Browse Source

Symfony 5.4.5 - deprecated

François Drouhard 3 năm trước cách đây
mục cha
commit
48abf3648e

+ 1 - 1
composer.json

@@ -11,7 +11,7 @@
         "doctrine/doctrine-migrations-bundle": "^3.1",
         "doctrine/orm": "^2.9",
         "phpdocumentor/reflection-docblock": "^5.3",
-        "sensio/framework-extra-bundle": "^5.4",
+        "sensio/framework-extra-bundle": "^6.2",
         "symfony/apache-pack": "^1.0",
         "symfony/asset": "^5.4",
         "symfony/console": "^5.4",

+ 22 - 24
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "6d966b11741c351b16ea7821d90d0978",
+    "content-hash": "55b8d15feb2f817680bfd46e7f6f77a4",
     "packages": [
         {
             "name": "composer/package-versions-deprecated",
@@ -2294,25 +2294,25 @@
         },
         {
             "name": "sensio/framework-extra-bundle",
-            "version": "v5.6.1",
+            "version": "v6.2.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
-                "reference": "430d14c01836b77c28092883d195a43ce413ee32"
+                "reference": "6bd976c99ef3f78e31c9490a10ba6dd8901076eb"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/430d14c01836b77c28092883d195a43ce413ee32",
-                "reference": "430d14c01836b77c28092883d195a43ce413ee32",
+                "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/6bd976c99ef3f78e31c9490a10ba6dd8901076eb",
+                "reference": "6bd976c99ef3f78e31c9490a10ba6dd8901076eb",
                 "shasum": ""
             },
             "require": {
                 "doctrine/annotations": "^1.0",
                 "php": ">=7.2.5",
-                "symfony/config": "^4.4|^5.0",
-                "symfony/dependency-injection": "^4.4|^5.0",
-                "symfony/framework-bundle": "^4.4|^5.0",
-                "symfony/http-kernel": "^4.4|^5.0"
+                "symfony/config": "^4.4|^5.0|^6.0",
+                "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+                "symfony/framework-bundle": "^4.4|^5.0|^6.0",
+                "symfony/http-kernel": "^4.4|^5.0|^6.0"
             },
             "conflict": {
                 "doctrine/doctrine-cache-bundle": "<1.3.1",
@@ -2322,25 +2322,23 @@
                 "doctrine/dbal": "^2.10|^3.0",
                 "doctrine/doctrine-bundle": "^1.11|^2.0",
                 "doctrine/orm": "^2.5",
-                "nyholm/psr7": "^1.1",
-                "symfony/browser-kit": "^4.4|^5.0",
-                "symfony/doctrine-bridge": "^4.4|^5.0",
-                "symfony/dom-crawler": "^4.4|^5.0",
-                "symfony/expression-language": "^4.4|^5.0",
-                "symfony/finder": "^4.4|^5.0",
-                "symfony/monolog-bridge": "^4.0|^5.0",
+                "symfony/browser-kit": "^4.4|^5.0|^6.0",
+                "symfony/doctrine-bridge": "^4.4|^5.0|^6.0",
+                "symfony/dom-crawler": "^4.4|^5.0|^6.0",
+                "symfony/expression-language": "^4.4|^5.0|^6.0",
+                "symfony/finder": "^4.4|^5.0|^6.0",
+                "symfony/monolog-bridge": "^4.0|^5.0|^6.0",
                 "symfony/monolog-bundle": "^3.2",
-                "symfony/phpunit-bridge": "^4.4.9|^5.0.9",
-                "symfony/psr-http-message-bridge": "^1.1",
-                "symfony/security-bundle": "^4.4|^5.0",
-                "symfony/twig-bundle": "^4.4|^5.0",
-                "symfony/yaml": "^4.4|^5.0",
+                "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0",
+                "symfony/security-bundle": "^4.4|^5.0|^6.0",
+                "symfony/twig-bundle": "^4.4|^5.0|^6.0",
+                "symfony/yaml": "^4.4|^5.0|^6.0",
                 "twig/twig": "^1.34|^2.4|^3.0"
             },
             "type": "symfony-bundle",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "5.6.x-dev"
+                    "dev-master": "6.1.x-dev"
                 }
             },
             "autoload": {
@@ -2368,9 +2366,9 @@
             ],
             "support": {
                 "issues": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues",
-                "source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v5.6.1"
+                "source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v6.2.6"
             },
