@@ -20,7 +20,7 @@ |
||
20 | 20 | public function get(string $userId):User |
21 | 21 | { |
22 | 22 | $user = $this->userRepository->getById($userId); |
23 | - if(!isset($user)){ |
|
23 | + if (!isset($user)) { |
|
24 | 24 | throw new UserNotFound(); |
25 | 25 | } |
26 | 26 | return $user; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function edit(string $userId, string $email, string $firstname, string $lastname, array $picture) |
21 | 21 | { |
22 | 22 | $user = $this->userRepository->getById($userId); |
23 | - if(!isset($user)){ |
|
23 | + if (!isset($user)) { |
|
24 | 24 | throw new UserNotFound(); |
25 | 25 | } |
26 | 26 | $this->validateData($userId, $firstname, $lastname, $email, $picture); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (isset($user) && $user->id() !== $userId) { |
54 | 54 | $errors['email'] = __('validation.unique', ['attribute' => 'email']); |
55 | 55 | } |
56 | - $validator->after(function () use ($validator, $errors) { |
|
56 | + $validator->after(function() use ($validator, $errors) { |
|
57 | 57 | foreach ($errors as $field => $error) { |
58 | 58 | $validator->errors()->add($field, $error); |
59 | 59 | } |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | interface UserRepository |
10 | 10 | { |
11 | - public function getByEmail(string $email):? User; |
|
12 | - public function getById(string $id):?User; |
|
13 | - public function getByProvider(string $provider, string $providerId):?User; |
|
11 | + public function getByEmail(string $email): ? User; |
|
12 | + public function getById(string $id): ?User; |
|
13 | + public function getByProvider(string $provider, string $providerId): ?User; |
|
14 | 14 | public function search(string $organizationId, int $page, int $perPage = 10): array; |
15 | 15 | public function add(User $u, string $password = null); |
16 | 16 | public function update(User $u); |
@@ -89,7 +89,7 @@ |
||
89 | 89 | */ |
90 | 90 | private function checkProviderAllowed(?string $provider, ?string $providerId): void |
91 | 91 | { |
92 | - if($provider === null || $providerId === null){ |
|
92 | + if ($provider === null || $providerId === null) { |
|
93 | 93 | throw new ProviderMissing(); |
94 | 94 | } |
95 | 95 | if (!in_array($provider, $this->allowedProviders)) { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | ->select() |
30 | 30 | ->where('hash', $hash) |
31 | 31 | ->first(); |
32 | - if(!isset($record)){ |
|
32 | + if (!isset($record)) { |
|
33 | 33 | return null; |
34 | 34 | } |
35 | 35 | return new Invitation($record->organization_id, $record->email, $record->firstname, $record->lastname); |
@@ -9,5 +9,5 @@ |
||
9 | 9 | interface InvitationRepository |
10 | 10 | { |
11 | 11 | public function add(Invitation $i); |
12 | - public function getByHash(string $hash):?Invitation; |
|
12 | + public function getByHash(string $hash): ?Invitation; |
|
13 | 13 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function __construct(array $data) |
22 | 22 | { |
23 | - foreach ($this->fields as $field){ |
|
23 | + foreach ($this->fields as $field) { |
|
24 | 24 | $this->stats[$field] = $this->dataOrZero($field, $data); |
25 | 25 | } |
26 | 26 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | $this->dbWiki->table('user') |
30 | 30 | ->orderBy('user.user_id', 'desc') |
31 | - ->chunk(200, function ($records){ |
|
31 | + ->chunk(200, function($records) { |
|
32 | 32 | foreach ($records as $record) { |
33 | 33 | |
34 | 34 | $user = $this->userRepository->getByEmail($record->user_email); |
35 | - if(!isset($user)){ |
|
35 | + if (!isset($user)) { |
|
36 | 36 | continue; |
37 | 37 | } |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $editsOnWiki = $this->getEditsOnWikiNumber($record->user_id); |
43 | 43 | |
44 | 44 | |
45 | - $numberContributions = $questions + $answers + $votes + $editsOnWiki; |
|
45 | + $numberContributions = $questions+$answers+$votes+$editsOnWiki; |
|
46 | 46 | $fields = [ |
47 | 47 | 'number_contributions' => $numberContributions, |
48 | 48 | 'number_questions' => $questions, |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function handle($request, Closure $next, $guard = null) |
20 | 20 | { |
21 | - if($request->has('wiki_callback') && Auth::user() !== null){ |
|
21 | + if ($request->has('wiki_callback') && Auth::user() !== null) { |
|
22 | 22 | return $this->redirectToWiki($request); |
23 | 23 | } |
24 | 24 |