Skip to content

Commit

Permalink
Merge pull request #1051 from joanhey/patch-1
Browse files Browse the repository at this point in the history
Add PHP 8.4 nightly to tests
  • Loading branch information
walkor authored Oct 21, 2024
2 parents 7d9d8b7 + 1032398 commit 4ede813
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: ["8.1", "8.2", "8.3"]
php: ["8.1", "8.2", "8.3", "8.4"]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down
12 changes: 6 additions & 6 deletions src/Protocols/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function __construct(protected string $buffer) {}
* @param mixed $default
* @return mixed
*/
public function get(string $name = null, mixed $default = null): mixed
public function get(?string $name = null, mixed $default = null): mixed
{
if (!isset($this->data['get'])) {
$this->parseGet();
Expand Down Expand Up @@ -157,7 +157,7 @@ public function setGet(array $get): Request
* @param mixed $default
* @return mixed
*/
public function post(string $name = null, mixed $default = null): mixed
public function post(?string $name = null, mixed $default = null): mixed
{
if (!isset($this->data['post'])) {
$this->parsePost();
Expand Down Expand Up @@ -188,7 +188,7 @@ public function setPost(array $post): Request
* @param mixed $default
* @return mixed
*/
public function header(string $name = null, mixed $default = null): mixed
public function header(?string $name = null, mixed $default = null): mixed
{
if (!isset($this->data['headers'])) {
$this->parseHeaders();
Expand Down Expand Up @@ -219,7 +219,7 @@ public function setHeaders(array $headers): Request
* @param mixed $default
* @return mixed
*/
public function cookie(string $name = null, mixed $default = null): mixed
public function cookie(?string $name = null, mixed $default = null): mixed
{
if (!isset($this->data['cookie'])) {
$cookies = explode(';', $this->header('cookie', ''));
Expand All @@ -246,7 +246,7 @@ public function cookie(string $name = null, mixed $default = null): mixed
* @param string|null $name
* @return array|null
*/
public function file(string $name = null)
public function file(?string $name = null)
{
clearstatcache();
if (!empty($this->data['files'])) {
Expand Down Expand Up @@ -357,7 +357,7 @@ public function session(): Session
* @return string
* @throws Exception
*/
public function sessionId(string $sessionId = null): string
public function sessionId(?string $sessionId = null): string
{
if ($sessionId) {
unset($this->sid);
Expand Down
2 changes: 1 addition & 1 deletion src/Protocols/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function getHeaders(): array
* @param string|null $reasonPhrase
* @return $this
*/
public function withStatus(int $code, string $reasonPhrase = null): static
public function withStatus(int $code, ?string $reasonPhrase = null): static
{
$this->status = $code;
$this->reason = $reasonPhrase;
Expand Down
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function something()
// ..
}

function testWithConnectionClose(Closure $closure, string $dataContains = null, $connectionClass = TcpConnection::class): void
function testWithConnectionClose(Closure $closure, ?string $dataContains = null, $connectionClass = TcpConnection::class): void
{
$tcpConnection = Mockery::spy($connectionClass);
$closure($tcpConnection);
Expand Down

0 comments on commit 4ede813

Please sign in to comment.