It seems like the GitHub access token used for retrieving details about this repository from
GitHub became invalid. This might prevent certain types of inspections from being run (in
particular,
everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
public const IDENTIFIER_REGEX = '/^[0-9A-Za-z\-]+$/';
18
19
/**
20
* The regular expression for a valid semantic version number.
21
*/
22
public const VERSION_REGEX = '/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/';
23
24
/**
25
* Checks if a identifier is valid.
26
*
27
* @param string $identifier A identifier.
28
*
29
* @return boolean TRUE if the identifier is valid, FALSE If not.
30
*/
31
public static function isIdentifier(string $identifier): bool
It seems like you are loosely comparing preg_match(self::IDENTIFIER_REGEX, $identifier) of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.
Loading history...
34
}
35
36
/**
37
* Checks if a number is a valid version number.
38
*
39
* @param integer $number A number.
40
*
41
* @return boolean TRUE if the number is valid, FALSE If not.
42
*/
43
public static function isNumber(int $number): bool
It seems like you are loosely comparing preg_match('/^(0|[1-9]\d*)$/', (string)$number) of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.
Loading history...
46
}
47
48
/**
49
* Checks if the string representation of a version number is valid.
50
*
51
* @param string $version The string representation.
52
*
53
* @return boolean TRUE if the string representation is valid, FALSE if not.
54
*/
55
public static function isVersion(string $version): bool
It seems like you are loosely comparing preg_match(self::VERSION_REGEX, $version) of type integer to the boolean true. If you are specifically checking for non-zero, consider using something more explicit like > 0 or !== 0 instead.