Passed
Push — master ( 2a3624...3abe14 )
by Théo
03:10
created

ConsoleLogger::outputSuccess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
/*
5
 * This file is part of the humbug/php-scoper package.
6
 *
7
 * Copyright (c) 2017 Théo FIDRY <[email protected]>,
8
 *                    Pádraic Brady <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Humbug\PhpScoper\Logger;
15
16
use Symfony\Component\Console\Application;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
/**
20
 * @private
21
 * @final
22
 */
23
class ConsoleLogger
24
{
25
    private $application;
26
    private $io;
27
28
    public function __construct(Application $application, OutputInterface $output)
29
    {
30
        $this->io = $output;
31
        $this->application = $application;
32
    }
33
34
    /**
35
     * Output version details at start.
36
     */
37
    public function outputScopingStart()
38
    {
39
        $version = $this->application->getVersion();
40
41
        $this->io->writeLn(sprintf('PHP Scoper %s', $version));
42
    }
43
44
    /**
45
     * Output file count message if relevant.
46
     *
47
     * @param int $count
48
     */
49
    public function outputFileCount(int $count)
50
    {
51
        if (0 === $count) {
52
            $this->io->writeLn('No PHP files to scope located with given path(s).');
53
        }
54
    }
55
56
    /**
57
     * Output scoping success message.
58
     *
59
     * @param string $path
60
     */
61
    public function outputSuccess(string $path)
62
    {
63
        $this->io->writeLn(sprintf('Scoping %s. . . Success', $path));
64
    }
65
66
    /**
67
     * Output scoping failure message.
68
     *
69
     * @param string $path
70
     */
71
    public function outputFail(string $path)
72
    {
73
        $this->io->writeLn(sprintf('Scoping %s. . . Fail', $path));
74
    }
75
76
    public function outputScopingEnd()
77
    {
78
    }
79
}
80