Skip to content

Commit b141a6b

Browse files
committed
Make data providers static
1 parent 12f3d67 commit b141a6b

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Rector\Config\RectorConfig;
44
use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector;
55
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
6+
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
67
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
78
use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector;
89
use Rector\PHPUnit\Set\PHPUnitSetList;
@@ -27,6 +28,7 @@
2728

2829
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified
2930
$rectorConfig->skip([
31+
RemoveExtraParametersRector::class,
3032
// Do not use ternaries extensively
3133
IfIssetToCoalescingRector::class,
3234
ChangeSwitchToMatchRector::class => [

tests/TestCase.php

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -237,34 +237,7 @@ protected static function getInvalidObjectValues(bool $includeNull = false): arr
237237

238238
protected static function getInvalidDocumentCodecValues(): array
239239
{
240-
$codec = new class implements Codec {
241-
use DecodeIfSupported;
242-
use EncodeIfSupported;
243-
244-
public function canDecode(mixed $value): bool
245-
{
246-
return true;
247-
}
248-
249-
public function decode(mixed $value): mixed
250-
{
251-
return $value;
252-
}
253-
254-
public function canEncode(mixed $value): bool
255-
{
256-
return true;
257-
}
258-
259-
public function encode(mixed $value): mixed
260-
{
261-
return $value;
262-
}
263-
};
264-
// @fixme: createStub can be called statically in PHPUnit 10
265-
// $codec = self::createStub(Codec::class);
266-
267-
return [123, 3.14, 'foo', true, [], new stdClass(), $codec];
240+
return [123, 3.14, 'foo', true, [], new stdClass(), self::createStub(Codec::class)];
268241
}
269242

270243
/**

0 commit comments

Comments
 (0)