mirror of https://github.com/rectorphp/rector.git
remove unused code
This commit is contained in:
parent
ae1e812a07
commit
6d6d99539d
|
@ -1,13 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\ReflectionDocBlock\DocBlock;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
|
||||
final class AnnotationReplacer
|
||||
{
|
||||
public function replaceOldByNew(string $content, string $oldAnnotation, string $newAnnotation): string
|
||||
{
|
||||
return Strings::replace($content, sprintf('#@%s#', $oldAnnotation), '@' . $newAnnotation);
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\ReflectionDocBlock\Tests\DocBlock;
|
||||
|
||||
use Rector\ReflectionDocBlock\DocBlock\AnnotationReplacer;
|
||||
use Rector\Tests\AbstractContainerAwareTestCase;
|
||||
|
||||
final class AnnotationReplacerTest extends AbstractContainerAwareTestCase
|
||||
{
|
||||
/**
|
||||
* @var AnnotationReplacer
|
||||
*/
|
||||
private $annotationReplacer;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->annotationReplacer = $this->container->get(AnnotationReplacer::class);
|
||||
}
|
||||
|
||||
public function test(): void
|
||||
{
|
||||
$oldContent = '/** @oldAnnotation */';
|
||||
$newContent = $this->annotationReplacer->replaceOldByNew($oldContent, 'oldAnnotation', 'newAnnotation');
|
||||
|
||||
$this->assertSame('/** @newAnnotation */', $newContent);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue