Skip to content

Commit 2462c5a

Browse files
Merge pull request #10 from luispabon/php71ize
PHP 7.1 uplift
2 parents 0965574 + 30c130b commit 2462c5a

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/Constraint/BodyMatchesConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(Constraint $constraint)
2424
*/
2525
public function toString(): string
2626
{
27-
return "message body matches " . $this->constraint->toString();
27+
return 'message body matches ' . $this->constraint->toString();
2828
}
2929

3030
protected function matches($other): bool

src/Constraint/HasUriConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ protected function matches($other): bool
3333
return false;
3434
}
3535

36-
return $this->uri == $other->getUri()->__toString();
36+
return $this->uri === (string) $other->getUri();
3737
}
3838
}

src/Functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function hasContentType(string $contentType): Constraint
4848
{
4949
return new HasHeaderConstraint(
5050
'Content-Type',
51-
Assert::matchesRegularExpression(',^' . preg_quote($contentType) . '(;.+)?$,')
51+
Assert::matchesRegularExpression(',^' . preg_quote($contentType, '/') . '(;.+)?$,')
5252
);
5353
}
5454

src/Psr7Assertions.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,72 +18,72 @@
1818
trait Psr7Assertions
1919
{
2020

21-
public static function assertRequestHasUri(RequestInterface $request, string $uri)
21+
public static function assertRequestHasUri(RequestInterface $request, string $uri): void
2222
{
2323
Assert::assertThat($request, static::hasUri($uri));
2424
}
2525

26-
public static function assertMessageHasHeader(MessageInterface $message, string $headerName, $headerValue = null)
26+
public static function assertMessageHasHeader(MessageInterface $message, string $headerName, $headerValue = null): void
2727
{
2828
Assert::assertThat($message, static::hasHeader($headerName, $headerValue));
2929
}
3030

31-
public static function assertMessageHasHeaders(MessageInterface $message, array $constraints)
31+
public static function assertMessageHasHeaders(MessageInterface $message, array $constraints): void
3232
{
3333
Assert::assertThat($message, static::hasHeaders($constraints));
3434
}
3535

36-
public static function assertMessageBodyMatches(MessageInterface $message, $constraint)
36+
public static function assertMessageBodyMatches(MessageInterface $message, $constraint): void
3737
{
3838
Assert::assertThat($message, static::bodyMatches($constraint));
3939
}
4040

41-
public static function assertMessageBodyMatchesJson(MessageInterface $message, array $jsonConstraints)
41+
public static function assertMessageBodyMatchesJson(MessageInterface $message, array $jsonConstraints): void
4242
{
4343
Assert::assertThat($message, static::bodyMatchesJson($jsonConstraints));
4444
}
4545

46-
public static function assertResponseHasStatus(ResponseInterface $response, int $status)
46+
public static function assertResponseHasStatus(ResponseInterface $response, int $status): void
4747
{
4848
Assert::assertThat($response, static::hasStatus($status));
4949
}
5050

51-
public static function assertResponseIsSuccess(ResponseInterface $response)
51+
public static function assertResponseIsSuccess(ResponseInterface $response): void
5252
{
5353
Assert::assertThat($response, static::isSuccess());
5454
}
5555

56-
public static function assertResponseIsClientError(ResponseInterface $response)
56+
public static function assertResponseIsClientError(ResponseInterface $response): void
5757
{
5858
Assert::assertThat($response, static::isClientError());
5959
}
6060

61-
public static function assertResponseIsServerError(ResponseInterface $response)
61+
public static function assertResponseIsServerError(ResponseInterface $response): void
6262
{
6363
Assert::assertThat($response, static::isServerError());
6464
}
6565

66-
public static function assertRequestHasMethod(RequestInterface $request, string $method)
66+
public static function assertRequestHasMethod(RequestInterface $request, string $method): void
6767
{
6868
Assert::assertThat($request, static::hasMethod($method));
6969
}
7070

71-
public static function assertRequestIsGet(RequestInterface $request)
71+
public static function assertRequestIsGet(RequestInterface $request): void
7272
{
7373
Assert::assertThat($request, static::isGet());
7474
}
7575

76-
public static function assertRequestIsPost(RequestInterface $request)
76+
public static function assertRequestIsPost(RequestInterface $request): void
7777
{
7878
Assert::assertThat($request, static::isPost());
7979
}
8080

81-
public static function assertRequestIsPut(RequestInterface $request)
81+
public static function assertRequestIsPut(RequestInterface $request): void
8282
{
8383
Assert::assertThat($request, static::isPut());
8484
}
8585

86-
public static function assertRequestIsDelete(RequestInterface $request)
86+
public static function assertRequestIsDelete(RequestInterface $request): void
8787
{
8888
Assert::assertThat($request, static::isDelete());
8989
}

0 commit comments

Comments
 (0)