Skip to content

Commit 848b980

Browse files
committed
refactor: run rector
1 parent d6f977c commit 848b980

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

system/CLI/InputOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class InputOutput
2121
/**
2222
* Is the readline library on the system?
2323
*/
24-
private bool $readlineSupport;
24+
private readonly bool $readlineSupport;
2525

2626
public function __construct()
2727
{

system/Commands/Utilities/Routes/SampleURIGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function get(string $routeKey): string
5252
{
5353
$sampleUri = $routeKey;
5454

55-
if (strpos($routeKey, '{locale}') !== false) {
55+
if (str_contains($routeKey, '{locale}')) {
5656
$sampleUri = str_replace(
5757
'{locale}',
5858
config(App::class)->defaultLocale,

system/Filters/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private function runAfter(array $filterClasses): ResponseInterface
230230
$class = new $className();
231231

232232
if (! $class instanceof FilterInterface) {
233-
throw FilterException::forIncorrectInterface(get_class($class));
233+
throw FilterException::forIncorrectInterface($class::class);
234234
}
235235

236236
$result = $class->after(

system/Filters/PageCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class PageCache implements FilterInterface
2727
{
28-
private ResponseCache $pageCache;
28+
private readonly ResponseCache $pageCache;
2929

3030
public function __construct()
3131
{

system/HTTP/Method.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,59 @@ class Method
1919
/**
2020
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT
2121
*/
22-
public const CONNECT = 'CONNECT';
22+
final public const CONNECT = 'CONNECT';
2323

2424
/**
2525
* Idempotent
2626
*
2727
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
2828
*/
29-
public const DELETE = 'DELETE';
29+
final public const DELETE = 'DELETE';
3030

3131
/**
3232
* Safe, Idempotent, Cacheable
3333
*
3434
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET
3535
*/
36-
public const GET = 'GET';
36+
final public const GET = 'GET';
3737

3838
/**
3939
* Safe, Idempotent, Cacheable
4040
*
4141
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD
4242
*/
43-
public const HEAD = 'HEAD';
43+
final public const HEAD = 'HEAD';
4444

4545
/**
4646
* Safe, Idempotent
4747
*
4848
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
4949
*/
50-
public const OPTIONS = 'OPTIONS';
50+
final public const OPTIONS = 'OPTIONS';
5151

5252
/**
5353
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH
5454
*/
55-
public const PATCH = 'PATCH';
55+
final public const PATCH = 'PATCH';
5656

5757
/**
5858
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST
5959
*/
60-
public const POST = 'POST';
60+
final public const POST = 'POST';
6161

6262
/**
6363
* Idempotent
6464
*
6565
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT
6666
*/
67-
public const PUT = 'PUT';
67+
final public const PUT = 'PUT';
6868

6969
/**
7070
* Safe, Idempotent
7171
*
7272
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE
7373
*/
74-
public const TRACE = 'TRACE';
74+
final public const TRACE = 'TRACE';
7575

7676
/**
7777
* Returns all HTTP methods.

system/Validation/Rules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public function field_exists(
444444
?string $error = null,
445445
?string $field = null
446446
): bool {
447-
if (strpos($field, '.') !== false) {
447+
if (str_contains($field, '.')) {
448448
return ArrayHelper::dotKeyExists($field, $data);
449449
}
450450

system/Validation/StrictRules/Rules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function differs(
4444
?string $error = null,
4545
?string $field = null
4646
): bool {
47-
if (strpos($otherField, '.') !== false) {
47+
if (str_contains($otherField, '.')) {
4848
return $str !== dot_array_search($otherField, $data);
4949
}
5050

@@ -275,7 +275,7 @@ public function matches(
275275
?string $error = null,
276276
?string $field = null
277277
): bool {
278-
if (strpos($otherField, '.') !== false) {
278+
if (str_contains($otherField, '.')) {
279279
return $str === dot_array_search($otherField, $data);
280280
}
281281

@@ -420,7 +420,7 @@ public function field_exists(
420420
?string $error = null,
421421
?string $field = null
422422
): bool {
423-
if (strpos($field, '.') !== false) {
423+
if (str_contains($field, '.')) {
424424
return ArrayHelper::dotKeyExists($field, $data);
425425
}
426426

0 commit comments

Comments
 (0)