Skip to content

Commit

Permalink
Changed line seperators in Request to \n instead of \r\n
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hills committed Oct 30, 2023
1 parent f1d46ea commit b8fe5c6
Showing 1 changed file with 135 additions and 135 deletions.
270 changes: 135 additions & 135 deletions tests/Unit/Request.php
Original file line number Diff line number Diff line change
@@ -1,135 +1,135 @@
<?php

namespace ZipkinOpenTracing\Tests\Unit;

use LogicException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;

final class Request implements RequestInterface
{
/**
* @var array
*/
private $headers;

public function __construct(array $headers = [])
{
foreach ($headers as $key => $value) {
$this->headers[strtolower($key)] = [$value];
}
}

/**
* @return string[][]
*/
public function getHeaders(): array
{
return $this->headers;
}

/**
* @return bool
*/
public function hasHeader($name): bool
{
foreach ($this->headers as $key => $value) {
if ($key === strtolower($name)) {
return true;
}
}

return false;
}

/**
* @return string[]
*/
public function getHeader($name): array
{
foreach ($this->headers as $key => $value) {
if ($key === strtolower($name)) {
return $value;
}
}

return [];
}

public function withHeader($name, $value): \Psr\Http\Message\MessageInterface
{
$this->headers[strtolower($name)] = [$value];
return $this;
}

// These functions are required by the interface but no used during
// parsing of headers
//
// phpcs:disable
public function withAddedHeader($name, $value): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getProtocolVersion(): string
{
throw new LogicException('not implemented');
}

public function withProtocolVersion($version): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getHeaderLine($name): string
{
throw new LogicException('not implemented');
}

public function withoutHeader($name): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getBody(): StreamInterface
{
throw new LogicException('not implemented');
}

public function withBody(StreamInterface $body): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getRequestTarget(): string
{
throw new LogicException('not implemented');
}

public function withRequestTarget($requestTarget): RequestInterface
{
throw new LogicException('not implemented');
}

public function getMethod(): string
{
throw new LogicException('not implemented');
}

public function withMethod($method): RequestInterface
{
throw new LogicException('not implemented');
}

public function getUri(): UriInterface
{
throw new LogicException('not implemented');
}

public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
throw new LogicException('not implemented');
}
// phpcs:enable
}
<?php

namespace ZipkinOpenTracing\Tests\Unit;

use LogicException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;

final class Request implements RequestInterface
{
/**
* @var array
*/
private $headers;

public function __construct(array $headers = [])
{
foreach ($headers as $key => $value) {
$this->headers[strtolower($key)] = [$value];
}
}

/**
* @return string[][]
*/
public function getHeaders(): array
{
return $this->headers;
}

/**
* @return bool
*/
public function hasHeader($name): bool
{
foreach ($this->headers as $key => $value) {
if ($key === strtolower($name)) {
return true;
}
}

return false;
}

/**
* @return string[]
*/
public function getHeader($name): array
{
foreach ($this->headers as $key => $value) {
if ($key === strtolower($name)) {
return $value;
}
}

return [];
}

public function withHeader($name, $value): \Psr\Http\Message\MessageInterface
{
$this->headers[strtolower($name)] = [$value];
return $this;
}

// These functions are required by the interface but no used during
// parsing of headers
//
// phpcs:disable
public function withAddedHeader($name, $value): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getProtocolVersion(): string
{
throw new LogicException('not implemented');
}

public function withProtocolVersion($version): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getHeaderLine($name): string
{
throw new LogicException('not implemented');
}

public function withoutHeader($name): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getBody(): StreamInterface
{
throw new LogicException('not implemented');
}

public function withBody(StreamInterface $body): \Psr\Http\Message\MessageInterface
{
throw new LogicException('not implemented');
}

public function getRequestTarget(): string
{
throw new LogicException('not implemented');
}

public function withRequestTarget($requestTarget): RequestInterface
{
throw new LogicException('not implemented');
}

public function getMethod(): string
{
throw new LogicException('not implemented');
}

public function withMethod($method): RequestInterface
{
throw new LogicException('not implemented');
}

public function getUri(): UriInterface
{
throw new LogicException('not implemented');
}

public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
throw new LogicException('not implemented');
}
// phpcs:enable
}

0 comments on commit b8fe5c6

Please sign in to comment.