{"id":13616287,"url":"https://github.com/IngeniozIT/php-skeleton","last_synced_at":"2025-04-14T00:32:01.251Z","repository":{"id":152069310,"uuid":"625257810","full_name":"IngeniozIT/php-skeleton","owner":"IngeniozIT","description":"A clean new PHP project","archived":false,"fork":false,"pushed_at":"2024-02-25T13:11:13.000Z","size":50,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-08T16:16:00.266Z","etag":null,"topics":["clean-code","php","skeleton","testing"],"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/IngeniozIT.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}},"created_at":"2023-04-08T14:54:55.000Z","updated_at":"2024-08-20T14:12:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"4228cfb9-3c65-4a1e-a2b2-73413086b181","html_url":"https://github.com/IngeniozIT/php-skeleton","commit_stats":null,"previous_names":[],"tags_count":7,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IngeniozIT%2Fphp-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IngeniozIT%2Fphp-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IngeniozIT%2Fphp-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IngeniozIT%2Fphp-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IngeniozIT","download_url":"https://codeload.github.com/IngeniozIT/php-skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"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","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":["clean-code","php","skeleton","testing"],"created_at":"2024-08-01T20:01:26.401Z","updated_at":"2025-04-14T00:32:00.906Z","avatar_url":"https://github.com/IngeniozIT.png","language":"PHP","funding_links":[],"categories":["Dockerfile","Makefile"],"sub_categories":[],"readme":"# PHP skeleton\n\n\u003e Bored of manually setting up your PHP projects ?  \n\u003e This is the solution !\n\n## Table of contents\n\n- [Description](#description)\n- [Installation](#installation)\n- [Requirements](#requirements)\n- [Getting started](#getting-started)\n- [Code quality](#code-quality)\n- [Docker](#docker)\n- [Customize your app](#customize-your-app)\n\n## Description\n\nThis is a skeleton for PHP projects that focus on **code quality**.   \nIt contains pretty much everything you need to start a new project :\n\n- **Code quality**\n  - A working unit test (using [PHPUnit](https://github.com/sebastianbergmann/phpunit)) to bootstrap your coding experience\n  - Static analyis tools ([phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpstan](https://github.com/phpstan/phpstan), [psalm](https://github.com/vimeo/psalm), [phpmd](https://github.com/phpmd/phpmd) and [phan](https://github.com/phan/phan)) to enforce the quality of your code\n  - A mutation testing framework ([Infection](https://github.com/infection/infection)) to enforce the quality of your tests\n  - An automated refactoring tool ([Rector](https://github.com/rectorphp/rector)) to help you keep your code up to date\n  - Composer scripts to easily use all the above\n- **Infra**\n  - Docker support\n    - A Makefile to manage docker commands with ease\n  - GitHub workflows to automatically run the tests and quality tools on every push and pull request\n    - It also uploads a code coverage report to [CodeCov](https://codecov.io/)\n\n## Installation\n\nTo create a new project based on this skeleton, run the following command:\n\n```bash\ncomposer create-project ingenioz-it/php-skeleton {PROJECT_NAME}\n```\n\n## Requirements\n\n- docker\n- make (optional)\n\nOR\n\n- PHP 8.2 or higher\n- composer\n- xdebug\n\n## Getting started\n\nI suggest you run the full set of tests to make sure everything is working correctly:\n\n### 1. Move to your new project.\n\n```bash\ncd {PROJECT_NAME}\n```\n\n### 2. Setup the project\n\n#### If you are using Docker\n\n```bash\nmake build \u0026\u0026 make start \u0026\u0026 make cli\n```\n\n*This will build the Docker image and start a shell inside the container (use `exit` to go back to your local terminal).*\n\n#### If you are NOT using Docker\n\n```bash\ncomposer install\n```\n\n### 3. Finally, run the tests\n\n```bash\ncomposer fulltest\n```\n\nThe last line should be:\n\n```\nOK\n```\n\n**You are now ready to start coding !**\n\n## Code quality\n\nThe project comes with a few useful composer scripts to help you work with it.\n\nYou can view their description inside the `composer.json` file (look for `scripts-descriptions`), but here is a quick overview of the main ones:\n\n- `composer serve`: Runs a local web server on port 8000. Run this command and go to http://localhost:8000 to see the magic happen.\n- `composer testdox`: Runs the unit tests using the `testdox` format (it's better looking than the default one).\n- `composer coverage-html`: Generates a code coverage report in HTML format inside the `doc/` directory.\n- `composer quality:infection`: Generates a mutation testing report in HTML format at `tmp/infection.html`.\n- `composer quality:clean`: Runs phpcbf to automatically fix code formatting issues.\n- `composer quality:refactor`: Runs Rector to automatically refactor your code. **Warning:** This is a very powerful tool that can break your code. Use `composer quality:refactor-dry` to preview the changes before applying them.\n- `composer fulltest`: Runs the full set of tests (unit tests, static analysis tools and mutation testing).\n\n## Docker\n\nThe project comes with a `Makefile` to help you manage your Docker container:\n\n- `make build` : Builds the Docker image\n- `make start` : Starts the Docker container (go to http://localhost:8080 to see your app live)\n- `make stop` : Stops the Docker container\n- `make restart` : Restarts the Docker container\n- `make rebuild` : Rebuilds the Docker image and restarts the container\n- `make remove` : Removes the Docker container\n- `make cli` : Access a command line the container (useful to run the various composer scripts)\n- `make logs` : Displays the logs of the Docker container\n- `make clean` : Cleans the docker environment\n\n## Customize your app\n\nMake the project truly yours by doing the following:\n\n- [ ] Update the `composer.json` with your project's information\n- [ ] Update the `README.md` file to describe your project\n- [ ] Update the `LICENSE` file with your favorite license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIngeniozIT%2Fphp-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIngeniozIT%2Fphp-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIngeniozIT%2Fphp-skeleton/lists"}