koriym / php-skeleton
Generic PHP project skeleton package
Installs: 3 876
Dependents: 0
Suggesters: 0
Security: 0
Stars: 182
Watchers: 18
Forks: 27
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- composer/composer: ^2.8
- phpunit/phpunit: ^10.5
- 1.x-dev
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-alpha
- 0.9.0
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.1
- 0.8.0
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.5.1
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-dep
- dev-sa
- dev-gh-action
- dev-bump
This package is auto-updated.
Last update: 2025-03-04 08:31:52 UTC
README
Are you tired of copy-pasting your boilerplate PHP code whenever you need to start a new project?
This repository contains a single-line command that will automatically setup for you all the needed code to create a modern, clutter-free and test-oriented PHP package.
It will automatically install the following dependencies:
- PHPUnit: provides testing framework.
- PHP_CodeSniffer: detects violations of a defined set of coding standards.
- PHPMD: analyze your code to detect sub-optimal or overly complex code.
- PHPStan: discover bugs in your code without running it.
- Psalm: - another static analysis tool from Vimeo.
- PHPMetrics provides various metrics.
- ComposerRequireChecker Check composer dependencies.
Project Structure
After installation, your project will have the following structure:
your-project/
├── src/ # Source code
├── tests/ # Test files
│ └── Fake/ # Test doubles
├── vendor/ # Dependencies
├── vendor-bin/ # Development tool dependencies
├── build/ # Build artifacts (coverage reports, etc.)
├── composer.json # Project configuration
├── phpcs.xml # PHP_CodeSniffer configuration
├── phpmd.xml # PHPMD configuration
├── phpstan.neon # PHPStan configuration
├── phpunit.xml.dist # PHPUnit configuration
├── psalm.xml # Psalm configuration
├── composer-require-checker.json # Composer dependencies checker configuration
└── README.md # Project documentation
Create Project
To create your project, enter the following command in your console:
composer create-project koriym/php-skeleton <project-path>
You will be asked a few questions to configure the project:
What is the vendor name ?
(MyVendor):Koriym
What is the package name ?
(MyPackage):AwesomePackage
What is your name ?
(Akihito Koriyama):
What is your email address ?
(akihito.koriyama@gmail.com):
Composer Commands
Once installed, the project will automatically be configured, so you can run these commands in the root of your application:
test
composer test
runs phpunit
.
tests
composer tests
runs cs
, sa
, and test
.
coverage, phpdbg, pcov
composer coverage
builds a test coverage report using XDebug.
composer phpdbg
builds a test coverage report using phpdbg.
composer pcov
builds a test coverage report using pcov.
cs, cs-fix
composer cs
checks coding standard.
composer cs-fix
fixes the PHP code to match coding standards.
sa
composer sa
runs static code analysis tools (PHPStan and Psalm).
metrics
composer metrics
generates code quality metrics.
build
composer build
builds all reports (code quality, test coverage, require check, metrics).
Continuous Integration
This project includes several GitHub Actions workflows to ensure code quality and compatibility. These workflows are pre-configured for common PHP project needs, but feel free to modify or remove them to suit your project's requirements.