Skip to content

Commit

Permalink
[php84] Fix some deprecations and lower requirements (#52636)
Browse files Browse the repository at this point in the history
* Fix implicit null types

* Update some lower requirements

* Fix typo

* More lower version constraints

* More lower version constraints

* For now only run lowest strategy

* Adjust PHPunit version

* Adjust carbon requirement

* Add phpunit 10 again

* Fix phpunit annotations

* Add prefer-stable again, disable fail-fast

* Allow cli-parser 2.0.1 for phpunit 10

* Escape pipe
  • Loading branch information
Jubeki authored Sep 4, 2024
1 parent 1aefe67 commit f1c8683
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
- 8888:8000

strategy:
fail-fast: true
# fail-fast: true
matrix:
php: [8.4]
phpunit: ['10.5', '11.0.1']
phpunit: ['10.5.12', '11.3.2']
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - ${{ matrix.stability }}
Expand Down Expand Up @@ -71,6 +71,13 @@ jobs:
max_attempts: 5
command: composer require guzzlehttp/psr7:^2.4 --no-interaction --no-update

- name: Set minimum PHP 8.4 versions
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: composer require guzzlehttp/promises:^2.0.3 mockery/mockery:^1.6.10 symfony/http-foundation:^7.1.3 symfony/translation:^7.1.3 symfony/console:^7.1.3 sebastian/cli-parser:^2.0.1\|^3.0.1 nesbot/carbon:^3.4.0 sebastian/exporter:^6.0.1 --no-interaction --no-update

- name: Set PHPUnit
uses: nick-fields/retry@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Support/ValidatedInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function missing($keys)
* @param callable|null $default
* @return $this|mixed
*/
public function whenMissing($key, callable $callback, callable $default = null)
public function whenMissing($key, callable $callback, ?callable $default = null)
{
if ($this->missing($key)) {
return $callback(data_get($this->all(), $key)) ?: $this;
Expand Down Expand Up @@ -212,7 +212,7 @@ public function all()
* @param callable|null $default
* @return $this|mixed
*/
public function whenHas($key, callable $callback, callable $default = null)
public function whenHas($key, callable $callback, ?callable $default = null)
{
if ($this->has($key)) {
return $callback(data_get($this->all(), $key)) ?: $this;
Expand Down Expand Up @@ -290,7 +290,7 @@ public function anyFilled($keys)
* @param callable|null $default
* @return $this|mixed
*/
public function whenFilled($key, callable $callback, callable $default = null)
public function whenFilled($key, callable $callback, ?callable $default = null)
{
if ($this->filled($key)) {
return $callback(data_get($this->all(), $key)) ?: $this;
Expand Down
17 changes: 5 additions & 12 deletions tests/Bus/QueueableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Bus;

use Illuminate\Bus\Queueable;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class QueueableTest extends TestCase
Expand All @@ -17,9 +18,7 @@ public static function connectionDataProvider(): array
];
}

/**
* @dataProvider connectionDataProvider
*/
#[DataProvider('connectionDataProvider')]
public function testOnConnection(mixed $connection, ?string $expected): void
{
$job = new FakeJob();
Expand All @@ -28,9 +27,7 @@ public function testOnConnection(mixed $connection, ?string $expected): void
$this->assertSame($job->connection, $expected);
}

/**
* @dataProvider connectionDataProvider
*/
#[DataProvider('connectionDataProvider')]
public function testAllOnConnection(mixed $connection, ?string $expected): void
{
$job = new FakeJob();
Expand All @@ -50,9 +47,7 @@ public static function queuesDataProvider(): array
];
}

/**
* @dataProvider queuesDataProvider
*/
#[DataProvider('queuesDataProvider')]
public function testOnQueue(mixed $queue, ?string $expected): void
{
$job = new FakeJob();
Expand All @@ -61,9 +56,7 @@ public function testOnQueue(mixed $queue, ?string $expected): void
$this->assertSame($job->queue, $expected);
}

/**
* @dataProvider queuesDataProvider
*/
#[DataProvider('queuesDataProvider')]
public function testAllOnQueue(mixed $queue, ?string $expected): void
{
$job = new FakeJob();
Expand Down

0 comments on commit f1c8683

Please # to comment.