Skip to content

Commit

Permalink
Try to solve deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Mar 14, 2024
1 parent d441da2 commit 21f335b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/End2End/App/FooHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
namespace Facile\MongoDbMessenger\Tests\End2End\App;

use Facile\MongoDbMessenger\Tests\Stubs\FooMessage;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

#[AsMessageHandler]
class FooHandler implements MessageHandlerInterface
{
public const ERROR_MESSAGE = 'Failing on purpose';
Expand Down
8 changes: 6 additions & 2 deletions tests/End2End/App/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
$loader->load(__DIR__ . '/facile_it_mongodb.yaml');
$loader->load(__DIR__ . '/messenger.yaml');

if (BaseKernel::VERSION_ID >= 50400) {
$loader->load(__DIR__ . '/deprecations.yaml');
if (BaseKernel::VERSION_ID >= 60400) {
$loader->load(__DIR__ . '/deprecations_6.4.yaml');
} elseif (BaseKernel::VERSION_ID >= 60100) {
$loader->load(__DIR__ . '/deprecations_6.1.yaml');
} elseif (BaseKernel::VERSION_ID >= 50400) {
$loader->load(__DIR__ . '/deprecations_5.4.yaml');
}
}
}
8 changes: 8 additions & 0 deletions tests/End2End/App/SuppressDeprecationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ protected function isAllowedAttribute($classOrObject, $attribute, $format = null

return parent::isAllowedAttribute($classOrObject, $attribute, $format, $context);
}

/**
* @return array<class-string, bool>
*/
public function getSupportedTypes(?string $format): array
{
return [RedeliveryStamp::class => true];
}
}
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/End2End/App/deprecations_6.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
framework:
http_method_override: false
5 changes: 5 additions & 0 deletions tests/End2End/App/deprecations_6.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
framework:
handle_all_throwables: true
http_method_override: false
php_errors:
log: true

0 comments on commit 21f335b

Please sign in to comment.