-            "time": "2020-08-25T19:10:18+00:00"
+            "time": "2022-01-14T11:51:13+00:00"
         },
         {
             "name": "swiftmailer/swiftmailer",

+ 6 - 2
src/Command/AppUserCreateCommand.php

@@ -10,6 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Question\ChoiceQuestion;
 use Symfony\Component\Console\Question\Question;
 use App\Service\UserManager;
+use Symfony\Component\Console\Style\SymfonyStyle;
 
 class AppUserCreateCommand extends Command
 {
@@ -31,8 +32,10 @@ class AppUserCreateCommand extends Command
         ;
     }
 
-    protected function execute(InputInterface $input, OutputInterface $output)
+    protected function execute(InputInterface $input, OutputInterface $output) : int
     {
+        $io = new SymfonyStyle($input, $output);
+
         $helper = $this->getHelper('question');
         $questionUsername = new Question('Nom (username) de l\'utilisateur : ', 'admin_user');
         $questionPrenom = new Question('Prénom de l\'utilisateur : ');
@@ -60,7 +63,8 @@ class AppUserCreateCommand extends Command
             $roles,
             true);
 
-        $output->writeln('Nom du pélo : '.$username);
+        $io->success('Nom du pélo : '.$username);
+        return COMMAND::SUCCESS;
     }
 
 }

+ 6 - 3
src/Command/AppUsersActivateCommand.php

@@ -7,6 +7,7 @@ use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Question\ConfirmationQuestion;
+use Symfony\Component\Console\Style\SymfonyStyle;
 
 class AppUsersActivateCommand extends Command
 {
@@ -26,13 +27,14 @@ class AppUsersActivateCommand extends Command
         ;
     }
 
-    protected function execute(InputInterface $input, OutputInterface $output)
+    protected function execute(InputInterface $input, OutputInterface $output) :int
     {
+        $io = new SymfonyStyle($input, $output);
         $helper = $this->getHelper('question');
         $question = new ConfirmationQuestion('Activer tous les utilisateurs ?', false);
         if (!$helper->ask($input, $output, $question))
         {
-            return;
+            return COMMAND::INVALID;
         }
         $users = $this->em->getRepository('App:User')->findAll();
         foreach ($users as $user)
@@ -41,7 +43,8 @@ class AppUsersActivateCommand extends Command
         }
         $this->em->flush();
 
-        $output->writeln('Les utilisateurs sont activés');
+        $io->success('Les utilisateurs sont activés');
+        return COMMAND::SUCCESS;
     }
 
 }

+ 5 - 2
src/Command/UpdateCommentairesCommand.php

@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
 
 class UpdateCommentairesCommand extends Command
 {
@@ -28,15 +29,17 @@ class UpdateCommentairesCommand extends Command
         ;
     }
 
-    protected function execute(InputInterface $input, OutputInterface $output)
+    protected function execute(InputInterface $input, OutputInterface $output) :int
     {
+        $io = new SymfonyStyle($input, $output);
         $films = $this->em->getRepository('App:Film')->findAll();
         foreach ($films as $film)
         {
             $this->notesAndComs->calculerMoyenne($film);
         }
 
-        $output->writeln('Tous les coms et toutes les notes sont mis à jour');
+        $io->success('Tous les coms et toutes les notes sont mis à jour');
+        return COMMAND::SUCCESS;
     }
 
 }

+ 1 - 1
src/Form/CommentaireType.php

@@ -56,7 +56,7 @@ class CommentaireType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_commentaire';
     }

+ 1 - 1
src/Form/FilmType.php

@@ -71,7 +71,7 @@ class FilmType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_film';
     }

+ 1 - 1
src/Form/GenreType.php

@@ -31,7 +31,7 @@ class GenreType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_genre';
     }

+ 1 - 1
src/Form/MediaVideoType.php

@@ -31,7 +31,7 @@ class MediaVideoType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_mediavideo';
     }

+ 1 - 1
src/Form/RealisateurType.php

@@ -36,7 +36,7 @@ class RealisateurType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_realisateur';
     }

+ 1 - 1
src/Form/UserEditPasswordType.php

@@ -21,7 +21,7 @@ class UserEditPasswordType extends AbstractType
             ->remove('roles');
     }
 
-    public function getParent()
+    public function getParent() : ?string
     {
         return UserType::class;
     }

+ 1 - 1
src/Form/UserEditProfilType.php

@@ -18,7 +18,7 @@ class UserEditProfilType extends AbstractType
             ->remove('activated');
     }
 
-    public function getParent()
+    public function getParent() : ?string
     {
         return UserType::class;
     }

+ 1 - 1
src/Form/UserEditType.php

@@ -16,7 +16,7 @@ class UserEditType extends AbstractType
             ->remove('password');
     }
 
-    public function getParent()
+    public function getParent() : ?string
     {
         return UserType::class;
     }

+ 1 - 1
src/Form/UserRegisterType.php

