All Projects → xthiago → php-skeleton

xthiago / php-skeleton

Licence: MIT License
A skeleton to start new high-quality PHP projects without worrying about bootstrapping everything from scratch.

Programming Languages

Dockerfile
14818 projects
PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to php-skeleton

noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (+126.09%)
Mutual labels:  phpunit, phpstan, github-actions
slim-skeleton
Slim Framework skeleton application following MVC construction
Stars: ✭ 18 (-21.74%)
Mutual labels:  skeleton, phpunit, phpcs
annotate-pull-request-from-checkstyle
cs2pr - Annotate a GitHub Pull Request based on a Checkstyle XML-report within your GitHub Action
Stars: ✭ 146 (+534.78%)
Mutual labels:  phpunit, phpcs, phpstan
php-toolbox
🐳 A Docker image designed for PHP developers that care about code quality.
Stars: ✭ 18 (-21.74%)
Mutual labels:  phpunit, phpstan
Tester
Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏
Stars: ✭ 281 (+1121.74%)
Mutual labels:  xdebug, phpunit
phpstan-ga
GithubAction for PHPStan
Stars: ✭ 85 (+269.57%)
Mutual labels:  phpstan, github-actions
Pdt
PHP Development Tools project (PDT)
Stars: ✭ 135 (+486.96%)
Mutual labels:  xdebug, phpunit
CI-Report-Converter
The tool converts different error reporting standards for deep compatibility with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc).
Stars: ✭ 17 (-26.09%)
Mutual labels:  phpcs, phpstan
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (+386.96%)
Mutual labels:  github-actions
CIAnalyzer
A tool collecting multi CI services build data and export it for creating self-hosting build dashboard.
Stars: ✭ 52 (+126.09%)
Mutual labels:  github-actions
redis-github-action
Use Redis in GitHub Actions
Stars: ✭ 56 (+143.48%)
Mutual labels:  github-actions
jcefbuild
Binary builds of java-cef
Stars: ✭ 160 (+595.65%)
Mutual labels:  github-actions
cakephpvue-spa
A CakePHP + VueJS single page application skeleton/boilerplate.
Stars: ✭ 40 (+73.91%)
Mutual labels:  skeleton
sentry
GitHub Actions for interacting with Sentry.io
Stars: ✭ 14 (-39.13%)
Mutual labels:  github-actions
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (+8.7%)
Mutual labels:  github-actions
commit-comment
A GitHub action to create a comment for a commit on GitHub
Stars: ✭ 62 (+169.57%)
Mutual labels:  github-actions
Github-Actions-React-Native
Github Action for React Native Build 🦊
Stars: ✭ 99 (+330.43%)
Mutual labels:  github-actions
args
Array arguments made bearable
Stars: ✭ 71 (+208.7%)
Mutual labels:  phpstan
netbox-plugin-skeleton
Skeleton for starting NetBox plugins
Stars: ✭ 15 (-34.78%)
Mutual labels:  skeleton
cfn-lint-action
GitHub Action for interacting with CloudFormation Linter
Stars: ✭ 41 (+78.26%)
Mutual labels:  github-actions

php-skeleton

A skeleton to start new high-quality PHP projects without worrying about bootstrapping everything from scratch.

Features

The skeleton includes a PHP project properly configured with:

  • 🛠 Docker and docker-compose - because nobody wants (or should) to install project dependencies directly into their machines.
  • 🎉 PHP 7.4
  • 🕵 Xdebug - to stop wasting time printing values and start debugging PHP applications like a boss‍️.
  • 🚦PHPUnit - to write and run unit tests and also generate code coverage.
  • 🏎 PHP Parallel Lint - to check syntax of PHP files.
  • 📋 phpcs - to ensure good coding standards.
  • 👻 phpstan - to find errors in the code before running it.
  • 🚀 Continuous Integration - to ensure the previous tools runs for every contribution to your repository.

Stop wasting time! 🏝🍹

Requirements

Install

  1. Make sure you have the requirements described above.
  2. Clone this repository: git clone [email protected]:xthiago/php-skeleton.git
  3. Run docker-compose run php composer install to install the PHP dependencies.
  4. If you are using Linux, go to the next step. If you are using Docker for Mac or Windows, create a .env file (I suggest you copy from distribution version with cp .env.dist .env) and add XDEBUG_REMOTE_HOST=host.docker.internal). It is needed in order to allow Xdebug to connect back to the IDE in these OS.
  5. (optional) You can configure the Xdebug in your editor/IDE in order to debug this application using it. See the guide.
  6. That's all 😜.

Usage

Web application

In order to start the web application, you must create and start the PHP service:

docker-compose up -d

Then you can open https://localhost:8000 in your browser. It will open web/index.php file.

For troubleshooting, you can watch the logs to see what's going on:

docker-compose logs -f

See docker-compose --help to get more instructions.

Command line

You can access the terminal of PHP container with:

docker-compose exec php ash

You can also execute any command in PHP container from outside it typing and running:

docker-compose run php [command-name]
# Example: docker-compose run php

--help

Available commands

You can run any available commands inside the PHP container:

  • parallel-lint --exclude vendor . to check the PHP syntax.
  • phpcs - to check the codebase against code standards
    • the configuration is automatically inherited from phpcs.xml.
  • phpstan analyse to run a static analyse in the codebase
    • the configuration is automatically inherited from phpstan.neon.
  • phpunit to run the unit tests
    • the configuration is automatically inherited from phpunit.xml
  • composer test to run all commands above.
  • phpunit --coverage-html reports/ to generate code coverage of tests
    • the configuration is automatically inherited from phpunit.xml
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].