1 | <?php |
||
2 | require_once __DIR__ .'/../vendor/autoload.php'; |
||
3 | use Kristuff\Mishell\Console; |
||
4 | |||
5 | Console::log(' '. Console::text('Overview:', 'underlined', 'bold')); |
||
6 | Console::log(" - Use " . Console::text("string ", 'blue'). Console::text("Console::pad()", 'lightblue', 'underlined') . "to get a text with given padding."); |
||
7 | Console::log(" - The method is equivalent to php " . Console::text("str_pad()", 'lightblue', 'underlined'). " method, except that it handles not printable ANSI chars."); |
||
8 | Console::log(); |
||
9 | Console::log(' '. Console::text('Sample:', 'underlined', 'bold')); |
||
10 | |||
11 | // ----------------- |
||
12 | // sample start here |
||
13 | // ----------------- |
||
14 | Console::log(); |
||
15 | Console::log(' '. Console::text(' 1) Using ') . Console::text('php str_pad()', 'lightblue', 'underlined')); |
||
16 | Console::log(); |
||
17 | Console::log(str_pad(' I am normal inside str_pad() {padLength:100, padString:\'*\'}', 100, '*')); |
||
18 | Console::log(str_pad(Console::text(' I am colorized with ::text() inside str_pad() {padLength:100, padString:\'*\'}', 'lightcyan'), 100, '*')); |
||
19 | Console::log(); |
||
20 | Console::log(' '. Console::text(' => you should\'see what you expect. I guess second text has less than 100 chars... ', 'white', 'red')); |
||
21 | Console::log(); |
||
22 | Console::log(); |
||
23 | Console::log(' '. Console::text(' 2) Using ') . Console::text('Console::pad()', 'lightblue', 'underlined')); |
||
24 | Console::log(); |
||
25 | Console::log(Console::pad(' I am normal inside ::pad() {padLength:100, padString:\'*\'}', 100, '*')); |
||
26 | Console::log(Console::pad(Console::text(' I am colorized with ::text() inside ::pad() {padLength:100, padString:\'*\'}', 'lightcyan'), 100, '*')); |
||
27 | Console::log(); |
||
28 | Console::log(' '. Console::text(' => should be OK ', 'white', 'green')); |
||
29 | |||
30 | ?> |
||
0 ignored issues
–
show
|
|||
31 |
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.