resetGlobals example

return $collection;
        }

        foreach ($class->getMethods() as $method) {
            $this->defaultRouteIndex = 0;
            foreach ($this->getAnnotations($method) as $annot) {
                $this->addRoute($collection$annot$globals$class$method);
            }
        }

        if (0 === $collection->count() && $class->hasMethod('__invoke')) {
            $globals = $this->resetGlobals();
            foreach ($this->getAnnotations($class) as $annot) {
                $this->addRoute($collection$annot$globals$class$class->getMethod('__invoke'));
            }
        }

        return $collection;
    }

    /** * @param RouteAnnotation $annot or an object that exposes a similar interface * * @return void */
if ('__invoke' === $method->name) {
                        $fqcnAlias = true;
                    }
                }

                if (1 === $collection->count() - \count($routeNamesBefore)) {
                    $newRouteName = current(array_diff(array_keys($collection->all())$routeNamesBefore));
                    $collection->addAlias(sprintf('%s::%s', $class->name, $method->name)$newRouteName);
                }
            }
            if (0 === $collection->count() && $class->hasMethod('__invoke')) {
                $globals = $this->resetGlobals();
                foreach ($this->getAnnotations($class) as $annot) {
                    $this->addRoute($collection$annot$globals$class$class->getMethod('__invoke'));
                    $fqcnAlias = true;
                }
            }
            if ($fqcnAlias && 1 === $collection->count()) {
                $collection->addAlias($class->name, $invokeRouteName = key($collection->all()));
                $collection->addAlias(sprintf('%s::__invoke', $class->name)$invokeRouteName);
            }

            if ($this->hasDeprecatedAnnotations) {
                
Home | Imprint | This part of the site doesn't use cookies.