Skip to content

Commit db363a7

Browse files
committed
refactor: re-run rector
1 parent 095aea9 commit db363a7

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

system/CLI/CLI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public static function promptByMultipleKeys(string $text, array $options): array
348348
// return the prompt again if $input contain(s) non-numeric character, except a comma.
349349
// And if max from $options less than max from input,
350350
// it means user tried to access null value in $options
351-
if (! $pattern || $maxOptions < $maxInput) {
351+
if ($pattern === 0 || $pattern === false || $maxOptions < $maxInput) {
352352
static::error('Please select correctly.');
353353
CLI::newLine();
354354

system/Database/MigrationRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ protected function migrationFromFile(string $path, string $namespace)
450450

451451
$filename = basename($path, '.php');
452452

453-
if (! preg_match($this->regex, $filename)) {
453+
if (preg_match($this->regex, $filename) !== 1) {
454454
return false;
455455
}
456456

system/Helpers/form_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s
6262
// Add CSRF field if enabled, but leave it out for GET requests and requests to external websites
6363
$before = service('filters')->getFilters()['before'];
6464

65-
if ((in_array('csrf', $before, true) || array_key_exists('csrf', $before)) && str_contains($action, base_url()) && ! stripos($form, 'method="get"')) {
65+
if ((in_array('csrf', $before, true) || array_key_exists('csrf', $before)) && str_contains($action, base_url()) && stripos($form, 'method="get"') === false) {
6666
$form .= csrf_field($csrfId ?? null);
6767
}
6868

system/Router/RouteCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ protected function fillRouteParams(string $from, ?array $params = null): string
13291329
$patterns = $matches[0];
13301330

13311331
foreach ($patterns as $index => $pattern) {
1332-
if (! preg_match('#^' . $pattern . '$#u', $params[$index])) {
1332+
if (preg_match('#^' . $pattern . '$#u', $params[$index]) !== 1) {
13331333
throw RouterException::forInvalidParameterType();
13341334
}
13351335

@@ -1391,7 +1391,7 @@ protected function buildReverseRoute(string $from, array $params): string
13911391
// or maybe $placeholder is not a placeholder, but a regex.
13921392
$pattern = $this->placeholders[$placeholderName] ?? $placeholder;
13931393

1394-
if (! preg_match('#^' . $pattern . '$#u', (string) $params[$index])) {
1394+
if (preg_match('#^' . $pattern . '$#u', (string) $params[$index]) !== 1) {
13951395
throw RouterException::forInvalidParameterType();
13961396
}
13971397

0 commit comments

Comments
 (0)