private function setDefinitionTags(Definition $definition, array $array)
    {
        if (isset($array['tags'])) {
            if (!is_array($array['tags'])) {
                throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s".', $id));
            }

            foreach ($array['tags'] as $tag) {
                if (!isset($tag['name'])) {
                    throw new InvalidArgumentException(sprintf(
                        'A "tags" entry is missing a "name" key for service "%s".',
                        $id
                    ));
                }

                $name = $tag['name'];
                unset($tag['name']);

                foreach ($tag as $attribute => $value) {
                    if (!is_scalar($value)) {
                        throw new InvalidArgumentException(sprintf(
                            'A "tags" attribute must be of a scalar-type for service "%s", tag "%s".',
                            $id,
                            $name
                        ));
                    }
                }

                $definition->addTag($name, $tag);
            }
        }
    }
private function setDefinitionTags(Definition $definition, array $array)
    {
        if (isset($array['tags'])) {
            if (!is_array($array['tags'])) {
                throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s".', $id));
            }

            foreach ($array['tags'] as $tag) {
                if (!isset($tag['name'])) {
                    throw new InvalidArgumentException(sprintf(
                        'A "tags" entry is missing a "name" key for service "%s".',
                        $id
                    ));
                }

                $name = $tag['name'];
                unset($tag['name']);

                foreach ($tag as $attribute => $value) {
                    if (!is_scalar($value)) {
                        throw new InvalidArgumentException(sprintf(
                            'A "tags" attribute must be of a scalar-type for service "%s", tag "%s".',
                            $id,
                            $name
                        ));
                    }
                }

                $definition->addTag($name, $tag);
            }
        }
    }
private function setDefinitionTags ( Definition $ definition , array $ array ) { if ( isset ( $ array [ 'tags' ] ) ) { if ( ! is_array ( $ array [ 'tags' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Parameter "tags" must be an array for service "%s".' , $ id ) ) ; } foreach ( $ array [ 'tags' ] as $ tag ) { if ( ! isset ( $ tag [ 'name' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'A "tags" entry is missing a "name" key for service "%s".' , $ id ) ) ; } $ name = $ tag [ 'name' ] ; unset ( $ tag [ 'name' ] ) ; foreach ( $ tag as $ attribute => $ value ) { if ( ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( sprintf ( 'A "tags" attribute must be of a scalar-type for service "%s", tag "%s".' , $ id , $ name ) ) ; } } $ definition -> addTag ( $ name , $ tag ) ; } } }
Set the definition tags into definition object if it exists.

@param Definition $definition definition object to hydrate
@param array      $array      raw definition datas
Set the definition tags into definition object if it exists .