From b20ed6adb9a068f5aa1502d1aeeec70c12058a14 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 14 Nov 2023 14:24:53 +0900 Subject: [PATCH] refactor: run rector --- system/CLI/InputOutput.php | 2 +- system/Commands/Utilities/Routes/SampleURIGenerator.php | 2 +- system/Validation/StrictRules/Rules.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/CLI/InputOutput.php b/system/CLI/InputOutput.php index 5b6c1da02f4d..b69c19e2eee1 100644 --- a/system/CLI/InputOutput.php +++ b/system/CLI/InputOutput.php @@ -21,7 +21,7 @@ class InputOutput /** * Is the readline library on the system? */ - private bool $readlineSupport; + private readonly bool $readlineSupport; public function __construct() { diff --git a/system/Commands/Utilities/Routes/SampleURIGenerator.php b/system/Commands/Utilities/Routes/SampleURIGenerator.php index 4c4cf0c9112e..c0832a382eff 100644 --- a/system/Commands/Utilities/Routes/SampleURIGenerator.php +++ b/system/Commands/Utilities/Routes/SampleURIGenerator.php @@ -52,7 +52,7 @@ public function get(string $routeKey): string { $sampleUri = $routeKey; - if (strpos($routeKey, '{locale}') !== false) { + if (str_contains($routeKey, '{locale}')) { $sampleUri = str_replace( '{locale}', config(App::class)->defaultLocale, diff --git a/system/Validation/StrictRules/Rules.php b/system/Validation/StrictRules/Rules.php index a077625bb366..d7dd799f140b 100644 --- a/system/Validation/StrictRules/Rules.php +++ b/system/Validation/StrictRules/Rules.php @@ -43,7 +43,7 @@ public function differs( ?string $error = null, ?string $field = null ): bool { - if (strpos($otherField, '.') !== false) { + if (str_contains($otherField, '.')) { return $str !== dot_array_search($otherField, $data); } @@ -274,7 +274,7 @@ public function matches( ?string $error = null, ?string $field = null ): bool { - if (strpos($otherField, '.') !== false) { + if (str_contains($otherField, '.')) { return $str === dot_array_search($otherField, $data); }