sbolch/console-helper

Makes console formatting easier.

v1.0 2023-07-10 14:42 UTC

This package is auto-updated.

Last update: 2024-10-22 21:54:02 UTC


README

Makes console formatting easier.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require sbolch/console-helper

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

use sbolch\ConsoleHelper;

echo ConsoleHelper::success("Task completed.\n");
echo ConsoleHelper::error("Failure!\n");
echo ConsoleHelper::warning("Attention!\n");
echo ConsoleHelper::info('5 items updated.');
echo ConsoleHelper::replace(ConsoleHelper::info('6 items updated.'));
echo "\n";
echo ConsoleHelper::replaceLine('All previous lines are replaced with this.', 4);
echo ConsoleHelper::progress(
    50, // percentage
    10  // width in characters, default is 20
); // prints this: █████░░░░░