Skip to content

Commit

Permalink
Make self option applied also on shared variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Feb 5, 2018
1 parent 5dbd484 commit 2ef3083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Phug/Renderer/Partial/AdapterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function getSandboxCall(&$source, $method, $path, $input, callable $getS
$adapter = $this->getAdapter();
$display = function () use ($adapter, $path, $input, $getSource, $parameters) {
/* @var CacheInterface $adapter */
$adapter->displayCached($path, $input, $getSource, $this->mergeWithSharedVariables($parameters));
$adapter->displayCached($path, $input, $getSource, $parameters);
};

return in_array($method, ['display', 'displayFile'])
Expand All @@ -137,7 +137,7 @@ private function getSandboxCall(&$source, $method, $path, $input, callable $getS

return $adapter->$method(
$source,
$this->mergeWithSharedVariables($parameters)
$parameters
);
});
}
Expand Down Expand Up @@ -195,7 +195,7 @@ public function callAdapter($method, $path, $input, callable $getSource, array $
$input = $renderEvent->getInput();
$path = $renderEvent->getPath();
$method = $renderEvent->getMethod();
$parameters = $renderEvent->getParameters();
$parameters = $this->mergeWithSharedVariables($renderEvent->getParameters());
if ($self = $this->getOption('self')) {
$self = $self === true ? 'self' : strval($self);
$parameters = [
Expand Down

0 comments on commit 2ef3083

Please sign in to comment.