fucongcong/framework

View on GitHub
core/Group/Common/ValidatorToolkit.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 7 of 7 total issues

The class ValidatorToolkit has 14 public methods. Consider refactoring ValidatorToolkit to keep number of public methods under 10.
Open

class ValidatorToolkit
{
public static function email($value)
{
$value = (string) $value;

Avoid unused parameters such as '$option'.
Open

public static function password($value, array $option = array())

Avoid using short method names like ValidatorToolkit::qq(). The configured minimum method name length is 3.
Open

public static function qq($value)
{
return !!preg_match('/^[1-9]\d{4,}$/', $value);
}

The closing brace for the class must go on the next line after the body
Open

}

Line exceeds 120 characters; contains 121 characters
Open

return !!preg_match('/^(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/', $value);

Line exceeds 120 characters; contains 250 characters
Open

return !!preg_match('/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/', $value);

Expected 1 newline at end of file; 0 found
Open

}

There are no issues that match your filters.

Category
Status