| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* An exception to be thrown when a DocCommentParser finds an anomilty in a
|
|
|
4 |
* doc comment.
|
|
|
5 |
*
|
|
|
6 |
* PHP version 5
|
|
|
7 |
*
|
|
|
8 |
* @category PHP
|
|
|
9 |
* @package PHP_CodeSniffer
|
|
|
10 |
* @author Greg Sherwood <gsherwood@squiz.net>
|
|
|
11 |
* @author Marc McIntyre <mmcintyre@squiz.net>
|
|
|
12 |
* @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
|
|
|
13 |
* @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
|
|
|
14 |
* @version CVS: $Id: ParserException.php 224862 2006-12-11 23:59:35Z squiz $
|
|
|
15 |
* @link http://pear.php.net/package/PHP_CodeSniffer
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
/**
|
|
|
19 |
* An exception to be thrown when a DocCommentParser finds an anomilty in a
|
|
|
20 |
* doc comment.
|
|
|
21 |
*
|
|
|
22 |
* @category PHP
|
|
|
23 |
* @package PHP_CodeSniffer
|
|
|
24 |
* @author Greg Sherwood <gsherwood@squiz.net>
|
|
|
25 |
* @author Marc McIntyre <mmcintyre@squiz.net>
|
|
|
26 |
* @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
|
|
|
27 |
* @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
|
|
|
28 |
* @version Release: 1.2.1
|
|
|
29 |
* @link http://pear.php.net/package/PHP_CodeSniffer
|
|
|
30 |
*/
|
|
|
31 |
class PHP_CodeSniffer_CommentParser_ParserException extends Exception
|
|
|
32 |
{
|
|
|
33 |
|
|
|
34 |
/**
|
|
|
35 |
* The line where the exception occured, in relation to the doc comment.
|
|
|
36 |
*
|
|
|
37 |
* @var int
|
|
|
38 |
*/
|
|
|
39 |
private $_line = 0;
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* Constructs a DocCommentParserException.
|
|
|
44 |
*
|
|
|
45 |
* @param string $message The message of the exception.
|
|
|
46 |
* @param int $line The position in comment where the error occured.
|
|
|
47 |
* A position of 0 indicates that the error occured
|
|
|
48 |
* at the opening line of the doc comment.
|
|
|
49 |
*/
|
|
|
50 |
public function __construct($message, $line)
|
|
|
51 |
{
|
|
|
52 |
parent::__construct($message);
|
|
|
53 |
$this->_line = $line;
|
|
|
54 |
|
|
|
55 |
}//end __construct()
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
/**
|
|
|
59 |
* Returns the line number within the comment where the exception occured.
|
|
|
60 |
*
|
|
|
61 |
* @return int
|
|
|
62 |
*/
|
|
|
63 |
public function getLineWithinComment()
|
|
|
64 |
{
|
|
|
65 |
return $this->_line;
|
|
|
66 |
|
|
|
67 |
}//end getLineWithinComment()
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
}//end class
|
|
|
71 |
|
|
|
72 |
?>
|