src/Articus/DataTransfer/Metadata/Reader/Annotation.php
protected static function readPropertyAnnotations(\ReflectionProperty &$property, AnnotationReader &$reader)
	{
		$dataMap = [];
		$strategyMap = [];
		$validatorsMap = [];
		foreach ($reader->getPropertyAnnotations($property) as $annotation)
		{
			switch (true)
			{
				case ($annotation instanceof DT\Annotation\Data):
					$dataMap[$annotation->subset] = $annotation;
					break;
				case ($annotation instanceof DT\Annotation\Strategy):
					$strategyMap[$annotation->subset] = $annotation;
					break;
				case ($annotation instanceof DT\Annotation\Validator):
					$validatorsMap[$annotation->subset][] = $annotation;
					break;
			}
		}
		foreach ($dataMap as $subset => $data)
		{
			$strategy = isset($strategyMap[$subset])? $strategyMap[$subset] : null;
			$validators = isset($validatorsMap[$subset])? $validatorsMap[$subset] : [];
			yield $subset => [$data, $strategy, $validators];
		}
	}
protected static function readPropertyAnnotations(\ReflectionProperty &$property, AnnotationReader &$reader)
	{
		$dataMap = [];
		$strategyMap = [];
		$validatorsMap = [];
		foreach ($reader->getPropertyAnnotations($property) as $annotation)
		{
			switch (true)
			{
				case ($annotation instanceof DT\Annotation\Data):
					$dataMap[$annotation->subset] = $annotation;
					break;
				case ($annotation instanceof DT\Annotation\Strategy):
					$strategyMap[$annotation->subset] = $annotation;
					break;
				case ($annotation instanceof DT\Annotation\Validator):
					$validatorsMap[$annotation->subset][] = $annotation;
					break;
			}
		}
		foreach ($dataMap as $subset => $data)
		{
			$strategy = isset($strategyMap[$subset])? $strategyMap[$subset] : null;
			$validators = isset($validatorsMap[$subset])? $validatorsMap[$subset] : [];
			yield $subset => [$data, $strategy, $validators];
		}
	}
protected static function readPropertyAnnotations ( \ ReflectionProperty & $ property , AnnotationReader & $ reader ) { $ dataMap = [ ] ; $ strategyMap = [ ] ; $ validatorsMap = [ ] ; foreach ( $ reader -> getPropertyAnnotations ( $ property ) as $ annotation ) { switch ( true ) { case ( $ annotation instanceof DT \ Annotation \ Data ) : $ dataMap [ $ annotation -> subset ] = $ annotation ; break ; case ( $ annotation instanceof DT \ Annotation \ Strategy ) : $ strategyMap [ $ annotation -> subset ] = $ annotation ; break ; case ( $ annotation instanceof DT \ Annotation \ Validator ) : $ validatorsMap [ $ annotation -> subset ] [ ] = $ annotation ; break ; } } foreach ( $ dataMap as $ subset => $ data ) { $ strategy = isset ( $ strategyMap [ $ subset ] ) ? $ strategyMap [ $ subset ] : null ; $ validators = isset ( $ validatorsMap [ $ subset ] ) ? $ validatorsMap [ $ subset ] : [ ] ; yield $ subset => [ $ data , $ strategy , $ validators ] ; } }
Reads and groups up annotations for specified property
@param \ReflectionProperty $property
@param AnnotationReader $reader
@return \Generator
Reads and groups up annotations for specified property