From bfda1c67f9ca310f1c6ac8bc29208d65db55a43a Mon Sep 17 00:00:00 2001 From: Nikita Hovratov Date: Tue, 5 Sep 2023 17:01:47 +0200 Subject: [PATCH] [BUGFIX] Hand over parent caller object in itemsProcFunc Fixes: #585 --- Build/phpstan/phpstan-baseline.neon | 10 ++++++++++ Classes/ItemsProcFuncs/CTypeList.php | 4 ++-- Classes/ItemsProcFuncs/ColPosList.php | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 0e17c029..d17602c4 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -615,11 +615,21 @@ parameters: count: 1 path: ../../Classes/ItemsProcFuncs/CTypeList.php + - + message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\CTypeList\\:\\:itemsProcFunc\\(\\) has parameter \\$parentObj with no type specified\\.$#" + count: 1 + path: ../../Classes/ItemsProcFuncs/CTypeList.php + - message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\ColPosList\\:\\:itemsProcFunc\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#" count: 1 path: ../../Classes/ItemsProcFuncs/ColPosList.php + - + message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\ColPosList\\:\\:itemsProcFunc\\(\\) has parameter \\$parentObj with no type specified\\.$#" + count: 1 + path: ../../Classes/ItemsProcFuncs/ColPosList.php + - message: "#^Method MASK\\\\Mask\\\\Loader\\\\JsonLoader\\:\\:__construct\\(\\) has parameter \\$maskExtensionConfiguration with no value type specified in iterable type array\\.$#" count: 1 diff --git a/Classes/ItemsProcFuncs/CTypeList.php b/Classes/ItemsProcFuncs/CTypeList.php index 89b5bfab..ccfcc7a9 100644 --- a/Classes/ItemsProcFuncs/CTypeList.php +++ b/Classes/ItemsProcFuncs/CTypeList.php @@ -36,7 +36,7 @@ public function __construct(TableDefinitionCollection $tableDefinitionCollection /** * Render the allowed CTypes for nested content elements */ - public function itemsProcFunc(array &$params): void + public function itemsProcFunc(array &$params, $parentObj): void { // if this tt_content element is inline element of mask if ((int)$params['row']['colPos'] === 999) { @@ -74,7 +74,7 @@ public function itemsProcFunc(array &$params): void GeneralUtility::callUserFunction( $params['config']['m_itemsProcFunc'], $params, - $this + $parentObj ); } } diff --git a/Classes/ItemsProcFuncs/ColPosList.php b/Classes/ItemsProcFuncs/ColPosList.php index 64aadc28..7b6d02cf 100644 --- a/Classes/ItemsProcFuncs/ColPosList.php +++ b/Classes/ItemsProcFuncs/ColPosList.php @@ -29,7 +29,7 @@ class ColPosList * Render the allowed colPos for nested content elements * @param array $params */ - public function itemsProcFunc(&$params): void + public function itemsProcFunc(&$params, $parentObj): void { // if this tt_content element is inline element of mask if ((int)$params['row']['colPos'] === 999) { @@ -49,7 +49,7 @@ public function itemsProcFunc(&$params): void GeneralUtility::callUserFunction( $params['config']['m_itemsProcFunc'], $params, - $this + $parentObj ); } }