Issues (37)

demo/demo.bluescreen.php (1 issue)

Severity
1
<?php
2
require_once __DIR__ .'/../vendor/autoload.php';
3
use Kristuff\Mishell\Console;  
4
5
// *open* new window
6
Console::newWindow();
7
8
// get columns / lines and calculate middle
9
$lines = Console::getLines();
10
$cols = Console::getColumns();
11
$middle = round($lines/2);
12
13
for ($i= 1; $i <= $lines ; $i++){
14
15
    switch($i){
16
        case $middle -10:   Console::log(Console::pad("                                /", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
17
        case $middle -9:    Console::log(Console::pad("                               /", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
18
        case $middle -8:    Console::log(Console::pad("                              /", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
19
        case $middle -7:    Console::log(Console::pad("                             |   o", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
20
        case $middle -6:    Console::log(Console::pad("                             |", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
21
        case $middle -5:    Console::log(Console::pad("                             |   o", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
22
        case $middle -4:    Console::log(Console::pad("                              \\", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
23
        case $middle -3:    Console::log(Console::pad("                               \\", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
24
        case $middle -2:    Console::log(Console::pad("                                \\", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
25
        case $middle +1:    Console::log(Console::pad("                             Houston, we've had a problem...", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
26
        case $middle +2:    Console::log(Console::pad("                             The screen is blue. The screen is blue. The screen is blue. The screen is blue. The screen is blue. ", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
27
        case $middle +3:    Console::log(Console::pad("                             The screen is blue. The screen is blue. The screen is blue. The screen is blue. The screen is blue. ", $cols, ' ', STR_PAD_RIGHT), 'white', 'blue'); break;
28
        case $lines:        Console::askInt(Console::pad('Press something to stop damage your eyes >   ', $cols, ' ', STR_PAD_LEFT), 'white', 'blue'); break;
29
        default:            Console::log(Console::pad(' ', $cols), 'white', 'blue');
30
    }
31
}
32
33
// restore window
34
Console::restoreWindow();
35
36
?>
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...
37