From e77c409ab516676e3241a9404a089224e8e50d2a Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Fri, 13 Dec 2024 13:56:16 -0600 Subject: [PATCH] Reduce dependency on getdkan/contracts (#23) --- composer.json | 4 ++-- rector.php | 7 ++----- src/HydratableInterface.php | 28 ++++++++++++++++++++++++++++ src/Job/AbstractPersistentJob.php | 7 +++++-- src/Result.php | 2 -- test/Mock/Complex.php | 2 +- 6 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 src/HydratableInterface.php diff --git a/composer.json b/composer.json index 360c216..438b129 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ "require": { "php": ">7.3 <8.4", "ext-json": "*", - "getdkan/contracts": "^1.1.3" + "getdkan/contracts": "^1.2" }, "require-dev": { "phpunit/phpunit": ">8.5.14 <10.0.0", - "rector/rector": "@stable", + "rector/rector": "^1@stable", "squizlabs/php_codesniffer": "^3.7", "symfony/phpunit-bridge": "^7.0" }, diff --git a/rector.php b/rector.php index 54fd922..b79cf54 100644 --- a/rector.php +++ b/rector.php @@ -3,16 +3,16 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; -use Rector\Set\ValueObject\SetList; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; +use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ __DIR__ . '/src', __DIR__ . '/test', + __DIR__ . '/rector.php', ]); $rectorConfig->sets([ @@ -24,9 +24,6 @@ ]); $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, diff --git a/src/HydratableInterface.php b/src/HydratableInterface.php new file mode 100644 index 0000000..64d0858 --- /dev/null +++ b/src/HydratableInterface.php @@ -0,0 +1,28 @@ +