HtmlEmailFooterView.php
2 years ago
HtmlReportEmailHeaderView.php
1 month ago
MethodCallExpression.php
1 year ago
OneClickDone.php
6 months ago
RenderTokenParser.php
1 year ago
SecurityPolicy.php
1 month ago
UIControl.php
1 month ago
ViewInterface.php
1 year ago
MethodCallExpression.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is a modified file from Twig 1.x. |
| 5 | * |
| 6 | * (c) Fabien Potencier |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with it's source code. |
| 10 | */ |
| 11 | namespace Piwik\View; |
| 12 | |
| 13 | use Matomo\Dependencies\Twig\Compiler; |
| 14 | use Matomo\Dependencies\Twig\Node\Expression\AbstractExpression; |
| 15 | use Matomo\Dependencies\Twig\Node\Expression\ArrayExpression; |
| 16 | use Matomo\Dependencies\Twig\Node\Expression\NameExpression; |
| 17 | class MethodCallExpression extends AbstractExpression |
| 18 | { |
| 19 | public function __construct(AbstractExpression $node, $method, ArrayExpression $arguments, $lineno) |
| 20 | { |
| 21 | parent::__construct(['node' => $node, 'arguments' => $arguments], ['method' => $method, 'safe' => \false], $lineno); |
| 22 | if ($node instanceof NameExpression) { |
| 23 | $node->setAttribute('always_defined', \true); |
| 24 | } |
| 25 | } |
| 26 | public function compile(Compiler $compiler) |
| 27 | { |
| 28 | $compiler->subcompile($this->getNode('node'))->raw('->')->raw($this->getAttribute('method'))->raw('('); |
| 29 | $first = \true; |
| 30 | foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { |
| 31 | if (!$first) { |
| 32 | $compiler->raw(', '); |
| 33 | } |
| 34 | $first = \false; |
| 35 | $compiler->subcompile($pair['value']); |
| 36 | } |
| 37 | $compiler->raw(')'); |
| 38 | } |
| 39 | } |
| 40 |