public static function patch(array $array, array $patches, string $parent = ''): array
    {
        foreach ($array as $key => $value) {
            $z = $parent . '/' . $key;

            if (isset($patches[$z])) {
                $array[$key] = $patches[$z];
                unset($patches[$z]);

                if (!count($patches)) {
                    break;
                }
            }

            if (is_array($value)) {
                $array[$key] = static::patch($value, $patches, $z);
            }
        }

        return $array;
    }