Skip to content

Commit

Permalink
refactor: run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 22, 2023
1 parent 75c9d0a commit 68d8a81
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion system/CLI/InputOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InputOutput
/**
* Is the readline library on the system?
*/
private bool $readlineSupport;
private readonly bool $readlineSupport;

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion system/Commands/Utilities/Routes/SampleURIGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion system/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private function runAfter(array $filterClasses): ResponseInterface
$class = new $className();

if (! $class instanceof FilterInterface) {
throw FilterException::forIncorrectInterface(get_class($class));
throw FilterException::forIncorrectInterface($class::class);
}

$result = $class->after(
Expand Down
2 changes: 1 addition & 1 deletion system/Filters/PageCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
class PageCache implements FilterInterface
{
private ResponseCache $pageCache;
private readonly ResponseCache $pageCache;

public function __construct()
{
Expand Down
18 changes: 9 additions & 9 deletions system/HTTP/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,59 +19,59 @@ class Method
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT
*/
public const CONNECT = 'CONNECT';
final public const CONNECT = 'CONNECT';

/**
* Idempotent
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
*/
public const DELETE = 'DELETE';
final public const DELETE = 'DELETE';

/**
* Safe, Idempotent, Cacheable
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET
*/
public const GET = 'GET';
final public const GET = 'GET';

/**
* Safe, Idempotent, Cacheable
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD
*/
public const HEAD = 'HEAD';
final public const HEAD = 'HEAD';

/**
* Safe, Idempotent
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
*/
public const OPTIONS = 'OPTIONS';
final public const OPTIONS = 'OPTIONS';

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

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

/**
* Idempotent
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT
*/
public const PUT = 'PUT';
final public const PUT = 'PUT';

/**
* Safe, Idempotent
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE
*/
public const TRACE = 'TRACE';
final public const TRACE = 'TRACE';

/**
* Returns all HTTP methods.
Expand Down
2 changes: 1 addition & 1 deletion system/Validation/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function field_exists(
?string $error = null,
?string $field = null
): bool {
if (strpos($field, '.') !== false) {
if (str_contains($field, '.')) {
return ArrayHelper::dotKeyExists($field, $data);
}

Expand Down
6 changes: 3 additions & 3 deletions system/Validation/StrictRules/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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);
}

Expand Down Expand Up @@ -275,7 +275,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);
}

Expand Down Expand Up @@ -420,7 +420,7 @@ public function field_exists(
?string $error = null,
?string $field = null
): bool {
if (strpos($field, '.') !== false) {
if (str_contains($field, '.')) {
return ArrayHelper::dotKeyExists($field, $data);
}

Expand Down

0 comments on commit 68d8a81

Please sign in to comment.