diff --git a/Build/php-cs-fixer.php b/Build/php-cs-fixer.php index cc2c923a..16494b66 100644 --- a/Build/php-cs-fixer.php +++ b/Build/php-cs-fixer.php @@ -2,7 +2,7 @@ $config = \TYPO3\CodingStandards\CsFixerConfig::create(); $config->getFinder()->exclude(['var'])->in(__DIR__ . '/..'); -$config->setRules([ +$config->addRules([ 'nullable_type_declaration' => [ 'syntax' => 'question_mark', ], diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php index 443197d7..29a4cbb6 100644 --- a/Build/phpunit/FunctionalTestsBootstrap.php +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -1,4 +1,5 @@ gridRenderer = $gridRenderer; $this->runtimeCache = $runtimeCache; } diff --git a/Classes/Backend/Preview/GridRenderer.php b/Classes/Backend/Preview/GridRenderer.php index cab8df5a..92cfcc5f 100644 --- a/Classes/Backend/Preview/GridRenderer.php +++ b/Classes/Backend/Preview/GridRenderer.php @@ -18,7 +18,6 @@ use B13\Container\Domain\Factory\Exception; use B13\Container\Domain\Factory\PageView\Backend\ContainerFactory; use B13\Container\Events\BeforeContainerPreviewIsRenderedEvent; -use B13\Container\Events\BeforeContainerPreviewIsRenderedEventV12; use B13\Container\Tca\Registry; use Psr\EventDispatcher\EventDispatcherInterface; use TYPO3\CMS\Backend\Utility\BackendUtility; @@ -36,7 +35,6 @@ class GridRenderer { - protected Registry $tcaRegistry; protected ContainerFactory $containerFactory; protected NewContentUrlBuilder $newContentUrlBuilder; diff --git a/Classes/ContentDefender/Xclasses/CommandMapHook.php b/Classes/ContentDefender/Xclasses/CommandMapHook.php index 13c95800..159c8e4b 100644 --- a/Classes/ContentDefender/Xclasses/CommandMapHook.php +++ b/Classes/ContentDefender/Xclasses/CommandMapHook.php @@ -40,8 +40,7 @@ public function __construct( public function processCmdmap_beforeStart(DataHandler $dataHandler): void { - if (isset($dataHandler->cmdmap['pages'])) - { + if (isset($dataHandler->cmdmap['pages'])) { $this->containerColumnConfigurationService->startCmdMap(); } if (!empty($dataHandler->cmdmap['tt_content'])) { diff --git a/Classes/ContentDefender/Xclasses/DatamapHook.php b/Classes/ContentDefender/Xclasses/DatamapHook.php index faed0e25..8e68d33b 100644 --- a/Classes/ContentDefender/Xclasses/DatamapHook.php +++ b/Classes/ContentDefender/Xclasses/DatamapHook.php @@ -13,7 +13,6 @@ */ use B13\Container\ContentDefender\ContainerColumnConfigurationService; -use B13\Container\Hooks\Datahandler\Database; use B13\Container\Hooks\Datahandler\DatahandlerProcess; use IchHabRecht\ContentDefender\Hooks\DatamapDataHandlerHook; use IchHabRecht\ContentDefender\Repository\ContentRepository; @@ -29,7 +28,6 @@ class DatamapHook extends DatamapDataHandlerHook */ protected $containerColumnConfigurationService; - public function __construct( ?ContentRepository $contentRepository = null, ?ContainerColumnConfigurationService $containerColumnConfigurationService = null diff --git a/Classes/DataProcessing/ContainerProcessor.php b/Classes/DataProcessing/ContainerProcessor.php index 8fc0fc26..ada39778 100644 --- a/Classes/DataProcessing/ContainerProcessor.php +++ b/Classes/DataProcessing/ContainerProcessor.php @@ -24,7 +24,6 @@ class ContainerProcessor implements DataProcessorInterface { - /** * @var ContentDataProcessor */ diff --git a/Classes/Domain/Factory/FrontendContainerFactory.php b/Classes/Domain/Factory/FrontendContainerFactory.php index f25c5dee..6fc6a5a8 100644 --- a/Classes/Domain/Factory/FrontendContainerFactory.php +++ b/Classes/Domain/Factory/FrontendContainerFactory.php @@ -21,7 +21,6 @@ class FrontendContainerFactory implements SingletonInterface { - protected Registry $tcaRegistry; public function __construct(Registry $tcaRegistry) diff --git a/Classes/Events/BeforeContainerPreviewIsRenderedEvent.php b/Classes/Events/BeforeContainerPreviewIsRenderedEvent.php index 665827d6..b56efe3b 100644 --- a/Classes/Events/BeforeContainerPreviewIsRenderedEvent.php +++ b/Classes/Events/BeforeContainerPreviewIsRenderedEvent.php @@ -24,7 +24,7 @@ final class BeforeContainerPreviewIsRenderedEvent protected StandaloneView $view; protected Grid $grid; - + protected GridColumnItem $item; public function __construct(Container $container, StandaloneView $view, Grid $grid, GridColumnItem $item) diff --git a/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php b/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php index 32b2e7ef..6d0d358b 100644 --- a/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php +++ b/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php @@ -65,7 +65,7 @@ protected function copyToLanguageChildren(int $uid, int $language, string $comma 'target' => $pos, 'action' => 'paste', 'update' => [], - ] + ], ]]]; $localDataHandler = GeneralUtility::makeInstance(DataHandler::class); $localDataHandler->enableLogging = $dataHandler->enableLogging; @@ -88,8 +88,8 @@ protected function copyToLanguageChildren(int $uid, int $language, string $comma 'action' => 'paste', 'update' => [ 'tx_container_parent' => $containerId, - ] - ] + ], + ], ]]]; $localDataHandler = GeneralUtility::makeInstance(DataHandler::class); $localDataHandler->enableLogging = $dataHandler->enableLogging; diff --git a/Classes/Hooks/Datahandler/DatamapPreProcessFieldArrayHook.php b/Classes/Hooks/Datahandler/DatamapPreProcessFieldArrayHook.php index 7756fb77..205f9090 100644 --- a/Classes/Hooks/Datahandler/DatamapPreProcessFieldArrayHook.php +++ b/Classes/Hooks/Datahandler/DatamapPreProcessFieldArrayHook.php @@ -17,7 +17,6 @@ use B13\Container\Domain\Service\ContainerService; use B13\Container\Tca\Registry; use TYPO3\CMS\Core\DataHandling\DataHandler; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; class DatamapPreProcessFieldArrayHook diff --git a/Classes/Listener/PageContentPreviewRendering.php b/Classes/Listener/PageContentPreviewRendering.php index fe960b5b..b6cf70db 100644 --- a/Classes/Listener/PageContentPreviewRendering.php +++ b/Classes/Listener/PageContentPreviewRendering.php @@ -34,7 +34,7 @@ public function __invoke(PageContentPreviewRenderingEvent $event): void } $record = $event->getRecord(); - if (!$this->tcaRegistry->isContainerElement( (string) $record['CType'])) { + if (!$this->tcaRegistry->isContainerElement((string)$record['CType'])) { return; } $record['tx_container_grid'] = $this->gridRenderer->renderGrid($record, $event->getPageLayoutContext()); diff --git a/Classes/Tca/Registry.php b/Classes/Tca/Registry.php index 8e22be93..2e4b10d4 100644 --- a/Classes/Tca/Registry.php +++ b/Classes/Tca/Registry.php @@ -67,7 +67,6 @@ public function configureContainer(ContainerConfiguration $containerConfiguratio } $GLOBALS['TCA']['tt_content']['types'][$containerConfiguration->getCType()]['previewRenderer'] = \B13\Container\Backend\Preview\ContainerPreviewRenderer::class; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() >= 13) { if (!isset($GLOBALS['TCA']['tt_content']['types'][$containerConfiguration->getCType()]['creationOptions'])) { $GLOBALS['TCA']['tt_content']['types'][$containerConfiguration->getCType()]['creationOptions'] = []; diff --git a/Tests/Acceptance/Backend/ContentDefenderCest.php b/Tests/Acceptance/Backend/ContentDefenderCest.php index ddb6bca2..efcb31e9 100644 --- a/Tests/Acceptance/Backend/ContentDefenderCest.php +++ b/Tests/Acceptance/Backend/ContentDefenderCest.php @@ -277,7 +277,6 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer( $I->seeElement('#EditDocumentController'); } - /** * @group content_defender */ @@ -302,5 +301,4 @@ public function seeEditDocumentWhenAddingChildrenToColposWhereOnlyHeaderIsAllowe $I->see('header', 'select'); $I->dontSee('Images Only', 'select'); } - } diff --git a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php index 81cb00f3..a9daaf97 100644 --- a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php +++ b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php @@ -12,9 +12,6 @@ * of the License, or any later version. */ -use Codeception\Event\SuiteEvent; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; class BackendContainerEnvironment extends BackendEnvironment diff --git a/Tests/Functional/Datahandler/ContentDefender/AbstractContentDefender.php b/Tests/Functional/Datahandler/ContentDefender/AbstractContentDefender.php index 607a8904..b6315520 100644 --- a/Tests/Functional/Datahandler/ContentDefender/AbstractContentDefender.php +++ b/Tests/Functional/Datahandler/ContentDefender/AbstractContentDefender.php @@ -31,4 +31,4 @@ protected function setUp(): void $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); } } -} \ No newline at end of file +} diff --git a/Tests/Functional/Frontend/DefaultLanguageTest.php b/Tests/Functional/Frontend/DefaultLanguageTest.php index 22b37322..e85ad1f0 100644 --- a/Tests/Functional/Frontend/DefaultLanguageTest.php +++ b/Tests/Functional/Frontend/DefaultLanguageTest.php @@ -82,7 +82,6 @@ public function canRenderContainerFromOtherPage(): void $body = (string)$response->getBody(); $body = $this->prepareContent($body); self::assertStringContainsString('

left side (201)

child
1]; $contentObjectRenderer = $this->getMockBuilder(ContentObjectRenderer::class)->disableOriginalConstructor()->getMock(); - $contentObjectRenderer->expects($this->never())->method('stdWrap'); + $contentObjectRenderer->expects(self::never())->method('stdWrap'); $context = $this->getMockBuilder(Context::class)->getMock(); $contentDataProcessor = $this->getMockBuilder(ContentDataProcessor::class)->disableOriginalConstructor()->getMock(); $frontendContainerFactory = $this->getMockBuilder(FrontendContainerFactory::class)->disableOriginalConstructor()->getMock(); - $frontendContainerFactory->expects($this->once())->method('buildContainer')->with( - $contentObjectRenderer, $context, 1 + $frontendContainerFactory->expects(self::once())->method('buildContainer')->with( + $contentObjectRenderer, + $context, + 1 )->willReturn(new Container([], [])); $containerProcessor = new ContainerProcessor($contentDataProcessor, $context, $frontendContainerFactory); $containerProcessor->process($contentObjectRenderer, [], $processorConfiguration, []); @@ -49,12 +51,14 @@ public function configuredContentIdStdWrapIsUsed(): void { $processorConfiguration = ['contentId' => 1, 'contentId.' => 'foo']; $contentObjectRenderer = $this->getMockBuilder(ContentObjectRenderer::class)->disableOriginalConstructor()->getMock(); - $contentObjectRenderer->expects($this->once())->method('stdWrap')->with(1, 'foo')->willReturn(2); + $contentObjectRenderer->expects(self::once())->method('stdWrap')->with(1, 'foo')->willReturn(2); $context = $this->getMockBuilder(Context::class)->getMock(); $contentDataProcessor = $this->getMockBuilder(ContentDataProcessor::class)->disableOriginalConstructor()->getMock(); $frontendContainerFactory = $this->getMockBuilder(FrontendContainerFactory::class)->disableOriginalConstructor()->getMock(); - $frontendContainerFactory->expects($this->once())->method('buildContainer')->with( - $contentObjectRenderer, $context, 2 + $frontendContainerFactory->expects(self::once())->method('buildContainer')->with( + $contentObjectRenderer, + $context, + 2 )->willReturn(new Container([], [])); $containerProcessor = new ContainerProcessor($contentDataProcessor, $context, $frontendContainerFactory); $containerProcessor->process($contentObjectRenderer, [], $processorConfiguration, []); @@ -67,12 +71,14 @@ public function canBeCalledWithoutContentId(): void { $processorConfiguration = ['contentId.' => 'foo']; $contentObjectRenderer = $this->getMockBuilder(ContentObjectRenderer::class)->disableOriginalConstructor()->getMock(); - $contentObjectRenderer->expects($this->once())->method('stdWrap')->with('', 'foo')->willReturn(2); + $contentObjectRenderer->expects(self::once())->method('stdWrap')->with('', 'foo')->willReturn(2); $context = $this->getMockBuilder(Context::class)->getMock(); $contentDataProcessor = $this->getMockBuilder(ContentDataProcessor::class)->disableOriginalConstructor()->getMock(); $frontendContainerFactory = $this->getMockBuilder(FrontendContainerFactory::class)->disableOriginalConstructor()->getMock(); - $frontendContainerFactory->expects($this->once())->method('buildContainer')->with( - $contentObjectRenderer, $context, 2 + $frontendContainerFactory->expects(self::once())->method('buildContainer')->with( + $contentObjectRenderer, + $context, + 2 )->willReturn(new Container([], [])); $containerProcessor = new ContainerProcessor($contentDataProcessor, $context, $frontendContainerFactory); $containerProcessor->process($contentObjectRenderer, [], $processorConfiguration, []); @@ -85,15 +91,16 @@ public function nullIsUsedForFactoryIfNoContentIdIsGiven(): void { $processorConfiguration = []; $contentObjectRenderer = $this->getMockBuilder(ContentObjectRenderer::class)->disableOriginalConstructor()->getMock(); - $contentObjectRenderer->expects($this->never())->method('stdWrap'); + $contentObjectRenderer->expects(self::never())->method('stdWrap'); $context = $this->getMockBuilder(Context::class)->getMock(); $contentDataProcessor = $this->getMockBuilder(ContentDataProcessor::class)->disableOriginalConstructor()->getMock(); $frontendContainerFactory = $this->getMockBuilder(FrontendContainerFactory::class)->disableOriginalConstructor()->getMock(); - $frontendContainerFactory->expects($this->once())->method('buildContainer')->with( - $contentObjectRenderer, $context, null + $frontendContainerFactory->expects(self::once())->method('buildContainer')->with( + $contentObjectRenderer, + $context, + null )->willReturn(new Container([], [])); $containerProcessor = new ContainerProcessor($contentDataProcessor, $context, $frontendContainerFactory); $containerProcessor->process($contentObjectRenderer, [], $processorConfiguration, []); } - } diff --git a/ext_localconf.php b/ext_localconf.php index 9b48370d..52f87fb4 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -60,7 +60,7 @@ = B13\Container\Updates\ContainerDeleteChildrenWithWrongPid::class; } - if(TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(TYPO3\CMS\Core\Information\Typo3Version::class)->getMajorVersion() < 12) { + if (TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(TYPO3\CMS\Core\Information\Typo3Version::class)->getMajorVersion() < 12) { $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1729106358] = \B13\Container\Backend\ContextMenu\RecordContextMenuItemProvider::class; } });