diff --git a/system/Commands/Utilities/PhpIniCheck.php b/system/Commands/Utilities/PhpIniCheck.php index df3d8376a7d3..f13d3d7f8fe9 100644 --- a/system/Commands/Utilities/PhpIniCheck.php +++ b/system/Commands/Utilities/PhpIniCheck.php @@ -80,7 +80,7 @@ public function run(array $params) return EXIT_ERROR; } - $argument = isset($params[0]) && $params[0] ? $params[0] : null; + $argument = $params[0] ?? null; CheckPhpIni::run(argument: $argument); diff --git a/tests/system/Commands/Utilities/PhpIniCheckTest.php b/tests/system/Commands/Utilities/PhpIniCheckTest.php index dd5180acbb5a..7a5e204dcd2f 100644 --- a/tests/system/Commands/Utilities/PhpIniCheckTest.php +++ b/tests/system/Commands/Utilities/PhpIniCheckTest.php @@ -15,7 +15,6 @@ use CodeIgniter\Test\CIUnitTestCase; use CodeIgniter\Test\StreamFilterTrait; -use Config\App; use PHPUnit\Framework\Attributes\Group; /** @@ -38,7 +37,7 @@ protected function tearDown(): void parent::tearDown(); } - protected function getBuffer() + protected function getBuffer(): string { return $this->getStreamFilterBuffer(); } @@ -60,7 +59,7 @@ public function testCommandCheckOpcache(): void { command('phpini:check opcache'); - $this->assertStringContainsString("opcache.save_comments", $this->getBuffer()); + $this->assertStringContainsString('opcache.save_comments', $this->getBuffer()); } public function testCommandCheckNoExistsArg(): void