Skip to content

Commit e1f34c3

Browse files
committed
Make data providers static
1 parent c882ba3 commit e1f34c3

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
@@ -239,34 +239,7 @@ protected static function getInvalidObjectValues(bool $includeNull = false): arr
239239

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

272245
/**

0 commit comments

Comments
 (0)