A very opinionated PHP Skeleton for Projects and Libraries
This skeleton has two distributions: project and library.
Use the following files:
Update the composer.json
accordingly.
Conventions:
- Application namespace is:
App\
; - Tests are split into Unit Tests (
tests/unit
) and Integration Tests (tests/integration
).
Use the following files:
Update the composer.json
accordingly.
Conventions:
- Tests are grouped as a suite in
tests/
.
The following configuration files are available:
- phpunit-lib.xml.dist: PHPUnit configuration for Libraries;
- phpunit-proj.xml.dist: PHPUnit configuration for Projects;
- psaml.xml.dist: Psalm configuration;
- ruleset.xml.dist: A copy of flavioheleno/phpcs-ruleset.
Composer has helper scripts for executing common tasks as seen below.
Script | Description |
---|---|
console | Uses psy/psysh to run an interactive shell |
infection | Uses infection/infection as mutation test framework |
lint | Uses php-parallel-lint/php-parallel-lint to lint source code |
phpcs | Uses squizlabs/php_codesniffer to check coding style |
phpstan | Uses phpstan/phpstan as static analyser |
phpunit | Uses phpunit/phpunit as test framework |
psalm | Uses vimeo/psalm to check for tainted strings |
test-ci | Runs library test suite (for continuous integration) |
test-coverage | Runs test-coverage analysis |
test | Runs infection, lint, phpcs, phpstan, phpunit and psalm |
Executes project test suite using phpunit/phpunit on push and pull request events.
Workflow configuration: .github/workflows/continuous-integration.yml
.
Executes static code analysis using phpstan/phpstan on push and pull request events.
Workflow configuration: .github/workflows/static-analysis.yml
.
Periodically checks for changes in flavioheleno/php-skel and, if there are any, creates or updates a pull request in this repository to review the changes.
Workflow configuration: .github/workflows/template-sync.yml
.
Source: solvaholic/template
This project is licensed under the MIT License.