From 492636581780bed8b136ad217bf7da99ef663a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 12 Nov 2025 21:25:11 +0100 Subject: [PATCH 1/4] fix: Review the exposed API --- UPGRADE.md | 3 ++- src/FileSystem.php | 10 ++-------- src/SymfonyFileSystem.php | 2 ++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index f2f053c..0d02612 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,4 +2,5 @@ - The class `FileSystem` was renamed `NativeFileSystem`. `FileSystem` is now an interface. -- Deprecated the `::getFileContents()` method in favour of the `::readFile()`. +- Deprecated the `::getFileContents()` method in favour of `::readFile()`. +- Deprecated the `::isRelativePath()` method in favour of `Path::isRelativePath()`. diff --git a/src/FileSystem.php b/src/FileSystem.php index ba048fc..d8750ba 100644 --- a/src/FileSystem.php +++ b/src/FileSystem.php @@ -52,19 +52,13 @@ interface FileSystem extends SymfonyFileSystem { /** - * Returns whether a path is relative. - * - * @param string $path a path string - * - * @return bool returns true if the path is relative or empty, false if - * it is absolute + * @deprecated Deprecated since 2.0. Use `Path::isRelativePath()` instead. Will be removed in 3.0. + * @see Path::isRelativePath */ public function isRelativePath(string $path): bool; public function escapePath(string $path): string; - public function dumpFile(string $filename, $content = ''): void; - /** * @deprecated Use the `::readFile()` method. Deprecated since 2.0 and it will be removed in 3.0. * @see readFile diff --git a/src/SymfonyFileSystem.php b/src/SymfonyFileSystem.php index ea0144f..a8c3112 100644 --- a/src/SymfonyFileSystem.php +++ b/src/SymfonyFileSystem.php @@ -224,6 +224,8 @@ public function mirror(string $originDir, string $targetDir, ?Traversable $itera /** * Returns whether the file path is an absolute path. + * + * @deprecated Deprecated since 2.0. Use `Path::isAbsolute()` instead. */ public function isAbsolutePath(string $file): bool; From f3ede125336e302a7bca3b46b20bab6e765b3a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 12 Nov 2025 21:27:32 +0100 Subject: [PATCH 2/4] fix doc --- UPGRADE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index 0d02612..205a0c9 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,4 +3,5 @@ - The class `FileSystem` was renamed `NativeFileSystem`. `FileSystem` is now an interface. - Deprecated the `::getFileContents()` method in favour of `::readFile()`. -- Deprecated the `::isRelativePath()` method in favour of `Path::isRelativePath()`. +- Deprecated the `::isAbsolutePath()` method in favour of `Path::isAbsolute()`. +- Deprecated the `::isRelativePath()` method in favour of `Path::isRelative()`. From 180152f9abd42c3bb92893988e876ffb8495666a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 12 Nov 2025 21:28:14 +0100 Subject: [PATCH 3/4] fix typo --- src/FileSystem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FileSystem.php b/src/FileSystem.php index d8750ba..68776cb 100644 --- a/src/FileSystem.php +++ b/src/FileSystem.php @@ -52,8 +52,8 @@ interface FileSystem extends SymfonyFileSystem { /** - * @deprecated Deprecated since 2.0. Use `Path::isRelativePath()` instead. Will be removed in 3.0. - * @see Path::isRelativePath + * @deprecated Deprecated since 2.0. Use `Path::isRelative()` instead. Will be removed in 3.0. + * @see Path::isRelative */ public function isRelativePath(string $path): bool; From b83bd8f9e07d3262c6633a916ee62b94b9b3a114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 12 Nov 2025 21:29:06 +0100 Subject: [PATCH 4/4] fix --- src/FileSystem.php | 4 ++-- src/SymfonyFileSystem.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/FileSystem.php b/src/FileSystem.php index 68776cb..2ae2935 100644 --- a/src/FileSystem.php +++ b/src/FileSystem.php @@ -53,7 +53,7 @@ interface FileSystem extends SymfonyFileSystem { /** * @deprecated Deprecated since 2.0. Use `Path::isRelative()` instead. Will be removed in 3.0. - * @see Path::isRelative + * @see Path::isRelative()) */ public function isRelativePath(string $path): bool; @@ -61,7 +61,7 @@ public function escapePath(string $path): string; /** * @deprecated Use the `::readFile()` method. Deprecated since 2.0 and it will be removed in 3.0. - * @see readFile + * @see SymfonyFileSystem::readFile() * * @throws IOException If the file cannot be read */ diff --git a/src/SymfonyFileSystem.php b/src/SymfonyFileSystem.php index a8c3112..3aa1783 100644 --- a/src/SymfonyFileSystem.php +++ b/src/SymfonyFileSystem.php @@ -226,6 +226,7 @@ public function mirror(string $originDir, string $targetDir, ?Traversable $itera * Returns whether the file path is an absolute path. * * @deprecated Deprecated since 2.0. Use `Path::isAbsolute()` instead. + * @see Path::isAbsolute() */ public function isAbsolutePath(string $file): bool;