Saeghe is a difficult name to pronounce. Therefore, Saeghe project has been renamed to phpkg.
This website no longer receives updates.
Please visit phpkg website at phpkg.com
This document describes included functions in the Saeghe\Cli\IO\Write
library.
function line(string $string): void
Print the given string
directly in the stdout with the default font color.
use function Saeghe\Cli\IO\Write\line;
line('Hello World!');
use Saeghe\Cli\IO\Write;
Write\line('Hello World!');
line('Hello World!'); // Output => Hello World!
function assert_line(string $expected, string $actual): bool
Assert to see the expected
string has been printed using the line
function and resulted in the actual
output.
use function Saeghe\Cli\IO\Write\assert_line;
$output = shell_exec('command');
assert_line($expected, $output);
use Saeghe\Cli\IO\Write;
$output = shell_exec('command');
Write\assert_line($expected, $output);
function success(string $string): void
Print the given string
directly in the stdout with green font color.
use function Saeghe\Cli\IO\Write\success;
success('Hello World!');
use Saeghe\Cli\IO\Write;
Write\success('Hello World!');
success('Hello World!'); // Output(With a green font color) => Hello World!
function assert_success(string $expected, string $actual): bool
Assert to see the expected
string has been printed using the success
function and resulted in the actual
output.
use function Saeghe\Cli\IO\Write\assert_success;
$output = shell_exec('command');
assert_success($expected, $output);
use Saeghe\Cli\IO\Write;
$output = shell_exec('command');
Write\assert_success($expected, $output);
function error(string $string): void
Print the given string
directly in the stdout with red font color.
use function Saeghe\Cli\IO\Write\error;
error('Hello World!');
use Saeghe\Cli\IO\Write;
Write\error('Hello World!');
error('Hello World!'); // Output(With a red font color) => Hello World!
function assert_error(string $expected, string $actual): bool
Assert to see the expected
string has been printed using the error
function and resulted in the actual
output.
use function Saeghe\Cli\IO\Write\assert_error;
$output = shell_exec('command');
assert_error($expected, $output);
use Saeghe\Cli\IO\Write;
$output = shell_exec('command');
Write\assert_error($expected, $output);