Collection of QA tools and JBZoo code standards

2.16.1 2021-04-28 12:04 UTC


Build Status Coverage Status Psalm Coverage Scrutinizer Code Quality CodeFactor PHP Strict Types
Stable Version Latest Unstable Version Dependents GitHub Issues Total Downloads GitHub License

Provides popular tools and general code style standards for all JBZoo projects.


Add into your Makefile the line to have predefined commands like test-*, help, list, etc.

ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
    include ./vendor/jbzoo/codestyle/src/init.Makefile

update: ##@Project Install/Update all 3rd party dependencies
    $(call title,"Install/Update all 3rd party dependencies")
    @echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
    @composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)

test-all: ##@Project Run all project tests at once
    @make test
    @make codestyle

Makefile Build-in help

  - `make [target]`
  - `ENV_VAR=value make [target]`

  update                        Install/Update all 3rd party dependencies
  test-all                      Run all project tests at once
  clean                         Cleanup only build directory
  clean-vendor                  Cleanup all
  autoload                      Dump optimized autoload file for PHP
  build-phar                    Compile phar file

  report-all                    Build all reports at once
  report-phpqa                  PHPqa - Build user-friendly code reports
  report-coveralls              Send coverage report to coveralls.io
  report-merge-coverage         Merge all coverage reports in one clover file
  report-composer-diff          What has changed after a composer update
  update-extend                 Checks new compatible versions of 3rd party libraries
  report-composer-graph         Build composer graph of dependencies
  report-performance            Build performance summary report
  report-phpmetrics             Build PHP Metrics Report
  report-pdepend                Build PHP Depend Report
  report-phploc                 PHPloc - Show code stats

  test                          Runs unit-tests (alias "test-phpunit")
  test-phpunit                  Runs all codestyle linters at once
  codestyle                     Runs all codestyle linters at once
  test-composer                 Validates composer.json and composer.lock
  test-composer-reqs            Checks composer.json the defined dependencies against your code
  test-phpcs                    PHPcs - Checking PHP Code Sniffer (PSR-12 + PHP Compatibility)
  test-phpmd                    PHPmd - Mess Detector Checker
  test-phpmd-strict             PHPmd - Mess Detector Checker (strict mode)
  test-phpmnd                   PHPmnd - Magic Number Detector
  test-phpcpd                   PHPcpd - Find obvious Copy&Paste
  test-phpstan                  PHPStan - Static Analysis Tool
  test-psalm                    Psalm - static analysis tool for PHP
  test-phan                     Phan - super strict static analyzer for PHP
  test-performance              Run benchmarks and performance tests
  test-performance-travis       Travis wrapper for benchmarks
  help                          Show this text
  list                          Full list of targets

Trick: Add into your "~/.bash_aliases" the line "complete -W "\`make list\`" make" to use TAB