Skip to content

1.2.0

@ondrejmirtes ondrejmirtes tagged this 23 Jul 20:44
Constructing ReflectionClass autoloads the inspected class, which breaks
when the source (or a class it depends on) uses PHP 8 syntax: parse
errors abort collection of that class, and delayed variance checks
against unloadable classes are unrecoverable fatal errors that kill
composer entirely.

Under PHP < 8 everything is now collected from the AST, located through
the class map: class/method/property/parameter attributes, methods and
properties inherited along the extends chain (mirroring reflection,
including private-member exclusion and promoted-property visibility),
and attributes on promoted constructor properties doubling as property
targets. Attribute arguments resolve self::*/Foo::* constants from the
class-map ASTs (falling back to constant() only for classes outside the
scanned paths) and support __DIR__, __FILE__ and __CLASS__.

On phpstan-src, the generated attributes.php is byte-identical between
PHP 7.4 and PHP 8.5.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EUJZL34ngijx9XTFtLGnEC
Assets 2
Loading