diff --git a/ChangeLog b/ChangeLog index 53c288b..f545ffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-09-07 Francois Suter (Idéative) + + * Ensure compatibility with PHP 8 + 2021-04-06 Francois Suter (Idéative) * Ensure compatibility with TYPO3 11, drop support for TYPO3 8 and 9 diff --git a/Classes/Service/ConnectorBase.php b/Classes/Service/ConnectorBase.php index 4f666ed..19155fc 100644 --- a/Classes/Service/ConnectorBase.php +++ b/Classes/Service/ConnectorBase.php @@ -157,7 +157,8 @@ abstract public function fetchArray($parameters): array; */ public function postProcessOperations($parameters, $status) { - if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->extensionKey]['postProcessOperations'])) { + $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->extensionKey]['postProcessOperations'] ?? null; + if (is_array($hooks)) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->extensionKey]['postProcessOperations'] as $className) { $processor = GeneralUtility::makeInstance($className); $processor->postProcessOperations($parameters, $status, $this); diff --git a/Classes/Utility/FileUtility.php b/Classes/Utility/FileUtility.php index aecf7ab..67df84d 100644 --- a/Classes/Utility/FileUtility.php +++ b/Classes/Utility/FileUtility.php @@ -63,12 +63,9 @@ public function getFileContent($uri, $headers = null) $key = array_shift($uriParts); $key = strtoupper($key); // Check if a corresponding key exists - if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['svconnector']['fileReader']) && array_key_exists( - $key, - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['svconnector']['fileReader'] - )) { + $reader = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['svconnector']['fileReader'][$key] ?? null; + if ($reader) { /** @var AbstractFileReader $readerObject */ - $reader = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['svconnector']['fileReader'][$key]; $readerObject = GeneralUtility::makeInstance($reader, $this); // Check inheritance and read data if okay if ($readerObject instanceof AbstractFileReader) {