Skip to content

Commit

Permalink
fix: remove deprecation notices from php 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Nov 29, 2024
1 parent 158537d commit 86f3195
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3]
php: [8.2, 8.3, 8.4]
laravel: [10, 11]
phpunit: [10.5, 11]

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. This projec

## Unreleased

### Fixed

- Remove deprecation notices from PHP 8.4.

## [6.0.0] - 2024-03-12

### Changed
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
failOnWarning="true"
failOnDeprecation="false"
failOnNotice="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
>
<coverage/>
<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion src/Constraints/HttpStatusIsSuccessful.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HttpStatusIsSuccessful extends Constraint
*
* @param string|null $content
*/
public function __construct(string $content = null)
public function __construct(?string $content = null)
{
$this->content = $content;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Constraints/OnlyExactInList.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OnlyExactInList extends OnlySubsetsInList
/**
* @inheritdoc
*/
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
protected function fail($other, $description, ?ComparisonFailure $comparisonFailure = null): never
{
$comparisonFailure = Compare::failure(
$this->expected,
Expand Down
2 changes: 1 addition & 1 deletion src/Constraints/OnlyIdentifiersInList.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OnlyIdentifiersInList extends OnlySubsetsInList
/**
* @inheritdoc
*/
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
protected function fail($other, $description, ?ComparisonFailure $comparisonFailure = null): never
{
$comparisonFailure = Compare::failure(
$this->expected,
Expand Down
2 changes: 1 addition & 1 deletion src/Constraints/OnlySubsetsInList.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function toString(): string
/**
* @inheritdoc
*/
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): never
protected function fail($other, $description, ?ComparisonFailure $comparisonFailure = null): never
{
if (!$comparisonFailure) {
$comparisonFailure = Compare::failure(
Expand Down
4 changes: 2 additions & 2 deletions src/HttpAssert.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class HttpAssert
public static function assertStatusCode(
$status,
int $expected,
string $content = null,
?string $content = null,
string $message = ''
): void
{
Expand Down Expand Up @@ -562,7 +562,7 @@ public static function assertAcceptedWithId(
* @param string $message
* @return void
*/
public static function assertNoContent($status, string $content = null, string $message = ''): void
public static function assertNoContent($status, ?string $content = null, string $message = ''): void
{
self::assertStatusCode($status, self::STATUS_NO_CONTENT, $content, $message);
PHPUnitAssert::assertEmpty($content, $message ?: 'Expecting HTTP body content to be empty.');
Expand Down
4 changes: 2 additions & 2 deletions src/HttpMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class HttpMessage implements ArrayAccess
*/
public function __construct(
int $status,
string $contentType = null,
string $content = null,
?string $contentType = null,
?string $content = null,
array $headers = []
) {
$this->status = $status;
Expand Down

0 comments on commit 86f3195

Please sign in to comment.