A minimal and flexible PHP template to kickstart your PHP projects, including development tools for linting, testing, and ensuring code quality. Designed to help you get started quickly and maintain best practices.
- Composer for dependency management
- PHPUnit for unit testing
- PHP Code Sniffer for enforcing coding standards
- PHPStan for static analysis
- Fully PSR-12 compliant
- Suggested VSCode extensions for an optimized development environment
- PHP 8.1.10 or higher
- Composer (latest version)
- Git for cloning the repository
- Optional: VSCode with suggested extensions
-
Clone the repository:
git clone https://github.com/salsan/PHP.git cd PHP -
Install dependencies via Composer:
composer install
-
Run tests to ensure everything is set up correctly:
./vendor/bin/phpunit
- Start writing your PHP code in the
src/directory. - Add your tests in the
tests/directory. - Run the following commands to ensure code quality:
# Run PHPUnit tests ./vendor/bin/phpunit # Run PHP Code Sniffer ./vendor/bin/phpcs # Run PHPStan ./vendor/bin/phpstan analyse src tests
.
├── src/ # Your source code
├── tests/ # Test files
├── vendor/ # Composer dependencies
├── .gitignore
├── .phpcs.xml # PHP Code Sniffer configuration
├── composer.json
├── phpstan.neon # PHPStan configuration
├── phpunit.xml # PHPUnit configuration
└── README.md
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name - Make your changes and commit them:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a pull request with a clear description of your changes.
Please make sure to follow PSR-12 coding standards and add tests for new features.
If you encounter any issues or bugs, please open an issue on the GitHub repository.
This project is licensed under the MIT License.