Skip to content

Commit be1043a

Browse files
authored
Merge pull request #94 from kbond/symfony-8
Symfony 8 Support
2 parents 8825b39 + 2188fed commit be1043a

27 files changed

+229
-241
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags')
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: zenstruck/.github@php-cs-fixer
28+
- uses: zenstruck/.github/actions/php-cs-fixer@main
2929
with:
3030
php: 8.1
3131
key: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -36,7 +36,7 @@ jobs:
3636
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags')
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: zenstruck/.github@sync-with-template
39+
- uses: zenstruck/.github/actions/sync-with-template@main
4040
with:
4141
key: ${{ secrets.GPG_PRIVATE_KEY }}
4242
token: ${{ secrets.COMPOSER_TOKEN }}

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=8.0",
15+
"php": ">=8.1",
1616
"dragonmantank/cron-expression": "^2.3|^3.0",
17-
"symfony/console": "^5.4|^6.0|^7.0",
18-
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
19-
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",
20-
"symfony/http-kernel": "^5.4|^6.0|^7.0"
17+
"symfony/console": "^6.4|^7.0|^8.0",
18+
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
19+
"symfony/event-dispatcher": "^6.4|^7.0|^8.0",
20+
"symfony/http-kernel": "^6.4|^7.0|^8.0"
2121
},
2222
"require-dev": {
2323
"lorisleiva/cron-translator": "^0.1.0|^0.3.1|^0.4.0",
24-
"matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0",
24+
"matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0|^6.0",
2525
"phpstan/phpstan": "^1.4",
26-
"phpunit/phpunit": "^9.5",
26+
"phpunit/phpunit": "^9.5|^10.0",
2727
"psr/log": "^1.1",
28-
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
29-
"symfony/http-client": "^5.4|^6.0|^7.0",
30-
"symfony/lock": "^5.4|^6.0|^7.0",
31-
"symfony/mailer": "^5.4|^6.0|^7.0",
32-
"symfony/messenger": "^5.4|^6.0|^7.0",
33-
"symfony/notifier": "^5.4|^6.0|^7.0",
34-
"symfony/phpunit-bridge": "^6.2|^7.0",
35-
"symfony/process": "^5.4|^6.0|^7.0"
28+
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
29+
"symfony/http-client": "^6.4|^7.0|^8.0",
30+
"symfony/lock": "^6.4|^7.0|^8.0",
31+
"symfony/mailer": "^6.4|^7.0|^8.0",
32+
"symfony/messenger": "^6.4|^7.0|^8.0",
33+
"symfony/notifier": "^6.4|^7.0|^8.0",
34+
"symfony/phpunit-bridge": "^6.4|^7.0|^8.0",
35+
"symfony/process": "^6.4|^7.0|^8.0"
3636
},
3737
"suggest": {
3838
"lorisleiva/cron-translator": "Displays human readable cron expression in schedule:list",

phpstan-baseline.neon

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,27 @@ parameters:
1616
path: src/Command/ScheduleListCommand.php
1717

1818
-
19-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:arrayPrototype\\(\\)\\.$#"
19+
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createEmailExtension\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition does not specify its types\\: TParent$#"
2020
count: 1
2121
path: src/DependencyInjection/Configuration.php
2222

2323
-
24-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:canBeEnabled\\(\\)\\.$#"
25-
count: 3
26-
path: src/DependencyInjection/Configuration.php
27-
28-
-
29-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
30-
count: 1
31-
path: src/DependencyInjection/Configuration.php
32-
33-
-
34-
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createEmailExtension\\(\\) should return Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition but returns Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\.$#"
24+
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createNotifyExtension\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition does not specify its types\\: TParent$#"
3525
count: 1
3626
path: src/DependencyInjection/Configuration.php
3727

3828
-
39-
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createNotifyExtension\\(\\) should return Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition but returns Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\.$#"
29+
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createPingExtension\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition does not specify its types\\: TParent$#"
4030
count: 1
4131
path: src/DependencyInjection/Configuration.php
4232

4333
-
44-
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:createPingExtension\\(\\) should return Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition but returns Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\.$#"
34+
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:getConfigTreeBuilder\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder does not specify its types\\: T$#"
4535
count: 1
4636
path: src/DependencyInjection/Configuration.php
4737

4838
-
49-
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:taskConfiguration\\(\\) should return Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition but returns Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\.$#"
39+
message: "#^Method Zenstruck\\\\ScheduleBundle\\\\DependencyInjection\\\\Configuration\\:\\:taskConfiguration\\(\\) return type with generic class Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition does not specify its types\\: TParent$#"
5040
count: 1
5141
path: src/DependencyInjection/Configuration.php
5242

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ini name="error_reporting" value="-1" />
1313
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0&amp;quiet[]=indirect&amp;quiet[]=other"/>
1414
<server name="KERNEL_CLASS" value="Zenstruck\ScheduleBundle\Tests\Fixture\Kernel" />
15-
<server name="SHELL_VERBOSITY" value="-1" />
15+
<server name="SHELL_VERBOSITY" value="0" />
1616
</php>
1717

1818
<testsuites>

src/DependencyInjection/ZenstruckScheduleExtension.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Config\FileLocator;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Definition;
17-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
1818
use Symfony\Component\DependencyInjection\Reference;
1919
use Symfony\Component\HttpClient\HttpClient;
2020
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
@@ -63,11 +63,11 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
6363
->addTag('schedule.extension_handler')
6464
;
6565

66-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
67-
$loader->load('services.xml');
66+
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
67+
$loader->load('services.php');
6868

6969
if (\class_exists(Process::class)) {
70-
$loader->load('process.xml');
70+
$loader->load('process.php');
7171
}
7272

7373
$container
@@ -76,7 +76,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
7676
;
7777

7878
if ($mergedConfig['without_overlapping_lock_factory'] || \class_exists(LockFactory::class)) {
79-
$loader->load('without_overlapping.xml');
79+
$loader->load('without_overlapping.php');
8080
}
8181

8282
if ($mergedConfig['without_overlapping_lock_factory']) {
@@ -87,7 +87,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
8787
}
8888

8989
if ($mergedConfig['single_server_lock_factory']) {
90-
$loader->load('single_server.xml');
90+
$loader->load('single_server.php');
9191

9292
$container
9393
->getDefinition(SingleServerHandler::class)
@@ -96,7 +96,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
9696
}
9797

9898
if ($mergedConfig['http_client'] || \class_exists(HttpClient::class)) {
99-
$loader->load('http.xml');
99+
$loader->load('http.php');
100100
}
101101

102102
if ($mergedConfig['http_client']) {
@@ -112,15 +112,15 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
112112
}
113113

114114
if ($mergedConfig['timezone']) {
115-
$loader->load('timezone.xml');
115+
$loader->load('timezone.php');
116116
$container
117117
->getDefinition(ScheduleTimezoneSubscriber::class)
118118
->setArgument(0, $mergedConfig['timezone'])
119119
;
120120
}
121121

122122
if ($mergedConfig['messenger']['enabled']) {
123-
$loader->load('messenger.xml');
123+
$loader->load('messenger.php');
124124

125125
$container
126126
->getDefinition(MessageTaskRunner::class)
@@ -129,7 +129,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
129129
}
130130

131131
if ($mergedConfig['mailer']['enabled']) {
132-
$loader->load('mailer.xml');
132+
$loader->load('mailer.php');
133133

134134
$container
135135
->getDefinition(EmailHandler::class)
@@ -143,7 +143,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
143143
}
144144

145145
if ($mergedConfig['notifier']['enabled']) {
146-
$loader->load('notifier.xml');
146+
$loader->load('notifier.php');
147147

148148
$container
149149
->getDefinition(NotifierHandler::class)

src/Resources/config/http.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->set(\Zenstruck\ScheduleBundle\Schedule\Extension\Handler\PingHandler::class)
10+
->tag('schedule.extension_handler');
11+
12+
$services->set(\Zenstruck\ScheduleBundle\Schedule\Task\Runner\PingTaskRunner::class)
13+
->tag('schedule.task_runner');
14+
};

src/Resources/config/http.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/Resources/config/mailer.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->set(\Zenstruck\ScheduleBundle\Schedule\Extension\Handler\EmailHandler::class)
10+
->args([
11+
'',
12+
'',
13+
'',
14+
])
15+
->tag('schedule.extension_handler');
16+
};

src/Resources/config/mailer.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Resources/config/messenger.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->set(\Zenstruck\ScheduleBundle\Schedule\Task\Runner\MessageTaskRunner::class)
10+
->tag('schedule.task_runner');
11+
};

0 commit comments

Comments
 (0)