Executes one callback from the top with given arguments without taking it out
@param  mixed ...$args Arguments
@return boolean
765896
public function executeAndKeepOne(...$args)
    {
        if ($this->isEmpty()) {
            return false;
        }
        $cb = $this->shift();
        $this->unshift($cb);
        if ($cb) {
            $cb(...$args);
        }
        return true;
    }
312943
public function exec($args)
    {
        $cmd = 'gcloud ' . implode(' ', array_map('escapeshellarg', $args));
        exec($cmd, $output, $ret);
        return [$ret, $output];
    }
166288
final public function execute(...$args)
    {
        $className = get_class($this);

        if (!method_exists($this, 'process')) {
            throw new RuntimeException(
                sprintf(
                    'Context "%s" should have process method',
                    $className
                )
            );
        }

        $process = new ReflectionMethod($className, 'process');

        if (!$process->isProtected()) {
            throw new RuntimeException('Method "process" should be protected');
        }

        return call_user_func_array([$this, 'process'], $args);
    }
223795
public static function fire($event, array $args = [])
    {
        if (!isset(self::$events[$event])) {
            return false;
        }

        // call event handlers of the event.
        foreach ((array)self::$eventHandlers[$event] as $cb) {
            // return FALSE to stop go on handle.
            if (false === PhpHelper::call($cb, ...$args)) {
                break;
            }
        }

        // is a once event, remove it
        if (self::$events[$event]) {
            return self::off($event);
        }

        return true;
    }
607149
public function matchArgs($args)
    {
        if ($this->_args === null || $args === null) {
            return true;
        }
        $arg = $this->_classes['arg'];
        foreach ($this->_args as $expected) {
            $actual = array_shift($args);
            if ($expected instanceof $arg) {
                if (!$expected->match($actual)) {
                    return false;
                }
            } elseif ($actual !== $expected) {
                return false;
            }
        }
        return true;
    }
754704
public function args(array $arguments)
    {
        // provide a new instance of the scheduler class if this
        // is the first method that was called.  This allows for
        // $scheduler->opts() to return a new instance of the
        // scheduler when it's first called
        if (count($this->options) == 0) {
            $scheduler = App::make(get_called_class());
            $scheduler->setArguments($arguments);

            return $scheduler;
        }

        $this->setArguments($arguments);

        return $this;
    }
735535
private function execute_callback(
		callable $callback, array $args, bool $is_raw=null
	) {
		$method = strtolower($this->request_method);

		if (in_array($method, ['head', 'get', 'options']))
			return $this->finish_callback($callback, $args);

		if ($method == 'post') {
			$args['post'] = $is_raw ?
				file_get_contents("php://input") : $_POST;
			if (isset($_FILES) && !empty($_FILES))
				$args['files'] = $_FILES;
			return $this->finish_callback($callback, $args);
		}

		if (in_array($method, ['put', 'delete', 'patch'])) {
			$args[$method] = file_get_contents("php://input");
			return $this->finish_callback($callback, $args);
		}

		# TRACE, CONNECT, etc. is not supported, in case web server
		# hasn't disabled them
		self::$logger->warning(sprintf(
			"Router: %s not supported in '%s'.",
			$this->request_method, $this->request_path));
		$this->abort(405);

		# always return self for chaining even if aborted
		return $this;
	}
969737
public function execute($callable, array $args = [], $context = null)
    {
        if ($callable instanceof \Closure) {
            $ref = new \ReflectionObject($callable);

            $args = $this->getMethodArgs($ref->getMethod('__invoke'), $args);
        } else {
            if (is_string($callable)) {
                $callable = explode('::', $callable);
            }

            list($object, $method) = $callable;

            $ref = new \ReflectionClass($object);

            $args = $this->getMethodArgs($ref->getMethod($method), $args);
        }

        $closure = function () use ($args, $callable) {
            switch (count($args)) {
                case 0:
                    return $callable();
                case 1:
                    return $callable($args[0]);
                case 2:
                    return $callable($args[0], $args[1]);
                case 3:
                    return $callable($args[0], $args[1], $args[2]);
                case 4:
                    return $callable($args[0], $args[1], $args[2], $args[3]);
                default:
                    return call_user_func_array($callable, $args);
            }
        };

        if ($context) {
            $closure = $closure->bindTo($context, $context);
        }

        return $closure();
    }
