BetterReflectionTest\Reflection\ReflectionFunctionAbstractTest::testGetDocBlockReturnTypes PHP Метод

testGetDocBlockReturnTypes() публичный Метод

    public function testGetDocBlockReturnTypes()
    {
        $php = '<?php
            /**
             * @return bool
             */
            function foo() {}';
        $reflector = new FunctionReflector(new StringSourceLocator($php));
        $function = $reflector->reflect('foo');
        $types = $function->getDocBlockReturnTypes();
        $this->assertInternalType('array', $types);
        $this->assertCount(1, $types);
        $this->assertInstanceOf(Boolean::class, $types[0]);
    }