Skip to content

Commit

Permalink
feat: add compatibility support for Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
chiqui3d committed Dec 28, 2023
1 parent 399961c commit 42704b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

return static function (RoutingConfigurator $routes): void {

$routes->import('../src/Presentation/Api', 'annotation');
$routes->import('../src/Presentation/BackOffice', 'annotation');
$symfonyVersion = Symfony\Component\HttpKernel\Kernel::VERSION;

if (\version_compare($symfonyVersion, '7.0', '>=')) {
$routes->import('../src/Presentation/Api', 'attribute');
$routes->import('../src/Presentation/BackOffice', 'attribute');
} else {
$routes->import('../src/Presentation/Api', 'annotation');
$routes->import('../src/Presentation/BackOffice', 'annotation');
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

namespace Ranky\MediaBundle\Infrastructure\Persistence\Dql;

use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Events;
use Ranky\SharedBundle\Common\ClassHelper;

#[AsDoctrineListener(event: Events::loadClassMetadata)]
class LoadDqlFunctionsSubscriber implements EventSubscriberInterface
{

Expand Down

0 comments on commit 42704b1

Please sign in to comment.