1 | <?php |
||
21 | class ProcessBase extends Process |
||
22 | { |
||
23 | /** |
||
24 | * @var OutputStyle |
||
25 | */ |
||
26 | protected $output; |
||
27 | |||
28 | /** |
||
29 | * @var OutputInterface |
||
30 | */ |
||
31 | protected $stderr; |
||
32 | |||
33 | private $simulated = false; |
||
34 | |||
35 | private $verbose = false; |
||
36 | |||
37 | /** |
||
38 | * @var LoggerInterface |
||
39 | */ |
||
40 | private $logger; |
||
41 | |||
42 | /** |
||
43 | * realtimeStdout returns the output stream that realtime output |
||
44 | * should be sent to (if applicable) |
||
45 | * |
||
46 | * @return OutputStyle $output |
||
47 | */ |
||
48 | public function realtimeStdout() |
||
52 | |||
53 | protected function realtimeStderr() |
||
64 | |||
65 | /** |
||
66 | * setRealtimeOutput allows the caller to inject an OutputStyle object |
||
67 | * that will be used to stream realtime output if applicable. |
||
68 | * |
||
69 | * @param OutputStyle $output |
||
70 | */ |
||
71 | public function setRealtimeOutput(OutputInterface $output, $stderr = null) |
||
76 | |||
77 | /** |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function isVerbose() |
||
81 | { |
||
82 | return $this->verbose; |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * @param bool $verbose |
||
87 | */ |
||
88 | public function setVerbose($verbose) |
||
92 | |||
93 | /** |
||
94 | * @return bool |
||
95 | */ |
||
96 | public function isSimulated() |
||
97 | { |
||
98 | return $this->simulated; |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * @param bool $simulated |
||
103 | */ |
||
104 | public function setSimulated($simulated) |
||
108 | |||
109 | /** |
||
110 | * @return LoggerInterface |
||
111 | */ |
||
112 | public function getLogger() |
||
116 | |||
117 | /** |
||
118 | * @param LoggerInterface $logger |
||
119 | */ |
||
120 | public function setLogger($logger) |
||
124 | |||
125 | /** |
||
126 | * @inheritDoc |
||
127 | */ |
||
128 | public function start(callable $callback = null, array $env = []) |
||
144 | |||
145 | /** |
||
146 | * Get Process output and decode its JSON. |
||
147 | * |
||
148 | * @return array |
||
149 | * An associative array. |
||
150 | */ |
||
151 | public function getOutputAsJson() |
||
175 | |||
176 | /** |
||
177 | * Allow for a certain amount of resiliancy in the output received when |
||
178 | * json is expected. |
||
179 | * |
||
180 | * @param string $data |
||
181 | * @return string |
||
182 | */ |
||
183 | protected function removeNonJsonJunk($data) |
||
204 | |||
205 | /** |
||
206 | * Return a realTime output object. |
||
207 | * |
||
208 | * @return callable |
||
209 | */ |
||
210 | public function showRealtime() |
||
216 | } |
||
217 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.