__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ExpressionLanguage\Node;
use Symfony\Component\ExpressionLanguage\Compiler;
/**
* Represents a node in the AST.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Node
{
public $nodes = [];
public $attributes = [];
/**
* @param array $nodes An array of nodes
* @param array $attributes An array of attributes
*/
public function __construct(array $nodes = [], array $attributes = [])
{
$this->nodes = $nodes;
$this->attributes = $attributes;
}
public function __toString(): string
{
$attributes = [];
foreach ($this->attributes as $name => $value) {
$attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true)));
}
$repr = [str_replace('Symfony\Component\ExpressionLanguage\Node\\', '', static::class).'('.implode(', ', $attributes)];
if (\count($this->nodes)) {
foreach ($this->nodes as $node) {
foreach (explode("\n", (string) $node) as $line) {
$repr[] = ' '.$line;
}
}
$repr[] = ')';
} else {
$repr[0] .= ')';
}
return implode("\n", $repr);
}
/**
* @return void
*/
public function compile(Compiler $compiler)
{
foreach ($this->nodes as $node) {
$node->compile($compiler);
}
}
/**
* @return mixed
*/
public function evaluate(array $functions, array $values)
{
$results = [];
foreach ($this->nodes as $node) {
$results[] = $node->evaluate($functions, $values);
}
return $results;
}
/**
* @return array
*
* @throws \BadMethodCallException when this node cannot be transformed to an array
*/
public function toArray()
{
throw new \BadMethodCallException(sprintf('Dumping a "%s" instance is not supported yet.', static::class));
}
/**
* @return string
*/
public function dump()
{
$dump = '';
foreach ($this->toArray() as $v) {
$dump .= \is_scalar($v) ? $v : $v->dump();
}
return $dump;
}
/**
* @return string
*/
protected function dumpString(string $value)
{
return sprintf('"%s"', addcslashes($value, "\0\t\"\\"));
}
/**
* @return bool
*/
protected function isHash(array $value)
{
$expectedKey = 0;
foreach ($value as $key => $val) {
if ($key !== $expectedKey++) {
return true;
}
}
return false;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| ArgumentsNode.php | File | 832 B | 0644 |
|
| ArrayNode.php | File | 2.7 KB | 0644 |
|
| BinaryNode.php | File | 6.27 KB | 0644 |
|
| ConditionalNode.php | File | 1.41 KB | 0644 |
|
| ConstantNode.php | File | 2.09 KB | 0644 |
|
| FunctionNode.php | File | 1.64 KB | 0644 |
|
| GetAttrNode.php | File | 6.03 KB | 0644 |
|
| NameNode.php | File | 942 B | 0644 |
|
| Node.php | File | 2.88 KB | 0644 |
|
| NullCoalesceNode.php | File | 1.65 KB | 0644 |
|
| UnaryNode.php | File | 1.43 KB | 0644 |
|