wildphp / authenticator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Tiny RBAC library written in PHP
dev-master
2023-03-01 21:44 UTC
Requires
- php: >=7.2.0
- yoshi2889/collections: ^0.1 || ^0.2
- yoshi2889/validation-closures: ^0.2
Requires (Dev)
- phpunit/phpunit: ^8
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2023-03-29 21:57:16 UTC
README
Tiny library to format text according to the IRC standard.
Installation
To install this package, you need Composer.
$ composer require wildphp/irc-textformatter ^0.1
Usage
The formatter works as a utility class. It exposes the following methods:
bold(string $text)
italic(string $text)
underline(string $text)
color(string $text, string $foreground, string $background = '')
(see below what colors are supported)
Along with the above basic methods, some more advanced methods are provided:
findColorByString(string $color)
- returns a numeric string with the color code based on human readable input ('white' will return '00', see the color table below)calculateStringColor(string $stringToColor)
- returns a numeric string with color code based on string contentsconsistentStringColor(string $stringToColor)
- same as above, but pre-applies the color to the string
It also allows you to strip various formatting elements from text:
stripBold(string $text)
stripItalic(string $text)
stripUnderline(string $text)
stripColor(string $text)
Color table
Human-readable | IRC color code |
---|---|
white |
00 |
black |
01 |
blue |
02 |
green |
03 |
red |
04 |
brown |
05 |
purple |
06 |
orange |
07 |
yellow |
08 |
lime |
09 |
teal |
10 |
aqua |
11 |
royal |
12 |
fuchsia |
13 |
grey |
14 |
silver |
15 |
Contributors
You can see the full list of contributors in the GitHub repository.