Skip to content

Commit

Permalink
Use correct spelling for "normalize" in PathResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Thomson committed Sep 15, 2020
1 parent 29c3dcc commit e2ed5fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Filesystem/PathResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function resolve($path)
}

// Split path into segments
$pathSegments = explode('/', static::normalisePath($path));
$pathSegments = explode('/', static::normalizePath($path));

// Store Windows drive, if available, for final resolved path.
$drive = array_shift($pathSegments) ?: null;
Expand Down Expand Up @@ -115,15 +115,15 @@ public static function within($path, $directory)
}

/**
* Normalises a given path.
* Normalizes a given path.
*
* Converts any type of path (Unix or Windows) into a Unix-style path, so that we have a consistent format to work
* with.
*
* @param string $path
* @return string
*/
protected static function normalisePath($path)
protected static function normalizePath($path)
{
// Change directory separators to Unix-based
$path = str_replace('\\', '/', $path);
Expand All @@ -135,7 +135,7 @@ protected static function normalisePath($path)

// Prepend current working directory for relative paths
if (substr($path, 0, 1) !== '/' && is_null($drive)) {
$path = static::normalisePath(getcwd()) . '/' . $path;
$path = static::normalizePath(getcwd()) . '/' . $path;
}

return $path;
Expand Down Expand Up @@ -173,7 +173,7 @@ protected static function resolveSymlink($symlink)
$target = static::resolve($directory . $target);
}

return static::normalisePath($target);
return static::normalizePath($target);
}

/**
Expand All @@ -194,7 +194,7 @@ protected static function withinOpenBaseDir($path)
$found = false;

foreach ($baseDirs as $baseDir) {
if (starts_with(static::normalisePath($path), static::normalisePath($baseDir))) {
if (starts_with(static::normalizePath($path), static::normalizePath($baseDir))) {
$found = true;
break;
}
Expand Down

0 comments on commit e2ed5fb

Please sign in to comment.