Completed
Push — master ( ae7a17...a23113 )
by Sherif
14:07
created
src/Modules/Acl/Database/Factories/GroupFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\AclGroup::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\AclGroup::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'name'       => $faker->unique->word(),
6 6
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Factories/PermissionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\AclPermission::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\AclPermission::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6 6
 		'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
Please login to merge, or discard this patch.
src/Modules/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/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', 'confirmEmail', 'resendEmailConfirmation'];
30
+    protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken', 'confirmEmail', 'resendEmailConfirmation'];
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'
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $this->validate($request, [
282 282
             'profile_picture' => 'nullable|base64image',
283 283
             'name'            => 'nullable|string', 
284
-            'email'           => 'required|email|unique:users,email,' . \Auth::id()
284
+            'email'           => 'required|email|unique:users,email,'.\Auth::id()
285 285
         ]);
286 286
 
287 287
         return \Response::json($this->repo->saveProfile($request->only('name', 'email', 'profile_picture')), 200);
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/Utl/Media.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     {
14 14
        $response        = [];
15 15
        $image           = $image;
16
-       $imageName       =  str_slug('image' . uniqid() . time() . '_' . $image->getClientOriginalName());
17
-       $destinationPath = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR;
16
+       $imageName       = str_slug('image'.uniqid().time().'_'.$image->getClientOriginalName());
17
+       $destinationPath = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR;
18 18
 
19 19
        ! file_exists($destinationPath) ? \File::makeDirectory($destinationPath) : false;
20 20
        $image->move($destinationPath, $imageName);
21 21
 
22
-       return url($destinationPath . $imageName);
22
+       return url($destinationPath.$imageName);
23 23
     }
24 24
 
25 25
     /**
@@ -31,22 +31,22 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function uploadImageBas64($image, $dir) 
33 33
     {
34
-        if (! strlen($image)) 
34
+        if ( ! strlen($image)) 
35 35
         {
36 36
             return null;
37 37
         }
38 38
         
39 39
         $response        = [];
40 40
         $image           = $image;
41
-        $imageName       = 'image' . uniqid() . time() . '.jpg';
42
-        $destinationPath = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR;
41
+        $imageName       = 'image'.uniqid().time().'.jpg';
42
+        $destinationPath = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR;
43 43
 
44 44
         ! file_exists($destinationPath) ? \File::makeDirectory($destinationPath) : false;
45 45
 
46 46
         $base  = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $image));
47
-        $image = \Image::make($base)->save($destinationPath . $imageName);
47
+        $image = \Image::make($base)->save($destinationPath.$imageName);
48 48
 
49
-        return url($destinationPath . $imageName);
49
+        return url($destinationPath.$imageName);
50 50
     }
51 51
 
52 52
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function deleteImage($path, $dir) 
60 60
     {   
61 61
         $arr      = explode('/', $path);
62
-        $path     = 'media' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . end($arr);
62
+        $path     = 'media'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.end($arr);
63 63
         if (\File::exists($path)) 
64 64
         {
65 65
             \File::delete($path);
Please login to merge, or discard this patch.
src/Modules/Core/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::group([
55 55
             'middleware' => 'web',
56 56
             'namespace'  => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require module_path('core', 'Routes/web.php');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => 'api',
73 73
             'namespace'  => $this->namespace,
74 74
             'prefix'     => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require module_path('core', 'Routes/api.php');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
src/Modules/Core/Providers/ModuleServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             return new \App\Modules\Core\Utl\Media;
52 52
         });
53 53
 
54
-        \Validator::extend('base64image', function ($attribute, $value, $parameters, $validator) {
54
+        \Validator::extend('base64image', function($attribute, $value, $parameters, $validator) {
55 55
             $explode = explode(',', $value);
56 56
             $allow   = ['png', 'jpg', 'svg'];
57 57
             $format  = str_replace(
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
                 $explode[0]
67 67
             );
68 68
             // check file format
69
-            if (!in_array($format, $allow)) {
69
+            if ( ! in_array($format, $allow)) {
70 70
                 return false;
71 71
             }
72 72
             // check base64 format
73
-            if (!preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $explode[1])) {
73
+            if ( ! preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $explode[1])) {
74 74
                 return false;
75 75
             }
76 76
             return true;
Please login to merge, or discard this patch.
src/Modules/Core/Decorators/CachingDecorator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         if ($this->cacheConfig && $this->cacheConfig == 'cache') 
65 65
         {
66 66
             $page     = \Request::get('page') !== null ? \Request::get('page') : '1';
67
-            $cacheKey = $name . $page . \Session::get('locale') . serialize($arguments);
67
+            $cacheKey = $name.$page.\Session::get('locale').serialize($arguments);
68 68
             return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) {
69 69
                 return call_user_func_array([$this->repo, $name], $arguments);
70 70
             });
Please login to merge, or discard this patch.