diff --git a/src/Handler/ArrayCollectionHandler.php b/src/Handler/ArrayCollectionHandler.php index f0bd6b36d..9523d0901 100644 --- a/src/Handler/ArrayCollectionHandler.php +++ b/src/Handler/ArrayCollectionHandler.php @@ -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']; diff --git a/src/Handler/ConstraintViolationHandler.php b/src/Handler/ConstraintViolationHandler.php index d46291eb9..fecb64e2c 100644 --- a/src/Handler/ConstraintViolationHandler.php +++ b/src/Handler/ConstraintViolationHandler.php @@ -16,7 +16,7 @@ final class ConstraintViolationHandler implements SubscribingHandlerInterface /** * {@inheritdoc} */ - public static function getSubscribingMethods() + public static function getSubscribingMethods() : iterable { $methods = []; $formats = ['xml', 'json']; diff --git a/src/Handler/DateHandler.php b/src/Handler/DateHandler.php index 981d8e21e..d8d2ff95f 100644 --- a/src/Handler/DateHandler.php +++ b/src/Handler/DateHandler.php @@ -31,7 +31,7 @@ final class DateHandler implements SubscribingHandlerInterface /** * {@inheritdoc} */ - public static function getSubscribingMethods() + public static function getSubscribingMethods() : iterable { $methods = []; $types = ['DateTime', 'DateTimeImmutable', 'DateInterval']; diff --git a/src/Handler/FormErrorHandler.php b/src/Handler/FormErrorHandler.php index 60a40a454..e35037f7e 100644 --- a/src/Handler/FormErrorHandler.php +++ b/src/Handler/FormErrorHandler.php @@ -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) { diff --git a/src/Handler/IteratorHandler.php b/src/Handler/IteratorHandler.php index b0971f59d..a16141d9a 100644 --- a/src/Handler/IteratorHandler.php +++ b/src/Handler/IteratorHandler.php @@ -21,7 +21,7 @@ final class IteratorHandler implements SubscribingHandlerInterface /** * {@inheritdoc} */ - public static function getSubscribingMethods() + public static function getSubscribingMethods() : iterable { $methods = []; diff --git a/src/Handler/StdClassHandler.php b/src/Handler/StdClassHandler.php index 2e4686a67..f73fd18cb 100644 --- a/src/Handler/StdClassHandler.php +++ b/src/Handler/StdClassHandler.php @@ -17,7 +17,7 @@ final class StdClassHandler implements SubscribingHandlerInterface /** * {@inheritdoc} */ - public static function getSubscribingMethods() + public static function getSubscribingMethods() : iterable { $methods = []; $formats = ['json', 'xml', 'yml']; diff --git a/src/Handler/SubscribingHandlerInterface.php b/src/Handler/SubscribingHandlerInterface.php index 4c206bc5d..1a4083b4b 100644 --- a/src/Handler/SubscribingHandlerInterface.php +++ b/src/Handler/SubscribingHandlerInterface.php @@ -20,9 +20,7 @@ interface SubscribingHandlerInterface * * The direction and method keys can be omitted. * - * @return array - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint + * @return iterable */ - public static function getSubscribingMethods(); + public static function getSubscribingMethods() : iterable; } diff --git a/tests/Serializer/GraphNavigatorTest.php b/tests/Serializer/GraphNavigatorTest.php index 33de10008..638caa6f0 100644 --- a/tests/Serializer/GraphNavigatorTest.php +++ b/tests/Serializer/GraphNavigatorTest.php @@ -209,7 +209,7 @@ class TestSubscribingHandler implements SubscribingHandlerInterface { public const FORMAT = 'foo'; - public static function getSubscribingMethods() + public static function getSubscribingMethods() : iterable { return [ [