@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | $this->io->title('Promote a new OBBLM Administrator'); |
42 | 42 | $this->io->caution('Be carefull, this new user will have the highest right on the application'); |
43 | 43 | $continue = $this->io->confirm('Are you sure you want to continue ?', true); |
44 | - if($continue) { |
|
44 | + if ($continue) { |
|
45 | 45 | $coachRepository = $this->em->getRepository(Coach::class); |
46 | 46 | |
47 | 47 | $choice = $this->io->choice('Search him by login or email ', ['login', 'email']); |
48 | 48 | |
49 | - if($choice !== 'login' && $choice !== 'email') { |
|
49 | + if ($choice !== 'login' && $choice !== 'email') { |
|
50 | 50 | throw new \RuntimeException("Something went wrong."); |
51 | 51 | return 0; |
52 | 52 | } |
53 | - elseif($choice === 'login') { |
|
54 | - $coach = $this->io->ask('User login', null, function ($username) use ($coachRepository) { |
|
53 | + elseif ($choice === 'login') { |
|
54 | + $coach = $this->io->ask('User login', null, function($username) use ($coachRepository) { |
|
55 | 55 | if (empty($username)) { |
56 | 56 | throw new \RuntimeException('The login cannot be empty.'); |
57 | 57 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | }); |
64 | 64 | } |
65 | 65 | elseif ($choice === 'email') { |
66 | - $coach = $this->io->ask('User email', null, function ($email) use ($coachRepository) { |
|
66 | + $coach = $this->io->ask('User email', null, function($email) use ($coachRepository) { |
|
67 | 67 | if (empty($email)) { |
68 | 68 | throw new \RuntimeException('The email cannot be empty.'); |
69 | 69 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | /** @var Coach $coach */ |
78 | 78 | $continue = $this->io->confirm("Are you sure you want to promote {$coach->getUsername()} ?", true); |
79 | - if($continue) { |
|
79 | + if ($continue) { |
|
80 | 80 | $coach |
81 | 81 | ->setRoles([Roles::ADMIN]); |
82 | 82 | $this->em->persist($coach); |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | if($choice !== 'login' && $choice !== 'email') { |
50 | 50 | throw new \RuntimeException("Something went wrong."); |
51 | 51 | return 0; |
52 | - } |
|
53 | - elseif($choice === 'login') { |
|
52 | + } elseif($choice === 'login') { |
|
54 | 53 | $coach = $this->io->ask('User login', null, function ($username) use ($coachRepository) { |
55 | 54 | if (empty($username)) { |
56 | 55 | throw new \RuntimeException('The login cannot be empty.'); |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | } |
62 | 61 | return $coach; |
63 | 62 | }); |
64 | - } |
|
65 | - elseif ($choice === 'email') { |
|
63 | + } elseif ($choice === 'email') { |
|
66 | 64 | $coach = $this->io->ask('User email', null, function ($email) use ($coachRepository) { |
67 | 65 | if (empty($email)) { |
68 | 66 | throw new \RuntimeException('The email cannot be empty.'); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | $this->io->title('Create a new OBBLM Administrator'); |
46 | 46 | $this->io->caution('Be carefull, this new user will have the highest right on the application'); |
47 | 47 | $continue = $this->io->confirm('Are you sure you want to continue ?', true); |
48 | - if($continue) { |
|
48 | + if ($continue) { |
|
49 | 49 | $coachRepository = $this->em->getRepository(Coach::class); |
50 | 50 | $this->io->section('User informations'); |
51 | - $username = $this->io->ask('User login', null, function ($username) use ($coachRepository) { |
|
51 | + $username = $this->io->ask('User login', null, function($username) use ($coachRepository) { |
|
52 | 52 | if (empty($username)) { |
53 | 53 | throw new \RuntimeException('The login cannot be empty.'); |
54 | 54 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | return (string) $username; |
59 | 59 | }); |
60 | - $email = $this->io->ask('User email', null, function ($email) use ($coachRepository) { |
|
60 | + $email = $this->io->ask('User email', null, function($email) use ($coachRepository) { |
|
61 | 61 | if (empty($email)) { |
62 | 62 | throw new \RuntimeException('The email cannot be empty.'); |
63 | 63 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | return (string) $email; |
68 | 68 | }); |
69 | - $password = $this->io->askHidden('User password', function ($password) { |
|
69 | + $password = $this->io->askHidden('User password', function($password) { |
|
70 | 70 | if (empty($password)) { |
71 | 71 | throw new \RuntimeException('Password cannot be empty.'); |
72 | 72 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ->setLocale('en') |
85 | 85 | ->setRoles([Roles::ADMIN]) |
86 | 86 | ; |
87 | - if(!$active) { |
|
87 | + if (!$active) { |
|
88 | 88 | $coach |
89 | 89 | ->setHash(hash('sha256', $coach->getEmail())); |
90 | 90 | $registration = new RegisterCoachEvent($coach); |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | $this->io->title('Revoke an OBBLM Administrator'); |
42 | 42 | $this->io->caution('Be carefull, this new user will not have anymore the highest right on the application'); |
43 | 43 | $continue = $this->io->confirm('Are you sure you want to continue ?', true); |
44 | - if($continue) { |
|
44 | + if ($continue) { |
|
45 | 45 | $coachRepository = $this->em->getRepository(Coach::class); |
46 | 46 | |
47 | 47 | $choice = $this->io->choice('Search him by login or email ', ['login', 'email']); |
48 | 48 | |
49 | - if($choice !== 'login' && $choice !== 'email') { |
|
49 | + if ($choice !== 'login' && $choice !== 'email') { |
|
50 | 50 | throw new \RuntimeException("Something went wrong."); |
51 | 51 | return 0; |
52 | 52 | } |
53 | - elseif($choice === 'login') { |
|
54 | - $coach = $this->io->ask('User login', null, function ($username) use ($coachRepository) { |
|
53 | + elseif ($choice === 'login') { |
|
54 | + $coach = $this->io->ask('User login', null, function($username) use ($coachRepository) { |
|
55 | 55 | if (empty($username)) { |
56 | 56 | throw new \RuntimeException('The login cannot be empty.'); |
57 | 57 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | }); |
64 | 64 | } |
65 | 65 | elseif ($choice === 'email') { |
66 | - $coach = $this->io->ask('User email', null, function ($email) use ($coachRepository) { |
|
66 | + $coach = $this->io->ask('User email', null, function($email) use ($coachRepository) { |
|
67 | 67 | if (empty($email)) { |
68 | 68 | throw new \RuntimeException('The email cannot be empty.'); |
69 | 69 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | /** @var Coach $coach */ |
78 | 78 | $continue = $this->io->confirm("Are you sure you want to revoke {$coach->getUsername()} ?", true); |
79 | - if($continue) { |
|
80 | - if(in_array(Roles::ADMIN, $coach->getRoles())) { |
|
79 | + if ($continue) { |
|
80 | + if (in_array(Roles::ADMIN, $coach->getRoles())) { |
|
81 | 81 | $coach |
82 | 82 | ->setRoles([Roles::COACH]); |
83 | 83 | $this->em->persist($coach); |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | if($choice !== 'login' && $choice !== 'email') { |
50 | 50 | throw new \RuntimeException("Something went wrong."); |
51 | 51 | return 0; |
52 | - } |
|
53 | - elseif($choice === 'login') { |
|
52 | + } elseif($choice === 'login') { |
|
54 | 53 | $coach = $this->io->ask('User login', null, function ($username) use ($coachRepository) { |
55 | 54 | if (empty($username)) { |
56 | 55 | throw new \RuntimeException('The login cannot be empty.'); |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | } |
62 | 61 | return $coach; |
63 | 62 | }); |
64 | - } |
|
65 | - elseif ($choice === 'email') { |
|
63 | + } elseif ($choice === 'email') { |
|
66 | 64 | $coach = $this->io->ask('User email', null, function ($email) use ($coachRepository) { |
67 | 65 | if (empty($email)) { |
68 | 66 | throw new \RuntimeException('The email cannot be empty.'); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | } |
127 | 127 | $translator = $this->translator; |
128 | - $closure = function (Player $starPlayer) use ($translator, $rule) { |
|
128 | + $closure = function(Player $starPlayer) use ($translator, $rule) { |
|
129 | 129 | $starPlayer->setName($translator->trans($starPlayer->getName(), [], $rule->getRuleKey())); |
130 | 130 | return $starPlayer; |
131 | 131 | }; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $order = Criteria::create()->orderBy(['name' => 'ASC']); |
175 | 175 | |
176 | 176 | $translator = $this->translator; |
177 | - $closure = function (Skill $skill) use ($translator, $rule) { |
|
177 | + $closure = function(Skill $skill) use ($translator, $rule) { |
|
178 | 178 | $skill->setName($translator->trans($skill->getName(), [], $rule->getRuleKey())); |
179 | 179 | return $skill; |
180 | 180 | }; |
@@ -22,8 +22,8 @@ |
||
22 | 22 | |
23 | 23 | private function load($directory) |
24 | 24 | { |
25 | - $manifestPath = $directory.'/manifest.json'; |
|
26 | - $entrypointsPath = $directory.'/entrypoints.json'; |
|
25 | + $manifestPath = $directory . '/manifest.json'; |
|
26 | + $entrypointsPath = $directory . '/entrypoints.json'; |
|
27 | 27 | |
28 | 28 | $this->package = new Package(new JsonManifestVersionStrategy($manifestPath)); |
29 | 29 |