Completed
Push — 3.0 ( 1cd324...cc19ac )
by Olivier
02:59
created
lib/Block/EditBlock.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -12,14 +12,11 @@
 block discarded – undo
12 12
 namespace Icybee\Modules\Users\Block;
13 13
 
14 14
 use Brickrouge\Group;
15
-
16
-
17 15
 use Brickrouge\Document;
18 16
 use Brickrouge\Element;
19 17
 use Brickrouge\Form;
20 18
 use Brickrouge\Text;
21 19
 use Brickrouge\Widget;
22
-
23 20
 use Icybee\Modules\Users\Module;
24 21
 use Icybee\Modules\Users\User;
25 22
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 
66 66
 			Element::GROUPS => [
67 67
 
68
-				'connection' => [ 'title' => 'Connection' ],
69
-				'advanced' => [ 'title' => 'Advanced' ]
68
+				'connection' => ['title' => 'Connection'],
69
+				'advanced' => ['title' => 'Advanced']
70 70
 
71 71
 			]
72 72
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 				Group::LABEL => 'language',
173 173
 				Element::GROUP => 'advanced',
174 174
 				Element::DESCRIPTION => 'language',
175
-				Element::OPTIONS => [ null => '' ] + $languages
175
+				Element::OPTIONS => [null => ''] + $languages
176 176
 
177 177
 			]),
178 178
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 			return null;
215 215
 		}
216 216
 
217
-		$rid = [ 2 => true ];
217
+		$rid = [2 => true];
218 218
 
219 219
 		if ($uid)
