Skip to content

Commit

Permalink
Updated generics types
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Nov 13, 2023
1 parent 8b823cc commit 5e0b1b7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/ExtractingInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
interface ExtractingInterface
{
/**
* @template Type
* @template OutputType
*
* @param ExtractorInterface<Type> $extractor
* @param ExtractorInterface<OutputType> $extractor
*/
public function extract(
StepCodeInterface $step,
Expand Down
4 changes: 2 additions & 2 deletions src/ExtractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

use Kiboko\Contract\Bucket\ResultBucketInterface;

/** @template Type */
/** @template OutputType */
interface ExtractorInterface
{
/**
* Extract data from the given source.
*
* @return iterable<int, ResultBucketInterface<Type|null>>
* @return iterable<int, ResultBucketInterface<OutputType|null>>
*/
public function extract(): iterable;
}
7 changes: 5 additions & 2 deletions src/LoaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

use Kiboko\Contract\Bucket\ResultBucketInterface;

/** @template Type */
/**
* @template InputType
* @template OutputType
*/
interface LoaderInterface
{
/**
* Loads data in the given sink.
*
* @return \Generator<mixed, ResultBucketInterface<Type>|ResultBucketInterface<void>, Type|null, void>
* @return \Generator<mixed, ResultBucketInterface<OutputType>|ResultBucketInterface<void>, InputType|null, void>
*/
public function load(): \Generator;
}
5 changes: 3 additions & 2 deletions src/LoadingInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
interface LoadingInterface
{
/**
* @template Type
* @template InputType
* @template OutputType
*
* @param LoaderInterface<Type> $loader
* @param LoaderInterface<InputType, OutputType> $loader
*/
public function load(
StepCodeInterface $step,
Expand Down
7 changes: 5 additions & 2 deletions src/TransformerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

use Kiboko\Contract\Bucket\ResultBucketInterface;

/** @template Type */
/**
* @template InputType
* @template OutputType
*/
interface TransformerInterface
{
/**
* Transforms the data from one format to another.
*
* @return \Generator<mixed, ResultBucketInterface<Type>|ResultBucketInterface<void>, Type|null, void>
* @return \Generator<mixed, ResultBucketInterface<OutputType>|ResultBucketInterface<void>, InputType|null, void>
*/
public function transform(): \Generator;
}
5 changes: 3 additions & 2 deletions src/TransformingInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
interface TransformingInterface
{
/**
* @template Type
* @template InputType
* @template OutputType
*
* @param TransformerInterface<Type> $transformer
* @param TransformerInterface<InputType, OutputType> $transformer
*/
public function transform(
StepCodeInterface $step,
Expand Down

0 comments on commit 5e0b1b7

Please sign in to comment.