Issues (37)

demo/demo.styles.php (1 issue)

1
<?php
2
require_once __DIR__ .'/../vendor/autoload.php';
3
use Kristuff\Mishell\Console;  
4
5
// the row header
6
$rowHeaders = [ 'Style name' => 15, 'ANSI Code' => 15, 'Sample output' => 50 ];
7
Console::log('  '.Console::tableRowSeparator($rowHeaders));
8
Console::log('  '.Console::tableRow($rowHeaders));
9
Console::log('  '.Console::tableRowSeparator($rowHeaders));
10
11
// enum styles
12
$index = 1;
13
foreach (Console::getStyles()[ 'options' ] as $option => $value){
14
    Console::log('  ' .
15
        Console::tableRow([
16
            $option   => 15, 
17
            "\\033[" . $value  .'m'  => 15, 
18
            Console::text('I am a text style={' . $option .'}', $option) => 50
19
        ]));
20
    $index++; 
21
}
22
Console::log('  '.Console::tableRowSeparator($rowHeaders));
23
24
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

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.

Loading history...
25