Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: zenstruck/.github@php-cs-fixer
- uses: zenstruck/.github/actions/php-cs-fixer@main
with:
php: 8.1
key: ${{ secrets.GPG_PRIVATE_KEY }}
Expand All @@ -36,7 +36,7 @@ jobs:
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: zenstruck/.github@sync-with-template
- uses: zenstruck/.github/actions/sync-with-template@main
with:
key: ${{ secrets.GPG_PRIVATE_KEY }}
token: ${{ secrets.COMPOSER_TOKEN }}
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
}
],
"require": {
"php": ">=8.0",
"php": ">=8.1",
"dragonmantank/cron-expression": "^2.3|^3.0",
"symfony/console": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0"
"symfony/console": "^6.4|^7.0|^8.0",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"symfony/event-dispatcher": "^6.4|^7.0|^8.0",
"symfony/http-kernel": "^6.4|^7.0|^8.0"
},
"require-dev": {
"lorisleiva/cron-translator": "^0.1.0|^0.3.1|^0.4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0|^6.0",
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5|^10.0",
"psr/log": "^1.1",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/http-client": "^5.4|^6.0|^7.0",
"symfony/lock": "^5.4|^6.0|^7.0",
"symfony/mailer": "^5.4|^6.0|^7.0",
"symfony/messenger": "^5.4|^6.0|^7.0",
"symfony/notifier": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^6.2|^7.0",
"symfony/process": "^5.4|^6.0|^7.0"
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
"symfony/http-client": "^6.4|^7.0|^8.0",
"symfony/lock": "^6.4|^7.0|^8.0",
"symfony/mailer": "^6.4|^7.0|^8.0",
"symfony/messenger": "^6.4|^7.0|^8.0",
"symfony/notifier": "^6.4|^7.0|^8.0",
"symfony/phpunit-bridge": "^6.4|^7.0|^8.0",
"symfony/process": "^6.4|^7.0|^8.0"
},
"suggest": {
"lorisleiva/cron-translator": "Displays human readable cron expression in schedule:list",
Expand Down
20 changes: 5 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,27 @@ parameters:
path: src/Command/ScheduleListCommand.php

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

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:canBeEnabled\\(\\)\\.$#"
count: 3
path: src/DependencyInjection/Configuration.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
count: 1
path: src/DependencyInjection/Configuration.php

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ini name="error_reporting" value="-1" />
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0&amp;quiet[]=indirect&amp;quiet[]=other"/>
<server name="KERNEL_CLASS" value="Zenstruck\ScheduleBundle\Tests\Fixture\Kernel" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SHELL_VERBOSITY" value="0" />
</php>

<testsuites>
Expand Down
22 changes: 11 additions & 11 deletions src/DependencyInjection/ZenstruckScheduleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
Expand Down Expand Up @@ -63,11 +63,11 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
->addTag('schedule.extension_handler')
;

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

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

$container
Expand All @@ -76,7 +76,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
;

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

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

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

$container
->getDefinition(SingleServerHandler::class)
Expand All @@ -96,7 +96,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
}

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

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

if ($mergedConfig['timezone']) {
$loader->load('timezone.xml');
$loader->load('timezone.php');
$container
->getDefinition(ScheduleTimezoneSubscriber::class)
->setArgument(0, $mergedConfig['timezone'])
;
}

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

$container
->getDefinition(MessageTaskRunner::class)
Expand All @@ -129,7 +129,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
}

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

$container
->getDefinition(EmailHandler::class)
Expand All @@ -143,7 +143,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
}

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

$container
->getDefinition(NotifierHandler::class)
Expand Down
14 changes: 14 additions & 0 deletions src/Resources/config/http.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();

$services->set(\Zenstruck\ScheduleBundle\Schedule\Extension\Handler\PingHandler::class)
->tag('schedule.extension_handler');

$services->set(\Zenstruck\ScheduleBundle\Schedule\Task\Runner\PingTaskRunner::class)
->tag('schedule.task_runner');
};
16 changes: 0 additions & 16 deletions src/Resources/config/http.xml

This file was deleted.

16 changes: 16 additions & 0 deletions src/Resources/config/mailer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();

$services->set(\Zenstruck\ScheduleBundle\Schedule\Extension\Handler\EmailHandler::class)
->args([
'',
'',
'',
])
->tag('schedule.extension_handler');
};
15 changes: 0 additions & 15 deletions src/Resources/config/mailer.xml

This file was deleted.

11 changes: 11 additions & 0 deletions src/Resources/config/messenger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();

$services->set(\Zenstruck\ScheduleBundle\Schedule\Task\Runner\MessageTaskRunner::class)
->tag('schedule.task_runner');
};
12 changes: 0 additions & 12 deletions src/Resources/config/messenger.xml

This file was deleted.

18 changes: 18 additions & 0 deletions src/Resources/config/notifier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();

$services->set(\Zenstruck\ScheduleBundle\Schedule\Extension\Handler\NotifierHandler::class)
->args([
'',
'',
'',
'',
'',
])
->tag('schedule.extension_handler');
};
17 changes: 0 additions & 17 deletions src/Resources/config/notifier.xml

This file was deleted.

11 changes: 11 additions & 0 deletions src/Resources/config/process.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();

$services->set(\Zenstruck\ScheduleBundle\Schedule\Task\Runner\ProcessTaskRunner::class)
->tag('schedule.task_runner');
};
12 changes: 0 additions & 12 deletions src/Resources/config/process.xml

This file was deleted.

Loading