Skip to content

parf/composer-php8-template

Repository files navigation

PHP8/8.1 composer/packagist package template

INSTALL / How to Use:

  • composer create-project parf/composer-php8-template your-project-name
  • edit composer.json
  • run composer install

Provides:

  • ready to use Composer Package Template for php 8/8.1 projects
  • commonly used php tools (see list below)
  • default tools configurations
  • useful scripts

Provided Php-Tools

tools install instructions

Scripts

composer test
run unit tests. use test-q to run tests silently (show errors only)

composer psalm
check code with psalm

composer stan
check code with php-stan (default level is 6)

composer lint
php syntax check

composer psalm-dry / composer psalm-fix (aka psalter)
review/apply suggested code changes by psalm, be careful always do dry-run first

composer cs-dry / composer cs-fix
review/apply suggested code changes by php-cs-fixer, be careful always do dry-run first

composer doc
generate phpDocumentor documentation in doc folder

./check
do all checks: lint, unit tests, psalm, php-stan; stops when any of them failed

./check-commit, ./check-push
do ./check, add all new files to git, do git commit -v -s and git push --tags

./psysh php cli shell
notable commands: wtf, doc Class, doc Class::method, show Class::method, ls -l ClassName, help

see composer.json scripts section for more scripts shortcuts

About

PHP8/8.1 composer/packagist package template

Resources

License

Stars

Watchers

Forks

Packages

No packages published