Nextras\Orm\Entity\Reflection\ModifierParser::matchModifiers PHP Метод

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

public matchModifiers ( string $input ) : array
$input string
Результат array
    public function matchModifiers($input)
    {
        preg_match_all('#
			\\{(
				(?:
					' . self::RE_STRING . ' |
					[^}]
				)++
			)\\}#x', $input, $matches);
        return $matches[1];
    }

Usage Example

Пример #1
0
 protected function parseAnnotationValue(PropertyMetadata $property, $propertyComment)
 {
     if (!$propertyComment) {
         return;
     }
     $matches = $this->modifierParser->matchModifiers($propertyComment);
     foreach ($matches as $macroContent) {
         try {
             $args = $this->modifierParser->parse($macroContent, $this->currentReflection);
         } catch (InvalidModifierDefinitionException $e) {
             throw new InvalidModifierDefinitionException("Invalid modifier definition for {$this->currentReflection->name}::\${$property->name} property.", 0, $e);
         }
         $this->processPropertyModifier($property, $args[0], $args[1]);
     }
 }