From 8ca406a3a85f160c9af1e51bd8c0fd8d65288e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:45:53 +0200 Subject: [PATCH] fix: Fix undefined functions usage (#1022) --- src/Annotation/DocblockAnnotationParser.php | 2 +- src/Console/Command/Extract.php | 2 +- src/FileSystem/FileSystem.php | 4 ++-- tests/PhpScoper/DummyPatcher.php | 2 +- tests/PhpScoper/SerializablePatcherTest.php | 2 +- tests/UnsupportedMethodCall.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Annotation/DocblockAnnotationParser.php b/src/Annotation/DocblockAnnotationParser.php index 040a2170d..b53fb1cce 100644 --- a/src/Annotation/DocblockAnnotationParser.php +++ b/src/Annotation/DocblockAnnotationParser.php @@ -20,10 +20,10 @@ use phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlockFactoryInterface; use function array_filter; +use function array_flip; use function array_key_exists; use function array_map; use function array_values; -use function Safe\array_flip; /** * @private diff --git a/src/Console/Command/Extract.php b/src/Console/Command/Extract.php index 3f39cd9a5..b8f2ee2c9 100644 --- a/src/Console/Command/Extract.php +++ b/src/Console/Command/Extract.php @@ -101,7 +101,7 @@ public function execute(IO $io): int if ($canDelete) { remove($outputDir); - // Continue + // Continue } else { // Do nothing return ExitCode::FAILURE; diff --git a/src/FileSystem/FileSystem.php b/src/FileSystem/FileSystem.php index 7d3609e28..98cd2f2b0 100644 --- a/src/FileSystem/FileSystem.php +++ b/src/FileSystem/FileSystem.php @@ -542,7 +542,7 @@ public function remove($files): void // MODIFIED CODE if (defined('PHP_WINDOWS_VERSION_BUILD') && is_dir($file)) { exec(sprintf('rd /s /q %s', escapeshellarg($file))); - // - MODIFIED CODE + // - MODIFIED CODE } elseif (is_link($file)) { // See https://bugs.php.net/52176 if (!@(unlink($file) || '\\' !== DIRECTORY_SEPARATOR || rmdir($file)) && file_exists($file)) { @@ -562,7 +562,7 @@ public function remove($files): void $error = error_get_last(); throw new IOException(sprintf('Failed to remove file "%s": %s.', $file, $error['message'])); - // MODIFIED CODE + // MODIFIED CODE } elseif (file_exists($file)) { throw new IOException(sprintf('Failed to remove file "%s".', $file)); // - MODIFIED CODE diff --git a/tests/PhpScoper/DummyPatcher.php b/tests/PhpScoper/DummyPatcher.php index b39c04244..b7da4efd8 100644 --- a/tests/PhpScoper/DummyPatcher.php +++ b/tests/PhpScoper/DummyPatcher.php @@ -15,7 +15,7 @@ namespace KevinGH\Box\PhpScoper; use Humbug\PhpScoper\Patcher\Patcher; -use function Safe\sprintf; +use function sprintf; final class DummyPatcher implements Patcher { diff --git a/tests/PhpScoper/SerializablePatcherTest.php b/tests/PhpScoper/SerializablePatcherTest.php index dc6b4c8fc..165568e57 100644 --- a/tests/PhpScoper/SerializablePatcherTest.php +++ b/tests/PhpScoper/SerializablePatcherTest.php @@ -15,8 +15,8 @@ namespace KevinGH\Box\PhpScoper; use PHPUnit\Framework\TestCase; -use function Safe\sprintf; use function serialize; +use function sprintf; use function unserialize; /** diff --git a/tests/UnsupportedMethodCall.php b/tests/UnsupportedMethodCall.php index 2631b2927..15a48440b 100644 --- a/tests/UnsupportedMethodCall.php +++ b/tests/UnsupportedMethodCall.php @@ -15,7 +15,7 @@ namespace KevinGH\Box; use DomainException; -use function Safe\sprintf; +use function sprintf; final class UnsupportedMethodCall extends DomainException {