protected function getExtension(IView $view) : string
    {
        // Find a registered extension that the view's path ends with
        foreach (array_keys($this->compilers) as $extension) {
            $lengthDifference = strlen($view->getPath()) - strlen($extension);

            if ($lengthDifference >= 0 && strpos($view->getPath(), $extension, $lengthDifference) !== false) {
                return $extension;
            }
        }

        throw new InvalidArgumentException("No extension registered for path \"{$view->getPath()}\"");
    }
protected function getExtension(IView $view) : string
    {
        // Find a registered extension that the view's path ends with
        foreach (array_keys($this->compilers) as $extension) {
            $lengthDifference = strlen($view->getPath()) - strlen($extension);

            if ($lengthDifference >= 0 && strpos($view->getPath(), $extension, $lengthDifference) !== false) {
                return $extension;
            }
        }

        throw new InvalidArgumentException("No extension registered for path \"{$view->getPath()}\"");
    }
protected function getExtension ( IView $ view ) : string { // Find a registered extension that the view's path ends with foreach ( array_keys ( $ this -> compilers ) as $ extension ) { $ lengthDifference = strlen ( $ view -> getPath ( ) ) - strlen ( $ extension ) ; if ( $ lengthDifference >= 0 && strpos ( $ view -> getPath ( ) , $ extension , $ lengthDifference ) !== false ) { return $ extension ; } } throw new InvalidArgumentException ( "No extension registered for path \"{$view->getPath()}\"" ) ; }
Gets the extension for a view

@param IView $view The view whose extension we're getting
@return string The view's extension
@throws InvalidArgumentException Thrown if no extension was found
Gets the extension for a view