mirror of
https://github.com/getgrav/grav.git
synced 2026-02-21 05:58:01 +01:00
Fully comply phpstan level2!
This commit is contained in:
@@ -1217,8 +1217,8 @@ class Page implements PageInterface
|
||||
/**
|
||||
* Gets and sets the associated media as found in the page folder.
|
||||
*
|
||||
* @param MediaCollectionInterface|Media $var Representation of associated media.
|
||||
* @return MediaCollectionInterface|Media Representation of associated media.
|
||||
* @param Media $var Representation of associated media.
|
||||
* @return Media Representation of associated media.
|
||||
*/
|
||||
public function media($var = null)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ use Twig\Extension\DebugExtension;
|
||||
use Twig\Extension\StringLoaderExtension;
|
||||
use Twig\Loader\ArrayLoader;
|
||||
use Twig\Loader\ChainLoader;
|
||||
use Twig\Loader\ExistsLoaderInterface;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
@@ -455,13 +456,14 @@ class Twig
|
||||
$twig_extension = $extension ? '.'. $extension .TWIG_EXT : TEMPLATE_EXT;
|
||||
$template_file = $this->template($page->template() . $twig_extension);
|
||||
|
||||
if ($this->twig->getLoader()->exists($template_file)) {
|
||||
$loader = $this->twig->getLoader();
|
||||
if ($loader instanceof ExistsLoaderInterface && $loader->exists($template_file)) {
|
||||
return $template_file;
|
||||
} else {
|
||||
// Default to HTML
|
||||
$page->templateFormat('html');
|
||||
return $template . TEMPLATE_EXT;
|
||||
}
|
||||
|
||||
// Default to HTML
|
||||
$page->templateFormat('html');
|
||||
return $template . TEMPLATE_EXT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ parameters:
|
||||
path: 'system/src/Grav/Common/Page/Pages.php'
|
||||
-
|
||||
message: '#on an unknown class Grav\\Plugin\\Admin#'
|
||||
path: 'system/src/Grav/Common/Page/Flex/PageObject.php'
|
||||
path: 'system/src/Grav/Common/Flex/Pages/PageObject.php'
|
||||
-
|
||||
message: '#Call to method getFlash\(\) on an unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#'
|
||||
path: 'system/src/Grav/Common/Session.php'
|
||||
|
||||
Reference in New Issue
Block a user