public static function get(array $array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $keys = self::explodeKeys(strval($keyPath));

        $nextValue = null;
        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $array)) {
                throw new KeyNotFound($keyPath);
            }
            $nextValue = $array[$key];
            if (!is_array($nextValue)) {
                break;
            }
            $array = $nextValue;
        }

        if ($keys === array()) {
            return $nextValue;
        }

        throw new KeyNotFound($keyPath);
    }