Skip to content

Commit

Permalink
Merge pull request #325 from web-vision/fix/phpstan-issues
Browse files Browse the repository at this point in the history
Resolve phpstan issues that block the pipeline
  • Loading branch information
NarkNiro authored May 3, 2024
2 parents 4ace9a0 + 4ab6cfd commit 74584e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
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

0 comments on commit 74584e2

Please sign in to comment.