From 8b19c125e65399aa3daae6b92597c418f13a8dc6 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 16 Dec 2024 08:46:08 -0600 Subject: [PATCH] Remove dependency on getdkan/contracts (#39) --- composer.json | 5 +++-- rector.php | 7 +------ src/Processor/AbstractChunkedProcessor.php | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 3755405..b88b65c 100644 --- a/composer.json +++ b/composer.json @@ -11,14 +11,15 @@ "require": { "php": ">=7.4 <8.4", "ext-curl": "*", - "getdkan/procrastinator": "^5.0.2", + "getdkan/procrastinator": "^5.0.3", "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5" }, "require-dev": { + "getdkan/contracts": "^1.2", "getdkan/mock-chain": "^1.3.6", "mikey179/vfsstream": "^1.6.11", "phpunit/phpunit": "^9.6", - "rector/rector": "^0.15.18", + "rector/rector": "^1@stable", "squizlabs/php_codesniffer": "^3.7", "symfony/phpunit-bridge": "^7.0" }, diff --git a/rector.php b/rector.php index dbd570c..7d0808c 100644 --- a/rector.php +++ b/rector.php @@ -6,15 +6,14 @@ use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; -use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Set\ValueObject\SetList; -use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ __DIR__ . '/src', __DIR__ . '/test', + __DIR__ . '/rector.php', ]); $rectorConfig->sets([ @@ -26,14 +25,10 @@ ]); $rectorConfig->skip([ - // Don't throw errors on JSON parse problems. Yet. - // @todo Throw errors and deal with them appropriately. - JsonThrowOnErrorRector::class, // We like our tags. Please don't remove them. RemoveUselessParamTagRector::class, RemoveUselessReturnTagRector::class, RemoveUselessVarTagRector::class, - ArrayShapeFromConstantArrayReturnRector::class, AddMethodCallBasedStrictParamTypeRector::class, ]); diff --git a/src/Processor/AbstractChunkedProcessor.php b/src/Processor/AbstractChunkedProcessor.php index 9e5676f..78abcb0 100644 --- a/src/Processor/AbstractChunkedProcessor.php +++ b/src/Processor/AbstractChunkedProcessor.php @@ -71,7 +71,7 @@ public function copy(array $state, Result $result, int $timeLimit = PHP_INT_MAX) return ['state' => $state, 'result' => $result]; } - private function validateWrite(int $bytesWritten, string $chunk, string $source, string $destination) + private function validateWrite(int $bytesWritten, string $chunk, string $source, string $destination): void { if ($bytesWritten !== strlen($chunk)) { throw new \RuntimeException(