This is a project skeleton template for creating new PHP libraries within the JBZoo ecosystem. It's not a completed library but a standardized template that helps maintain consistency across JBZoo projects.
The skeleton includes:
- Modern PHP 8.2+ setup with strict typing
- Comprehensive testing framework integration
- Complete CI/CD pipeline configuration
- Integrated code quality tools (PHPStan, Psalm, PHP-CS-Fixer, etc.)
- JBZoo coding standards and conventions
- Create a new repository (MIT license, without .gitignore)
- Clone the skeleton:
git clone https://github.com/JBZoo/Skeleton-Php.git your-project-name cd your-project-name
- Initialize the project:
make update php create-new-project.php Project-Name make update
The initialization script will:
- Replace all template placeholders with your package name
- Rename template files to match your namespace
- Update composer.json and other configuration files
- Clean up skeleton-specific files
# Install/update dependencies
make update
# Develop cycle
make skel-test
# fix, commit, git reset --hard, repeat.
# Run all tests and code quality checks
make test-all
# Run individual tools
make test # PHPUnit tests
make codestyle # All linters
├── src/ # Main library code
├── tests/ # PHPUnit tests
├── create-new-project.php # Skeleton transformation script
├── Makefile # Build commands
├── phpunit.xml.dist # PHPUnit configuration
└── composer.json # Dependencies and autoloading
The skeleton uses placeholder tokens that get replaced during project creation:
__PACKAGE__
→ Your package name (e.g., "MyAwesomeLib")__NS__
→ Your namespace (e.g., "MyAwesomeLib")jbzoo/skeleton-php
→ Your composer package name
Template files that get renamed:
src/__NS__.php
→src/YourClassName.php
tests/__NS__Test.php
→tests/YourClassNameTest.php
- PHP 8.2 or higher
- Composer 2.0+
- Make (for build commands)
The skeleton includes comprehensive code quality tools:
- PHPUnit - Unit testing framework
- PHPStan - Static analysis (level max)
- Psalm - Additional static analysis
- PHP-CS-Fixer - Code style fixer
- PHPMD - Mess detector
- Phan - Static analyzer
All tools are pre-configured with JBZoo standards and integrate with CI/CD pipelines.
The skeleton includes GitHub Actions workflow that:
- Tests against multiple PHP versions
- Runs all quality assurance tools
- Generates coverage reports
- Validates composer configuration
MIT