{"id":28391425,"url":"https://github.com/shipmonk-rnd/phpstan-baseline-per-identifier","last_synced_at":"2025-06-25T21:31:15.602Z","repository":{"id":253921558,"uuid":"844926716","full_name":"shipmonk-rnd/phpstan-baseline-per-identifier","owner":"shipmonk-rnd","description":"✂️ Split PHPStan baseline to multiple files per each error identifier. Supports both neon baseline and PHP baseline.","archived":false,"fork":false,"pushed_at":"2025-06-16T13:40:54.000Z","size":81,"stargazers_count":77,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-16T14:49:36.111Z","etag":null,"topics":["baseline","error","identifier","phpstan"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shipmonk-rnd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-08-20T08:37:40.000Z","updated_at":"2025-06-16T13:40:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"555a5fa6-6d67-4f24-8070-0963df9b6dd2","html_url":"https://github.com/shipmonk-rnd/phpstan-baseline-per-identifier","commit_stats":null,"previous_names":["shipmonk-rnd/phpstan-baseline-per-identifier"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/shipmonk-rnd/phpstan-baseline-per-identifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipmonk-rnd%2Fphpstan-baseline-per-identifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipmonk-rnd%2Fphpstan-baseline-per-identifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipmonk-rnd%2Fphpstan-baseline-per-identifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipmonk-rnd%2Fphpstan-baseline-per-identifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shipmonk-rnd","download_url":"https://codeload.github.com/shipmonk-rnd/phpstan-baseline-per-identifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shipmonk-rnd%2Fphpstan-baseline-per-identifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260183005,"owners_count":22971195,"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":["baseline","error","identifier","phpstan"],"created_at":"2025-05-31T09:12:51.399Z","updated_at":"2025-06-25T21:31:15.592Z","avatar_url":"https://github.com/shipmonk-rnd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPStan baseline per error identifier\n\nSplit your [PHPStan baseline](https://phpstan.org/user-guide/baseline) into multiple files, one per error identifier:\n\n```txt\nbaselines/\n ├─ loader.neon\n ├─ empty.notAllowed.neon\n ├─ foreach.nonIterable.neon\n ├─ identical.alwaysFalse.neon\n └─ if.condNotBoolean.neon\n```\n\nEach file looks like this:\n\n```neon\n# total 1 error\n\nparameters:\n    ignoreErrors:\n        -\n            message: '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#'\n            path: ../app/index.php\n            count: 1\n```\n\n## Installation:\n\n```sh\ncomposer require --dev shipmonk/phpstan-baseline-per-identifier\n```\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e _This usage is available since version 2.0. See legacy usage below if you are still using PHPStan 1.x_\n\nRemove old single baseline include:\n```diff\n-includes:\n-\t- phpstan-baseline.neon\n```\n\nRun native baseline generation and split it into multiple files via our script (other baseline files will be placed beside the loader):\n```sh\nvendor/bin/phpstan --generate-baseline=baselines/loader.neon \u0026\u0026 vendor/bin/split-phpstan-baseline baselines/loader.neon\n```\n\nSetup the baselines loader:\n```neon\n# phpstan.neon.dist\nincludes:\n    - baselines/loader.neon\n```\n\n_(optional)_ You can simplify generation with e.g. composer script:\n```json\n{\n    \"scripts\": {\n        \"generate:baseline:phpstan\": [\n            \"phpstan --generate-baseline=baselines/loader.neon\",\n            \"find baselines/ -type f -not -name loader.neon -delete\",\n            \"split-phpstan-baseline baselines/loader.neon\"\n        ]\n    }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003eLegacy usage\u003c/h3\u003e\u003c/summary\u003e\n\n\u003e _This usage is deprecated since 2.0, but it works in all versions. Downside is that it cannot utilize result cache_\n\nSetup where your baseline files should be stored and include its loader:\n```neon\n# phpstan.neon.dist\nincludes:\n    - vendor/shipmonk/phpstan-baseline-per-identifier/extension.neon # or use extension-installer\n    - baselines/loader.neon\n\nparameters:\n    shipmonkBaselinePerIdentifier:\n        directory: %currentWorkingDirectory%/baselines\n        indent: '    '\n```\n\nPrepare composer script to simplify generation:\n\n```json\n{\n    \"scripts\": {\n        \"generate:baseline:phpstan\": [\n            \"rm baselines/*.neon\",\n            \"touch baselines/loader.neon\",\n            \"phpstan analyse --error-format baselinePerIdentifier\"\n        ]\n    }\n}\n```\n\n\u003c/details\u003e\n\n## Cli options\n- ``--tabs`` to use tabs as indents in generated neon files\n- ``--no-error-count`` to remove errors count in generated files\n\n## PHP Baseline\n- If the loader file extension is php, the generated files will be php files as well\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipmonk-rnd%2Fphpstan-baseline-per-identifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshipmonk-rnd%2Fphpstan-baseline-per-identifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipmonk-rnd%2Fphpstan-baseline-per-identifier/lists"}