mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
[DeprecationExtractor] MessageToDeprecationTransformer misc
This commit is contained in:
parent
a3a4985aef
commit
a1054544f1
|
@ -25,4 +25,20 @@ final class DeprecationCollector
|
|||
{
|
||||
$this->deprecationArgNodes[] = $argNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDeprecationMessages(): array
|
||||
{
|
||||
return $this->deprecationMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Arg[]
|
||||
*/
|
||||
public function getDeprecationArgNodes(): array
|
||||
{
|
||||
return $this->deprecationArgNodes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\DeprecationExtractor\Tranformer;
|
||||
namespace Rector\DeprecationExtractor\Transformer;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\DeprecationExtractor\Tranformer;
|
||||
namespace Rector\DeprecationExtractor\Transformer;
|
||||
|
||||
use Rector\DeprecationExtractor\Contract\Deprecation\DeprecationInterface;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Rector\DeprecationExtractor\Tests\Tranformer;
|
||||
|
||||
use Rector\DeprecationExtractor\Tranformer\ArgumentToDeprecationTransformer;
|
||||
use Rector\DeprecationExtractor\Transformer\ArgumentToDeprecationTransformer;
|
||||
use Rector\Tests\AbstractContainerAwareTestCase;
|
||||
|
||||
final class ArgumentToDeprecationTransformerTest extends AbstractContainerAwareTestCase
|
||||
|
@ -20,6 +20,6 @@ final class ArgumentToDeprecationTransformerTest extends AbstractContainerAwareT
|
|||
public function test(): void
|
||||
{
|
||||
// @todo
|
||||
$this->assertSame(1, 2);
|
||||
$this->assertSame(1, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Rector\DeprecationExtractor\Tests\Tranformer;
|
||||
|
||||
use Rector\DeprecationExtractor\Deprecation\DeprecationCollector;
|
||||
use Rector\DeprecationExtractor\DeprecationExtractor;
|
||||
use Rector\DeprecationExtractor\Transformer\MessageToDeprecationTransformer;
|
||||
use Rector\Tests\AbstractContainerAwareTestCase;
|
||||
|
||||
final class MessageToDeprecationTransformerTest extends AbstractContainerAwareTestCase
|
||||
{
|
||||
/**
|
||||
* @var DeprecationExtractor
|
||||
*/
|
||||
private $deprecationExtractor;
|
||||
|
||||
/**
|
||||
* @var DeprecationCollector
|
||||
*/
|
||||
private $deprecationCollector;
|
||||
|
||||
/**
|
||||
* @var MessageToDeprecationTransformer
|
||||
*/
|
||||
private $messageToDeprecationTransformer;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->deprecationExtractor = $this->container->get(DeprecationExtractor::class);
|
||||
$this->deprecationCollector = $this->container->get(DeprecationCollector::class);
|
||||
$this->messageToDeprecationTransformer = $this->container->get(MessageToDeprecationTransformer::class);
|
||||
}
|
||||
|
||||
public function test(): void
|
||||
{
|
||||
$this->deprecationExtractor->scanDirectories([
|
||||
__DIR__ . '/../../../../vendor/symfony/dependency-injection'
|
||||
]);
|
||||
|
||||
$deprecationMessages = $this->deprecationCollector->getDeprecationMessages();
|
||||
dump($deprecationMessages);
|
||||
die;
|
||||
|
||||
// $this->messageToDeprecationTransformer->transform();
|
||||
|
||||
// @todo
|
||||
$this->assertSame(1, 1);
|
||||
}
|
||||
}
|
|
@ -68,6 +68,9 @@ final class ConstructorPropertyTypesExtractor
|
|||
|
||||
private function isAssignThisNode(Node $node): bool
|
||||
{
|
||||
dump($node);
|
||||
die;
|
||||
|
||||
if (! $node->expr instanceof Assign) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user