Skip to content
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

Draft
wants to merge 1 commit into
base: 5.7
Choose a base branch
from

Conversation

aragon999
Copy link
Contributor

and fix some phpstan errors

@aragon999 aragon999 requested a review from mitelg October 1, 2024 22:07
Copy link

github-actions bot commented Oct 1, 2024

Warnings
⚠️ The Pull Request doesn't contain any changes to the Upgrade file

@aragon999 aragon999 marked this pull request as draft October 1, 2024 22:30
Copy link
Contributor

@mitelg mitelg left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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
Copy link
Contributor

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 😬

Copy link
Contributor Author

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
Copy link
Contributor

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;
Copy link
Contributor

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 😁

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param array<string> $cronjobActions
* @param list<string> $cronjobActions

@@ -41,7 +41,11 @@ public function __construct(Connection $connection)
}

/**
* @param array<array<string, mixed>> $cronjobs
Copy link
Contributor

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 😇

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants