diff --git a/Build/phpstan-baseline.neon b/Build/phpstan-baseline.neon index 7892fef6..fec77fcc 100644 --- a/Build/phpstan-baseline.neon +++ b/Build/phpstan-baseline.neon @@ -1,36 +1,6 @@ parameters: ignoreErrors: - - message: "#^Call to method addHeaderContent\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#" + message: "#^Return type \\(TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\QueryResultInterface\\) of method T3G\\\\AgencyPack\\\\Blog\\\\Domain\\\\Repository\\\\PostRepository\\:\\:findAll\\(\\) should be covariant with return type \\(iterable\\\\) of method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\RepositoryInterface\\\\:\\:findAll\\(\\)$#" count: 1 - path: ../Classes/Listener/ModifyPageLayoutContent.php - - - - message: "#^Call to method getRequest\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#" - count: 1 - path: ../Classes/Listener/ModifyPageLayoutContent.php - - - - message: "#^Method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\ModifyPageLayoutContent\\:\\:__invoke\\(\\) has no return type specified\\.$#" - count: 1 - path: ../Classes/Listener/ModifyPageLayoutContent.php - - - - message: "#^Parameter \\$event of method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\ModifyPageLayoutContent\\:\\:__invoke\\(\\) has invalid type TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#" - count: 1 - path: ../Classes/Listener/ModifyPageLayoutContent.php - - - - message: "#^Call to method addContentAbove\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#" - count: 1 - path: ../Classes/Listener/RenderAdditionalContentToRecordList.php - - - - message: "#^Call to method getRequest\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#" - count: 1 - path: ../Classes/Listener/RenderAdditionalContentToRecordList.php - - - - message: "#^Parameter \\$event of method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\RenderAdditionalContentToRecordList\\:\\:__invoke\\(\\) has invalid type TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#" - count: 1 - path: ../Classes/Listener/RenderAdditionalContentToRecordList.php + path: ../Classes/Domain/Repository/PostRepository.php diff --git a/Classes/Controller/PostController.php b/Classes/Controller/PostController.php index b7782943..2adbb042 100644 --- a/Classes/Controller/PostController.php +++ b/Classes/Controller/PostController.php @@ -59,7 +59,7 @@ public function __construct( } /** - * @param ViewInterface|\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view + * @param ViewInterface $view */ protected function initializeView($view): void { diff --git a/Classes/Domain/Model/Author.php b/Classes/Domain/Model/Author.php index 66344b14..81373d87 100644 --- a/Classes/Domain/Model/Author.php +++ b/Classes/Domain/Model/Author.php @@ -54,8 +54,10 @@ public function initializeObject(): void public function getAvatarProvider(): AvatarProviderInterface { - $avatarProvider = trim($this->avatarProvider) !== '' - ? GeneralUtility::makeInstance($this->avatarProvider) + /** @var class-string|'' $avatarProviderClassName */ + $avatarProviderClassName = trim($this->avatarProvider); + $avatarProvider = $avatarProviderClassName !== '' + ? GeneralUtility::makeInstance($avatarProviderClassName) : GeneralUtility::makeInstance(GravatarProvider::class); if (!$avatarProvider instanceof AvatarProviderInterface) { diff --git a/Classes/Domain/Validator/GoogleCaptchaValidator.php b/Classes/Domain/Validator/GoogleCaptchaValidator.php index 9e3a4344..036de106 100644 --- a/Classes/Domain/Validator/GoogleCaptchaValidator.php +++ b/Classes/Domain/Validator/GoogleCaptchaValidator.php @@ -19,7 +19,7 @@ class GoogleCaptchaValidator extends AbstractValidator { protected $acceptsEmptyValues = false; - public function isValid($value): void + public function isValid(mixed $value): void { $action = 'form'; $controller = 'Comment'; diff --git a/Classes/Listener/ModifyPageLayoutContent.php b/Classes/Listener/ModifyPageLayoutContent.php index e1acb0d8..92af357e 100644 --- a/Classes/Listener/ModifyPageLayoutContent.php +++ b/Classes/Listener/ModifyPageLayoutContent.php @@ -23,7 +23,7 @@ public function __construct(BlogPostHeaderContentRenderer $blogPostHeaderContent $this->blogPostHeaderContentRenderer = $blogPostHeaderContentRenderer; } - public function __invoke(ModifyPageLayoutContentEvent $event) + public function __invoke(ModifyPageLayoutContentEvent $event): void { $request = $event->getRequest(); $content = $this->blogPostHeaderContentRenderer->render($request); diff --git a/Classes/Notification/NotificationManager.php b/Classes/Notification/NotificationManager.php index 9a82c928..7646ebbb 100644 --- a/Classes/Notification/NotificationManager.php +++ b/Classes/Notification/NotificationManager.php @@ -35,6 +35,7 @@ public function notify(NotificationInterface $notification): void $notificationId = $notification->getNotificationId(); if (\is_array($this->visitorsRegistry[$notificationId] ?? null)) { foreach ($this->visitorsRegistry[$notificationId] as $visitorClassName) { + /** @var class-string $visitorClassName */ $instance = GeneralUtility::makeInstance($visitorClassName); if ($instance instanceof ProcessorInterface) { $instance->process($notification); diff --git a/Tests/Functional/AvatarProvider/GravatarProviderTest.php b/Tests/Functional/AvatarProvider/GravatarProviderTest.php index 5963dffc..65089f9a 100644 --- a/Tests/Functional/AvatarProvider/GravatarProviderTest.php +++ b/Tests/Functional/AvatarProvider/GravatarProviderTest.php @@ -31,6 +31,7 @@ class GravatarProviderTest extends FunctionalTestCase public function testGetAvatarUrlReturnsOriginalGravatarComUrl(): void { + /** @phpstan-ignore-next-line */ $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); $frontendTypoScript->setSetupArray([]); $request = (new ServerRequest()) @@ -49,6 +50,7 @@ public function testGetAvatarUrlReturnsOriginalGravatarComUrl(): void public function testGetAvatarUrlReturnsTypo3TempUrl(): void { $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['blog']['enableGravatarProxy'] = '1'; + /** @phpstan-ignore-next-line */ $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); $frontendTypoScript->setSetupArray([]); $request = (new ServerRequest()) diff --git a/Tests/Functional/SiteBasedTestCase.php b/Tests/Functional/SiteBasedTestCase.php index 8ef30d9c..f4bdc59c 100644 --- a/Tests/Functional/SiteBasedTestCase.php +++ b/Tests/Functional/SiteBasedTestCase.php @@ -66,8 +66,10 @@ protected function createTestSite(): void GeneralUtility::rmdir($this->instancePath . '/typo3conf/sites/' . $identifier, true); if ((new Typo3Version())->getMajorVersion() >= 13) { + /** @phpstan-ignore-next-line */ $this->get(SiteWriter::class)->write($identifier, $configuration); } else { + /** @phpstan-ignore-next-line */ $this->get(SiteConfiguration::class)->write($identifier, $configuration); } } diff --git a/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php b/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php index a46b3b26..c4df1cb4 100644 --- a/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php @@ -36,6 +36,7 @@ final class GravatarViewHelperTest extends FunctionalTestCase #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { + /** @phpstan-ignore-next-line */ $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); $frontendTypoScript->setSetupArray([]); $request = (new ServerRequest()) diff --git a/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php b/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php index 1c00926d..e2dc2cfe 100644 --- a/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php @@ -37,6 +37,7 @@ final class AvatarViewHelperTest extends FunctionalTestCase #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { + /** @phpstan-ignore-next-line */ $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); $frontendTypoScript->setSetupArray([]); $request = (new ServerRequest())