Neos\Flow\Reflection\ReflectionService::getPropertyTagValues PHP Метод

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

Returns the values of the specified class property tag
public getPropertyTagValues ( string $className, string $propertyName, string $tag ) : array
$className string Name of the class containing the property
$propertyName string Name of the tagged property
$tag string Tag to return the values of
Результат array An array of values or an empty array if the tag was not found
    public function getPropertyTagValues($className, $propertyName, $tag)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName])) {
            return [];
        }
        return isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tag]) ? $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tag] : [];
    }

Usage Example

 /**
  * @test
  */
 public function booleanPropertiesGetANormlizedType()
 {
     $className = Reflection\Fixtures\DummyClassWithProperties::class;
     $varTagValues = $this->reflectionService->getPropertyTagValues($className, 'boolProperty', 'var');
     $this->assertCount(1, $varTagValues);
     $this->assertEquals('boolean', $varTagValues[0]);
     $varTagValues = $this->reflectionService->getPropertyTagValues($className, 'booleanProperty', 'var');
     $this->assertCount(1, $varTagValues);
     $this->assertEquals('boolean', $varTagValues[0]);
 }
All Usage Examples Of Neos\Flow\Reflection\ReflectionService::getPropertyTagValues
ReflectionService