Skip to content

Commit

Permalink
Make SubscribingHandlerInterface::getSubscribingMethods() return iter…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
simPod committed Jul 4, 2020
1 parent c3fbc76 commit a45c665
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Handler/ArrayCollectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(bool $initializeExcluded = true)
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];
$formats = ['json', 'xml', 'yml'];
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/ConstraintViolationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ConstraintViolationHandler implements SubscribingHandlerInterface
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];
$formats = ['xml', 'json'];
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/DateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class DateHandler implements SubscribingHandlerInterface
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];
$types = ['DateTime', 'DateTimeImmutable', 'DateInterval'];
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/FormErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class FormErrorHandler implements SubscribingHandlerInterface
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];
foreach (['xml', 'json'] as $format) {
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/IteratorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class IteratorHandler implements SubscribingHandlerInterface
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Handler/StdClassHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class StdClassHandler implements SubscribingHandlerInterface
/**
* {@inheritdoc}
*/
public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
$methods = [];
$formats = ['json', 'xml', 'yml'];
Expand Down
6 changes: 2 additions & 4 deletions src/Handler/SubscribingHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ interface SubscribingHandlerInterface
*
* The direction and method keys can be omitted.
*
* @return array
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
* @return iterable<string, int|string>
*/
public static function getSubscribingMethods();
public static function getSubscribingMethods(): iterable;
}
2 changes: 1 addition & 1 deletion tests/Serializer/GraphNavigatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class TestSubscribingHandler implements SubscribingHandlerInterface
{
public const FORMAT = 'foo';

public static function getSubscribingMethods()
public static function getSubscribingMethods(): iterable
{
return [
[
Expand Down

0 comments on commit a45c665

Please sign in to comment.