protected function getSelfMatchingValue(
        SimpleXMLElement $content,
        array $matches = [],
        ?string $alias = null
    ): array {
        $name = $matches[1];
        $key = $matches[2];
        $meta = $matches[3];

        $item = [];
        $uses = ($key == '@' ? $meta : "{$key},{$meta}");

        if (\is_null($alias)) {
            $alias = $name;
        }

        $collection = $this->getValue($content, \sprintf('%s[%s]', $name, $uses));

        foreach ((array) $collection as $collect) {
            $v = $collect[$meta];

            if ($key == '@') {
                $item[$alias][] = $v;
            } else {
                $item[$collect[$key]] = $v;
            }
        }

        return $item;
    }
protected function getSelfMatchingValue(
        SimpleXMLElement $content,
        array $matches = [],
        ?string $alias = null
    ): array {
        $name = $matches[1];
        $key = $matches[2];
        $meta = $matches[3];

        $item = [];
        $uses = ($key == '@' ? $meta : "{$key},{$meta}");

        if (\is_null($alias)) {
            $alias = $name;
        }

        $collection = $this->getValue($content, \sprintf('%s[%s]', $name, $uses));

        foreach ((array) $collection as $collect) {
            $v = $collect[$meta];

            if ($key == '@') {
                $item[$alias][] = $v;
            } else {
                $item[$collect[$key]] = $v;
            }
        }

        return $item;
    }
protected function getSelfMatchingValue ( SimpleXMLElement $ content , array $ matches = [ ] , ? string $ alias = null ) : array { $ name = $ matches [ 1 ] ; $ key = $ matches [ 2 ] ; $ meta = $ matches [ 3 ] ; $ item = [ ] ; $ uses = ( $ key == '@' ? $ meta : "{$key},{$meta}" ) ; if ( \ is_null ( $ alias ) ) { $ alias = $ name ; } $ collection = $ this -> getValue ( $ content , \ sprintf ( '%s[%s]' , $ name , $ uses ) ) ; foreach ( ( array ) $ collection as $ collect ) { $ v = $ collect [ $ meta ] ; if ( $ key == '@' ) { $ item [ $ alias ] [ ] = $ v ; } else { $ item [ $ collect [ $ key ] ] = $ v ; } } return $ item ; }
Get self matching value.

@param  \SimpleXMLElement  $content
@param  array  $matches
@param  string|null  $alias

@return array
Get self matching value .