FooBar is a known challenge in computer world that consist in follwing test:
Write a program that prints the numbers from 1 to 100. But for multiples of
three print "Foo" instead of the number and for the multiples of five print
"Bar". For numbers which are multiples of both three and five print "FooBar".
- PHP 5.6+
- Composer
Run $ composer install
to generate autoload and install development dependencies.
To run this code, you just need to execute the following command:
$ php index.php
Run $ composer test
.
Run $ composer run phpcs
.
Run $ composer run phpmd
.
Run $ composer run lint
.
You can use docker instead of php and composer. To run project using docker, you just need to replace
$ php ...
for
$ docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) php:7.2-cli-alpine php ...
.
To run tests and linters, you need to replace
$ composer ...
for
$ docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) composer composer ...
.