Skip to content

27: Cleaned up code #81

27: Cleaned up code

27: Cleaned up code #81

Workflow file for this run

# Do not edit this file! Make a pull request on changing
# github/workflows/symfony/php.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.
### ### Symfony PHP
###
### Checks that PHP code adheres to the [Symfony coding
### standards](https://symfony.com/doc/current/contributing/code/standards.html).
###
### #### Assumptions
###
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
### run inside the `phpfpm` service. 2.
### [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
### is a dev requirement in `composer.json`:
###
### ``` shell
### docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
### ```
###
### Clean up and check code by running
###
### ``` shell
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
### ```
###
### > [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration
### > file for PHP CS
### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
### > and this makes it possible to override the actual configuration used in a
### > project by adding a more important configuration file, `.php-cs-fixer.php`.
name: Symfony PHP
env:
COMPOSE_USER: root
on:
pull_request:
push:
branches:
- main
- develop
jobs:
coding-standards:
name: PHP - Check Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --rm phpfpm composer install
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff