{"id":16674820,"url":"https://github.com/odan/phpstan-rules","last_synced_at":"2025-10-17T14:29:00.075Z","repository":{"id":65289159,"uuid":"589309082","full_name":"odan/phpstan-rules","owner":"odan","description":"A collection of PHPStan rules","archived":false,"fork":false,"pushed_at":"2023-11-06T14:33:18.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:14:27.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/odan.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-01-15T18:54:12.000Z","updated_at":"2023-11-17T13:38:40.000Z","dependencies_parsed_at":"2025-02-15T20:33:42.033Z","dependency_job_id":"860bffd1-b567-49b6-abda-02964d898882","html_url":"https://github.com/odan/phpstan-rules","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odan%2Fphpstan-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odan%2Fphpstan-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odan%2Fphpstan-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odan%2Fphpstan-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odan","download_url":"https://codeload.github.com/odan/phpstan-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104840,"owners_count":21048411,"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":[],"created_at":"2024-10-12T12:44:29.766Z","updated_at":"2025-10-17T14:29:00.049Z","avatar_url":"https://github.com/odan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPStan Rules\n\n[![Latest Version on Packagist](https://img.shields.io/github/release/odan/phpstan-rules.svg)](https://packagist.org/packages/odan/phpstan-rules)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n[![Total Downloads](https://img.shields.io/packagist/dt/odan/phpstan-rules.svg)](https://packagist.org/packages/odan/phpstan-rules/stats)\n\nA collection of PHPStan rules.\n\n## Requirements\n\n* PHP 8.2+\n\n## Installation\n\n```\ncomposer require odan/phpstan-rules --dev\n```\n\nTo use the PHPStan rules, you need to include the classes \nin your PHPStan configuration file `phpstan.neon`.\n\nJust pick the rule(s) you want:\n\n```neon\nrules:\n\t- Odan\\PHPStan\\Rules\\AssignmentInConditionRule\n\t- Odan\\PHPStan\\Rules\\YodaConditionRule\n```\n\nIf you want to include all rules, you have to include `rules.neon` in your project's PHPStan config:\n\n```neon\nincludes:\n\t- vendor/odan/phpstan-rules/rules.neon\n```\n\n## Register CyclomaticComplexityRule in phpstan.neon\n\nAdd a new service configuration and change the `maxComplexity` as needed.\n\n```neon\nservices:\n\t-\n\t\tclass: Odan\\PHPStan\\Rules\\CyclomaticComplexityRule\n\t\targuments:\n\t\t\tmaxComplexity: 3\n\t\ttags:\n\t\t\t- phpstan.rules.rule\n\n```\n\nNote: If exists, remove the rule `Odan\\PHPStan\\Rules\\CyclomaticComplexityRule` from the `rules:` section in `phpstan.neon`\n\n## Rules\n\n* AssignmentInConditionRule\n* YodaConditionRule\n* CyclomaticComplexityRule\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodan%2Fphpstan-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodan%2Fphpstan-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodan%2Fphpstan-rules/lists"}