Scrutinizer patch

This commit is contained in:
Eduardo Gulias Davis
2014-10-26 23:02:09 +01:00
parent 82fb2d6ce1
commit 8b62522238
3 changed files with 19 additions and 3 deletions
+9 -3
View File
@@ -121,7 +121,7 @@ class EmailLexer extends AbstractLexer
/**
* moveNext
*
* @return mixed
* @return boolean
*/
public function moveNext()
{
@@ -133,7 +133,7 @@ class EmailLexer extends AbstractLexer
/**
* Lexical catchable patterns.
*
* @return array
* @return string[]
*/
protected function getCatchablePatterns()
{
@@ -151,7 +151,7 @@ class EmailLexer extends AbstractLexer
/**
* Lexical non-catchable patterns.
*
* @return array
* @return string[]
*/
protected function getNonCatchablePatterns()
{
@@ -184,6 +184,9 @@ class EmailLexer extends AbstractLexer
return self::GENERIC;
}
/**
* @param string $value
*/
protected function isNullType($value)
{
if ($value === "\0") {
@@ -193,6 +196,9 @@ class EmailLexer extends AbstractLexer
return false;
}
/**
* @param string $value
*/
protected function isInvalid($value)
{
if (preg_match('/[\x10-\x1F]+/', $value)) {
@@ -28,6 +28,9 @@ class EmailParser
$this->domainPartParser = new DomainPart($this->lexer);
}
/**
* @param string $str
*/
public function parse($str)
{
$this->lexer->setInput($str);
@@ -82,6 +85,10 @@ class EmailParser
return true;
}
/**
* @param string $localPart
* @param string $parsedDomainPart
*/
protected function addLongEmailWarning($localPart, $parsedDomainPart)
{
if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) {
@@ -217,6 +217,9 @@ class DomainPart extends Parser
return $addressLiteral;
}
/**
* @param string $addressLiteral
*/
protected function checkIPV4Tag($addressLiteral)
{
$matchesIP = array();