API
note
📣 All commands have to be run in the api
service (make api
).
#
PHP_CodeSnifferPHP_CodeSniffer is both a linting and a formatting tool.
The boilerplate adds the rules from the Doctrine Coding Standard.
It will parse your PHP source code, catch common mistakes plus format it.
It's quite strict, but that's for your good! 😁
This command will try to fix and format your source code:
This command will verify your source code:
#
PHPStanPHPStan is a static analysis tool that focuses on finding errors in your code without actually running it.
In the boilerplate, we set it to the maximum level.
#
DeptracDeptrac is a static code analysis tool that enforces rules for dependencies between software layers in your PHP projects.
In other words, il will ensure that:
- You don't call the classes from the
Instrastructure
namespace outside of itself. - You don't call the classes from the
UseCase
namespace in theDomain
namespace.
#
YAML configurationSymfony provides a linter that checks common errors in YAML files:
#
Composer normalizeComposer normalize normalizes your composer.json file's structure: