ConsoleApp   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A demonstrate() 0 17 4
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();