Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.2.14" installed="2.2.14" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="7.0.0-beta22" installed="7.0.0-beta22" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="2.3.5" installed="2.3.5" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="7.2.1" installed="7.2.1" location="./tools/psalm" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"stan-baseline": "tools/phpstan --generate-baseline",
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
"stan-setup": "phive install",
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:\"~2.6.0\" && mv composer.backup composer.json",
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:\"~2.8.4\" && mv composer.backup composer.json",
"rector-check": "vendor/bin/rector process --dry-run",
"rector-fix": "vendor/bin/rector process",
"test": "phpunit"
Expand Down
12 changes: 12 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ parameters:
count: 1
path: src/Controller/DebugKitController.php

-
message: '#^Possibly invalid array key type string\|null\.$#'
identifier: offsetAccess.invalidOffset
count: 2
path: src/DebugInclude.php

-
message: '#^Possibly invalid array key type int\|string\|null\.$#'
identifier: offsetAccess.invalidOffset
count: 2
path: src/DebugTimer.php

-
message: '#^Parameter \#1 \$request of method DebugKit\\ToolbarService\:\:saveData\(\) expects Cake\\Http\\ServerRequest, Psr\\Http\\Message\\ServerRequestInterface given\.$#'
identifier: argument.type
Expand Down
25 changes: 1 addition & 24 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\BooleanNot\NegatedAndsToPositiveOrsRector;
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector;
use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
use Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector;
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector;
Expand All @@ -29,11 +27,9 @@
use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\DeadCode\Rector\Cast\RecastingRemovalRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveMixedDocblockOverruledByNativeTypeRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveNullTagValueNodeRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveReturnTagIncompatibleWithNativeTypeRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
Expand Down Expand Up @@ -66,20 +62,14 @@
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector;
use Rector\TypeDeclaration\Rector\Class_\ReturnTypeFromMockObjectRector;
use Rector\TypeDeclaration\Rector\Class_\TypedPropertyFromCreateMockAssignRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamStringTypeFromSprintfUseRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeBasedOnPHPUnitDataProviderRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstReturnsRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromMockObjectRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictFluentReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnUnionTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ScalarParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureNeverReturnTypeRector;
use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeFromAssertInstanceOfRector;
Expand All @@ -90,7 +80,6 @@
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector;
use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector;

$cacheDir = getenv('RECTOR_CACHE_DIR') ?: sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'rector';

Expand Down Expand Up @@ -123,16 +112,13 @@
ThrowWithPreviousExceptionRector::class,
ExplicitReturnNullRector::class,
OptionalParametersAfterRequiredRector::class,
CompleteDynamicPropertiesRector::class,
ForeachToInArrayRector::class,
CompactToVariablesRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
SimplifyIfReturnBoolRector::class,
AbsolutizeRequireAndIncludePathRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
CatchExceptionNameMatchingTypeRector::class,
CatchExceptionNameMatchingTypeRector::class,
MakeInheritedMethodVisibilitySameAsParentRector::class,
NewlineBeforeNewAssignSetRector::class,
StrictArraySearchRector::class,
Expand Down Expand Up @@ -169,13 +155,9 @@
ClosureToArrowFunctionRector::class,
ReadOnlyPropertyRector::class,
AddArrowFunctionReturnTypeRector::class,
BinaryOpNullableToInstanceofRector::class,
NewlineBetweenClassLikeStmtsRector::class,
AddParamStringTypeFromSprintfUseRector::class,
AddParamTypeBasedOnPHPUnitDataProviderRector::class,
AddVoidReturnTypeWhereNoReturnRector::class,
BoolReturnTypeFromBooleanConstReturnsRector::class,
ParamTypeByMethodCallTypeRector::class,
ReturnNeverTypeRector::class,
ReturnTypeFromMockObjectRector::class,
ReturnTypeFromStrictFluentReturnRector::class,
Expand All @@ -188,7 +170,6 @@
TypedPropertyFromAssignsRector::class,
TypedPropertyFromStrictConstructorRector::class,
TypedPropertyFromStrictSetUpRector::class,
WhileNullableToInstanceofRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,

// Manual - only appliable for part of the code
Expand All @@ -209,16 +190,12 @@
// them is a separate decision from getting CI green again.
NegatedAndsToPositiveOrsRector::class,
FixClassCaseSensitivityVarDocblockRector::class,
RemoveDuplicatedReturnSelfDocblockRector::class,
RemoveMixedDocblockOverruledByNativeTypeRector::class,
RemoveParentDelegatingClassMethodRector::class,
RemoveReturnTagIncompatibleWithNativeTypeRector::class,
RemoveUselessUnionReturnDocblockRector::class,
RemoveDefaultValueFromAssignedPropertyRector::class,
RemoveDeadInstanceOfAssertRector::class,
MbStrContainsRector::class,
ArrayParamTypeByMethodCallTypeRector::class,
ScalarParamTypeByMethodCallTypeRector::class,
ClosureReturnTypeFromAssertInstanceOfRector::class,
AddClosureParamTypeForArrayMapRector::class,
AddClosureParamTypeFromVariableCallRector::class,
Expand Down
5 changes: 3 additions & 2 deletions src/Model/Table/RequestsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Cake\ORM\Query\SelectQuery;
use Cake\ORM\Table;
use PDOException;
use function Cake\Database\Expression\notIn;

/**
* The requests table tracks basic information about each request.
Expand Down Expand Up @@ -129,12 +130,12 @@ public function gc(): void
}

$query = $this->Panels->deleteQuery()
->where(['request_id NOT IN' => $noPurge]);
->where(['request_id' => notIn($noPurge)]);
$statement = $query->execute();
$statement->closeCursor();

$query = $this->deleteQuery()
->where(['id NOT IN' => $noPurge]);
->where(['id' => notIn($noPurge)]);

$statement = $query->execute();
$statement->closeCursor();
Expand Down
Loading