orisai / reflection-meta
PHP reflection in more reliable and deterministic way - for declarative engines
Installs: 30 033
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: 7.4 - 8.3
- orisai/exceptions: ^1.0.0
- orisai/source-map: ^1.0.0
- orisai/utils: ^1.0.0
Requires (Dev)
- brianium/paratest: ^6.3.0
- doctrine/annotations: ^1.12.1|^2.0.0
- infection/infection: ^0.26.0|^0.27.0|^0.28.0|^0.29.0
- orisai/coding-standard: ^3.0.0
- phpstan/extension-installer: ^1.0.0
- phpstan/phpstan: ^1.0.0
- phpstan/phpstan-deprecation-rules: ^1.0.0
- phpstan/phpstan-phpunit: ^1.0.0
- phpstan/phpstan-strict-rules: ^1.0.0
- phpunit/phpunit: ^9.5.0
- staabm/annotate-pull-request-from-checkstyle: ^1.7.0
README
Reflection Meta
PHP reflection in more reliable and deterministic way - for declarative engines
📄 Check out our documentation.
💸 If you like Orisai, please make a donation. Thank you!
use Orisai\ReflectionMeta\Structure\StructureBuilder; use Orisai\ReflectionMeta\Structure\StructureFlattener; use Orisai\ReflectionMeta\Structure\StructureGrouper; use ReflectionClass; $reflector = new ReflectionClass(ExampleClass::class); $hierarchy = StructureBuilder::build($reflector); $list = StructureFlattener::flatten($hierarchy); $group = StructureGrouper::group($list); var_dump($group); /* StructureGroup( classes: [ ClassStructure(ParentInterface), ClassStructure(ParentTrait), ClassStructure(ParentClass), ClassStructure(ExampleInterface), ClassStructure(ExampleTrait), ClassStructure(ExampleClass), ], constants: [ '::publicConstName' => [ ConstantStructure(ExampleInterface, 'publicConstName'), ], '::protectedConstName' => [ ConstantStructure(ParentClass, 'protectedConstName'), ConstantStructure(ExampleClass, 'protectedConstName'), ], 'ParentClass::privateConstName' => [ ConstantStructure(ParentClass, 'privateConstName'), ], ], properties: [ '::publicPropertyName' => [ PropertyStructure(ExampleClass, 'publicPropertyName'), ], // ... ], methods: [ // ... ], ) */