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

Add PHP 8.3 support #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
env:
SYMFONY_DEPRECATIONS_HELPER: weak

- php-version: '8.3'
coverage: true
dependency-versions: 'highest'
env:
SYMFONY_DEPRECATIONS_HELPER: weak

services:
mysql:
image: mysql:5.7
Expand Down
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "proprietary",
"type": "sulu-bundle",
"require": {
"php": "8.0.* || 8.1.* || 8.2.*",
"php": "8.0.* || 8.1.* || 8.2.* || 8.3.*",
"doctrine/dbal": "^3.3",
"doctrine/doctrine-bundle": "^2.5",
"doctrine/orm": "^2.11",
Expand Down 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
Loading