Skip to content

salsan/PHP

Repository files navigation

PHP Template

PHP Template Logo

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.

PHP License Composer

Features

Requirements

  • PHP 8.1.10 or higher
  • Composer (latest version)
  • Git for cloning the repository
  • Optional: VSCode with suggested extensions

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/salsan/PHP.git
    cd PHP
  2. Install dependencies via Composer:

    composer install
  3. Run tests to ensure everything is set up correctly:

    ./vendor/bin/phpunit

Usage

  1. Start writing your PHP code in the src/ directory.
  2. Add your tests in the tests/ directory.
  3. 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

Project Structure

.
├── 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

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix: git checkout -b feature/your-feature-name
  3. Make your changes and commit them: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. 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.

Bug Reports

If you encounter any issues or bugs, please open an issue on the GitHub repository.

License

This project is licensed under the MIT License.

About

This is a template created for my projects in PHP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published