ConsoleApp::demonstrate()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 17
rs 9.2
cc 4
eloc 10
nc 8
nop 0
1
<?php declare(strict_types = 1);
2
3
use Console\Console;
4
use Console\Modifier\Background;
5
use Console\Modifier\Option;
6
use Console\Modifier\Text;
7
8
require __DIR__ . '/../vendor/autoload.php';
9
10
class ConsoleApp
11
{
12
    public function demonstrate(): void
13
    {
14
        $text             = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
15
        $textColors       = (new ReflectionClass(Text::class))->getConstants();
16
        $backgroundColors = (new ReflectionClass(Background::class))->getConstants();
17
        $options          = (new ReflectionClass(Option::class))->getConstants();
18
19
        foreach ($textColors as $color) {
20
            Console::log($text . "\n", $color);
21
        }
22
23
        foreach ($backgroundColors as $color) {
24
            Console::log($text . "\n", null, $color);
25
        }
26
27
        foreach ($options as $option) {
28
            Console::log($text . "\n", null, null, $option);
29
        }
30
    }
31
}
32
33
(new ConsoleApp())->demonstrate();