Issues (37)

demo/demo.ask.php (1 issue)

Severity
1
<?php
2
3
require_once __DIR__ .'/../vendor/autoload.php';
4
use Kristuff\Mishell\Console;  
5
6
Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
7
Console::log(' '. Console::text("  - Use ") . Console::text("string ", 'blue'). Console::text("Console::ask()", 'lightblue', 'underlined') . " to ask something to user in the console.");
8
Console::log();
9
Console::log(' '. Console::text('Tips:', 'underlined', 'bold'));
10
Console::log("   - You can customize colors (foreground and background) and some styles in same way than ");
11
Console::log('     with ' . Console::text("Console::text()", 'lightblue', 'underlined') . 
12
                 ' and ' .  Console::text("Console::log()", 'lightblue', 'underlined'). ' methods.');
13
Console::log();
14
Console::log(' '. Console::text('Usage:', 'underlined', 'bold'));
15
Console::log('   '. Console::text("\$value = Console::ask('Please enter something > ');", 'lightmagenta'));
16
Console::log('   '. Console::text("// or", 'green'));
17
Console::log('   '. Console::text("\$value = Console::ask('Please enter something > ', 'white', 'blue);", 'lightmagenta'));
18
Console::log();
19
20
// -----------------
21
// sample start here
22
// -----------------
23
$value = Console::ask('Please enter something > ');
24
Console::log('=> the value you entered is [' . Console::text($value, 'lightyellow') . ']');
25
26
$value2 = Console::ask('Please enter something > ', 'magenta', 'underlined');
27
Console::log('=> the value you entered is [' . Console::text($value2, 'lightyellow') . ']');
28
29
?>
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...
30