public static function checkType(array $vars): bool
    {
        foreach ($vars as $var) {
            if (!is_array($var)) {
                throw new Exception(
                    'The informations need for the check is not in a correct format.',
                    self::ERR_CHECKTYPE_INFOS_FORMAT
                );
            }

            if (
                !isset($var['data'])
                || empty($var['type'])
                || (isset($var['type']) && !is_string($var['type']))
            ) {
                throw new Exception(
                    'Items data or type is empty or in an bad format.',
                    self::ERR_CHECKTYPE_DATA_OR_TYPE_VALUE_FORMAT
                );
            }

            if ($var['type'] === 'int') {
                $var['type'] = 'integer';
            } elseif ($var['type'] === 'float') {
                $var['type'] = 'double';
            }

            if (gettype($var['data']) !== $var['type']) {
                return false;
            }
        }

        return true;
    }
public static function checkType(array $vars): bool
    {
        foreach ($vars as $var) {
            if (!is_array($var)) {
                throw new Exception(
                    'The informations need for the check is not in a correct format.',
                    self::ERR_CHECKTYPE_INFOS_FORMAT
                );
            }

            if (
                !isset($var['data'])
                || empty($var['type'])
                || (isset($var['type']) && !is_string($var['type']))
            ) {
                throw new Exception(
                    'Items data or type is empty or in an bad format.',
                    self::ERR_CHECKTYPE_DATA_OR_TYPE_VALUE_FORMAT
                );
            }

            if ($var['type'] === 'int') {
                $var['type'] = 'integer';
            } elseif ($var['type'] === 'float') {
                $var['type'] = 'double';
            }

            if (gettype($var['data']) !== $var['type']) {
                return false;
            }
        }

        return true;
    }
public static function checkType ( array $ vars ) : bool { foreach ( $ vars as $ var ) { if ( ! is_array ( $ var ) ) { throw new Exception ( 'The informations need for the check is not in a correct format.' , self :: ERR_CHECKTYPE_INFOS_FORMAT ) ; } if ( ! isset ( $ var [ 'data' ] ) || empty ( $ var [ 'type' ] ) || ( isset ( $ var [ 'type' ] ) && ! is_string ( $ var [ 'type' ] ) ) ) { throw new Exception ( 'Items data or type is empty or in an bad format.' , self :: ERR_CHECKTYPE_DATA_OR_TYPE_VALUE_FORMAT ) ; } if ( $ var [ 'type' ] === 'int' ) { $ var [ 'type' ] = 'integer' ; } elseif ( $ var [ 'type' ] === 'float' ) { $ var [ 'type' ] = 'double' ; } if ( gettype ( $ var [ 'data' ] ) !== $ var [ 'type' ] ) { return false ; } } return true ; }
Check types of variables

@param array $vars : Variables to check
array(array('type' => 'myType', 'data' => 'myData), array(...)...)

@return boolean
Check types of variables