1 | <?php |
||
18 | class Engine |
||
19 | { |
||
20 | /** |
||
21 | * Executable path. |
||
22 | * |
||
23 | * @var string |
||
24 | * @access protected |
||
25 | */ |
||
26 | protected $path; |
||
27 | |||
28 | /** |
||
29 | * Debug flag. |
||
30 | * |
||
31 | * @var boolean |
||
32 | * @access protected |
||
33 | */ |
||
34 | protected $debug; |
||
35 | |||
36 | /** |
||
37 | * PhantomJs run options. |
||
38 | * |
||
39 | * @var array |
||
40 | * @access protected |
||
41 | */ |
||
42 | protected $options; |
||
43 | |||
44 | /** |
||
45 | * Log info |
||
46 | * |
||
47 | * @var string |
||
48 | * @access protected |
||
49 | */ |
||
50 | protected $log; |
||
51 | |||
52 | /** |
||
53 | * Internal constructor |
||
54 | * |
||
55 | * @access public |
||
56 | * @return void |
||
|
|||
57 | */ |
||
58 | 25 | public function __construct() |
|
63 | |||
64 | /** |
||
65 | * Get PhantomJs run command with |
||
66 | * loader run options. |
||
67 | * |
||
68 | * @access public |
||
69 | * @return string |
||
70 | */ |
||
71 | 47 | public function getCommand() |
|
84 | |||
85 | /** |
||
86 | * Set path. |
||
87 | * |
||
88 | * @access public |
||
89 | * @param string $path |
||
90 | * @return \JonnyW\PhantomJs\Client |
||
91 | */ |
||
92 | 1 | public function setPath($path) |
|
100 | |||
101 | /** |
||
102 | * Get path. |
||
103 | * |
||
104 | * @access public |
||
105 | * @return string |
||
106 | */ |
||
107 | 48 | public function getPath() |
|
111 | |||
112 | /** |
||
113 | * Set PhantomJs run options. |
||
114 | * |
||
115 | * @access public |
||
116 | * @param array $options |
||
117 | * @return \JonnyW\PhantomJs\Client |
||
118 | */ |
||
119 | 1 | public function setOptions(array $options) |
|
125 | |||
126 | /** |
||
127 | * Get PhantomJs run options. |
||
128 | * |
||
129 | * @access public |
||
130 | * @return array |
||
131 | */ |
||
132 | 48 | public function getOptions() |
|
136 | |||
137 | /** |
||
138 | * Add single PhantomJs run option. |
||
139 | * |
||
140 | * @access public |
||
141 | * @param string $option |
||
142 | * @return \JonnyW\PhantomJs\Client |
||
143 | */ |
||
144 | 3 | public function addOption($option) |
|
152 | |||
153 | /** |
||
154 | * Debug. |
||
155 | * |
||
156 | * @access public |
||
157 | * @param boolean $doDebug |
||
158 | * @return \JonnyW\PhantomJs\Client |
||
159 | */ |
||
160 | 4 | public function debug($doDebug) |
|
166 | |||
167 | /** |
||
168 | * Log info. |
||
169 | * |
||
170 | * @access public |
||
171 | * @param string $info |
||
172 | * @return \JonnyW\PhantomJs\Client |
||
173 | */ |
||
174 | 43 | public function log($info) |
|
180 | |||
181 | /** |
||
182 | * Get log info. |
||
183 | * |
||
184 | * @access public |
||
185 | * @return string |
||
186 | */ |
||
187 | 11 | public function getLog() |
|
191 | |||
192 | /** |
||
193 | * Clear log info. |
||
194 | * |
||
195 | * @access public |
||
196 | * @return \JonnyW\PhantomJs\Client |
||
197 | */ |
||
198 | 1 | public function clearLog() |
|
204 | |||
205 | /** |
||
206 | * Validate execuable file. |
||
207 | * |
||
208 | * @access private |
||
209 | * @param string $file |
||
210 | * @return boolean |
||
211 | * @throws \JonnyW\PhantomJs\Exception\InvalidExecutableException |
||
212 | */ |
||
213 | 48 | private function validateExecutable($file) |
|
221 | } |
||
222 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.