Skip to content

Commit

Permalink
[TASK] Rector to PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrodala committed Apr 22, 2024
1 parent 125f417 commit b690f0d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions Classes/DataCollector/TCA/PlainValueProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Events/AfterIndexRunEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Feature/CompletionSuggestFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Hook/DynamicFlexFormHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Preview/SimplePreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/ExtconfService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b690f0d

Please sign in to comment.