Skip to content

Commit 817fc21

Browse files
committed
Breaking change: Update signature of ExtractorInterface->extract()
1 parent 6275e02 commit 817fc21

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Classes/DataProvider/Extractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
$this->maxDepthOfObjectTreeTraversal = $maxDepthOfObjectTreeTraversal;
6262
}
6363

64-
public function extract($input)
64+
public function extract(mixed $input): string|int|bool|float|array|null
6565
{
6666
return $this->extractData($input, null, null);
6767
}

Classes/DataProvider/ExtractorInterface.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99

1010
/**
1111
* Class to prepare/extract the data to be sent from objects
12+
*
13+
* @phpstan-type Data string|int|bool|float|array<mixed,mixed>|null
1214
*/
1315
interface ExtractorInterface
1416
{
1517
/**
16-
* Returns the data from the given input
18+
* Extract the data from the given input
19+
*
20+
* @return Data
1721
*
1822
* @throws RuntimeException if the data nesting is too deep
1923
* @throws InvalidArgumentException if the input type is not supported
2024
*/
21-
public function extract($input);
25+
public function extract(mixed $input): string|int|bool|float|array|null;
2226
}

0 commit comments

Comments
 (0)