CodeSampleX

Exemplo

guzzlehttp/guzzle 8.0.2: Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors, and stream EOF read traps in GuzzleHttp\Client

Amostra verificada para composer guzzlehttp/guzzle 8.0.2: Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors…

sha256:e6562515ed9854401063a9e342efcace883b0bb7e7314a875ead4822104844c9

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado php linux x64 php php composer

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
php 8 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-16
php 8 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-18

Caso

HOW
Objetivo
Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors, and stream EOF read traps in GuzzleHttp\Client
Pacotes
Símbolos
  • GuzzleHttp\Client
  • GuzzleHttp\Client::request
  • GuzzleHttp\Exception\ClientException
  • GuzzleHttp\Psr7\Response::getHeader
  • GuzzleHttp\Psr7\Response::getHeaderLine
  • GuzzleHttp\Psr7\Stream::getContents
Ambiente
php
Criado
2026-08-16T08:33:15Z

Contrato

  1. base_uri without trailing slash strips the final path segment when resolving relative path
  2. base_uri with trailing slash strips all path prefix when resolving leading-slash root-relative path
  3. base_uri with trailing slash and relative path without leading slash preserves prefix path
  4. passing a pre-encoded JSON string to json option double-encodes into a quoted JSON string literal
  5. passing an associative array to json option correctly serializes to a JSON object
  6. getHeader returns an array of string header values rather than a scalar string
  7. getHeaderLine returns the combined comma-separated string header representation
  8. getBody getContents advances stream pointer to EOF returning empty string on subsequent calls
  9. casting getBody to string rewinds seekable stream returning full payload
  10. default request throws ClientException on 4xx unless http_errors is explicitly false

Arquivos

  • NOTES.md
  • composer.json
  • composer.lock
  • csx.json
  • test/contract.php

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed