Remove superfluous parentheses

This commit is contained in:
2021-09-17 15:52:37 +02:00
parent 80ab3216d5
commit a6ebab3e03
3 changed files with 17 additions and 16 deletions

View File

@ -16,7 +16,7 @@ final class MD_STD_IN {
*
* @return integer
*/
public static function sanitize_id($input):int {
public static function sanitize_id(mixed $input):int {
$input = \filter_var($input, \FILTER_VALIDATE_INT, [
'options' => [
@ -26,7 +26,7 @@ final class MD_STD_IN {
]
);
if (!($input)) {
if (!$input) {
throw new MDpageParameterNotNumericException("Value is not numeric.");
}
@ -41,7 +41,7 @@ final class MD_STD_IN {
*
* @return integer
*/
public static function sanitize_id_or_zero($input):int {
public static function sanitize_id_or_zero(mixed $input):int {
if ($input === "") {
return 0;
@ -71,7 +71,7 @@ final class MD_STD_IN {
*
* @return string
*/
public static function sanitize_text($input):string {
public static function sanitize_text(mixed $input):string {
$output = \filter_var($input,
FILTER_SANITIZE_STRING,
@ -95,14 +95,14 @@ final class MD_STD_IN {
*
* @return string
*/
public static function sanitize_rgb_color($input):string {
public static function sanitize_rgb_color(mixed $input):string {
$output = \filter_var($input,
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES);
if ($output === false
|| ((preg_match('/^[a-zA-Z0-9]{3}$/', $output)) === false && (preg_match('/^[a-zA-Z0-9]{6}$/', $output)) === false)
|| (preg_match('/^[a-zA-Z0-9]{3}$/', $output) === false && preg_match('/^[a-zA-Z0-9]{6}$/', $output) === false)
) {
throw new MDInvalidColorCode("Invalid color code provided: " . $output);
}
@ -175,7 +175,7 @@ final class MD_STD_IN {
*
* @return string
*/
public static function sanitize_url($input):string {
public static function sanitize_url(mixed $input):string {
if ($input === "") {
return "";
@ -197,7 +197,7 @@ final class MD_STD_IN {
*
* @return string
*/
public static function sanitize_email($input):string {
public static function sanitize_email(mixed $input):string {
if ($input === "") {
return "";