Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve phpstan issues that block the pipeline #325

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Build/phpstan/Core11/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ parameters:
count: 1
path: ../../../Classes/Override/Core11/DatabaseRecordList.php

-
message: "#^Cannot call method fetch\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#"
count: 1
path: ../../../Classes/Override/Core11/DeeplRecordListController.php

-
message: "#^Method WebVision\\\\WvDeepltranslate\\\\Override\\\\LocalizationController\\:\\:process\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -251,8 +256,8 @@ parameters:
path: ../../../Tests/Functional/Fixtures/Frontend/PhpError.php

-
message: "#^Cannot access offset 'tx_wvdeepltranslate…' on array\\<string, mixed\\>\\|false\\.$#"
count: 2
message: "#^Call to an undefined method Doctrine\\\\DBAL\\\\Result\\:\\:fetch\\(\\)\\.$#"
count: 1
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
Expand Down Expand Up @@ -325,11 +330,6 @@ parameters:
count: 1
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, array\\<string, mixed\\>\\|false given\\.$#"
count: 2
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
message: "#^Parameter \\#2 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#"
count: 1
Expand Down
10 changes: 0 additions & 10 deletions Build/phpstan/Core12/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,6 @@ parameters:
count: 1
path: ../../../Tests/Functional/Fixtures/Frontend/PhpError.php

-
message: "#^Cannot access offset 'tx_wvdeepltranslate…' on array\\<string, mixed\\>\\|false\\.$#"
count: 2
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
message: "#^Method WebVision\\\\WvDeepltranslate\\\\Tests\\\\Functional\\\\Hooks\\\\TranslateHookTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -330,11 +325,6 @@ parameters:
count: 1
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, array\\<string, mixed\\>\\|false given\\.$#"
count: 2
path: ../../../Tests/Functional/Hooks/TranslateHookTest.php

-
message: "#^Cannot access property \\$code on DeepL\\\\Language\\|null\\.$#"
count: 7
Expand Down
9 changes: 7 additions & 2 deletions Classes/Upgrades/GlossaryUpgradeWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ public function executeUpdate(): bool

$updateGlossary = [];
foreach ($result as $item) {
$updateGlossary[] = [
$formatItem = [
'uid' => $item['uid'],
'pid' => $item['pid'],
'tstamp' => $item['tstamp'],
'crdate' => $item['crdate'],
'cruser_id' => $item['cruser_id'],
'deleted' => $item['deleted'],
'hidden' => $item['hidden'],
'sys_language_uid' => $item['sys_language_uid'],
Expand All @@ -81,6 +80,12 @@ public function executeUpdate(): bool
'l10n_diffsource' => $item['l10n_diffsource'],
'term' => $item['term'],
];

if ((new Typo3Version())->getMajorVersion() < 12) {
$formatItem['cruser_id'] = $item['cruser_id'];
}

$updateGlossary[] = $formatItem;
}

$insert = GeneralUtility::makeInstance(ConnectionPool::class)
Expand Down