Strict and modern kit to optimise the codebase defensively.
composer require --dev quartetcom/static-analysis-kit:~8.2
./vendor/bin/static-analysis-kit installNote
Replace~8.2with the PHP version you want to use. Refer Versioning for details.
The project will be automatically optimised by answering the questions.
Version of this package follows the PHP version that which is supported.
For example, if you want to use in a PHP 8.2 project, use in range of ~8.2.
- Change code
- Run "Reformat Code" (%L) in PhpStorm
- Confirm there are no errors (will be highlighted on the scroll bar)
- Run
composer analyse - Problems about formatting can be resolved by
composer fix - The remaining problems should caused by the code, so fix them manually
(You can run
composer fix:riskyorcomposer fix:rectorto resolve them, but this causes code breaks; be careful of the diff after run) - Commit after confirmed there are no errors by running
composer analyse