gamu1012 / cli-text-decoration
String decoration library for PHP CLI output
Installs: 838
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
pkg:composer/gamu1012/cli-text-decoration
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-12-21 08:31:52 UTC
README
String decoration library for PHP CLI output
Installation
composer require gamu1012/cli-text-decoration
Basic Usage
<?php
require __DIR__ . '/vendor/autoload.php';
echo \Gamu1012\CliTextDecoration::setString("RED")->red()->decorate() . "\n";
echo \Gamu1012\CliTextDecoration::setString("MAGENTA-WHITE_BACKGROUND-UNDERLINE")->magenta()->whiteBackground()->underLine()->decorate() . "\n";
To decorate a character string, first set the target string with setString
The setString method returns a CliTextDecoration instance
Use this to connect chain of decoration information.
Finally, we use the decorate method to get the result
Method List
Front Color
- black()
- red()
- green()
- yellow()
- magenta()
- cyan()
- white()
Background Color
- blackBackground()
- redBackground()
- greenBackground()
- yellowBackground()
- magentaBackground()
- cyanBackground()
- whiteBackground()
Attribute
- bold()
- italic()
- underLine()
- blink()
- hidden()
