bundle/Menu/Factory/LocationFactory.php
protected function getExtension(Location $location): ExtensionInterface
    {
        foreach ($this->extensions as $extension) {
            if ($extension->matches($location)) {
                return $extension;
            }
        }

        return $this->fallbackExtension;
    }
protected function getExtension(Location $location): ExtensionInterface
    {
        foreach ($this->extensions as $extension) {
            if ($extension->matches($location)) {
                return $extension;
            }
        }

        return $this->fallbackExtension;
    }
protected function getExtension ( Location $ location ) : ExtensionInterface { foreach ( $ this -> extensions as $ extension ) { if ( $ extension -> matches ( $ location ) ) { return $ extension ; } } return $ this -> fallbackExtension ; }
Returns the first extension that matches the provided location.

If none match, fallback extension is returned.
Returns the first extension that matches the provided location .