Преглед изворни кода

Merge branch 'develop' into features/background

François Drouhard пре 3 година
родитељ
комит
7d828c793a

+ 5 - 2
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",
@@ -53,7 +53,10 @@
         "preferred-install": {
             "*": "dist"
         },
-        "sort-packages": true
+        "sort-packages": true,
+        "allow-plugins": {
+            "symfony/flex": true
+        }
     },
     "autoload": {
         "psr-4": {

Разлика између датотеке није приказан због своје велике величине
+ 178 - 183
composer.lock


+ 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"
     }
 }

Неке датотеке нису приказане због велике количине промена