lib/DTL/Glob/Parser/SelectorParser.php
public function parse($selector)
    {
        if ('/' === $selector) {
            return array();
        }

        if ('/' !== substr($selector, 0, 1)) {
            throw new \InvalidArgumentException(sprintf(
                'Path "%s" must be absolute',
                $selector
            ));
        }

        $selector = substr($selector, 1);

        $segments = array();
        $elements = explode('/', $selector);

        foreach ($elements as $index => $element) {
            if ($this->processWildcard($element)) {
                $flags = self::T_PATTERN;
            } else {
                $flags = self::T_STATIC;
            }

            if ($index === (count($elements) - 1)) {
                $flags = $flags | self::T_LAST;
            }

            $segments[] = array($element, $flags);
        }

        return $segments;
    }
public function parse($selector)
    {
        if ('/' === $selector) {
            return array();
        }

        if ('/' !== substr($selector, 0, 1)) {
            throw new \InvalidArgumentException(sprintf(
                'Path "%s" must be absolute',
                $selector
            ));
        }

        $selector = substr($selector, 1);

        $segments = array();
        $elements = explode('/', $selector);

        foreach ($elements as $index => $element) {
            if ($this->processWildcard($element)) {
                $flags = self::T_PATTERN;
            } else {
                $flags = self::T_STATIC;
            }

            if ($index === (count($elements) - 1)) {
                $flags = $flags | self::T_LAST;
            }

            $segments[] = array($element, $flags);
        }

        return $segments;
    }
public function parse ( $ selector ) { if ( '/' === $ selector ) { return array ( ) ; } if ( '/' !== substr ( $ selector , 0 , 1 ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Path "%s" must be absolute' , $ selector ) ) ; } $ selector = substr ( $ selector , 1 ) ; $ segments = array ( ) ; $ elements = explode ( '/' , $ selector ) ; foreach ( $ elements as $ index => $ element ) { if ( $ this -> processWildcard ( $ element ) ) { $ flags = self :: T_PATTERN ; } else { $ flags = self :: T_STATIC ; } if ( $ index === ( count ( $ elements ) - 1 ) ) { $ flags = $ flags | self :: T_LAST ; } $ segments [ ] = array ( $ element , $ flags ) ; } return $ segments ; }
Parse the given selector.

Returns an associative array of path elements to bitmasks.

@return array
Parse the given selector .