-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php80] Add implements interface support on single file on AddParamBa…
…sedOnParentClassMethodRector (#2660)
- Loading branch information
1 parent
84012e4
commit db7012e
Showing
6 changed files
with
143 additions
and
17 deletions.
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
...r/ClassMethod/AddParamBasedOnParentClassMethodRector/Fixture/implements_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,41 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
/** | ||
* Both interface and class on same file on purpose to ensure locate | ||
* parent interface bug | ||
*/ | ||
interface InterfaceWithParam | ||
{ | ||
public function execute($foo); | ||
} | ||
|
||
class ImplementsInterface implements InterfaceWithParam { | ||
public function execute() | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
/** | ||
* Both interface and class on same file on purpose to ensure locate | ||
* parent interface bug | ||
*/ | ||
interface InterfaceWithParam | ||
{ | ||
public function execute($foo); | ||
} | ||
|
||
class ImplementsInterface implements InterfaceWithParam { | ||
public function execute($foo) | ||
{ | ||
} | ||
} | ||
|
||
?> |
41 changes: 41 additions & 0 deletions
41
...ethod/AddParamBasedOnParentClassMethodRector/Fixture/implements_interface_flipped.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,41 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
class ImplementsInterfaceFlipped implements InterfaceWithParamFlipped { | ||
public function execute() | ||
{ | ||
} | ||
} | ||
|
||
/** | ||
* Both interface and class on same file on purpose to ensure locate | ||
* parent interface bug | ||
*/ | ||
interface InterfaceWithParamFlipped | ||
{ | ||
public function execute($foo); | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
class ImplementsInterfaceFlipped implements InterfaceWithParamFlipped { | ||
public function execute($foo) | ||
{ | ||
} | ||
} | ||
|
||
/** | ||
* Both interface and class on same file on purpose to ensure locate | ||
* parent interface bug | ||
*/ | ||
interface InterfaceWithParamFlipped | ||
{ | ||
public function execute($foo); | ||
} | ||
|
||
?> |
27 changes: 27 additions & 0 deletions
27
...d/AddParamBasedOnParentClassMethodRector/Fixture/implements_interface_from_source.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Source\InterfaceWithParam; | ||
|
||
class ImplementsInterfaceFromSource implements InterfaceWithParam { | ||
public function execute() | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Source\InterfaceWithParam; | ||
|
||
class ImplementsInterfaceFromSource implements InterfaceWithParam { | ||
public function execute($foo) | ||
{ | ||
} | ||
} | ||
|
||
?> |
8 changes: 8 additions & 0 deletions
8
...0/Rector/ClassMethod/AddParamBasedOnParentClassMethodRector/Source/InterfaceWithParam.php
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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\Source; | ||
|
||
interface InterfaceWithParam | ||
{ | ||
public function execute($foo); | ||
} |
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