Skip to content

Instantly share code, notes, and snippets.

@sobanvuex
Created September 11, 2019 20:54
Show Gist options
  • Save sobanvuex/86b7771f82b4b9050585f9e6a2565dea to your computer and use it in GitHub Desktop.
Save sobanvuex/86b7771f82b4b9050585f9e6a2565dea to your computer and use it in GitHub Desktop.
<?php
if (!function_exists('path')) {
/**
* Get the path to the app folder.
*
* @param null|string $path
* @param string ...$argv
*
* @return string
*/
function path(string $path = null, string ...$argv): string
{
return __DIR__ . (
$path ? (
DIRECTORY_SEPARATOR . $path . (
$argv ? (
DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $argv)
) : ''
)
) : ''
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment