https://github.com/sci3ma/symfony-grumphp
Configured GrumPHP with bunch of tools for static code analysis Symfony Framework
https://github.com/sci3ma/symfony-grumphp
clean-code code-quality grumphp phmd php-cs-fixer phpstan phpunit standards static-analysis symfony symfony-grumphp
Last synced: 5 days ago
JSON representation
Configured GrumPHP with bunch of tools for static code analysis Symfony Framework
- Host: GitHub
- URL: https://github.com/sci3ma/symfony-grumphp
- Owner: sci3ma
- License: mit
- Created: 2019-03-01T20:36:43.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-22T17:10:54.000Z (about 4 years ago)
- Last Synced: 2025-03-29T13:51:17.945Z (26 days ago)
- Topics: clean-code, code-quality, grumphp, phmd, php-cs-fixer, phpstan, phpunit, standards, static-analysis, symfony, symfony-grumphp
- Language: PHP
- Homepage:
- Size: 200 KB
- Stars: 17
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Symfony + GrumPHP
`symfony-grumphp` is configured GrumPHP with bunch of tools for static code analysis mainly based on [PSRs](https://www.php-fig.org/psr/) and [Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html) for Symfony Framework projects.
[](https://github.com/sci3ma/symfony-grumphp)
[](https://github.com/sci3ma/symfony-grumphp/blob/master/LICENSE)
[](https://packagist.org/packages/sci3ma/symfony-grumphp/stats)
[](https://github.com/sci3ma/symfony-grumphp/commits/master)
[](https://travis-ci.com/sci3ma/symfony-grumphp)
[](https://coveralls.io/github/sci3ma/symfony-grumphp)## Included tools
* [GrumPHP](https://github.com/phpro/grumphp): `phpro/grumphp`
* [PhpCpd](https://github.com/sebastianbergmann/phpcpd): `sebastian/phpcpd`
* [PHP-CS-FIXER](https://github.com/FriendsOfPHP/PHP-CS-Fixer): `friendsofphp/php-cs-fixer`
* [PHPLint](https://github.com/php-parallel-lint/PHP-Parallel-Lint): `php-parallel-lint/php-parallel-lint`
* [PhpMd](https://github.com/phpmd/phpmd): `phpmd/phpmd`
* [PHPStan](https://github.com/phpstan/phpstan): `phpstan/phpstan`
* [Doctrine extension](https://github.com/phpstan/phpstan-doctrine): `phpstan/phpstan-doctrine`
* [PHPUnit extension](https://github.com/phpstan/phpstan-phpunit): `phpstan/phpstan-phpunit`
* [Symfony Framework extension](https://github.com/phpstan/phpstan-symfony): `phpstan/phpstan-symfony`
* [TheCodingMachine's additional rules](https://github.com/thecodingmachine/phpstan-strict-rules): `thecodingmachine/phpstan-strict-rules`
* [PHPUnit Bridge](https://github.com/symfony/phpunit-bridge): `symfony/phpunit-bridge`
* With Clover Coverage and percentage code coverage check
* [Enlightn Security Checker](https://github.com/enlightn/security-checker): `enlightn/security-checker`## Requirements
PHP needs to be a minimum version of PHP 7.3.
Symfony Framework needs to be a minimum version of Symfony Framework 4.0 or 5.0.## Installation
To install `symfony-grumphp`, [install Composer](https://getcomposer.org/download/), execute the following command:
```
composer require --dev sci3ma/symfony-grumphp
```
and create (or update) configuration files:
```
./vendor/bin/symfony-grumphp install
```## Configuration
You can, and perhaps you should, check and customize all configured tasks in `grumphp.yml` file in project root folder.GrumPHP should be enabled by default but you can also enable GrumPHP yourself:
```
./vendor/bin/grumphp git:init
```
or disable GrumPHP:
```
./vendor/bin/grumphp git:deinit
```
You can find more GrumPHP configuration [here](https://github.com/phpro/grumphp/blob/master/doc/commands.md#installation).##### Test code with the database
If you need to test code that interact with the database you need to instal [`dama/doctrine-test-bundle`](https://github.com/dmaicher/doctrine-test-bundle):
```
composer require --dev dama/doctrine-test-bundle
```
and uncomment extension `` in `phpunit.xml.dist`.
Read more about [how to Test Code that Interacts with the Database](https://symfony.com/doc/current/testing/database.html)## Uninstall
If you want to uninstall this library remove configuration files first:
```
./vendor/bin/symfony-grumphp uninstall
```
then remove package:
```
composer remove sci3ma/symfony-grumphp
```## Force run
You can run tests/checks our code without commit manually:
```
./vendor/bin/grumphp run
```