631846
public function run($args)
    {
        if (!isset($args[0]) || !$args[0]) {
            return $this->exec('check', [$this->cwd]);
        }

        $name = trim($args[0]);
        if (is_dir($path = $this->cwd.'/repository/'.$name)) {
            return $this->exec('check', [$path]);
        }

        return $this->error('Required project name.');
    }
790492
public function set($callback, $args = [])
    {
        if (!$this->app) {
            throw new Exception(['Call-back must be part of a RenderTree']);
        }

        $this->view = $this->owner;

        if (isset($_GET[$this->name])) {
            $this->triggered = $_GET[$this->name];

            $this->app->run_called = true;
            $this->app->stickyGet($this->name);
            $ret = call_user_func_array($callback, $args);
            $this->sendSse();

            return $ret;
        }

        return $this;
    }
657278
public function run(array $args = null)
    {
        global $argv;

        if (isset($argv[1]) && $argv[1] == 'autocomplete' && !isset($argv[2])) {
            $this->setBanner(
                function () {
                    return 0;
                }
            );
            $this->setFooter(
                function () {
                    return 0;
                }
            );
        }

        return parent::run($args);
    }
651396
public function auto(Argument $args, $total, array $callableArgs = [])
    {
        $args = $this->protectArgs($args);

        if ($args['last']) {
            $connection = $this->backward($args, $total, $callableArgs);
        } else {
            $connection = $this->forward($args);
        }

        if ($this->promise) {
            return $connection->then(function (ConnectionInterface $connection) use ($total, $callableArgs) {
                $connection->setTotalCount($this->computeTotalCount($total, $callableArgs));

                return $connection;
            });
        } else {
            $connection->setTotalCount($this->computeTotalCount($total, $callableArgs));

            return $connection;
        }
    }
1151736
public function execute(array $args, array $options = [])
    {
        $this->bootstrap($args, $options);

        $version = isset($options['target']) ? $options['target'] : $options['t'];
        $removeAll = isset($options['remove-all']) ? $options['remove-all'] : $options['r'];

        if ($version && $removeAll){
            throw new \InvalidArgumentException('Cannot toggle a breakpoint and remove all breakpoints at the same time.');
        }

        // Remove all breakpoints
        if ($removeAll){
            $this->getManager()->removeBreakpoints();
        } else {
            // Toggle the breakpoint.
            $this->getManager()->toggleBreakpoint($version);
        }
    }
614704
public static function nonEmptyStrs( ...$args ) {
		if ( !isset( $args[0] ) ) {
			return false;
		}
		foreach ( $args as $arg ) {
			if ( !self::nonEmptyStr( $arg ) ) {
				return false;
			}
		}
		// If we're still here, all are good
		return true;
	}
449916
public function shouldRender(array $arguments = []) {
        $callback = $this->shouldRenderCallback;
        $result = $callback($this, $arguments);

        return $result;
    }
105917
private function cmdPurge($args)
    {
        $cmd = new PurgeCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
1281659
public function run(...$args): bool
    {
        $this->channel = new Channel($this->messageBuffer);

        $this->pid = pcntl_fork();

        // If $pid is set, we are in the parent process
        if ($this->pid) {
            // If we want the process to run asynchronously,
            // we can just store the PID and abandon it
            if ($this->async) {
                // Store the communication channel for the process
                $this->asyncChannels[$this->pid] = $this->channel;

                return true;
            }

            // Wait for the child process to complete before continuing
            return $this->wait();
        }

        // If $pid is not set, we are in the child process
        if (!$this->pid) {
            // Bind the channel as the $this argument within the handler
            $handler = $this->handler;
            $handler = $handler->bindTo($this->channel);

            // Call the handler
            $successful = $handler(...$args);

            // Capture the return value from the function and use
            // it to set the exit status for the process
            $status = $successful ? 0 : 1;

            // Exit the child process
            exit($status);
        }

        // We shouldn't ever get this far, so if we do
        // something went wrong
        return false;
    }