Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Parser Reflection Laravel Package

goaop/parser-reflection

Parser Reflection brings PHP's Reflection API to static analysis: parse source files into an AST and introspect classes, methods, and properties without autoloading, including, or executing code. Drop-in compatible with native Reflection classes for analyzers, generators, and IDE tooling.

View on GitHub
Deep Wiki
Context7
5.0.1

What's Changed

Patch release to improve the performance of engine by creating the parser and the name resolver on the first parse (4.x) in https://github.com/goaop/parser-reflection/pull/239

Full Changelog: https://github.com/goaop/parser-reflection/compare/5.0.0...5.0.1

5.0.0

Parser Reflection 5.0.0

This release brings the library to full PHP 8.6 reflection parity ahead of the PHP 8.6 GA (planned 2026-11-19): parameter doc comments, scope-aware property accessibility, readonly property defaults, partial function application, and the 8.6 attribute-API additions are all reflected statically from the AST — without loading the reflected code into memory. All 8.6 behavior is validated against PHP 8.6.0RC2 and guarded by runtime version checks, so the library runs identically on PHP 8.5. Tracked in epic #219.

💥 Breaking changes

  • PHP 8.5 or newer is now required (previously >=8.4) — #218. The CI matrix runs PHP 8.5 (lowest + highest deps) with PHP 8.6 as experimental.
  • nikic/php-parser: ^5.9 is now required — the first release parsing PHP 8.6 partial-application placeholders (ArgPlaceholder) — #224
  • Named attribute arguments are now keyed by name in ReflectionAttribute::getArguments(), matching native reflection (previously they were collapsed into a positional list) — #225
  • ReflectionClassConstant::__toString() now prints the constant's doc comment like native reflection, and renders boolean values as true/false on PHP 8.6+ (following the native rendering change) — #225, #223

✨ PHP 8.6 API coverage

  • ReflectionParameter::getDocComment() — doc comments on parameters (plain, promoted, variadic, by-ref, combined with attributes), byte-for-byte native parity; available on every supported runtime. Known limitation: a doc comment written after a parameter is dropped by PHP-Parser — #221
  • ReflectionProperty::isReadable() / isWritable() — scope-aware accessibility emulation covering visibility, asymmetric (set) visibility, readonly (incl. the implicit protected(set)), property hooks, virtual properties, and object initialization state; validated against native 8.6 across ~12,800 combinations. Deliberate divergence: scope classes are resolved statically, never autoloaded — #222
  • Readonly property defaults — hasDefaultValue() / getDefaultValue() / getDefaultProperties() for readonly properties with defaults, verified against PHP 8.6.0RC2 across scalar, const-expression, class-constant, enum-case and array defaults — #223
  • Partial Function Application — sources using f(?), f(name: ?) and f(1, ...) reflect cleanly on every host runtime; placeholder arguments in constant-expression positions degrade into a catchable ReflectionException (the same contract as first-class callables) — #224
  • Attribute API additions: ReflectionAttribute::getShortName(), getNamespaceName(), inNamespace() and ReflectionConstant::inNamespace() implemented (the inherited native implementations fatal on parsed attributes) — #225
  • #[\Override] on class constants (incl. interface and enum constants) and __debugInfo() on enums are fully reflected — #225
  • Internal functions newly deprecated in 8.6 (strcoll() et al.) report isDeprecated() and their #[\Deprecated] payload correctly through the native fallback — #215

🐛 Bug fixes

  • Fixed a latent fatal in getDefaultValueExpression() on typed properties/parameters without a default value — #223
  • isVirtual() no longer misreports a property whose short-form get hook references its own backing store — #222

🔧 Internal & CI

  • PHP 8.6 test scaffolding (FileWith*86.php stub convention with PHP_VERSION_ID >= 80600 guards) and a deprecation-clean audit against the "Deprecations for PHP 8.6" RFC (no hits) — #220
  • The experimental PHP 8.6 CI rows are clearly labeled and their real outcome is written to the run summary — #220
  • Dev dependencies: phpunit/phpunit ^13.3, rector/rector ^2.6.7 (required: Rector preloads its bundled php-parser under PHPUnit ≥ 12, so the bundle must also be ≥ 5.9)

