Updated Symfony\Filesystem to version 6.2.5

This commit is contained in:
Netkas 2023-02-24 21:46:51 -05:00
parent 7f73c45920
commit 177b6b5238
5 changed files with 35 additions and 35 deletions

View file

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.2] - Unreleased
### Changed
- Updated `Symfony\Filesystem` to version 6.2.5
## [1.0.1] - 2023-02-07

View file

@ -29,9 +29,6 @@ class IOException extends \RuntimeException implements IOExceptionInterface
parent::__construct($message, $code, $previous);
}
/**
* {@inheritdoc}
*/
public function getPath(): ?string
{
return $this->path;

View file

@ -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
of this software and associated documentation files (the "Software"), to deal

View file

@ -81,7 +81,7 @@ final class Path
// Replace "~" with user's home directory.
if ('~' === $path[0]) {
$path = self::getHomeDirectory().mb_substr($path, 1);
$path = self::getHomeDirectory().substr($path, 1);
}
$path = self::normalize($path);
@ -151,14 +151,14 @@ final class Path
$path = self::canonicalize($path);
// Maintain scheme
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
$scheme = mb_substr($path, 0, $schemeSeparatorPosition + 3);
$path = mb_substr($path, $schemeSeparatorPosition + 3);
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
$scheme = substr($path, 0, $schemeSeparatorPosition + 3);
$path = substr($path, $schemeSeparatorPosition + 3);
} else {
$scheme = '';
}
if (false === ($dirSeparatorPosition = strrpos($path, '/'))) {
if (false === $dirSeparatorPosition = strrpos($path, '/')) {
return '';
}
@ -169,10 +169,10 @@ final class Path
// Directory equals Windows root "C:/"
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
if (false !== ($schemeSeparatorPosition = strpos($path, '://'))) {
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
$scheme = substr($path, 0, $schemeSeparatorPosition + 3);
$path = substr($path, $schemeSeparatorPosition + 3);
} else {
@ -233,7 +233,7 @@ final class Path
return $scheme.'/';
}
$length = mb_strlen($path);
$length = \strlen($path);
// Windows root
if ($length > 1 && ':' === $path[1] && ctype_alpha($firstCharacter)) {
@ -349,16 +349,16 @@ final class Path
$extension = ltrim($extension, '.');
// No extension for paths
if ('/' === mb_substr($path, -1)) {
if ('/' === substr($path, -1)) {
return $path;
}
// No actual extension in path
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
@ -368,8 +368,8 @@ final class Path
}
// Strip scheme
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
$path = mb_substr($path, $schemeSeparatorPosition + 3);
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
$path = substr($path, $schemeSeparatorPosition + 3);
}
$firstCharacter = $path[0];
@ -380,9 +380,9 @@ final class Path
}
// Windows root
if (mb_strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) {
if (\strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) {
// Special case: "C:"
if (2 === mb_strlen($path)) {
if (2 === \strlen($path)) {
return true;
}
@ -451,9 +451,9 @@ final class Path
return self::canonicalize($path);
}
if (false !== ($schemeSeparatorPosition = mb_strpos($basePath, '://'))) {
$scheme = mb_substr($basePath, 0, $schemeSeparatorPosition + 3);
$basePath = mb_substr($basePath, $schemeSeparatorPosition + 3);
if (false !== $schemeSeparatorPosition = strpos($basePath, '://')) {
$scheme = substr($basePath, 0, $schemeSeparatorPosition + 3);
$basePath = substr($basePath, $schemeSeparatorPosition + 3);
} else {
$scheme = '';
}
@ -671,7 +671,7 @@ final class Path
}
// 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 .= '/';
}
@ -721,7 +721,7 @@ final class Path
}
/**
* @return non-empty-string[]
* @return string[]
*/
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
if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) {
$root = mb_substr($path, 0, $schemeSeparatorPosition + 3);
$path = mb_substr($path, $schemeSeparatorPosition + 3);
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
$root = substr($path, 0, $schemeSeparatorPosition + 3);
$path = substr($path, $schemeSeparatorPosition + 3);
} else {
$root = '';
}
$length = mb_strlen($path);
$length = \strlen($path);
// Remove and remember root directory
if (str_starts_with($path, '/')) {
$root .= '/';
$path = $length > 1 ? mb_substr($path, 1) : '';
$path = $length > 1 ? substr($path, 1) : '';
} elseif ($length > 1 && ctype_alpha($path[0]) && ':' === $path[1]) {
if (2 === $length) {
// Windows special case: "C:"
@ -796,8 +796,8 @@ final class Path
$path = '';
} elseif ('/' === $path[2]) {
// Windows normal case: "C:/"..
$root .= mb_substr($path, 0, 3);
$path = $length > 3 ? mb_substr($path, 3) : '';
$root .= substr($path, 0, 3);
$path = $length > 3 ? substr($path, 3) : '';
}
}
@ -806,11 +806,11 @@ final class Path
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 strtolower($string, $encoding);
return strtolower($string);
}
private function __construct()

View file

@ -1 +1 @@
6.1.3
6.2.5