Skip to content

Commit db1ca81

Browse files
committed
chore: Update PHPStan and its plugins
1 parent ca1aeb7 commit db1ca81

File tree

14 files changed

+109
-220
lines changed

14 files changed

+109
-220
lines changed

.phpstan-baseline.neon

+2-92
Original file line numberDiff line numberDiff line change
@@ -3220,11 +3220,6 @@ parameters:
32203220
count: 1
32213221
path: engine/Library/Enlight/Template/Plugins/block.stripLines.php
32223222

3223-
-
3224-
message: "#^Function smarty_block_stripLines\\(\\) never returns void so it can be removed from the return type\\.$#"
3225-
count: 1
3226-
path: engine/Library/Enlight/Template/Plugins/block.stripLines.php
3227-
32283223
-
32293224
message: "#^Method Smarty_Compiler_Config\\:\\:compile\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
32303225
count: 1
@@ -11855,36 +11850,6 @@ parameters:
1185511850
count: 1
1185611851
path: engine/Shopware/Commands/DatabaseSetupCommand.php
1185711852

11858-
-
11859-
message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardDisableCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
11860-
count: 1
11861-
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php
11862-
11863-
-
11864-
message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#"
11865-
count: 2
11866-
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php
11867-
11868-
-
11869-
message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
11870-
count: 1
11871-
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php
11872-
11873-
-
11874-
message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardEnableCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
11875-
count: 1
11876-
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php
11877-
11878-
-
11879-
message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#"
11880-
count: 2
11881-
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php
11882-
11883-
-
11884-
message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
11885-
count: 1
11886-
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php
11887-
1188811853
-
1188911854
message: "#^Method Shopware\\\\Commands\\\\GenerateAttributesCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
1189011855
count: 1
@@ -12685,11 +12650,6 @@ parameters:
1268512650
count: 1
1268612651
path: engine/Shopware/Components/Acl.php
1268712652

12688-
-
12689-
message: "#^Access to an undefined property Enlight_Controller_Response_Response\\:\\:\\$headers\\.$#"
12690-
count: 1
12691-
path: engine/Shopware/Components/AddLinkHeaderSubscriber.php
12692-
1269312653
-
1269412654
message: "#^Cannot call method setAcl\\(\\) on object\\|null\\.$#"
1269512655
count: 1
@@ -14125,21 +14085,6 @@ parameters:
1412514085
count: 1
1412614086
path: engine/Shopware/Components/Cart/CartPersistService.php
1412714087

14128-
-
14129-
message: "#^Query error\\: Column \"s_order_basket\\.currencyFactor\" expects value type float\\|int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
14130-
count: 1
14131-
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php
14132-
14133-
-
14134-
message: "#^Query error\\: Column \"s_order_basket\\.sessionID\" expects value type string\\|null, got type mixed$#"
14135-
count: 1
14136-
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php
14137-
14138-
-
14139-
message: "#^Query error\\: Column \"s_order_basket_attributes\\.basketID\" expects value type int\\|null, got type int\\|string\\|false$#"
14140-
count: 1
14141-
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php
14142-
1414314088
-
1414414089
message: "#^Parameter \\#4 \\$path of class Symfony\\\\Component\\\\HttpFoundation\\\\Cookie constructor expects string\\|null, string\\|false given\\.$#"
1414514090
count: 1
@@ -17956,47 +17901,12 @@ parameters:
1795617901
path: engine/Shopware/Components/Plugin/Configuration/ReaderInterface.php
1795717902

1795817903
-
17959-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has no return type specified\\.$#"
17960-
count: 1
17961-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17962-
17963-
-
17964-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has parameter \\$cronjob with no value type specified in iterable type array\\.$#"
17965-
count: 1
17966-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17967-
17968-
-
17969-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has no return type specified\\.$#"
17970-
count: 1
17971-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17972-
17973-
-
17974-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has parameter \\$cronjobActions with no value type specified in iterable type array\\.$#"
17975-
count: 1
17976-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17977-
17978-
-
17979-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has no return type specified\\.$#"
17980-
count: 1
17981-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17982-
17983-
-
17984-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has parameter \\$cronjobs with no value type specified in iterable type array\\.$#"
17985-
count: 1
17986-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17987-
17988-
-
17989-
message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\<mixed~'active', mixed\\>&hasOffsetValue\\('pluginID', int\\)$#"
17990-
count: 1
17991-
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
17992-
17993-
-
17994-
message: "#^Query error\\: Argument \\#1 is not a constant array, got hasOffsetValue\\('end', DateTime\\)&hasOffsetValue\\('next', DateTime\\)&hasOffsetValue\\('pluginID', int\\)&non\\-empty\\-array$#"
17904+
message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\<string, mixed\\>&hasOffsetValue\\('pluginID', int\\)$#"
1799517905
count: 1
1799617906
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
1799717907