Full Changelog: https://github.com/goaop/parser-reflection/compare/4.0.0...5.0.0


Known follow-ups (out of this release's scope): #233, #234, #235, and possibly mirroring the new 8.6 getDefaultValue() deprecation in the parsed implementation.

3.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/goaop/parser-reflection/compare/3.0.1...3.1.0

2.1.2

This patch release fixes compatibility with PHP7.3 and PHP7.4 #103

Warning! Please, be aware that this repo is not maintained well and will be abandoned soon. Consider to upgrade your software to the Roave/BetterReflection library.

2.1.0

This minor release contains several fixes and improvements:

  • Added support for the ReflectionClassConstant #93, #97 (by @MaximilianKresse)
  • PHP7.4 ReflectionMethod->getClosure($object = null) compatibility #88 (by @ddinchev)
  • getNamespaceAliases() logic fix #96 (by @MaximilianKresse)
1.4.1

Small patch release for #89

1.3.0

This release enables usage of token positions during analysis in Go! AOP framework, see #78. Also contains improvements by @loren-osborn in #76

1.2.1

Patch version with small fixes:

  • Fixed the signature of ReflectionClass::newInstance to be compatible across all PHP versions, resolves #70
  • Fixed namespace names with leading slash, resolves #67

PHP version was also bumped to be >=5.6.0. Pay an attention if you use this library with outdated PHP versions.

1.2.0

This release contains a lot of fixes and improvements since 1.1.0:

  • Fixed ReflectionParameters with class constant as default value (#44)
  • [NodeResolver] allow parsing of scalar expressions (#47)
  • Fix NodeExpressionResolver to reflect system classes (#50)
  • Parse top level “define” statements in a root namespace (#46)
  • Add test-case scenario for resolving self: constants for parameters, #49
  • Change logic of collecting constants to have an ability to resolve self constants recursively
  • Enable 7.1 for code coverage collecting
  • Added tests for parameters in 5.6 and 7.0
  • Fixed isOptional() result for variadic parameters, they should be optional
  • Fixed bug with accessing default value for variadic optional parameters
  • Added support for the pow operator in PHP5.6
  • Fixed type handling for PHP7.0
  • Enable parsing of files with PHP7.0 classes
  • isAbstract() for methods in the interface should return true
  • Fix broken compatibility with 5.5
  • Added support for displaying return types in the ReflectionMethod->__toString()
  • Fixed typehint for the method
  • Allow to install latest version of nikic/php-parser
  • Fixed ReflectionProperty->isDefault() implementation
  • Fixed buggy self::class resolution for old versions of PHP
  • Add support for nullable types, related to the #12
  • Implement ReflectionFile->isStrictMode check for the strict_types, resolves #59

This release also provides support for parsing PHP7.1 files. However, ReflectionClassConstant and constants with modifiers are not supported yet.

1.1.0

Minor release, that contains several features and important bug-fixes:

  • Added root namespace normalization, resolves #39
  • Resolved all relative paths to be compatibe with original reflection filenames, resolves #31
  • Allow limiting number of files, that can be cached at any given moment
  • Added resizing of the cache size after changing the maximum limit, resolves #35
  • Added support for "self" and "parent" as method parameter type hint
  • Allow to use internal interfaces (e.g. "Traversable") as parameter types
  • Fixed a notice, when using ReflectionClass::hasConstant method
1.0.2

Patch release for #8

1.0.1

Patch release for fixing #5

1.0.0

This is first working version of ParserReflection :registered: library with almost compatible Reflection API. Enjoy!

1.0.0-alpha

First working version of ReflectionEngine with full emulation of original Reflection classes.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings