This package calculates the Fibonacci number.
- PHP 7.4 or higher.
The package could be installed with composer:
composer require roslov/fibonacci#!/usr/bin/env php
<?php
declare(strict_types=1);
use Roslov\Fibonacci\Fibonacci;
require_once __DIR__ . '/vendor/autoload.php';
$fibonacciNumber = Fibonacci::calculate(10);
echo $fibonacciNumber;This will return:
55
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunitThe code style is analyzed with PHP_CodeSniffer and PSR-12 Ext coding standard. To run code style analysis:
./vendor/bin/phpcs --extensions=php --colors --standard=PSR12Ext --ignore=vendor/* -p -s .