Documentation
¶
Overview ¶
Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing. It reuses the shared VKCOM-based reader (internal/common/php), which normalizes PHP 8.2–8.5 to the 8.1 grammar.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Brief ¶ added in v0.6.0
Brief collapses field/value-level detail for a signature-only view: properties disappear entirely (they're the class-body equivalent of Go struct fields), and enum cases keep their names but drop the backing value — class/interface/trait name, extends/implements, constructor and method signatures are all left alone, since those already sit at signature level. Dropping every case's value also makes enumIsBacked report false, so rendering falls through to the existing name-only cases header for free.
func Summarize ¶
Summarize writes the structural summary of the PHP file at path to w. When api is set and the file declares a class or trait, the methods block becomes the effective public surface — own methods plus those composed via traits and inherited from parent classes (see effectiveSurface). api implies the public-only filter. brief drops properties and enum cases' backing values (see Brief). The json format stays structural (machine output); callers wanting the flattened surface use toon/md.
Types ¶
This section is empty.