Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build/php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down
1 change: 1 addition & 0 deletions Build/phpunit/FunctionalTestsBootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of the TYPO3 CMS project.
*
Expand Down
1 change: 1 addition & 0 deletions Build/phpunit/UnitTestsBootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of the TYPO3 CMS project.
*
Expand Down
4 changes: 2 additions & 2 deletions Classes/Backend/Preview/ContainerPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* of the License, or any later version.
*/


use TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer;
use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
Expand All @@ -24,7 +23,8 @@ class ContainerPreviewRenderer extends StandardContentPreviewRenderer
protected GridRenderer $gridRenderer;
protected FrontendInterface $runtimeCache;

public function __construct(GridRenderer $gridRenderer, FrontendInterface $runtimeCache) {
public function __construct(GridRenderer $gridRenderer, FrontendInterface $runtimeCache)
{
$this->gridRenderer = $gridRenderer;
$this->runtimeCache = $runtimeCache;
}
Expand Down
2 changes: 0 additions & 2 deletions Classes/Backend/Preview/GridRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,7 +35,6 @@

class GridRenderer
{

protected Registry $tcaRegistry;
protected ContainerFactory $containerFactory;
protected NewContentUrlBuilder $newContentUrlBuilder;
Expand Down
3 changes: 1 addition & 2 deletions Classes/ContentDefender/Xclasses/CommandMapHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
2 changes: 0 additions & 2 deletions Classes/ContentDefender/Xclasses/DatamapHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,7 +28,6 @@ class DatamapHook extends DatamapDataHandlerHook
*/
protected $containerColumnConfigurationService;


public function __construct(
?ContentRepository $contentRepository = null,
?ContainerColumnConfigurationService $containerColumnConfigurationService = null
Expand Down
1 change: 0 additions & 1 deletion Classes/DataProcessing/ContainerProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

class ContainerProcessor implements DataProcessorInterface
{

/**
* @var ContentDataProcessor
*/
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Factory/FrontendContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

class FrontendContainerFactory implements SingletonInterface
{

protected Registry $tcaRegistry;

public function __construct(Registry $tcaRegistry)
Expand Down
2 changes: 1 addition & 1 deletion Classes/Events/BeforeContainerPreviewIsRenderedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Classes/Listener/PageContentPreviewRendering.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion Classes/Tca/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = [];
Expand Down
2 changes: 0 additions & 2 deletions Tests/Acceptance/Backend/ContentDefenderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
$I->seeElement('#EditDocumentController');
}


/**
* @group content_defender
*/
Expand All @@ -302,5 +301,4 @@ public function seeEditDocumentWhenAddingChildrenToColposWhereOnlyHeaderIsAllowe
$I->see('header', 'select');
$I->dontSee('Images Only', 'select');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ protected function setUp(): void
$GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);
}
}
}
}
1 change: 0 additions & 1 deletion Tests/Functional/Frontend/DefaultLanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public function canRenderContainerFromOtherPage(): void
$body = (string)$response->getBody();
$body = $this->prepareContent($body);
self::assertStringContainsString('<h2>left side (201)</h2><div class="left-children"><h6 class="left-children">child</h6><div id="c2"', $body);

}

/**
Expand Down
33 changes: 20 additions & 13 deletions Tests/Unit/DataProcessing/ContainerProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ public function configuredContentIdIsUsed(): void
{
$processorConfiguration = ['contentId' => 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, []);
Expand All @@ -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, []);
Expand All @@ -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, []);
Expand All @@ -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, []);
}

}
2 changes: 1 addition & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Loading