@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $difference = $this->parseDump($path, $sharedKey, $importModes); |
34 | 34 | |
35 | - $foreigners = array_map(function (array $user) { |
|
35 | + $foreigners = array_map(function(array $user) { |
|
36 | 36 | return $this->createRemoteUserFromResponse($user); |
37 | 37 | }, $difference); |
38 | 38 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | private function parseDump(string $filename, string $sharedKey, bool $importModes): array |
57 | 57 | { |
58 | - if(!file_exists($filename)) { |
|
58 | + if (!file_exists($filename)) { |
|
59 | 59 | throw new \InvalidArgumentException($filename . ' cannot be found'); |
60 | 60 | } |
61 | 61 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // Then delete from a dump so we can proceed with decryption |
68 | 68 | $this->extractHeaders($payload); |
69 | 69 | |
70 | - if($importModes) { |
|
70 | + if ($importModes) { |
|
71 | 71 | $this->modes = Arr::get($this->importHeaders, 'modes', []); |
72 | 72 | } |
73 | 73 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $handler = 'action' . Str::studly($action); |
31 | 31 | |
32 | - if(!method_exists($this, $handler)) { |
|
32 | + if (!method_exists($this, $handler)) { |
|
33 | 33 | throw new \Slides\Connector\Auth\Exceptions\SyncException("User action handler {$handler} cannot be found."); |
34 | 34 | } |
35 | 35 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | protected function actionCreate(RemoteUser $remote) |
49 | 49 | { |
50 | 50 | // If a user with the same email was found, we need to skip the process |
51 | - if(Auth::getProvider()->retrieveByCredentials(['email' => strtolower($remote->getEmail())])) { |
|
51 | + if (Auth::getProvider()->retrieveByCredentials(['email' => strtolower($remote->getEmail())])) { |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | protected function actionUpdate(RemoteUser $remote) |
70 | 70 | { |
71 | 71 | // If a user with the same email cannot be found, we should skip the process |
72 | - if(!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
72 | + if (!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | 76 | // If a local user was updated later than remote one, we should skip the process |
77 | 77 | // Since we have a latest one |
78 | - if($this->localNewerThanRemote($local, $remote)) { |
|
78 | + if ($this->localNewerThanRemote($local, $remote)) { |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
82 | 82 | // If "password" mode is not enabled, we cannot update local passwords, so we simply resetting it |
83 | - if(!$this->hasMode(static::MODE_PASSWORDS)) { |
|
83 | + if (!$this->hasMode(static::MODE_PASSWORDS)) { |
|
84 | 84 | $remote->resetPassword(); |
85 | 85 | } |
86 | 86 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected function actionDelete(RemoteUser $remote) |
105 | 105 | { |
106 | - if(!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
106 | + if (!$local = Auth::getProvider()->retrieveByCredentials(['email' => $remote->getEmail()])) { |
|
107 | 107 | return; |
108 | 108 | } |
109 | 109 | |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | */ |
123 | 123 | private function localNewerThanRemote(LocalUser $local, RemoteUser $remote) |
124 | 124 | { |
125 | - if(!$local->retrieveRemoteId()) { |
|
125 | + if (!$local->retrieveRemoteId()) { |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | |
129 | - if(!$remoteUpdated = $remote->getUpdated()) { |
|
129 | + if (!$remoteUpdated = $remote->getUpdated()) { |
|
130 | 130 | return false; |
131 | 131 | } |
132 | 132 | |
133 | - if(!$localUpdate = $local->retrieveUpdatedAt()) { |
|
133 | + if (!$localUpdate = $local->retrieveUpdatedAt()) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public static function stringToArray(string $string = null, string $valueDelimiter = ':', string $itemDelimiter = ',') |
26 | 26 | { |
27 | - if(is_null($string)) { |
|
27 | + if (is_null($string)) { |
|
28 | 28 | return []; |
29 | 29 | } |
30 | 30 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $key = Arr::get($item, 0); |
38 | 38 | $value = Arr::get($item, 1); |
39 | 39 | |
40 | - if(is_null($value)) { |
|
40 | + if (is_null($value)) { |
|
41 | 41 | $value = $key; |
42 | 42 | $key = $index; |
43 | 43 | } |