Skip to content

Commit

Permalink
rename to NoParamTypeRemoval rule
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 28, 2024
1 parent 04121be commit 5131f17
Show file tree
Hide file tree
Showing 25 changed files with 85 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @see \Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\ForbiddenParamTypeRemovalRuleTest
* @implements Rule<ClassMethod>
*/
final readonly class ForbiddenParamTypeRemovalRule implements Rule
final readonly class NoParamTypeRemovalRule implements Rule
{
/**
* @var string
Expand Down

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/Rules/ForbiddenParamTypeRemovalRule/Fixture/SkipNoType.php

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions tests/Rules/ForbiddenParamTypeRemovalRule/Source/SomeNode.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

interface AnInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use stdClass;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class HasDifferentParameterWithInterfaceMethod implements AnInterface, AnInterfaceOther
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class HasDifferentParameterWithParentMethod extends ParentClass
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class ParentClass
{
Expand Down
14 changes: 14 additions & 0 deletions tests/Rules/NoParamTypeRemovalRule/Fixture/RemoveParentType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source\SomeRectorInterface;

final class RemoveParentType implements SomeRectorInterface
{
public function refactor($node)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use stdClass;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class SkipHasSameParameterWithParentMethod extends ParentClass
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;

Expand Down
9 changes: 9 additions & 0 deletions tests/Rules/NoParamTypeRemovalRule/Fixture/SkipNoParent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class SkipNoParent
{
}
14 changes: 14 additions & 0 deletions tests/Rules/NoParamTypeRemovalRule/Fixture/SkipNoType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source\NoTypeInterface;

final class SkipNoType implements NoTypeInterface
{
public function noType($node)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

class SkipNotHasParentMethod extends ParentClass
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Fixture;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Source\PhpDocType;
use Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source\PhpDocType;

final class SkipPhpDocType extends PhpDocType
{
Expand Down
15 changes: 15 additions & 0 deletions tests/Rules/NoParamTypeRemovalRule/Fixture/SkipPresentType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Fixture;

use Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source\SomeNode;
use Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source\SomeRectorInterface;

final class SkipPresentType implements SomeRectorInterface
{
public function refactor(SomeNode $node)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule;

use Iterator;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\TypePerfect\Rules\ForbiddenParamTypeRemovalRule;
use Rector\TypePerfect\Rules\NoParamTypeRemovalRule;

final class ForbiddenParamTypeRemovalRuleTest extends RuleTestCase
final class NoParamTypeRemovalRuleTest extends RuleTestCase
{
/**
* @param mixed[] $expectedErrorMessagesWithLines
Expand All @@ -29,7 +29,7 @@ public static function provideData(): Iterator

yield [__DIR__ . '/Fixture/SkipIndirectRemoval.php', []];

yield [__DIR__ . '/Fixture/RemoveParentType.php', [[ForbiddenParamTypeRemovalRule::ERROR_MESSAGE, 11]]];
yield [__DIR__ . '/Fixture/RemoveParentType.php', [[NoParamTypeRemovalRule::ERROR_MESSAGE, 11]]];

yield [__DIR__ . '/Fixture/SkipNoParent.php', []];
yield [__DIR__ . '/Fixture/SkipNotHasParentMethod.php', []];
Expand All @@ -38,12 +38,12 @@ public static function provideData(): Iterator

yield [
__DIR__ . '/Fixture/HasDifferentParameterWithParentMethod.php',
[[ForbiddenParamTypeRemovalRule::ERROR_MESSAGE, 9]],
[[NoParamTypeRemovalRule::ERROR_MESSAGE, 9]],
];
yield [
__DIR__ . '/Fixture/HasDifferentParameterWithInterfaceMethod.php',
[[ForbiddenParamTypeRemovalRule::ERROR_MESSAGE, 9], [
ForbiddenParamTypeRemovalRule::ERROR_MESSAGE,
[[NoParamTypeRemovalRule::ERROR_MESSAGE, 9], [
NoParamTypeRemovalRule::ERROR_MESSAGE,
13,
]],
];
Expand All @@ -59,6 +59,6 @@ public static function getAdditionalConfigFiles(): array

protected function getRule(): Rule
{
return self::getContainer()->getByType(ForbiddenParamTypeRemovalRule::class);
return self::getContainer()->getByType(NoParamTypeRemovalRule::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Source;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source;

interface NoTypeInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Source;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source;

class PhpDocType
{
Expand Down
10 changes: 10 additions & 0 deletions tests/Rules/NoParamTypeRemovalRule/Source/SomeNode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source;

final class SomeNode
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\ForbiddenParamTypeRemovalRule\Source;
namespace Rector\TypePerfect\Tests\Rules\NoParamTypeRemovalRule\Source;

interface SomeRectorInterface
{
Expand Down

0 comments on commit 5131f17

Please sign in to comment.