The kata uses:
- Docker
- Docker compose plugin
- GNU make
Recommended:
See GitHub cloning a repository for details on how to create a local copy of this project on your computer.
git clone [email protected]:Redominus/crafters15-php.gitor
git clone https://github.com/Redominus/crafters15-php.gitInstall all the dependencies using docker
cd ./crafters15-php
make installEverything is handled by docker!
src- contains the two classes:Item.php- this class should not be changedGildedRose.php- this class needs to be refactored, and the new feature added
tests- contains the testsGildedRoseTest.php- starter test.- Tip: ApprovalTests has been included as a dev dependency, see the PHP version of the Theatrical Players Refactoring Kata for an example
Fixturetexttest_fixture.phpthis could be used by an ApprovalTests, or run from the command line
To run the fixture from the php directory:
make run-fixture days=10Change 10 to the required days.
PHPUnit is configured for testing, a composer script has been provided. To run the unit tests, from the root of the PHP project run:
make testsTo run all test and generate a html coverage report run:
make test-coverageThe test-coverage report will be created in /builds, it is best viewed by opening /builds/index.html in your browser.
Easy Coding Standard (ECS) is configured for style and code standards, PSR-12 is used. The current code is not upto standard!
To check code, but not fix errors:
make check-csECS provides may code fixes, automatically, if advised to run --fix, the following script can be run:
make fix-csPHPStan is used to run static analysis checks:
make phpstanHappy coding!