Completed
Push — master ( 7e51b9...91e5b0 )
by Sherif
04:01 queued 01:33
created
Modules/Reporting/Database/Migrations/2016_01_19_112603_sampel_report.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	 */
13 13
 	public function up()
14 14
 	{
15
-		DB::statement( "CREATE VIEW admin_count AS  
15
+		DB::statement("CREATE VIEW admin_count AS  
16 16
 			select count(u.id)
17 17
 			from users u, groups g ,users_groups ug
18 18
 			where
@@ -39,6 +39,6 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function down()
41 41
 	{
42
-		DB::statement( "DROP VIEW IF EXISTS admin_count");
42
+		DB::statement("DROP VIEW IF EXISTS admin_count");
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
Database/Migrations/2016_01_24_111942_push_notifications_devices.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function up()
14 14
 	{
15
-		Schema::create('push_notifications_devices', function (Blueprint $table) {
15
+		Schema::create('push_notifications_devices', function(Blueprint $table) {
16 16
 			$table->increments('id');
17 17
 			$table->string('device_token');
18 18
 			$table->integer('user_id');
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Migrations/2015_12_20_124153_users.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function up()
14 14
 	{
15
-		Schema::create('users', function (Blueprint $table) {
15
+		Schema::create('users', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('profile_picture', 150)->nullable();
18 18
             $table->string('name', 100)->nullable();
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/GroupRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	 */
24 24
 	public function assignPermissions($groupId, $permissionIds)
25 25
 	{
26
-		\DB::transaction(function () use ($groupId, $permissionIds) {
26
+		\DB::transaction(function() use ($groupId, $permissionIds) {
27 27
 			$group = $this->find($groupId);
28 28
 			$group->permissions()->detach();
29 29
 			$group->permissions()->attach($permissionIds);
Please login to merge, or discard this patch.
src/Modules/Core/Core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use App\Modules\Core\AbstractRepositories\AbstractRepositoryContainer;
4 4
 
5
-class Core extends AbstractRepositoryContainer{
5
+class Core extends AbstractRepositoryContainer {
6 6
 	/**
7 7
 	 * Specify module repositories name space.
8 8
 	 * 
Please login to merge, or discard this patch.
src/Modules/Core/Http/Controllers/ApiDocumentController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
 			],
21 21
 			[
22 22
 				'title'   => 'email equal [email protected] and user is blocked:',
23
-				'content' => ['and' => ['email' => '[email protected]','blocked' => 1]]
23
+				'content' => ['and' => ['email' => '[email protected]', 'blocked' => 1]]
24 24
 			],
25 25
 			[
26 26
 				'title'   => 'email equal [email protected] or user is blocked:',
27
-				'content' => ['or' => ['email' => '[email protected]','blocked' => 1]]
27
+				'content' => ['or' => ['email' => '[email protected]', 'blocked' => 1]]
28 28
 			],
29 29
 			[
30 30
 				'title'   => 'email contain John:',
31
-				'content' => ['email' => ['op' => 'like','val' => '%John%']]
31
+				'content' => ['email' => ['op' => 'like', 'val' => '%John%']]
32 32
 			],
33 33
 			[
34 34
 				'title'   => 'user created after 2016-10-25:',
35
-				'content' => ['created_at' => ['op' => '>','val' => '2016-10-25']]
35
+				'content' => ['created_at' => ['op' => '>', 'val' => '2016-10-25']]
36 36
 			],
37 37
 			[
38 38
 				'title'   => 'user created between 2016-10-20 and 2016-10-25:',
39
-				'content' => ['created_at' => ['op' => 'between','val1' => '2016-10-20','val2' => '2016-10-25']]
39
+				'content' => ['created_at' => ['op' => 'between', 'val1' => '2016-10-20', 'val2' => '2016-10-25']]
40 40
 			],
41 41
 			[
42 42
 				'title'   => 'user id in 1,2,3:',
43
-				'content' => ['id' => ['op' => 'in','val' => [1, 2, 3]]]
43
+				'content' => ['id' => ['op' => 'in', 'val' => [1, 2, 3]]]
44 44
 			],
45 45
 			[
46 46
 				'title'   => 'user name is null:',
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			],
53 53
 			[
54 54
 				'title'   => 'user has group admin:',
55
-				'content' => ['groups' => ['op' => 'has','val' => ['name' => 'Admin']]]
55
+				'content' => ['groups' => ['op' => 'has', 'val' => ['name' => 'Admin']]]
56 56
 			]
57 57
 		];
58 58
 
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/UserRepository.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * Check if the logged in user has the given group.
63 63
 	 * 
64
-	 * @param  array $groups
64
+	 * @param  string[] $groups
65 65
 	 * @param  mixed $user
66 66
 	 * @return boolean
67 67
 	 */
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * 
156 156
 	 * @param  array   $credentials
157 157
 	 * @param  boolean $skipConfirmEmail
158
-	 * @return array
158
+	 * @return boolean
159 159
 	 */
160 160
 	public function register($credentials, $skipConfirmEmail = false)
161 161
 	{
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 * Reset the given user's password.
247 247
 	 *
248 248
 	 * @param  array  $credentials
249
-	 * @return array
249
+	 * @return string|null
250 250
 	 */
251 251
 	public function resetPassword($credentials)
252 252
 	{
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		$user        = \Core::users()->find(\Auth::id(), $relations);
29 29
 		foreach ($user->groups()->get() as $group)
30 30
 		{
31
-			$group->permissions->each(function ($permission) use (&$permissions){
31
+			$group->permissions->each(function($permission) use (&$permissions){
32 32
 				$permissions[$permission->model][$permission->id] = $permission->name;
33 33
 			});
34 34
 		}
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$user        = $user ?: $this->find(\Auth::id(), ['groups.permissions']);
52 52
 		$permissions = [];
53 53
 
54
-		$user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){
54
+		$user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){
55 55
 			$permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); 
56 56
 		});
57 57
         
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function assignGroups($userId, $groupIds)
82 82
 	{
83
-		\DB::transaction(function () use ($userId, $groupIds) {
83
+		\DB::transaction(function() use ($userId, $groupIds) {
84 84
 			$user = $this->find($userId);
85 85
 			$user->groups()->detach();
86 86
 			$user->groups()->attach($groupIds);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function resetPassword($credentials)
252 252
 	{
253
-		$response = \Password::reset($credentials, function ($user, $password) {
253
+		$response = \Password::reset($credentials, function($user, $password) {
254 254
 			$user->password = $password;
255 255
 			$user->save();
256 256
 		});
Please login to merge, or discard this patch.
src/Modules/Core/AbstractRepositories/AbstractRepository.php 2 patches
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @param  array   $relations
34 34
 	 * @param  string  $sortBy
35
-	 * @param  boolean $desc
35
+	 * @param  integer $desc
36 36
 	 * @param  array   $columns
37 37
 	 * @return collection
38 38
 	 */
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @param  integer $perPage
51 51
 	 * @param  array   $relations
52 52
 	 * @param  string  $sortBy
53
-	 * @param  boolean $desc
53
+	 * @param  integer $desc
54 54
 	 * @param  array   $columns
55 55
 	 * @return collection
56 56
 	 */
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @param  integer $perPage
165 165
 	 * @param  array   $relations
166 166
 	 * @param  string  $sortBy
167
-	 * @param  boolean $desc
167
+	 * @param  integer $desc
168 168
 	 * @param  array   $columns
169 169
 	 * @return collection
170 170
 	 */
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 * @param  integer $perPage
183 183
 	 * @param  array   $relations
184 184
 	 * @param  string  $sortBy
185
-	 * @param  boolean $desc
185
+	 * @param  integer $desc
186 186
 	 * @param  array   $columns
187 187
 	 * @return collection
188 188
 	 */
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * Save the given model to the storage.
199 199
 	 * 
200 200
 	 * @param  array $data
201
-	 * @return mixed
201
+	 * @return boolean
202 202
 	 */
203 203
 	public function save(array $data)
204 204
 	{
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	 * id.
518 518
 	 * 
519 519
 	 * @param  integer $id
520
-	 * @param  array   $relations
520
+	 * @param  string[]   $relations
521 521
 	 * @param  array   $columns
522 522
 	 * @return object
523 523
 	 */
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 * @param  array   $conditions array of conditions
534 534
 	 * @param  array   $relations
535 535
 	 * @param  string  $sortBy
536
-	 * @param  boolean $desc
536
+	 * @param  integer $desc
537 537
 	 * @param  array   $columns
538 538
 	 * @return collection
539 539
 	 */
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 	 * @param  array   $conditions array of conditions
566 566
 	 * @param  integer $perPage
567 567
 	 * @param  string  $sortBy
568
-	 * @param  boolean $desc
568
+	 * @param  integer $desc
569 569
 	 * @param  array   $columns
570 570
 	 * @return collection
571 571
 	 */
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 		/**
64 64
 		 * Construct the select conditions for the model.
65 65
 		 */
66
-		$model->where(function ($q) use ($query, $conditionColumns, $relations){
66
+		$model->where(function($q) use ($query, $conditionColumns, $relations){
67 67
 
68 68
 			if (count($conditionColumns)) 
69 69
 			{
70
-				$column = 'LOWER(' . array_shift($conditionColumns) . ')';
70
+				$column = 'LOWER('.array_shift($conditionColumns).')';
71 71
 				if (str_contains($column, '->')) 
72 72
 				{
73 73
 					$column = $this->wrapJsonSelector($column);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 				/**
77 77
 				 * Use the first element in the model columns to construct the first condition.
78 78
 				 */
79
-				$q->where(\DB::raw($column), 'LIKE', '%' . strtolower($query) . '%');
79
+				$q->where(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
80 80
 			}
81 81
 
82 82
 			/**
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 			 */
85 85
 			foreach ($conditionColumns as $column) 
86 86
 			{
87
-				$column = 'LOWER(' . $column . ')';
87
+				$column = 'LOWER('.$column.')';
88 88
 				if (str_contains($column, '->')) 
89 89
 				{
90 90
 					$column = $this->wrapJsonSelector($column);
91 91
 				}
92 92
 
93
-				$q->orWhere(\DB::raw($column), 'LIKE', '%' . strtolower($query) . '%');
93
+				$q->orWhere(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
94 94
 			}
95 95
 
96 96
 			/**
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 					/**
112 112
 					 * Construct the relation condition.
113 113
 					 */
114
-					$q->orWhereHas($relation, function ($subModel) use ($query, $relation){
114
+					$q->orWhereHas($relation, function($subModel) use ($query, $relation){
115 115
 
116
-						$subModel->where(function ($q) use ($query, $relation){
116
+						$subModel->where(function($q) use ($query, $relation){
117 117
 
118 118
 							/**
119 119
 							 * Get columns of the relation.
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 							if (count($subConditionColumns)) 
124 124
 							{
125 125
 
126
-								$column = 'LOWER(' . array_shift($subConditionColumns) . ')';
126
+								$column = 'LOWER('.array_shift($subConditionColumns).')';
127 127
 								if (str_contains($column, '->')) 
128 128
 								{
129 129
 									$column = $this->wrapJsonSelector($column);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 								/**
133 133
 								 * Use the first element in the relation model columns to construct the first condition.
134 134
 								 */
135
-								$q->where(\DB::raw($column), 'LIKE', '%' . strtolower($query) . '%');
135
+								$q->where(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
136 136
 							}
137 137
 
138 138
 							/**
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 							 */
141 141
 							foreach ($subConditionColumns as $subConditionColumn)
142 142
 							{
143
-								$column = 'LOWER(' . $subConditionColumn . ')';
143
+								$column = 'LOWER('.$subConditionColumn.')';
144 144
 								if (str_contains($column, '->')) 
145 145
 								{
146 146
 									$column = $this->wrapJsonSelector($column);
147 147
 								}
148 148
                                 
149
-								$q->orWhere(\DB::raw($column), 'LIKE', '%' . strtolower($query) . '%');
149
+								$q->orWhere(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
150 150
 							} 
151 151
 						});
152 152
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		$modelClass = $this->model;
208 208
 		$relations  = [];
209 209
 
210
-		\DB::transaction(function () use (&$model, &$relations, $data, $modelClass) {
210
+		\DB::transaction(function() use (&$model, &$relations, $data, $modelClass) {
211 211
 			/**
212 212
 			 * If the id is present in the data then select the model for updating,
213 213
 			 * else create new model.
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			$model = array_key_exists('id', $data) ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
217 217
 			if ( ! $model) 
218 218
 			{
219
-				\ErrorHandler::notFound(class_basename($modelClass) . ' with id : ' . $data['id']);
219
+				\ErrorHandler::notFound(class_basename($modelClass).' with id : '.$data['id']);
220 220
 			}
221 221
 
222 222
 			/**
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 								 */
275 275
 								if ( ! $relationModel) 
276 276
 								{
277
-									\ErrorHandler::notFound(class_basename($relationBaseModel) . ' with id : ' . $val['id']);
277
+									\ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
278 278
 								}
279 279
 
280 280
 								/**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 									/**
286 286
 									 * Prevent the sub relations or attributes not in the fillable.
287 287
 									 */
288
-									if (gettype($val) !== 'object' && gettype($val) !== 'array' &&  array_search($attr, $relationModel->getFillable(), true) !== false)
288
+									if (gettype($val) !== 'object' && gettype($val) !== 'array' && array_search($attr, $relationModel->getFillable(), true) !== false)
289 289
 									{
290 290
 										$relationModel->$attr = $val;
291 291
 									}
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 									 */
316 316
 									if ( ! $relationModel) 
317 317
 									{
318
-										\ErrorHandler::notFound(class_basename($relationBaseModel) . ' with id : ' . $value['id']);
318
+										\ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
319 319
 									}
320 320
 
321 321
 									foreach ($value as $relationAttribute => $relationValue) 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 		}
475 475
 		else
476 476
 		{
477
-			call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function ($model) use ($data){
477
+			call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function($model) use ($data){
478 478
 				$model->update($data);
479 479
 			});
480 480
 		}
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
 	{
493 493
 		if ($attribute == 'id') 
494 494
 		{
495
-			\DB::transaction(function () use ($value, $attribute, &$result) {
495
+			\DB::transaction(function() use ($value, $attribute, &$result) {
496 496
 				$model = $this->model->lockForUpdate()->find($value);
497 497
 				if ( ! $model) 
498 498
 				{
499
-					\ErrorHandler::notFound(class_basename($this->model) . ' with id : ' . $value);
499
+					\ErrorHandler::notFound(class_basename($this->model).' with id : '.$value);
500 500
 				}
501 501
                 
502 502
 				$model->delete();
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 		}
505 505
 		else
506 506
 		{
507
-			\DB::transaction(function () use ($value, $attribute, &$result) {
508
-				call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function ($model){
507
+			\DB::transaction(function() use ($value, $attribute, &$result) {
508
+				call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function($model) {
509 509
 					$model->delete();
510 510
 				});
511 511
 			});   
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	{
542 542
 		$conditions = $this->constructConditions($conditions, $this->model);
543 543
 		$sort       = $desc ? 'desc' : 'asc';
544
-		return call_user_func_array("{$this->getModel()}::with",  array($relations))->whereRaw($conditions['conditionString'], $conditions['conditionValues'])->orderBy($sortBy, $sort)->get($columns);
544
+		return call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($conditions['conditionString'], $conditions['conditionValues'])->orderBy($sortBy, $sort)->get($columns);
545 545
 	}
546 546
 
547 547
 	/**
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 			$model->whereRaw($conditions['conditionString'], $conditions['conditionValues']);
582 582
 		}
583 583
 
584
-		return $model->orderBy($sortBy, $sort)->paginate($perPage, $columns);;
584
+		return $model->orderBy($sortBy, $sort)->paginate($perPage, $columns); ;
585 585
 	}
586 586
 
587 587
 	/**
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 		if ( ! $model) 
598 598
 		{
599
-			\ErrorHandler::notFound(class_basename($this->model) . ' with id : ' . $id);
599
+			\ErrorHandler::notFound(class_basename($this->model).' with id : '.$id);
600 600
 		}
601 601
 
602 602
 		$model->restore();
@@ -621,13 +621,13 @@  discard block
 block discarded – undo
621 621
 			if ($key == 'and') 
622 622
 			{
623 623
 				$conditions       = $this->constructConditions($value, $model);
624
-				$conditionString .= str_replace('{op}', 'and', $conditions['conditionString']) . ' {op} ';
624
+				$conditionString .= str_replace('{op}', 'and', $conditions['conditionString']).' {op} ';
625 625
 				$conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
626 626
 			}
627 627
 			else if ($key == 'or')
628 628
 			{
629 629
 				$conditions       = $this->constructConditions($value, $model);
630
-				$conditionString .= str_replace('{op}', 'or', $conditions['conditionString']) . ' {op} ';
630
+				$conditionString .= str_replace('{op}', 'or', $conditions['conditionString']).' {op} ';
631 631
 				$conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
632 632
 			}
633 633
 			else
@@ -652,41 +652,41 @@  discard block
 block discarded – undo
652 652
                 
653 653
 				if (strtolower($operator) == 'between') 
654 654
 				{
655
-					$conditionString  .= $key . ' >= ? and ';
655
+					$conditionString  .= $key.' >= ? and ';
656 656
 					$conditionValues[] = $value1;
657 657
 
658
-					$conditionString  .= $key . ' <= ? {op} ';
658
+					$conditionString  .= $key.' <= ? {op} ';
659 659
 					$conditionValues[] = $value2;
660 660
 				}
661 661
 				elseif (strtolower($operator) == 'in') 
662 662
 				{
663 663
 					$conditionValues  = array_merge($conditionValues, $value);
664 664
 					$inBindingsString = rtrim(str_repeat('?,', count($value)), ',');
665
-					$conditionString .= $key . ' in (' . rtrim($inBindingsString, ',') . ') {op} ';
665
+					$conditionString .= $key.' in ('.rtrim($inBindingsString, ',').') {op} ';
666 666
 				}
667 667
 				elseif (strtolower($operator) == 'null') 
668 668
 				{
669
-					$conditionString .= $key . ' is null {op} ';
669
+					$conditionString .= $key.' is null {op} ';
670 670
 				}
671 671
 				elseif (strtolower($operator) == 'not null') 
672 672
 				{
673
-					$conditionString .= $key . ' is not null {op} ';
673
+					$conditionString .= $key.' is not null {op} ';
674 674
 				}
675 675
 				elseif (strtolower($operator) == 'has') 
676 676
 				{
677 677
 					$sql              = $model->withTrashed()->has($key)->toSql();
678 678
 					$conditions       = $this->constructConditions($value, $model->$key()->getRelated());
679
-					$conditionString .= rtrim(substr($sql, strpos($sql, 'exists')), ')') . ' and ' . $conditions['conditionString'] . ') {op} ';
679
+					$conditionString .= rtrim(substr($sql, strpos($sql, 'exists')), ')').' and '.$conditions['conditionString'].') {op} ';
680 680
 					$conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
681 681
 				}
682 682
 				else
683 683
 				{
684
-					$conditionString  .= $key . ' ' . $operator . ' ? {op} ';
684
+					$conditionString  .= $key.' '.$operator.' ? {op} ';
685 685
 					$conditionValues[] = $value;
686 686
 				}
687 687
 			}
688 688
 		}
689
-		$conditionString = '(' . rtrim($conditionString, '{op} ') . ')';
689
+		$conditionString = '('.rtrim($conditionString, '{op} ').')';
690 690
 		return ['conditionString' => $conditionString, 'conditionValues' => $conditionValues];
691 691
 	}
692 692
 
@@ -702,11 +702,11 @@  discard block
 block discarded – undo
702 702
 		$value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
703 703
 		$path       = explode('->', $value);
704 704
 		$field      = array_shift($path);
705
-		$result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
705
+		$result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
706 706
 			return '"'.$part.'"';
707 707
 		})->implode('.'));
708 708
         
709
-		return $removeLast === false ? $result : $result . ')';
709
+		return $removeLast === false ? $result : $result.')';
710 710
 	}
711 711
 
712 712
 	/**
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/GenerateDoc.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * based on the docblock.
125 125
 	 * 
126 126
 	 * @param  array  &$route
127
-	 * @param  object $reflectionMethod
127
+	 * @param  \ReflectionMethod $reflectionMethod
128 128
 	 * @return void
129 129
 	 */
130 130
 	protected function processDocBlock(&$route, $reflectionMethod)
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * Generate post body for the given route.
149 149
 	 * 
150 150
 	 * @param  array  &$route
151
-	 * @param  object $reflectionMethod
151
+	 * @param  \ReflectionMethod $reflectionMethod
152 152
 	 * @param  array  $validationRules
153 153
 	 * @return void
154 154
 	 */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 			if ($route) 
44 44
 			{
45 45
 				$actoinArray = explode('@', $route['action']);
46
-				if(array_get($actoinArray, 1, false))
46
+				if (array_get($actoinArray, 1, false))
47 47
 				{
48 48
 					$controller       = $actoinArray[0];
49 49
 					$method           = $actoinArray[1];
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 					$route['response'] = $this->getResponseObject($classProperties['model'], $route['name'], $route['returnDocBlock']);
63 63
 
64 64
 					preg_match('/api\/([^#]+)\//iU', $route['uri'], $module);
65
-					$docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/' . $module[1] . '/') - 1)][] = $route;
65
+					$docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/'.$module[1].'/') - 1)][] = $route;
66 66
 
67 67
 					$this->getModels($classProperties['model'], $docData);   
68 68
 				}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	protected function getRoutes()
83 83
 	{
84
-		return collect(\Route::getRoutes())->map(function ($route) {
84
+		return collect(\Route::getRoutes())->map(function($route) {
85 85
 			if (strpos($route->uri(), 'api') !== false) 
86 86
 			{
87 87
 				return [
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		];
114 114
 
115 115
 
116
-		if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
116
+		if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
117 117
 		{
118 118
 			$route['headers']['Authorization'] = 'Bearer {token}';
119 119
 		}
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
 				}
168 168
 				else
169 169
 				{
170
-					$route['body'] = eval('return ' . str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]) . ';');
170
+					$route['body'] = eval('return '.str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]).';');
171 171
 				}
172 172
 
173 173
 				foreach ($route['body'] as &$rule) 
174 174
 				{
175
-					if(strpos($rule, 'unique'))
175
+					if (strpos($rule, 'unique'))
176 176
 					{
177 177
 						$rule = substr($rule, 0, strpos($rule, 'unique') + 6);
178 178
 					}
179
-					elseif(strpos($rule, 'exists'))
179
+					elseif (strpos($rule, 'exists'))
180 180
 					{
181 181
 						$rule = substr($rule, 0, strpos($rule, 'exists') - 1);
182 182
 					}
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 			$model      = factory($modelClass)->make();
250 250
 			$modelArr   = $model->toArray();
251 251
 
252
-			if ( $model->trans && ! $model->trans->count()) 
252
+			if ($model->trans && ! $model->trans->count()) 
253 253
 			{
254 254
 				$modelArr['trans'] = [
255
-					'en' => factory($modelClass . 'Translation')->make()->toArray()
255
+					'en' => factory($modelClass.'Translation')->make()->toArray()
256 256
 				];
257 257
 			}
258 258
 
Please login to merge, or discard this patch.