akeneo / php-coupling-detector
Detect all the coupling issues of your project with respect to the coupling rules you have defined.
Installs: 1 047 659
Dependents: 2
Suggesters: 0
Security: 0
Stars: 42
Watchers: 37
Forks: 6
Open Issues: 19
Requires
- php: ^7.2||^8.0
- friendsofphp/php-cs-fixer: ^2.1||^3.0
- symfony/console: ^4.4||^5.0||^6.0||^7.0
- symfony/event-dispatcher: ^4.4||^5.0||^6.0||^7.0
- symfony/filesystem: ^4.4||^5.0||^6.0||^7.0
- symfony/finder: ^4.4||^5.0||^6.0||^7.0
Requires (Dev)
- phpspec/phpspec: ^7.2
- phpstan/phpstan: ^1.9
README
The PHP Coupling Detector tool detects all the coupling issues of your project with respect to the coupling rules you have defined.
At the moment, only PHP coupling issues are detected by analysing the use statements of the classes in your project. But adding a new kind of coupling detections is doable in the future. We could for example imagine to detect the coupling issues of Symfony services that are defined in YAML or XML
At the moment, 3 types of rules are supported:
- forbidden: A node respects such a rule if no rule token is present in the node. In case the node does not respect this rule, an error violation will be sent.
- discouraged: A node respects such a rule if no rule token is present in the node. In case the node does not respect this rule, a warning violation will be sent.
- only: A node respects such a rule if the node contains only tokens defined in the rule. In case the node does not respect this rule, an error violation will be sent.
Requirements
PHP needs to be a minimum version of PHP 7.2
Installation
$ composer require akeneo/php-coupling-detector
Usage
To discover how to use this tool, please read the usage of the detect and list-unused-requirements commands.
Development
You can develop out of the box thanks to the provided docker-compose.yml
and Makefile
files
To install the app:
$ make vendor
To launch tests on your machine:
$ make test