esi / php-project-template
Simple template repository for PHP libraries/projects.
Fund package maintenance!
ko-fi.com/ericsizemore
ericsizemore
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 2
Type:project
Requires
- php: >=8.2
Requires (Dev)
- esi/phpunit-coverage-check: ^2.0
- friendsofphp/php-cs-fixer: ^3.65
- infection/infection: ^0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.5
- psalm/plugin-phpunit: ^0.19.0
- rector/rector: ^2.0
- vimeo/psalm: dev-master
This package is auto-updated.
Last update: 2024-12-23 03:35:34 UTC
README
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.
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`.
Installation
You can install the package via composer:
$ composer create-project ericsizemore/php-project-template YOUR-PROJECT-NAME
You can also create a repository from this template on GitHub.
Workflow Setup
The continuous-integration.yml
workflow expects the project to exist on Scrutinizer so that it can upload coverage reports.
It also makes use of CodeCov, so it will require a new repository/action secret named CODECOV_TOKEN
.
Renovate
is used to handle automated updating of composer
dependencies with a config file at renovate.json
. A 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 named MERGE_TOKEN
.
# 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
workflow sends mutation coverage (handled with Infection) information to Stryker and requires a new repository/action secret named STRYKER_DASHBOARD_API_KEY
.
Usage
// usage information here
About
Requirements
- PHP >= 8.2
Credits
- Eric Sizemore
- All Contributors
- Special thanks to JetBrains for their Licenses for Open Source Development.
Available Tools
See Available Tools.
Contributing
See CONTRIBUTING.
Bugs and feature requests are tracked on GitHub.
Contributor Covenant Code of Conduct
Backward Compatibility Promise
See backward-compatibility.md for more information on Backwards Compatibility.
Changelog
See the CHANGELOG for more information on what has changed recently.
License
See the LICENSE for more information on the license that applies to this project.
Security
See SECURITY for more information on the security disclosure process.