Skip to content

Commit

Permalink
chore: Update PHPStan and its plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mitelg committed Nov 13, 2024
1 parent ca1aeb7 commit db1ca81
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 220 deletions.
94 changes: 2 additions & 92 deletions .phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3220,11 +3220,6 @@ parameters:
count: 1
path: engine/Library/Enlight/Template/Plugins/block.stripLines.php

-
message: "#^Function smarty_block_stripLines\\(\\) never returns void so it can be removed from the return type\\.$#"
count: 1
path: engine/Library/Enlight/Template/Plugins/block.stripLines.php

-
message: "#^Method Smarty_Compiler_Config\\:\\:compile\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -11855,36 +11850,6 @@ parameters:
count: 1
path: engine/Shopware/Commands/DatabaseSetupCommand.php

-
message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardDisableCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php

-
message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#"
count: 2
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php

-
message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
count: 1
path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php

-
message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardEnableCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php

-
message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#"
count: 2
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php

-
message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
count: 1
path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php

-
message: "#^Method Shopware\\\\Commands\\\\GenerateAttributesCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -12685,11 +12650,6 @@ parameters:
count: 1
path: engine/Shopware/Components/Acl.php

-
message: "#^Access to an undefined property Enlight_Controller_Response_Response\\:\\:\\$headers\\.$#"
count: 1
path: engine/Shopware/Components/AddLinkHeaderSubscriber.php

-
message: "#^Cannot call method setAcl\\(\\) on object\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -14125,21 +14085,6 @@ parameters:
count: 1
path: engine/Shopware/Components/Cart/CartPersistService.php

-
message: "#^Query error\\: Column \"s_order_basket\\.currencyFactor\" expects value type float\\|int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
count: 1
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php

-
message: "#^Query error\\: Column \"s_order_basket\\.sessionID\" expects value type string\\|null, got type mixed$#"
count: 1
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php

-
message: "#^Query error\\: Column \"s_order_basket_attributes\\.basketID\" expects value type int\\|null, got type int\\|string\\|false$#"
count: 1
path: engine/Shopware/Components/Cart/ConditionalLineItemService.php

-
message: "#^Parameter \\#4 \\$path of class Symfony\\\\Component\\\\HttpFoundation\\\\Cookie constructor expects string\\|null, string\\|false given\\.$#"
count: 1
Expand Down Expand Up @@ -17956,47 +17901,12 @@ parameters:
path: engine/Shopware/Components/Plugin/Configuration/ReaderInterface.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has no return type specified\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has parameter \\$cronjob with no value type specified in iterable type array\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has no return type specified\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has parameter \\$cronjobActions with no value type specified in iterable type array\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has no return type specified\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has parameter \\$cronjobs with no value type specified in iterable type array\\.$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\<mixed~'active', mixed\\>&hasOffsetValue\\('pluginID', int\\)$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Query error\\: Argument \\#1 is not a constant array, got hasOffsetValue\\('end', DateTime\\)&hasOffsetValue\\('next', DateTime\\)&hasOffsetValue\\('pluginID', int\\)&non\\-empty\\-array$#"
message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\<string, mixed\\>&hasOffsetValue\\('pluginID', int\\)$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

-
message: "#^Query error\\: Column \"s_crontab\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#"
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\\)$#"
count: 1
path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
"friends-of-behat/mink-extension": "2.7.5",
"php-parallel-lint/php-var-dump-check": "^0.5",
"phpstan/extension-installer": "1.4.3",
"phpstan/phpstan": "1.12.0",
"phpstan/phpstan-doctrine": "1.5.3",
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-symfony": "1.4.11",
"phpstan/phpstan": "1.12.10",
"phpstan/phpstan-doctrine": "1.5.6",
"phpstan/phpstan-phpunit": "1.4.1",
"phpstan/phpstan-symfony": "1.4.12",
"phpunit/phpunit": "^9.6",
"sensiolabs/behat-page-object-extension": "2.3.7",
"staabm/phpstan-dba": "0.2.81",
Expand Down
54 changes: 27 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

/**
* Shopware 5
* Copyright (c) shopware AG
Expand Down Expand Up @@ -33,10 +36,6 @@ public function completer(array $context, string $smartyCode): array

if (!empty($matches)) {
foreach ($matches as $match) {
if (!isset($match['arrayName'], $match['value'])) {
continue;
}

$value = $this->getValueFromPath($context, $match['arrayName']);

if ($value === null) {
Expand All @@ -46,14 +45,10 @@ public function completer(array $context, string $smartyCode): array
if (\count($value)) {
$key = array_keys($value)[0];
$context[$match['value']] = $value[$key];
if (isset($match['key'])) {
$context[$match['key']] = $key;
}
$context[$match['key']] = $key;
} else {
$context[$match['value']] = [];
if (isset($match['key'])) {
$context[$match['key']] = 0;
}
$context[$match['key']] = 0;
}
}
}
Expand Down
20 changes: 12 additions & 8 deletions engine/Shopware/Commands/FirstRunWizardDisableCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

/**
* Shopware 5
* Copyright (c) shopware AG
Expand All @@ -23,13 +26,15 @@

namespace Shopware\Commands;

use Doctrine\DBAL\Connection;
use Shopware\Components\CacheManager;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class FirstRunWizardDisableCommand extends ShopwareCommand
{
/**
* {@inheritdoc}
* @return void
*/
protected function configure()
{
Expand All @@ -44,28 +49,27 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$conn = $this->container->get(\Doctrine\DBAL\Connection::class);
$elementId = $conn->fetchColumn('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"');
$valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]);
$conn = $this->container->get(Connection::class);
$elementId = (int) $conn->fetchOne('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"');
$valueId = (int) $conn->fetchOne('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]);

$data = [
'element_id' => $elementId,
'shop_id' => 1,
'value' => serialize(false),
];

if ($valueid) {
if ($valueId) {
$conn->update(
's_core_config_values',
$data,
['id' => $valueid]
['id' => $valueId]
);
} else {
$conn->insert('s_core_config_values', $data);
}

/** @var \Shopware\Components\CacheManager $cacheManager */
$cacheManager = $this->container->get(\Shopware\Components\CacheManager::class);
$cacheManager = $this->container->get(CacheManager::class);
$cacheManager->clearConfigCache();

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

0 comments on commit db1ca81

Please sign in to comment.