{"id":44411321,"url":"https://github.com/struggle-for-php/sfp-deptrac-builtin","last_synced_at":"2026-02-12T07:39:48.208Z","repository":{"id":90538997,"uuid":"541640067","full_name":"struggle-for-php/sfp-deptrac-builtin","owner":"struggle-for-php","description":"Deptrac extension to enforce application on framework rule.","archived":false,"fork":false,"pushed_at":"2024-06-09T02:22:44.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"0.3.x","last_synced_at":"2025-12-01T16:32:08.625Z","etag":null,"topics":[],"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/struggle-for-php.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}},"created_at":"2022-09-26T14:54:12.000Z","updated_at":"2024-06-09T02:22:47.000Z","dependencies_parsed_at":"2024-06-09T03:26:09.646Z","dependency_job_id":"87b59053-ec8d-4c87-bd9d-9dae51467fbe","html_url":"https://github.com/struggle-for-php/sfp-deptrac-builtin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/struggle-for-php/sfp-deptrac-builtin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-deptrac-builtin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-deptrac-builtin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-deptrac-builtin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-deptrac-builtin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/struggle-for-php","download_url":"https://codeload.github.com/struggle-for-php/sfp-deptrac-builtin/tar.gz/refs/heads/0.3.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-deptrac-builtin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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":[],"created_at":"2026-02-12T07:39:45.676Z","updated_at":"2026-02-12T07:39:48.194Z","avatar_url":"https://github.com/struggle-for-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deptrac extension to enforce application on framework rule.\n\nPHP Web application on framework should not use network function like `header()`. \nBut this rule is **Implicit** !.\nThis extension is attempted to find violate such rule.\n\n## Example\n\n - examples/src/Action/UserShowAction.php includes\n```\n    public function handle(ServerRequestInterface $request): ResponseInterface\n    {\n        \\header('Location: http://www.example.com/');\n    }\n```\n\n```\n$ cd examples/\n$ ./vendor/bin/deptrac analyse\n 107/107 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n\n ----------- ----------------------------------------------------------------------------------\n  Reason      Action\n ----------- ----------------------------------------------------------------------------------\n  Violation   Foo\\Action\\UserShowAction must not depend on header() (Sending Raw HTTP)\n              /home/sasezaki/dev/sfp-deptrac-builtin/examples/src/Action/UserShowAction.php:20\n ----------- ----------------------------------------------------------------------------------\n\n\n -------------------- -----\n  Report\n -------------------- -----\n  Violations           1\n  Skipped violations   0\n  Uncovered            24\n  Allowed              48\n  Warnings             0\n  Errors               0\n -------------------- -----\n ```\n\n## Q\u0026A\n\n- Q. Why not use PHPCS `forbiddenFunctionNames` ?\n  - A. IMO, `forbiddenFunctionNames` is only should be used for dangerous function (its own) or alias function.\nReason of forbidden `header()` usage in application is layer problem.\n\n- Q. When called `header()` with `'Location: ...`, then should be called `exit()` on same scope, is it not ?\n  - A. Maybe..\n\n\n## Inspired \nThis extension is developed inspired from this talk.\n\nhttps://speakerdeck.com/asumikam/phpcon-2022","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstruggle-for-php%2Fsfp-deptrac-builtin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstruggle-for-php%2Fsfp-deptrac-builtin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstruggle-for-php%2Fsfp-deptrac-builtin/lists"}