Skip to content

Commit

Permalink
Allow Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
neeckeloo committed Dec 3, 2023
1 parent 9668e4d commit b8531e7
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 47 deletions.
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"psr/container": "^1.0",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.0|^2.0|^3.0",
"symfony/config": "^5.0|^6.0",
"symfony/console": "^5.0|^6.0",
"symfony/dependency-injection": "^5.0|^6.0",
"symfony/form": "^5.0|^6.0",
"symfony/http-kernel": "^5.0|^6.0",
"symfony/framework-bundle": "^5.0|^6.0",
"symfony/messenger": "^5.0|^6.0",
"symfony/serializer": "^5.0|^6.0",
"symfony/validator": "^5.0|^6.0"
"symfony/config": "^5.0|^6.0|^7.0",
"symfony/console": "^5.0|^6.0|^7.0",
"symfony/dependency-injection": "^5.0|^6.0|^7.0",
"symfony/form": "^5.0|^6.0|^7.0",
"symfony/http-kernel": "^5.0|^6.0|^7.0",
"symfony/framework-bundle": "^5.0|^6.0|^7.0",
"symfony/messenger": "^5.0|^6.0|^7.0",
"symfony/serializer": "^5.0|^6.0|^7.0",
"symfony/validator": "^5.0|^6.0|^7.0"
},
"require-dev": {
"doctrine/annotations": "^1.14",
Expand All @@ -41,14 +41,14 @@
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9.5",
"sonata-project/admin-bundle": "^4.0",
"symfony/browser-kit": "^5.0|^6.0",
"symfony/css-selector": "^5.0|^6.0",
"symfony/filesystem": "^5.0|^6.0",
"symfony/finder": "^5.0|^6.0",
"symfony/process": "^5.0|^6.0",
"symfony/security-bundle": "^5.0|^6.0",
"symfony/translation": "^5.0|^6.0",
"symfony/twig-bundle": "^5.0|^6.0",
"symfony/browser-kit": "^5.0|^6.0|^7.0",
"symfony/css-selector": "^5.0|^6.0|^7.0",
"symfony/filesystem": "^5.0|^6.0|^7.0",
"symfony/finder": "^5.0|^6.0|^7.0",
"symfony/process": "^5.0|^6.0|^7.0",
"symfony/security-bundle": "^5.0|^6.0|^7.0",
"symfony/translation": "^5.0|^6.0|^7.0",
"symfony/twig-bundle": "^5.0|^6.0|^7.0",
"symplify/easy-coding-standard": "^11.3"
},
"replace": {
Expand Down
2 changes: 1 addition & 1 deletion src/batch-box-spout/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/filesystem": "^5.0|^6.0"
"symfony/filesystem": "^5.0|^6.0|^7.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/batch-openspout/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/filesystem": "^5.0|^6.0"
"symfony/filesystem": "^5.0|^6.0|^7.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/batch-symfony-console/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"php": "^8.0",
"ext-json": "*",
"symfony/console": "^5.0|^6.0",
"symfony/console": "^5.0|^6.0|^7.0",
"yokai/batch": "^0.5.0"
},
"autoload": {
Expand All @@ -24,7 +24,7 @@
"require-dev": {
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"symfony/process": "^5.0|^6.0"
"symfony/process": "^5.0|^6.0|^7.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
18 changes: 9 additions & 9 deletions src/batch-symfony-framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"require": {
"php": "^8.0",
"composer-runtime-api": "^2.0",
"symfony/config": "^5.0|^6.0",
"symfony/dependency-injection": "^5.0|^6.0",
"symfony/http-kernel": "^5.0|^6.0",
"symfony/framework-bundle": "^5.0|^6.0",
"symfony/config": "^5.0|^6.0|^7.0",
"symfony/dependency-injection": "^5.0|^6.0|^7.0",
"symfony/http-kernel": "^5.0|^6.0|^7.0",
"symfony/framework-bundle": "^5.0|^6.0|^7.0",
"yokai/batch": "^0.5.0"
},
"autoload": {
Expand All @@ -26,11 +26,11 @@
},
"require-dev": {
"sonata-project/admin-bundle": "^4.0",
"symfony/filesystem": "^5.0|^6.0",
"symfony/form": "^5.0|^6.0",
"symfony/security-bundle": "^5.0|^6.0",
"symfony/translation": "^5.0|^6.0",
"symfony/twig-bundle": "^5.0|^6.0",
"symfony/filesystem": "^5.0|^6.0|^7.0",
"symfony/form": "^5.0|^6.0|^7.0",
"symfony/security-bundle": "^5.0|^6.0|^7.0",
"symfony/translation": "^5.0|^6.0|^7.0",
"symfony/twig-bundle": "^5.0|^6.0|^7.0",
"phpunit/phpunit": "^9.5"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/batch-symfony-messenger/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^8.0",
"symfony/messenger": "^5.0|^6.0",
"symfony/messenger": "^5.0|^6.0|^7.0",
"yokai/batch": "^0.5.0"
},
"autoload": {
Expand Down
5 changes: 3 additions & 2 deletions src/batch-symfony-messenger/src/LaunchJobMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

namespace Yokai\Batch\Bridge\Symfony\Messenger;

use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Yokai\Batch\Job\JobExecutionAccessor;
use Yokai\Batch\Job\JobExecutor;

/**
* Answer to {@see LaunchJobMessage} and launch requested job.
*/
final class LaunchJobMessageHandler implements MessageHandlerInterface
#[AsMessageHandler]
final class LaunchJobMessageHandler
{
public function __construct(
private JobExecutionAccessor $jobExecutionAccessor,
Expand Down
2 changes: 1 addition & 1 deletion src/batch-symfony-serializer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^8.0",
"symfony/serializer": "^5.0|^6.0",
"symfony/serializer": "^5.0|^6.0|^7.0",
"yokai/batch": "^0.5.0"
},
"autoload": {
Expand Down
14 changes: 10 additions & 4 deletions src/batch-symfony-serializer/tests/Dummy/DummyNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yokai\Batch\Tests\Bridge\Symfony\Serializer\Dummy;

use ArrayObject;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

Expand All @@ -15,23 +16,28 @@ public function __construct(
) {
}

public function supportsNormalization(mixed $data, string $format = null)
public function supportsNormalization(mixed $data, string $format = null, array $context = null): bool
{
return $this->supports;
}

public function normalize(mixed $object, string $format = null, array $context = [])
public function normalize(mixed $object, string $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null
{
return $this->value;
}

public function supportsDenormalization(mixed $data, string $type, string $format = null)
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = null): bool
{
return $this->supports;
}

public function denormalize(mixed $data, string $type, string $format = null, array $context = [])
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
{
return $this->value;
}

public function getSupportedTypes(?string $format): array
{
return [];
}
}
14 changes: 10 additions & 4 deletions src/batch-symfony-serializer/tests/Dummy/FailingNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yokai\Batch\Tests\Bridge\Symfony\Serializer\Dummy;

use ArrayObject;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Expand All @@ -15,23 +16,28 @@ public function __construct(
) {
}

public function supportsNormalization(mixed $data, string $format = null)
public function supportsNormalization(mixed $data, string $format = null, array $context = null): bool
{
return true;
}

public function normalize(mixed $object, string $format = null, array $context = [])
public function normalize(mixed $object, string $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null
{
throw $this->exception;
}

public function supportsDenormalization(mixed $data, string $type, string $format = null)
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = null): bool
{
return true;
}

public function denormalize(mixed $data, string $type, string $format = null, array $context = [])
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
{
throw $this->exception;
}

public function getSupportedTypes(?string $format): array
{
return [];
}
}
2 changes: 1 addition & 1 deletion src/batch-symfony-validator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^8.0",
"symfony/validator": "^5.0|^6.0",
"symfony/validator": "^5.0|^6.0|^7.0",
"yokai/batch": "^0.5.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/batch/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require-dev": {
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"symfony/filesystem": "^5.0|^6.0"
"symfony/filesystem": "^5.0|^6.0|^7.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions tests/symfony/tests/JobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Container;
use Yokai\Batch\Launcher\JobLauncherInterface;
use Yokai\Batch\Storage\JobExecutionStorageInterface;

final class JobTest extends KernelTestCase
{
protected static $booted = false;
protected static bool $booted = false;

protected static function getContainer(): ContainerInterface
protected static function getContainer(): Container
{
if (\method_exists(KernelTestCase::class, __FUNCTION__)) {
return parent::getContainer();
Expand Down

0 comments on commit b8531e7

Please sign in to comment.