@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function buildClassName( $name, $path = '' ) |
16 | 16 | { |
17 | - $className = explode( '_', $this->snakeCase( $name )); |
|
17 | + $className = explode( '_', $this->snakeCase( $name ) ); |
|
18 | 18 | $className = array_map( 'ucfirst', $className ); |
19 | 19 | $className = implode( '', $className ); |
20 | 20 | $path = ltrim( str_replace( __NAMESPACE__, '', $path ), '\\' ); |
21 | - return !empty( $path ) |
|
21 | + return !empty($path) |
|
22 | 22 | ? __NAMESPACE__.'\\'.$path.'\\'.$className |
23 | 23 | : $className; |
24 | 24 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function buildMethodName( $name, $prefix = '' ) |
32 | 32 | { |
33 | - return lcfirst( $prefix.$this->buildClassName( $name )); |
|
33 | + return lcfirst( $prefix.$this->buildClassName( $name ) ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function buildPropertyName( $name ) |
41 | 41 | { |
42 | - return lcfirst( $this->buildClassName( $name )); |
|
42 | + return lcfirst( $this->buildClassName( $name ) ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function convertPathToId( $path, $prefix = '' ) |
72 | 72 | { |
73 | - return str_replace( ['[', ']'], ['-', ''], $this->convertPathToName( $path, $prefix )); |
|
73 | + return str_replace( ['[', ']'], ['-', ''], $this->convertPathToName( $path, $prefix ) ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $levels = explode( '.', $path ); |
83 | 83 | return array_reduce( $levels, function( $result, $value ) { |
84 | - return $result.= '['.$value.']'; |
|
84 | + return $result .= '['.$value.']'; |
|
85 | 85 | }, $prefix ); |
86 | 86 | } |
87 | 87 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function dashCase( $string ) |
93 | 93 | { |
94 | - return str_replace( '_', '-', $this->snakeCase( $string )); |
|
94 | + return str_replace( '_', '-', $this->snakeCase( $string ) ); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function filterInput( $key, array $request = [] ) |
115 | 115 | { |
116 | - if( isset( $request[$key] )) { |
|
116 | + if( isset($request[$key]) ) { |
|
117 | 117 | return $request[$key]; |
118 | 118 | } |
119 | 119 | $variable = filter_input( INPUT_POST, $key ); |
120 | - if( is_null( $variable ) && isset( $_POST[$key] )) { |
|
120 | + if( is_null( $variable ) && isset($_POST[$key]) ) { |
|
121 | 121 | $variable = $_POST[$key]; |
122 | 122 | } |
123 | 123 | return $variable; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function filterInputArray( $key ) |
131 | 131 | { |
132 | 132 | $variable = filter_input( INPUT_POST, $key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
133 | - if( empty( $variable ) && !empty( $_POST[$key] ) && is_array( $_POST[$key] )) { |
|
133 | + if( empty($variable) && !empty($_POST[$key]) && is_array( $_POST[$key] ) ) { |
|
134 | 134 | $variable = $_POST[$key]; |
135 | 135 | } |
136 | 136 | return (array)$variable; |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | $result = []; |
147 | 147 | foreach( $array as $key => $value ) { |
148 | 148 | $newKey = ltrim( $prefix.'.'.$key, '.' ); |
149 | - if( $this->isIndexedFlatArray( $value )) { |
|
149 | + if( $this->isIndexedFlatArray( $value ) ) { |
|
150 | 150 | if( $flattenValue ) { |
151 | 151 | $value = '['.implode( ', ', $value ).']'; |
152 | 152 | } |
153 | 153 | } |
154 | - else if( is_array( $value )) { |
|
155 | - $result = array_merge( $result, $this->flattenArray( $value, $flattenValue, $newKey )); |
|
154 | + else if( is_array( $value ) ) { |
|
155 | + $result = array_merge( $result, $this->flattenArray( $value, $flattenValue, $newKey ) ); |
|
156 | 156 | continue; |
157 | 157 | } |
158 | 158 | $result[$newKey] = $value; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | Whip::IPV4 => $cloudflareIps['v4'], |
172 | 172 | Whip::IPV6 => $cloudflareIps['v6'], |
173 | 173 | ], |
174 | - ]))->getValidIpAddress(); |
|
174 | + ] ))->getValidIpAddress(); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | $keys = explode( '.', $path ); |
186 | 186 | foreach( $keys as $key ) { |
187 | - if( !isset( $values[$key] )) { |
|
187 | + if( !isset($values[$key]) ) { |
|
188 | 188 | return $fallback; |
189 | 189 | } |
190 | 190 | $values = $values[$key]; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function isIndexedArray( $array ) |
200 | 200 | { |
201 | - if( !is_array( $array )) { |
|
201 | + if( !is_array( $array ) ) { |
|
202 | 202 | return false; |
203 | 203 | } |
204 | 204 | $current = 0; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function isIndexedFlatArray( $array ) |
219 | 219 | { |
220 | - if( !is_array( $array ) || array_filter( $array, 'is_array' )) { |
|
220 | + if( !is_array( $array ) || array_filter( $array, 'is_array' ) ) { |
|
221 | 221 | return false; |
222 | 222 | } |
223 | 223 | return $this->isIndexedArray( $array ); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function prefixString( $string, $prefix = '' ) |
232 | 232 | { |
233 | - return $prefix.str_replace( $prefix, '', trim( $string )); |
|
233 | + return $prefix.str_replace( $prefix, '', trim( $string ) ); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function snakeCase( $string ) |
278 | 278 | { |
279 | - if( !ctype_lower( $string )) { |
|
279 | + if( !ctype_lower( $string ) ) { |
|
280 | 280 | $string = preg_replace( '/\s+/u', '', $string ); |
281 | 281 | $string = preg_replace( '/(.)(?=[A-Z])/u', '$1_', $string ); |
282 | 282 | $string = mb_strtolower( $string, 'UTF-8' ); |
@@ -291,6 +291,6 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function startsWith( $needle, $haystack ) |
293 | 293 | { |
294 | - return substr( $haystack, 0, strlen( $needle )) === $needle; |
|
294 | + return substr( $haystack, 0, strlen( $needle ) ) === $needle; |
|
295 | 295 | } |
296 | 296 | } |