diff --git a/app/FileSystem.php b/app/FileSystem.php index 94a88aa..8661bd3 100644 --- a/app/FileSystem.php +++ b/app/FileSystem.php @@ -13,8 +13,16 @@ namespace Sakura; */ class FileSystem { + /** + * Cached copy of the root path. + * @var string + */ private static $rootPath = null; + /** + * Resolves the root path. + * @return string + */ public static function getRootPath() { if (self::$rootPath === null) { @@ -25,11 +33,19 @@ class FileSystem return self::$rootPath; } + /** + * Fixes a given path to the correct slashes and root. + * @return string + */ public static function getPath($path) { return self::getRootPath() . DIRECTORY_SEPARATOR . self::fixSlashes($path); } + /** + * Fixes slashes. + * @return string + */ private static function fixSlashes($path) { return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);