Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SubscribingHandlerInterface::getSubscribingMethods() return iterable #1227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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