protected function find($array, $key)
    {
        if (empty($key) && !is_numeric($key) || empty($array) || !is_array($array)) {
            return [false, null];
        }

        $partsOfKey = explode('.', $key);
        $variants = [];
        $parts = [];

        do {
            $partial = implode('.', $partsOfKey);

            if (array_key_exists($partial, $array)) {
                if (!count($parts)) {
                    return [true, $array[$partial]];
                }

                $variants[implode('.', $parts)] = $array[$partial];
            }

            array_unshift($parts, array_pop($partsOfKey));
        } while (count($partsOfKey));

        foreach ($variants as $path => $branch) {
            list($has, $value) = $this->find($branch, $path);

            if ($has) {
                return [true, $value];
            }
        }

        return [false, null];
    }