Passed
Push — master ( 113f76...3cc35b )
by Anthony
02:44
created
Command/CreateAdminCommand.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -13,78 +13,78 @@
 block discarded – undo
13 13
 
14 14
 class CreateAdminCommand extends Command
15 15
 {
16
-    /** @var EntityManagerInterface */
17
-    private $em;
16
+				/** @var EntityManagerInterface */
17
+				private $em;
18 18
 
19
-    /** @var UserPasswordEncoderInterface */
20
-    private $passwordEncoder;
19
+				/** @var UserPasswordEncoderInterface */
20
+				private $passwordEncoder;
21 21
 
22
-    /**
23
-     * CreateAdminCommand constructor.
24
-     * @param EntityManagerInterface $em
25
-     * @param UserPasswordEncoderInterface $passwordEncoder
26
-     * @param string|null $name
27
-     */
28
-    public function __construct(EntityManagerInterface $em, UserPasswordEncoderInterface $passwordEncoder, string $name = null)
29
-    {
30
-        parent::__construct($name);
31
-        $this->em = $em;
32
-        $this->passwordEncoder = $passwordEncoder;
33
-    }
22
+				/**
23
+				 * CreateAdminCommand constructor.
24
+				 * @param EntityManagerInterface $em
25
+				 * @param UserPasswordEncoderInterface $passwordEncoder
26
+				 * @param string|null $name
27
+				 */
28
+				public function __construct(EntityManagerInterface $em, UserPasswordEncoderInterface $passwordEncoder, string $name = null)
29
+				{
30
+								parent::__construct($name);
31
+								$this->em = $em;
32
+								$this->passwordEncoder = $passwordEncoder;
33
+				}
34 34
 
35
-    protected function configure()
36
-    {
37
-        $this
38
-            ->setName('ribsadmin:create-admin')
39
-            ->setDescription('Create an admin in ribs admin')
40
-            ->addArgument(
41
-                'firstname',
42
-                InputArgument::REQUIRED,
43
-                'Firstname of admin to create'
44
-            )
45
-            ->addArgument(
46
-                'lastname',
47
-                InputArgument::REQUIRED,
48
-                'Lastname of admin to create'
49
-            )
50
-            ->addArgument(
51
-                'email',
52
-                InputArgument::REQUIRED,
53
-                'email of admin to create'
54
-            )
55
-            ->addArgument(
56
-                'password',
57
-                InputArgument::REQUIRED,
58
-                'password of admin to create'
59
-            )
60
-        ;
61
-    }
35
+				protected function configure()
36
+				{
37
+								$this
38
+												->setName('ribsadmin:create-admin')
39
+												->setDescription('Create an admin in ribs admin')
40
+												->addArgument(
41
+																'firstname',
42
+																InputArgument::REQUIRED,
43
+																'Firstname of admin to create'
44
+												)
45
+												->addArgument(
46
+																'lastname',
47
+																InputArgument::REQUIRED,
48
+																'Lastname of admin to create'
49
+												)
50
+												->addArgument(
51
+																'email',
52
+																InputArgument::REQUIRED,
53
+																'email of admin to create'
54
+												)
55
+												->addArgument(
56
+																'password',
57
+																InputArgument::REQUIRED,
58
+																'password of admin to create'
59
+												)
60
+								;
61
+				}
62 62
 
63
-    protected function execute(InputInterface $input, OutputInterface $output)
64
-    {
65
-        $firstname = $input->getArgument('firstname');
66
-        $lastname = $input->getArgument('lastname');
67
-        $email = $input->getArgument('email');
68
-        $password = $input->getArgument('password');
63
+				protected function execute(InputInterface $input, OutputInterface $output)
64
+				{
65
+								$firstname = $input->getArgument('firstname');
66
+								$lastname = $input->getArgument('lastname');
67
+								$email = $input->getArgument('email');
68
+								$password = $input->getArgument('password');
69 69
 
70
-        $output->writeln("Create admin " . $firstname . " " . $lastname);
70
+								$output->writeln("Create admin " . $firstname . " " . $lastname);
71 71
 
72
-        $user = new User();
73
-        $user->setFirstname($firstname);
74
-        $user->setLastname($lastname);
75
-        $user->setAccessRights("*");
76
-        $this->em->persist($user);
72
+								$user = new User();
73
+								$user->setFirstname($firstname);
74
+								$user->setLastname($lastname);
75
+								$user->setAccessRights("*");
76
+								$this->em->persist($user);
77 77
 
78
-        $account = new Account();
79
-        $temp_password = $this->passwordEncoder->encodePassword($account, $password);
80
-        $account->setPassword($temp_password);
81
-        $account->setUser($user);
82
-        $account->setEmail($email);
83
-        $account->setUsername(substr($firstname, 0, 1).".".$lastname);
84
-        $this->em->persist($account);
78
+								$account = new Account();
79
+								$temp_password = $this->passwordEncoder->encodePassword($account, $password);
80
+								$account->setPassword($temp_password);
81
+								$account->setUser($user);
82
+								$account->setEmail($email);
83
+								$account->setUsername(substr($firstname, 0, 1).".".$lastname);
84
+								$this->em->persist($account);
85 85
 
86
-        $this->em->flush();
86
+								$this->em->flush();
87 87
 
88
-        $output->writeln("End Create admin " . $firstname . " " . $lastname);
89
-    }
88
+								$output->writeln("End Create admin " . $firstname . " " . $lastname);
89
+				}
90 90
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         $account->setPassword($temp_password);
81 81
         $account->setUser($user);
82 82
         $account->setEmail($email);
83
-        $account->setUsername(substr($firstname, 0, 1).".".$lastname);
83
+        $account->setUsername(substr($firstname, 0, 1) . "." . $lastname);
84 84
         $this->em->persist($account);
85 85
 
86 86
         $this->em->flush();
Please login to merge, or discard this patch.