{"id":19136933,"url":"https://github.com/xactsystems/phpstan-extensions","last_synced_at":"2026-06-17T12:31:27.392Z","repository":{"id":191767652,"uuid":"685599520","full_name":"XactSystems/phpstan-extensions","owner":"XactSystems","description":"Useful PHPStan extension for detecting errors in your code.","archived":false,"fork":false,"pushed_at":"2023-09-03T16:24:30.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-13T12:03:36.865Z","etag":null,"topics":["extensions","php","phpstan","unused-classes"],"latest_commit_sha":null,"homepage":"","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/XactSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-31T15:35:19.000Z","updated_at":"2023-08-31T15:47:56.000Z","dependencies_parsed_at":"2024-11-09T06:45:59.073Z","dependency_job_id":null,"html_url":"https://github.com/XactSystems/phpstan-extensions","commit_stats":null,"previous_names":["xactsystems/phpstan-extensions"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/XactSystems/phpstan-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XactSystems%2Fphpstan-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XactSystems%2Fphpstan-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XactSystems%2Fphpstan-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XactSystems%2Fphpstan-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XactSystems","download_url":"https://codeload.github.com/XactSystems/phpstan-extensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XactSystems%2Fphpstan-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34449277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["extensions","php","phpstan","unused-classes"],"created_at":"2024-11-09T06:35:54.677Z","updated_at":"2026-06-17T12:31:27.358Z","avatar_url":"https://github.com/XactSystems.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A collection of PHPStan extensions\n\nThis repo contains some useful PHPStan extension for detecting errors in your code. The currently list of rules is:\n## `UnusedClassRule`\n## `UnusedTraitRule`\n\n## Install\n\n```bash\ncomposer require xactsystems/phpstan-extensions --dev\n```\n\n\n## Usage\n\nWith [PHPStan extension installer](https://github.com/phpstan/extension-installer), everything is ready to run.\n\nOtherwise manually enable the extension:\n```yaml\n# phpstan.neon\ninclude:\n    'vendor/xactsystems/phpstan-extensions/config/extension.neon'\n    \n```\n\n## Rules\n---\n### `UnusedClassRule`\nThis rule scans for class declarations and use statements. If a class is declared but not used within the scanned source files, an error is generated.\n\n### Disabling the rule\nYou can disable scanning classes as follows:\n```yaml\n# phpstan.neon\nparameters:\n    unused_classes:\n        classes: false\n```\n\n#### Excluding files\nYou can exclude directories and individual files from being scanned by this rule:\n\n```yaml\n# phpstan.neon\nparameters:\n    unused_classes:\n        excludePaths:\n            - 'src/Controller'\n            - 'src/MyUnusedClass.php'\n```\n\n### Excluding Services\nBy default, some known service and framework classes are excluded. There are a number of base classes from Symfony, Doctrine and PHPUnit that checked and, if matched, the class being analysed is ignored.\n\nTo disable this, set the *excludeFrameworks* property to false:\n```yaml\n# phpstan.neon\nparameters:\n    unused_classes:\n        excludeFrameworks: false\n```\n\nThis list will change as new frameworks and classes are added. Please look at the source code in src/Frameworks for a list of base classes that are excluded.\n\nIf you want add a custom list of base classes to ignore, use the *baseClassExcludes* property:\n```yaml\n# phpstan.neon\nparameters:\n    unused_classes:\n        baseClassExcludes:\n            - 'App\\Service\\MyAbstractService'\n            - 'App\\DI\\MyDIClass'\n```\n\nEntries in *baseClassExcludes* are excluded regardless of the *excludeFrameworks* property value.\n\n---\n### `UnusedTraitRule`\nThis rule scans for trait declarations and use statements. If a trait is declared but not used within the scanned source files, an error is generated.\n\n### Disabling the rule\nYou can disable scanning traits as follows:\n```yaml\n# phpstan.neon\nparameters:\n    unused_classes:\n        traits: false\n```\n\n#### Excluding files\nYou can exclude directories and individual files from being scanned by this rule using the excludePaths parameter as shown above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxactsystems%2Fphpstan-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxactsystems%2Fphpstan-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxactsystems%2Fphpstan-extensions/lists"}