LeanMapper\Reflection\PropertyFilters::__construct PHP Method

__construct() public method

public __construct ( string $definition )
$definition string
    public function __construct($definition)
    {
        foreach (preg_split('#\\s*\\|\\s*#', trim($definition)) as $set) {
            if ($set === '') {
                $this->filters[] = $this->targetedArgs[] = [];
                continue;
            }
            $filters = $targetedArgs = [];
            foreach (preg_split('#\\s*,\\s*#', $set) as $filter) {
                $matches = [];
                preg_match('~^([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)(?:#(.*))?$~', $filter, $matches);
                if (empty($matches)) {
                    throw new InvalidAnnotationException("Malformed filter name given: '{$filter}'.");
                }
                $filterName = $matches[1];
                if (isset($filters[$filterName])) {
                    unset($filters[$filterName], $targetedArgs[$filterName]);
                }
                $filters[$filterName] = $filterName;
                if (isset($matches[2])) {
                    $targetedArgs[$filterName] = [$matches[2]];
                }
            }
            $this->filters[] = $filters;
            $this->targetedArgs[] = $targetedArgs;
        }
    }