open-serializer / type
PHP Type Tools
Installs: 18 605
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- phpdocumentor/reflection-docblock: ^5.2.2
- webmozart/assert: ^1.9
Requires (Dev)
- phpstan/phpstan: ^0.12
- phpstan/phpstan-phpunit: ^0.12.17
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.4
This package is not auto-updated.
Last update: 2024-11-17 09:31:56 UTC
README
class Foo { /** @return array<int> */ public function test(): array { return []; } } $typeResolver = new PropertyTypeResolvers( new TypedPropertyResolver(), new DocBlockPropertyResolver(), ); $classInfo = new ReflectionClass(Foo::class); $methodInfo = $classInfo->getMethod('test'); $typeInfo = $typeResolver->resolveMethodType($classInfo, $methodInfo);