private static function checkKeyPathIsValidAndNonEmpty($keyPath)
    {
        if (!is_string($keyPath) && !is_int($keyPath)) {
            throw new BadKeyPath($keyPath);
        }
        if (strlen(strval($keyPath)) === 0) {
            throw new BadKeyPath($keyPath);
        }
    }
private static function checkKeyPathIsValidAndNonEmpty($keyPath)
    {
        if (!is_string($keyPath) && !is_int($keyPath)) {
            throw new BadKeyPath($keyPath);
        }
        if (strlen(strval($keyPath)) === 0) {
            throw new BadKeyPath($keyPath);
        }
    }
private static function checkKeyPathIsValidAndNonEmpty ( $ keyPath ) { if ( ! is_string ( $ keyPath ) && ! is_int ( $ keyPath ) ) { throw new BadKeyPath ( $ keyPath ) ; } if ( strlen ( strval ( $ keyPath ) ) === 0 ) { throw new BadKeyPath ( $ keyPath ) ; } }
Check the variable is a string.

@param mixed $keyPath

@return void
@throws BadKeyPath
Check the variable is a string .