lib/Bob/Task.php
function invoke()
    {
        if (!$this->enable) {
            if ($this->application->trace) {
                $this->application['log']->debug("{$this->inspect()} is not enabled");
            }
            return;
        }

        if (!$this->reenable and $this->application['invocation_chain']->has($this)) {
            return;
        }

        if (!$this->application->forceRun and !$this->isNeeded()) {
            $this->application->trace and $this->application['log']->debug("Skipping {$this->inspect()}");
            return;
        }

        $this->application['invocation_chain']->push($this);

        if ($this->application->trace) {
            $this->application['log']->debug("Invoke {$this->inspect()}");
        }

        $app = $this->application;

        itertools\walk(
            itertools\filter(itertools\to_iterator($this->prerequisites), function($p) use ($app) {
                return $app->taskDefined((string) $p);
            }),
            function($p) use ($app) {
                $app['tasks'][(string) $p]->invoke();
            }
        );

        if ($this->prerequisites !== null) {
            $this->prerequisites->rewind();
        }

        $this->execute();
        $this->reenable = false;
    }
function invoke()
    {
        if (!$this->enable) {
            if ($this->application->trace) {
                $this->application['log']->debug("{$this->inspect()} is not enabled");
            }
            return;
        }

        if (!$this->reenable and $this->application['invocation_chain']->has($this)) {
            return;
        }

        if (!$this->application->forceRun and !$this->isNeeded()) {
            $this->application->trace and $this->application['log']->debug("Skipping {$this->inspect()}");
            return;
        }

        $this->application['invocation_chain']->push($this);

        if ($this->application->trace) {
            $this->application['log']->debug("Invoke {$this->inspect()}");
        }

        $app = $this->application;

        itertools\walk(
            itertools\filter(itertools\to_iterator($this->prerequisites), function($p) use ($app) {
                return $app->taskDefined((string) $p);
            }),
            function($p) use ($app) {
                $app['tasks'][(string) $p]->invoke();
            }
        );

        if ($this->prerequisites !== null) {
            $this->prerequisites->rewind();
        }

        $this->execute();
        $this->reenable = false;
    }
# Returns the callback's return value.