Skip to content

Commit

Permalink
[TASK] Cleanup GoogleFontHook
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Oct 10, 2024
1 parent 6efbddc commit 59576f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
8 changes: 0 additions & 8 deletions Build/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -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\\)\\.$#"
Expand Down
22 changes: 4 additions & 18 deletions Classes/Hooks/PageRenderer/GoogleFontHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,22 @@
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;

/**
* GoogleFontHook
*/
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() ||
Expand All @@ -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) {
Expand Down

0 comments on commit 59576f0

Please sign in to comment.