-
Notifications
You must be signed in to change notification settings - Fork 804
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
base: 5.7
Are you sure you want to change the base?
Conversation
and fix some phpstan errors
|
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.
thank you very much again!
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't false
be cast to 0
anyway?
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.
The problem is, that this version of doctrine returns mixed|false
, therefore this check. But it probably should be replaced by fetchOne
(which returns mixed|false
as well).
$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 comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
protected function configure(): void |
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.
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
protected function configure(): void |
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.
same as above
@@ -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 comment
The 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 comment
The 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
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
* @param array<string> $cronjobActions | |
* @param list<string> $cronjobActions |
@@ -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 comment
The 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 comment
The 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 :-)
static::assertInstanceOf(Unit::class, $price->getUnit()); | ||
static::assertGreaterThanOrEqual(1, $price->getUnit()->getMinPurchase()); | ||
} | ||
|
||
foreach ($product->getPriceRules() as $price) { |
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.
can we check the rules in another way? that they are correctly present?
and fix some phpstan errors