LoggerTrait::logServerConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PjbServer\Tools\Console\Command;
6
7
use Symfony\Component\Console\Logger\ConsoleLogger;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use PjbServer\Tools\StandaloneServer\Config;
10
11
trait LoggerTrait
12
{
13
    public function getConsoleLogger(OutputInterface $output): ConsoleLogger
14
    {
15
        return new ConsoleLogger($output);
16 7
    }
17
18 7
    /**
19
     * @param ConsoleLogger $logger
20
     * @param Config        $config
21
     */
22
    public function logServerConfig(ConsoleLogger $logger, Config $config): void
23
    {
24
        $logger->info('* config port       :' . $config->getPort());
25 7
        $logger->info('* config log_file   :' . $config->getLogFile());
26
        $logger->info('* config pid_file   :' . $config->getPidFile());
27 7
        $logger->info('* config classpaths :' . implode(',', $config->getClasspaths()));
28 7
        $logger->info('* config java_bin   :' . $config->getJavaBin());
29 7
        $logger->info('* config server_jar :' . $config->getServerJar());
30 7
    }
31
}
32