-
-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update text for FileProccessor to use Rector interface contract (#6289)
- Loading branch information
1 parent
6f30aff
commit cd8be43
Showing
4 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
tests/Application/ApplicationFileProcessor/Source/Contract/TextRectorInterface.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,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\Tests\Application\ApplicationFileProcessor\Source\Contract; | ||
|
||
use Rector\Core\Contract\Rector\RectorInterface; | ||
|
||
interface TextRectorInterface extends RectorInterface | ||
{ | ||
public function refactorContent(string $content): string; | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/Application/ApplicationFileProcessor/Source/Rector/ChangeTextRector.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\Tests\Application\ApplicationFileProcessor\Source\Rector; | ||
|
||
use Rector\Core\Tests\Application\ApplicationFileProcessor\Source\Contract\TextRectorInterface; | ||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; | ||
|
||
final class ChangeTextRector implements TextRectorInterface | ||
{ | ||
public function refactorContent(string $content): string | ||
{ | ||
return str_replace('Foo', 'Bar', $content); | ||
} | ||
|
||
public function getRuleDefinition(): RuleDefinition | ||
{ | ||
// just for docs | ||
} | ||
} |
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