Verify : phpstan
This commit is contained in:
@@ -20,7 +20,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isIp ($val)
|
public function isIp ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIp ($val);
|
return Verify::staticIsIp ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv4 in static mode
|
/** Check if $val is a valid IPv4 in static mode
|
||||||
@@ -41,7 +41,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_ip ($val)
|
public function is_ip ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIp ($val);
|
return Verify::staticIsIp ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv4 in static mode
|
/** Check if $val is a valid IPv4 in static mode
|
||||||
@@ -51,7 +51,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_ip ($val)
|
public static function staticIs_ip ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIp ($val);
|
return Verify::staticIsIp ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv4
|
/** Check if $val is a valid IPv4
|
||||||
@@ -60,7 +60,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isIpv4 ($val)
|
public function isIpv4 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIpv4 ($val);
|
return Verify::staticIsIpv4 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv4 in static mode
|
/** Check if $val is a valid IPv4 in static mode
|
||||||
@@ -81,7 +81,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_ipv4 ($val)
|
public function is_ipv4 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIpv4 ($val);
|
return Verify::staticIsIpv4 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv4 in static mode
|
/** Check if $val is a valid IPv4 in static mode
|
||||||
@@ -91,7 +91,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_ipv4 ($val)
|
public static function staticIs_ipv4 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIpv4 ($val);
|
return Verify::staticIsIpv4 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv6
|
/** Check if $val is a valid IPv6
|
||||||
@@ -100,7 +100,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isIpv6 ($val)
|
public function isIpv6 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsIpv6 ($val);
|
return Verify::staticIsIpv6 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv6 in static mode
|
/** Check if $val is a valid IPv6 in static mode
|
||||||
@@ -121,7 +121,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_ipv6 ($val)
|
public function is_ipv6 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsipv6 ($val);
|
return Verify::staticIsipv6 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid IPv6 in static mode
|
/** Check if $val is a valid IPv6 in static mode
|
||||||
@@ -131,7 +131,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_ipv6 ($val)
|
public static function staticIs_ipv6 ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsipv6 ($val);
|
return Verify::staticIsipv6 ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid hostname (without domain)
|
/** Check if $val is a valid hostname (without domain)
|
||||||
@@ -140,7 +140,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isHostname ($val)
|
public function isHostname ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsHostname ($val);
|
return Verify::staticIsHostname ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid hostname (without domain)
|
/** Check if $val is a valid hostname (without domain)
|
||||||
@@ -168,7 +168,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_hostname ($val)
|
public function is_hostname ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIs_hostname ($val);
|
return Verify::staticIs_hostname ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid hostname (without domain)
|
/** Check if $val is a valid hostname (without domain)
|
||||||
@@ -178,7 +178,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_hostname ($val)
|
public static function staticIs_hostname ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsHostname ($val);
|
return Verify::staticIsHostname ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid domain (without hostname)
|
/** Check if $val is a valid domain (without hostname)
|
||||||
@@ -187,7 +187,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isDomain ($val)
|
public function isDomain ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDomain ($val);
|
return Verify::staticIsDomain ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid domain (without hostname) in static mode
|
/** Check if $val is a valid domain (without hostname) in static mode
|
||||||
@@ -216,7 +216,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_domain ($val)
|
public function is_domain ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDomain ($val);
|
return Verify::staticIsDomain ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid domain (without hostname) in static mode
|
/** Check if $val is a valid domain (without hostname) in static mode
|
||||||
@@ -226,7 +226,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_domain ($val)
|
public static function staticIs_domain ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDomain ($val);
|
return Verify::staticIsDomain ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid FQDN
|
/** Check if $val is a valid FQDN
|
||||||
@@ -235,7 +235,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isFQDN ($val)
|
public function isFQDN ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsFQDN ($val);
|
return Verify::staticIsFQDN ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid FQDN in static mode
|
/** Check if $val is a valid FQDN in static mode
|
||||||
@@ -246,7 +246,7 @@ class Verify
|
|||||||
{
|
{
|
||||||
if (strlen ($val) < 2 || strlen ($val) > 255)
|
if (strlen ($val) < 2 || strlen ($val) > 255)
|
||||||
return false;
|
return false;
|
||||||
if (verify::is_ip ($val))
|
if (Verify::staticIsIp ($val))
|
||||||
return false;
|
return false;
|
||||||
if (strspn ($val, "abcdefghijklmnopqrstuvwxyz".
|
if (strspn ($val, "abcdefghijklmnopqrstuvwxyz".
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
|
||||||
@@ -266,7 +266,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_FQDN ($val)
|
public function is_FQDN ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsFQDN ($val);
|
return Verify::staticIsFQDN ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid FQDN in static mode
|
/** Check if $val is a valid FQDN in static mode
|
||||||
@@ -276,7 +276,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_FQDN ($val)
|
public static function staticIs_FQDN ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsFQDN ($val);
|
return Verify::staticIsFQDN ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
@@ -289,7 +289,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isDatetimeSQL ($val)
|
public function isDatetimeSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDatetimeSQL ($val);
|
return Verify::staticIsDatetimeSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid date and time in SQL in static mode
|
/** Check if $val is a valid date and time in SQL in static mode
|
||||||
@@ -323,7 +323,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_datetimeSQL ($val)
|
public function is_datetimeSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDatetimeSQL ($val);
|
return Verify::staticIsDatetimeSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid date and time in SQL in static mode
|
/** Check if $val is a valid date and time in SQL in static mode
|
||||||
@@ -334,7 +334,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_datetimeSQL ($val)
|
public static function staticIs_datetimeSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDatetimeSQL ($val);
|
return Verify::staticIsDatetimeSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid date in SQL
|
/** Check if $val is a valid date in SQL
|
||||||
@@ -344,7 +344,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isDateSQL ($val)
|
public function isDateSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDateSQL ($val);
|
return Verify::staticIsDateSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid date in SQL in static mode
|
/** Check if $val is a valid date in SQL in static mode
|
||||||
@@ -378,7 +378,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_dateSQL ($val)
|
public function is_dateSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDateSQL ($val);
|
return Verify::staticIsDateSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if $val is a valid date in SQL in static mode
|
/** Check if $val is a valid date in SQL in static mode
|
||||||
@@ -389,7 +389,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_dateSQL ($val)
|
public static function staticIs_dateSQL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsDateSQL ($val);
|
return Verify::staticIsDateSQL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isAllowedChars ($val, $allowedChars)
|
public function isAllowedChars ($val, $allowedChars)
|
||||||
{
|
{
|
||||||
return verify::staticIsAllowedChars ($val, $allowedChars);
|
return Verify::staticIsAllowedChars ($val, $allowedChars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if the provided value is only contains the provided chars.
|
/** Check if the provided value is only contains the provided chars.
|
||||||
@@ -430,7 +430,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isInteger ($val)
|
public function isInteger ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsInteger ($val);
|
return Verify::staticIsInteger ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is an integer in decimal (not octal)
|
/** Return true if the provided value is an integer in decimal (not octal)
|
||||||
@@ -454,7 +454,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_integer ($val)
|
public function is_integer ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsInteger ($val);
|
return Verify::staticIsInteger ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is an integer in decimal (not octal)
|
/** Return true if the provided value is an integer in decimal (not octal)
|
||||||
@@ -464,7 +464,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_integer ($val)
|
public static function staticIs_integer ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsInteger ($val);
|
return Verify::staticIsInteger ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
@@ -476,7 +476,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isEmail ($val)
|
public function isEmail ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsEmail ($val);
|
return Verify::staticIsEmail ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid email address in static mode
|
/** Return true if the provided value is a valid email address in static mode
|
||||||
@@ -495,7 +495,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_email ($val)
|
public function is_email ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsEmail ($val);
|
return Verify::staticIsEmail ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid email address in static mode
|
/** Return true if the provided value is a valid email address in static mode
|
||||||
@@ -505,7 +505,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_email ($val)
|
public static function staticIs_email ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsEmail ($val);
|
return Verify::staticIsEmail ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
@@ -517,7 +517,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isURL ($val)
|
public function isURL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsURL ($val);
|
return Verify::staticIsURL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid URL in static mode
|
/** Return true if the provided value is a valid URL in static mode
|
||||||
@@ -536,7 +536,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_URL ($val)
|
public function is_URL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsURL ($val);
|
return Verify::staticIsURL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid URL in static mode
|
/** Return true if the provided value is a valid URL in static mode
|
||||||
@@ -546,7 +546,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_URL ($val)
|
public static function staticIs_URL ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsURL ($val);
|
return Verify::staticIsURL ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
@@ -559,7 +559,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isUUID ($val)
|
public function isUUID ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsUUID ($val);
|
return Verify::staticIsUUID ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid UUID in static mode
|
/** Return true if the provided value is a valid UUID in static mode
|
||||||
@@ -589,7 +589,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function is_UUID ($val)
|
public function is_UUID ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsUUID ($val);
|
return Verify::staticIsUUID ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided value is a valid UUID in static mode
|
/** Return true if the provided value is a valid UUID in static mode
|
||||||
@@ -600,7 +600,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIs_UUID ($val)
|
public static function staticIs_UUID ($val)
|
||||||
{
|
{
|
||||||
return verify::staticIsUUID ($val);
|
return Verify::staticIsUUID ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided string is a valid hash
|
/** Return true if the provided string is a valid hash
|
||||||
@@ -609,7 +609,7 @@ class Verify
|
|||||||
*/
|
*/
|
||||||
public function isHash ($algo, $val)
|
public function isHash ($algo, $val)
|
||||||
{
|
{
|
||||||
return verify::IsHash ($algo, $val);
|
return Verify::IsHash ($algo, $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true if the provided string is a valid hash in static
|
/** Return true if the provided string is a valid hash in static
|
||||||
@@ -625,7 +625,7 @@ class Verify
|
|||||||
$len = strlen (hash ($algo, ""));
|
$len = strlen (hash ($algo, ""));
|
||||||
if (strlen ($val) !== $len)
|
if (strlen ($val) !== $len)
|
||||||
return false;
|
return false;
|
||||||
if (verify::staticIsAllowedChars ($val, "0123456789abcdef") === false)
|
if (Verify::staticIsAllowedChars ($val, "0123456789abcdef") === false)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user