public function confirmToProceed(string $warning = 'Application is in Production mode!', $callback = null): bool
    {
        $callback      = $callback ?? $this->getDefaultConfirmCallback();
        $shouldConfirm = $callback instanceof Closure ? $callback() : $callback;

        if ($shouldConfirm) {
            if ($this->option('force')) {
                return true;
            }

            $this->comment(\str_repeat('*', \mb_strlen($warning) + 12));
            $this->comment('*     ' . $warning . '     *');
            $this->comment(\str_repeat('*', \mb_strlen($warning) + 12));
            $this->line('');

            $confirmed = $this->confirm('Do you really wish to run this command?');

            if (! $confirmed) {
                $this->comment('Command Cancelled!');

                return false;
            }
        }

        return true;
    }
public function confirmToProceed(string $warning = 'Application is in Production mode!', $callback = null): bool
    {
        $callback      = $callback ?? $this->getDefaultConfirmCallback();
        $shouldConfirm = $callback instanceof Closure ? $callback() : $callback;

        if ($shouldConfirm) {
            if ($this->option('force')) {
                return true;
            }

            $this->comment(\str_repeat('*', \mb_strlen($warning) + 12));
            $this->comment('*     ' . $warning . '     *');
            $this->comment(\str_repeat('*', \mb_strlen($warning) + 12));
            $this->line('');

            $confirmed = $this->confirm('Do you really wish to run this command?');

            if (! $confirmed) {
                $this->comment('Command Cancelled!');

                return false;
            }
        }

        return true;
    }
public function confirmToProceed ( string $ warning = 'Application is in Production mode!' , $ callback = null ) : bool { $ callback = $ callback ?? $ this -> getDefaultConfirmCallback ( ) ; $ shouldConfirm = $ callback instanceof Closure ? $ callback ( ) : $ callback ; if ( $ shouldConfirm ) { if ( $ this -> option ( 'force' ) ) { return true ; } $ this -> comment ( \ str_repeat ( '*' , \ mb_strlen ( $ warning ) + 12 ) ) ; $ this -> comment ( '*     ' . $ warning . '     *' ) ; $ this -> comment ( \ str_repeat ( '*' , \ mb_strlen ( $ warning ) + 12 ) ) ; $ this -> line ( '' ) ; $ confirmed = $ this -> confirm ( 'Do you really wish to run this command?' ) ; if ( ! $ confirmed ) { $ this -> comment ( 'Command Cancelled!' ) ; return false ; } } return true ; }
Confirm before proceeding with the action.

@param string             $warning
@param null|bool|\Closure $callback

@return bool
Confirm before proceeding with the action .