Skip to content

Commit

Permalink
PEAR FileCommentSniff and ClassCommentSniff now support author emails…
Browse files Browse the repository at this point in the history
… with a single character in the local part
  • Loading branch information
gsherwood committed May 11, 2012
1 parent 766f102 commit c717874
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ protected function processAuthors($commentStart)
// Dot character cannot be the first or last character
// in the local-part.
$localMiddle = $local.'.\w';
if (preg_match('/^([^<]*)\s+<(['.$local.']['.$localMiddle.']*['.$local.']@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,7})>$/', $content) === 0) {
if (preg_match('/^([^<]*)\s+<(['.$local.'](['.$localMiddle.']*['.$local.'])*@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,7})>$/', $content) === 0) {
$error = 'Content of the @author tag must be in the form "Display Name <username@example.com>"';
$this->currentFile->addError($error, $errorPos, 'InvalidAuthors');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class Missing_Newlines_Before_Tags
* @package ADDITIONAL PACKAGE TAG
* @subpackage SUBPACKAGE TAG
* @author Original Author <author@example.com>
* @author Rayn Ong rong@squiz.net
* @author Greg Sherwood gsherwood@squiz.net
* @author Mr T <t@squiz.net>
* @author
* @copyright 1997~1994 The PHP Group
* @license http://www.php.net/license/3_0.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ public function getErrorList()
65 => 2,
66 => 1,
68 => 2,
69 => 1,
70 => 1,
71 => 1,
73 => 2,
74 => 1,
76 => 1,
72 => 1,
74 => 2,
75 => 1,
77 => 1,
78 => 1,
84 => 1,
92 => 1,
102 => 1,
79 => 1,
85 => 1,
93 => 1,
103 => 1,
);

}//end getErrorList()
Expand All @@ -78,8 +78,8 @@ public function getErrorList()
public function getWarningList()
{
return array(
70 => 1,
72 => 1,
71 => 1,
73 => 1,
);

}//end getWarningList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ declare(encoding='utf-8');
* @package ADDITIONAL PACKAGE TAG
* @subpackage SUBPACKAGE TAG
* @author Antônio Carlos Venâncio Júnior <foreign@character.net>
* @author Rayn Ong rong@squiz.net
* @author Greg Sherwood gsherwood@squiz.net
* @author Mr T <t@squiz.net>
* @author
* @copyright 1997~1994 The PHP Group
* @copyright 1997~1994 The PHP Group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ public function getErrorList()
23 => 2,
24 => 1,
26 => 2,
27 => 1,
28 => 1,
29 => 1,
30 => 1,
31 => 2,
32 => 1,
34 => 1,
31 => 1,
32 => 2,
33 => 1,
35 => 1,
36 => 1,
39 => 1,
37 => 1,
40 => 1,
);

}//end getErrorList()
Expand All @@ -83,10 +83,10 @@ public function getErrorList()
public function getWarningList()
{
return array(
28 => 1,
29 => 1,
33 => 1,
39 => 1,
30 => 1,
34 => 1,
40 => 1,
);

}//end getWarningList()
Expand Down
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed an issue in Zend ClosingTagSniff where the closing tag was not always being detected correctly
-- Thanks to Jonathan Robson for the patch
- Fixed an issue in Generic FunctionCallArgumentSpacingSniff where closures could cause incorrect errors
- PEAR FileCommentSniff and ClassCommentSniff now support author emails with a single character in the local part
-- E.g., a@me.com
-- Thanks to Denis Shapkin for the patch
- Fixed bug #19290 : Generic indent sniffer fails for anonymous functions
- Fixed bug #19324 : Setting show_warnings configuration option does not work
- Fixed bug #19354 : Not recognizing references passed to method
Expand Down

0 comments on commit c717874

Please sign in to comment.