Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0c0160

Browse files
authored
chore: update return type of FixerOptionInterface::getAllowedValues (#8530)
1 parent ae464bc commit b0c0160

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/FixerConfiguration/AliasedFixerOptionBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function setAllowedTypes(array $allowedTypes): self
5252
}
5353

5454
/**
55-
* @param list<null|(callable(mixed): bool)|scalar> $allowedValues
55+
* @param non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues
5656
*/
5757
public function setAllowedValues(array $allowedValues): self
5858
{

src/FixerConfiguration/FixerOption.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ final class FixerOption implements FixerOptionInterface
3636
private ?array $allowedTypes;
3737

3838
/**
39-
* @var null|list<null|(callable(mixed): bool)|scalar>
39+
* @var null|non-empty-list<null|(callable(mixed): bool)|scalar>
4040
*/
4141
private ?array $allowedValues;
4242

4343
private ?\Closure $normalizer;
4444

4545
/**
46-
* @param mixed $default
47-
* @param null|list<string> $allowedTypes
48-
* @param null|list<null|(callable(mixed): bool)|scalar> $allowedValues
46+
* @param mixed $default
47+
* @param null|list<string> $allowedTypes
48+
* @param null|non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues
4949
*/
5050
public function __construct(
5151
string $name,

src/FixerConfiguration/FixerOptionBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class FixerOptionBuilder
3333
private ?array $allowedTypes = null;
3434

3535
/**
36-
* @var null|list<null|(callable(mixed): bool)|scalar>
36+
* @var null|non-empty-list<null|(callable(mixed): bool)|scalar>
3737
*/
3838
private ?array $allowedValues = null;
3939

@@ -74,7 +74,7 @@ public function setAllowedTypes(array $allowedTypes): self
7474
}
7575

7676
/**
77-
* @param list<null|(callable(mixed): bool)|scalar> $allowedValues
77+
* @param non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues
7878
*
7979
* @return $this
8080
*/

src/FixerConfiguration/FixerOptionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getDefault();
3535
public function getAllowedTypes(): ?array;
3636

3737
/**
38-
* @return null|list<null|(callable(mixed): bool)|scalar>
38+
* @return null|non-empty-list<null|(callable(mixed): bool)|scalar>
3939
*/
4040
public function getAllowedValues(): ?array;
4141

tests/Console/Command/HelpCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testGetDisplayableAllowedValues($expected, FixerOptionInterface
3838

3939
public static function provideGetDisplayableAllowedValuesCases(): iterable
4040
{
41-
yield [null, new FixerOption('foo', 'bar', false, null, ['int'], [])];
41+
yield [null, new FixerOption('foo', 'bar', false, null, ['int'])];
4242

4343
yield [['A', 'B', 'x', 'z'], new FixerOption('foo', 'bar', false, null, ['string'], ['z', 'x', 'B', 'A'])];
4444

tests/FixerConfiguration/AliasedFixerOptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static function provideGetAllowedTypesCases(): iterable
142142
}
143143

144144
/**
145-
* @param null|list<null|(callable(mixed): bool)|scalar> $allowedValues
145+
* @param null|non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues
146146
*
147147
* @dataProvider provideGetAllowedValuesCases
148148
*/

tests/RuleSet/RuleSetsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private static function assertPHPUnitVersionIsLargestAllowed(string $setName, st
196196

197197
foreach ($fixer->getConfigurationDefinition()->getOptions() as $option) {
198198
if ('target' === $option->getName()) {
199-
/** @var list<PhpUnitTargetVersion::VERSION_*> */
199+
/** @var non-empty-list<PhpUnitTargetVersion::VERSION_*> */
200200
$allowedValues = $option->getAllowedValues();
201201

202202
$allowedVersionsForFixer = array_diff(

0 commit comments

Comments
 (0)