-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix interface implementer in AddOverrideAttributeToOverriddenMethodsR…
…ector, add override only in case of overiding parent method with contents (#6447)
- Loading branch information
1 parent
e562253
commit 26b4d97
Showing
10 changed files
with
173 additions
and
71 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
...OverriddenMethodsRector/Fixture/apply_attribute_to_override_method_from_interface.php.inc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../AddOverrideAttributeToOverriddenMethodsRector/Fixture/skip_abstract_trait_method.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Fixture; | ||
|
||
use Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Source\ExampleFromTrait; | ||
|
||
final class SkipAbstractTraitMethod | ||
{ | ||
use ExampleFromTrait; | ||
|
||
public function foo() | ||
{ | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ethod/AddOverrideAttributeToOverriddenMethodsRector/Fixture/skip_execute_override.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Fixture; | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
final class SkipExecuteOverride extends Command | ||
{ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$result = 100; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...assMethod/AddOverrideAttributeToOverriddenMethodsRector/Fixture/skip_on_interface.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Fixture; | ||
|
||
final class SkipOnInterface implements \Stringable | ||
{ | ||
public function __toString(): string | ||
{ | ||
return 'implements only'; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.../AddOverrideAttributeToOverriddenMethodsRector/Fixture/skip_on_parent_return_null.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Fixture; | ||
|
||
use PhpParser\Node; | ||
use PhpParser\NodeVisitorAbstract; | ||
|
||
final class SkipOnParentReturnNull extends NodeVisitorAbstract | ||
{ | ||
public function enterNode(Node $node) | ||
{ | ||
return 1; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...sMethod/AddOverrideAttributeToOverriddenMethodsRector/Fixture/skip_setup_override.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\Fixture; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class SkipSetupOverride extends TestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
$result = 1000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters