| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | 3 | use IlluminateAgnostic\Str\Support\Arr; | 
| 4 | -use IlluminateAgnostic\Str\Support\Str; | |
| 5 | 4 | use IlluminateAgnostic\Str\Support\Collection; | 
| 6 | 5 | use IlluminateAgnostic\Str\Support\Debug\Dumper; | 
| 6 | +use IlluminateAgnostic\Str\Support\Str; | |
| 7 | 7 | |
| 8 | 8 |  if (! class_exists(Illuminate\Support\Collection::class)) { | 
| 9 | 9 |      if (! function_exists('camel_case')) { | 
| @@ -5,8 +5,8 @@ discard block | ||
| 5 | 5 | use IlluminateAgnostic\Str\Support\Collection; | 
| 6 | 6 | use IlluminateAgnostic\Str\Support\Debug\Dumper; | 
| 7 | 7 | |
| 8 | -if (! class_exists(Illuminate\Support\Collection::class)) { | |
| 9 | -    if (! function_exists('camel_case')) { | |
| 8 | +if (!class_exists(Illuminate\Support\Collection::class)) { | |
| 9 | +    if (!function_exists('camel_case')) { | |
| 10 | 10 | /** | 
| 11 | 11 | * Convert a value to camel case. | 
| 12 | 12 | * | 
| @@ -19,7 +19,7 @@ discard block | ||
| 19 | 19 | } | 
| 20 | 20 | } | 
| 21 | 21 | |
| 22 | -    if (! function_exists('collect')) { | |
| 22 | +    if (!function_exists('collect')) { | |
| 23 | 23 | /** | 
| 24 | 24 | * Create a collection from the given value. | 
| 25 | 25 | * | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | } | 
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | -    if (! function_exists('data_get')) { | |
| 35 | +    if (!function_exists('data_get')) { | |
| 36 | 36 | /** | 
| 37 | 37 | * Get an item from an array or object using "dot" notation. | 
| 38 | 38 | * | 
| @@ -49,11 +49,11 @@ discard block | ||
| 49 | 49 | |
| 50 | 50 |              $key = is_array($key) ? $key : explode('.', $key); | 
| 51 | 51 | |
| 52 | -            while (! is_null($segment = array_shift($key))) { | |
| 52 | +            while (!is_null($segment = array_shift($key))) { | |
| 53 | 53 |                  if ($segment === '*') { | 
| 54 | 54 |                      if ($target instanceof Collection) { | 
| 55 | 55 | $target = $target->all(); | 
| 56 | -                    } elseif (! is_array($target)) { | |
| 56 | +                    } elseif (!is_array($target)) { | |
| 57 | 57 | return value($default); | 
| 58 | 58 | } | 
| 59 | 59 | |
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | } | 
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | -    if (! function_exists('ends_with')) { | |
| 78 | +    if (!function_exists('ends_with')) { | |
| 79 | 79 | /** | 
| 80 | 80 | * Determine if a given string ends with a given substring. | 
| 81 | 81 | * | 
| @@ -89,7 +89,7 @@ discard block | ||
| 89 | 89 | } | 
| 90 | 90 | } | 
| 91 | 91 | |
| 92 | -    if (! function_exists('kebab_case')) { | |
| 92 | +    if (!function_exists('kebab_case')) { | |
| 93 | 93 | /** | 
| 94 | 94 | * Convert a string to kebab case. | 
| 95 | 95 | * | 
| @@ -103,7 +103,7 @@ discard block | ||
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | 105 | |
| 106 | -    if (! function_exists('snake_case')) { | |
| 106 | +    if (!function_exists('snake_case')) { | |
| 107 | 107 | /** | 
| 108 | 108 | * Convert a string to snake case. | 
| 109 | 109 | * | 
| @@ -117,7 +117,7 @@ discard block | ||
| 117 | 117 | } | 
| 118 | 118 | } | 
| 119 | 119 | |
| 120 | -    if (! function_exists('starts_with')) { | |
| 120 | +    if (!function_exists('starts_with')) { | |
| 121 | 121 | /** | 
| 122 | 122 | * Determine if a given string starts with a given substring. | 
| 123 | 123 | * | 
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | } | 
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | -    if (! function_exists('str_after')) { | |
| 134 | +    if (!function_exists('str_after')) { | |
| 135 | 135 | /** | 
| 136 | 136 | * Return the remainder of a string after a given value. | 
| 137 | 137 | * | 
| @@ -145,7 +145,7 @@ discard block | ||
| 145 | 145 | } | 
| 146 | 146 | } | 
| 147 | 147 | |
| 148 | -    if (! function_exists('str_before')) { | |
| 148 | +    if (!function_exists('str_before')) { | |
| 149 | 149 | /** | 
| 150 | 150 | * Get the portion of a string before a given value. | 
| 151 | 151 | * | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | } | 
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | -    if (! function_exists('str_contains')) { | |
| 162 | +    if (!function_exists('str_contains')) { | |
| 163 | 163 | /** | 
| 164 | 164 | * Determine if a given string contains a given substring. | 
| 165 | 165 | * | 
| @@ -173,7 +173,7 @@ discard block | ||
| 173 | 173 | } | 
| 174 | 174 | } | 
| 175 | 175 | |
| 176 | -    if (! function_exists('str_finish')) { | |
| 176 | +    if (!function_exists('str_finish')) { | |
| 177 | 177 | /** | 
| 178 | 178 | * Cap a string with a single instance of a given value. | 
| 179 | 179 | * | 
| @@ -187,7 +187,7 @@ discard block | ||
| 187 | 187 | } | 
| 188 | 188 | } | 
| 189 | 189 | |
| 190 | -    if (! function_exists('str_is')) { | |
| 190 | +    if (!function_exists('str_is')) { | |
| 191 | 191 | /** | 
| 192 | 192 | * Determine if a given string matches a given pattern. | 
| 193 | 193 | * | 
| @@ -201,7 +201,7 @@ discard block | ||
| 201 | 201 | } | 
| 202 | 202 | } | 
| 203 | 203 | |
| 204 | -    if (! function_exists('str_limit')) { | |
| 204 | +    if (!function_exists('str_limit')) { | |
| 205 | 205 | /** | 
| 206 | 206 | * Limit the number of characters in a string. | 
| 207 | 207 | * | 
| @@ -216,7 +216,7 @@ discard block | ||
| 216 | 216 | } | 
| 217 | 217 | } | 
| 218 | 218 | |
| 219 | -    if (! function_exists('str_plural')) { | |
| 219 | +    if (!function_exists('str_plural')) { | |
| 220 | 220 | /** | 
| 221 | 221 | * Get the plural form of an English word. | 
| 222 | 222 | * | 
| @@ -230,7 +230,7 @@ discard block | ||
| 230 | 230 | } | 
| 231 | 231 | } | 
| 232 | 232 | |
| 233 | -    if (! function_exists('str_random')) { | |
| 233 | +    if (!function_exists('str_random')) { | |
| 234 | 234 | /** | 
| 235 | 235 | * Generate a more truly "random" alpha-numeric string. | 
| 236 | 236 | * | 
| @@ -245,7 +245,7 @@ discard block | ||
| 245 | 245 | } | 
| 246 | 246 | } | 
| 247 | 247 | |
| 248 | -    if (! function_exists('str_replace_array')) { | |
| 248 | +    if (!function_exists('str_replace_array')) { | |
| 249 | 249 | /** | 
| 250 | 250 | * Replace a given value in the string sequentially with an array. | 
| 251 | 251 | * | 
| @@ -260,7 +260,7 @@ discard block | ||
| 260 | 260 | } | 
| 261 | 261 | } | 
| 262 | 262 | |
| 263 | -    if (! function_exists('str_replace_first')) { | |
| 263 | +    if (!function_exists('str_replace_first')) { | |
| 264 | 264 | /** | 
| 265 | 265 | * Replace the first occurrence of a given value in the string. | 
| 266 | 266 | * | 
| @@ -275,7 +275,7 @@ discard block | ||
| 275 | 275 | } | 
| 276 | 276 | } | 
| 277 | 277 | |
| 278 | -    if (! function_exists('str_replace_last')) { | |
| 278 | +    if (!function_exists('str_replace_last')) { | |
| 279 | 279 | /** | 
| 280 | 280 | * Replace the last occurrence of a given value in the string. | 
| 281 | 281 | * | 
| @@ -290,7 +290,7 @@ discard block | ||
| 290 | 290 | } | 
| 291 | 291 | } | 
| 292 | 292 | |
| 293 | -    if (! function_exists('str_singular')) { | |
| 293 | +    if (!function_exists('str_singular')) { | |
| 294 | 294 | /** | 
| 295 | 295 | * Get the singular form of an English word. | 
| 296 | 296 | * | 
| @@ -303,7 +303,7 @@ discard block | ||
| 303 | 303 | } | 
| 304 | 304 | } | 
| 305 | 305 | |
| 306 | -    if (! function_exists('str_slug')) { | |
| 306 | +    if (!function_exists('str_slug')) { | |
| 307 | 307 | /** | 
| 308 | 308 | * Generate a URL friendly "slug" from a given string. | 
| 309 | 309 | * | 
| @@ -318,7 +318,7 @@ discard block | ||
| 318 | 318 | } | 
| 319 | 319 | } | 
| 320 | 320 | |
| 321 | -    if (! function_exists('str_start')) { | |
| 321 | +    if (!function_exists('str_start')) { | |
| 322 | 322 | /** | 
| 323 | 323 | * Begin a string with a single instance of a given value. | 
| 324 | 324 | * | 
| @@ -332,7 +332,7 @@ discard block | ||
| 332 | 332 | } | 
| 333 | 333 | } | 
| 334 | 334 | |
| 335 | -    if (! function_exists('studly_case')) { | |
| 335 | +    if (!function_exists('studly_case')) { | |
| 336 | 336 | /** | 
| 337 | 337 | * Convert a value to studly caps case. | 
| 338 | 338 | * | 
| @@ -346,7 +346,7 @@ discard block | ||
| 346 | 346 | } | 
| 347 | 347 | |
| 348 | 348 | |
| 349 | -    if (! function_exists('title_case')) { | |
| 349 | +    if (!function_exists('title_case')) { | |
| 350 | 350 | /** | 
| 351 | 351 | * Convert a value to title case. | 
| 352 | 352 | * | 
| @@ -360,7 +360,7 @@ discard block | ||
| 360 | 360 | } | 
| 361 | 361 | |
| 362 | 362 | |
| 363 | -    if (! function_exists('value')) { | |
| 363 | +    if (!function_exists('value')) { | |
| 364 | 364 | /** | 
| 365 | 365 | * Return the default value of the given value. | 
| 366 | 366 | * | 
| @@ -374,7 +374,7 @@ discard block | ||
| 374 | 374 | } | 
| 375 | 375 | |
| 376 | 376 | |
| 377 | -    if (! function_exists('dd')) { | |
| 377 | +    if (!function_exists('dd')) { | |
| 378 | 378 | /** | 
| 379 | 379 | * Dump the passed variables and end the script. | 
| 380 | 380 | * |