Test Setup Failed
Push — master ( ac1df1...78b07d )
by Php Easy Api
04:27
created
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/Router/RouteMatching.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      * @param ApplicationContracts $app
19 19
      * @param null|object $route
20 20
      */
21
-    public function __construct(ApplicationContracts $app, $route=null)
21
+    public function __construct(ApplicationContracts $app, $route = null)
22 22
     {
23 23
         parent::__construct($app);
24 24
 
@@ -34,53 +34,53 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $routes = $this->route->getRoutes();
36 36
 
37
-        if(!isset($routes['pattern'])){
37
+        if (!isset($routes['pattern'])) {
38 38
             return [];
39 39
         }
40 40
 
41 41
         $patterns = $routes['pattern'];
42
-        $urlRoute = array_filter(route(),'strlen');
42
+        $urlRoute = array_filter(route(), 'strlen');
43 43
 
44 44
         $patternList = [];
45 45
 
46
-        foreach($routes['data'] as $patternKey=>$routeData){
47
-            if($routeData['http']==httpMethod()){
48
-                $patternList[$patternKey]=$patterns[$patternKey];
46
+        foreach ($routes['data'] as $patternKey=>$routeData) {
47
+            if ($routeData['http']==httpMethod()) {
48
+                $patternList[$patternKey] = $patterns[$patternKey];
49 49
             }
50 50
         }
51 51
 
52 52
         $scoredList = [];
53 53
 
54
-        foreach ($patternList as $key=>$pattern){
54
+        foreach ($patternList as $key=>$pattern) {
55 55
 
56 56
             $patternCount = $this->getPatternRealCount($pattern);
57 57
 
58
-            if(count($urlRoute)==0 && count($urlRoute)==0) return 0;
58
+            if (count($urlRoute)==0 && count($urlRoute)==0) return 0;
59 59
 
60
-            if(isset($patternCount['optional'])){
61
-                $optionalCount = count($patternCount['default']) + count($patternCount['optional']);
60
+            if (isset($patternCount['optional'])) {
61
+                $optionalCount = count($patternCount['default'])+count($patternCount['optional']);
62 62
             }
63 63
 
64
-            if(count($urlRoute) == count($patternCount['default']) ||
64
+            if (count($urlRoute)==count($patternCount['default']) ||
65 65
                 (isset($optionalCount) && count($urlRoute)>count($patternCount['default']) && $optionalCount>=count($urlRoute))
66
-            ){
66
+            ) {
67 67
 
68
-                foreach ($pattern as $pkey=>$item){
68
+                foreach ($pattern as $pkey=>$item) {
69 69
 
70
-                    if($this->route->isMatchVaribleRegexPattern($item)===false){
71
-                        if(isset($urlRoute[$pkey]) && $urlRoute[$pkey]==$item){
70
+                    if ($this->route->isMatchVaribleRegexPattern($item)===false) {
71
+                        if (isset($urlRoute[$pkey]) && $urlRoute[$pkey]==$item) {
72 72
                             $scoredList[$key][] = 3;
73 73
                         }
74 74
                     }
75 75
 
76
-                    if($this->route->isMatchVaribleRegexPattern($item) && !$this->route->isOptionalVaribleRegexPattern($item)){
77
-                        if(isset($urlRoute[$pkey])){
76
+                    if ($this->route->isMatchVaribleRegexPattern($item) && !$this->route->isOptionalVaribleRegexPattern($item)) {
77
+                        if (isset($urlRoute[$pkey])) {
78 78
                             $scoredList[$key][] = 2;
79 79
                         }
80 80
                     }
81 81
 
82
-                    if($this->route->isMatchVaribleRegexPattern($item) && $this->route->isOptionalVaribleRegexPattern($item)){
83
-                        if(isset($urlRoute[$pkey])){
82
+                    if ($this->route->isMatchVaribleRegexPattern($item) && $this->route->isOptionalVaribleRegexPattern($item)) {
83
+                        if (isset($urlRoute[$pkey])) {
84 84
                             $scoredList[$key][] = 1;
85 85
                         }
86 86
                     }
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
         $list = [];
105 105
         $list['default'] = [];
106 106
 
107
-        foreach ($pattern as $key=>$value){
108
-            if(($this->route->isMatchVaribleRegexPattern($value)===false) || ($this->route->isMatchVaribleRegexPattern($value)
109
-                    && !$this->route->isOptionalVaribleRegexPattern($value))){
107
+        foreach ($pattern as $key=>$value) {
108
+            if (($this->route->isMatchVaribleRegexPattern($value)===false) || ($this->route->isMatchVaribleRegexPattern($value)
109
+                    && !$this->route->isOptionalVaribleRegexPattern($value))) {
110 110
                 $list['default'][$key] = $value;
111 111
             }
112 112
 
113
-            if(($this->route->isMatchVaribleRegexPattern($value)
114
-                && $this->route->isOptionalVaribleRegexPattern($value))){
113
+            if (($this->route->isMatchVaribleRegexPattern($value)
114
+                && $this->route->isOptionalVaribleRegexPattern($value))) {
115 115
                 $list['optional'][] = true;
116 116
             }
117 117
         }
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
      * @param array $scoredList
126 126
      * @return false|int|string
127 127
      */
128
-    private function showKeyAccordingToScoredList($scoredList=array())
128
+    private function showKeyAccordingToScoredList($scoredList = array())
129 129
     {
130 130
         $scored = [];
131 131
 
132
-        foreach($scoredList as $key=>$item){
132
+        foreach ($scoredList as $key=>$item) {
133 133
             $scored[$key] = array_sum($item);
134 134
         }
135 135
 
136
-        if(count($scored)){
137
-            return array_search(max($scored),$scored);
136
+        if (count($scored)) {
137
+            return array_search(max($scored), $scored);
138 138
         }
139 139
 
140 140
         return null;
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         $route = route();
153 153
 
154 154
         foreach ($pattern as $key=>$item) {
155
-            if($this->route->isMatchVaribleRegexPattern($item)===false){
156
-                if(isset($route[$key]) && $item!==$route[$key]){
155
+            if ($this->route->isMatchVaribleRegexPattern($item)===false) {
156
+                if (isset($route[$key]) && $item!==$route[$key]) {
157 157
                     return false;
158 158
                 }
159 159
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@
 block discarded – undo
55 55
 
56 56
             $patternCount = $this->getPatternRealCount($pattern);
57 57
 
58
-            if(count($urlRoute)==0 && count($urlRoute)==0) return 0;
58
+            if(count($urlRoute)==0 && count($urlRoute)==0) {
59
+                return 0;
60
+            }
59 61
 
60 62
             if(isset($patternCount['optional'])){
61 63
                 $optionalCount = count($patternCount['default']) + count($patternCount['optional']);
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.
src/resta/Support/Str.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function after($subject, $search)
37 37
     {
38
-        return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
38
+        return $search==='' ? $subject : array_reverse(explode($search, $subject, 2))[0];
39 39
     }
40 40
 
41 41
     /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $languageSpecific = static::languageSpecificCharsArray($language);
51 51
 
52
-        if (! is_null($languageSpecific)) {
52
+        if (!is_null($languageSpecific)) {
53 53
             $value = str_replace($languageSpecific[0], $languageSpecific[1], $value);
54 54
         }
55 55
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function before($subject, $search)
71 71
     {
72
-        return $search === '' ? $subject : explode($search, $subject)[0];
72
+        return $search==='' ? $subject : explode($search, $subject)[0];
73 73
     }
74 74
 
75 75
     /**
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public static function contains($haystack, $needles)
98 98
     {
99
-        foreach ((array) $needles as $needle) {
100
-            if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {
99
+        foreach ((array)$needles as $needle) {
100
+            if ($needle!=='' && mb_strpos($haystack, $needle)!==false) {
101 101
                 return true;
102 102
             }
103 103
         }
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public static function endsWith($haystack, $needles)
116 116
     {
117
-        foreach ((array) $needles as $needle) {
118
-            if (mb_substr($haystack, -mb_strlen($needle)) === (string) $needle) {
117
+        foreach ((array)$needles as $needle) {
118
+            if (mb_substr($haystack, -mb_strlen($needle))===(string)$needle) {
119 119
                 return true;
120 120
             }
121 121
         }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public static function is($pattern, $value)
148 148
     {
149
-        $patterns = is_array($pattern) ? $pattern : (array) $pattern;
149
+        $patterns = is_array($pattern) ? $pattern : (array)$pattern;
150 150
 
151 151
         if (empty($patterns)) {
152 152
             return false;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             // If the given value is an exact match we can of course return true right
157 157
             // from the beginning. Otherwise, we will translate asterisks and do an
158 158
             // actual pattern match against the two strings to see if they match.
159
-            if ($pattern == $value) {
159
+            if ($pattern==$value) {
160 160
                 return true;
161 161
             }
162 162
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             // pattern such as "library/*", making any string check convenient.
168 168
             $pattern = str_replace('\*', '.*', $pattern);
169 169
 
170
-            if (preg_match('#^'.$pattern.'\z#u', $value) === 1) {
170
+            if (preg_match('#^'.$pattern.'\z#u', $value)===1) {
171 171
                 return true;
172 172
             }
173 173
         }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public static function limit($value, $limit = 100, $end = '...')
214 214
     {
215
-        if (mb_strwidth($value, 'UTF-8') <= $limit) {
215
+        if (mb_strwidth($value, 'UTF-8')<=$limit) {
216 216
             return $value;
217 217
         }
218 218
 
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
      * @param string $case
239 239
      * @return string
240 240
      */
241
-    public static function crop($value,$crop,$case='lower')
241
+    public static function crop($value, $crop, $case = 'lower')
242 242
     {
243
-        return static::$case(str_replace($crop,'',$value));
243
+        return static::$case(str_replace($crop, '', $value));
244 244
     }
245 245
 
246 246
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     {
256 256
         preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches);
257 257
 
258
-        if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) {
258
+        if (!isset($matches[0]) || static::length($value)===static::length($matches[0])) {
259 259
             return $value;
260 260
         }
261 261
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $string = '';
286 286
 
287
-        while (($len = strlen($string)) < $length) {
288
-            $size = $length - $len;
287
+        while (($len = strlen($string))<$length) {
288
+            $size = $length-$len;
289 289
 
290 290
             $bytes = random_bytes($size);
291 291
 
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public static function replaceWordArray($word, $replace, $subject)
307 307
     {
308
-        if(is_array($word)){
308
+        if (is_array($word)) {
309 309
 
310 310
             foreach ($word as $value) {
311
-                $subject = str_replace($value,$replace,$subject);
311
+                $subject = str_replace($value, $replace, $subject);
312 312
             }
313 313
         }
314 314
 
@@ -342,14 +342,14 @@  discard block
 block discarded – undo
342 342
      */
343 343
     public static function replaceFirst($search, $replace, $subject)
344 344
     {
345
-        if ($search == '') {
345
+        if ($search=='') {
346 346
             return $subject;
347 347
         }
348 348
 
349 349
         $position = mb_strpos($subject, $search);
350 350
 
351
-        if ($position !== false) {
352
-            return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + mb_strlen($search));
351
+        if ($position!==false) {
352
+            return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position+mb_strlen($search));
353 353
         }
354 354
 
355 355
         return $subject;
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
     {
368 368
         $position = mb_strrpos($subject, $search);
369 369
 
370
-        if ($position !== false) {
371
-            return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + mb_strlen($search));
370
+        if ($position!==false) {
371
+            return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position+mb_strlen($search));
372 372
         }
373 373
 
374 374
         return $subject;
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         $title = static::ascii($title, $language);
424 424
 
425 425
         // Convert all dashes/underscores into separator
426
-        $flip = $separator == '-' ? '_' : '-';
426
+        $flip = $separator=='-' ? '_' : '-';
427 427
 
428 428
         $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
429 429
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             return static::$snakeCache[$key][$delimiter];
455 455
         }
456 456
 
457
-        if (! ctype_lower($value)) {
457
+        if (!ctype_lower($value)) {
458 458
             $value = preg_replace('/\s+/u', '', ucwords($value));
459 459
 
460 460
             $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public static function startsWith($haystack, $needles)
474 474
     {
475
-        foreach ((array) $needles as $needle) {
476
-            if ($needle !== '' && mb_substr($haystack, 0, mb_strlen($needle)) === (string) $needle) {
475
+        foreach ((array)$needles as $needle) {
476
+            if ($needle!=='' && mb_substr($haystack, 0, mb_strlen($needle))===(string)$needle) {
477 477
                 return true;
478 478
             }
479 479
         }
@@ -672,14 +672,14 @@  discard block
 block discarded – undo
672 672
     {
673 673
         static $languageSpecific;
674 674
 
675
-        if (! isset($languageSpecific)) {
675
+        if (!isset($languageSpecific)) {
676 676
             $languageSpecific = [
677 677
                 'bg' => [
678 678
                     ['х', 'Х', 'щ', 'Щ', 'ъ', 'Ъ', 'ь', 'Ь'],
679 679
                     ['h', 'H', 'sht', 'SHT', 'a', 'А', 'y', 'Y'],
680 680
                 ],
681 681
                 'de' => [
682
-                    ['ä',  'ö',  'ü',  'Ä',  'Ö',  'Ü'],
682
+                    ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü'],
683 683
                     ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'],
684 684
                 ],
685 685
             ];
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
      */
695 695
     public static function slashToBackSlash($data)
696 696
     {
697
-        return str_replace("\\","/",$data);
697
+        return str_replace("\\", "/", $data);
698 698
     }
699 699
 
700 700
     /**
@@ -702,25 +702,25 @@  discard block
 block discarded – undo
702 702
      * @param string $explode
703 703
      * @return array
704 704
      */
705
-    public static function stringToArray($string,$explode=".")
705
+    public static function stringToArray($string, $explode = ".")
706 706
     {
707
-        return explode($explode,$string);
707
+        return explode($explode, $string);
708 708
     }
709 709
 
710 710
     /**
711 711
      * @param null $removeCharacter
712 712
      * @return null|string|string[]
713 713
      */
714
-    public static function removeCharacterFromUri($removeCharacter=null)
714
+    public static function removeCharacterFromUri($removeCharacter = null)
715 715
     {
716
-        if($removeCharacter!==null){
716
+        if ($removeCharacter!==null) {
717 717
             $query = request()->query->all();
718 718
 
719
-            if(count($query)=='1' && isset($query[$removeCharacter])){
720
-                return preg_replace('@'.$removeCharacter.'=(.*)|\?@is','',fullUrl());
719
+            if (count($query)=='1' && isset($query[$removeCharacter])) {
720
+                return preg_replace('@'.$removeCharacter.'=(.*)|\?@is', '', fullUrl());
721 721
             }
722 722
 
723
-            return preg_replace('@'.$removeCharacter.'=\d+\&|\&'.$removeCharacter.'=\d+@is','',fullUrl());
723
+            return preg_replace('@'.$removeCharacter.'=\d+\&|\&'.$removeCharacter.'=\d+@is', '', fullUrl());
724 724
         }
725 725
 
726 726
     }
Please login to merge, or discard this patch.
src/resta/Container/GraceContainer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @throws \ReflectionException
50 50
      */
51
-    protected function getNameContainers($parameter,$param)
51
+    protected function getNameContainers($parameter, $param)
52 52
     {
53 53
         // If the parameter contains a route variable.
54 54
         // We do a custom bind for the route
55
-        if($this->checkNameContainer($parameter)){
55
+        if ($this->checkNameContainer($parameter)) {
56 56
 
57 57
             // we do the name control for the container here,
58 58
             // and if we have the name container we are checking, we make a handle make bind.
59 59
             $nameContainers = $this->nameContainers[$parameter->getName()];
60
-            return app()->resolve($nameContainers,[
60
+            return app()->resolve($nameContainers, [
61 61
                 'reflection' => $this->reflection
62
-            ])->resolveContainer($parameter->getDefaultValue(),$param);
62
+            ])->resolveContainer($parameter->getDefaultValue(), $param);
63 63
         }
64 64
 
65 65
         return [];
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * @throws \ReflectionException
74 74
      */
75
-    public function graceContainerBuilder($parameter,$param)
75
+    public function graceContainerBuilder($parameter, $param)
76 76
     {
77 77
         // if the parameter is an object
78 78
         // but not a container object.
79 79
         // we do some useful logic bind for user benefit.
80
-        if($parameter->getType()!==null){
81
-            return app()->resolve(RepositoryContainer::class)->handle($parameter,$param);
80
+        if ($parameter->getType()!==null) {
81
+            return app()->resolve(RepositoryContainer::class)->handle($parameter, $param);
82 82
         }
83 83
 
84 84
         // In particular, name container values can be specified and
85 85
         // they are injected directly into the methods contextually.
86
-        return $this->getNameContainers($parameter,$param);
86
+        return $this->getNameContainers($parameter, $param);
87 87
     }
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.