@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $messages = []; |
| 47 | 47 | |
| 48 | 48 | foreach (json_decode($message, true) as $property => $attributeMessages) { |
| 49 | - if(in_array($property, static::$attributeHides)) { |
|
| 49 | + if (in_array($property, static::$attributeHides)) { |
|
| 50 | 50 | continue; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function showResetForm(string $token, string $email) |
| 30 | 30 | { |
| 31 | - if(!$email = AuthService::validatePasswordResetToken($token, $email)) { |
|
| 31 | + if (!$email = AuthService::validatePasswordResetToken($token, $email)) { |
|
| 32 | 32 | throw new \Symfony\Component\HttpKernel\Exception\NotFoundHttpException(); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $this->validate($request, $this->rules(), $this->validationErrorMessages()); |
| 50 | 50 | |
| 51 | - if(AuthService::resetPassword( |
|
| 51 | + if (AuthService::resetPassword( |
|
| 52 | 52 | $request->input('token'), |
| 53 | 53 | $email = $request->input('email'), |
| 54 | 54 | $password = $request->input('password'), |
| 55 | 55 | $request->input('password_confirmation') |
| 56 | 56 | )) { |
| 57 | - if(AuthService::login($email, $password)) { |
|
| 57 | + if (AuthService::login($email, $password)) { |
|
| 58 | 58 | return $this->sendResetResponse(PasswordBroker::PASSWORD_RESET); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $handler = 'action' . studly_case($action); |
| 30 | 30 | |
| 31 | - if(!method_exists($this, $handler)) { |
|
| 31 | + if (!method_exists($this, $handler)) { |
|
| 32 | 32 | throw new \Slides\Connector\Auth\Exceptions\SyncException("User action handler {$handler} cannot be found."); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | protected function actionCreate(RemoteUser $remote) |
| 46 | 46 | { |
| 47 | 47 | // If a user with the same email was found, we need to skip the process |
| 48 | - if(Auth::getProvider()->retrieveByCredentials(['email' => strtolower($remote->getEmail())])) { |
|
| 48 | + if (Auth::getProvider()->retrieveByCredentials(['email' => strtolower($remote->getEmail())])) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -64,18 +64,18 @@ discard block |
||
| 64 | 64 | protected function actionUpdate(RemoteUser $remote) |
| 65 | 65 | { |
| 66 | 66 | // If a user with the same email cannot be found, we should skip the process |
| 67 | - if(!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
| 67 | + if (!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
| 68 | 68 | return; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // If a local user was updated later than remote one, we should skip the process |
| 72 | 72 | // Since we have a latest one |
| 73 | - if($this->localNewerThanRemote($local, $remote)) { |
|
| 73 | + if ($this->localNewerThanRemote($local, $remote)) { |
|
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // If "password" mode is not enabled, we cannot update local passwords, so we simply resetting it |
| 78 | - if(!$this->hasMode(static::MODE_PASSWORDS)) { |
|
| 78 | + if (!$this->hasMode(static::MODE_PASSWORDS)) { |
|
| 79 | 79 | $remote->resetPassword(); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | protected function actionDelete(RemoteUser $remote) |
| 98 | 98 | { |
| 99 | - if(!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
| 99 | + if (!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -115,15 +115,15 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | private function localNewerThanRemote(LocalUser $local, RemoteUser $remote) |
| 117 | 117 | { |
| 118 | - if(!$local->retrieveRemoteId()) { |
|
| 118 | + if (!$local->retrieveRemoteId()) { |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if(!$remoteUpdated = $remote->getUpdated()) { |
|
| 122 | + if (!$remoteUpdated = $remote->getUpdated()) { |
|
| 123 | 123 | return false; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - if(!$localUpdate = $local->retrieveUpdatedAt()) { |
|
| 126 | + if (!$localUpdate = $local->retrieveUpdatedAt()) { |
|
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $difference = $this->parseDump($path, $sharedKey, $importModes); |
| 33 | 33 | |
| 34 | - $foreigners = array_map(function (array $user) { |
|
| 34 | + $foreigners = array_map(function(array $user) { |
|
| 35 | 35 | return $this->createRemoteUserFromResponse($user); |
| 36 | 36 | }, $difference); |
| 37 | 37 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | private function parseDump(string $filename, string $sharedKey, bool $importModes): array |
| 56 | 56 | { |
| 57 | - if(!file_exists($filename)) { |
|
| 57 | + if (!file_exists($filename)) { |
|
| 58 | 58 | throw new \InvalidArgumentException($filename . ' cannot be found'); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // Then delete from a dump so we can proceed with decryption |
| 67 | 67 | $this->extractHeaders($payload); |
| 68 | 68 | |
| 69 | - if($importModes) { |
|
| 69 | + if ($importModes) { |
|
| 70 | 70 | $this->modes = array_get($this->importHeaders, 'modes', []); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function getEncryptionKey() |
| 56 | 56 | { |
| 57 | - if(!$this->encryptionKey) { |
|
| 57 | + if (!$this->encryptionKey) { |
|
| 58 | 58 | return null; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | protected function parseResponse(array $response) |
| 159 | 159 | { |
| 160 | - $foreigners = array_map(function (array $user) { |
|
| 160 | + $foreigners = array_map(function(array $user) { |
|
| 161 | 161 | return $this->createRemoteUserFromResponse($user); |
| 162 | 162 | }, array_get($response, 'difference')); |
| 163 | 163 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $action = $foreigner->getRemoteAction() |
| 198 | 198 | ); |
| 199 | 199 | } |
| 200 | - catch(\Slides\Connector\Auth\Exceptions\SyncException $e) { |
|
| 200 | + catch (\Slides\Connector\Auth\Exceptions\SyncException $e) { |
|
| 201 | 201 | \Illuminate\Support\Facades\Log::error( |
| 202 | 202 | "Cannot $action the user {$foreigner->getEmail()}: " . $e->getMessage() |
| 203 | 203 | ); |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | { |
| 359 | 359 | $output[] = $message; |
| 360 | 360 | |
| 361 | - if($this->outputCallback instanceof \Closure) { |
|
| 361 | + if ($this->outputCallback instanceof \Closure) { |
|
| 362 | 362 | call_user_func($this->outputCallback, $message); |
| 363 | 363 | } |
| 364 | 364 | } |
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Illuminate\Support\Facades\Route; |
| 4 | 4 | |
| 5 | -Route::group(['namespace' => 'Slides\Connector\Auth\Http\Controllers'], function () { |
|
| 5 | +Route::group(['namespace' => 'Slides\Connector\Auth\Http\Controllers'], function() { |
|
| 6 | 6 | Route::post('connector/webhook/{key}', 'WebhookController'); |
| 7 | 7 | }); |
| 8 | 8 | \ No newline at end of file |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | { |
| 65 | 65 | $modes = $this->formatModes($modes ?? $this->modes()); |
| 66 | 66 | |
| 67 | - if($modes) { |
|
| 67 | + if ($modes) { |
|
| 68 | 68 | $this->output->block('Passed modes: ' . $modes, null, 'comment'); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $syncer = new Syncer($locals = $this->syncingUsers(), $this->modes()); |
| 45 | 45 | |
| 46 | - if($locals->isEmpty()) { |
|
| 46 | + if ($locals->isEmpty()) { |
|
| 47 | 47 | $this->info('No local users found.'); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if(!$this->confirm('There are ' . $locals->count() . ' local user(s) to export. Continue?', $this->option('no-interaction'))) { |
|
| 50 | + if (!$this->confirm('There are ' . $locals->count() . ' local user(s) to export. Continue?', $this->option('no-interaction'))) { |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | private function syncingUsers() |
| 104 | 104 | { |
| 105 | - if(!count($ids = ConsoleHelper::stringToArray($this->option('users')))) { |
|
| 105 | + if (!count($ids = ConsoleHelper::stringToArray($this->option('users')))) { |
|
| 106 | 106 | return Syncer::retrieveLocals(); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | private function filePath() |
| 121 | 121 | { |
| 122 | - if(!$path = $this->option('path')) { |
|
| 122 | + if (!$path = $this->option('path')) { |
|
| 123 | 123 | $path = storage_path('app'); |
| 124 | 124 | } |
| 125 | 125 | |