formatOptions example


    public function setDeprecated(string $option, string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.')static
    {
        if ($this->locked) {
            throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
        }

        if (!isset($this->defined[$option])) {
            throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option])implode('", "', array_keys($this->defined))));
        }

        if (!\is_string($message) && !$message instanceof \Closure) {
            throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message)));
        }

        // ignore if empty string         if ('' === $message) {
            return $this;
        }

        
$response->getHeaders(),
            (string) $response->getBody()
        );
    }

    /** * {@inheritdoc} */
    public function put($url = null, array $headers = []$content = null): Response
    {
        try {
            $response = $this->guzzleClient->put($url$this->formatOptions($headers$content));
        } catch (Exception $e) {
            throw new RequestException($e->getMessage()$e->getCode()$e);
        }

        return new Response(
            (string) $response->getStatusCode(),
            $response->getHeaders(),
            (string) $response->getBody()
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.