remove unused code

This commit is contained in:
TomasVotruba 2018-02-08 17:33:57 +01:00
parent ae1e812a07
commit 6d6d99539d
2 changed files with 0 additions and 40 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}