DiDom\Query::parseProperty PHP 메소드

parseProperty() 보호된 정적인 메소드

protected static parseProperty ( string $property ) : array
$property string
리턴 array
    protected static function parseProperty($property)
    {
        $name = '(?P<name>[\\w\\-]*)';
        $args = '(?:\\((?P<args>[^\\)]+)\\))';
        $regexp = '/(?:' . $name . $args . '?)?/is';
        if (preg_match($regexp, $property, $segments)) {
            $result = [];
            $result['name'] = $segments['name'];
            $result['args'] = isset($segments['args']) ? explode('|', $segments['args']) : [];
            return $result;
        }
        throw new RuntimeException('Invalid selector');
    }