From e3d064b4f01ef3bb2cebea06f690611df1d66f8d Mon Sep 17 00:00:00 2001 From: Mathias Brodala Date: Mon, 22 Apr 2024 15:02:20 +0900 Subject: [PATCH 1/3] [TASK] Use PHP 8.1 for development by default --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b3fee4f..6323b99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: app: - image: thecodingmachine/php:${PHP_VERSION:-8.0}-v4-cli + image: thecodingmachine/php:${PHP_VERSION:-8.1}-v4-cli environment: TYPO3_VERSION: ${TYPO3_VERSION:-^11.5} typo3DatabaseHost: mysql From a09b5f33dddebb332f5b84e1cceab1c5065dbea4 Mon Sep 17 00:00:00 2001 From: Mathias Brodala Date: Mon, 22 Apr 2024 15:08:19 +0900 Subject: [PATCH 2/3] [TASK] Drop support for PHP 8.0 --- .github/workflows/ci.yml | 1 - composer.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5aa1a..a07c118 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: strategy: matrix: php: - - '8.0' - '8.1' typo3: - '^11.5' diff --git a/composer.json b/composer.json index 8410883..8a106e6 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "elasticsearch/elasticsearch": "^5.0 || ^7.0", "symfony/polyfill-php80": "^1.26", "typo3/cms-backend": "^11.5", From 6a5f53b7493391c891b0ea3ca7a433ec570300c8 Mon Sep 17 00:00:00 2001 From: Mathias Brodala Date: Mon, 22 Apr 2024 15:09:36 +0900 Subject: [PATCH 3/3] [TASK] Rector to PHP 8.1 --- Classes/Controller/BackendController.php | 4 ++-- Classes/DataCollector/TCA/PlainValueProcessor.php | 4 ++-- Classes/Events/AfterIndexRunEvent.php | 2 +- Classes/Feature/CompletionSuggestFeature.php | 2 +- Classes/Hook/DynamicFlexFormHook.php | 2 +- Classes/Preview/SimplePreviewRenderer.php | 2 +- Classes/Service/ExtconfService.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 90a4e35..572bbae 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -23,7 +23,7 @@ class BackendController extends ActionController * @var IndexerFactory $indexerFactory */ protected $indexerFactory; - public function __construct(private ModuleTemplateFactory $moduleTemplateFactory) + public function __construct(private readonly ModuleTemplateFactory $moduleTemplateFactory) { } @@ -104,7 +104,7 @@ public function requestAction($url = '', $body = ''): ResponseInterface if ($url != '') { $result = $this->request($url, $body); - $this->view->assign('response', json_decode($result['body'], true)); + $this->view->assign('response', json_decode((string) $result['body'], true)); $resultColor = match ($result['status']) { '200' => 'success', diff --git a/Classes/DataCollector/TCA/PlainValueProcessor.php b/Classes/DataCollector/TCA/PlainValueProcessor.php index 2451bcf..9603125 100644 --- a/Classes/DataCollector/TCA/PlainValueProcessor.php +++ b/Classes/DataCollector/TCA/PlainValueProcessor.php @@ -41,7 +41,7 @@ public function processCheckboxField($value, $fieldTca) foreach ($activeItemKeys as $key) { $label = $fieldTca['items'][$key][0]; - if (str_starts_with($label, 'LLL:')) { + if (str_starts_with((string) $label, 'LLL:')) { $label = $this->getLanguageService()->sL($label); } @@ -71,7 +71,7 @@ public function processRadioField($value, $fieldTca) } } - if (str_starts_with($label, 'LLL:')) { + if (str_starts_with((string) $label, 'LLL:')) { $label = $this->getLanguageService()->sL($label); } diff --git a/Classes/Events/AfterIndexRunEvent.php b/Classes/Events/AfterIndexRunEvent.php index d4bddd0..562b159 100644 --- a/Classes/Events/AfterIndexRunEvent.php +++ b/Classes/Events/AfterIndexRunEvent.php @@ -5,7 +5,7 @@ final class AfterIndexRunEvent { - public function __construct(private bool $fullIndexing, private int $elapsedTime) + public function __construct(private readonly bool $fullIndexing, private readonly int $elapsedTime) { } diff --git a/Classes/Feature/CompletionSuggestFeature.php b/Classes/Feature/CompletionSuggestFeature.php index b9cb560..95be33b 100644 --- a/Classes/Feature/CompletionSuggestFeature.php +++ b/Classes/Feature/CompletionSuggestFeature.php @@ -96,7 +96,7 @@ protected function splitFields($fields = []) $splittedContent = []; if (!empty($fields)) { foreach ($fields as $field) { - $split = preg_split($this->config['splitRegex'], $field); + $split = preg_split($this->config['splitRegex'], (string) $field); $splittedContent = array_merge($splittedContent, $split); } } diff --git a/Classes/Hook/DynamicFlexFormHook.php b/Classes/Hook/DynamicFlexFormHook.php index 8b0ff3c..c8c2529 100644 --- a/Classes/Hook/DynamicFlexFormHook.php +++ b/Classes/Hook/DynamicFlexFormHook.php @@ -34,7 +34,7 @@ class DynamicFlexFormHook public function parseDataStructureByIdentifierPostProcess($dataStructure, $identifier) { if ($identifier['tableName'] == 'tt_content' && $identifier['fieldName'] == 'pi_flexform' && in_array($identifier['dataStructureKey'], $this->allowedIdentifiers)) { - [$pluginKey, $listType] = explode(",", $identifier['dataStructureKey']); + [$pluginKey, $listType] = explode(",", (string) $identifier['dataStructureKey']); $dataStructure['sheets']['features'] = $this->buildFlexSettingsFromTSSettings($pluginKey); } return $dataStructure; diff --git a/Classes/Preview/SimplePreviewRenderer.php b/Classes/Preview/SimplePreviewRenderer.php index cd4f8d4..ccd0b37 100644 --- a/Classes/Preview/SimplePreviewRenderer.php +++ b/Classes/Preview/SimplePreviewRenderer.php @@ -27,7 +27,7 @@ public function render($record) { $rawfield = $record[$this->config['field']]; - $processedField = substr($rawfield, 0, 200) . "..."; + $processedField = substr((string) $rawfield, 0, 200) . "..."; return $processedField; } diff --git a/Classes/Service/ExtconfService.php b/Classes/Service/ExtconfService.php index 2e9c545..cec0f9f 100644 --- a/Classes/Service/ExtconfService.php +++ b/Classes/Service/ExtconfService.php @@ -160,7 +160,7 @@ public function getUpdateIndex() */ public function getHostsSettings() { - $hosts = explode(",", $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['searchable']['extensionManagement']['connection']['hosts']); + $hosts = explode(",", (string) $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['searchable']['extensionManagement']['connection']['hosts']); return $hosts; }