Passed
Pull Request — master (#18)
by Kris
07:04
created
demo/demo.bgcolors.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;  
4 4
 
5 5
 $rowHeaders = ['Color name' => 15, ' ANSI Code'  => 15, ' Sample output' => 51];
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 
10 10
 // enum backgrounds
11 11
 $i = 1;
12
-foreach (Console::getStyles()['backgrounds'] as $bgcolor => $colorValue ){
13
-    $foregroundColor = ($bgcolor === 'black' || $bgcolor === 'default') ? 'white': 'black';
12
+foreach (Console::getStyles()['backgrounds'] as $bgcolor => $colorValue) {
13
+    $foregroundColor = ($bgcolor === 'black' || $bgcolor === 'default') ? 'white' : 'black';
14 14
     Console::log('  '.Console::tableRow([
15 15
         $bgcolor        => 15, 
16
-       "\\033[" . $colorValue  .'m'  => 15, 
17
-        Console::text(str_pad('I am a text color={' . $foregroundColor .'} on bgcolor={' . $bgcolor .'}', 48), $foregroundColor , $bgcolor) => 51
16
+       "\\033[".$colorValue.'m'  => 15, 
17
+        Console::text(str_pad('I am a text color={'.$foregroundColor.'} on bgcolor={'.$bgcolor.'}', 48), $foregroundColor, $bgcolor) => 51
18 18
     ]));
19 19
     $i++;
20 20
 }
Please login to merge, or discard this patch.
demo/demo.bell.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;  
4 4
 
5
-Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
6
-Console::log('  - Use ' . Console::text("Console::bell()", 'lightblue', 'underlined') . ' to play a bell sound in console (if available).', 'white');
5
+Console::log(' '.Console::text('Overview:', 'underlined', 'bold'));
6
+Console::log('  - Use '.Console::text("Console::bell()", 'lightblue', 'underlined').' to play a bell sound in console (if available).', 'white');
7 7
 Console::log();   
8
-Console::log(' '. Console::text('Usage:', 'underlined', 'bold'));
8
+Console::log(' '.Console::text('Usage:', 'underlined', 'bold'));
9 9
 Console::log();   
10
-Console::log('   ' .Console::text('// Play the bell', 'green'));
11
-Console::log('   ' .Console::text('Console::bell();', 'lightmagenta'));
10
+Console::log('   '.Console::text('// Play the bell', 'green'));
11
+Console::log('   '.Console::text('Console::bell();', 'lightmagenta'));
12 12
 Console::log();   
13
-Console::log(' '. Console::text('Sample:', 'underlined', 'bold'));
13
+Console::log(' '.Console::text('Sample:', 'underlined', 'bold'));
14 14
 
15 15
 // -----------------
16 16
 // sample start here
Please login to merge, or discard this patch.
demo/demo.window.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;  
4 4
 
5 5
 Console::log(' Let say we are current window.');
6
-Console::log(' We will open a new window using ' . Console::text('Console::newWindow()', 'lightblue', 'underlined') . ' method.');
6
+Console::log(' We will open a new window using '.Console::text('Console::newWindow()', 'lightblue', 'underlined').' method.');
7 7
 Console::ask(' Press [Enter] to open new window > ');
8 8
 
9 9
 // ------------------
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 Console::log('          NEW WINDOW 1        ', 'green');
18 18
 Console::log(' _____________________________', 'green');
19 19
 Console::log();
20
-Console::log(' I am in new window. We will restore the window later using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method.' );
20
+Console::log(' I am in new window. We will restore the window later using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method.');
21 21
 Console::ask(' Press [Enter] to restore >');
22 22
 
23 23
 // ------------------
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 // ------------------
26 26
 Console::restoreWindow();
27 27
 
28
-Console::log(' We have now restored the current window using ' . Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method');
29
-Console::log(' We will reopen a new window using ' . Console::text('Console::newWindow()', 'lightblue', 'underlined') . ' method.');
28
+Console::log(' We have now restored the current window using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method');
29
+Console::log(' We will reopen a new window using '.Console::text('Console::newWindow()', 'lightblue', 'underlined').' method.');
30 30
 Console::ask(' Press [Enter] to open new window > ');
31 31
 
32 32
 // ------------------
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 Console::log('          NEW WINDOW 2        ', 'yellow');
41 41
 Console::log(' _____________________________', 'yellow');
42 42
 Console::log();
43
-Console::log(' I am in new window. We will restore the window later using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method.' );
43
+Console::log(' I am in new window. We will restore the window later using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method.');
44 44
 Console::ask(' Press [Enter] to restore >');
45 45
 
46 46
 // ------------------
47 47
 // restore new window
48 48
 // ------------------
49 49
 Console::restoreWindow();
50
-Console::log(' We have now restored the current window using ' .  Console::text('Console::restoreWindow()', 'lightblue', 'underlined') . ' method. That\'s all.');
51
-Console::log(' Got it'. Console::text('?', 'green'));
50
+Console::log(' We have now restored the current window using '.Console::text('Console::restoreWindow()', 'lightblue', 'underlined').' method. That\'s all.');
51
+Console::log(' Got it'.Console::text('?', 'green'));
52 52
 
53 53
 ?>
Please login to merge, or discard this patch.
demo/demo.standwithukraine.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ .'/../vendor/autoload.php';
2
+require_once __DIR__.'/../vendor/autoload.php';
3 3
 use Kristuff\Mishell\Console;  
4 4
 
5 5
 // *open* new window
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
 $cols   = Console::getColumns();
11 11
 $middle = round($lines/2);
12 12
 
13
-for ($i= 1; $i <= $lines ; $i++){
13
+for ($i = 1; $i <= $lines; $i++) {
14 14
 
15
-    switch($i){
16
-        case $middle -1:
15
+    switch ($i) {
16
+        case $middle-1:
17 17
             Console::log(Console::pad("Stand With Ukraine <3", $cols, ' ', STR_PAD_BOTH), 'yellow', 'blue');
18 18
             break;
19 19
         case $middle:
20 20
             Console::log(Console::pad(' ', $cols, ' ', STR_PAD_BOTH), 'yellow', 'blue');
21 21
             break;
22
-        case $middle +1:
22
+        case $middle+1:
23 23
             Console::log(Console::pad(' ', $cols, ' ', STR_PAD_BOTH), 'blue', 'yellow');
24 24
             break;
25
-        case $middle +2:
25
+        case $middle+2:
26 26
             Console::log(Console::pad('Slava Ukraini', $cols, ' ', STR_PAD_BOTH), 'blue', 'yellow');
27 27
             break;
28 28
         case $lines:
Please login to merge, or discard this patch.