Reflection that accounts for features that are in static analysers, but aren't in the language yet.
- Reflection for classes, traits, interfaces and enums
- Generics (reflect and substitute)
- Type system
- Built-in types reflection
- Anonymous classes
- Blazing fast cache
- Support for
strict_types=false
- Conditional types
- Type aliases
- Extensions reflection (spl, zip, ds, dom etc)
- PHP dynamic properties/methods:
__get
,__set
,__call
,__callStatic
,__isset
,__unset
,@property
,@method
,@mixin
- value types:
true
,false
(both reported asbool
),T1|T2|null
(reported as?(T1|T2)
),null
,123
,1.0
,'string'
,'string'|'other'
,Foo::SOME_CONSTANT
,Foo::SOME_*
,SOME_CONSTANT
,SOME_CONSTANT|OTHER_CONSTANT
(all reported as error types) - special primitive types:
positive-int
,int<0, 100>
,int-mask<1, 2, 4>
(both reported asint
),non-empty-array
(reported asarray
),callable-string
,numeric-string
,non-empty-string
(reported asstring
) - array shapes:
array{'foo': int, "bar": string}
,array{int, int}
Install dependencies:
docker run -it --rm -v $PWD:/app -w /app composer install
Run tests:
docker run -it --rm -v $PWD:/app -w /app php:7.4-cli vendor/bin/pest
Run php-cs-fixer on self:
docker run -it --rm -v $PWD:/app -w /app composer cs-fix