https://github.com/ericsizemore/php-project-template
Simple template repository for PHP libraries/projects.
https://github.com/ericsizemore/php-project-template
php php-library php-library-template php-project php-project-template
Last synced: 7 months ago
JSON representation
Simple template repository for PHP libraries/projects.
- Host: GitHub
- URL: https://github.com/ericsizemore/php-project-template
- Owner: ericsizemore
- License: mit
- Created: 2024-11-05T01:48:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-06T21:12:02.000Z (7 months ago)
- Last Synced: 2025-09-06T22:14:12.511Z (7 months ago)
- Topics: php, php-library, php-library-template, php-project, php-project-template
- Language: PHP
- Homepage:
- Size: 637 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# PHP Project Template
[](https://scrutinizer-ci.com/g/ericsizemore/php-project-template/build-status/main)
[](https://scrutinizer-ci.com/g/ericsizemore/php-project-template/?branch=main)
[](https://scrutinizer-ci.com/g/ericsizemore/php-project-template/?branch=main)
[](https://github.com/ericsizemore/php-project-template/actions/workflows/continuous-integration.yml)
[](https://shepherd.dev/github/ericsizemore/php-project-template)
[](https://shepherd.dev/github/ericsizemore/php-project-template)
[](https://dashboard.stryker-mutator.io/reports/github.com/ericsizemore/php-project-template/main)
[](https://packagist.org/packages/esi/php-project-template)
[](https://packagist.org/packages/esi/php-project-template)
[](https://packagist.org/packages/esi/php-project-template)
`ericsizemore/php-project-template` started as a template to be used for my own future repos/libraries, with the goal of eventually bringing my current repos to parity with this setup.
This package can be used to create a basic PHP library package/repository, complete with a directory structure and starting files (i.e., README, LICENSE, issue templates, PHPUnit configuration, etc.) commonly found in PHP libraries.
> [!IMPORTANT]
> Once you create a new repository based on this template, or a project if via Composer, it is important
> that you change all mention of 'esi/php-project-template' and 'ericsizemore/php-project-template' to
> your `vendor/library` and `github-username/repository` name.
>
> Obviously, this is also necessary for the `vendor\namespace` and filenames inside the `src` and `tests` folders.
> It is also important to setup and modify workflows per [Workflow Setup](#workflow-setup).
> [!NOTE]
> Files that may need changed per the above `IMPORTANT` information: all files within the `.github` directory, `composer.json`,
> `$header` block in `.php-cs-fixer.dist.php`, `CONTRIBUTING.md`, `LICENSE`, `README.md`, and `SECURITY.md`.
> [!NOTE]
> The issue templates in `.github/ISSUE_TEMPLATE`, the pull request template at `.github/pull_request_template.md`, and the
> Renovate config at `renovate.json` assume you have created labels for: `bug`, `dependency`, enhancement`, `fix`, `unverified`,
> and `verified`.
> [!NOTE]
> You should replace the contents of the included `.gitattributes` file with the contents of `.gitattributes.template`
> for proper export ignores, etc.
## Installation
You can install the package via composer:
``` bash
$ composer create-project ericsizemore/php-project-template YOUR-PROJECT-NAME
```
You can also [create a repository from this template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) on GitHub.
**If you still need PHP 8.2 support, install v1.0.x of this project.**
### Workflow Setup
The [`continuous-integration.yml`](.github/workflows/continuous-integration.yml) workflow expects the project to exist on [Scrutinizer](https://scrutinizer-ci.com) so that it can upload coverage reports.
It also makes use of [CodeCov](https://about.codecov.io), so it will require a new [repository/action secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) named `CODECOV_TOKEN`.
[`Renovate`](https://github.com/apps/renovate) is used to handle automated updating of `composer` dependencies with a config file at `renovate.json`. A [`merge-me.yml`](.github/workflows/merge-me.yml) workflow is provided to automatically merge PR's created by Renovate. This requires `Allow auto-merge` to be enabled in repository settings, and a new [repository/action secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) named `MERGE_TOKEN`.
```bash
# Create a token with repository permissions:
# https://github.com/settings/tokens/new?scopes=repo&description=Merge+Me!+GitHub+Actions+Workflow
#
# Set MERGE_TOKEN as an environment variable on your repository:
# https://github.com/yourname/repo-name/settings/secrets/actions/new
```
The `mutation-test` portion of the [`continuous-integration.yml`](.github/workflows/continuous-integration.yml) workflow sends mutation coverage (handled with [Infection](https://github.com/infection/infection)) information to [Stryker](https://dashboard.stryker-mutator.io) and requires a new [repository/action secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) named `STRYKER_DASHBOARD_API_KEY`.
## Usage
```php
// usage information here
```
## About
### Requirements
* PHP >= 8.3
### Credits
- [Eric Sizemore](https://github.com/ericsizemore)
- [All Contributors](https://github.com/ericsizemore/php-project-template/contributors)
### Available Tools
See [Available Tools](./docs/available-tools.md).
### Contributing
See [CONTRIBUTING](./CONTRIBUTING.md).
Bugs and feature requests are tracked on [GitHub](https://github.com/ericsizemore/php-project-template/issues).
### Contributor Covenant Code of Conduct
See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
### Backward Compatibility Promise
See [backward-compatibility.md](./backward-compatibility.md) for more information on Backwards Compatibility.
### Changelog
See the [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.
### License
See the [LICENSE](./LICENSE) for more information on the license that applies to this project.
### Security
See [SECURITY](./SECURITY.md) for more information on the security disclosure process.