1 | <?php |
||
21 | abstract class AbstractDevice |
||
22 | { |
||
23 | /** |
||
24 | * Use command line options. |
||
25 | */ |
||
26 | use CommandLineParametersTrait; |
||
27 | |||
28 | /** |
||
29 | * Use rendering parameters. |
||
30 | */ |
||
31 | use CommandLineParameters\RenderingTrait; |
||
32 | |||
33 | /** |
||
34 | * Use page parameters. |
||
35 | */ |
||
36 | use CommandLineParameters\PageTrait; |
||
37 | |||
38 | /** |
||
39 | * Use font-related parameters. |
||
40 | */ |
||
41 | use CommandLineParameters\FontTrait; |
||
42 | |||
43 | /** |
||
44 | * Use resource-related parameters. |
||
45 | */ |
||
46 | use CommandLineParameters\ResourceTrait; |
||
47 | |||
48 | /** |
||
49 | * Use interaction parameters. |
||
50 | */ |
||
51 | use CommandLineParameters\InteractionTrait; |
||
52 | |||
53 | /** |
||
54 | * Use device and output selection parameters. |
||
55 | */ |
||
56 | use CommandLineParameters\OutputSelectionTrait; |
||
57 | |||
58 | /** |
||
59 | * Use EPS parameters. |
||
60 | */ |
||
61 | use CommandLineParameters\EpsTrait; |
||
62 | |||
63 | /** |
||
64 | * Use ICC color parameters. |
||
65 | */ |
||
66 | use CommandLineParameters\IccColorTrait; |
||
67 | |||
68 | /** |
||
69 | * Use other parameters. |
||
70 | */ |
||
71 | use CommandLineParameters\OtherTrait; |
||
72 | |||
73 | /** |
||
74 | * The Ghostscript object. |
||
75 | * |
||
76 | * @var Ghostscript |
||
77 | */ |
||
78 | private $ghostscript; |
||
79 | |||
80 | /** |
||
81 | * The arguments object. |
||
82 | * |
||
83 | * @var Arguments |
||
84 | */ |
||
85 | private $arguments; |
||
86 | |||
87 | /** |
||
88 | * Create abstract device object. |
||
89 | * |
||
90 | * @param Ghostscript $ghostscript |
||
91 | * @param Arguments $arguments |
||
92 | */ |
||
93 | public function __construct(Ghostscript $ghostscript, Arguments $arguments) |
||
98 | 20 | ||
99 | /** |
||
100 | * Get argument. |
||
101 | * |
||
102 | * @param string $name |
||
103 | * |
||
104 | * @return null|Argument |
||
105 | */ |
||
106 | protected function getArgument($name) |
||
110 | |||
111 | /** |
||
112 | * Whether argument is set. |
||
113 | * |
||
114 | * @param string $name |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function hasArgument($name) |
||
122 | |||
123 | /** |
||
124 | * Get argument value. |
||
125 | * |
||
126 | * @param string $name |
||
127 | * |
||
128 | * @return null|string |
||
129 | */ |
||
130 | protected function getArgumentValue($name) |
||
139 | |||
140 | /** |
||
141 | * Set argument. |
||
142 | * |
||
143 | * @param string $argument |
||
144 | * |
||
145 | * @return $this |
||
146 | */ |
||
147 | protected function setArgument($argument) |
||
153 | |||
154 | /** |
||
155 | * Sanitize input. |
||
156 | * |
||
157 | * @param null|string|resource|Input $input |
||
158 | * |
||
159 | * @return Input |
||
160 | */ |
||
161 | protected function sanitizeInput($input) |
||
183 | |||
184 | /** |
||
185 | * Create process arguments. |
||
186 | * |
||
187 | * @param Input $input |
||
188 | * |
||
189 | * @throws \RuntimeException |
||
190 | * |
||
191 | * @return array |
||
192 | */ |
||
193 | protected function createProcessArguments(Input $input) |
||
218 | |||
219 | /** |
||
220 | * Create process object. |
||
221 | * |
||
222 | * @param null|string|resource|Input $input |
||
223 | * |
||
224 | * @throws \RuntimeException |
||
225 | * |
||
226 | * @return Process |
||
227 | */ |
||
228 | 10 | public function createProcess($input = null) |
|
246 | } |
||
247 |