YGGo/library/cli.php

34 lines
667 B
PHP
Raw Normal View History

2023-07-29 14:04:20 +00:00
<?php
class CLI {
2023-07-29 17:07:44 +00:00
public static function break() {
2023-07-29 14:22:25 +00:00
echo PHP_EOL;
}
2023-07-29 14:04:20 +00:00
public static function default(string $string) {
2023-07-29 17:07:44 +00:00
echo sprintf("%s", $string) . self::break();
2023-07-29 14:04:20 +00:00
}
public static function notice(string $string) {
2023-07-29 17:07:44 +00:00
echo sprintf("\033[36m%s\033[0m", $string) . self::break();
2023-07-29 14:04:20 +00:00
}
public static function warning(string $string) {
2023-07-29 17:07:44 +00:00
echo sprintf("\033[33m%s\033[0m", $string) . self::break();
2023-07-29 14:04:20 +00:00
}
public static function danger(string $string) {
2023-07-29 17:07:44 +00:00
echo sprintf("\033[31m%s\033[0m", $string) . self::break();
2023-07-29 14:04:20 +00:00
}
public static function success(string $string) {
2023-07-29 17:07:44 +00:00
echo sprintf("\033[32m%s\033[0m", $string) . self::break();
2023-07-29 14:04:20 +00:00
}
}