cs fixes, better naming for ArgNode

This commit is contained in:
TomasVotruba 2017-09-09 01:13:44 +02:00
parent b529a60f0b
commit a3a4985aef
4 changed files with 19 additions and 5 deletions

View File

@ -30,6 +30,7 @@ checkers:
extraAllowedClasses:
- 'PhpParser\Node\*'
- 'PhpParser\Comment\Doc'
- SplObjectStorage # temporary before adding to Symplify\CodingStandard package
parameters:
exclude_checkers:

View File

@ -14,15 +14,15 @@ final class DeprecationCollector
/**
* @var Arg[]
*/
private $deprecationNodes = [];
private $deprecationArgNodes = [];
public function addDeprecationMessage(string $deprecationMessage): void
{
$this->deprecationMessages[] = $deprecationMessage;
}
public function addDeprecationNode(Arg $argNode): void
public function addDeprecationArgNode(Arg $argNode): void
{
$this->deprecationNodes[] = $argNode;
$this->deprecationArgNodes[] = $argNode;
}
}

View File

@ -7,7 +7,6 @@ use PhpParser\Node\Expr\FuncCall;
use PhpParser\NodeVisitorAbstract;
use Rector\DeprecationExtractor\Deprecation\DeprecationCollector;
use Rector\DeprecationExtractor\NodeAnalyzer\TriggerErrorAnalyzer;
use Rector\Node\Attribute;
use Rector\NodeAnalyzer\DocBlockAnalyzer;
/**
@ -52,7 +51,7 @@ final class DeprecationDetector extends NodeVisitorAbstract
if ($this->triggerErrorAnalyzer->isUserDeprecation($node)) {
/** @var FuncCall $node */
$argNode = $this->triggerErrorAnalyzer->messageNodeForNode($node);
$this->deprecationCollector->addDeprecationNode($argNode);
$this->deprecationCollector->addDeprecationArgNode($argNode);
return;
}

View File

@ -0,0 +1,14 @@
<?php declare(strict_types=1);
namespace Rector\DeprecationExtractor\Tranformer;
use Rector\DeprecationExtractor\Contract\Deprecation\DeprecationInterface;
final class MessageToDeprecationTransformer
{
public function transform(string $message): DeprecationInterface
{
dump($message);
die;
}
}