From c0fe4a61d10b9225eed20797d317b9665589bdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:21:54 +0200 Subject: [PATCH 1/2] refactor: Remove obsolete TODOs (#1048) --- src/Console/Command/Diff.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Console/Command/Diff.php b/src/Console/Command/Diff.php index f706ab5ab..0c4a0d031 100644 --- a/src/Console/Command/Diff.php +++ b/src/Console/Command/Diff.php @@ -29,7 +29,6 @@ use Webmozart\Assert\Assert; use function array_map; use function count; -// TODO: migrate to Safe API use function explode; use function implode; use function is_string; @@ -44,7 +43,6 @@ final class Diff implements Command private const FIRST_PHAR_ARG = 'pharA'; private const SECOND_PHAR_ARG = 'pharB'; - // TODO: replace by DiffMode::X->value once bumping to PHP 8.2 as the min version. private const LIST_FILES_DIFF_OPTION = 'list-diff'; private const GIT_DIFF_OPTION = 'git-diff'; private const GNU_DIFF_OPTION = 'gnu-diff'; From df55b9da3d1878f5873b07faa223179da405d490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:23:24 +0200 Subject: [PATCH 2/2] test: Switch to the Safe API for tests (#1050) --- tests/BoxTest.php | 2 +- tests/Console/Command/CompileTest.php | 2 +- tests/Console/Command/DiffTest.php | 4 ++-- tests/Console/Command/GenerateDockerFileTest.php | 2 +- tests/Console/Command/InfoTest.php | 2 +- tests/Console/Command/VerifyTest.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/BoxTest.php b/tests/BoxTest.php index e6ac4a5ee..979ba8f46 100644 --- a/tests/BoxTest.php +++ b/tests/BoxTest.php @@ -48,7 +48,7 @@ use function implode; use function in_array; use function iterator_to_array; -use function realpath; +use function Safe\realpath; use function sprintf; use function str_replace; use function trim; diff --git a/tests/Console/Command/CompileTest.php b/tests/Console/Command/CompileTest.php index 3382552b2..dce69f130 100644 --- a/tests/Console/Command/CompileTest.php +++ b/tests/Console/Command/CompileTest.php @@ -56,7 +56,7 @@ use function preg_quote; use function preg_replace; use function random_int; -use function realpath; +use function Safe\realpath; use function sort; use function sprintf; use function str_replace; diff --git a/tests/Console/Command/DiffTest.php b/tests/Console/Command/DiffTest.php index 4b9494eb5..b506c399f 100644 --- a/tests/Console/Command/DiffTest.php +++ b/tests/Console/Command/DiffTest.php @@ -26,8 +26,8 @@ use Symfony\Component\Console\Output\OutputInterface; use function array_splice; use function ob_get_clean; -use function ob_start; -use function realpath; +use function Safe\ob_start; +use function Safe\realpath; /** * @covers \KevinGH\Box\Console\Command\Diff diff --git a/tests/Console/Command/GenerateDockerFileTest.php b/tests/Console/Command/GenerateDockerFileTest.php index d6cfe2896..68c4d2a99 100644 --- a/tests/Console/Command/GenerateDockerFileTest.php +++ b/tests/Console/Command/GenerateDockerFileTest.php @@ -18,7 +18,7 @@ use Fidry\Console\ExitCode; use KevinGH\Box\Test\CommandTestCase; use KevinGH\Box\Test\RequiresPharReadonlyOff; -use function realpath; +use function Safe\realpath; /** * @covers \KevinGH\Box\Console\Command\GenerateDockerFile diff --git a/tests/Console/Command/InfoTest.php b/tests/Console/Command/InfoTest.php index b36a40e75..9fdf342c4 100644 --- a/tests/Console/Command/InfoTest.php +++ b/tests/Console/Command/InfoTest.php @@ -25,7 +25,7 @@ use function extension_loaded; use function implode; use function preg_replace; -use function realpath; +use function Safe\realpath; /** * @covers \KevinGH\Box\Console\Command\Info diff --git a/tests/Console/Command/VerifyTest.php b/tests/Console/Command/VerifyTest.php index 245cb7008..5ae412d02 100644 --- a/tests/Console/Command/VerifyTest.php +++ b/tests/Console/Command/VerifyTest.php @@ -21,7 +21,7 @@ use KevinGH\Box\Test\RequiresPharReadonlyOff; use Phar; use Symfony\Component\Console\Output\OutputInterface; -use function realpath; +use function Safe\realpath; /** * @covers \KevinGH\Box\Console\Command\Verify