PhpDependencyAnalysis is an extendable static code analysis for object-oriented
PHP-Projects to provide
for abstract datatypes (Classes, Interfaces and Traits) based on
Dependencies can be aggregated to build graphs for several levels, like Package-Level or Layer-Level.
Each dependency can be verified to your defined architecture.
Read the Introduction-Chapter for further informations.
See more examples.
For graph creation
GraphViz is required on your machine, which is
an open source graph visualization software and available for the most platforms.
$ composer require mamuz/php-dependency-analysis
- Providing high customizing level
- Dependency graph creation on customized levels respectively different scopes and layers
- Supports Usage-Graph, Call-Graph and Inheritance-Graph
- Dependencies can be aggregated to a package, a module or a layer
- Detecting cycles and violations between layers in a tiered architecture
- Verifiying dependency graph against a user-defined reference architecture
- Collected Namespaces of dependencies are modifiable to meet custom use cases
- Printing graphs in several formats (HTML, SVG, DOT, JSON)
- Extandable by adding user-defined plugins for collecting and displaying dependencies
- Compatible to PHP7 Features, like
Return Type Declarationsand
This tool is configurable by a
You can copy a prepared file from the vendor directory.
$ cp ./vendor/mamuz/php-dependency-analysis/phpda.yml.dist ./myconfig.yml
Run this command line to create a dependecy graph:
$ ./vendor/bin/phpda analyze ./myconfig.yml
After that open created report file with your prefered tool.
As contributors and maintainers of this project you have to respect the Code of Coduct
See record of changes made to this project here
Before opening up a pull-request please read the Contributing-Guideline
Check the resources in Code Analysis Section at Awesome PHP