Skip to content

Commit

Permalink
Fix current CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed May 16, 2024
1 parent 1f34c72 commit 26a3ec0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ composer.lock

/tests/Application/var
/tests/Application/secrets

phpstan.neon
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5",
"qossmic/deptrac-shim": "^0.24.0 || ^1.0",
"rector/rector": "^0.15.0",
"rector/rector": "^1.0",
"schranz/test-generator": "^0.4",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
Expand Down
File renamed without changes.
17 changes: 11 additions & 6 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@
__DIR__ . '/tests',
]);

$rectorConfig->phpstanConfigs([
__DIR__ . '/phpstan.dist.neon',
// rector does not load phpstan extension automatically so require them manually here:
__DIR__ . '/vendor/phpstan/phpstan-doctrine/extension.neon',
__DIR__ . '/vendor/phpstan/phpstan-symfony/extension.neon',
]);

$rectorConfig->skip([
__DIR__ . '/tests/Application/var',
__DIR__ . '/tests/Application/config',
]);

$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');

// basic rules
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);

$rectorConfig->sets([
SetList::CODE_QUALITY,
LevelSetList::UP_TO_PHP_80,
// LevelSetList::UP_TO_PHP_80,
]);

// symfony rules
Expand All @@ -39,7 +44,7 @@
$rectorConfig->sets([
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonyLevelSetList::UP_TO_SYMFONY_54,
// SymfonyLevelSetList::UP_TO_SYMFONY_54,
]);

// doctrine rules
Expand All @@ -49,7 +54,7 @@

// phpunit rules
$rectorConfig->sets([
PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
PHPUnitSetList::PHPUNIT_91,
// PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
// PHPUnitSetList::PHPUNIT_91,
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
$envelope = $stack->next()->handle($envelope, $stack);

// flush unit-of-work to the database after the root message was handled successfully
if (!empty($envelope->all(EnableFlushStamp::class))) {
if ([] !== $envelope->all(EnableFlushStamp::class)) {
$this->container->get('doctrine.orm.entity_manager')->flush();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private function createEnvelope(): Envelope
return new Envelope(new \stdClass());
}

private function createStack(callable $handler = null): StackMiddleware
private function createStack(?callable $handler = null): StackMiddleware
{
if (!$handler) {
return new StackMiddleware([]);
Expand Down

0 comments on commit 26a3ec0

Please sign in to comment.