PHP Type Tools

Maintainers

Package info

github.com/open-serializer/type

pkg:composer/open-serializer/type

Statistics

Installs: 25 255

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2021-03-12 22:14 UTC

This package is not auto-updated.

Last update: 2026-03-08 15:40:04 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);