Updated Symfony\Filesystem
to version 6.2.5
This commit is contained in:
parent
7f73c45920
commit
177b6b5238
5 changed files with 35 additions and 35 deletions
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [1.0.2] - Unreleased
|
## [1.0.2] - Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Updated `Symfony\Filesystem` to version 6.2.5
|
||||||
|
|
||||||
|
|
||||||
## [1.0.1] - 2023-02-07
|
## [1.0.1] - 2023-02-07
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,6 @@ class IOException extends \RuntimeException implements IOExceptionInterface
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getPath(): ?string
|
public function getPath(): ?string
|
||||||
{
|
{
|
||||||
return $this->path;
|
return $this->path;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2004-2022 Fabien Potencier
|
Copyright (c) 2004-2023 Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
60
src/ncc/ThirdParty/Symfony/Filesystem/Path.php
vendored
60
src/ncc/ThirdParty/Symfony/Filesystem/Path.php
vendored
|
@ -81,7 +81,7 @@ final class Path
|
||||||
|
|
||||||
// Replace "~" with user's home directory.
|
// Replace "~" with user's home directory.
|
||||||
if ('~' === $path[0]) {
|
if ('~' === $path[0]) {
|
||||||
$path = self::getHomeDirectory().mb_substr($path, 1);
|
$path = self::getHomeDirectory().substr($path, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = self::normalize($path);
|
$path = self::normalize($path);
|
||||||
|
@ -151,14 +151,14 @@ final class Path
|
||||||
$path = self::canonicalize($path);
|
$path = self::canonicalize($path);
|
||||||
|
|
||||||
// Maintain scheme
|
// Maintain scheme
|
||||||
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
|
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
|
||||||
$scheme = mb_substr($path, 0, $schemeSeparatorPosition + 3);
|
$scheme = substr($path, 0, $schemeSeparatorPosition + 3);
|
||||||
$path = mb_substr($path, $schemeSeparatorPosition + 3);
|
$path = substr($path, $schemeSeparatorPosition + 3);
|
||||||
} else {
|
} else {
|
||||||
$scheme = '';
|
$scheme = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === ($dirSeparatorPosition = strrpos($path, '/'))) {
|
if (false === $dirSeparatorPosition = strrpos($path, '/')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,10 +169,10 @@ final class Path
|
||||||
|
|
||||||
// Directory equals Windows root "C:/"
|
// Directory equals Windows root "C:/"
|
||||||
if (2 === $dirSeparatorPosition && ctype_alpha($path[0]) && ':' === $path[1]) {
|
if (2 === $dirSeparatorPosition && ctype_alpha($path[0]) && ':' === $path[1]) {
|
||||||
return $scheme.mb_substr($path, 0, 3);
|
return $scheme.substr($path, 0, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scheme.mb_substr($path, 0, $dirSeparatorPosition);
|
return $scheme.substr($path, 0, $dirSeparatorPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -219,7 +219,7 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maintain scheme
|
// Maintain scheme
|
||||||
if (false !== ($schemeSeparatorPosition = strpos($path, '://'))) {
|
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
|
||||||
$scheme = substr($path, 0, $schemeSeparatorPosition + 3);
|
$scheme = substr($path, 0, $schemeSeparatorPosition + 3);
|
||||||
$path = substr($path, $schemeSeparatorPosition + 3);
|
$path = substr($path, $schemeSeparatorPosition + 3);
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,7 +233,7 @@ final class Path
|
||||||
return $scheme.'/';
|
return $scheme.'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
$length = mb_strlen($path);
|
$length = \strlen($path);
|
||||||
|
|
||||||
// Windows root
|
// Windows root
|
||||||
if ($length > 1 && ':' === $path[1] && ctype_alpha($firstCharacter)) {
|
if ($length > 1 && ':' === $path[1] && ctype_alpha($firstCharacter)) {
|
||||||
|
@ -349,16 +349,16 @@ final class Path
|
||||||
$extension = ltrim($extension, '.');
|
$extension = ltrim($extension, '.');
|
||||||
|
|
||||||
// No extension for paths
|
// No extension for paths
|
||||||
if ('/' === mb_substr($path, -1)) {
|
if ('/' === substr($path, -1)) {
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No actual extension in path
|
// No actual extension in path
|
||||||
if (empty($actualExtension)) {
|
if (empty($actualExtension)) {
|
||||||
return $path.('.' === mb_substr($path, -1) ? '' : '.').$extension;
|
return $path.('.' === substr($path, -1) ? '' : '.').$extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mb_substr($path, 0, -mb_strlen($actualExtension)).$extension;
|
return substr($path, 0, -\strlen($actualExtension)).$extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isAbsolute(string $path): bool
|
public static function isAbsolute(string $path): bool
|
||||||
|
@ -368,8 +368,8 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip scheme
|
// Strip scheme
|
||||||
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
|
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
|
||||||
$path = mb_substr($path, $schemeSeparatorPosition + 3);
|
$path = substr($path, $schemeSeparatorPosition + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
$firstCharacter = $path[0];
|
$firstCharacter = $path[0];
|
||||||
|
@ -380,9 +380,9 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Windows root
|
// Windows root
|
||||||
if (mb_strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) {
|
if (\strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) {
|
||||||
// Special case: "C:"
|
// Special case: "C:"
|
||||||
if (2 === mb_strlen($path)) {
|
if (2 === \strlen($path)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,9 +451,9 @@ final class Path
|
||||||
return self::canonicalize($path);
|
return self::canonicalize($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false !== ($schemeSeparatorPosition = mb_strpos($basePath, '://'))) {
|
if (false !== $schemeSeparatorPosition = strpos($basePath, '://')) {
|
||||||
$scheme = mb_substr($basePath, 0, $schemeSeparatorPosition + 3);
|
$scheme = substr($basePath, 0, $schemeSeparatorPosition + 3);
|
||||||
$basePath = mb_substr($basePath, $schemeSeparatorPosition + 3);
|
$basePath = substr($basePath, $schemeSeparatorPosition + 3);
|
||||||
} else {
|
} else {
|
||||||
$scheme = '';
|
$scheme = '';
|
||||||
}
|
}
|
||||||
|
@ -671,7 +671,7 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only add slash if previous part didn't end with '/' or '\'
|
// Only add slash if previous part didn't end with '/' or '\'
|
||||||
if (!\in_array(mb_substr($finalPath, -1), ['/', '\\'])) {
|
if (!\in_array(substr($finalPath, -1), ['/', '\\'])) {
|
||||||
$finalPath .= '/';
|
$finalPath .= '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -721,7 +721,7 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return non-empty-string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
private static function findCanonicalParts(string $root, string $pathWithoutRoot): array
|
private static function findCanonicalParts(string $root, string $pathWithoutRoot): array
|
||||||
{
|
{
|
||||||
|
@ -776,19 +776,19 @@ final class Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remember scheme as part of the root, if any
|
// Remember scheme as part of the root, if any
|
||||||
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
|
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
|
||||||
$root = mb_substr($path, 0, $schemeSeparatorPosition + 3);
|
$root = substr($path, 0, $schemeSeparatorPosition + 3);
|
||||||
$path = mb_substr($path, $schemeSeparatorPosition + 3);
|
$path = substr($path, $schemeSeparatorPosition + 3);
|
||||||
} else {
|
} else {
|
||||||
$root = '';
|
$root = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$length = mb_strlen($path);
|
$length = \strlen($path);
|
||||||
|
|
||||||
// Remove and remember root directory
|
// Remove and remember root directory
|
||||||
if (str_starts_with($path, '/')) {
|
if (str_starts_with($path, '/')) {
|
||||||
$root .= '/';
|
$root .= '/';
|
||||||
$path = $length > 1 ? mb_substr($path, 1) : '';
|
$path = $length > 1 ? substr($path, 1) : '';
|
||||||
} elseif ($length > 1 && ctype_alpha($path[0]) && ':' === $path[1]) {
|
} elseif ($length > 1 && ctype_alpha($path[0]) && ':' === $path[1]) {
|
||||||
if (2 === $length) {
|
if (2 === $length) {
|
||||||
// Windows special case: "C:"
|
// Windows special case: "C:"
|
||||||
|
@ -796,8 +796,8 @@ final class Path
|
||||||
$path = '';
|
$path = '';
|
||||||
} elseif ('/' === $path[2]) {
|
} elseif ('/' === $path[2]) {
|
||||||
// Windows normal case: "C:/"..
|
// Windows normal case: "C:/"..
|
||||||
$root .= mb_substr($path, 0, 3);
|
$root .= substr($path, 0, 3);
|
||||||
$path = $length > 3 ? mb_substr($path, 3) : '';
|
$path = $length > 3 ? substr($path, 3) : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,11 +806,11 @@ final class Path
|
||||||
|
|
||||||
private static function toLower(string $string): string
|
private static function toLower(string $string): string
|
||||||
{
|
{
|
||||||
if (false !== $encoding = mb_detect_encoding($string)) {
|
if (false !== $encoding = mb_detect_encoding($string, null, true)) {
|
||||||
return mb_strtolower($string, $encoding);
|
return mb_strtolower($string, $encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
return strtolower($string, $encoding);
|
return strtolower($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function __construct()
|
private function __construct()
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
6.1.3
|
6.2.5
|
Loading…
Add table
Reference in a new issue