Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
/ php-skel Public archive

A very opinionated PHP Skeleton for Projects and Libraries

License

Notifications You must be signed in to change notification settings

flavioheleno/php-skel

Repository files navigation

php-skel

A very opinionated PHP Skeleton for Projects and Libraries

Distribution

This skeleton has two distributions: project and library.

Project

Use the following files:

Update the composer.json accordingly.

Conventions:

  1. Application namespace is: App\;
  2. Tests are split into Unit Tests (tests/unit) and Integration Tests (tests/integration).

Library

Use the following files:

Update the composer.json accordingly.

Conventions:

  1. Tests are grouped as a suite in tests/.

Configuration files

The following configuration files are available:

Composer scripts

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

Workflows

Continuous Integration

Executes project test suite using phpunit/phpunit on push and pull request events.

Workflow configuration: .github/workflows/continuous-integration.yml.

Static Analysis

Executes static code analysis using phpstan/phpstan on push and pull request events.

Workflow configuration: .github/workflows/static-analysis.yml.

Template sync

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

License

This project is licensed under the MIT License.