class

Analyzer::Php::PhpEngine

Inherits FileScanEngine < Analyzer < FileHelper < Reference < Object

Constants

INTERPOLATION_BRACE_DOLLAR_RE = /\{\$([A-Za-z_]\w*)\}/
INTERPOLATION_DOLLAR_BRACE_RE = /\$\{([A-Za-z_]\w*)\}/

PHP double-quoted strings interpolate $var, {$var}, and ${var}. The route extractor captures the literal characters between the quotes, so "/api/{$VERSION}/items" came out as /api/{$VERSION}/items with the $ leaking into the URL. Rewrite each shape to {name} so the path-parameter extractor picks it up and the URL template reads cleanly. Same posture as the Python f-string and Ruby #{} fixes.

INTERPOLATION_DOLLAR_RE = /\$([A-Za-z_]\w*)/

Class methods

test_path?(relative_path : String) : Bool

Standard PHP test-source conventions:

  • /Tests/ — PSR-4 / Symfony convention (src/Symfony/Bundle/FrameworkBundle/Tests/...)
  • /tests/ — Laravel / CakePHP / PHPUnit default
  • *Test.php filename — PHPUnit suffix convention
  • *Tests.php filename — pluralized variant (rare)

symfony/symfony's own repo accounts for ~63 phantom endpoints under src/Symfony/Bundle/FrameworkBundle/Tests/.... The conventions are unambiguous — production routing never adopts any of them.

Takes the scan-base-relative path (Analyzer#base_relative_path), never the absolute one. The conventions describe a location inside the project, so matching the absolute path handed the decision to whatever directory the checkout happened to live in: the same tree scanned from ~/work/tests/myapp reported 0 endpoints instead of 235.

Source