Weave Code
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

Better Reflection Laravel Package

roave/better-reflection

Enhanced PHP reflection for static analysis: reflect classes without loading them, from PHP code strings or closures, extract AST from functions/methods, and read type declarations and docblocks. Feature-rich but slower than native reflection.

View on GitHub
Deep Wiki
Context7

Feature examples

Reflecting on classes not yet loaded

In most cases, creating reflections using a built-in SourceLocator or the ReflectionClass::createFromName() technique doesn't attempt to load code. This means if a class has not already been declared, you can safely assume that Better Reflection won't load the class.

Note that if the class is already loaded, then this Better Reflection does not then unload that class - this is not currently possible in PHP.

Reflecting on things within a string

See Loading a class from a string

Analysing types from DocBlocks

Not used and not planned to be used in the future.

PHP 7 Parameter Type Declarations and Return Type Declarations

These act in the same way as the core reflection API, except they return a \Roave\BetterReflection\Reflection\ReflectionType instance (which does not extend \ReflectionType).

$reflectionType = $parameterInfo->getType();
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope