private static function isClass(string $type): bool
    {
        if ($type === '') {
            throw new EmptyTypeException('Empty type passed');
        }
        if ($type === 'stdClass') {
            return true;
        }
        // Classes start with uppercase letters. Otherwise, it's most likely a scalar.
        if ($type[0] === strtoupper($type[0])) {
            return true;
        }
        return false;
    }