for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Firesphere\GraphQLJWT\Helpers;
class PathResolver
{
/**
* Return an absolute path from a relative one
* If the path doesn't exist, returns null
*
* @param string $path
* @param string $base
* @return string|null
*/
public static function resolve(string $path, string $base = BASE_PATH): ?string
if (strstr($path, '/') !== 0) {
$path = $base . '/' . $path;
}
return realpath($path) ?: null;