Skip to content

Commit 06ea3d0

Browse files
committed
[WIP] ContentAreaProcessor
1 parent 41e2907 commit 06ea3d0

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Build/phpstan13.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ parameters:
1212
- %currentWorkingDirectory%/Classes/Listener/PageContentPreviewRendering.php
1313
- %currentWorkingDirectory%/Classes/Listener/ManipulateBackendLayoutColPosConfigurationForPage.php
1414
- %currentWorkingDirectory%/Classes/Hooks/Datahandler/ContentElementRestriction
15+
- %currentWorkingDirectory%/Classes/DataProcessing/ContentAreaProcessor.php
1516

Classes/DataProcessing/ContentAreaProcessor.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* of the License, or any later version.
1313
*/
1414

15+
use function array_map;
1516
use B13\Container\Domain\Factory\FrontendContainerFactory;
1617
use B13\Container\Tca\Registry;
1718
use Psr\Log\LoggerInterface;
@@ -26,9 +27,8 @@
2627
use TYPO3\CMS\Core\Utility\GeneralUtility;
2728
use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor;
2829
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
29-
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
3030

31-
use function array_map;
31+
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
3232

3333
/**
3434
* Automatically detects if content element has container columns
@@ -49,12 +49,10 @@
4949
*
5050
* html:
5151
* <f:render.contentArea contentArea="{content.200}" />
52-
*
5352
*/
5453
#[Autoconfigure(public: true)]
5554
readonly class ContentAreaProcessor implements DataProcessorInterface
5655
{
57-
5856
public function __construct(
5957
protected ContentDataProcessor $contentDataProcessor,
6058
protected Context $context,
@@ -63,7 +61,8 @@ public function __construct(
6361
protected RecordFactory $recordFactory,
6462
protected Typo3Version $typo3Version,
6563
protected LoggerInterface $logger,
66-
) {}
64+
) {
65+
}
6766

6867
public function process(
6968
ContentObjectRenderer $cObj,
@@ -98,7 +97,7 @@ function () use (&$container, $CType, $cObj, $record, $colPos): ContentArea {
9897

9998
$rows = $container->getChildrenByColPos($colPos);
10099

101-
$records = array_map(fn($row) => $this->recordFactory->createFromDatabaseRow('tt_content', $row), $rows);
100+
$records = array_map(fn ($row) => $this->recordFactory->createFromDatabaseRow('tt_content', $row), $rows);
102101
return new ContentArea(
103102
(string)$colPos,
104103
$this->tcaRegistry->getColPosName($record['CType'], $colPos),

Tests/Functional/Frontend/DefaultLanguageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function childrenAreRendered(): void
4545
public function childrenAreRenderedContentArea(): void
4646
{
4747
if (((float)(new Typo3Version())->getBranch()) < 14.2) {
48-
$this->markTestSkipped('Content area rendering is only supported in TYPO3 v14.2 and above');
48+
self::markTestSkipped('Content area rendering is only supported in TYPO3 v14.2 and above');
4949
}
5050

5151
$this->importCSVDataSet(__DIR__ . '/Fixtures/default_language_ContentArea.csv');

0 commit comments

Comments
 (0)