From d6e5978c14a22d93a27932940431bc6e91670475 Mon Sep 17 00:00:00 2001 From: "Chun-Sheng, Li" Date: Fri, 13 Oct 2023 22:10:27 +0800 Subject: [PATCH] Apply using the str_starts_with function (#289) --- src/NewCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index e2ab3351..37477eff 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -699,11 +699,11 @@ protected function runCommands($commands, InputInterface $input, OutputInterface { if (! $output->isDecorated()) { $commands = array_map(function ($value) { - if (substr($value, 0, 5) === 'chmod') { + if (str_starts_with($value, 'chmod')) { return $value; } - if (substr($value, 0, 3) === 'git') { + if (str_starts_with($value, 'git')) { return $value; } @@ -713,11 +713,11 @@ protected function runCommands($commands, InputInterface $input, OutputInterface if ($input->getOption('quiet')) { $commands = array_map(function ($value) { - if (substr($value, 0, 5) === 'chmod') { + if (str_starts_with($value, 'chmod')) { return $value; } - if (substr($value, 0, 3) === 'git') { + if (str_starts_with($value, 'git')) { return $value; }