@@ -23,8 +23,7 @@ |
||
| 23 | 23 | if (empty($rows)) |
| 24 | 24 | { |
| 25 | 25 | CLI::write( CLI::color("There are no groups.", 'yellow') ); |
| 26 | - } |
|
| 27 | - else |
|
| 26 | + } else |
|
| 28 | 27 | { |
| 29 | 28 | $thead = ['Group ID', 'Name', 'Description']; |
| 30 | 29 | CLI::table($rows, $thead); |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | if ($userId = $users->insert($user)) |
| 47 | 47 | { |
| 48 | 48 | CLI::write(lang('Auth.registerCLI', [$row['username'], $userId]), 'green'); |
| 49 | - } |
|
| 50 | - else |
|
| 49 | + } else |
|
| 51 | 50 | { |
| 52 | 51 | foreach ($users->errors() as $message) |
| 53 | 52 | { |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | CLI::write($message, 'red'); |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | - } |
|
| 46 | - catch (\Exception $e) |
|
| 45 | + } catch (\Exception $e) |
|
| 47 | 46 | { |
| 48 | 47 | $this->showError($e); |
| 49 | 48 | } |
@@ -33,16 +33,14 @@ |
||
| 33 | 33 | if (! $user) |
| 34 | 34 | { |
| 35 | 35 | CLI::write('User with identity: '. $identity .' not found.', 'red'); |
| 36 | - } |
|
| 37 | - else |
|
| 36 | + } else |
|
| 38 | 37 | { |
| 39 | 38 | $user->active = 1; |
| 40 | 39 | |
| 41 | 40 | if ($userModel->save($user)) |
| 42 | 41 | { |
| 43 | 42 | CLI::write('Sucessfuly activated the user with identity: ' . $identity , 'green'); |
| 44 | - } |
|
| 45 | - else |
|
| 43 | + } else |
|
| 46 | 44 | { |
| 47 | 45 | CLI::write('Failed to activate the user with identity: ' . $identity , 'red'); |
| 48 | 46 | } |
@@ -167,9 +167,11 @@ |
||
| 167 | 167 | public function down() |
| 168 | 168 | { |
| 169 | 169 | // drop constraints first to prevent errors |
| 170 | - if ($this->db->DBDriver != 'SQLite3') // @phpstan-ignore-line |
|
| 170 | + if ($this->db->DBDriver != 'SQLite3') { |
|
| 171 | + // @phpstan-ignore-line |
|
| 171 | 172 | { |
| 172 | 173 | $this->forge->dropForeignKey('auth_tokens', 'auth_tokens_user_id_foreign'); |
| 174 | + } |
|
| 173 | 175 | $this->forge->dropForeignKey('auth_groups_permissions', 'auth_groups_permissions_group_id_foreign'); |
| 174 | 176 | $this->forge->dropForeignKey('auth_groups_permissions', 'auth_groups_permissions_permission_id_foreign'); |
| 175 | 177 | $this->forge->dropForeignKey('auth_groups_users', 'auth_groups_users_group_id_foreign'); |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | 'time_cost' => $config->hashTimeCost, |
| 28 | 28 | 'threads' => $config->hashThreads, |
| 29 | 29 | ]; |
| 30 | - } |
|
| 31 | - else |
|
| 30 | + } else |
|
| 32 | 31 | { |
| 33 | 32 | $hashOptions = [ |
| 34 | 33 | 'cost' => $config->hashCost, |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | if (PHP_VERSION_ID >= 80000) |
| 25 | 25 | { |
| 26 | 26 | $this->bc_expectException('\ValueError'); |
| 27 | - } |
|
| 28 | - else |
|
| 27 | + } else |
|
| 29 | 28 | { |
| 30 | 29 | $this->bc_expectException('\PHPUnit_Framework_Error'); |
| 31 | 30 | } |
@@ -136,8 +136,7 @@ |
||
| 136 | 136 | { |
| 137 | 137 | if ($bool) { |
| 138 | 138 | $this->returnTypeNode = new ReturnTypeNode('null', ...$this->returnTypeNode->getTypes()); |
| 139 | - } |
|
| 140 | - else { |
|
| 139 | + } else { |
|
| 141 | 140 | $this->returnTypeNode = new ReturnTypeNode(...$this->returnTypeNode->getNonNullTypes()); |
| 142 | 141 | } |
| 143 | 142 | } |
@@ -151,8 +151,7 @@ discard block |
||
| 151 | 151 | if ($method->hasReturnType()) { |
| 152 | 152 | $returnTypes = $this->getTypeHints($method->getReturnType(), $method->getDeclaringClass(), $method->getReturnType()->allowsNull()); |
| 153 | 153 | $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes)); |
| 154 | - } |
|
| 155 | - elseif (method_exists($method, 'hasTentativeReturnType') && $method->hasTentativeReturnType()) { |
|
| 154 | + } elseif (method_exists($method, 'hasTentativeReturnType') && $method->hasTentativeReturnType()) { |
|
| 156 | 155 | $returnTypes = $this->getTypeHints($method->getTentativeReturnType(), $method->getDeclaringClass(), $method->getTentativeReturnType()->allowsNull()); |
| 157 | 156 | $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes)); |
| 158 | 157 | } |
@@ -220,14 +219,11 @@ discard block |
||
| 220 | 219 | if ($type instanceof ReflectionNamedType) { |
| 221 | 220 | $types = [$type->getName()]; |
| 222 | 221 | |
| 223 | - } |
|
| 224 | - elseif ($type instanceof ReflectionUnionType) { |
|
| 222 | + } elseif ($type instanceof ReflectionUnionType) { |
|
| 225 | 223 | $types = $type->getTypes(); |
| 226 | - } |
|
| 227 | - elseif ($type instanceof ReflectionIntersectionType) { |
|
| 224 | + } elseif ($type instanceof ReflectionIntersectionType) { |
|
| 228 | 225 | throw new ClassMirrorException('Doubling intersection types is not supported', $class); |
| 229 | - } |
|
| 230 | - elseif(is_object($type)) { |
|
| 226 | + } elseif(is_object($type)) { |
|
| 231 | 227 | throw new ClassMirrorException('Unknown reflection type ' . get_class($type), $class); |
| 232 | 228 | } |
| 233 | 229 | |