From 9497fc04ef6aae5db6c49df5a9fbf877be047abf Mon Sep 17 00:00:00 2001 From: Paul Rock Date: Thu, 14 Feb 2019 11:49:39 +0300 Subject: [PATCH] simplification --- src/Config.php | 2 +- src/Helpers/TypeHelper.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Config.php b/src/Config.php index a10fe0a..132af99 100644 --- a/src/Config.php +++ b/src/Config.php @@ -58,7 +58,7 @@ class Config implements ConfigInterface } // Check what type has this value - if (TypeHelper::checkIfTypeMismatch($name, \gettype($value), self::ALLOWED[$name])) { + if (TypeHelper::checkIfTypeMismatch(\gettype($value), self::ALLOWED[$name])) { throw new ConfigException("Parameter '$name' has wrong type '" . \gettype($value) . "' but should be '" . self::ALLOWED[$name] . "'"); } diff --git a/src/Helpers/TypeHelper.php b/src/Helpers/TypeHelper.php index 2df76ec..f074cda 100644 --- a/src/Helpers/TypeHelper.php +++ b/src/Helpers/TypeHelper.php @@ -13,12 +13,11 @@ class TypeHelper /** * Compare data types of some value * - * @param string $name Name of value * @param mixed $whatType What type has value * @param mixed $isType What type should be * @return bool */ - public static function checkIfTypeMismatch(string $name, $whatType, $isType): bool + public static function checkIfTypeMismatch($whatType, $isType): bool { return ($whatType !== $isType); }