Lines Matching refs:callable

25         $callable = $this->getAttribute('callable');
29 if (\is_string($callable) && false === strpos($callable, '::')) {
30 $compiler->raw($callable);
32 list($r, $callable) = $this->reflectCallable($callable);
33 if ($r instanceof \ReflectionMethod && \is_string($callable[0])) {
35 $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1]));
37 … $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
39 … } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) {
41 $class = (new \ReflectionClass(\get_class($callable[0])))->name;
49 $compiler->raw(sprintf('->%s', $callable[1]));
102 $callable = $this->getAttribute('callable');
103 $arguments = $this->getArguments($callable, $this->getNode('arguments'));
116 protected function getArguments($callable, $arguments) argument
139 if (!$callable) {
149 … list($callableParameters, $isPhpVariadic) = $this->getCallableParameters($callable, $isVariadic);
157 if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) {
246 private function getCallableParameters($callable, bool $isVariadic): array argument
248 list($r) = $this->reflectCallable($callable);
290 private function reflectCallable($callable) argument
296 if (\is_array($callable)) {
297 if (!method_exists($callable[0], $callable[1])) {
301 $r = new \ReflectionMethod($callable[0], $callable[1]);
302 } elseif (\is_object($callable) && !$callable instanceof \Closure) {
303 $r = new \ReflectionObject($callable);
305 $callable = [$callable, '__invoke'];
306 } elseif (\is_string($callable) && false !== $pos = strpos($callable, '::')) {
307 $class = substr($callable, 0, $pos);
308 $method = substr($callable, $pos + 2);
313 $r = new \ReflectionMethod($callable);
314 $callable = [$class, $method];
316 $r = new \ReflectionFunction($callable);
319 return $this->reflector = [$r, $callable];