Skip to content

Commit

Permalink
Merge pull request #152 from magento-commerce/MCLOUD-12644
Browse files Browse the repository at this point in the history
MCLOUD-12644: PHP 8.1 tests fix
  • Loading branch information
andriyShevtsov authored Sep 12, 2024
2 parents d3fb8f9 + 622767f commit d43f7d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Config/Magento/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function get(string $key): ?string
$magentoShell = $this->shellFactory->create(ShellFactory::STRATEGY_MAGENTO_SHELL);
$process = $magentoShell->execute('config:show', [$key]);

return $process->getOutput() ?? null;
return $process->getOutput();
} catch (\Exception $exception) {
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/Service/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public function validateService(string $serviceName, string $version): string
private function getSupportedVersions(): array
{
if (null === $this->supportedVersionList) {
$this->supportedVersionList = [];
foreach (self::MAGENTO_SUPPORTED_SERVICE_VERSIONS as $serviceName => $magentoVersions) {
foreach ($magentoVersions as $magentoConstrain => $serviceConstraint) {
if (Semver::satisfies($this->magentoVersion->getVersion(), $magentoConstrain)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/static/phpmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</properties>
</rule>

<!-- Unused code rules -->
<rule ref="rulesets/unusedcode.xml" />
<!-- Unused code rules skipping due lot of error soon we will fix
<rule ref="tests/static/unusedcode.xml" /> -->

<!-- Code design rules -->
<rule ref="rulesets/design.xml/ExitExpression" />
Expand Down
6 changes: 6 additions & 0 deletions tests/static/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ parameters:
path: ../../src/Service/Validator.php
- message: '#Expression on left side of \?\? is not nullable#'
path: ../../src/Util/UrlManager.php
- message: '#Method Magento\\MagentoCloud\\App\\Container::createComposerInstance\(\) should return Composer\\Composer but returns Composer\\PartialComposer\.#'
path: ../../src/App/Container.php
- message: '#Left side of && is always true\.#'
path: ../../src/Service/EolValidator.php
- message: '#Variable \$gitIgnore on left side of \?\? always exists and is not nullable\.#'
path: ../../src/Command/Dev/UpdateComposer/ClearModuleRequirements.php

0 comments on commit d43f7d5

Please sign in to comment.