From 4cba97ad516b3d918bdd4f6895acb6c79cba3669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Tue, 20 Feb 2018 22:07:08 +0100 Subject: [PATCH] Allow PhpStorm to understand the code better (I followed suggestions from PhpStorm's inspections) --- src/enums/DatatypeEnum.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/enums/DatatypeEnum.php b/src/enums/DatatypeEnum.php index 5813132..8fea47d 100644 --- a/src/enums/DatatypeEnum.php +++ b/src/enums/DatatypeEnum.php @@ -33,6 +33,11 @@ class DatatypeEnum { * Define validator functions here. * * @var array + * + * @uses isValidFloat + * @uses isValidInteger + * @uses isValidBoolean + * @uses isValidDate */ private static $validators = array( self::TYPE_STRING => null, @@ -61,10 +66,8 @@ class DatatypeEnum { continue; } - if (method_exists(__CLASS__, $validator)){ - if (get_class()::$validator($value)) { - return $type; - } + if (method_exists(__CLASS__, $validator) && self::$validator($value)) { + return $type; } }