public static function decompilePath($path)
    {
        if (is_object($path) && ! method_exists($path, '__toString')) {
            throw InvalidArgumentException::create('scalar', $path);
        }
        $path = (string) $path;

        if (preg_match('/^[a-z0-9_]*\./i', $path)) {
            return explode('.', $path);
        }
        else {
            $parts = array_filter(explode('[', $path), function (&$value) {
                $value = trim($value, ']');
                return ! empty($value);
            });
            return array_values($parts);
        }
    }