Skip to content

Commit

Permalink
Symfony 6 (#221)
Browse files Browse the repository at this point in the history
* [All] migrate to symfony 6

* [All] Fix hasSession check on request

* [TesterBundle] fix deprecated InMemoryTransport

* [FrameworkExtraBundle] fix container.excluded definition

* [Security] fix test mocked class

* [SonataExtraBundle] Fix container.excluded definition

* [UserBundle] Fix container.excluded definition

* [FrameworkExtraBundle] Fix open api integration container.excluded

* [Tester] fix is readable type value

* [OpenApi] Chagne RequetBodyValueResolver to implement ValueResolverInterface

* [TesterBundle] Fix InMemoryTransport not returning delayed message

* [All] convert annotation to attribute

* [UserBundle] Remove deprecatated symfony/security-guard and scheb/2fa-qr-code

* [All] fix deprecation

* [All] Use our Security class so we don't rely on symfony/security-bundle

* [Messenger] Register doctinre listener via tags

* [FrameworkExtraBundle] extract arguments classes via type api

* [FrameworkExtraBundle] Change RequestMatcher for ChainRequestMather

* [UserBundle] fix user lock inversed by property

* [Internal] Fix deprecated doctrine report_fields_where_declared

* [SonataExtraBundle] Remove service implement in Sonata directly
  • Loading branch information
mpoiriert authored Dec 20, 2023
1 parent d520af5 commit 65d97e8
Show file tree
Hide file tree
Showing 111 changed files with 2,688 additions and 3,722 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ AWS_SECRET=@@not-a-real-secret
###> draw/entity-migrator ###
ENTITY_MIGRATOR_LOCK_DSN=flock
###< draw/entity-migrator ###

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###
7 changes: 1 addition & 6 deletions app/src/Controller/Api/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
use Draw\Component\OpenApi\Serializer\Serialization;
use Draw\DoctrineExtra\ORM\EntityHandler;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Entity;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;

/**
* @method user getUser()
Expand Down Expand Up @@ -97,7 +96,6 @@ public function editAction(
#[Route(path: '/users/{id}/tags', methods: ['PUT'])]
#[IsGranted('ROLE_ADMIN')]
#[OpenApi\Operation(operationId: 'userSetTags')]
#[Entity('target', class: User::class)]
public function setTagsAction(
User $target,
#[RequestBody(type: 'array<App\Entity\Tag>')]
Expand All @@ -113,15 +111,13 @@ public function setTagsAction(

#[Route(path: '/users/{id}', name: 'user_get', methods: ['GET'])]
#[IsGranted('ROLE_ADMIN')]
#[Entity('target', class: User::class)]
#[OpenApi\Operation(operationId: 'userGet')]
public function getAction(User $target): User
{
return $target;
}

#[Route(path: '/users/{id}', name: 'user_delete', methods: ['DELETE'])]
#[Entity('target', class: User::class)]
#[IsGranted('ROLE_ADMIN')]
#[OpenApi\Operation(operationId: 'userDelete')]
#[Serialization(statusCode: 204)]
Expand Down Expand Up @@ -149,7 +145,6 @@ public function listAction(EntityHandler $entityHandler): array
* @return void No return value mean email has been sent
*/
#[Route(path: '/users/{id}/reset-password-email', methods: ['POST'])]
#[Entity('target', class: User::class)]
#[OpenApi\Operation(operationId: 'userSendResetPasswordEmail')]
public function sendResetPasswordEmail(User $target, MailerInterface $mailer): void
{
Expand Down
10 changes: 3 additions & 7 deletions app/src/MessageHandler/NewUserMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
namespace App\MessageHandler;

use App\Message\NewUserMessage;
use Symfony\Component\Messenger\Handler\MessageSubscriberInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

class NewUserMessageHandler implements MessageSubscriberInterface
class NewUserMessageHandler
{
public static function getHandledMessages(): iterable
{
yield NewUserMessage::class => 'handleNewUserMessage';
}

/**
* Empty method just to prevent error.
*/
#[AsMessageHandler]
public function handleNewUserMessage(NewUserMessage $message): void
{
}
Expand Down
126 changes: 62 additions & 64 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"doctrine/orm": "^2.11",
"doctrine/persistence": "^3.2",
"guzzlehttp/psr7": "^1.8 || ^2.0",
"jms/serializer": "^3.11",
"jms/serializer-bundle": "^4.2",
"jms/serializer": "^3.29.1",
"jms/serializer-bundle": "^5.4.0",
"phpdocumentor/reflection-docblock": "^5.2",
"phpunit/phpunit": "^9.0 || ^10.0",
"psr/http-message": "^1.0",
Expand All @@ -28,33 +28,32 @@
"sonata-project/admin-bundle": "^4.8",
"sonata-project/doctrine-orm-admin-bundle": "^4.2",
"sonata-project/form-extensions": "^1.13",
"symfony/browser-kit": "5.4.*",
"symfony/config": "5.4.*",
"symfony/console": "5.4.*",
"symfony/css-selector": "5.4.*",
"symfony/dependency-injection": "5.4.*",
"symfony/doctrine-bridge": "5.4.*",
"symfony/doctrine-messenger": "5.4.*",
"symfony/dom-crawler": "5.4.*",
"symfony/event-dispatcher": "5.4.*",
"symfony/expression-language": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/framework-bundle": "5.4.*",
"symfony/http-foundation": "5.4.*",
"symfony/http-kernel": "5.4.*",
"symfony/mailer": "5.4.*",
"symfony/messenger": "5.4.*",
"symfony/process": "5.4.*",
"symfony/property-access": "5.4.*",
"symfony/runtime": "5.4.*",
"symfony/security-core": "5.4.*",
"symfony/security-guard": "5.4.*",
"symfony/security-http": "5.4.*",
"symfony/translation": "5.4.*",
"symfony/twig-bridge": "5.4.*",
"symfony/validator": "5.4.*",
"symfony/workflow": "5.4.*",
"symfony/yaml": "5.4.*",
"symfony/browser-kit": "^6.4.0",
"symfony/config": "^6.4.0",
"symfony/console": "^6.4.0",
"symfony/css-selector": "^6.4.0",
"symfony/dependency-injection": "^6.4.0",
"symfony/doctrine-bridge": "^6.4.0",
"symfony/doctrine-messenger": "^6.4.0",
"symfony/dom-crawler": "^6.4.0",
"symfony/event-dispatcher": "^6.4.0",
"symfony/expression-language": "^6.4.0",
"symfony/filesystem": "^6.4.0",
"symfony/framework-bundle": "^6.4.0",
"symfony/http-foundation": "^6.4.0",
"symfony/http-kernel": "^6.4.0",
"symfony/mailer": "^6.4.0",
"symfony/messenger": "^6.4.0",
"symfony/process": "^6.4.0",
"symfony/property-access": "^6.4.0",
"symfony/runtime": "^6.4.0",
"symfony/security-core": "^6.4.0",
"symfony/security-http": "^6.4.0",
"symfony/translation": "^6.4.0",
"symfony/twig-bridge": "^6.4.0",
"symfony/validator": "^6.4.0",
"symfony/workflow": "^6.4.0",
"symfony/yaml": "^6.4.0",
"twig/twig": "^3.3",
"friendsofphp/php-cs-fixer": "^3.13",
"nesbot/carbon": "^2.0"
Expand All @@ -66,55 +65,54 @@
"bamarni/composer-bin-plugin": "^1.4",
"composer/semver": "^3.2",
"doctrine/data-fixtures": "^1.5",
"doctrine/doctrine-fixtures-bundle": "^3.4",
"doctrine/doctrine-fixtures-bundle": "^3.5",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/sql-formatter": "^1.1",
"firebase/php-jwt": "^6.1",
"monolog/monolog": "^2.4.0",
"nelmio/cors-bundle": "^2.0",
"pdeans/http": "^1.1",
"pelago/emogrifier": "^6.0",
"scheb/2fa-bundle": "^5.12",
"scheb/2fa-qr-code": "^5.12",
"scheb/2fa-totp": "^5.12",
"sensio/framework-extra-bundle": "^5.6 || ^6.2",
"scheb/2fa-bundle": "^6.0",
"endroid/qr-code": "^4.8",
"scheb/2fa-totp": "^6.0",
"sonata-project/admin-bundle": "^4.8",
"sonata-project/doctrine-orm-admin-bundle": "^4.2",
"symfony/asset": "5.4.*",
"symfony/cache": "5.4.*",
"symfony/debug-bundle": "5.4.*",
"symfony/dependency-injection": "5.4.*",
"symfony/dotenv": "5.4.*",
"symfony/error-handler": "5.4.x",
"symfony/event-dispatcher": "5.4.*",
"symfony/expression-language": "5.4.*",
"symfony/finder": "5.4.x",
"symfony/asset": "^6.4.0",
"symfony/cache": "^6.4.0",
"symfony/debug-bundle": "^6.4.0",
"symfony/dependency-injection": "^6.4.0",
"symfony/dotenv": "^6.4.0",
"symfony/error-handler": "^6.4.0",
"symfony/event-dispatcher": "^6.4.0",
"symfony/expression-language": "^6.4.0",
"symfony/finder": "^6.4.0",
"symfony/flex": "^2.2.4",
"symfony/form": "5.4.*",
"symfony/http-client": "5.4.*",
"symfony/http-client-contracts": "^2.5",
"symfony/lock": "5.4.x",
"symfony/monolog-bundle": "^3.7",
"symfony/password-hasher": "5.4.*",
"symfony/phpunit-bridge": "5.4.*",
"symfony/property-info": "5.4.*",
"symfony/redis-messenger": "5.4.*",
"symfony/routing": "5.4.*",
"symfony/security-bundle": "5.4.*",
"symfony/security-csrf": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/stopwatch": "5.4.*",
"symfony/string": "5.4.*",
"symfony/form": "^6.4.0",
"symfony/http-client": "^6.4.0",
"symfony/http-client-contracts": "^3.4",
"symfony/lock": "^6.4.0",
"symfony/monolog-bundle": "^3.8",
"symfony/password-hasher": "^6.4.0",
"symfony/phpunit-bridge": "^6.4.0",
"symfony/property-info": "^6.4.0",
"symfony/redis-messenger": "^6.4.0",
"symfony/routing": "^6.4.0",
"symfony/security-bundle": "^6.4.0",
"symfony/security-csrf": "^6.4.0",
"symfony/serializer": "^6.4.0",
"symfony/stopwatch": "^6.4.0",
"symfony/string": "^6.4.0",
"symfony/translation-contracts": "^2.5",
"symfony/twig-bundle": "5.4.*",
"symfony/var-dumper": "5.4.*",
"symfony/var-exporter": "5.4.*",
"symfony/web-profiler-bundle": "5.4.*",
"symfony/twig-bundle": "^6.4.0",
"symfony/var-dumper": "^6.4.0",
"symfony/var-exporter": "^6.4.0",
"symfony/web-profiler-bundle": "^6.4.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.7",
"phpstan/phpstan-symfony": "^1.2",
"phpstan/phpstan-phpunit": "^1.1",
"scheb/2fa-email": "^5.12",
"scheb/2fa-email": "^6.0",
"colinodell/psr-testlogger": "^1.1",
"cweagans/composer-patches": "^1.7"
},
Expand Down Expand Up @@ -206,7 +204,7 @@
"symfony": {
"id": "01CAD2CSWYZBBNJDXQR6BP23MR",
"allow-contrib": true,
"require": "5.4.*"
"require": "^6.4.0"
}
},
"extra": {
Expand Down
Loading

0 comments on commit 65d97e8

Please sign in to comment.