Skip to content

Commit 4cde98f

Browse files
committed
Make data providers static
1 parent 6ac8057 commit 4cde98f

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

rector.php

+2
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

+1-28
Original file line numberDiff line numberDiff line change
@@ -236,34 +236,7 @@ protected static function getInvalidObjectValues(bool $includeNull = false): arr
236236

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

269242
/**

0 commit comments

Comments
 (0)