Skip to content

Commit 20959bc

Browse files
author
Fredrick Peter
committed
update
1 parent 9a53aae commit 20959bc

File tree

2 files changed

+19
-41
lines changed

2 files changed

+19
-41
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ http://domain.com/public/storage/[asset_file]
7070

7171
- or -- `Helpers Function`
7272
```
73-
asset_config('public');
73+
config_asset('public');
7474
```
7575

7676
### Asset Cache
@@ -234,7 +234,7 @@ autoload_register(['folder', 'folder2]);
234234
| env_update() | Same as `Env::updateENV` method |
235235
| server() | Return instance of `(new Server)` class |
236236
| asset() | Return Absolute path of asset. Same as `Asset::asset()` |
237-
| asset_config() | Same as `Asset::config()`. Configure Asset root directory |
237+
| config_asset() | Same as `Asset::config()`. Configure Asset root directory |
238238
| base_path() | Get absolute base directory path. It accepts a param as `string` if given, will be appended to the path |
239239
| directory() | Same as `base_path()` just naming difference |
240240
| domain() | Similar to `base_path()` as it returns domain URI. Also accepts path given and this will append to the endpoint of URL. |

helpers.php

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ function config($key, $default = null)
191191
* - If .env was not used,
192192
* - Then it will get all App Configuration Data as well
193193
*
194-
* @param string $key
194+
* @param string|null $key
195195
* - [optional] ENV KEY or APP Configuration Key
196196
*
197197
* @param mixed $value
198198
* - [optional] Default value if key not found
199199
*
200200
* @return mixed
201201
*/
202-
function env(?string $key = null, mixed $value = null)
202+
function env($key = null, $value = null)
203203
{
204204
return Env::env($key, $value);
205205
}
@@ -209,9 +209,9 @@ function env(?string $key = null, mixed $value = null)
209209
/**
210210
* Update Environment [path .env] variables
211211
*
212-
* @param string $key \Environment key you want to update
212+
* @param string|null $key \Environment key you want to update
213213
*
214-
* @param string|bool $value \Value of Variable to update
214+
* @param string|bool|null $value \Value of Variable to update
215215
*
216216
* @param bool $quote \Default is true
217217
* [optional] Allow quotes around values
@@ -221,7 +221,7 @@ function env(?string $key = null, mixed $value = null)
221221
*
222222
* @return bool
223223
*/
224-
function env_update(?string $key = null, string|bool $value = null, ?bool $quote = true, ?bool $space = false)
224+
function env_update($key = null, $value = null, ?bool $quote = true, ?bool $space = false)
225225
{
226226
return Env::updateENV($key, $value, $quote, $space);
227227
}
@@ -244,33 +244,11 @@ function asset($asset = null, ?bool $cache = false)
244244
}
245245
}
246246

247-
if (! function_exists('asset_config')) {
248-
/**
249-
* Configure Assets Default Directory
250-
*
251-
* @param string $base_path
252-
* - [optional] Default is `base_directory/assets`
253-
* - If set and directory is not found, then we revert back to the default
254-
*
255-
* @param string $cache
256-
* - [optional] Default is false
257-
* - End point of link `?v=xxxxxxxx` is with cache of file time change
258-
* - This will automatically tells the broswer to fetch new file if the time change
259-
* - Time will only change if you make changes or modify the request file
260-
*
261-
* @return void
262-
*/
263-
function asset_config($base_path = null, ?bool $cache = false)
264-
{
265-
Asset::config($base_path, $cache);
266-
}
267-
}
268-
269247
if (! function_exists('config_asset')) {
270248
/**
271249
* Configure Assets Default Directory
272250
*
273-
* @param string $base_path
251+
* @param string|null $base_path
274252
* - [optional] Default is `base_directory/assets`
275253
* - If set and directory is not found, then we revert back to the default
276254
*
@@ -284,7 +262,7 @@ function asset_config($base_path = null, ?bool $cache = false)
284262
*/
285263
function config_asset($base_path = null, ?bool $cache = true)
286264
{
287-
asset_config($base_path, $cache);
265+
Asset::config($base_path, $cache);
288266
}
289267
}
290268

@@ -309,7 +287,7 @@ function __($key = null, $locale = null)
309287
if (! function_exists('base_path')) {
310288
/**
311289
* Get Base Directory `Path`
312-
* @param string $path
290+
* @param string|null $path
313291
* - [optional] You can pass a path to include with the base directory
314292
* - Final result: i.e C:/server_path/path
315293
*
@@ -324,7 +302,7 @@ function base_path($path = null)
324302
if (! function_exists('directory')) {
325303
/**
326304
* Get Base Directory `Path`
327-
* @param string $path
305+
* @param string|null $path
328306
* - [optional] You can pass a path to include with the base directory
329307
* - Final result: i.e C:/server_path/path
330308
*
@@ -339,7 +317,7 @@ function directory($path = null)
339317
if (! function_exists('storage_path')) {
340318
/**
341319
* Get Storage Directory `Path`
342-
* @param string $path
320+
* @param string|null $path
343321
* - [optional] You can pass a path to include with the base directory
344322
* - Final result: i.e C:/storage/path
345323
*
@@ -354,7 +332,7 @@ function storage_path($path = null)
354332
if (! function_exists('public_path')) {
355333
/**
356334
* Get Public Directory `Path`
357-
* @param string $path
335+
* @param string|null $path
358336
* - [optional] You can pass a path to include with the base directory
359337
* - Final result: i.e C:/public/path
360338
*
@@ -369,7 +347,7 @@ function public_path($path = null)
369347
if (! function_exists('app_path')) {
370348
/**
371349
* Get Storage Directory `Path`
372-
* @param string $path
350+
* @param string|null $path
373351
* - [optional] You can pass a path to include with the base directory
374352
* - Final result: i.e C:/app/path
375353
*
@@ -384,7 +362,7 @@ function app_path($path = null)
384362
if (! function_exists('config_path')) {
385363
/**
386364
* Get Config Directory `Path`
387-
* @param string $path
365+
* @param string|null $path
388366
* - [optional] You can pass a path to include with the base directory
389367
* - Final result: i.e C:/server_path/path
390368
*
@@ -399,7 +377,7 @@ function config_path($path = null)
399377
if (! function_exists('lang_path')) {
400378
/**
401379
* Get Config Directory `Path`
402-
* @param string $path
380+
* @param string|null $path
403381
* - [optional] You can pass a path to include with the base directory
404382
* - Final result: i.e C:/lang/path
405383
*
@@ -415,7 +393,7 @@ function lang_path($path = null)
415393
/**
416394
* Get Domain `URL` URI
417395
*
418-
* @param string $path
396+
* @param string|null $path
419397
* - [optional] You can pass a path to include with the domain link
420398
* - Final result: i.e https://domain.com/path
421399
*
@@ -435,7 +413,7 @@ function domain($path = null)
435413
* @param mixed $value
436414
* @return array
437415
*/
438-
function to_array(mixed $value)
416+
function to_array($value)
439417
{
440418
return server()->toArray($value);
441419
}
@@ -448,7 +426,7 @@ function to_array(mixed $value)
448426
* @param mixed $value
449427
* @return object
450428
*/
451-
function to_object(mixed $value)
429+
function to_object($value)
452430
{
453431
return server()->toObject($value);
454432
}

0 commit comments

Comments
 (0)