showError example

// @codeCoverageIgnoreStart                 CLI::error('Database creation failed.', 'light_gray', 'red');
                CLI::newLine();

                return;
                // @codeCoverageIgnoreEnd             }

            CLI::write("Database \"{$name}\" successfully created.", 'green');
            CLI::newLine();
        } catch (Throwable $e) {
            $this->showError($e);
        } finally {
            Factories::reset('config');
            Database::connect(null, false);
        }
    }
}
$messages = $runner->getCliMessages();

            foreach ($messages as $message) {
                CLI::write($message);
            }

            CLI::write('Done rolling back migrations.', 'green');

            // @codeCoverageIgnoreStart         } catch (Throwable $e) {
            $this->showError($e);
            // @codeCoverageIgnoreEnd         }
    }
}
/** * Wrap helper function to use as view plugin. */
    public static function ValidationErrors(array $params = []): string
    {
        $validator = Services::validation();
        if (empty($params)) {
            return $validator->listErrors();
        }

        return $validator->showError($params['field']);
    }

    /** * Wrap helper function to use as view plugin. * * @return false|string */
    public static function route(array $params = [])
    {
        return route_to(...$params);
    }

    
$messages = $runner->getCliMessages();

            foreach ($messages as $message) {
                CLI::write($message);
            }

            CLI::write(lang('Migrations.migrated'), 'green');

            // @codeCoverageIgnoreStart         } catch (Throwable $e) {
            $this->showError($e);
            // @codeCoverageIgnoreEnd         }
    }
}

        $seeder   = new Seeder(new Database());
        $seedName = array_shift($params);

        if (empty($seedName)) {
            $seedName = CLI::prompt(lang('Migrations.migSeeder'), null, 'required'); // @codeCoverageIgnore         }

        try {
            $seeder->call($seedName);
        } catch (Throwable $e) {
            $this->showError($e);
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.