| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Error handling for phpDocumentor
|
|
|
4 |
*
|
|
|
5 |
* phpDocumentor :: automatic documentation generator
|
|
|
6 |
*
|
|
|
7 |
* PHP versions 4 and 5
|
|
|
8 |
*
|
|
|
9 |
* Copyright (c) 2001-2008 Gregory Beaver
|
|
|
10 |
*
|
|
|
11 |
* LICENSE:
|
|
|
12 |
*
|
|
|
13 |
* This library is free software; you can redistribute it
|
|
|
14 |
* and/or modify it under the terms of the GNU Lesser General
|
|
|
15 |
* Public License as published by the Free Software Foundation;
|
|
|
16 |
* either version 2.1 of the License, or (at your option) any
|
|
|
17 |
* later version.
|
|
|
18 |
*
|
|
|
19 |
* This library is distributed in the hope that it will be useful,
|
|
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
22 |
* Lesser General Public License for more details.
|
|
|
23 |
*
|
|
|
24 |
* You should have received a copy of the GNU Lesser General Public
|
|
|
25 |
* License along with this library; if not, write to the Free Software
|
|
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
27 |
*
|
|
|
28 |
* @category ToolsAndUtilities
|
|
|
29 |
* @package phpDocumentor
|
|
|
30 |
* @subpackage Errors
|
|
|
31 |
* @author Greg Beaver <cellog@php.net>
|
|
|
32 |
* @copyright 2001-2008 Gregory Beaver
|
|
|
33 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
34 |
* @version CVS: $Id: Errors.inc 253641 2008-02-24 02:35:44Z ashnazg $
|
|
|
35 |
* @filesource
|
|
|
36 |
* @link http://www.phpdoc.org
|
|
|
37 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
38 |
* @see parserDocBlock, parserInclude, parserPage, parserClass
|
|
|
39 |
* @see parserDefine, parserFunction, parserMethod, parserVar
|
|
|
40 |
* @since 0.4
|
|
|
41 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
42 |
*/
|
|
|
43 |
/**
|
|
|
44 |
* warning triggered when inheritance could be from more than one class
|
|
|
45 |
*/
|
|
|
46 |
define("PDERROR_MULTIPLE_PARENT", 1);
|
|
|
47 |
/**
|
|
|
48 |
* warning triggered when parent class doesn't exist
|
|
|
49 |
*/
|
|
|
50 |
define("PDERROR_PARENT_NOT_FOUND", 2);
|
|
|
51 |
/**
|
|
|
52 |
* warning triggered when an {@inline tag} is not terminated
|
|
|
53 |
* (no } before the * / ending the comment)
|
|
|
54 |
*/
|
|
|
55 |
define("PDERROR_UNTERMINATED_INLINE_TAG", 3);
|
|
|
56 |
/**
|
|
|
57 |
* warning triggered when inheritance could be from more than one class
|
|
|
58 |
*/
|
|
|
59 |
define("PDERROR_CLASS_EXISTS", 4);
|
|
|
60 |
/**
|
|
|
61 |
* warning triggered when inheritance could be from more than one class
|
|
|
62 |
*/
|
|
|
63 |
define("PDERROR_INHERITANCE_CONFLICT", 5);
|
|
|
64 |
/**
|
|
|
65 |
* warning triggered when a converter is passed to
|
|
|
66 |
* {@link phpDocumentor_IntermediateParser::addConverter()} that is not a class
|
|
|
67 |
*/
|
|
|
68 |
define("PDERROR_CONVERTER_NOT_FOUND", 6);
|
|
|
69 |
/**
|
|
|
70 |
* warning triggered when a converter is passed to
|
|
|
71 |
* {@link phpDocumentor_IntermediateParser::addConverter()} that is not a class
|
|
|
72 |
*/
|
|
|
73 |
define("PDERROR_NO_CONVERTERS", 7);
|
|
|
74 |
/**
|
|
|
75 |
* warning triggered when the arguments to @access are neither public nor private
|
|
|
76 |
*/
|
|
|
77 |
define("PDERROR_ACCESS_WRONG_PARAM", 8);
|
|
|
78 |
/**
|
|
|
79 |
* warning triggered when there are multiple @access tags in a docblock
|
|
|
80 |
*/
|
|
|
81 |
define("PDERROR_MULTIPLE_ACCESS_TAGS", 9);
|
|
|
82 |
/**
|
|
|
83 |
* warning triggered when there are multiple @return tags in a docblock
|
|
|
84 |
*/
|
|
|
85 |
define("PDERROR_MULTIPLE_RETURN_TAGS", 10);
|
|
|
86 |
/**
|
|
|
87 |
* warning triggered when there are multiple @var tags in a docblock
|
|
|
88 |
*/
|
|
|
89 |
define("PDERROR_MULTIPLE_VAR_TAGS", 11);
|
|
|
90 |
/**
|
|
|
91 |
* warning triggered when there are multiple @package tags in a docblock
|
|
|
92 |
*/
|
|
|
93 |
define("PDERROR_MULTIPLE_PACKAGE_TAGS", 12);
|
|
|
94 |
/**
|
|
|
95 |
* warning triggered when there are multiple @subpackage tags in a docblock
|
|
|
96 |
*/
|
|
|
97 |
define("PDERROR_MULTIPLE_SUBPACKAGE_TAGS", 13);
|
|
|
98 |
/**
|
|
|
99 |
* warning triggered when the package or subpackage name is illegal
|
|
|
100 |
*/
|
|
|
101 |
define("PDERROR_ILLEGAL_PACKAGENAME", 14);
|
|
|
102 |
/**
|
|
|
103 |
* warning triggered when there a @package tag is used in a function,
|
|
|
104 |
* define, method, var or include
|
|
|
105 |
*/
|
|
|
106 |
define("PDERROR_OVERRIDDEN_PACKAGE_TAGS", 15);
|
|
|
107 |
/**
|
|
|
108 |
* warning triggered when there a @subpackage tag is used in a function,
|
|
|
109 |
* define, method, var or include
|
|
|
110 |
*/
|
|
|
111 |
define("PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS", 16);
|
|
|
112 |
/**
|
|
|
113 |
* warning triggered when classes in the same package have the same name
|
|
|
114 |
*/
|
|
|
115 |
define("PDERROR_CLASS_CONFLICT", 17);
|
|
|
116 |
/**
|
|
|
117 |
* warning triggered when classes in the same package have the same name
|
|
|
118 |
*/
|
|
|
119 |
define("PDERROR_UNKNOWN_TAG", 18);
|
|
|
120 |
/**
|
|
|
121 |
* warning triggered when there are multiple @name tags in a docblock
|
|
|
122 |
*/
|
|
|
123 |
define("PDERROR_MULTIPLE_NAME_TAGS", 19);
|
|
|
124 |
/**
|
|
|
125 |
* warning triggered when there are multiple @name tags in a docblock
|
|
|
126 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
127 |
*/
|
|
|
128 |
define("PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE", 20);
|
|
|
129 |
/**
|
|
|
130 |
* warning triggered when there are multiple @name tags in a docblock
|
|
|
131 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
132 |
*/
|
|
|
133 |
define("PDERROR_GLOBAL_NOT_FOUND", 21);
|
|
|
134 |
/**
|
|
|
135 |
* warning triggered when there are multiple @name tags in a docblock
|
|
|
136 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
137 |
*/
|
|
|
138 |
define("PDERROR_MULTIPLE_GLOBAL_TAGS", 22);
|
|
|
139 |
/**
|
|
|
140 |
* warning triggered when there are multiple @name tags in a docblock
|
|
|
141 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
142 |
*/
|
|
|
143 |
define("PDERROR_MALFORMED_GLOBAL_TAG", 23);
|
|
|
144 |
/**
|
|
|
145 |
* warning triggered when an @ignore tag is used in a DocBlock preceding
|
|
|
146 |
* a method, variable, include, or global variable
|
|
|
147 |
*/
|
|
|
148 |
define("PDERROR_IGNORE_TAG_IGNORED", 24);
|
|
|
149 |
/**
|
|
|
150 |
* warning triggered when a duplicate element is encountered that will be
|
|
|
151 |
* ignored by the documentor
|
|
|
152 |
*/
|
|
|
153 |
define("PDERROR_ELEMENT_IGNORED", 25);
|
|
|
154 |
/**
|
|
|
155 |
* warning triggered when an entire page is ignored because of @access private
|
|
|
156 |
*/
|
|
|
157 |
define("PDERROR_PARSEPRIVATE", 26);
|
|
|
158 |
/**
|
|
|
159 |
* warning triggered when an entire page is ignored because of @access private
|
|
|
160 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
161 |
*/
|
|
|
162 |
define("PDERROR_UNKNOWN_COMMANDLINE", 27);
|
|
|
163 |
/**
|
|
|
164 |
* warning triggered when an entire page is ignored because of @access private
|
|
|
165 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
166 |
*/
|
|
|
167 |
define("PDERROR_NEED_WHITESPACE", 28);
|
|
|
168 |
/**
|
|
|
169 |
* warning triggered when an entire page is ignored because of @access private
|
|
|
170 |
* @todo I think this description is a copy/paste that was never updated
|
|
|
171 |
*/
|
|
|
172 |
define("PDERROR_CLASS_PARENT_NOT_FOUND", 29);
|
|
|
173 |
/**
|
|
|
174 |
* warning triggered when a getClassByPackage is called and can't find the class
|
|
|
175 |
*/
|
|
|
176 |
define("PDERROR_CLASS_NOT_IN_PACKAGE", 30);
|
|
|
177 |
/**
|
|
|
178 |
* warning triggered when a { @source } inline tag is used in a docblock not
|
|
|
179 |
* preceding a function
|
|
|
180 |
*/
|
|
|
181 |
define("PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND", 31);
|
|
|
182 |
/**
|
|
|
183 |
* warning triggered when a docblock template is never turned off
|
|
|
184 |
* with /**#@-* / (no space)
|
|
|
185 |
*/
|
|
|
186 |
define("PDERROR_DB_TEMPLATE_UNTERMINATED", 32);
|
|
|
187 |
/**
|
|
|
188 |
* warning triggered when a docblock has an unmatched <ol> or <ul>
|
|
|
189 |
*/
|
|
|
190 |
define("PDERROR_UNMATCHED_LIST_TAG", 33);
|
|
|
191 |
/**
|
|
|
192 |
* warning triggered when another tag is nested in <b>
|
|
|
193 |
* (not allowed in phpDocumentor)
|
|
|
194 |
*/
|
|
|
195 |
define("PDERROR_CANT_NEST_IN_B", 34);
|
|
|
196 |
/**
|
|
|
197 |
* warning triggered when a docbook tag is not properly matched
|
|
|
198 |
*/
|
|
|
199 |
define("PDERROR_UNMATCHED_TUTORIAL_TAG", 35);
|
|
|
200 |
/**
|
|
|
201 |
* warning triggered when an inline tag is found inside an xml tag name
|
|
|
202 |
* in a package page
|
|
|
203 |
*/
|
|
|
204 |
define("PDERROR_CANT_HAVE_INLINE_IN_TAGNAME", 36);
|
|
|
205 |
/**
|
|
|
206 |
* warning triggered when a tutorial is referenced
|
|
|
207 |
* via @tutorial/{ @tutorial} and is not found
|
|
|
208 |
*/
|
|
|
209 |
define("PDERROR_TUTORIAL_NOT_FOUND", 37);
|
|
|
210 |
/**
|
|
|
211 |
* warning triggered when a tutorial lists itself as a child tutorial
|
|
|
212 |
*/
|
|
|
213 |
define("PDERROR_TUTORIAL_IS_OWN_CHILD", 38);
|
|
|
214 |
/**
|
|
|
215 |
* warning triggered when a tutorial's child lists the parent tutorial
|
|
|
216 |
* as a child tutorial
|
|
|
217 |
*/
|
|
|
218 |
define("PDERROR_TUTORIAL_IS_OWN_GRANDPA", 39);
|
|
|
219 |
/**
|
|
|
220 |
* warning triggered when a tutorial's child in the .ini file doesn't exist in the
|
|
|
221 |
* package and subpackage of the parent
|
|
|
222 |
*/
|
|
|
223 |
define("PDERROR_CHILD_TUTORIAL_NOT_FOUND", 40);
|
|
|
224 |
/**
|
|
|
225 |
* warning triggered when a <pdffunction:funcname /> tag is used in the PDF
|
|
|
226 |
* Converter and no funcname is present (<pdffunction: />)
|
|
|
227 |
*/
|
|
|
228 |
define("PDERROR_PDFFUNCTION_NO_FUNC", 41);
|
|
|
229 |
/**
|
|
|
230 |
* warning triggered when a <pdffunction:funcname /> tag is used in the PDF
|
|
|
231 |
* Converter and funcname is not a {@link Cezpdf} method
|
|
|
232 |
*/
|
|
|
233 |
define("PDERROR_PDF_METHOD_DOESNT_EXIST", 42);
|
|
|
234 |
/**
|
|
|
235 |
* warning triggered when a <pdffunction:funcname arg=$tempvar/> tag
|
|
|
236 |
* is used in the PDF
|
|
|
237 |
* Converter and "tempvar" is not set from the return of a previous pdffunction tag
|
|
|
238 |
*/
|
|
|
239 |
define("PDERROR_PDF_TEMPVAR_DOESNT_EXIST", 43);
|
|
|
240 |
/**
|
|
|
241 |
* warning triggered when a subsection's title is asked for, but the subsection
|
|
|
242 |
* is not found
|
|
|
243 |
*/
|
|
|
244 |
define("PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND", 44);
|
|
|
245 |
/**
|
|
|
246 |
* warning triggered when a subsection's title is asked for, but the subsection
|
|
|
247 |
* is not found
|
|
|
248 |
*/
|
|
|
249 |
define("PDERROR_UNTERMINATED_ATTRIB", 45);
|
|
|
250 |
/**
|
|
|
251 |
* warning triggered when no @package tag is used in a page-level
|
|
|
252 |
* or class-level DocBlock
|
|
|
253 |
*/
|
|
|
254 |
define("PDERROR_NO_PACKAGE_TAG", 46);
|
|
|
255 |
/**
|
|
|
256 |
* warning triggered when no @access private tag is used in a
|
|
|
257 |
* global variable/method/var with _ as first char in name
|
|
|
258 |
* and --pear was specified
|
|
|
259 |
*/
|
|
|
260 |
define("PDERROR_PRIVATE_ASSUMED", 47);
|
|
|
261 |
/**
|
|
|
262 |
* warning triggered when an example's path from @example /path/to/example.php
|
|
|
263 |
* is not found
|
|
|
264 |
*/
|
|
|
265 |
define("PDERROR_EXAMPLE_NOT_FOUND", 48);
|
|
|
266 |
/**
|
|
|
267 |
* warning triggered when an example's path from @example /path/to/example.php
|
|
|
268 |
* is not found
|
|
|
269 |
*/
|
|
|
270 |
define("PDERROR_NO_CONVERTER_HANDLER", 49);
|
|
|
271 |
/**
|
|
|
272 |
* warning triggered when an example's path from @example /path/to/example.php
|
|
|
273 |
* is not found
|
|
|
274 |
*/
|
|
|
275 |
define("PDERROR_INLINETAG_IN_SEE", 50);
|
|
|
276 |
/**
|
|
|
277 |
* warning triggered when an id attribute in a tutorial docbook tag is not
|
|
|
278 |
* an {@}id} inline tag
|
|
|
279 |
*/
|
|
|
280 |
define("PDERROR_ID_MUST_BE_INLINE", 51);
|
|
|
281 |
/**
|
|
|
282 |
* warning triggered when an {@}internal}} tag is not closed
|
|
|
283 |
*/
|
|
|
284 |
define("PDERROR_INTERNAL_NOT_CLOSED", 52);
|
|
|
285 |
/**
|
|
|
286 |
* warning triggered when an {@}source} tag is found in a short description
|
|
|
287 |
*/
|
|
|
288 |
define("PDERROR_SOURCE_TAG_IGNORED", 53);
|
|
|
289 |
/**
|
|
|
290 |
* warning triggered when a child converter doesn't override
|
|
|
291 |
* getFormattedClassTrees()
|
|
|
292 |
*/
|
|
|
293 |
define("PDERROR_CONVERTER_OVR_GFCT", 54);
|
|
|
294 |
/**
|
|
|
295 |
* warning triggered when a package is already associated with a category, and
|
|
|
296 |
* a new association is found
|
|
|
297 |
*/
|
|
|
298 |
define("PDERROR_PACKAGECAT_SET", 55);
|
|
|
299 |
/**
|
|
|
300 |
* warning triggered when text in a docblock list is not contained in
|
|
|
301 |
* an <<li>> opening tag
|
|
|
302 |
*/
|
|
|
303 |
define("PDERROR_TEXT_OUTSIDE_LI", 56);
|
|
|
304 |
/**
|
|
|
305 |
* warning triggered when a DocBlock html tag is unclosed
|
|
|
306 |
*/
|
|
|
307 |
define("PDERROR_UNCLOSED_TAG", 57);
|
|
|
308 |
/**
|
|
|
309 |
* warning triggered by @filesource, if PHP < 4.3.0
|
|
|
310 |
*/
|
|
|
311 |
define("PDERROR_TAG_NOT_HANDLED", 58);
|
|
|
312 |
/**
|
|
|
313 |
* warning triggered by sourcecode="on", if PHP < 4.3.0
|
|
|
314 |
*/
|
|
|
315 |
define("PDERROR_SOURCECODE_IGNORED", 59);
|
|
|
316 |
/**
|
|
|
317 |
* warning triggered by an empty tag
|
|
|
318 |
*/
|
|
|
319 |
define("PDERROR_MALFORMED_TAG", 60);
|
|
|
320 |
/**
|
|
|
321 |
* warning triggered by more than 1 @category tag
|
|
|
322 |
*/
|
|
|
323 |
define("PDERROR_MULTIPLE_CATEGORY_TAGS", 61);
|
|
|
324 |
/**
|
|
|
325 |
* warning triggered by {@}inheritdoc} in a non-inheritable situation
|
|
|
326 |
*/
|
|
|
327 |
define("PDERROR_INHERITDOC_DONT_WORK_HERE", 62);
|
|
|
328 |
/**
|
|
|
329 |
* warning triggered by @example path/to/example with no title
|
|
|
330 |
*/
|
|
|
331 |
define("PDERROR_EMPTY_EXAMPLE_TITLE", 63);
|
|
|
332 |
/**
|
|
|
333 |
* warning triggered by non-existent template directory
|
|
|
334 |
*/
|
|
|
335 |
define("PDERROR_TEMPLATEDIR_DOESNT_EXIST", 64);
|
|
|
336 |
/**
|
|
|
337 |
* warning triggered by an unterminated entity in a tutorial
|
|
|
338 |
*/
|
|
|
339 |
define("PDERROR_UNTERMINATED_ENTITY", 65);
|
|
|
340 |
/**
|
|
|
341 |
* warning triggered by an unterminated entity in a tutorial
|
|
|
342 |
*/
|
|
|
343 |
define("PDERROR_BEAUTIFYING_FAILED", 66);
|
|
|
344 |
/**
|
|
|
345 |
* warning triggered by a function with no name
|
|
|
346 |
*
|
|
|
347 |
* <pre>
|
|
|
348 |
* function ($params)
|
|
|
349 |
* {
|
|
|
350 |
* }
|
|
|
351 |
* </pre>
|
|
|
352 |
* triggers this error
|
|
|
353 |
*/
|
|
|
354 |
define("PDERROR_FUNCTION_HAS_NONAME", 67);
|
|
|
355 |
/**
|
|
|
356 |
* warning triggered by a page-level docblock preceding a source element
|
|
|
357 |
*
|
|
|
358 |
* <code>
|
|
|
359 |
* <?php
|
|
|
360 |
* /**
|
|
|
361 |
* * Page-level DocBlock
|
|
|
362 |
* * @package pagepackage
|
|
|
363 |
* *{@*}
|
|
|
364 |
* include 'file.php';
|
|
|
365 |
* </code>
|
|
|
366 |
*/
|
|
|
367 |
define("PDERROR_DOCBLOCK_CONFLICT", 68);
|
|
|
368 |
/**
|
|
|
369 |
* warning triggered when a file does not contain a page-level docblock
|
|
|
370 |
*/
|
|
|
371 |
define("PDERROR_NO_PAGE_LEVELDOCBLOCK", 69);
|
|
|
372 |
/**
|
|
|
373 |
* warning triggered when the first docblock in a file with a @package tag
|
|
|
374 |
* precedes a class. In this case, the class gets the docblock.
|
|
|
375 |
*/
|
|
|
376 |
define("PDERROR_DOCBLOCK_GOES_CLASS", 70);
|
|
|
377 |
/**
|
|
|
378 |
* warning triggered in tutorial parsing if there is a missing {@id} inline tag
|
|
|
379 |
*/
|
|
|
380 |
define("PDERROR_NO_DOCBOOK_ID", 71);
|
|
|
381 |
/**
|
|
|
382 |
* warning triggered if someone brilliant tries "class X extends X {"
|
|
|
383 |
*/
|
|
|
384 |
define("PDERROR_CANNOT_EXTEND_SELF", 72);
|
|
|
385 |
/**
|
|
|
386 |
* warning triggered by improper "@uses {@link blah}"
|
|
|
387 |
*/
|
|
|
388 |
define("PDERROR_DUMB_USES", 73);
|
|
|
389 |
/**
|
|
|
390 |
* warning triggered if <<ul>> is nested inside <<ul>> and not <<li>>
|
|
|
391 |
*/
|
|
|
392 |
define("PDERROR_UL_IN_UL", 74);
|
|
|
393 |
/**
|
|
|
394 |
* warning triggered if a command line option does not have a valid value passed in
|
|
|
395 |
*/
|
|
|
396 |
define("PDERROR_INVALID_VALUES", 75);
|
|
|
397 |
/**
|
|
|
398 |
* warning triggered when {@}internal}} is nested inside another {@}internal}}
|
|
|
399 |
*/
|
|
|
400 |
define("PDERROR_NESTED_INTERNAL", 76);
|
|
|
401 |
/**
|
|
|
402 |
* warning triggered when @todo is used on an include element
|
|
|
403 |
*/
|
|
|
404 |
define("PDERROR_NOTODO_INCLUDE", 77);
|
|
|
405 |
/**
|
|
|
406 |
* warning triggered when a class or method hasn't got docblock
|
|
|
407 |
*/
|
|
|
408 |
define("PDERROR_UNDOCUMENTED_ELEMENT", 78);
|
|
|
409 |
/**
|
|
|
410 |
* warning triggered when any of {@}property}}, {@}property-read}},
|
|
|
411 |
* {@}property-write}}, or {@}method}} tag does not have name
|
|
|
412 |
*/
|
|
|
413 |
define("PDERROR_MISSING_PROPERTY_TAG_NAME", 79);
|
|
|
414 |
/**
|
|
|
415 |
* warning triggered when the PHP version being used has dangerous bug/behavior
|
|
|
416 |
*/
|
|
|
417 |
define("PDERROR_DANGEROUS_PHP_BUG_EXISTS", 80);
|
|
|
418 |
/**
|
|
|
419 |
* warning triggered when the alias value in an page-level docblock's @name tag
|
|
|
420 |
* is the same value as the target filename is it supposed to alias
|
|
|
421 |
*/
|
|
|
422 |
define("PDERROR_NAME_ALIAS_SAME_AS_TARGET", 81);
|
|
|
423 |
/**
|
|
|
424 |
* warning triggered when the a loop recursion tripwire has been tripped
|
|
|
425 |
*/
|
|
|
426 |
define("PDERROR_LOOP_RECURSION_LIMIT_REACHED", 82);
|
|
|
427 |
|
|
|
428 |
/**
|
|
|
429 |
* Error messages for phpDocumentor parser warnings
|
|
|
430 |
* @global array $GLOBALS['phpDocumentor_warning_descrip']
|
|
|
431 |
* @name $phpDocumentor_warning_descrip
|
|
|
432 |
*/
|
|
|
433 |
$GLOBALS['phpDocumentor_warning_descrip'] =
|
|
|
434 |
array(
|
|
|
435 |
PDERROR_MULTIPLE_PARENT =>
|
|
|
436 |
'Class %s has multiple possible parents, package inheritance aborted'
|
|
|
437 |
,
|
|
|
438 |
PDERROR_PARENT_NOT_FOUND =>
|
|
|
439 |
'Class %s parent %s not found'
|
|
|
440 |
,
|
|
|
441 |
PDERROR_INHERITANCE_CONFLICT =>
|
|
|
442 |
'Class %s in file %s has multiple possible parents named %s. ' .
|
|
|
443 |
'Cannot resolve name conflict,' . "\n" .
|
|
|
444 |
' try ignoring a file that contains the conflicting parent class'
|
|
|
445 |
,
|
|
|
446 |
PDERROR_UNKNOWN_TAG =>
|
|
|
447 |
'Unknown tag "@%s" used'
|
|
|
448 |
,
|
|
|
449 |
PDERROR_IGNORE_TAG_IGNORED =>
|
|
|
450 |
'@ignore tag used for %s element "%s" will be ignored'
|
|
|
451 |
,
|
|
|
452 |
PDERROR_ELEMENT_IGNORED =>
|
|
|
453 |
"\n" . 'duplicate %s element "%s" in file %s will be ignored.' . "\n" .
|
|
|
454 |
'Use an @ignore tag on the original ' .
|
|
|
455 |
'if you want this case to be documented.'
|
|
|
456 |
,
|
|
|
457 |
PDERROR_PARSEPRIVATE =>
|
|
|
458 |
"entire page %s ignored because of @access private." . "\n" .
|
|
|
459 |
"Choose -pp to enable parsing of private elements"
|
|
|
460 |
,
|
|
|
461 |
PDERROR_CLASS_PARENT_NOT_FOUND =>
|
|
|
462 |
"class %s in package %s parent not found in @see parent::%s"
|
|
|
463 |
,
|
|
|
464 |
PDERROR_CLASS_NOT_IN_PACKAGE =>
|
|
|
465 |
"class %s was not found in package %s"
|
|
|
466 |
,
|
|
|
467 |
PDERROR_DB_TEMPLATE_UNTERMINATED =>
|
|
|
468 |
'docblock template never terminated with /**#@-*/'
|
|
|
469 |
,
|
|
|
470 |
PDERROR_PDF_METHOD_DOESNT_EXIST =>
|
|
|
471 |
'<pdffunction:%s /> called, but pdf method "%s" doesn\'t exist'
|
|
|
472 |
,
|
|
|
473 |
PDERROR_TUTORIAL_NOT_FOUND =>
|
|
|
474 |
"tutorial \"%s\" not found, does it exist?"
|
|
|
475 |
,
|
|
|
476 |
PDERROR_CHILD_TUTORIAL_NOT_FOUND =>
|
|
|
477 |
'child tutorial "%s" listed in %s not found ' .
|
|
|
478 |
'in parent package "%s" subpackage "%s"'
|
|
|
479 |
,
|
|
|
480 |
PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND =>
|
|
|
481 |
'tutorial %s subsection "%s" doesn\'t exist, ' .
|
|
|
482 |
'but its title was asked for'
|
|
|
483 |
,
|
|
|
484 |
PDERROR_NO_PACKAGE_TAG =>
|
|
|
485 |
'no @package tag was used in a DocBlock for %s %s'
|
|
|
486 |
,
|
|
|
487 |
PDERROR_PRIVATE_ASSUMED =>
|
|
|
488 |
'%s "%s" is assumed to be @access private because its name ' .
|
|
|
489 |
'starts with _, but has no @access tag'
|
|
|
490 |
,
|
|
|
491 |
PDERROR_EXAMPLE_NOT_FOUND =>
|
|
|
492 |
'example file "%s" does not exist'
|
|
|
493 |
,
|
|
|
494 |
PDERROR_SOURCE_TAG_IGNORED =>
|
|
|
495 |
'{@source} can only be used in the long description, ' .
|
|
|
496 |
'not in the short description: "%s"'
|
|
|
497 |
,
|
|
|
498 |
PDERROR_PACKAGECAT_SET =>
|
|
|
499 |
'package %s is already in category %s, ' .
|
|
|
500 |
'will now replace with category %s'
|
|
|
501 |
,
|
|
|
502 |
PDERROR_SOURCECODE_IGNORED =>
|
|
|
503 |
'sourcecode command-line option is ignored ' .
|
|
|
504 |
'when your PHP build has no tokenizer support'
|
|
|
505 |
,
|
|
|
506 |
PDERROR_INHERITDOC_DONT_WORK_HERE =>
|
|
|
507 |
'{@inheritdoc} can only be used in the docblock of a child class'
|
|
|
508 |
,
|
|
|
509 |
PDERROR_EMPTY_EXAMPLE_TITLE =>
|
|
|
510 |
'Example file found at "%s" has no title, using "%s"'
|
|
|
511 |
,
|
|
|
512 |
PDERROR_DOCBLOCK_CONFLICT =>
|
|
|
513 |
'Page-level DocBlock precedes "%s %s", ' .
|
|
|
514 |
'use another DocBlock to document the source element'
|
|
|
515 |
,
|
|
|
516 |
PDERROR_NO_PAGE_LEVELDOCBLOCK =>
|
|
|
517 |
'File "%s" has no page-level DocBlock, ' .
|
|
|
518 |
'use @package in the first DocBlock to create one'
|
|
|
519 |
,
|
|
|
520 |
PDERROR_DOCBLOCK_GOES_CLASS =>
|
|
|
521 |
'DocBlock would be page-level, but precedes class "%s", ' .
|
|
|
522 |
'use another DocBlock to document the file'
|
|
|
523 |
,
|
|
|
524 |
PDERROR_NO_DOCBOOK_ID =>
|
|
|
525 |
'Tutorial section %s "%s" has no id="{@id subsection}" tag ' .
|
|
|
526 |
'({@id} for refentry)'
|
|
|
527 |
,
|
|
|
528 |
PDERROR_BEAUTIFYING_FAILED =>
|
|
|
529 |
'Beautifying failed: %s'
|
|
|
530 |
,
|
|
|
531 |
PDERROR_NOTODO_INCLUDE =>
|
|
|
532 |
'@todo on an include element is ignored (line %s, file %s)'
|
|
|
533 |
,
|
|
|
534 |
PDERROR_UNDOCUMENTED_ELEMENT =>
|
|
|
535 |
'%s "%s" has no %s-level DocBlock.'
|
|
|
536 |
,
|
|
|
537 |
PDERROR_MISSING_PROPERTY_TAG_NAME =>
|
|
|
538 |
'@%s magic tag does not have name, illegal. Ignoring tag "@%s %s %s"'
|
|
|
539 |
,
|
|
|
540 |
PDERROR_NAME_ALIAS_SAME_AS_TARGET =>
|
|
|
541 |
'@name value is the same as the filename it is supposed to alias'
|
|
|
542 |
);
|
|
|
543 |
|
|
|
544 |
|
|
|
545 |
|
|
|
546 |
//********************************************************
|
|
|
547 |
|
|
|
548 |
|
|
|
549 |
|
|
|
550 |
/**
|
|
|
551 |
* Error messages for phpDocumentor parser errors
|
|
|
552 |
* @global array $GLOBALS['phpDocumentor_error_descrip']
|
|
|
553 |
* @name $phpDocumentor_error_descrip
|
|
|
554 |
*/
|
|
|
555 |
$GLOBALS['phpDocumentor_error_descrip'] =
|
|
|
556 |
array(
|
|
|
557 |
PDERROR_UNTERMINATED_INLINE_TAG =>
|
|
|
558 |
'Inline tag {@%s} in tag %s is unterminated, "%s"'
|
|
|
559 |
,
|
|
|
560 |
PDERROR_CLASS_EXISTS =>
|
|
|
561 |
'Class %s already exists in package "%s"'
|
|
|
562 |
,
|
|
|
563 |
PDERROR_CONVERTER_NOT_FOUND =>
|
|
|
564 |
'Converter %s specified by --output command-line option is not a class'
|
|
|
565 |
,
|
|
|
566 |
PDERROR_NO_CONVERTERS =>
|
|
|
567 |
'No Converters have been specified by --output command-line option'
|
|
|
568 |
,
|
|
|
569 |
PDERROR_ACCESS_WRONG_PARAM =>
|
|
|
570 |
'@access was passed neither "public" nor "private." Was passed: "%s"'
|
|
|
571 |
,
|
|
|
572 |
PDERROR_MULTIPLE_ACCESS_TAGS =>
|
|
|
573 |
'DocBlock has multiple @access tags, illegal. ' .
|
|
|
574 |
'ignoring additional tag "@access %s"'
|
|
|
575 |
,
|
|
|
576 |
PDERROR_MULTIPLE_RETURN_TAGS =>
|
|
|
577 |
'DocBlock has multiple @return tags, illegal. ' .
|
|
|
578 |
'ignoring additional tag "@return %s %s"'
|
|
|
579 |
,
|
|
|
580 |
PDERROR_MULTIPLE_VAR_TAGS =>
|
|
|
581 |
'DocBlock has multiple @var tags, illegal. ' .
|
|
|
582 |
'ignoring additional tag "@var %s %s"'
|
|
|
583 |
,
|
|
|
584 |
PDERROR_MULTIPLE_PACKAGE_TAGS =>
|
|
|
585 |
'DocBlock has multiple @package tags, illegal. ' .
|
|
|
586 |
'ignoring additional tag "@package %s"'
|
|
|
587 |
,
|
|
|
588 |
PDERROR_MULTIPLE_SUBPACKAGE_TAGS =>
|
|
|
589 |
'DocBlock has multiple @subpackage tags, illegal. ' .
|
|
|
590 |
'ignoring additional tag "@subpackage %s"'
|
|
|
591 |
,
|
|
|
592 |
PDERROR_ILLEGAL_PACKAGENAME =>
|
|
|
593 |
'@%s tag has illegal %s name "%s"'
|
|
|
594 |
,
|
|
|
595 |
PDERROR_OVERRIDDEN_PACKAGE_TAGS =>
|
|
|
596 |
'%s %s\'s DocBlock has @package tag, illegal. ' .
|
|
|
597 |
'ignoring tag "@package %s"'
|
|
|
598 |
,
|
|
|
599 |
PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS =>
|
|
|
600 |
'"%s" %s\'s DocBlock has @subpackage tags, illegal. ' .
|
|
|
601 |
'ignoring tag "@subpackage %s"'
|
|
|
602 |
,
|
|
|
603 |
PDERROR_CLASS_CONFLICT =>
|
|
|
604 |
'class "%s" has multiple declarations in package %s, ' .
|
|
|
605 |
'in file %s and file %s, documentation will have output errors!'
|
|
|
606 |
,
|
|
|
607 |
PDERROR_MULTIPLE_NAME_TAGS =>
|
|
|
608 |
'DocBlock has multiple @name tags, illegal. ' .
|
|
|
609 |
'ignoring additional tag "@name %s"'
|
|
|
610 |
,
|
|
|
611 |
PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE =>
|
|
|
612 |
'-po (packageoutput) option deletes parent file "%s" containing class' .
|
|
|
613 |
' "%s."' . "\n" . ' Try using --defaultpackagename (-dn) %s to ' .
|
|
|
614 |
'include the parent file in the same package as the class'
|
|
|
615 |
,
|
|
|
616 |
PDERROR_GLOBAL_NOT_FOUND =>
|
|
|
617 |
'global variable %s specified in @global tag was never found'
|
|
|
618 |
,
|
|
|
619 |
PDERROR_MULTIPLE_GLOBAL_TAGS =>
|
|
|
620 |
'@global define tag already used for global variable "%s", ' .
|
|
|
621 |
'ignoring @global %s'
|
|
|
622 |
,
|
|
|
623 |
PDERROR_MALFORMED_GLOBAL_TAG =>
|
|
|
624 |
'incorrect @global syntax. ' .
|
|
|
625 |
'Should be @global vartype $varname or @global vartype description'
|
|
|
626 |
,
|
|
|
627 |
PDERROR_UNKNOWN_COMMANDLINE =>
|
|
|
628 |
'Unknown command-line option "%s" encountered, use phpdoc -h for help'
|
|
|
629 |
,
|
|
|
630 |
PDERROR_NEED_WHITESPACE =>
|
|
|
631 |
'phpDocumentor programmer error - wordparser whitespace set to false ' .
|
|
|
632 |
'in handleDocBlock, notify developers. You should never see this error'
|
|
|
633 |
,
|
|
|
634 |
PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND =>
|
|
|
635 |
'{@source} tag used in a docblock that isn\'t preceding a function'
|
|
|
636 |
,
|
|
|
637 |
PDERROR_UNMATCHED_LIST_TAG =>
|
|
|
638 |
'unmatched ol or ul tag in DocBlock, parsing will be incorrect'
|
|
|
639 |
,
|
|
|
640 |
PDERROR_CANT_NEST_IN_B =>
|
|
|
641 |
'Can\'t nest a code, pre, ul, or ol tag in a b tag in ' .
|
|
|
642 |
'phpDocumentor DocBlock (%s tag nested)'
|
|
|
643 |
,
|
|
|
644 |
PDERROR_UNMATCHED_TUTORIAL_TAG =>
|
|
|
645 |
'While parsing extended documentation, "%s" tag was matched ' .
|
|
|
646 |
'with "%s" endtag, missing endtag'."\ntag contents:\"%s\""
|
|
|
647 |
,
|
|
|
648 |
PDERROR_CANT_HAVE_INLINE_IN_TAGNAME =>
|
|
|
649 |
'Can\'t have an inline tag inside a package page XML tag!'
|
|
|
650 |
,
|
|
|
651 |
PDERROR_TUTORIAL_IS_OWN_CHILD =>
|
|
|
652 |
'Tutorial %s lists itself as its own child in %s, illegal'
|
|
|
653 |
,
|
|
|
654 |
PDERROR_TUTORIAL_IS_OWN_GRANDPA =>
|
|
|
655 |
'Tutorial %s\'s child %s lists %s as its child in %s, illegal'
|
|
|
656 |
,
|
|
|
657 |
PDERROR_PDFFUNCTION_NO_FUNC =>
|
|
|
658 |
'Invalid pdffunction syntax: "<pdffunction: />", ' .
|
|
|
659 |
'should be "<pdffunction:functionname [arg="value"...]/>"'
|
|
|
660 |
,
|
|
|
661 |
PDERROR_PDF_TEMPVAR_DOESNT_EXIST =>
|
|
|
662 |
'<pdffunction:%s arg=%s /> called ' .
|
|
|
663 |
'but temporary variable "%s" doesn\'t exist'
|
|
|
664 |
,
|
|
|
665 |
PDERROR_UNTERMINATED_ATTRIB =>
|
|
|
666 |
'Tutorial tag %s attribute %s is unterminated, current value "%s"'
|
|
|
667 |
,
|
|
|
668 |
PDERROR_NO_CONVERTER_HANDLER =>
|
|
|
669 |
'Handler for element of type "%s" called, but %s is not a method of %s'
|
|
|
670 |
,
|
|
|
671 |
PDERROR_INLINETAG_IN_SEE =>
|
|
|
672 |
'Inline tags are not allowed in a @see tag'
|
|
|
673 |
,
|
|
|
674 |
PDERROR_ID_MUST_BE_INLINE =>
|
|
|
675 |
'<%s id="%s"> must be <%s id="{@id %s}">'
|
|
|
676 |
,
|
|
|
677 |
PDERROR_INTERNAL_NOT_CLOSED =>
|
|
|
678 |
'{@internal was never terminated with }}'
|
|
|
679 |
,
|
|
|
680 |
PDERROR_CONVERTER_OVR_GFCT =>
|
|
|
681 |
'Converter "%s" must override getFormattedClassTrees() but doesn\'t'
|
|
|
682 |
,
|
|
|
683 |
PDERROR_TEXT_OUTSIDE_LI =>
|
|
|
684 |
'Text cannot be outside of li tag in a DocBlock list, ' .
|
|
|
685 |
'parsing will be incorrect'
|
|
|
686 |
,
|
|
|
687 |
PDERROR_UNCLOSED_TAG =>
|
|
|
688 |
'Unclosed %s tag in DocBlock, parsing will be incorrect'
|
|
|
689 |
,
|
|
|
690 |
PDERROR_TAG_NOT_HANDLED =>
|
|
|
691 |
'"%s" tag is not available in PHP built without tokenizer support, tag ignored'
|
|
|
692 |
,
|
|
|
693 |
PDERROR_MALFORMED_TAG =>
|
|
|
694 |
'"%s" tag was used without any parameters, illegal'
|
|
|
695 |
,
|
|
|
696 |
PDERROR_MULTIPLE_CATEGORY_TAGS =>
|
|
|
697 |
'package has multiple @category tags, ignoring "@category %s"'
|
|
|
698 |
,
|
|
|
699 |
PDERROR_TEMPLATEDIR_DOESNT_EXIST =>
|
|
|
700 |
'template directory "%s" does not exist'
|
|
|
701 |
,
|
|
|
702 |
PDERROR_UNTERMINATED_ENTITY =>
|
|
|
703 |
'entity &%s is unterminated'
|
|
|
704 |
,
|
|
|
705 |
PDERROR_FUNCTION_HAS_NONAME =>
|
|
|
706 |
'function has no name (PHP error - test your file before parsing!)'
|
|
|
707 |
,
|
|
|
708 |
PDERROR_CANNOT_EXTEND_SELF =>
|
|
|
709 |
'class %s cannot extend itself - TEST YOUR CODE BEFORE PARSING'
|
|
|
710 |
,
|
|
|
711 |
PDERROR_DUMB_USES =>
|
|
|
712 |
'@uses can only link to string data'
|
|
|
713 |
,
|
|
|
714 |
PDERROR_UL_IN_UL =>
|
|
|
715 |
'ul/ol tags cannot be directly nested inside ul/ol, nest inside li'
|
|
|
716 |
,
|
|
|
717 |
PDERROR_INVALID_VALUES =>
|
|
|
718 |
'command %s was passed "%s" but must be one of %s'
|
|
|
719 |
,
|
|
|
720 |
PDERROR_NESTED_INTERNAL =>
|
|
|
721 |
'{@internal}} cannot be nested inside {@internal}}'
|
|
|
722 |
,
|
|
|
723 |
PDERROR_DANGEROUS_PHP_BUG_EXISTS =>
|
|
|
724 |
'Dangerous PHP Bug exists in PHP version %s that can be triggered ' .
|
|
|
725 |
'by this parse (see PHP Bug #%s and PEAR Bug #%s)'
|
|
|
726 |
,
|
|
|
727 |
PDERROR_LOOP_RECURSION_LIMIT_REACHED =>
|
|
|
728 |
'An internal loop in PhpDocumentor has reached its preset ' .
|
|
|
729 |
'recursion limit, preventing a possible infinite loop condition.'
|
|
|
730 |
);
|
|
|
731 |
|
|
|
732 |
/**
|
|
|
733 |
* encapsulates warning information
|
|
|
734 |
*
|
|
|
735 |
* @category ToolsAndUtilities
|
|
|
736 |
* @package phpDocumentor
|
|
|
737 |
* @subpackage Errors
|
|
|
738 |
* @author Greg Beaver <cellog@php.net>
|
|
|
739 |
* @copyright 2001-2008 Gregory Beaver
|
|
|
740 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
741 |
* @version Release: 1.4.3
|
|
|
742 |
* @link http://www.phpdoc.org
|
|
|
743 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
744 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
745 |
*/
|
|
|
746 |
class RecordWarning
|
|
|
747 |
{
|
|
|
748 |
/**
|
|
|
749 |
* name of global variable that descriptors for this warning/error is kept
|
|
|
750 |
* @var string
|
|
|
751 |
*/
|
|
|
752 |
var $type = 'phpDocumentor_warning_descrip';
|
|
|
753 |
/**
|
|
|
754 |
* file this error occurred in
|
|
|
755 |
* @var string
|
|
|
756 |
*/
|
|
|
757 |
var $file = false;
|
|
|
758 |
/**
|
|
|
759 |
* line number of the file this error occurred in
|
|
|
760 |
* @var integer
|
|
|
761 |
*/
|
|
|
762 |
var $linenum;
|
|
|
763 |
/**
|
|
|
764 |
* error string
|
|
|
765 |
* @var string
|
|
|
766 |
*/
|
|
|
767 |
var $data;
|
|
|
768 |
/**
|
|
|
769 |
* error number
|
|
|
770 |
* @see Errors.inc
|
|
|
771 |
* @var string
|
|
|
772 |
*/
|
|
|
773 |
var $num;
|
|
|
774 |
/**
|
|
|
775 |
* Constructor
|
|
|
776 |
*
|
|
|
777 |
* @param string $file filename this error occurred in ({@link $file})
|
|
|
778 |
* @param integer $linenum line number this error occurred on ({@link $linenum})
|
|
|
779 |
* @param integer $num Error number defined in {@link Errors.inc}
|
|
|
780 |
* @param string $data... variable number of strings, up to 4,
|
|
|
781 |
*
|
|
|
782 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
783 |
* to sprintf based on the error number
|
|
|
784 |
*/
|
|
|
785 |
function RecordWarning($file, $linenum, $num)
|
|
|
786 |
{
|
|
|
787 |
$this->file = $file;
|
|
|
788 |
$this->linenum = $linenum;
|
|
|
789 |
$a = array('', '', '', '');
|
|
|
790 |
if (func_num_args()>3) {
|
|
|
791 |
for ($i=3;$i<func_num_args();$i++) {
|
|
|
792 |
$a[$i - 3] = func_get_arg($i);
|
|
|
793 |
}
|
|
|
794 |
}
|
|
|
795 |
|
|
|
796 |
$this->num = $num;
|
|
|
797 |
$this->data =
|
|
|
798 |
sprintf($GLOBALS[$this->type][$this->num], $a[0], $a[1], $a[2], $a[3]);
|
|
|
799 |
$this->output();
|
|
|
800 |
}
|
|
|
801 |
|
|
|
802 |
/**
|
|
|
803 |
* prints the warning
|
|
|
804 |
*
|
|
|
805 |
* @param string $string the warning to print
|
|
|
806 |
*
|
|
|
807 |
* @return void
|
|
|
808 |
*/
|
|
|
809 |
function output($string = false)
|
|
|
810 |
{
|
|
|
811 |
if ($string) {
|
|
|
812 |
if ($this->file) {
|
|
|
813 |
return
|
|
|
814 |
"WARNING in $this->file on line $this->linenum: $this->data\n";
|
|
|
815 |
} else {
|
|
|
816 |
return "WARNING: $this->data\n";
|
|
|
817 |
}
|
|
|
818 |
}
|
|
|
819 |
if ($this->file) {
|
|
|
820 |
phpDocumentor_out("WARNING in $this->file " .
|
|
|
821 |
"on line $this->linenum: $this->data\n");
|
|
|
822 |
} else {
|
|
|
823 |
phpDocumentor_out("WARNING: $this->data\n");
|
|
|
824 |
}
|
|
|
825 |
flush();
|
|
|
826 |
}
|
|
|
827 |
}
|
|
|
828 |
|
|
|
829 |
/**
|
|
|
830 |
* encapsulates error information
|
|
|
831 |
*
|
|
|
832 |
* @category ToolsAndUtilities
|
|
|
833 |
* @package phpDocumentor
|
|
|
834 |
* @subpackage Errors
|
|
|
835 |
* @author Greg Beaver <cellog@php.net>
|
|
|
836 |
* @copyright 2001-2008 Gregory Beaver
|
|
|
837 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
838 |
* @version Release: 1.4.3
|
|
|
839 |
* @link http://www.phpdoc.org
|
|
|
840 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
841 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
842 |
*/
|
|
|
843 |
class RecordError extends RecordWarning
|
|
|
844 |
{
|
|
|
845 |
/**
|
|
|
846 |
* name of global variable that descriptors for this warning/error is kept
|
|
|
847 |
* @var string
|
|
|
848 |
*/
|
|
|
849 |
var $type = 'phpDocumentor_error_descrip';
|
|
|
850 |
|
|
|
851 |
/**
|
|
|
852 |
* prints the error
|
|
|
853 |
*
|
|
|
854 |
* @param string $string the error to print
|
|
|
855 |
*
|
|
|
856 |
* @return string
|
|
|
857 |
*/
|
|
|
858 |
function output($string = false)
|
|
|
859 |
{
|
|
|
860 |
if ($string) {
|
|
|
861 |
if ($this->file) {
|
|
|
862 |
return
|
|
|
863 |
"\n\tERROR in $this->file on line $this->linenum: $this->data\n"
|
|
|
864 |
;
|
|
|
865 |
} else {
|
|
|
866 |
return "\n\tERROR: $this->data\n";
|
|
|
867 |
}
|
|
|
868 |
}
|
|
|
869 |
if ($this->file) {
|
|
|
870 |
phpDocumentor_out("\n\tERROR in $this->file " .
|
|
|
871 |
"on line $this->linenum: $this->data\n");
|
|
|
872 |
} else {
|
|
|
873 |
phpDocumentor_out("\n\tERROR: $this->data\n");
|
|
|
874 |
}
|
|
|
875 |
flush();
|
|
|
876 |
}
|
|
|
877 |
}
|
|
|
878 |
|
|
|
879 |
/**
|
|
|
880 |
* contains all the errors/warnings
|
|
|
881 |
*
|
|
|
882 |
* @category ToolsAndUtilities
|
|
|
883 |
* @package phpDocumentor
|
|
|
884 |
* @subpackage Errors
|
|
|
885 |
* @author Greg Beaver <cellog@php.net>
|
|
|
886 |
* @copyright 2001-2008 Gregory Beaver
|
|
|
887 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
888 |
* @version Release: 1.4.3
|
|
|
889 |
* @link http://www.phpdoc.org
|
|
|
890 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
891 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
892 |
* @see $errors, $warnings
|
|
|
893 |
*/
|
|
|
894 |
class ErrorTracker
|
|
|
895 |
{
|
|
|
896 |
/**
|
|
|
897 |
* array of {@link RecordError}s
|
|
|
898 |
* @var array
|
|
|
899 |
*/
|
|
|
900 |
var $errors = array();
|
|
|
901 |
/**
|
|
|
902 |
* array of {@link RecordWarning}s
|
|
|
903 |
* @var array
|
|
|
904 |
*/
|
|
|
905 |
var $warnings = array();
|
|
|
906 |
/**
|
|
|
907 |
* @var string
|
|
|
908 |
*/
|
|
|
909 |
var $curfile = '';
|
|
|
910 |
/**
|
|
|
911 |
* @var integer
|
|
|
912 |
*/
|
|
|
913 |
var $linenum = 0;
|
|
|
914 |
|
|
|
915 |
/**
|
|
|
916 |
* index in {@link $errors} of last error triggered
|
|
|
917 |
* @var integer|false
|
|
|
918 |
*/
|
|
|
919 |
var $lasterror = false;
|
|
|
920 |
|
|
|
921 |
/**
|
|
|
922 |
* index in {@link $warnings} of last warning triggered
|
|
|
923 |
* @var integer|false
|
|
|
924 |
*/
|
|
|
925 |
var $lastwarning = false;
|
|
|
926 |
|
|
|
927 |
/**
|
|
|
928 |
* This function subscribes to two events in the Parser
|
|
|
929 |
* in order to keep track of line number information and file name.
|
|
|
930 |
*
|
|
|
931 |
* @param integer $num parser-passed event
|
|
|
932 |
* (see {@link PHPDOCUMENTOR_EVENT_NEWLINENUM,
|
|
|
933 |
* PHPDOCUMENTOR_EVENT_NEWFILE})
|
|
|
934 |
* @param mixed $data either a line number if $num is
|
|
|
935 |
* PHPDOCUMENTOR_EVENT_NEWLINENUM or a file name
|
|
|
936 |
* if $num is PHPDOCUMENTOR_EVENT_NEWFILE
|
|
|
937 |
*
|
|
|
938 |
* @return void
|
|
|
939 |
*/
|
|
|
940 |
function handleEvent($num,$data)
|
|
|
941 |
{
|
|
|
942 |
switch($num) {
|
|
|
943 |
case PHPDOCUMENTOR_EVENT_NEWLINENUM :
|
|
|
944 |
$this->linenum = $data;
|
|
|
945 |
break;
|
|
|
946 |
|
|
|
947 |
case PHPDOCUMENTOR_EVENT_NEWFILE :
|
|
|
948 |
$this->linenum = 0;
|
|
|
949 |
$this->curfile = $data;
|
|
|
950 |
break;
|
|
|
951 |
|
|
|
952 |
case 1000000635 : // debugging
|
|
|
953 |
phpDocumentor_out($this->curfile .
|
|
|
954 |
' has ' . $this->linenum . ' lines' . "\n");
|
|
|
955 |
flush();
|
|
|
956 |
break;
|
|
|
957 |
}
|
|
|
958 |
}
|
|
|
959 |
|
|
|
960 |
/**
|
|
|
961 |
* add a new warning to the {@link $warnings} array
|
|
|
962 |
*
|
|
|
963 |
* @param integer $num error number from {@link Errors.inc}
|
|
|
964 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
965 |
* into the error string for error number $num
|
|
|
966 |
*
|
|
|
967 |
* @return void
|
|
|
968 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
969 |
*/
|
|
|
970 |
function addWarning($num)
|
|
|
971 |
{
|
|
|
972 |
$a = array('', '', '', '');
|
|
|
973 |
if (func_num_args()>1) {
|
|
|
974 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
975 |
$a[$i - 1] = func_get_arg($i);
|
|
|
976 |
}
|
|
|
977 |
}
|
|
|
978 |
$this->warnings[] = new RecordWarning($this->curfile,
|
|
|
979 |
$this->linenum, $num, $a[0], $a[1], $a[2], $a[3]);
|
|
|
980 |
$this->lastwarning = count($this->warnings) - 1;
|
|
|
981 |
}
|
|
|
982 |
|
|
|
983 |
/**
|
|
|
984 |
* add a new error to the {@link $errors} array
|
|
|
985 |
*
|
|
|
986 |
* @param integer $num error number from {@link Errors.inc}
|
|
|
987 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
988 |
* into the error string for error number $num
|
|
|
989 |
*
|
|
|
990 |
* @return void
|
|
|
991 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
992 |
*/
|
|
|
993 |
function addError($num)
|
|
|
994 |
{
|
|
|
995 |
$a = array('', '', '', '');
|
|
|
996 |
if (func_num_args()>1) {
|
|
|
997 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
998 |
$a[$i - 1] = func_get_arg($i);
|
|
|
999 |
}
|
|
|
1000 |
}
|
|
|
1001 |
$this->errors[] = new RecordError($this->curfile,
|
|
|
1002 |
$this->linenum, $num, $a[0], $a[1], $a[2], $a[3]);
|
|
|
1003 |
$this->lasterror = count($this->errors) - 1;
|
|
|
1004 |
}
|
|
|
1005 |
|
|
|
1006 |
/**
|
|
|
1007 |
* add a new error to the {@link $errors} array and returns the error string
|
|
|
1008 |
*
|
|
|
1009 |
* @param integer $num error number from {@link Errors.inc}
|
|
|
1010 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
1011 |
* into the error string for error number $num
|
|
|
1012 |
*
|
|
|
1013 |
* @return void
|
|
|
1014 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
1015 |
*/
|
|
|
1016 |
function addErrorReturn($num)
|
|
|
1017 |
{
|
|
|
1018 |
$a = array('', '', '', '');
|
|
|
1019 |
if (func_num_args()>1) {
|
|
|
1020 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
1021 |
$a[$i - 1] = func_get_arg($i);
|
|
|
1022 |
}
|
|
|
1023 |
}
|
|
|
1024 |
$this->errors[] = new RecordError($this->curfile,
|
|
|
1025 |
$this->linenum, $num, $a[0], $a[1], $a[2], $a[3], false);
|
|
|
1026 |
$this->lasterror = count($this->errors) - 1;
|
|
|
1027 |
}
|
|
|
1028 |
|
|
|
1029 |
/**
|
|
|
1030 |
* Get sorted array of all warnings in parsing/conversion
|
|
|
1031 |
*
|
|
|
1032 |
* @return array
|
|
|
1033 |
*/
|
|
|
1034 |
function &returnWarnings()
|
|
|
1035 |
{
|
|
|
1036 |
usort($this->warnings, array($this, "errorsort"));
|
|
|
1037 |
return $this->warnings;
|
|
|
1038 |
}
|
|
|
1039 |
|
|
|
1040 |
/**
|
|
|
1041 |
* Get sorted array of all non-fatal errors in parsing/conversion
|
|
|
1042 |
*
|
|
|
1043 |
* @return array
|
|
|
1044 |
*/
|
|
|
1045 |
function &returnErrors()
|
|
|
1046 |
{
|
|
|
1047 |
usort($this->errors, array($this, "errorsort"));
|
|
|
1048 |
return $this->errors;
|
|
|
1049 |
}
|
|
|
1050 |
|
|
|
1051 |
/**
|
|
|
1052 |
* sort two errors
|
|
|
1053 |
*
|
|
|
1054 |
* @param RecordError|RecordWarning $a the first error/warning
|
|
|
1055 |
* @param RecordError|RecordWarning $b the second error/warning
|
|
|
1056 |
*
|
|
|
1057 |
* @return int
|
|
|
1058 |
* @access private
|
|
|
1059 |
*/
|
|
|
1060 |
function errorsort($a, $b)
|
|
|
1061 |
{
|
|
|
1062 |
if (!$a->file) return -1;
|
|
|
1063 |
if (!$b->file) return 1;
|
|
|
1064 |
if ($a->file == $b->file) {
|
|
|
1065 |
if ($a->linenum == $b->linenum) return 0;
|
|
|
1066 |
if ($a->linenum < $b->linenum) return -1;
|
|
|
1067 |
return 1;
|
|
|
1068 |
}
|
|
|
1069 |
return strnatcasecmp($a->file, $b->file);
|
|
|
1070 |
}
|
|
|
1071 |
|
|
|
1072 |
/**
|
|
|
1073 |
* Get the error message of the last error
|
|
|
1074 |
*
|
|
|
1075 |
* @return string
|
|
|
1076 |
*/
|
|
|
1077 |
function returnLastError()
|
|
|
1078 |
{
|
|
|
1079 |
return $this->errors[$this->lasterror]->output(true);
|
|
|
1080 |
}
|
|
|
1081 |
|
|
|
1082 |
/**
|
|
|
1083 |
* Get the warning message of the last warning
|
|
|
1084 |
*
|
|
|
1085 |
* @return string
|
|
|
1086 |
*/
|
|
|
1087 |
function returnLastWarning()
|
|
|
1088 |
{
|
|
|
1089 |
return $this->warnings[$this->lastwarning]->output(true);
|
|
|
1090 |
}
|
|
|
1091 |
}
|
|
|
1092 |
|
|
|
1093 |
/**
|
|
|
1094 |
* @global ErrorTracker $GLOBALS['phpDocumentor_errors']
|
|
|
1095 |
* @name $phpDocumentor_errors
|
|
|
1096 |
*/
|
|
|
1097 |
$GLOBALS['phpDocumentor_errors'] = new ErrorTracker;
|
|
|
1098 |
|
|
|
1099 |
/**
|
|
|
1100 |
* add an Error
|
|
|
1101 |
*
|
|
|
1102 |
* @param integer $num error number from {@link Errors.inc}
|
|
|
1103 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
1104 |
* into the error string for error number $num
|
|
|
1105 |
*
|
|
|
1106 |
* @return void
|
|
|
1107 |
* @see ErrorTracker::addError()
|
|
|
1108 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
1109 |
*/
|
|
|
1110 |
function addError($num)
|
|
|
1111 |
{
|
|
|
1112 |
global $phpDocumentor_errors;
|
|
|
1113 |
$a = array('', '', '', '');
|
|
|
1114 |
if (func_num_args()>1) {
|
|
|
1115 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
1116 |
$a[$i - 1] = func_get_arg($i);
|
|
|
1117 |
}
|
|
|
1118 |
}
|
|
|
1119 |
$phpDocumentor_errors->addError($num, $a[0], $a[1], $a[2], $a[3]);
|
|
|
1120 |
}
|
|
|
1121 |
|
|
|
1122 |
/**
|
|
|
1123 |
* like {@link addError()} but exits parsing
|
|
|
1124 |
*
|
|
|
1125 |
* @param integer $num error number from {@link Errors.inc}
|
|
|
1126 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
1127 |
* into the error string for error number $num
|
|
|
1128 |
*
|
|
|
1129 |
* @return void
|
|
|
1130 |
* @global ErrorTracker repository for all errors generated by phpDocumentor
|
|
|
1131 |
* @see ErrorTracker::addError()
|
|
|
1132 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
1133 |
*/
|
|
|
1134 |
function addErrorDie($num)
|
|
|
1135 |
{
|
|
|
1136 |
global $phpDocumentor_errors;
|
|
|
1137 |
$a = array('', '', '', '');
|
|
|
1138 |
if (func_num_args()>1) {
|
|
|
1139 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
1140 |
$a[$i - 1] = func_get_arg($i);
|
|
|
1141 |
}
|
|
|
1142 |
}
|
|
|
1143 |
$phpDocumentor_errors->addErrorReturn($num, $a[0], $a[1], $a[2], $a[3]);
|
|
|
1144 |
echo $phpDocumentor_errors->returnLastError();
|
|
|
1145 |
die(1);
|
|
|
1146 |
}
|
|
|
1147 |
|
|
|
1148 |
/**
|
|
|
1149 |
* add a Warning
|
|
|
1150 |
*
|
|
|
1151 |
* @param integer $num warning number from {@link Errors.inc}
|
|
|
1152 |
* @param string $data... up to 4 string parameters to sprintf()
|
|
|
1153 |
* into the error string for error number $num
|
|
|
1154 |
*
|
|
|
1155 |
* @return void
|
|
|
1156 |
* @global ErrorTracker repository for all errors generated by phpDocumentor
|
|
|
1157 |
* @see ErrorTracker::addWarning()
|
|
|
1158 |
* @todo CS Cleanup - do I need to add $data to the method signature?
|
|
|
1159 |
*/
|
|
|
1160 |
function addWarning($num)
|
|
|
1161 |
{
|
|
|
1162 |
global $phpDocumentor_errors;
|
|
|
1163 |
$a = array('', '', '', '');
|
|
|
1164 |
if (func_num_args()>1) {
|
|
|
1165 |
for ($i=1;$i<func_num_args();$i++) {
|
|
|
1166 |
$a[$i - 1] = func_get_arg($i);
|
|
|
1167 |
}
|
|
|
1168 |
}
|
|
|
1169 |
|
|
|
1170 |
$phpDocumentor_errors->addWarning($num, $a[0], $a[1], $a[2], $a[3]);
|
|
|
1171 |
}
|
|
|
1172 |
?>
|