@@ -17,7 +17,7 @@ class UserRegisterType extends AbstractType
             ->remove('activated');
     }
 
-    public function getParent()
+    public function getParent() : ?string
     {
         return UserType::class;
     }

+ 1 - 1
src/Form/UserType.php

@@ -67,7 +67,7 @@ class UserType extends AbstractType
     /**
      * {@inheritdoc}
      */
-    public function getBlockPrefix()
+    public function getBlockPrefix() : string
     {
         return 'App_user';
     }

+ 1 - 2
src/Security/LoginFormAuthenticator.php

@@ -15,7 +15,6 @@ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\RememberMeBadge
 use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
 use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
 use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
-use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
 use Symfony\Component\Security\Http\Util\TargetPathTrait;
 
 class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
@@ -45,7 +44,7 @@ class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
             && $request->isMethod('POST');
 }
 
-    public function authenticate(Request $request): PassportInterface
+    public function authenticate(Request $request): Passport
     {
         $username = $request->request->get('username', '');
 

+ 2 - 2
src/Twig/TwigNouveautes.php

@@ -8,14 +8,14 @@ use App\Service\Nouveautes;
 
 class TwigNouveautes extends AbstractExtension
 {
-    public function getFunctions ()
+    public function getFunctions () : array
     {
         return array(
             new TwigFunction('afficheNouveautes', array(Nouveautes::class, 'afficher')),
         );
     }
 
-    public function getName()
+    public function getName() : string
     {
         return 'afficheNouveautes';
     }

+ 0 - 54
symfony.lock

@@ -78,36 +78,15 @@
     "doctrine/persistence": {
         "version": "1.1.1"
     },
-    "doctrine/reflection": {
-        "version": "v1.0.0"
-    },
     "doctrine/sql-formatter": {
         "version": "1.1.0"
     },
-    "easycorp/easy-log-handler": {
-        "version": "1.0",
-        "recipe": {
-            "repo": "github.com/symfony/recipes",
-            "branch": "master",
-            "version": "1.0",
-            "ref": "70062abc2cd58794d2a90274502f81b55cd9951b"
-        },
-        "files": [
-            "config/packages/dev/easy_log_handler.yaml"
-        ]
-    },
     "egulias/email-validator": {
         "version": "2.1.7"
     },
-    "facebook/webdriver": {
-        "version": "1.6.0"
-    },
     "friendsofphp/proxy-manager-lts": {
         "version": "v1.0.5"
     },
-    "jdorn/sql-formatter": {
-        "version": "v1.2.17"
-    },
     "laminas/laminas-code": {
         "version": "3.4.1"
     },
@@ -126,21 +105,12 @@
     "nikic/php-parser": {
         "version": "v4.2.1"
     },
-    "ocramius/package-versions": {
-        "version": "1.5.1"
-    },
-    "ocramius/proxy-manager": {
-        "version": "2.1.1"
-    },
     "phar-io/manifest": {
         "version": "2.0.1"
     },
     "phar-io/version": {
         "version": "3.1.0"
     },
-    "php": {
-        "version": "7.3"
-    },
     "phpdocumentor/reflection-common": {
         "version": "1.0.1"
     },
@@ -315,9 +285,6 @@
             "config/packages/dev/debug.yaml"
         ]
     },
-    "symfony/debug-pack": {
-        "version": "v1.0.8"
-    },
     "symfony/dependency-injection": {
         "version": "v4.2.8"
     },
@@ -385,9 +352,6 @@
             "src/Kernel.php"
         ]
     },
-    "symfony/http-client-contracts": {
-        "version": "v2.4.0"
-    },
     "symfony/http-foundation": {
         "version": "v4.2.8"
     },
@@ -423,12 +387,6 @@
     "symfony/options-resolver": {
         "version": "v4.2.8"
     },
-    "symfony/orm-pack": {
-        "version": "v1.0.6"
-    },
-    "symfony/panther": {
-        "version": "v0.3.0"
-    },
     "symfony/password-hasher": {
         "version": "v5.3.3"
     },
@@ -478,9 +436,6 @@
     "symfony/process": {
         "version": "v4.2.8"
     },
-    "symfony/profiler-pack": {
-        "version": "v1.0.4"
-    },
     "symfony/property-access": {
         "version": "v4.2.8"
     },
@@ -655,16 +610,7 @@
     "twig/twig": {
         "version": "v2.9.0"
     },
-    "webimpress/safe-writer": {
-        "version": "2.0.1"
-    },
     "webmozart/assert": {
         "version": "1.4.0"
-    },
-    "zendframework/zend-code": {
-        "version": "3.3.1"
-    },
-    "zendframework/zend-eventmanager": {
-        "version": "3.2.1"
     }
 }