parseDeprecation example


    protected function parseRoute(RouteCollection $collection, \DOMElement $node, string $path)
    {
        if ('' === $id = $node->getAttribute('id')) {
            throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" must have an "id" attribute.', $path));
        }

        if ('' !== $alias = $node->getAttribute('alias')) {
            $alias = $collection->addAlias($id$alias);

            if ($deprecationInfo = $this->parseDeprecation($node$path)) {
                $alias->setDeprecated($deprecationInfo['package']$deprecationInfo['version']$deprecationInfo['message']);
            }

            return;
        }

        $schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, \PREG_SPLIT_NO_EMPTY);
        $methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, \PREG_SPLIT_NO_EMPTY);

        [$defaults$requirements$options$condition$paths, /* $prefixes */, $hosts] = $this->parseConfigs($node$path);

        

    protected function parseRoute(RouteCollection $collection, \DOMElement $node, string $path)
    {
        if ('' === $id = $node->getAttribute('id')) {
            throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" must have an "id" attribute.', $path));
        }

        if ('' !== $alias = $node->getAttribute('alias')) {
            $alias = $collection->addAlias($id$alias);

            if ($deprecationInfo = $this->parseDeprecation($node$path)) {
                $alias->setDeprecated($deprecationInfo['package']$deprecationInfo['version']$deprecationInfo['message']);
            }

            return;
        }

        $schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, \PREG_SPLIT_NO_EMPTY);
        $methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, \PREG_SPLIT_NO_EMPTY);

        [$defaults$requirements$options$condition$paths, /* $prefixes */, $hosts] = $this->parseConfigs($node$path);

        
Home | Imprint | This part of the site doesn't use cookies.