Skip to content

Commit d3b9285

Browse files
authored
Merge pull request #1163 from kenjis/refactor-method-incorrect-case
refactor: fix method names with incorrect case
2 parents 0aaa04b + 317477e commit d3b9285

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,12 @@
135135
'count' => 1,
136136
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
137137
];
138-
$ignoreErrors[] = [
139-
// identifier: method.nameCase
140-
'message' => '#^Call to method CodeIgniter\\\\Shield\\\\Result\\:\\:isOK\\(\\) with incorrect case\\: isOk$#',
141-
'count' => 1,
142-
'path' => __DIR__ . '/src/Authentication/Passwords.php',
143-
];
144138
$ignoreErrors[] = [
145139
// identifier: empty.notAllowed
146140
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
147141
'count' => 4,
148142
'path' => __DIR__ . '/src/Authentication/Passwords/NothingPersonalValidator.php',
149143
];
150-
$ignoreErrors[] = [
151-
// identifier: method.nameCase
152-
'message' => '#^Call to method CodeIgniter\\\\Shield\\\\Result\\:\\:isOK\\(\\) with incorrect case\\: isOk$#',
153-
'count' => 2,
154-
'path' => __DIR__ . '/src/Authentication/Passwords/ValidationRules.php',
155-
];
156144
$ignoreErrors[] = [
157145
// identifier: booleanAnd.rightNotBoolean
158146
'message' => '#^Only booleans are allowed in &&, CodeIgniter\\\\Shield\\\\Entities\\\\User\\|null given on the right side\\.$#',
@@ -316,12 +304,6 @@
316304
'count' => 1,
317305
'path' => __DIR__ . '/src/Filters/AuthRates.php',
318306
];
319-
$ignoreErrors[] = [
320-
// identifier: method.nameCase
321-
'message' => '#^Call to method CodeIgniter\\\\HTTP\\\\ResponseInterface\\:\\:setJSON\\(\\) with incorrect case\\: setJson$#',
322-
'count' => 2,
323-
'path' => __DIR__ . '/src/Filters/TokenAuth.php',
324-
];
325307
$ignoreErrors[] = [
326308
// identifier: empty.notAllowed
327309
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',

src/Authentication/Passwords.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function check(string $password, ?User $user = null): Result
124124
$class = new $className($this->config);
125125

126126
$result = $class->check($password, $user);
127-
if (! $result->isOk()) {
127+
if (! $result->isOK()) {
128128
return $result;
129129
}
130130
}

src/Authentication/Passwords/ValidationRules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public function strong_password(string $value, ?string &$error1 = null, array $d
5454

5555
$result = $checker->check($value, $user);
5656

57-
if (! $result->isOk()) {
57+
if (! $result->isOK()) {
5858
if ($data === []) {
5959
$error1 = $result->reason();
6060
} else {
6161
$error2 = $result->reason();
6262
}
6363
}
6464

65-
return $result->isOk();
65+
return $result->isOK();
6666
}
6767

6868
/**

src/Filters/TokenAuth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function before(RequestInterface $request, $arguments = null)
5858
if (! $result->isOK() || (! empty($arguments) && $result->extraInfo()->tokenCant($arguments[0]))) {
5959
return service('response')
6060
->setStatusCode(Response::HTTP_UNAUTHORIZED)
61-
->setJson(['message' => lang('Auth.badToken')]);
61+
->setJSON(['message' => lang('Auth.badToken')]);
6262
}
6363

6464
if (setting('Auth.recordActiveDate')) {
@@ -72,7 +72,7 @@ public function before(RequestInterface $request, $arguments = null)
7272

7373
return service('response')
7474
->setStatusCode(Response::HTTP_FORBIDDEN)
75-
->setJson(['message' => lang('Auth.activationBlocked')]);
75+
->setJSON(['message' => lang('Auth.activationBlocked')]);
7676
}
7777
}
7878

0 commit comments

Comments
 (0)