{"id":18783659,"url":"https://github.com/tomkyle/boilerplate-php","last_synced_at":"2025-11-06T23:03:53.202Z","repository":{"id":57071434,"uuid":"331942186","full_name":"tomkyle/boilerplate-php","owner":"tomkyle","description":"PHP package boilerplate. Automatically runs PHPUnit, PHPStan, Rector, and PHP-CS-Fixer on file changes.","archived":false,"fork":false,"pushed_at":"2025-06-28T17:24:21.000Z","size":207,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T16:25:08.329Z","etag":null,"topics":["package-development","php","php-boilerplate","php-cs-fixer","phpstan","phpunit","rector"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomkyle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-22T12:38:37.000Z","updated_at":"2025-06-28T17:24:24.000Z","dependencies_parsed_at":"2024-08-28T17:13:13.005Z","dependency_job_id":"9a445124-1acc-4538-bb58-7be6f5f40f51","html_url":"https://github.com/tomkyle/boilerplate-php","commit_stats":{"total_commits":59,"total_committers":1,"mean_commits":59.0,"dds":0.0,"last_synced_commit":"1c8cb169789cb1d23abac23758de1f67ae413534"},"previous_names":[],"tags_count":8,"template":true,"template_full_name":null,"purl":"pkg:github/tomkyle/boilerplate-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2Fboilerplate-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2Fboilerplate-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2Fboilerplate-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2Fboilerplate-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomkyle","download_url":"https://codeload.github.com/tomkyle/boilerplate-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2Fboilerplate-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283095890,"owners_count":26778518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-06T02:00:06.180Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["package-development","php","php-boilerplate","php-cs-fixer","phpstan","phpunit","rector"],"created_at":"2024-11-07T20:40:01.661Z","updated_at":"2025-11-06T23:03:53.196Z","avatar_url":"https://github.com/tomkyle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePHP Package Boilerplate\u003c/h1\u003e\n\n[![Composer Version](https://img.shields.io/packagist/v/tomkyle/boilerplate-php)](https://packagist.org/packages/tomkyle/boilerplate-php )\n[![PHP version](https://img.shields.io/packagist/php-v/tomkyle/boilerplate-php)](https://packagist.org/packages/tomkyle/boilerplate-php )\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/tomkyle/boilerplate-php/php.yml)](https://github.com/tomkyle/boilerplate-php/actions/workflows/php.yml)\n[![Packagist License](https://img.shields.io/packagist/l/tomkyle/boilerplate-php)](LICENSE)\n\n\n**A template repository for PHP package.**\n\n---\n\n## Start new project\n\n```bash\n$ composer create-project tomkyle/boilerplate-php new-project  \n$ cd new-project\n$ composer install\n$ npm install\n```\n\n### Initial setup\n\nOn first install, the `composer install` command will create two things:\n\n#### 1. Pre-commit hook\nThe _pre-commit_ hook runs the following checks before allowing any `git commit`:\n\n- [PHPUnit](https://phpunit.de/documentation.html) tests\n- [PHPStan](https://phpstan.org/) static analysis\n- [Rector](https://getrector.com/) to fix code style issues\n- [PHP CS Fixer](https://cs.symfony.com/) to format the code\t\n\n#### 2. Local PHP-CS-Fixer configuration\nWhile the `.php-cs-fixer.dist.php` in the repo basically sets **@PER-CS** as coding standard, the local `.php-cs-fixer.php` override sets the sophisticated **@PhpCsFixer** coding standard. Its opinionated rules are compatible with PER-CS. This setup matches _my_ taste but leaves room for customization.\n\n\n\n---\n\n## Requirements and suggestions\n\n| PSR standard                        | require                                                      | suggest                                                      |\n| ----------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| PSR-3 Logger implementation         | [psr/log](https://packagist.org/packages/psr/log)            | [Monolog Logger](https://github.com/Seldaek/monolog)         |\n| PSR-6 Cache Implementation          | [psr/cache](https://packagist.org/packages/psr/cache)        | [Symfony Cache component](https://symfony.com/components/Cache) |\n| PSR-17 HTTP factory* implementation | [psr/http-factory](https://packagist.org/packages/psr/http-factory) | [nyholm/psr7](nyholm/psr7)                                   |\n| PSR-18 HTTP client                  | [psr/http-client](https://packagist.org/packages/psr/http-client) | [Guzzle 7](https://packagist.org/packages/guzzlehttp/guzzle) |\n\n\n```bash\n$ composer require monolog/monolog\n$ composer require symfony/cache\n$ composer require nyholm/psr7\n$ composer require guzzlehttp/guzzle\n```\n\n\n\n---\n\n## Development\n\n\n### Watch PHP source code\n\nWatch the file system for PHP code changes. Unit and code quality tests are automatically triggered. To manually trigger a test run, see [package.json](package.json) for a list of all test tasks:\n\n```bash\n$ npm run watch\n```\n\nWhenever a PHP file is changed, the following tasks are run:\n\n- [PHPUnit](https://phpunit.de/documentation.html) test — only for [that very file](https://github.com/tomkyle/find-run-test)\n- [PHPStan](https://phpstan.org/) static analysis\n- [Rector](https://getrector.com/) to fix code style issues\n\n[PHP CS Fixer](https://cs.symfony.com/) is not automatically applied, but you can invoke it manually with `npm run phpcs` or `npm run phpcs:apply` to apply the changes. It will, however, automatically be executed on `git commit`.\n\n### Available npm scripts:\n\n\n```bash\n$ npm run\n```\n\n**Overview:**\n\n- **watch** watches `src/` and `tests/` directory\n- **phpstan** runs *PHPStan* static analysis \n- **phpcs** runs *PHP CS Fixer* as a dry run, use `phpcs:apply` to actually apply changes.\n- **rector**  runs *Rector* as a dry run, use `rector:apply` to actually apply changes.\n- **phpunit** runs *PHPUnit* tests with *textdox* and *coverage* report if available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fboilerplate-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomkyle%2Fboilerplate-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fboilerplate-php/lists"}