Skip to content

Commit

Permalink
Fix travis compatability php 8.1 and magento 2.4.4
Browse files Browse the repository at this point in the history
#6

- Third party loggers no longer in magento 2.4.4.
- Also change travis php setup for 8.1 support
  • Loading branch information
convenient authored Apr 22, 2022
1 parent b5dd6b3 commit 2ccccd8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
language: php
php:
- 7.4.22
- 7.4
- 8.1
git:
depth: false
dist: xenial
env:
- TEST_GROUP=magento_latest
- TEST_GROUP=magento_23
jobs:
exclude:
- php: 8.1
env: TEST_GROUP=magento_23
- php: 7.4
env: TEST_GROUP=magento_latest
addons:
apt:
packages:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
},
"require-dev": {
"ampersand/travis-vanilla-magento": "^1.1",
"bitexpert/phpstan-magento": "^0.9",
"friendsofphp/php-cs-fixer": "^3.0",
"bitexpert/phpstan-magento": "^0.11",
"friendsofphp/php-cs-fixer": "^3.4",
"magento/magento-coding-standard": "^15",
"magento/magento2-base": "*",
"phpstan/phpstan": "^0.12.80",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": "^9.5"
},
"extra": {
Expand Down
6 changes: 5 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
includes:
- %currentWorkingDirectory%/vendor/bitexpert/phpstan-magento/extension.neon
parameters:
reportUnmatchedIgnoredErrors: false
paths:
- %currentWorkingDirectory%/src
excludes_analyse:
excludePaths:
- *Test*
- *tests*
level: max
bootstrapFiles:
- %currentWorkingDirectory%/vendor/bitexpert/phpstan-magento/autoload.php
ignoreErrors:
-
message: '#Method(.*)getCommands(.*)should return(.*)but(.*)#'
path: %currentWorkingDirectory%/src/Console/CommandList.php
5 changes: 3 additions & 2 deletions src/Console/CommandList.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ private function getCommandsClasses(): array
}

/**
* @inheritdoc
* Gets list of command instances, can be used without installing the application
*
* @return \Symfony\Component\Console\Command\Command[]
*/
public function getCommands(): array
{
Expand All @@ -51,7 +53,6 @@ public function getCommands(): array
throw new \RuntimeException('Class ' . $class . ' does not exist');
}
}

return $commands;
}
}
3 changes: 2 additions & 1 deletion src/Console/ListCustomLoggersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ function ($class) use ($output) {
$extendsMonologLogger = array_merge($extendsMonologLogger, $moduleClassesThatExtendMonologLogger);
}

/** @var string[] $filters */
$filters = $input->getOption(self::INPUT_KEY_FILTER);
$extendsMonologLogger = array_diff($extendsMonologLogger, $input->getOption(self::INPUT_KEY_FILTER));
$extendsMonologLogger = array_diff($extendsMonologLogger, $filters);

if (!empty($filters) && !empty($extendsMonologLogger)) {
/*
Expand Down
6 changes: 5 additions & 1 deletion src/Test/Integration/ListCustomLoggersCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public function testListCustomLoggersCommandInCi()
}

$tester = new CommandTester($this->objectManager->create(ListCustomLoggersCommand::class));
$tester->execute([]);
$this->assertEquals(0, $tester->execute([]));

if (getenv('TEST_GROUP') === 'magento_latest') {
return; // Magento 2.4.4 has removed a lot of third party bundled modules
}

/*
* Our modules CI pipeline ensures we have composer dump-autoload -o so we should see the bundled loggers
Expand Down

0 comments on commit 2ccccd8

Please sign in to comment.