Completed
Branch master (bff1a4)
by Filipe
02:53
created

ConsoleAwareMethods   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 92
ccs 15
cts 15
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setInput() 0 5 1
A getInput() 0 4 1
A setOutput() 0 5 1
A getOutput() 0 4 1
A getCommand() 0 4 1
A setCommand() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of slick/mvc package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Mvc\Console\MetaDataGenerator;
11
12
use Slick\Mvc\Console\MetaDataGeneratorInterface;
13
use Symfony\Component\Console\Command\Command;
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
/**
18
 * Console Aware Methods
19
 *
20
 * @package Slick\Mvc\Console\MetaDataGenerator
21
 * @author  Filipe Silva <[email protected]>
22
 */
23
trait ConsoleAwareMethods
24
{
25
26
    /**
27
     * @readwrite
28
     * @var InputInterface
29
     */
30
    protected $input;
31
32
    /**
33
     * @readwrite
34
     * @var OutputInterface
35
     */
36
    protected $output;
37
38
    /**
39
     * @readwrite
40
     * @var Command
41
     */
42
    protected $command;
43
44
    /**
45
     * Set the console input
46
     *
47
     * @param InputInterface $input
48
     *
49
     * @return self|MetaDataGeneratorInterface
50
     */
51 16
    public function setInput(InputInterface $input)
52
    {
53 16
        $this->input = $input;
54 16
        return $this;
55
    }
56
57
    /**
58
     * Get console input
59
     *
60
     * @return InputInterface
61
     */
62 6
    public function getInput()
63
    {
64 6
        return $this->input;
65
    }
66
67
    /**
68
     * Sets the console output
69
     *
70
     * @param OutputInterface $output
71
     *
72
     * @return self|MetaDataGeneratorInterface
73
     */
74 16
    public function setOutput(OutputInterface $output)
75
    {
76 16
        $this->output = $output;
77 16
        return $this;
78
    }
79
80
    /**
81
     * Get console output
82
     *
83
     * @return OutputInterface
84
     */
85 6
    public function getOutput()
86
    {
87 6
        return $this->output;
88
    }
89
90
    /**
91
     * Gets command property
92
     *
93
     * @return Command
94
     */
95 10
    public function getCommand()
96
    {
97 10
        return $this->command;
98
    }
99
100
    /**
101
     * Sets command property
102
     *
103
     * @param Command $command
104
     *
105
     * @return self|MetaDataGeneratorInterface
106
     */
107 16
    public function setCommand(Command $command)
108
    {
109 16
        $this->command = $command;
110 16
        return $this;
111
    }
112
113
114
}