Skip to content

Commit

Permalink
Make all data providers return iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Nov 13, 2023
1 parent b3c0de6 commit 43b782e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions phpstan.tests.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ parameters:
-
message: '#RepositoryInterface (but )?does not specify its types#'
path: tests/lib/Validator/RepositoryValidatorFactory.php

# Disable errors about missing value types in PHPUnit data providers

- '#Method .+Test::\w+DataProvider\(\) return type has no value type specified in iterable type iterable.#'
13 changes: 3 additions & 10 deletions tests/lib/Parameters/ParameterType/SectionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ public function testInvalidOptions(array $options): void

/**
* Provider for testing valid parameter attributes.
*
* @return mixed[]
*/
public static function validOptionsDataProvider(): array
public static function validOptionsDataProvider(): iterable
{
return [
[
Expand All @@ -75,10 +73,8 @@ public static function validOptionsDataProvider(): array

/**
* Provider for testing invalid parameter attributes.
*
* @return mixed[]
*/
public static function invalidOptionsDataProvider(): array
public static function invalidOptionsDataProvider(): iterable
{
return [
[
Expand Down Expand Up @@ -144,10 +140,7 @@ public function testIsValueEmpty(mixed $value, bool $isEmpty): void
self::assertSame($isEmpty, $this->type->isValueEmpty(new ParameterDefinition(), $value));
}

/**
* @return mixed[]
*/
public static function emptyDataProvider(): array
public static function emptyDataProvider(): iterable
{
return [
[null, true],
Expand Down

0 comments on commit 43b782e

Please sign in to comment.