Completed
Push — master ( fad632...bfac7f )
by Maxime
03:40
created
src/Distilleries/Expendable/Http/Controllers/Backend/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 
55 55
 
56
-    public function postUnLock(Request $request){
56
+    public function postUnLock(Request $request) {
57 57
 
58 58
         $model = $this->model->findOrFail($request->get('id'));
59 59
         $model->nb_of_try = 0;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     }
64 64
 
65 65
 
66
-    public function postLock(Request $request){
66
+    public function postLock(Request $request) {
67 67
 
68 68
         $model = $this->model->findOrFail($request->get('id'));
69 69
         $model->nb_of_try = config('expendable.auth.nb_of_try');
Please login to merge, or discard this patch.
Distilleries/Expendable/Http/Controllers/Backend/Base/BaseController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         $this->layoutManager->initStaticPart(function($layoutManager)
50 50
         {
51 51
 
52
-            $menu_top  = $layoutManager->getView()->make('expendable::admin.menu.top',[
52
+            $menu_top  = $layoutManager->getView()->make('expendable::admin.menu.top', [
53 53
                 'languages'=>Language::all()
54 54
             ]);
55 55
             $menu_left = $layoutManager->getView()->make('expendable::admin.menu.left');
Please login to merge, or discard this patch.
Distilleries/Expendable/Http/Controllers/Backend/Base/ErrorController.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
 
20 20
         $this->layoutManager->add([
21
-            'class_layout'=>$class . '-full-page',
21
+            'class_layout'=>$class.'-full-page',
22 22
             'content'=>$content,
23 23
         ]);
24 24
 
Please login to merge, or discard this patch.
src/config/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
     'login_uri'           => 'admin/login',
5 5
     'logout_action'       => 'Distilleries\Expendable\Http\Controllers\Backend\LoginController@getLogout',
6 6
     'admin_base_uri'      => 'admin',
7
-    'config_file_assets'  => base_path() . '/package.json',
7
+    'config_file_assets'  => base_path().'/package.json',
8 8
     'folder_whitelist'    => [
9 9
         'moximanager'
10 10
     ],
Please login to merge, or discard this patch.
Distilleries/Expendable/Http/Controllers/Backend/ComponentController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function getIndex()
30 30
     {
31
-        return redirect()->to(action('\\' . get_class($this) . '@getEdit'));
31
+        return redirect()->to(action('\\'.get_class($this).'@getEdit'));
32 32
     }
33 33
 
34 34
 
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
         }
71 71
 
72 72
         $libelle            = $request->get('libelle');
73
-        $libelle_form       = $libelle . 'Form';
74
-        $libelle_datatable  = $libelle . 'Datatable';
75
-        $libelle_controller = $libelle . 'Controller';
73
+        $libelle_form       = $libelle.'Form';
74
+        $libelle_datatable  = $libelle.'Datatable';
75
+        $libelle_controller = $libelle.'Controller';
76 76
         $model              = $request->get('models');
77 77
         $states             = $request->get('state');
78 78
 
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
             {
83 83
                 $this->artisan->call('datatable:make', [
84 84
                     '--fields' => $request->get('colon_datatable'),
85
-                    'name'     => 'Http/Datatables/' . $libelle_datatable
85
+                    'name'     => 'Http/Datatables/'.$libelle_datatable
86 86
                 ]);
87 87
             } else if (strpos($state, 'FormStateContract') !== false)
88 88
             {
89 89
 
90 90
                 $this->artisan->call('make:form', [
91 91
                     '--fields' => $request->get('fields_form'),
92
-                    'name'     => 'Http/Forms/' . $libelle_form
92
+                    'name'     => 'Http/Forms/'.$libelle_form
93 93
                 ]);
94 94
             }
95 95
         }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             '--model'     => $model,
100 100
             '--datatable' => $libelle_datatable,
101 101
             '--form'      => $libelle_form,
102
-            'name'        => 'Http/Controllers/Backend/' . $libelle_controller
102
+            'name'        => 'Http/Controllers/Backend/'.$libelle_controller
103 103
         ]);
104 104
 
105 105
         return redirect()->back()->with(Message::MESSAGE, [trans('expendable::success.generated')]);
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Models/BaseModel.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
     public function scopeSearch($query, $searchQuery)
31 31
     {
32 32
 
33
-        return $query->where(function ($query) use ($searchQuery) {
33
+        return $query->where(function($query) use ($searchQuery) {
34 34
             $columns = $this->getAllColumnsNames();
35 35
 
36 36
             foreach ($columns as $column) {
37
-                $column = $this->isReserved($column) ? '"' . $column . '"' : $column;
37
+                $column = $this->isReserved($column) ? '"'.$column.'"' : $column;
38 38
 
39 39
                 if ((DB::connection()->getDriverName()) == 'oracle') {
40
-                    $query->orWhereRaw('LOWER(' . $column . ') like ? ESCAPE \'\\\'', ['%' . Security::escapeLike(strtolower($searchQuery)) . '%']);
40
+                    $query->orWhereRaw('LOWER('.$column.') like ? ESCAPE \'\\\'', ['%'.Security::escapeLike(strtolower($searchQuery)).'%']);
41 41
                 } else {
42
-                    $query->orwhere($column, 'like', '%' . Security::escapeLike($searchQuery,'\\\'') . '%');
42
+                    $query->orwhere($column, 'like', '%'.Security::escapeLike($searchQuery, '\\\'').'%');
43 43
                 }
44 44
 
45 45
             }
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
     {
51 51
         switch (DB::connection()->getDriverName()) {
52 52
             case 'pgsql':
53
-                $query       = "SELECT column_name FROM information_schema.columns WHERE table_name = '" . $this->getTable() . "'";
53
+                $query       = "SELECT column_name FROM information_schema.columns WHERE table_name = '".$this->getTable()."'";
54 54
                 $column_name = 'column_name';
55 55
                 $reverse     = true;
56 56
                 break;
57 57
 
58 58
             case 'sqlite':
59
-                $query       = "PRAGMA table_info('" . $this->getTable()."')";
59
+                $query       = "PRAGMA table_info('".$this->getTable()."')";
60 60
                 $column_name = 'name';
61 61
                 $reverse     = true;
62 62
                 break;
63 63
 
64 64
 
65 65
             case 'mysql':
66
-                $query       = 'SHOW COLUMNS FROM ' . $this->getTable();
66
+                $query       = 'SHOW COLUMNS FROM '.$this->getTable();
67 67
                 $column_name = 'Field';
68 68
                 $reverse     = false;
69 69
                 break;
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
                 $parts       = explode('.', $this->getTable());
73 73
                 $num         = (count($parts) - 1);
74 74
                 $table       = $parts[$num];
75
-                $query       = "SELECT column_name FROM " . DB::connection()->getConfig('database') . ".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'" . $table . "'";
75
+                $query       = "SELECT column_name FROM ".DB::connection()->getConfig('database').".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'".$table."'";
76 76
                 $column_name = 'column_name';
77 77
                 $reverse     = false;
78 78
                 break;
79 79
             case 'oracle':
80
-                $query       = 'SELECT COLUMN_NAME from ALL_TAB_COLUMNS WHERE TABLE_NAME=\'' . strtoupper($this->getTable()) . '\' AND DATA_TYPE <> \'CLOB\' AND DATA_TYPE <> \'NUMBER\' AND DATA_TYPE <> \'TIMESTAMP\'';
80
+                $query       = 'SELECT COLUMN_NAME from ALL_TAB_COLUMNS WHERE TABLE_NAME=\''.strtoupper($this->getTable()).'\' AND DATA_TYPE <> \'CLOB\' AND DATA_TYPE <> \'NUMBER\' AND DATA_TYPE <> \'TIMESTAMP\'';
81 81
                 $column_name = 'column_name';
82 82
                 $reverse     = false;
83 83
                 break;
84 84
             default:
85
-                $error = 'Database driver not supported: ' . DB::connection()->getConfig('driver');
85
+                $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');
86 86
                 throw new Exception($error);
87 87
         }
88 88
 
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 
102 102
     public function scopeBetweenCreate($query, $start, $end)
103 103
     {
104
-        return $query->whereBetween($this->getTable() . '.created_at', [$start, $end]);
104
+        return $query->whereBetween($this->getTable().'.created_at', [$start, $end]);
105 105
     }
106 106
 
107 107
     public function scopeBetweenUpdate($query, $start, $end)
108 108
     {
109
-        return $query->whereBetween($this->getTable() . '.updated_at', [$start, $end]);
109
+        return $query->whereBetween($this->getTable().'.updated_at', [$start, $end]);
110 110
     }
111 111
 
112 112
 
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Http/Forms/Role/RoleForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
41 41
 
42 42
     protected function getUpdateRules()
43 43
     {
44
-        $key                           = \Request::get($this->model->getKeyName());
45
-        static::$rules_update['initials'] = 'required|unique:roles,initials,' . $key;
44
+        $key = \Request::get($this->model->getKeyName());
45
+        static::$rules_update['initials'] = 'required|unique:roles,initials,'.$key;
46 46
 
47 47
         return parent::getUpdateRules();
48 48
     }
Please login to merge, or discard this patch.
src/Distilleries/Expendable/Http/Forms/Component/ComponentForm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $allModels = [
49 49
             [
50
-                'path' => app_path() . DIRECTORY_SEPARATOR,
50
+                'path' => app_path().DIRECTORY_SEPARATOR,
51 51
                 'namespace' => '{{app}}',
52 52
             ],
53 53
             [
54
-                'path' => app_path() . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR,
54
+                'path' => app_path().DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR,
55 55
                 'namespace' => '{{app}}Models\\',
56 56
             ],
57 57
             [
58
-                'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR,
58
+                'path' => __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR,
59 59
                 'namespace' => 'Distilleries\\Expendable\\Models\\',
60 60
             ],
61 61
         ];
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 foreach ($models as $model) {
68 68
                     $choice = explode('/', $model);
69 69
                     $model = preg_replace('/.php/i', '', last($choice));
70
-                    $choices[$config['namespace'] . $model] = $model;
70
+                    $choices[$config['namespace'].$model] = $model;
71 71
                 }
72 72
             }
73 73
 
Please login to merge, or discard this patch.
Distilleries/Expendable/Http/Middleware/AuthenticateOnceWithBasicAuth.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@
 block discarded – undo
16 16
      */
17 17
     public function handle($request, Closure $next, $guard = null, $field = null)
18 18
     {
19
-        $ipsAuth = env('BASIC_AUTH_IP','');
20
-        $ipsAuth = explode(',',$ipsAuth);
19
+        $ipsAuth = env('BASIC_AUTH_IP', '');
20
+        $ipsAuth = explode(',', $ipsAuth);
21 21
 
22 22
 
23
-        if (env('BASIC_AUTH',false) == true)
23
+        if (env('BASIC_AUTH', false) == true)
24 24
         {
25
-            if(empty($ipsAuth) || !in_array($request->ip(),$ipsAuth))
25
+            if (empty($ipsAuth) || !in_array($request->ip(), $ipsAuth))
26 26
             {
27 27
                 return $this->auth->guard($guard)->basic() ?: $next($request);
28 28
             }
Please login to merge, or discard this patch.