{"id":22446796,"url":"https://github.com/mamuz/phpdependencyanalysis","last_synced_at":"2025-05-15T06:02:24.461Z","repository":{"id":37547528,"uuid":"24533794","full_name":"mamuz/PhpDependencyAnalysis","owner":"mamuz","description":"Static code analysis to find violations in a dependency graph","archived":false,"fork":false,"pushed_at":"2023-12-03T20:43:10.000Z","size":7123,"stargazers_count":570,"open_issues_count":15,"forks_count":45,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-14T06:03:46.344Z","etag":null,"topics":["code-analysis","code-quality","dependency-graph","php","reference-architecture"],"latest_commit_sha":null,"homepage":"http://mamuz.github.io/PhpDependencyAnalysis/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mamuz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-09-27T14:29:36.000Z","updated_at":"2025-04-03T07:59:09.000Z","dependencies_parsed_at":"2024-01-23T02:03:44.858Z","dependency_job_id":"7ebe5dad-7516-4c82-93b3-2c260d199736","html_url":"https://github.com/mamuz/PhpDependencyAnalysis","commit_stats":{"total_commits":640,"total_committers":15,"mean_commits":"42.666666666666664","dds":"0.36406249999999996","last_synced_commit":"5e30a86eed89097fdeab280c30f33915095f9041"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamuz%2FPhpDependencyAnalysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamuz%2FPhpDependencyAnalysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamuz%2FPhpDependencyAnalysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamuz%2FPhpDependencyAnalysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mamuz","download_url":"https://codeload.github.com/mamuz/PhpDependencyAnalysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830395,"owners_count":21168272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-analysis","code-quality","dependency-graph","php","reference-architecture"],"created_at":"2024-12-06T04:11:38.421Z","updated_at":"2025-04-14T06:04:07.707Z","avatar_url":"https://github.com/mamuz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PhpDependencyAnalysis\n=====================\n\n[![Author](http://img.shields.io/badge/author-@mamuz_de-blue.svg?style=flat-square)](https://twitter.com/mamuz_de)\n[![Build Status](https://img.shields.io/travis/mamuz/PhpDependencyAnalysis.svg?style=flat-square)](https://travis-ci.org/mamuz/PhpDependencyAnalysis)\n[![Latest Stable Version](https://img.shields.io/packagist/v/mamuz/php-dependency-analysis.svg?style=flat-square)](https://packagist.org/packages/mamuz/php-dependency-analysis)\n[![Total Downloads](https://img.shields.io/packagist/dt/mamuz/php-dependency-analysis.svg?style=flat-square)](https://packagist.org/packages/mamuz/php-dependency-analysis)\n[![License](https://img.shields.io/packagist/l/mamuz/php-dependency-analysis.svg?style=flat-square)](https://packagist.org/packages/mamuz/php-dependency-analysis)\n\nPhpDependencyAnalysis is an extendable static code analysis for object-oriented\nPHP-Projects to generate [`dependency graphs`](http://en.wikipedia.org/wiki/Dependency_graph)\nfrom abstract datatypes (Classes, Interfaces and Traits) based on [`namespaces`](http://php.net/manual/en/language.namespaces.php).\nDependencies can be aggregated to build graphs for several levels, like Package-Level or Layer-Level.\nEach dependency can be verified to a defined architecture.\n\nRead the [Introduction-Chapter](https://github.com/mamuz/PhpDependencyAnalysis/wiki/1.-Introduction) for further informations.\n\n### Example\n\n![](https://cdn.rawgit.com/mamuz/PhpDependencyAnalysis/master/tests/_data/svg/expectation/packages.svg)\n\nSee more [examples](https://github.com/mamuz/PhpDependencyAnalysis/wiki/4.-Examples).\n\n## Installation\n\n### As a Docker Image (recommend way)\n\n```bash\ndocker pull mamuz/phpda\n```\n\n### As a Composer Dependency\n\n**NOTE:** For graph creation [`GraphViz`](http://www.graphviz.org/) is required on your machine, which is\nan open source graph visualization software and available for the most platforms.\n\n```sh\n$ composer require --dev mamuz/php-dependency-analysis\n```\n\n### As a Phar\n\nSince version 2.0.0 not supported anymore.\n\n## Features\n\n- High customizing level\n- Graph creation on customized levels respectively different scopes and layers\n- Supports Usage-Graph, Call-Graph and Inheritance-Graph\n- Dependencies can be aggregated such as to a package, a module or a layer\n- Detecting cycles and violations between layers in a tiered architecture\n- Verifiying dependency graph against a user-defined reference architecture\n- Collected namespaces of dependencies are modifiable to meet custom use cases\n- Printing graphs in several formats (HTML, SVG, DOT, JSON)\n- Extandable by adding user-defined plugins for collecting and displaying\n- Compatible to PHP7 Features, like [`Return Type Declarations`](https://wiki.php.net/rfc/return_types) and [`Anonymous Classes`](https://wiki.php.net/rfc/anonymous_classes)\n\n## Usage\n\nPhpda can run out of the box by using a prepared [`configuration`](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/phpda.yml.dist).\nAs you can see configuration is defined by a [`YAML`](http://en.wikipedia.org/wiki/YAML) file.\n\nTo provide your own configuration create a yml file, e.g. located in `./phpda.yml`:\n\n```yml\nmode: 'usage'\nsource: './src'\nfilePattern: '*.php'\nignore: 'tests'\nformatter: 'PhpDA\\Writer\\Strategy\\Svg'\ntarget: './phpda.svg'\ngroupLength: 1\nvisitor:\n  - PhpDA\\Parser\\Visitor\\TagCollector\n  - PhpDA\\Parser\\Visitor\\SuperglobalCollector\nvisitorOptions:\n  PhpDA\\Parser\\Visitor\\Required\\DeclaredNamespaceCollector: {minDepth: 2, sliceLength: 2}\n  PhpDA\\Parser\\Visitor\\Required\\MetaNamespaceCollector: {minDepth: 2, sliceLength: 2}\n  PhpDA\\Parser\\Visitor\\Required\\UsedNamespaceCollector: {minDepth: 2, sliceLength: 2}\n  PhpDA\\Parser\\Visitor\\TagCollector: {minDepth: 2, sliceLength: 2}\n```\n\nPerform an analysis with that configuration:\n\n```sh\n$ docker run --rm -v $PWD:/app mamuz/phpda\n```\n\nRead the [Configuration-Chapter](https://github.com/mamuz/PhpDependencyAnalysis/wiki/3.-Configuration)\nto get knowledge about all available options.\n\n## [Wiki](https://github.com/mamuz/PhpDependencyAnalysis/wiki)\n\n1. [Introduction](https://github.com/mamuz/PhpDependencyAnalysis/wiki/1.-Introduction)\n2. [Requirements](https://github.com/mamuz/PhpDependencyAnalysis/wiki/2.-Requirements)\n3. [Configuration](https://github.com/mamuz/PhpDependencyAnalysis/wiki/3.-Configuration)\n4. [Examples](https://github.com/mamuz/PhpDependencyAnalysis/wiki/4.-Examples)\n5. [Plugins](https://github.com/mamuz/PhpDependencyAnalysis/wiki/5.-Plugins)\n\n## [Code of Conduct](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/.github/CODE_OF_CONDUCT.md)\n\nAs contributors and maintainers of this project you have to respect the [Code of Coduct](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/.github/CODE_OF_CONDUCT.md)\n\n## [Changelog](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/CHANGELOG.md)\n\nSee record of changes made to this project\n[here](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/CHANGELOG.md)\n\n## [Contributing](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/.github/CONTRIBUTING.md)\n\nBefore opening up a pull-request please read the\n[Contributing-Guideline](https://github.com/mamuz/PhpDependencyAnalysis/blob/master/.github/CONTRIBUTING.md)\n\n## Alternatives\n\nCheck the resources in [Satic Analysis Section at Awesome PHP](https://github.com/ziadoz/awesome-php#static-analysis)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamuz%2Fphpdependencyanalysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamuz%2Fphpdependencyanalysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamuz%2Fphpdependencyanalysis/lists"}