Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare (strict_types=1); namespace Rector\Symfony\NodeAnalyzer\Annotations; use P..
Decoded Output download
<?php
declare (strict_types=1);
namespace Rector\Symfony\NodeAnalyzer\Annotations;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Stmt;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\Exception\NotImplementedYetException;
use Rector\Symfony\NodeFactory\Annotations\DoctrineAnnotationFromNewFactory;
final class ClassAnnotationAssertResolver
{
/**
* @readonly
* @var \Rector\Symfony\NodeAnalyzer\Annotations\StmtMethodCallMatcher
*/
private $stmtMethodCallMatcher;
/**
* @readonly
* @var \Rector\Symfony\NodeFactory\Annotations\DoctrineAnnotationFromNewFactory
*/
private $doctrineAnnotationFromNewFactory;
public function __construct(\Rector\Symfony\NodeAnalyzer\Annotations\StmtMethodCallMatcher $stmtMethodCallMatcher, DoctrineAnnotationFromNewFactory $doctrineAnnotationFromNewFactory)
{
$this->stmtMethodCallMatcher = $stmtMethodCallMatcher;
$this->doctrineAnnotationFromNewFactory = $doctrineAnnotationFromNewFactory;
}
public function resolve(Stmt $stmt) : ?DoctrineAnnotationTagValueNode
{
$methodCall = $this->stmtMethodCallMatcher->match($stmt, 'addConstraint');
if (!$methodCall instanceof MethodCall) {
return null;
}
$args = $methodCall->getArgs();
$firstArgValue = $args[0]->value;
if (!$firstArgValue instanceof New_) {
throw new NotImplementedYetException();
}
return $this->doctrineAnnotationFromNewFactory->create($firstArgValue);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare (strict_types=1);
namespace Rector\Symfony\NodeAnalyzer\Annotations;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Stmt;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\Exception\NotImplementedYetException;
use Rector\Symfony\NodeFactory\Annotations\DoctrineAnnotationFromNewFactory;
final class ClassAnnotationAssertResolver
{
/**
* @readonly
* @var \Rector\Symfony\NodeAnalyzer\Annotations\StmtMethodCallMatcher
*/
private $stmtMethodCallMatcher;
/**
* @readonly
* @var \Rector\Symfony\NodeFactory\Annotations\DoctrineAnnotationFromNewFactory
*/
private $doctrineAnnotationFromNewFactory;
public function __construct(\Rector\Symfony\NodeAnalyzer\Annotations\StmtMethodCallMatcher $stmtMethodCallMatcher, DoctrineAnnotationFromNewFactory $doctrineAnnotationFromNewFactory)
{
$this->stmtMethodCallMatcher = $stmtMethodCallMatcher;
$this->doctrineAnnotationFromNewFactory = $doctrineAnnotationFromNewFactory;
}
public function resolve(Stmt $stmt) : ?DoctrineAnnotationTagValueNode
{
$methodCall = $this->stmtMethodCallMatcher->match($stmt, 'addConstraint');
if (!$methodCall instanceof MethodCall) {
return null;
}
$args = $methodCall->getArgs();
$firstArgValue = $args[0]->value;
if (!$firstArgValue instanceof New_) {
throw new NotImplementedYetException();
}
return $this->doctrineAnnotationFromNewFactory->create($firstArgValue);
}
}
Function Calls
None |
Stats
MD5 | c00f80c7e169d2e46815330190244607 |
Eval Count | 0 |
Decode Time | 235 ms |