Completed
Push — master ( 68f327...051b28 )
by Daniel
06:37
created

Input::setFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the Ghostscript package.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Ghostscript;
9
10
/**
11
 * The input class.
12
 *
13
 * @package GravityMedia\Ghostscript
14
 */
15
class Input
16
{
17
    /**
18
     * The process input.
19
     *
20
     * @var mixed
21
     */
22
    private $processInput;
23
24
    /**
25
     * The PostScript code.
26
     *
27
     * @var null|string
28
     */
29
    private $postScriptCode;
30
31
    /**
32
     * The files.
33
     *
34
     * @var null|string[]
35
     */
36
    private $files;
37
38
    /**
39
     * Get process input.
40
     *
41
     * @return mixed
42
     */
43
    public function getProcessInput()
44
    {
45
        return $this->processInput;
46
    }
47
48
    /**
49
     * Set process input.
50
     *
51
     * @param mixed $processInput
52
     *
53
     * @return $this
54
     */
55
    public function setProcessInput($processInput)
56
    {
57
        $this->processInput = $processInput;
58
59
        return $this;
60
    }
61
62
    /**
63
     * Get PostScript code.
64
     *
65
     * @return null|string
66
     */
67
    public function getPostScriptCode()
68
    {
69
        return $this->postScriptCode;
70
    }
71
72
    /**
73
     * Set PostScript code.
74
     *
75
     * @param null|string $postScriptCode
76
     *
77
     * @return $this
78
     */
79
    public function setPostScriptCode($postScriptCode)
80
    {
81
        $this->postScriptCode = $postScriptCode;
82
83
        return $this;
84
    }
85
86
    /**
87
     * Get files.
88
     *
89
     * @return string[]
90
     */
91
    public function getFiles()
92
    {
93
        if (null === $this->files) {
94
            return [];
95
        }
96
97
        return $this->files;
98
    }
99
100
    /**
101
     * Set files.
102
     *
103
     * @param string[] $files
104
     *
105
     * @return $this
106
     */
107
    public function setFiles(array $files)
108
    {
109
        $this->files = $files;
110
111
        return $this;
112
    }
113
114
    /**
115
     * Add file.
116
     *
117
     * @param string $file
118
     *
119
     * @return $this
120
     */
121
    public function addFile($file)
122
    {
123
        if (null === $this->files) {
124
            $this->files = [];
125
        }
126
127
        $this->files[] = $file;
128
129
        return $this;
130
    }
131
}
132