public function start(callable $startTask = null)
    {
        $taskReturnValue = null;

        // Don't start a running application
        if (!$this->isRunning) {
            try {
                $this->taskDispatcher->dispatch(TaskTypes::PRE_START);
                $this->isRunning = true;

                if ($startTask !== null) {
                    $taskReturnValue = $startTask();
                }

                $this->taskDispatcher->dispatch(TaskTypes::POST_START);
            } catch (Exception $ex) {
                $this->shutDown();

                throw $ex;
            }
        }

        return $taskReturnValue;
    }
public function start(callable $startTask = null)
    {
        $taskReturnValue = null;

        // Don't start a running application
        if (!$this->isRunning) {
            try {
                $this->taskDispatcher->dispatch(TaskTypes::PRE_START);
                $this->isRunning = true;

                if ($startTask !== null) {
                    $taskReturnValue = $startTask();
                }

                $this->taskDispatcher->dispatch(TaskTypes::POST_START);
            } catch (Exception $ex) {
                $this->shutDown();

                throw $ex;
            }
        }

        return $taskReturnValue;
    }
public function start ( callable $ startTask = null ) { $ taskReturnValue = null ; // Don't start a running application if ( ! $ this -> isRunning ) { try { $ this -> taskDispatcher -> dispatch ( TaskTypes :: PRE_START ) ; $ this -> isRunning = true ; if ( $ startTask !== null ) { $ taskReturnValue = $ startTask ( ) ; } $ this -> taskDispatcher -> dispatch ( TaskTypes :: POST_START ) ; } catch ( Exception $ ex ) { $ this -> shutDown ( ) ; throw $ ex ; } } return $ taskReturnValue ; }
Starts this application

@param callable $startTask The task to perform on startup
@return mixed|null The return value of the task if there was one, otherwise null
@throws Exception Thrown if there was a problem starting the application
@deprecated 1.1.0 This method will be removed
Starts this application