Analyzer::Php::Laminas
Inherits Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object
Constants
Regex metacharacters. A Laminas constraint is a validation pattern
('itemId' => '[0-9]+'), so it only doubles as a value when it matches
exactly one string — i.e. when it contains none of these.
Precompiled once at load: the three namespace markers used to be
three separate String#includes? scans of the whole file ORed
together. Crystal's String#includes? is measurably slower than a
single precompiled Regex#matches? call, and this runs on every
.php file fed into the analyzer during a project-wide scan.
Rules::SHARED_DEPTH_RAW with a trailing empty dropped, then a
strip applied by this method rather than by the splitter.
The order matters and is not cosmetic. The body this replaces
stripped each part as it pushed it, but decided whether to emit the
tail from the RAW slice (if start < size), so f(a, ) kept a final
"" while f(a,) did not. Stripping inside the splitter would test
the stripped tail and drop both. Splitting raw and stripping
afterwards reproduces the original exactly.
The old scan walked bytes to dodge String#[](Int); the shared
splitter is a single forward each_char pass, so it is O(n) on any
input without needing the byte detour. Every delimiter, quote and
bracket involved is ASCII and UTF-8 continuation bytes are all
= 0x80, so the two scans see the same split points.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.