1799817908
-
17999-
message: "#^Query error\\: Column \"s_crontab\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
17909+
message: "#^Query error\\: Argument \\#1 is not a constant array, got non\\-empty\\-array\\<string, mixed\\>&hasOffsetValue\\('end', DateTime\\)&hasOffsetValue\\('next', DateTime\\)&hasOffsetValue\\('pluginID', int\\)$#"
1800017910
count: 1
1800117911
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php
1800217912

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
"friends-of-behat/mink-extension": "2.7.5",
113113
"php-parallel-lint/php-var-dump-check": "^0.5",
114114
"phpstan/extension-installer": "1.4.3",
115-
"phpstan/phpstan": "1.12.0",
116-
"phpstan/phpstan-doctrine": "1.5.3",
117-
"phpstan/phpstan-phpunit": "1.4.0",
118-
"phpstan/phpstan-symfony": "1.4.11",
115+
"phpstan/phpstan": "1.12.10",
116+
"phpstan/phpstan-doctrine": "1.5.6",
117+
"phpstan/phpstan-phpunit": "1.4.1",
118+
"phpstan/phpstan-symfony": "1.4.12",
119119
"phpunit/phpunit": "^9.6",
120120
"sensiolabs/behat-page-object-extension": "2.3.7",
121121
"staabm/phpstan-dba": "0.2.81",

composer.lock

+27-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/Shopware/Bundle/MailBundle/AutocompleteResolver/ShortForeachResolver.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* Shopware 5
47
* Copyright (c) shopware AG
@@ -33,10 +36,6 @@ public function completer(array $context, string $smartyCode): array
3336

3437
if (!empty($matches)) {
3538
foreach ($matches as $match) {
36-
if (!isset($match['arrayName'], $match['value'])) {
37-
continue;
38-
}
39-
4039
$value = $this->getValueFromPath($context, $match['arrayName']);
4140

4241
if ($value === null) {
@@ -46,14 +45,10 @@ public function completer(array $context, string $smartyCode): array
4645
if (\count($value)) {
4746
$key = array_keys($value)[0];
4847
$context[$match['value']] = $value[$key];
49-
if (isset($match['key'])) {
50-
$context[$match['key']] = $key;
51-
}
48+
$context[$match['key']] = $key;
5249
} else {
5350
$context[$match['value']] = [];
54-
if (isset($match['key'])) {
55-
$context[$match['key']] = 0;
56-
}
51+
$context[$match['key']] = 0;
5752
}
5853
}
5954
}

engine/Shopware/Commands/FirstRunWizardDisableCommand.php

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* Shopware 5
47
* Copyright (c) shopware AG
@@ -23,13 +26,15 @@
2326

2427
namespace Shopware\Commands;
2528

29+
use Doctrine\DBAL\Connection;
30+
use Shopware\Components\CacheManager;
2631
use Symfony\Component\Console\Input\InputInterface;
2732
use Symfony\Component\Console\Output\OutputInterface;
2833

2934
class FirstRunWizardDisableCommand extends ShopwareCommand
3035
{
3136
/**
32-
* {@inheritdoc}
37+
* @return void
3338
*/
3439
protected function configure()
3540
{
@@ -44,28 +49,27 @@ protected function configure()
4449
*/
4550
protected function execute(InputInterface $input, OutputInterface $output)
4651
{
47-
$conn = $this->container->get(\Doctrine\DBAL\Connection::class);
48-
$elementId = $conn->fetchColumn('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"');
49-
$valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]);
52+
$conn = $this->container->get(Connection::class);
53+
$elementId = (int) $conn->fetchOne('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"');
54+
$valueId = (int) $conn->fetchOne('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]);
5055

5156
$data = [
5257
'element_id' => $elementId,
5358
'shop_id' => 1,
5459
'value' => serialize(false),
5560
];
5661

57-
if ($valueid) {
62+
if ($valueId) {
5863
$conn->update(
5964
's_core_config_values',
6065
$data,
61-
['id' => $valueid]
66+
['id' => $valueId]
6267
);
6368
} else {
6469
$conn->insert('s_core_config_values', $data);
6570
}
6671

67-
/** @var \Shopware\Components\CacheManager $cacheManager */
68-
$cacheManager = $this->container->get(\Shopware\Components\CacheManager::class);
72+
$cacheManager = $this->container->get(CacheManager::class);
6973
$cacheManager->clearConfigCache();
7074

7175
$output->writeln('<info>First Run Wizard disabled</info>');

0 commit comments

Comments
 (0)