Skip to main content

Module php

Module php 

Source
Expand description

PHP language parser.

Coverage in 0.9.36:

  • class / interface / trait declarations → ClassInfo / InterfaceInfo (trait → ClassInfo kind=“trait”, matching the Rust-trait encoding).
  • Top-level function definitions and class method declarations → FunctionInfo.
  • const declarations (top-level + class-level) → ConstantInfo per const_element.
  • namespace declaration → FileInfo.module_path (backslash separator).
  • use declarations → FileInfo.imports.
  • PHP 8 attributes (#[Route('/x')]) → FunctionInfo.decorators so the existing 0.9.34 DECORATES pass picks them up.
  • Visibility modifiers (public / protected / private).
  • static, final, abstract modifiers as metadata.

Not yet supported (follow-up scope):

  • define('NAME', value) constants — these are function calls, not declaration nodes, and need a separate post-pass that walks the call graph.
  • PHP fibers (Fiber::start) async detection. v1 marks every PHP function is_async=false.
  • Property declarations as AttributeInfo. The grammar exposes them but we don’t currently model PHP class properties; the same applies to constructor property promotion.

Structs§

PhpParser

Constants§

PHP_NOISE_NAMES
PHP standard-library / language built-in names excluded from CALLS resolution. The list is small on purpose — the call resolver’s 5-tier name lookup already disambiguates user-defined identifiers well; we only need to swallow the truly ubiquitous names that would otherwise generate edges to every same-name user function.