Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<UndefinedAttributeClass errorLevel="suppress" />
</issueHandlers>
</psalm>
5 changes: 5 additions & 0 deletions src/ClientError.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Response,
};

/**
* @psalm-immutable
*/
final class ClientError
{
private Request $request;
Expand All @@ -23,11 +26,13 @@ public function __construct(Request $request, Response $response)
$this->response = $response;
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function response(): Response
{
return $this->response;
Expand Down
5 changes: 5 additions & 0 deletions src/ConnectionFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

use Innmind\Http\Request;

/**
* @psalm-immutable
*/
final class ConnectionFailed
{
public function __construct(
Expand All @@ -13,11 +16,13 @@ public function __construct(
) {
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function reason(): string
{
return $this->reason;
Expand Down
4 changes: 4 additions & 0 deletions src/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static function of(
*
* @param positive-int $max
*/
#[\NoDiscard]
public function maxConcurrency(int $max): self
{
return new self(
Expand All @@ -98,6 +99,7 @@ public function maxConcurrency(int $max): self
* @param Period $timeout Only seconds are allowed
* @param callable(): void $heartbeat
*/
#[\NoDiscard]
public function heartbeat(Period $timeout, ?callable $heartbeat = null): self
{
return new self(
Expand All @@ -120,6 +122,7 @@ public function heartbeat(Period $timeout, ?callable $heartbeat = null): self
*
* @psalm-mutation-free
*/
#[\NoDiscard]
public function disableSSLVerification(): self
{
return new self(
Expand All @@ -136,6 +139,7 @@ public function disableSSLVerification(): self
/**
* @psalm-mutation-free
*/
#[\NoDiscard]
public function proxy(Url $proxy): self
{
return new self(
Expand Down
5 changes: 5 additions & 0 deletions src/Failure.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

use Innmind\Http\Request;

/**
* @psalm-immutable
*/
final class Failure
{
public function __construct(
Expand All @@ -13,11 +16,13 @@ public function __construct(
) {
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function reason(): string
{
return $this->reason;
Expand Down
5 changes: 5 additions & 0 deletions src/Information.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Response,
};

/**
* @psalm-immutable
*/
final class Information
{
private Request $request;
Expand All @@ -23,11 +26,13 @@ public function __construct(Request $request, Response $response)
$this->response = $response;
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function response(): Response
{
return $this->response;
Expand Down
5 changes: 5 additions & 0 deletions src/MalformedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Innmind\HttpTransport\MalformedResponse\Raw;
use Innmind\Http\Request;

/**
* @psalm-immutable
*/
final class MalformedResponse
{
private Request $request;
Expand All @@ -17,11 +20,13 @@ public function __construct(Request $request, ?Raw $raw = null)
$this->raw = $raw ?? Raw::none();
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function raw(): Raw
{
return $this->raw;
Expand Down
3 changes: 3 additions & 0 deletions src/MalformedResponse/Raw.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static function none(): self
return new self(Str::of(''), Sequence::of(), Content::none());
}

#[\NoDiscard]
public function statusLine(): Str
{
return $this->statusLine;
Expand All @@ -50,11 +51,13 @@ public function statusLine(): Str
/**
* @return Sequence<Str>
*/
#[\NoDiscard]
public function headers(): Sequence
{
return $this->headers;
}

#[\NoDiscard]
public function body(): Content
{
return $this->body;
Expand Down
5 changes: 5 additions & 0 deletions src/Redirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Response,
};

/**
* @psalm-immutable
*/
final class Redirection
{
private Request $request;
Expand All @@ -23,11 +26,13 @@ public function __construct(Request $request, Response $response)
$this->response = $response;
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function response(): Response
{
return $this->response;
Expand Down
5 changes: 5 additions & 0 deletions src/ServerError.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Response,
};

/**
* @psalm-immutable
*/
final class ServerError
{
private Request $request;
Expand All @@ -23,11 +26,13 @@ public function __construct(Request $request, Response $response)
$this->response = $response;
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function response(): Response
{
return $this->response;
Expand Down
5 changes: 5 additions & 0 deletions src/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Response,
};

/**
* @psalm-immutable
*/
final class Success
{
private Request $request;
Expand All @@ -23,11 +26,13 @@ public function __construct(Request $request, Response $response)
$this->response = $response;
}

#[\NoDiscard]
public function request(): Request
{
return $this->request;
}

#[\NoDiscard]
public function response(): Response
{
return $this->response;
Expand Down
1 change: 1 addition & 0 deletions src/Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ interface Transport
/**
* @return Either<Errors, Success>
*/
#[\NoDiscard]
public function __invoke(Request $request): Either;
}
Loading