From 3778836d6620f4d4ea6a02f0511a3ff1cc604f85 Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Tue, 21 Feb 2023 13:14:34 -0600 Subject: [PATCH] Added InvalidArgumentException --- lib/Filesystem.php | 5 +++-- lib/Filesystem/InvalidArgumentException.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 lib/Filesystem/InvalidArgumentException.php diff --git a/lib/Filesystem.php b/lib/Filesystem.php index fde0701..ec94879 100644 --- a/lib/Filesystem.php +++ b/lib/Filesystem.php @@ -10,6 +10,7 @@ declare(strict_types=1); namespace MensBeam; use MensBeam\Filesystem\{ FileNotFoundException, + InvalidArgumentException, IOException }; @@ -407,11 +408,11 @@ class Filesystem { */ public static function makePathRelative(string $endPath, string $startPath): string { if (!self::isAbsolutePath($startPath)) { - throw new \InvalidArgumentException(sprintf('The start path "%s" is not absolute.', $startPath)); + throw new InvalidArgumentException(sprintf('The start path "%s" is not absolute.', $startPath)); } if (!self::isAbsolutePath($endPath)) { - throw new \InvalidArgumentException(sprintf('The end path "%s" is not absolute.', $endPath)); + throw new InvalidArgumentException(sprintf('The end path "%s" is not absolute.', $endPath)); } // Normalize separators on Windows diff --git a/lib/Filesystem/InvalidArgumentException.php b/lib/Filesystem/InvalidArgumentException.php new file mode 100644 index 0000000..f3806b5 --- /dev/null +++ b/lib/Filesystem/InvalidArgumentException.php @@ -0,0 +1,16 @@ + + */ +class InvalidArgumentException extends \InvalidArgumentException {} \ No newline at end of file