Test Setup Failed
Push — master ( d7ad2e...14e992 )
by Php Easy Api
04:20
created
src/resta/Database/Migration/Src/Resource/Request/BaseRequestProcess.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
                 //get path and set mkdir
94 94
                 $path = $mainPath.'/'.ucfirst($table);
95 95
                 if(!file_exists($path)){
96
-                   $mkdirResults[] = mkdir($path, 0777);
96
+                    $mkdirResults[] = mkdir($path, 0777);
97 97
                 }
98 98
             }
99 99
         }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 
36 36
         $paths = self::$paths;
37 37
 
38
-        foreach ($paths as $path){
38
+        foreach ($paths as $path) {
39 39
             $globPaths = array_filter(glob($path.'/*'), 'is_dir');
40
-            foreach ($globPaths as $reelPath){
41
-                $list[]=$reelPath;
40
+            foreach ($globPaths as $reelPath) {
41
+                $list[] = $reelPath;
42 42
             }
43 43
         }
44 44
 
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
         $list = [];
56 56
 
57
-        foreach ($directories as $directory){
57
+        foreach ($directories as $directory) {
58 58
 
59 59
             foreach (glob($directory."/*.php") as $file) {
60 60
 
61
-                $list[self::getFileName($directory)][]=$file;
61
+                $list[self::getFileName($directory)][] = $file;
62 62
             }
63 63
         }
64 64
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public static function getFileName($path)
73 73
     {
74
-        $pathParse = explode ("/",$path);
74
+        $pathParse = explode("/", $path);
75 75
 
76 76
         return end($pathParse);
77 77
     }
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 
88 88
         $mkdirResults = [];
89 89
 
90
-        foreach ($tables as $table){
91
-            if(!isset($directories[$table])){
90
+        foreach ($tables as $table) {
91
+            if (!isset($directories[$table])) {
92 92
 
93 93
                 //get path and set mkdir
94 94
                 $path = $mainPath.'/'.ucfirst($table);
95
-                if(!file_exists($path)){
95
+                if (!file_exists($path)) {
96 96
                    $mkdirResults[] = mkdir($path, 0777);
97 97
                 }
98 98
             }
99 99
         }
100 100
 
101
-        dd(self::getAllDirectories(),$tables,$mkdirResults);
101
+        dd(self::getAllDirectories(), $tables, $mkdirResults);
102 102
     }
103 103
 }
104 104
 
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Resource/StubManager/Stubber.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
             if(!file_exists($tableDirectory)){
94 94
                 $results['directory'][$pathKey]= $this->fileProcess($tableDirectory,'makeDirectory');
95
-            }
96
-            else{
95
+            } else{
97 96
                 $results['directory'][$pathKey]= $this->getResult(false,
98 97
                     'Already exist the specified directory');
99 98
             }
@@ -110,8 +109,7 @@  discard block
 block discarded – undo
110 109
 
111 110
             if(!file_exists($filePath)){
112 111
                 $results['file'][$pathKey]=$this->fileProcess($filePath,'makeFile');
113
-            }
114
-            else{
112
+            } else{
115 113
                 $results['file'][$pathKey]= $this->getResult(false,
116 114
                     'Already exist the specified file');
117 115
             }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     private function getPaths($params)
48 48
     {
49
-        if(!isset($params[0]['group'])){
49
+        if (!isset($params[0]['group'])) {
50 50
             return [$this->config['paths'][0]];
51 51
         }
52 52
         
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
      * @param $params
60 60
      * @return bool
61 61
      */
62
-    private function fopenprocess($executionPath,$path,$params)
62
+    private function fopenprocess($executionPath, $path, $params)
63 63
     {
64 64
         $dt = fopen($executionPath, "r");
65 65
         $content = fread($dt, filesize($executionPath));
66 66
         fclose($dt);
67 67
 
68
-        foreach ($params as $key=>$value){
68
+        foreach ($params as $key=>$value) {
69 69
 
70
-            $content=str_replace("__".$key."__",$value,$content);
70
+            $content = str_replace("__".$key."__", $value, $content);
71 71
         }
72 72
 
73 73
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function get($params)
88 88
     {
89
-        list($arguments,$type) = $params;
89
+        list($arguments, $type) = $params;
90 90
         
91 91
         $table = $arguments['table'];
92 92
         $name = $arguments['name'];
@@ -95,22 +95,22 @@  discard block
 block discarded – undo
95 95
 
96 96
         $paths = $this->getPaths($params);
97 97
 
98
-        foreach ($paths as $pathKey=>$path){
98
+        foreach ($paths as $pathKey=>$path) {
99 99
 
100 100
             $tableDirectory = $path.'/'.ucfirst($table);
101 101
 
102 102
 
103
-            if(!file_exists($tableDirectory)){
104
-                $results['directory'][$pathKey]= $this->fileProcess($tableDirectory,'makeDirectory');
103
+            if (!file_exists($tableDirectory)) {
104
+                $results['directory'][$pathKey] = $this->fileProcess($tableDirectory, 'makeDirectory');
105 105
             }
106
-            else{
107
-                $results['directory'][$pathKey]= $this->getResult(false,
106
+            else {
107
+                $results['directory'][$pathKey] = $this->getResult(false,
108 108
                     'Already exist the specified directory');
109 109
             }
110 110
 
111
-            $results['directory'][$pathKey]['table']= $table;
112
-            $results['directory'][$pathKey]['directory']= $table;
113
-            $results['directory'][$pathKey]['type']= $type;
111
+            $results['directory'][$pathKey]['table'] = $table;
112
+            $results['directory'][$pathKey]['directory'] = $table;
113
+            $results['directory'][$pathKey]['type'] = $type;
114 114
 
115 115
             $fileName = ucfirst($name);
116 116
 
@@ -118,23 +118,23 @@  discard block
 block discarded – undo
118 118
 
119 119
             $filePath = $tableDirectory.'/'.$fileNameWithTime.'.php';
120 120
 
121
-            if(!file_exists($filePath)){
122
-                $results['file'][$pathKey]=$this->fileProcess($filePath,'makeFile');
121
+            if (!file_exists($filePath)) {
122
+                $results['file'][$pathKey] = $this->fileProcess($filePath, 'makeFile');
123 123
             }
124
-            else{
125
-                $results['file'][$pathKey]= $this->getResult(false,
124
+            else {
125
+                $results['file'][$pathKey] = $this->getResult(false,
126 126
                     'Already exist the specified file');
127 127
             }
128 128
 
129
-            $results['file'][$pathKey]['table']=$table;
130
-            $results['file'][$pathKey]['file']=$fileName;
131
-            $results['file'][$pathKey]['type']=$type;
129
+            $results['file'][$pathKey]['table'] = $table;
130
+            $results['file'][$pathKey]['file'] = $fileName;
131
+            $results['file'][$pathKey]['type'] = $type;
132 132
 
133 133
             $stubber = $this->stubber.'/'.$type.'.stub';
134 134
 
135
-            $this->fopenprocess($stubber,$filePath,['className'=>$fileName]);
135
+            $this->fopenprocess($stubber, $filePath, ['className'=>$fileName]);
136 136
 
137
-            $this->file->chmod($tableDirectory,0777,000,true);
137
+            $this->file->chmod($tableDirectory, 0777, 000, true);
138 138
         }
139 139
 
140 140
         return $results;
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
      * @param $process
146 146
      * @return array
147 147
      */
148
-    private function fileProcess($path,$process)
148
+    private function fileProcess($path, $process)
149 149
     {
150 150
         try {
151 151
             $this->{$process}($path);
152
-            return $this->getResult(true,null);
152
+            return $this->getResult(true, null);
153 153
         } catch (IOExceptionInterface $exception) {
154 154
             return $this->getResult(false,
155 155
                 "An error occurred while creating your directory at ".$exception->getPath()."");
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
      * @param $path
161 161
      * @param int $mode
162 162
      */
163
-    private function  makeDirectory($path,$mode=0777)
163
+    private function  makeDirectory($path, $mode = 0777)
164 164
     {
165
-        return $this->file->mkdir($path,$mode);
165
+        return $this->file->mkdir($path, $mode);
166 166
     }
167 167
 
168 168
     /**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @param $message
179 179
      * @return array
180 180
      */
181
-    private function getResult($success,$message)
181
+    private function getResult($success, $message)
182 182
     {
183 183
         return [
184 184
             'success'=>$success,
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/QueryBaseContract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
      * @param array $tables
14 14
      * @return mixed
15 15
      */
16
-    public function getColumns($tables=array());
16
+    public function getColumns($tables = array());
17 17
 
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/WizardContract.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @param bool $table
17 17
      * @return TablePropertiesContract
18 18
      */
19
-    public function collation($value,$table=false);
19
+    public function collation($value, $table = false);
20 20
 
21 21
     /**
22 22
      * @param $value
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @param bool $key
37 37
      * @return $this
38 38
      */
39
-    public function index($name=null,$value=null,$key=false);
39
+    public function index($name = null, $value = null, $key = false);
40 40
 
41 41
     /**
42 42
      * @param $value
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param bool $null
49 49
      * @return $this
50 50
      */
51
-    public function nullable($null=true);
51
+    public function nullable($null = true);
52 52
 
53 53
     /**
54 54
      * @return $this
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param null $value
66 66
      * @return mixed
67 67
      */
68
-    public function unique($name=null,$value=null);
68
+    public function unique($name = null, $value = null);
69 69
 
70 70
 }
71 71
 
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/Foreign/ReferencesContract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
      * @param string $field
10 10
      * @return OptionsContract
11 11
      */
12
-    public function references($table,$field='id');
12
+    public function references($table, $field = 'id');
13 13
 }
14 14
 
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/ColumnsProcessContract.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
      * @param array $tables
14 14
      * @return mixed
15 15
      */
16
-    public function fields($tables=array());
16
+    public function fields($tables = array());
17 17
 
18 18
 }
19 19
 
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/SchemaFacadeContract.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      * @param array $tables
19 19
      * @return SchemaContract
20 20
      */
21
-    public function tables($tables=array());
21
+    public function tables($tables = array());
22 22
 
23 23
     /**
24 24
      * @param $table
@@ -27,5 +27,5 @@  discard block
 block discarded – undo
27 27
      * @param array $paths
28 28
      * @return mixed
29 29
      */
30
-    public function stub($table,$type,$name,$paths=[0]);
30
+    public function stub($table, $type, $name, $paths = [0]);
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Database/Migration/Src/Contract/TablePropertiesContract.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
      * @param string $value
13 13
      * @return mixed
14 14
      */
15
-    public function collation($value='utf8');
15
+    public function collation($value = 'utf8');
16 16
 
17 17
     /**
18 18
      * @return EngineProperties
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param null $comment
31 31
      * @return IndexPropertiesContract
32 32
      */
33
-    public function indexes($index_name,$fields=array(),$comment=null);
33
+    public function indexes($index_name, $fields = array(), $comment = null);
34 34
 
35 35
 }
36 36
 
Please login to merge, or discard this patch.
src/resta/Support/App.php 2 patches
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -24,29 +24,29 @@  discard block
 block discarded – undo
24 24
      * @param $arg
25 25
      * @return mixed
26 26
      */
27
-    public static function annotationsLoaders($service,$arg)
27
+    public static function annotationsLoaders($service, $arg)
28 28
     {
29 29
         //factory runner
30
-        if($service=="factory"){
30
+        if ($service=="factory") {
31 31
             return self::factory();
32 32
         }
33 33
         //if $name starts with $needles for repository
34
-        if(Str::endsWith($service,'Repository')){
34
+        if (Str::endsWith($service, 'Repository')) {
35 35
             return self::repository($service);
36 36
         }
37 37
 
38 38
         //if $name starts with $needles for source
39
-        if(Str::endsWith($service,'Source')){
40
-            return self::source($service,$arg);
39
+        if (Str::endsWith($service, 'Source')) {
40
+            return self::source($service, $arg);
41 41
         }
42 42
 
43 43
         //if $name starts with $needles for model
44
-        if(Str::endsWith($service,'Builder')){
44
+        if (Str::endsWith($service, 'Builder')) {
45 45
             return self::Builder(ucfirst($service));
46 46
         }
47 47
 
48 48
 
49
-        if(method_exists(new self,$service)){
49
+        if (method_exists(new self, $service)) {
50 50
             return self::$service($arg);
51 51
         }
52 52
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     private static function builder($service)
76 76
     {
77 77
         //we are making a namespace assignment for the builder.
78
-        $builder=app()->namespace()->builder().'\\'.$service;
78
+        $builder = app()->namespace()->builder().'\\'.$service;
79 79
 
80 80
         //we are getting builder instance.
81 81
         return app()->resolve($builder);
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
      * @param array $bind
104 104
      * @return mixed
105 105
      */
106
-    public function container($instance,$class,$bind=array())
106
+    public function container($instance, $class, $bind = array())
107 107
     {
108
-        if(!property_exists($instance->container(),$class)){
108
+        if (!property_exists($instance->container(), $class)) {
109 109
             throw new \InvalidArgumentException('container object false for ('.$class.') object');
110 110
         }
111 111
 
112
-        $container=$instance->container()->{$class};
112
+        $container = $instance->container()->{$class};
113 113
 
114
-        if(!is_array($instance->container()->{$class}) AND Utils::isNamespaceExists($container)){
115
-            return $instance->resolve($container,$bind);
114
+        if (!is_array($instance->container()->{$class}) AND Utils::isNamespaceExists($container)) {
115
+            return $instance->resolve($container, $bind);
116 116
         }
117 117
         return $instance->container()->{$class};
118 118
     }
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function createAppInstance($object)
124 124
     {
125
-        if(!defined('appInstance')){
126
-            define('appInstance',(base64_encode(serialize($object))));
125
+        if (!defined('appInstance')) {
126
+            define('appInstance', (base64_encode(serialize($object))));
127 127
         }
128 128
     }
129 129
 
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
      * @param array $arg
132 132
      * @return mixed
133 133
      */
134
-    private static function date($arg=array())
134
+    private static function date($arg = array())
135 135
     {
136
-        $locale = (count($arg)=="0") ? config('app.locale','en') : current($arg);
136
+        $locale = (count($arg)=="0") ? config('app.locale', 'en') : current($arg);
137 137
 
138 138
         return app()->resolve(Date::class)->setLocale($locale);
139 139
     }
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
     {
154 154
         //we save an instance for the entire application
155 155
         //and add it to the helper file to be accessed from anywhere in the application.
156
-        if(!isset(self::$instance['appInstance'])){
157
-            self::$instance['appInstance']=unserialize(base64_decode(appInstance));
156
+        if (!isset(self::$instance['appInstance'])) {
157
+            self::$instance['appInstance'] = unserialize(base64_decode(appInstance));
158 158
             return self::$instance['appInstance'];
159 159
         }
160 160
         return self::$instance['appInstance'];
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
      */
182 182
     private static function queue()
183 183
     {
184
-        if(!isset(self::$instance['queue'])){
184
+        if (!isset(self::$instance['queue'])) {
185 185
 
186
-            self::$instance['queue']=(new Queue());
186
+            self::$instance['queue'] = (new Queue());
187 187
             return self::$instance['queue'];
188 188
 
189 189
         }
@@ -195,18 +195,18 @@  discard block
 block discarded – undo
195 195
      * @param bool $namespace
196 196
      * @return string
197 197
      */
198
-    public static function repository($service,$namespace=false)
198
+    public static function repository($service, $namespace = false)
199 199
     {
200 200
         //I can get the repository name from the magic method as a salt repository,
201 201
         //after which we will edit it as an adapter namespace.
202
-        $repositoryName=ucfirst(preg_replace('@Repository@is','',$service));
202
+        $repositoryName = ucfirst(preg_replace('@Repository@is', '', $service));
203 203
 
204 204
         //If we then configure the name of the simple repository to be an adapter
205 205
         //then we will give the user an example of the adapter class in each repository call.
206 206
         $repositoryAdapterName  = $repositoryName.'Adapter';
207 207
         $repositoryNamespace    = app()->namespace()->repository().'\\'.$repositoryName.'\\'.$repositoryAdapterName;
208 208
 
209
-        if($namespace) return $repositoryNamespace;
209
+        if ($namespace) return $repositoryNamespace;
210 210
 
211 211
         //and eventually we conclude the adapter class of the repository package as an instance.
212 212
         return app()->resolve($repositoryNamespace)->adapter();
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
      * @param $arg
218 218
      * @return mixed
219 219
      */
220
-    private static function source($service,$arg)
220
+    private static function source($service, $arg)
221 221
     {
222 222
         //get Source path
223
-        $service=ucfirst($service);
224
-        $getCalledClass=str_replace('\\'.class_basename($arg[0]),'',get_class($arg[0]));
225
-        $getCalledClass=class_basename($getCalledClass);
223
+        $service = ucfirst($service);
224
+        $getCalledClass = str_replace('\\'.class_basename($arg[0]), '', get_class($arg[0]));
225
+        $getCalledClass = class_basename($getCalledClass);
226 226
 
227
-        $service=str_replace($getCalledClass,'',$service);
227
+        $service = str_replace($getCalledClass, '', $service);
228 228
 
229 229
         //run service for endpoint
230
-        $serviceSource=StaticPathModel::appSourceEndpoint().'\\'.$getCalledClass.'\\'.$service.'\Main';
230
+        $serviceSource = StaticPathModel::appSourceEndpoint().'\\'.$getCalledClass.'\\'.$service.'\Main';
231 231
         return app()->resolve($serviceSource);
232 232
     }
233 233
 
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
      */
237 237
     public static function redis()
238 238
     {
239
-        if(!isset(self::$instance['redis'])){
239
+        if (!isset(self::$instance['redis'])) {
240 240
 
241
-            self::$instance['redis']=(new Redis())->client();
241
+            self::$instance['redis'] = (new Redis())->client();
242 242
             return self::$instance['redis'];
243 243
 
244 244
         }
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
      * @param null $param
250 250
      * @return array|null|string
251 251
      */
252
-    public function route($param=null)
252
+    public function route($param = null)
253 253
     {
254
-        $kernel=self::getAppInstance()->kernel;
254
+        $kernel = self::getAppInstance()->kernel;
255 255
 
256
-        $saltRouteParameters=$kernel->routeParameters;
256
+        $saltRouteParameters = $kernel->routeParameters;
257 257
 
258
-        if($param===null){
258
+        if ($param===null) {
259 259
             return $saltRouteParameters;
260 260
         }
261 261
 
@@ -271,14 +271,14 @@  discard block
 block discarded – undo
271 271
      * @param array $select
272 272
      * @return mixed|string
273 273
      */
274
-    public function translator($data,$select=array())
274
+    public function translator($data, $select = array())
275 275
     {
276
-        $lang=(new Lingua(path()->appLanguage()));
276
+        $lang = (new Lingua(path()->appLanguage()));
277 277
 
278
-        $defaultLocale=config('app.locale');
278
+        $defaultLocale = config('app.locale');
279 279
 
280
-        if(count($select)){
281
-            return $lang->include(['default'])->locale($defaultLocale)->get($data,$select);
280
+        if (count($select)) {
281
+            return $lang->include(['default'])->locale($defaultLocale)->get($data, $select);
282 282
         }
283 283
 
284 284
         return $lang->include(['default'])->locale($defaultLocale)->get($data);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -206,7 +206,9 @@
 block discarded – undo
206 206
         $repositoryAdapterName  = $repositoryName.'Adapter';
207 207
         $repositoryNamespace    = app()->namespace()->repository().'\\'.$repositoryName.'\\'.$repositoryAdapterName;
208 208
 
209
-        if($namespace) return $repositoryNamespace;
209
+        if($namespace) {
210
+            return $repositoryNamespace;
211
+        }
210 212
 
211 213
         //and eventually we conclude the adapter class of the repository package as an instance.
212 214
         return app()->resolve($repositoryNamespace)->adapter();
Please login to merge, or discard this patch.