Lines Matching refs:callable

27         if ($this->hasAttribute('callable') && $callable = $this->getAttribute('callable')) {
28 if (\is_string($callable) && false === strpos($callable, '::')) {
29 $compiler->raw($callable);
31 list($r, $callable) = $this->reflectCallable($callable);
32 if ($r instanceof \ReflectionMethod && \is_string($callable[0])) {
34 $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1]));
36 … $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
38 … } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) {
39 …iler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($callable[0]), $callable[1]));
96 $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null;
98 $arguments = $this->getArguments($callable, $this->getNode('arguments'));
112 protected function getArguments($callable, $arguments) argument
135 if (!$callable) {
145 $callableParameters = $this->getCallableParameters($callable, $isVariadic);
229 private function getCallableParameters($callable, $isVariadic) argument
231 list($r) = $this->reflectCallable($callable);
268 private function reflectCallable($callable) argument
274 if (\is_array($callable)) {
275 if (!method_exists($callable[0], $callable[1])) {
279 $r = new \ReflectionMethod($callable[0], $callable[1]);
280 } elseif (\is_object($callable) && !$callable instanceof \Closure) {
281 $r = new \ReflectionObject($callable);
283 $callable = [$callable, '__invoke'];
284 } elseif (\is_string($callable) && false !== $pos = strpos($callable, '::')) {
285 $class = substr($callable, 0, $pos);
286 $method = substr($callable, $pos + 2);
291 $r = new \ReflectionMethod($callable);
292 $callable = [$class, $method];
294 $r = new \ReflectionFunction($callable);
297 return $this->reflector = [$r, $callable];