220 220
 		{
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			Form::LABEL => 'roles',
237 237
 			Element::GROUP => 'advanced',
238 238
 			Element::OPTIONS => $options,
239
-			Element::OPTIONS_DISABLED => [ 2 => true ],
239
+			Element::OPTIONS_DISABLED => [2 => true],
240 240
 			Element::REQUIRED => true,
241 241
 			Element::DESCRIPTION => 'roles',
242 242
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	{
256 256
 		$values = $this->values;
257 257
 
258
-		$options = [ '<username>' ];
258
+		$options = ['<username>'];
259 259
 
260 260
 		if ($values[User::USERNAME])
261 261
 		{
Please login to merge, or discard this patch.
lib/Hooks.php 4 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 *
217 217
 	 * This is the getter for the `$app->user` property.
218 218
 	 *
219
-	 * @param Core|CoreBindings|\ICanBoogie\Binding\ActiveRecord\CoreBindings $app
219
+	 * @param Core $app
220 220
 	 *
221 221
 	 * @return User The user object, or guest user object.
222 222
 	 */
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	/**
276 276
 	 * Checks if a user has a given permission.
277 277
 	 *
278
-	 * @param Core|CoreBindings $app
278
+	 * @param Core $app
279 279
 	 * @param User $user
280 280
 	 * @param string $permission
281 281
 	 * @param string $target
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 	/**
293 293
 	 * Checks if a user has the ownership of a record.
294 294
 	 *
295
-	 * @param Core|CoreBindings $app
295
+	 * @param Core $app
296 296
 	 * @param User $user
297 297
 	 * @param ActiveRecord $record
298 298
 	 *
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 
360 360
 	/**
361
-	 * @return Core|\Icybee\Binding\CoreBindings
361
+	 * @return Core
362 362
 	 */
363 363
 	static private function app()
364 364
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 			return;
51 51
 		}
52 52
 
53
-		$event->errors['rid'] = $event->errors->format('The role %name is used by :count users.', [ 'name' => $operation->record->name, ':count' => $count ]);
53
+		$event->errors['rid'] = $event->errors->format('The role %name is used by :count users.', ['name' => $operation->record->name, ':count' => $count]);
54 54
 	}
55 55
 
56 56
 	/**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,7 +233,9 @@
 block discarded – undo
233 233
 				$user = $model[$uid];
234 234
 			}
235 235
 		}
236
-		catch (\Exception $e) {}
236
+		catch (\Exception $e)
237
+		{
238
+}
237 239
 
238 240
 		if (!$user)
239 241
 		{
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -16,13 +16,10 @@
 block discarded – undo
16 16
 use ICanBoogie\HTTP\AuthenticationRequired;
17 17
 use ICanBoogie\HTTP\PermissionRequired;
18 18
 use ICanBoogie\HTTP\Response;
19
-use ICanBoogie\HTTP\RequestDispatcher;
20 19
 use ICanBoogie\HTTP\SecurityError;
21 20
 use ICanBoogie\Operation;
22 21
 use ICanBoogie\PropertyNotDefined;
23 22
 use ICanBoogie\Routing\RouteDispatcher;
24
-use ICanBoogie\Session;
25
-
26 23
 use Icybee\Element\AdminDecorator;
27 24
 use Icybee\Element\DocumentDecorator;
28 25
 use Icybee\Modules\Members\Member;
Please login to merge, or discard this patch.
lib/LoginForm.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -11,15 +11,12 @@
 block discarded – undo
11 11
 
12 12
 namespace Icybee\Modules\Users;
13 13
 
14
-use ICanBoogie\Operation;
15
-
16 14
 use Brickrouge\A;
17 15
 use Brickrouge\Button;
18 16
 use Brickrouge\Document;
19 17
 use Brickrouge\Element;
20 18
 use Brickrouge\Form;
21 19
 use Brickrouge\Text;
22
-
23 20
 use Icybee\Binding\Core\PrototypedBindings;
24 21
 
25 22
 class LoginForm extends Form
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	{
51 51
 		$app = $this->app;
52 52
 
53
-		$this->lost_password = new A($this->t('lost_password', [], [ 'scope' => 'users.label', 'default' => 'I forgot my password' ]), "#lost-password", [
53
+		$this->lost_password = new A($this->t('lost_password', [], ['scope' => 'users.label', 'default' => 'I forgot my password']), "#lost-password", [
54 54
 
55 55
 			'rel' => 'nonce-request'
56 56
 
Please login to merge, or discard this patch.
lib/Module.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,7 @@
 block discarded – undo
11 11
 
12 12
 namespace Icybee\Modules\Users;
13 13
 
14
-use ICanBoogie\I18n;
15 14
 use ICanBoogie\Operation;
16
-
17 15
 use Brickrouge\Button;
18 16
 use Brickrouge\Element;
19 17
 use Brickrouge\Form;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 
82 82
 			Element::CHILDREN => [
83 83
 
84
-				new Button('logout', [ 'type' => 'submit' ])
84
+				new Button('logout', ['type' => 'submit'])
85 85
 
86 86
 			]
87 87
 
Please login to merge, or discard this patch.
lib/Operation/LoginOperation.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -12,11 +12,9 @@
 block discarded – undo
12 12
 namespace Icybee\Modules\Users\Operation;
13 13
 
14 14
 use ICanBoogie\Errors;
15
-use ICanBoogie\HTTP\Request;
16 15
 use ICanBoogie\I18n;
17 16
 use ICanBoogie\Operation;
18 17
 use ICanBoogie\Module\ControllerBindings as ModuleBindings;
19
-
20 18
 use Icybee\Binding\Core\PrototypedBindings;
21 19
 use Icybee\Modules\Registry\MetaCollection;
22 20
 use Icybee\Modules\Users\LoginForm;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 attack attempt on the website. If you think this is the case, please contact its admin.
147 147
 
148 148
 The remote address of the request was: $request->ip.
149
-EOT
149
+eot
150 150
 				]);
151 151
 
152 152
 				unset($errors[User::PASSWORD]);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
 		{
92 92
 			if ($login_unlock_time > $now)
93 93
 			{
94
-				throw new \Exception
95
-				(
94
+				throw new \Exception(
96 95
 					\ICanBoogie\format("The user account has been locked after multiple failed login attempts.
97 96
 					An e-mail has been sent to unlock the account. Login attempts are locked until %time,
98 97
 					unless you unlock the account using the email sent.", [
@@ -168,7 +167,7 @@  discard block
 block discarded – undo
168 167
 
169 168
 		if (!$user->is_admin && !$user->is_activated)
170 169
 		{
171
-			$errors->add_generic("User %username is not activated", [ '%username' => $username ]);
170
+			$errors->add_generic("User %username is not activated", ['%username' => $username]);
172 171
 
173 172
 			return false;
174 173
 		}
Please login to merge, or discard this patch.
lib/Operation/UnlockLoginOperation.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 
14 14
 use ICanBoogie\Errors;
15 15
 use ICanBoogie\Operation;
16
-
17 16
 use Icybee\Modules\Users\User;
18 17
 
19 18
 /**
Please login to merge, or discard this patch.
lib/User.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,9 @@
 block discarded – undo
14 14
 use ICanBoogie\ActiveRecord;
15 15
 use ICanBoogie\ActiveRecord\CreatedAtProperty;
16 16
 use ICanBoogie\ActiveRecord\RecordNotFound;
17
-
18 17
 use Brickrouge\AlterCSSClassNamesEvent;
19 18
 use Brickrouge\CSSClassNames;
20 19
 use Brickrouge\CSSClassNamesProperty;
21
-
22 20
 use Icybee\Modules\Users\Roles\Role;
23 21
 use Icybee\Binding\Core\PrototypedBindings as IcybeeBindings;
24 22
 use Icybee\Modules\Registry\Binding\UserBindings as RegistryBindings;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@
 block discarded – undo
355 355
 		{
356 356
 			if (!$this->uid)
357 357
 			{
358
-				return [ $models['users.roles'][1] ];
358
+				return [$models['users.roles'][1]];
359 359
 			}
360 360
 		}
361 361
 		catch (\Exception $e)
Please login to merge, or discard this patch.
lib/UserModel.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,6 @@
 block discarded – undo
12 12
 namespace Icybee\Modules\Users;
13 13
 
14 14
 use ICanBoogie\DateTime;
15
-use ICanBoogie\ActiveRecord;
16
-
17 15
 use Icybee\ConstructorModel;
18 16
 
19 17
 class UserModel extends ConstructorModel
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 				continue;
74 74
 			}
75 75
 
76
-			$has_many_roles->execute('INSERT {self} SET uid = ?, rid = ?', [ $rc, $rid ]);
76
+			$has_many_roles->execute('INSERT {self} SET uid = ?, rid = ?', [$rc, $rid]);
77 77
 		}
78 78
 	}
79 79
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 		foreach ($restricted_sites as $site_id)
90 90
 		{
91
-			$has_many_sites->execute('INSERT {self} SET uid = ?, site_id = ?', [ $rc, $site_id ]);
91
+			$has_many_sites->execute('INSERT {self} SET uid = ?, site_id = ?', [$rc, $site_id]);
92 92
 		}
93 93
 	}
94 94
 }
Please login to merge, or discard this patch.
config/event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 return [
11 11
 
12
-	ICanBoogie\HTTP\AuthenticationRequired::class .'::rescue' => $hooks . 'on_security_exception_rescue',
12
+	ICanBoogie\HTTP\AuthenticationRequired::class . '::rescue' => $hooks . 'on_security_exception_rescue',
13 13
 	ICanBoogie\HTTP\PermissionRequired::class . '::rescue' => $hooks . 'on_security_exception_rescue',
14 14
 	ICanBoogie\Routing\RouteDispatcher::class . '::dispatch:before' => $hooks . 'before_routing_dispatcher_dispatch',
15 15
 	Icybee\Modules\Users\Roles\Operation\DeleteOperation::class . '::process:before' => $hooks . 'before_roles_delete',
Please login to merge, or discard this patch.