1 | <?php |
||
27 | class ReportBuilder |
||
28 | { |
||
29 | |||
30 | private $meta; |
||
31 | private $excelService; |
||
32 | private $sheet; |
||
33 | private $nav; |
||
34 | private $query; |
||
35 | private $status; |
||
36 | private $style; |
||
37 | |||
38 | /** |
||
39 | * @param object $excelService |
||
40 | * @param Meta $meta |
||
41 | * @param NavInterface $nav |
||
42 | */ |
||
43 | public function __construct($excelService, Meta $meta, NavInterface $nav, ReportStyle $style) |
||
50 | |||
51 | /** |
||
52 | * Set the database query handler |
||
53 | * |
||
54 | * @param QueryInterface $query |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setQuery(QueryInterface $query) |
||
63 | |||
64 | /** |
||
65 | * Set the navigation handler |
||
66 | * |
||
67 | * @param NavInterface $nav |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setNav(NavInterface $nav) |
||
76 | |||
77 | /** |
||
78 | * Fill in a literal value in the cell at current nav pointer |
||
79 | * |
||
80 | * @param mixed $value |
||
81 | */ |
||
82 | public function write($value) |
||
86 | |||
87 | /** |
||
88 | * Fill in a cell with a custom or ready made formula at current nav pointer |
||
89 | * |
||
90 | * @param type $value |
||
91 | * @param type $options |
||
92 | */ |
||
93 | public function formula($value, $options) |
||
110 | |||
111 | /** |
||
112 | * Set or return the current run status of the report builder |
||
113 | * |
||
114 | * @param type $newStatus |
||
115 | * @return $this |
||
116 | */ |
||
117 | public function status($newStatus = false) |
||
128 | |||
129 | /** |
||
130 | * Facade function for creating a new spreadsheet within the current excel |
||
131 | * If it is not the first, the query object will also be reset back to |
||
132 | * initial status |
||
133 | * |
||
134 | * @param type $title |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function createSheet($title = '') |
||
148 | |||
149 | /** |
||
150 | * Used to prepare the service for an iteration of writing. This should be |
||
151 | * called prior to any data manipulation as it will reset the data tracking |
||
152 | * array. |
||
153 | * |
||
154 | * @return boolean outcome of operation |
||
155 | */ |
||
156 | public function newSet() |
||
174 | |||
175 | /** |
||
176 | * Facade function for saving the spreadsheet |
||
177 | * |
||
178 | * @param string $fileName |
||
179 | * @param string $path |
||
180 | * @param string $outputFormat |
||
181 | * @return File |
||
182 | */ |
||
183 | public function save($fileName, $path = '', $outputFormat = '') |
||
187 | |||
188 | /** |
||
189 | * Facade function for applying style to the spreadsheet. Will also merge |
||
190 | * options with user overrides before calling |
||
191 | * |
||
192 | * @param string $reference |
||
193 | * @param string $coordString |
||
194 | * @param array $options |
||
195 | */ |
||
196 | public function style($reference, $coordString, $options = array()) |
||
202 | /** |
||
203 | * Return the navigation service object |
||
204 | * |
||
205 | * @return NavInterface |
||
206 | */ |
||
207 | public function nav() |
||
211 | |||
212 | /** |
||
213 | * Return the meta data broker service object |
||
214 | * |
||
215 | * @return Meta |
||
216 | */ |
||
217 | public function meta() |
||
221 | |||
222 | /** |
||
223 | * Return the current sheet object. This is for low level control |
||
224 | * |
||
225 | * @return object |
||
226 | */ |
||
227 | public function sheet() |
||
231 | |||
232 | /** |
||
233 | * Return the Excel service directly |
||
234 | * |
||
235 | * @return Excel |
||
236 | */ |
||
237 | public function excel() |
||
241 | |||
242 | /** |
||
243 | * Return the data handling query service |
||
244 | * |
||
245 | * @return QueryInterface |
||
246 | */ |
||
247 | public function query() |
||
251 | } |
||
252 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.