src/Metadata/Driver/YamlDriver.php
protected function parseNodes(\ReflectionClass $class, ClassMetadata $metadata, $config)
    {
        if (!isset($config['nodes'])) {
            return;
        }

        if (!is_array($config)) {
            throw new \RuntimeException(sprintf('Invalid YAML configuration for "%s" : "properties" property need to be an array.', $metadata->name));
        }

        foreach ($config['nodes'] as $property => $nodeProperties) {
            foreach ($nodeProperties as $nodeProperty) {
                if (!isset($nodeProperty['namespace']) || !isset($nodeProperty['tag'])) {
                    throw new \RuntimeException(sprintf('Invalid YAML configuration for "%s" : "namespace" and "tag" are required.', $metadata->name));
                }

                $node = new Node([
                    'namespace' => $nodeProperty['namespace'],
                    'tag' => $nodeProperty['tag'],
                ]);

                if ($class->hasProperty($property)) {
                    $metadata->addGraphMetadata($node, new PropertyMetadata($class->name, $property));
                }

                if ($class->hasMethod($property)) {
                    $metadata->addGraphMetadata($node, new MethodMetadata($class->name, $property));
                }
            }
        }
    }
protected function parseNodes(\ReflectionClass $class, ClassMetadata $metadata, $config)
    {
        if (!isset($config['nodes'])) {
            return;
        }

        if (!is_array($config)) {
            throw new \RuntimeException(sprintf('Invalid YAML configuration for "%s" : "properties" property need to be an array.', $metadata->name));
        }

        foreach ($config['nodes'] as $property => $nodeProperties) {
            foreach ($nodeProperties as $nodeProperty) {
                if (!isset($nodeProperty['namespace']) || !isset($nodeProperty['tag'])) {
                    throw new \RuntimeException(sprintf('Invalid YAML configuration for "%s" : "namespace" and "tag" are required.', $metadata->name));
                }

                $node = new Node([
                    'namespace' => $nodeProperty['namespace'],
                    'tag' => $nodeProperty['tag'],
                ]);

                if ($class->hasProperty($property)) {
                    $metadata->addGraphMetadata($node, new PropertyMetadata($class->name, $property));
                }

                if ($class->hasMethod($property)) {
                    $metadata->addGraphMetadata($node, new MethodMetadata($class->name, $property));
                }
            }
        }
    }
protected function parseNodes ( \ ReflectionClass $ class , ClassMetadata $ metadata , $ config ) { if ( ! isset ( $ config [ 'nodes' ] ) ) { return ; } if ( ! is_array ( $ config ) ) { throw new \ RuntimeException ( sprintf ( 'Invalid YAML configuration for "%s" : "properties" property need to be an array.' , $ metadata -> name ) ) ; } foreach ( $ config [ 'nodes' ] as $ property => $ nodeProperties ) { foreach ( $ nodeProperties as $ nodeProperty ) { if ( ! isset ( $ nodeProperty [ 'namespace' ] ) || ! isset ( $ nodeProperty [ 'tag' ] ) ) { throw new \ RuntimeException ( sprintf ( 'Invalid YAML configuration for "%s" : "namespace" and "tag" are required.' , $ metadata -> name ) ) ; } $ node = new Node ( [ 'namespace' => $ nodeProperty [ 'namespace' ] , 'tag' => $ nodeProperty [ 'tag' ] , ] ) ; if ( $ class -> hasProperty ( $ property ) ) { $ metadata -> addGraphMetadata ( $ node , new PropertyMetadata ( $ class -> name , $ property ) ) ; } if ( $ class -> hasMethod ( $ property ) ) { $ metadata -> addGraphMetadata ( $ node , new MethodMetadata ( $ class -> name , $ property ) ) ; } } } }
Parse OpenGraph node properties

@param \ReflectionClass $class
@param ClassMetadata    $metadata
@param mixed            $config
Parse OpenGraph node properties