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\CodeQuality\NodeFactory; use Ph..
Decoded Output download
<?php
declare (strict_types=1);
namespace Rector\Symfony\CodeQuality\NodeFactory;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt;
use Rector\Naming\Naming\PropertyNaming;
final class SymfonyClosureFactory
{
/**
* @readonly
* @var \Rector\Naming\Naming\PropertyNaming
*/
private $propertyNaming;
public function __construct(PropertyNaming $propertyNaming)
{
$this->propertyNaming = $propertyNaming;
}
/**
* @param Stmt[] $stmts
*/
public function create(string $configClass, Closure $closure, array $stmts) : Closure
{
$closure->params[0] = $this->createConfigParam($configClass);
$closure->stmts = $stmts;
return $closure;
}
private function createConfigParam(string $configClass) : Param
{
$configVariable = $this->createConfigVariable($configClass);
$fullyQualified = new FullyQualified($configClass);
return new Param($configVariable, null, $fullyQualified);
}
private function createConfigVariable(string $configClass) : Variable
{
$variableName = $this->propertyNaming->fqnToVariableName($configClass);
return new Variable($variableName);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare (strict_types=1);
namespace Rector\Symfony\CodeQuality\NodeFactory;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt;
use Rector\Naming\Naming\PropertyNaming;
final class SymfonyClosureFactory
{
/**
* @readonly
* @var \Rector\Naming\Naming\PropertyNaming
*/
private $propertyNaming;
public function __construct(PropertyNaming $propertyNaming)
{
$this->propertyNaming = $propertyNaming;
}
/**
* @param Stmt[] $stmts
*/
public function create(string $configClass, Closure $closure, array $stmts) : Closure
{
$closure->params[0] = $this->createConfigParam($configClass);
$closure->stmts = $stmts;
return $closure;
}
private function createConfigParam(string $configClass) : Param
{
$configVariable = $this->createConfigVariable($configClass);
$fullyQualified = new FullyQualified($configClass);
return new Param($configVariable, null, $fullyQualified);
}
private function createConfigVariable(string $configClass) : Variable
{
$variableName = $this->propertyNaming->fqnToVariableName($configClass);
return new Variable($variableName);
}
}
Function Calls
None |
Stats
MD5 | 9baf53979d037ab280e7e54d781817f0 |
Eval Count | 0 |
Decode Time | 83 ms |