How patryyyck/phpflow works
PHPFlow is a static analyzer for Symfony/PHP projects. Its main workflow scans source files, analyzes PHP and supported framework configuration, builds a flow graph, then lets users inspect flows, query impacts, or export results. The graph preserves HTTP, Messenger, service/repository, database, external-HTTP, response, and exception concepts. The source excerpts show key orchestration and graph construction; some impact and export branches are included based on the README and SOURCE INDEX, so their internal details are not expanded.
Main entry points: AnalyzeProject.php Analysis orchestration · Graph.php Flow graph · ScanProject.php Scan orchestration · Application.php Command registration
Components 23
CLI
- Command registration
src/Console/Application.php - Scan command
src/Console/Command/ScanCommand.php
Project analysis
- Project scanner
src/Infrastructure/Scanner/DirectoryScanner.php - Scan orchestration
src/Application/ScanProject.php - Analysis orchestration
src/Application/AnalyzeProject.php - Symbol indexer
src/Ast/ProjectIndexer.php - PHP AST analysis
src/Ast/ProjectAstAnalyzer.php - Messenger config reader
src/Infrastructure/Messenger/MessengerRoutingReader.php - PHP routing parser
src/Infrastructure/Messenger/PhpMessengerRoutingReader.php - Service alias reader
src/Infrastructure/Symfony/SymfonyServiceAliasReader.php - Analysis results
src/Domain/Analysis/ProjectAnalysis.php
Flow modeling
- Flow graph builder
src/Application/BuildFlowGraph.php - Flow graph
src/Domain/Graph/Graph.php - Graph traversal
src/Application/TraverseFlowGraph.php - Route subgraph
src/Application/ExtractSubgraph.php
Queries
- Impact analysis
src/Application - Flow inspection
src/Console/Command/InspectCommand.php
Exports
- Interactive HTML
src/Exporter/HtmlExporter.php - Graph JSON
src/Exporter/JsonExporter.php - Mermaid output
src/Exporter/MermaidExporter.php - Graph comparison
src/Application/CompareGraphExports.php
Other components
- CLI user
- Target project
Connections 23
- CLI user → Command registration: runs commands
README.md - Command registration → Scan command: registers
src/Console/Application.php - Scan command → Scan orchestration: scans project
src/Console/Command/ScanCommand.php - Target project → Project scanner: provides source
README.md - Scan orchestration → Project scanner: delegates scan
src/Application/ScanProject.php - Scan orchestration → Analysis orchestration: feeds project
src/Console/Command/ScanCommand.php - Analysis orchestration → Symbol indexer: builds index
src/Application/AnalyzeProject.php - Analysis orchestration → PHP AST analysis: analyzes PHP
src/Application/AnalyzeProject.php - Analysis orchestration → Messenger config reader: reads routing
src/Application/AnalyzeProject.php - Messenger config reader → PHP routing parser: parses PHP config
src/Infrastructure/Messenger/MessengerRoutingReader.php - Analysis orchestration → Service alias reader: reads aliases
src/Application/AnalyzeProject.php - Analysis orchestration → Analysis results: produces results
src/Application/AnalyzeProject.php - Analysis orchestration → Flow graph builder: passes analysis
src/Console/Command/ScanCommand.php - Flow graph builder → Flow graph: constructs graph
src/Application/BuildFlowGraph.php - Flow graph → Graph traversal: traverses flows
- Flow graph → Route subgraph: extracts routes
- Flow graph → Impact analysis: queries impacts
src/Application/FindServiceImpact.php - CLI user → Flow inspection: requests inspection
README.md - Flow inspection → Graph traversal: explores graph
- Flow graph → Interactive HTML: renders viewer
src/Exporter/HtmlExporter.php - Flow graph → Graph JSON: serializes graph
src/Exporter/JsonExporter.php - Flow graph → Mermaid output: renders diagram
src/Exporter/MermaidExporter.php - CLI user → Graph comparison: compares exports
README.md