Title: feat(forge-analyzer): PHP namespace & use import graph, cycle detection & security pattern scanner · Issue #172 · elcode-id/elcode-forge · GitHub
Open Graph Title: feat(forge-analyzer): PHP namespace & use import graph, cycle detection & security pattern scanner · Issue #172 · elcode-id/elcode-forge
X Title: feat(forge-analyzer): PHP namespace & use import graph, cycle detection & security pattern scanner · Issue #172 · elcode-id/elcode-forge
Description: Description Implement PHP namespace and use import graph parsing, PSR-4 class resolution, module boundary inference, cycle detection, and security pattern scanning in crates/forge-analyzer and crates/forge-security. Detailed Requirements...
Open Graph Description: Description Implement PHP namespace and use import graph parsing, PSR-4 class resolution, module boundary inference, cycle detection, and security pattern scanning in crates/forge-analyzer and crat...
X Description: Description Implement PHP namespace and use import graph parsing, PSR-4 class resolution, module boundary inference, cycle detection, and security pattern scanning in crates/forge-analyzer and crat...
Opengraph URL: https://github.com/elcode-id/elcode-forge/issues/172
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(forge-analyzer): PHP namespace & use import graph, cycle detection & security pattern scanner","articleBody":"## Description\nImplement PHP namespace and `use` import graph parsing, PSR-4 class resolution, module boundary inference, cycle detection, and security pattern scanning in `crates/forge-analyzer` and `crates/forge-security`.\n\n## Detailed Requirements\n1. **PHP Import & Namespace Extractor (`crates/forge-analyzer/src/php_imports.rs`):**\n - Extract `namespace \u003cName>;` and `use \u003cNamespace>\\\u003cClass>;` statements.\n - Handle group use statements (`use App\\Services\\{UserService, AuthService};`) and aliases (`use App\\Models\\User as UserModel;`).\n - Filter built-in PHP classes (`stdClass`, `DateTime`, `Exception`, `PDO`, etc.).\n - Support PSR-4 namespace resolution to file paths (`App\\...` -> `app/...php`).\n2. **PHP Architecture Graph & Cycle Detection:**\n - Infer module boundaries from directories (`app/Http/Controllers`, `app/Models`, `app/Services`, `app/Providers`, etc.).\n - Build module import edges and detect circular dependencies using Tarjan's SCC algorithm.\n3. **PHP Security Pattern Scanner (`crates/forge-security`):**\n - Unsafe dynamic evaluation: `eval(...)`.\n - Insecure deserialization: `unserialize(...)`.\n - Command injection: `exec(...)`, `passthru(...)`, `shell_exec(...)`, `system(...)`, backticks.\n - Deprecated dynamic code: `create_function(...)`.\n4. **Unit Tests:**\n - Unit tests in `crates/forge-analyzer/tests/php_imports_test.rs` and `crates/forge-security/tests/php_security_test.rs`.\n\n## Verification\n- `cargo clippy --package forge-analyzer --package forge-security --all-targets -- -D warnings`\n- `cargo test --package forge-analyzer`\n- `cargo test --package forge-security`\n- Selective CI: Tier 1.\n\nPart of #170","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-10-21T17:52:39Z","url":"https://github.com/elcode-id/elcode-forge/issues/172"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:80a87890-1286-1583-4ac0-ad518aa602dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A816:2B3C9F:184858:20EEE1:6B059826 |
| html-safe-nonce | bbbdaa5c667e62fe29365d2b8eb3d51d8bf71b707a57fec214854e67d12385be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODE2OjJCM0M5RjoxODQ4NTg6MjBFRUUxOjZCMDU5ODI2IiwidmlzaXRvcl9pZCI6IjE1NTQyOTMyNTY4NDQ4NDMwNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0ee185c9e958aa44031b91a8491159c87113647a40f8817423c4dfa6cfa1c6dc |
| hovercard-subject-tag | issue:5965703656 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/elcode-id/elcode-forge/172/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64bcf98f27a085e8a488bc52ebe20b928c3ba8e5e76df4278b56a714c30c7d96/elcode-id/elcode-forge/issues/172 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64bcf98f27a085e8a488bc52ebe20b928c3ba8e5e76df4278b56a714c30c7d96/elcode-id/elcode-forge/issues/172 |
| og:image:alt | Description Implement PHP namespace and use import graph parsing, PSR-4 class resolution, module boundary inference, cycle detection, and security pattern scanning in crates/forge-analyzer and crat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luksluki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3b72fd2385d76a50ce0fe937d50bb4a81434432c4fd47866074a26f6cd03623f |
| turbo-cache-control | no-preview |
| go-import | github.com/elcode-id/elcode-forge git https://github.com/elcode-id/elcode-forge.git |
| octolytics-dimension-user_id | 337957755 |
| octolytics-dimension-user_login | elcode-id |
| octolytics-dimension-repository_id | 1423983661 |
| octolytics-dimension-repository_nwo | elcode-id/elcode-forge |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1423983661 |
| octolytics-dimension-repository_network_root_nwo | elcode-id/elcode-forge |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 58e2bd32336f3dcee343ec627a4d09c7c444e214 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width