public function handle(Args $args, IO $io)
    {
        $processTitle = $this->config->getProcessTitle();

        $this->warnIfProcessTitleNotSupported($processTitle, $io);

        if ($processTitle && ProcessTitle::isSupported()) {
            ProcessTitle::setProcessTitle($processTitle);

            try {
                $statusCode = $this->doHandle($args, $io);
            } catch (Exception $e) {
                ProcessTitle::resetProcessTitle();

                throw $e;
            }

            ProcessTitle::resetProcessTitle();
        } else {
            $statusCode = $this->doHandle($args, $io);
        }

        // Any empty value is considered a success
        if (!$statusCode) {
            return 0;
        }

        // Anything else is normalized to a valid error status code
        // (i.e. one of [1, 255])
        return min(max((int) $statusCode, 1), 255);
    }
public function handle(Args $args, IO $io)
    {
        $processTitle = $this->config->getProcessTitle();

        $this->warnIfProcessTitleNotSupported($processTitle, $io);

        if ($processTitle && ProcessTitle::isSupported()) {
            ProcessTitle::setProcessTitle($processTitle);

            try {
                $statusCode = $this->doHandle($args, $io);
            } catch (Exception $e) {
                ProcessTitle::resetProcessTitle();

                throw $e;
            }

            ProcessTitle::resetProcessTitle();
        } else {
            $statusCode = $this->doHandle($args, $io);
        }

        // Any empty value is considered a success
        if (!$statusCode) {
            return 0;
        }

        // Anything else is normalized to a valid error status code
        // (i.e. one of [1, 255])
        return min(max((int) $statusCode, 1), 255);
    }
public function handle ( Args $ args , IO $ io ) { $ processTitle = $ this -> config -> getProcessTitle ( ) ; $ this -> warnIfProcessTitleNotSupported ( $ processTitle , $ io ) ; if ( $ processTitle && ProcessTitle :: isSupported ( ) ) { ProcessTitle :: setProcessTitle ( $ processTitle ) ; try { $ statusCode = $ this -> doHandle ( $ args , $ io ) ; } catch ( Exception $ e ) { ProcessTitle :: resetProcessTitle ( ) ; throw $ e ; } ProcessTitle :: resetProcessTitle ( ) ; } else { $ statusCode = $ this -> doHandle ( $ args , $ io ) ; } // Any empty value is considered a success if ( ! $ statusCode ) { return 0 ; } // Anything else is normalized to a valid error status code // (i.e. one of [1, 255]) return min ( max ( ( int ) $ statusCode , 1 ) , 255 ) ; }
Executes the command for the given parsed arguments.

@param Args $args The parsed console arguments.
@param IO   $io   The I/O.

@return int Returns 0 on success and any other integer on error.

@throws Exception
Executes the command for the given parsed arguments .