-
Notifications
You must be signed in to change notification settings - Fork 803
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
chore(deps-dev): Bump phpstan/phpstan from 1.12.0 to 1.12.5 #2766
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -23,15 +23,13 @@ | |
|
||
namespace Shopware\Commands; | ||
|
||
use RuntimeException; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class FirstRunWizardDisableCommand extends ShopwareCommand | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
protected function configure(): void | ||
{ | ||
$this | ||
->setName('sw:firstrunwizard:disable') | ||
|
@@ -46,15 +44,21 @@ 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"'); | ||
$elementId = is_numeric($elementId) ? (int) $elementId : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is, that this version of doctrine returns |
||
if ($elementId <= 0) { | ||
throw new RuntimeException('Cannot find config element `firstRunWizardEnabled`'); | ||
} | ||
|
||
$valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); | ||
$valueid = is_numeric($valueid) ? (int) $valueid : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
|
||
$data = [ | ||
'element_id' => $elementId, | ||
'shop_id' => 1, | ||
'value' => serialize(false), | ||
]; | ||
|
||
if ($valueid) { | ||
if ($valueid > 0) { | ||
$conn->update( | ||
's_core_config_values', | ||
$data, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,15 +23,13 @@ | |
|
||
namespace Shopware\Commands; | ||
|
||
use RuntimeException; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class FirstRunWizardEnableCommand extends ShopwareCommand | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
protected function configure(): void | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
{ | ||
$this | ||
->setName('sw:firstrunwizard:enable') | ||
|
@@ -46,15 +44,21 @@ 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"'); | ||
$elementId = is_numeric($elementId) ? (int) $elementId : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above I see an abstraction potential here 😁 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was thinking about this as well, but then we would have inherited commands and I was not sure where to place them, and then I thought, okay maybe for phpstan cleanup, it is enough to adjust it twice :D |
||
if ($elementId <= 0) { | ||
throw new RuntimeException('Cannot find config element `firstRunWizardEnabled`'); | ||
} | ||
|
||
$valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); | ||
$valueid = is_numeric($valueid) ? (int) $valueid : 0; | ||
|
||
$data = [ | ||
'element_id' => $elementId, | ||
'shop_id' => 1, | ||
'value' => serialize(true), | ||
]; | ||
|
||
if ($valueid) { | ||
if ($valueid > 0) { | ||
$conn->update( | ||
's_core_config_values', | ||
$data, | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -41,7 +41,11 @@ public function __construct(Connection $connection) | |||||
} | ||||||
|
||||||
/** | ||||||
* @param array<array<string, mixed>> $cronjobs | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. really fancy would be an object shape annotation of the array 😇 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I will look into it, I still need to adjust the code, that the pipeline for php 7.4 still works :-) |
||||||
* | ||||||
* @throws InvalidArgumentException | ||||||
* | ||||||
* @return void | ||||||
*/ | ||||||
public function synchronize(Plugin $plugin, array $cronjobs) | ||||||
{ | ||||||
|
@@ -53,9 +57,9 @@ public function synchronize(Plugin $plugin, array $cronjobs) | |||||
} | ||||||
|
||||||
/** | ||||||
* @param array $cronjob | ||||||
* @param array<string, mixed> $cronjob | ||||||
*/ | ||||||
private function addCronjob(Plugin $plugin, $cronjob) | ||||||
private function addCronjob(Plugin $plugin, $cronjob): void | ||||||
{ | ||||||
$cronjob['pluginID'] = $plugin->getId(); | ||||||
|
||||||
|
@@ -84,7 +88,8 @@ private function addCronjob(Plugin $plugin, $cronjob) | |||||
$id = $this->connection->fetchColumn($selectStatement, $params); | ||||||
} | ||||||
|
||||||
if ($id) { | ||||||
$id = is_numeric($id) ? (int) $id : 0; | ||||||
if ($id !== 0) { | ||||||
// Don't overwrite user cronjob state | ||||||
unset($cronjob['active']); | ||||||
|
||||||
|
@@ -97,9 +102,9 @@ private function addCronjob(Plugin $plugin, $cronjob) | |||||
} | ||||||
|
||||||
/** | ||||||
* @param int $pluginId | ||||||
* @param array<string> $cronjobActions | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
*/ | ||||||
private function removeNotExistingEntries($pluginId, array $cronjobActions) | ||||||
private function removeNotExistingEntries(int $pluginId, array $cronjobActions): void | ||||||
{ | ||||||
$builder = $this->connection->createQueryBuilder(); | ||||||
$builder->delete('s_crontab'); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this would be a breaking change, strictly speaking 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh, does someone extend commands? But probably as they are not internal, it might be a BC.