From 089fd4c5825d1423bb0f2e0812b7faadd6d85298 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Tue, 24 Jan 2023 16:04:45 +0100 Subject: [PATCH] [BUGFIX] Fix PHP 8 warning in AbstractPlugin Resolves: #98630 Releases: main, 11.5 Change-Id: Iae48bf68a9f18a33e86d79cf7826617e2b3d48c6 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77570 Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: core-ci <typo3@b13.com> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> --- Build/phpstan/phpstan-baseline.neon | 2 +- typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 90bfa97cda4b..4510f51b4a20 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -4277,7 +4277,7 @@ parameters: - message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#" - count: 2 + count: 1 path: ../../typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php - diff --git a/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php b/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php index fa5e96b4c951..7a0b5f6617ac 100644 --- a/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php +++ b/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php @@ -1391,7 +1391,7 @@ class AbstractPlugin */ public function pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF') { - $sheetArray = is_array($T3FlexForm_array) ? $T3FlexForm_array['data'][$sheet][$lang] : ''; + $sheetArray = $T3FlexForm_array['data'][$sheet][$lang] ?? ''; if (is_array($sheetArray)) { return $this->pi_getFFvalueFromSheetArray($sheetArray, explode('/', $fieldName), $value); } -- GitLab