diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 665f28f45934c075f6fa142437c3dace9b1a5a53..b953e3eedd3930fce12149f96e3e42d26ada64cb 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -2130,11 +2130,6 @@ parameters: count: 1 path: ../../typo3/sysext/fluid/Classes/View/StandaloneView.php - - - message: "#^Method TYPO3\\\\CMS\\\\Fluid\\\\View\\\\TemplatePaths\\:\\:ensureAbsolutePath\\(\\) should return string but returns array\\.$#" - count: 1 - path: ../../typo3/sysext/fluid/Classes/View/TemplatePaths.php - - message: "#^Method TYPO3\\\\CMS\\\\Fluid\\\\ViewHelpers\\\\Be\\\\Menus\\\\ActionMenuViewHelper\\:\\:compile\\(\\) should return string but returns null\\.$#" count: 1 diff --git a/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php b/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php index 83ad0cd7541e1b666ce2bf6dc0507c007ee64885..af81e8546eb90a9f5d577e8ab343c77cdede9427 100644 --- a/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php +++ b/typo3/sysext/fluid/Classes/Core/Cache/FluidTemplateCache.php @@ -34,16 +34,15 @@ class FluidTemplateCache extends PhpFrontend implements FluidCacheInterface /** * @param null $name */ - public function flush($name = null) + public function flush($name = null): void { parent::flush(); } /** * @param string $entryIdentifier - * @return mixed */ - public function get($entryIdentifier) + public function get($entryIdentifier): mixed { return $this->requireOnce($entryIdentifier); } @@ -54,7 +53,7 @@ class FluidTemplateCache extends PhpFrontend implements FluidCacheInterface * @param int $lifetime * @throws InvalidDataException */ - public function set($entryIdentifier, $sourceCode, array $tags = [], $lifetime = null) + public function set($entryIdentifier, $sourceCode, array $tags = [], $lifetime = null): void { if (str_starts_with($sourceCode, '<?php')) { // Remove opening PHP tag; it is added by the cache backend to which @@ -64,10 +63,7 @@ class FluidTemplateCache extends PhpFrontend implements FluidCacheInterface parent::set($entryIdentifier, $sourceCode, $tags, time() + 86400); } - /** - * @return FluidCacheWarmerInterface - */ - public function getCacheWarmer() + public function getCacheWarmer(): FluidCacheWarmerInterface { return new StandardCacheWarmer(); } diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolverFactory.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolverFactory.php index c5e0a05b61987fe20e40f8616b902eb73ffc4d54..b7a97b561c58ffcdd5f79d33725b110562b0ee5d 100644 --- a/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolverFactory.php +++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolverFactory.php @@ -35,12 +35,8 @@ use Psr\Container\ContainerInterface; */ final class ViewHelperResolverFactory implements ViewHelperResolverFactoryInterface { - private ContainerInterface $container; - - public function __construct( - ContainerInterface $container - ) { - $this->container = $container; + public function __construct(private readonly ContainerInterface $container) + { } public function create(): ViewHelperResolver diff --git a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php index 7b74e292da7a416dc3700187f639781ea96f39dd..0f510f83522cbb8c4565974e5e24e5b6c6109d37 100644 --- a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php +++ b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php @@ -29,10 +29,9 @@ use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException; abstract class AbstractTemplateView extends Typo3FluidAbstractTemplateView { /** - * @param RenderingContextInterface|null $context * @internal */ - public function __construct(RenderingContextInterface $context = null) + public function __construct(?RenderingContextInterface $context = null) { if (!$context) { $context = GeneralUtility::makeInstance(RenderingContextFactory::class)->create(); @@ -41,10 +40,9 @@ abstract class AbstractTemplateView extends Typo3FluidAbstractTemplateView } /** - * @param string $templateName * @internal */ - public function setTemplate($templateName) + public function setTemplate(string $templateName): void { $this->baseRenderingContext->setControllerAction($templateName); } diff --git a/typo3/sysext/fluid/Classes/View/TemplatePaths.php b/typo3/sysext/fluid/Classes/View/TemplatePaths.php index d04870eb00b30b7a9e0d326a48ec1571d476d30e..7798cbc36d0e4dd4424d25cc1f277f4b5afac97b 100644 --- a/typo3/sysext/fluid/Classes/View/TemplatePaths.php +++ b/typo3/sysext/fluid/Classes/View/TemplatePaths.php @@ -45,11 +45,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths */ protected $templatePathAndFilename; - /** - * @param string $extensionKey - * @return string|null - */ - protected function getExtensionPrivateResourcesPath($extensionKey) + protected function getExtensionPrivateResourcesPath(string $extensionKey): ?string { $extensionKey = trim($extensionKey); if ($extensionKey && ExtensionManagementUtility::isLoaded($extensionKey)) { @@ -58,19 +54,12 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths return null; } - /** - * @return ConfigurationManager - */ - protected function getConfigurationManager() + protected function getConfigurationManager(): ConfigurationManagerInterface { return GeneralUtility::makeInstance(ConfigurationManager::class); } - /** - * @param string $extensionKey - * @return array - */ - protected function getContextSpecificViewConfiguration($extensionKey) + protected function getContextSpecificViewConfiguration(string $extensionKey): array { if (empty($extensionKey)) { return []; @@ -123,7 +112,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths * * @param string $packageName */ - public function fillDefaultsByPackageName($packageName) + public function fillDefaultsByPackageName($packageName): void { $this->fillFromConfigurationArray($this->getContextSpecificViewConfiguration($packageName)); } @@ -131,7 +120,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths /** * Overridden setter with enforced sorting behavior */ - public function setTemplateRootPaths(array $templateRootPaths) + public function setTemplateRootPaths(array $templateRootPaths): void { parent::setTemplateRootPaths( ArrayUtility::sortArrayWithIntegerKeys($templateRootPaths) @@ -141,7 +130,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths /** * Overridden setter with enforced sorting behavior */ - public function setLayoutRootPaths(array $layoutRootPaths) + public function setLayoutRootPaths(array $layoutRootPaths): void { parent::setLayoutRootPaths( ArrayUtility::sortArrayWithIntegerKeys($layoutRootPaths) @@ -151,7 +140,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths /** * Overridden setter with enforced sorting behavior */ - public function setPartialRootPaths(array $partialRootPaths) + public function setPartialRootPaths(array $partialRootPaths): void { parent::setPartialRootPaths( ArrayUtility::sortArrayWithIntegerKeys($partialRootPaths) @@ -163,7 +152,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths * * @return string Returns the absolute path to a Fluid template file */ - public function getTemplatePathAndFilename() + public function getTemplatePathAndFilename(): string { return $this->templatePathAndFilename; } @@ -174,10 +163,9 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths * relative path or a FILE: or EXT: reference * but cannot be a FAL resource identifier. * - * @param mixed $reference - * @return string + * @param string|array $reference */ - protected function ensureAbsolutePath($reference) + protected function ensureAbsolutePath($reference): array|string { if (!is_array($reference)) { return PathUtility::isAbsolutePath($reference) ? $reference : GeneralUtility::getFileAbsFileName($reference);