diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index b8f4078..ad20fd5 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -33,5 +33,5 @@ jobs: uses: php-actions/phpstan@v3 with: path: src/ - level: 3 + level: 4 php_version: '8.2' diff --git a/composer.lock b/composer.lock index 2121a79..2fba402 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/php-etl/bucket.git", - "reference": "96b2549417b603abdee3f193d7d3074c0672f45a" + "reference": "3e25f9ca7a85c7c05a72c004407f13da501248c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/bucket/zipball/96b2549417b603abdee3f193d7d3074c0672f45a", - "reference": "96b2549417b603abdee3f193d7d3074c0672f45a", + "url": "https://api.github.com/repos/php-etl/bucket/zipball/3e25f9ca7a85c7c05a72c004407f13da501248c0", + "reference": "3e25f9ca7a85c7c05a72c004407f13da501248c0", "shasum": "" }, "require": { @@ -61,7 +61,7 @@ "issues": "https://github.com/php-etl/bucket/issues", "source": "https://github.com/php-etl/bucket/tree/main" }, - "time": "2023-11-14T10:16:20+00:00" + "time": "2023-11-14T11:38:59+00:00" }, { "name": "php-etl/bucket-contracts", diff --git a/src/GeneratorWrapper.php b/src/GeneratorWrapper.php index f662c69..95856f3 100644 --- a/src/GeneratorWrapper.php +++ b/src/GeneratorWrapper.php @@ -11,7 +11,7 @@ */ class GeneratorWrapper { - /** @param \Iterator ...$iterators */ + /** @param \Iterator, Type> ...$iterators */ public function rewind(\Iterator ...$iterators): void { foreach ($iterators as $iterator) { @@ -19,7 +19,7 @@ public function rewind(\Iterator ...$iterators): void } } - /** @param \Iterator ...$iterators */ + /** @param \Iterator, Type> ...$iterators */ public function next(\Iterator ...$iterators): void { foreach ($iterators as $iterator) { @@ -27,7 +27,7 @@ public function next(\Iterator ...$iterators): void } } - /** @param \Iterator ...$iterators */ + /** @param \Iterator, Type> ...$iterators */ public function valid(\Iterator ...$iterators): bool { foreach ($iterators as $iterator) { @@ -41,7 +41,7 @@ public function valid(\Iterator ...$iterators): bool /** * @param Type $value - * @param \Generator, Type, void> ...$generators + * @param \Generator, ResultBucketInterface, Type, void> ...$generators */ public function send($value, \Generator ...$generators): \Generator { diff --git a/src/Loader/LogLoader.php b/src/Loader/LogLoader.php index 02ef5c7..23fb3eb 100644 --- a/src/Loader/LogLoader.php +++ b/src/Loader/LogLoader.php @@ -21,7 +21,7 @@ public function __construct(private LoggerInterface $logger, private string $log { } - /** @return \Generator|EmptyResultBucket, Type|null, void> */ + /** @return \Generator, AcceptanceResultBucket|EmptyResultBucket, Type|null, void> */ public function load(): \Generator { $line = yield new EmptyResultBucket(); diff --git a/src/Loader/StreamLoader.php b/src/Loader/StreamLoader.php index fd98b6e..1b3792a 100644 --- a/src/Loader/StreamLoader.php +++ b/src/Loader/StreamLoader.php @@ -28,7 +28,7 @@ public function __construct($stream) $this->stream = $stream; } - /** @return \Generator|EmptyResultBucket, Type|null, void> */ + /** @return \Generator, AcceptanceResultBucket|EmptyResultBucket, Type|null, void> */ public function load(): \Generator { $line = yield new EmptyResultBucket(); diff --git a/src/Pipeline.php b/src/Pipeline.php index be37897..9b33007 100644 --- a/src/Pipeline.php +++ b/src/Pipeline.php @@ -22,9 +22,9 @@ class Pipeline implements PipelineInterface, WalkableInterface, RunnableInterface { - /** @var \AppendIterator|object, \Iterator|object>> */ + /** @var \AppendIterator, non-empty-array|object, \Iterator, non-empty-array|object>> */ private readonly \AppendIterator $source; - /** @var \Iterator|object>|\NoRewindIterator */ + /** @var \Iterator, non-empty-array|object>|\NoRewindIterator */ private iterable $subject; public function __construct( diff --git a/src/PipelineRunner.php b/src/PipelineRunner.php index ee57dc7..9862d08 100644 --- a/src/PipelineRunner.php +++ b/src/PipelineRunner.php @@ -30,11 +30,11 @@ public function __construct( * @template InputType of non-empty-array|object * @template OutputType of non-empty-array|object * - * @param \Iterator $source - * @param \Generator|AcceptanceResultBucketInterface|RejectionResultBucketInterface|null, InputType, void> $coroutine + * @param \Iterator, InputType|null> $source + * @param \Generator, ResultBucketInterface|AcceptanceResultBucketInterface|RejectionResultBucketInterface|null, InputType, void> $coroutine * @param StepRejectionInterface $rejection * @param StepStateInterface $state - * @return \Iterator> + * @return \Iterator, ResultBucketInterface> */ public function run( \Iterator $source, diff --git a/src/Transformer/BatchingTransformer.php b/src/Transformer/BatchingTransformer.php index a3aa364..c404127 100644 --- a/src/Transformer/BatchingTransformer.php +++ b/src/Transformer/BatchingTransformer.php @@ -19,7 +19,7 @@ */ class BatchingTransformer implements TransformerInterface, FlushableInterface { - /** @var array */ + /** @var list */ private array $batch = []; /** @@ -30,7 +30,7 @@ public function __construct( ) { } - /** @return \Generator|EmptyResultBucket, InputType|null, void> */ + /** @return \Generator, ResultBucketInterface|EmptyResultBucket, InputType|null, void> */ public function transform(): \Generator { $this->batch = []; diff --git a/src/Transformer/CallableTransformer.php b/src/Transformer/CallableTransformer.php index f7cd6ae..c3ac523 100644 --- a/src/Transformer/CallableTransformer.php +++ b/src/Transformer/CallableTransformer.php @@ -29,7 +29,7 @@ public function __construct( } /** - * @return \Generator|EmptyResultBucket, InputType|null, void> + * @return \Generator, AcceptanceResultBucket|EmptyResultBucket, InputType|null, void> */ public function transform(): \Generator { diff --git a/src/Transformer/ColumnTrimTransformer.php b/src/Transformer/ColumnTrimTransformer.php index c450ffe..23b500a 100644 --- a/src/Transformer/ColumnTrimTransformer.php +++ b/src/Transformer/ColumnTrimTransformer.php @@ -22,7 +22,7 @@ public function __construct( ) { } - /** @return \Generator|EmptyResultBucket, InputType|null, void> */ + /** @return \Generator, AcceptanceResultBucket|EmptyResultBucket, InputType|null, void> */ public function transform(): \Generator { $line = yield new EmptyResultBucket(); diff --git a/src/Transformer/FilterTransformer.php b/src/Transformer/FilterTransformer.php index a92d66e..b10c112 100644 --- a/src/Transformer/FilterTransformer.php +++ b/src/Transformer/FilterTransformer.php @@ -26,7 +26,7 @@ public function __construct( } /** - * @return \Generator|EmptyResultBucket, Type|null, void> + * @return \Generator, AcceptanceResultBucket|EmptyResultBucket, Type|null, void> */ public function transform(): \Generator { diff --git a/src/UnexpectedYieldedValueType.php b/src/UnexpectedYieldedValueType.php index 0c4ad30..f4c9ba7 100644 --- a/src/UnexpectedYieldedValueType.php +++ b/src/UnexpectedYieldedValueType.php @@ -27,7 +27,7 @@ public function getCoroutine(): \Generator } /** - * @param \Generator, InputType, void> $actual + * @param \Generator, ResultBucketInterface, InputType, void> $actual * @param list $expectedTypes * @param mixed $actual *