@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Ramsey\Uuid\Uuid; |
4 | 4 | |
5 | -if (! function_exists('get_id')) { |
|
5 | +if (!function_exists('get_id')) { |
|
6 | 6 | /** |
7 | 7 | * Get id from a mixed variable. |
8 | 8 | * |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | if (is_object($var)) { |
16 | 16 | return $var->{$key}; |
17 | 17 | } elseif (is_array($var)) { |
18 | - return $var[$key]; |
|
18 | + return $var[ $key ]; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | return $var; |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | -if (! function_exists('is_domain')) { |
|
25 | +if (!function_exists('is_domain')) { |
|
26 | 26 | /** |
27 | 27 | * Determines the current domain equals to the given domain identifier. |
28 | 28 | * |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -if (! function_exists('app_url')) { |
|
38 | +if (!function_exists('app_url')) { |
|
39 | 39 | /** |
40 | 40 | * Generate an URL for the application. |
41 | 41 | * |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | function app_url($path = '', $parameters = null, $identifier = 'site') |
48 | 48 | { |
49 | 49 | $path = trim($path, '/'); |
50 | - if (! empty($path) && ! starts_with($path, ['?', '&', '#'])) { |
|
50 | + if (!empty($path) && !starts_with($path, [ '?', '&', '#' ])) { |
|
51 | 51 | $path = '/'.$path; |
52 | 52 | } |
53 | 53 | |
54 | - if (! is_null($parameters)) { |
|
54 | + if (!is_null($parameters)) { |
|
55 | 55 | $query = http_build_query($parameters); |
56 | - if (! empty($query)) { |
|
57 | - $path .= (str_contains($path, ['?', '&', '#']) ? '&' : '?').$query; |
|
56 | + if (!empty($query)) { |
|
57 | + $path .= (str_contains($path, [ '?', '&', '#' ]) ? '&' : '?').$query; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | -if (! function_exists('revision')) { |
|
69 | +if (!function_exists('revision')) { |
|
70 | 70 | /** |
71 | 71 | * Get the revisioned asset path. |
72 | 72 | * |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
86 | -if (! function_exists('asset_from')) { |
|
86 | +if (!function_exists('asset_from')) { |
|
87 | 87 | /** |
88 | 88 | * Generate the URL to an asset from a custom root domain such as CDN, etc. |
89 | 89 | * |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | -if (! function_exists('asset_url')) { |
|
101 | +if (!function_exists('asset_url')) { |
|
102 | 102 | /** |
103 | 103 | * Generate an asset URL. |
104 | 104 | * |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | -if (! function_exists('cdn_url')) { |
|
118 | +if (!function_exists('cdn_url')) { |
|
119 | 119 | /** |
120 | 120 | * Generate an asset CDN URL. |
121 | 121 | * |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | -if (! function_exists('gravatar')) { |
|
131 | +if (!function_exists('gravatar')) { |
|
132 | 132 | /** |
133 | 133 | * Generate a Gravatar url. |
134 | 134 | * |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | -if (! function_exists('optimus_encode')) { |
|
161 | +if (!function_exists('optimus_encode')) { |
|
162 | 162 | /** |
163 | 163 | * Encode a number with Optimus. |
164 | 164 | * |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | -if (! function_exists('optimus_decode')) { |
|
174 | +if (!function_exists('optimus_decode')) { |
|
175 | 175 | /** |
176 | 176 | * Decode a number with Optimus. |
177 | 177 | * |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | -if (! function_exists('random_uuid')) { |
|
187 | +if (!function_exists('random_uuid')) { |
|
188 | 188 | /** |
189 | 189 | * Generate a version 4 (random) UUID. |
190 | 190 | * |