diff --git a/Build/phpstan-baseline.neon b/Build/phpstan-baseline.neon index 6978167d0..42e124650 100644 --- a/Build/phpstan-baseline.neon +++ b/Build/phpstan-baseline.neon @@ -1,13 +1,5 @@ parameters: ignoreErrors: - - - message: """ - #^Return type of method BK2K\\\\BootstrapPackage\\\\Hooks\\\\PageRenderer\\\\GoogleFontHook\\:\\:getTemplateService\\(\\) has typehint with deprecated class TYPO3\\\\CMS\\\\Core\\\\TypoScript\\\\TemplateService\\: - This class should not be used anymore, last core usages will be removed during v12\\. - Using methods or properties of this class will start logging deprecation messages\\.$# - """ - count: 1 - path: ../Classes/Hooks/PageRenderer/GoogleFontHook.php - message: "#^Variable method call on \\$this\\(BK2K\\\\BootstrapPackage\\\\Utility\\\\ExternalMediaUtility\\)\\.$#" diff --git a/Classes/Hooks/PageRenderer/GoogleFontHook.php b/Classes/Hooks/PageRenderer/GoogleFontHook.php index 0e9f60b8b..0f8226526 100644 --- a/Classes/Hooks/PageRenderer/GoogleFontHook.php +++ b/Classes/Hooks/PageRenderer/GoogleFontHook.php @@ -13,6 +13,7 @@ use BK2K\BootstrapPackage\Service\GoogleFontService; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Http\ApplicationType; +use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -20,24 +21,14 @@ */ class GoogleFontHook { - /** - * @var array - */ - protected $includeMapping = [ + protected array $includeMapping = [ 'includeCSSLibs' => 'cssLibs', 'includeCSS' => 'cssFiles', ]; - /** - * @var \BK2K\BootstrapPackage\Service\GoogleFontService - */ - protected $googleFontService; + protected ?GoogleFontService $googleFontService = null; - /** - * @param array $params - * @param \TYPO3\CMS\Core\Page\PageRenderer $pagerenderer - */ - public function execute(&$params, &$pagerenderer): void + public function execute(array &$params, PageRenderer &$pagerenderer): void { if (!($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface || !ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend() || @@ -63,11 +54,6 @@ public function execute(&$params, &$pagerenderer): void } } - /** - * Get the google font service - * - * @return GoogleFontService - */ protected function getGoogleFontService(): GoogleFontService { if ($this->googleFontService === null) {