Main   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A display() 0 4 1
A __construct() 0 7 1
1
<?php
2
3
/**
4
 * Main.php
5
 *
6
 * @author Dominik Kocuj
7
 * @license https://opensource.org/licenses/MIT The MIT License
8
 * @copyright Copyright (c) 2017-2018 kocuj.pl
9
 */
10
11
namespace Kocuj\Di\Examples\Example1\Lib;
12
13
/**
14
 * Main service
15
 *
16
 * @package Kocuj\Di\Examples\Example1\Lib
17
 */
18
class Main
19
{
20
    /**
21
     * Input service
22
     *
23
     * @var InputServiceInterface
24
     */
25
    private $inputService;
26
27
    /**
28
     * Output service
29
     *
30
     * @var OutputServiceInterface
31
     */
32
    private $outputService;
33
34
    /**
35
     * Constructor
36
     *
37
     * @param InputServiceInterface $inputService Input service
38
     * @param OutputServiceInterface $outputService Output service
39
     */
40
    public function __construct(InputServiceInterface $inputService, OutputServiceInterface $outputService)
41
    {
42
        // remember arguments
43
        $this->inputService = $inputService;
44
        $this->outputService = $outputService;
45
        // display information
46
        echo 'Main created' . PHP_EOL;
47
    }
48
49
    /**
50
     * Display
51
     */
52
    public function display()
53
    {
54
        // display output
55
        $this->outputService->displayOutput($this->inputService->getInput());
56
    }
57
}
58