Completed
Push — master ( 2f5e5e...b7f417 )
by Sherif
08:33 queued 03:29
created
Database/Migrations/2017_11_22_162811_create_failed_jobs_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('failed_jobs', function (Blueprint $table) {
16
+        Schema::create('failed_jobs', function(Blueprint $table) {
17 17
             $table->bigIncrements('id');
18 18
             $table->text('connection');
19 19
             $table->text('queue');
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Repositories/UserRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $user        = \Core::users()->find(\Auth::id(), $relations);
50 50
         foreach ($user->groups()->get() as $group)
51 51
         {
52
-            $group->permissions->each(function ($permission) use (&$permissions){
52
+            $group->permissions->each(function($permission) use (&$permissions){
53 53
                 $permissions[$permission->model][$permission->id] = $permission->name;
54 54
             });
55 55
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $user        = $user ?: $this->find(\Auth::id(), ['groups.permissions']);
73 73
         $permissions = [];
74 74
 
75
-        $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){
75
+        $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){
76 76
             $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); 
77 77
         });
78 78
         
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function assignGroups($user_id, $group_ids)
104 104
     {
105
-        \DB::transaction(function () use ($user_id, $group_ids) {
105
+        \DB::transaction(function() use ($user_id, $group_ids) {
106 106
             $user = $this->find($user_id);
107 107
             $user->groups()->detach();
108 108
             $user->groups()->attach($group_ids);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $url   = $this->config['resetLink'];
252 252
         $token = \Password::getRepository()->create($user);
253 253
         
254
-        \Mail::send('acl::resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function ($m) use ($user) {
254
+        \Mail::send('acl::resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function($m) use ($user) {
255 255
             $m->to($user->email, $user->name)->subject('Your Password Reset Link');
256 256
         });
257 257
     }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      */
265 265
     public function resetPassword($credentials)
266 266
     {
267
-        $response = \Password::reset($credentials, function ($user, $password) {
267
+        $response = \Password::reset($credentials, function($user, $password) {
268 268
             $user->password = $password;
269 269
             $user->save();
270 270
         });
Please login to merge, or discard this patch.
src/Modules/V1/Acl/AclUser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     use SoftDeletes, HasApiTokens;
11 11
     protected $table    = 'users';
12 12
     protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
13
-    protected $hidden   = ['password', 'remember_token','deleted_at', 'two_factor_code'];
13
+    protected $hidden   = ['password', 'remember_token', 'deleted_at', 'two_factor_code'];
14 14
     protected $guarded  = ['id'];
15 15
     protected $fillable = ['name', 'email', 'password'];
16 16
     public $searchable  = ['name', 'email'];
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function groups()
45 45
     {
46
-        return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
46
+        return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
47 47
     }
48 48
 
49 49
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function receivesBroadcastNotificationsOn()
86 86
     {
87
-        return 'users.' . $this->id;
87
+        return 'users.'.$this->id;
88 88
     }
89 89
     
90 90
     public static function boot()
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
 		 * Assign the permissions to the admin group.
20 20
 		 */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['users', 'permissions', 'groups', 'oauthClients'])->each(function ($permission) use ($adminGroupId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['users', 'permissions', 'groups', 'oauthClients'])->each(function($permission) use ($adminGroupId) {
22 22
         	\DB::table('groups_permissions')->insert(
23 23
 				[
24 24
 				'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/V1/Core/Console/Commands/GenerateDoc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -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\/v1\/([^#]+)\//iU', $route['uri'], $module);
65
-                $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/' . $module[1] . '/') - 1)][] = $route;
65
+                $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/'.$module[1].'/') - 1)][] = $route;
66 66
 
67 67
                 $this->getModels($classProperties['model'], $docData);
68 68
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     protected function getRoutes()
81 81
     {
82
-        return collect(\Route::getRoutes())->map(function ($route) {
82
+        return collect(\Route::getRoutes())->map(function($route) {
83 83
             if (strpos($route->uri(), 'api/v') !== false) 
84 84
             {
85 85
                 return [
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         ];
112 112
 
113 113
 
114
-        if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
114
+        if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
115 115
         {
116 116
             $route['headers']['Authrization'] = 'Bearer {token}';
117 117
         }
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
                 }
166 166
                 else
167 167
                 {
168
-                    $route['body'] = eval('return ' . str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]) . ';');
168
+                    $route['body'] = eval('return '.str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]).';');
169 169
                 }
170 170
 
171 171
                 foreach ($route['body'] as &$rule) 
172 172
                 {
173
-                    if(strpos($rule, 'unique'))
173
+                    if (strpos($rule, 'unique'))
174 174
                     {
175 175
                         $rule = substr($rule, 0, strpos($rule, 'unique') + 6);
176 176
                     }
177
-                    elseif(strpos($rule, 'exists'))
177
+                    elseif (strpos($rule, 'exists'))
178 178
                     {
179 179
                         $rule = substr($rule, 0, strpos($rule, 'exists') - 1);
180 180
                     }
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
             $model      = factory($modelClass)->make();
248 248
             $modelArr   = $model->toArray();
249 249
 
250
-            if ( $model->trans && ! $model->trans->count()) 
250
+            if ($model->trans && ! $model->trans->count()) 
251 251
             {
252 252
                 $modelArr['trans'] = [
253
-                    'en' => factory($modelClass . 'Translation')->make()->toArray()
253
+                    'en' => factory($modelClass.'Translation')->make()->toArray()
254 254
                 ];
255 255
             }
256 256
 
Please login to merge, or discard this patch.
src/Modules/V1/Core/Http/Controllers/BaseApiController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : [];
36 36
         $this->skipLoginCheck      = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : [];
37 37
         $this->repo                = call_user_func_array("\Core::{$this->model}", []);
38
-        $route                     = explode('@',\Route::currentRouteAction())[1];
38
+        $route                     = explode('@', \Route::currentRouteAction())[1];
39 39
 
40 40
         $this->checkPermission($route);
41 41
         $this->setRelations($route);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
             if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model)))
255 255
             {}
256
-            elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
256
+            elseif ( ! $isPasswordClient && $user->tokenCan($this->model.'-'.$permission)) 
257 257
             {}
258 258
             else
259 259
             {
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Http/Controllers/UsersController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * to preform actions like (add, edit ... etc).
14 14
      * @var string
15 15
      */
16
-    protected $model               = 'users';
16
+    protected $model = 'users';
17 17
 
18 18
     /**
19 19
      * List of all route actions that the base api controller
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
      * will skip login check for them.
28 28
      * @var array
29 29
      */
30
-    protected $skipLoginCheck      = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken'];
30
+    protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken'];
31 31
 
32 32
     /**
33 33
      * The validations rules used by the base api controller
34 34
      * to check before add.
35 35
      * @var array
36 36
      */
37
-    protected $validationRules     = [
37
+    protected $validationRules = [
38 38
         'name'     => 'nullable|string', 
39 39
         'email'    => 'required|email|unique:users,email,{id}', 
40 40
         'password' => 'nullable|min:6'
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     {
250 250
         $this->validate($request, [
251 251
             'name'  => 'nullable|string', 
252
-            'email' => 'required|email|unique:users,email,' . \Auth::id()
252
+            'email' => 'required|email|unique:users,email,'.\Auth::id()
253 253
         ]);
254 254
 
255 255
         return \Response::json($this->repo->saveProfile($request->only('name', 'email')), 200);
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Http/Controllers/OauthClientsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
      * to preform actions like (add, edit ... etc).
14 14
      * @var string
15 15
      */
16
-    protected $model               = 'oauthClients';
16
+    protected $model = 'oauthClients';
17 17
 
18 18
     /**
19 19
      * The validations rules used by the base api controller
20 20
      * to check before add.
21 21
      * @var array
22 22
      */
23
-    protected $validationRules  = [
23
+    protected $validationRules = [
24 24
         'name'     => 'required|max:255',
25 25
         'redirect' => 'required|url',
26 26
         'user_id'  => 'required|exists:users,id',
Please login to merge, or discard this patch.
src/Modules/V1/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.