Skip to content

Commit f1c8683

Browse files
authored
[php84] Fix some deprecations and lower requirements (#52636)
* 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
1 parent 1aefe67 commit f1c8683

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
- 8888:8000
3838

3939
strategy:
40-
fail-fast: true
40+
# fail-fast: true
4141
matrix:
4242
php: [8.4]
43-
phpunit: ['10.5', '11.0.1']
43+
phpunit: ['10.5.12', '11.3.2']
4444
stability: [prefer-lowest, prefer-stable]
4545

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

74+
- name: Set minimum PHP 8.4 versions
75+
uses: nick-fields/retry@v3
76+
with:
77+
timeout_minutes: 5
78+
max_attempts: 5
79+
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
80+
7481
- name: Set PHPUnit
7582
uses: nick-fields/retry@v3
7683
with:

src/Illuminate/Support/ValidatedInput.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function missing($keys)
9393
* @param callable|null $default
9494
* @return $this|mixed
9595
*/
96-
public function whenMissing($key, callable $callback, callable $default = null)
96+
public function whenMissing($key, callable $callback, ?callable $default = null)
9797
{
9898
if ($this->missing($key)) {
9999
return $callback(data_get($this->all(), $key)) ?: $this;
@@ -212,7 +212,7 @@ public function all()
212212
* @param callable|null $default
213213
* @return $this|mixed
214214
*/
215-
public function whenHas($key, callable $callback, callable $default = null)
215+
public function whenHas($key, callable $callback, ?callable $default = null)
216216
{
217217
if ($this->has($key)) {
218218
return $callback(data_get($this->all(), $key)) ?: $this;
@@ -290,7 +290,7 @@ public function anyFilled($keys)
290290
* @param callable|null $default
291291
* @return $this|mixed
292292
*/
293-
public function whenFilled($key, callable $callback, callable $default = null)
293+
public function whenFilled($key, callable $callback, ?callable $default = null)
294294
{
295295
if ($this->filled($key)) {
296296
return $callback(data_get($this->all(), $key)) ?: $this;

tests/Bus/QueueableTest.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Tests\Bus;
44

55
use Illuminate\Bus\Queueable;
6+
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78

89
class QueueableTest extends TestCase
@@ -17,9 +18,7 @@ public static function connectionDataProvider(): array
1718
];
1819
}
1920

20-
/**
21-
* @dataProvider connectionDataProvider
22-
*/
21+
#[DataProvider('connectionDataProvider')]
2322
public function testOnConnection(mixed $connection, ?string $expected): void
2423
{
2524
$job = new FakeJob();
@@ -28,9 +27,7 @@ public function testOnConnection(mixed $connection, ?string $expected): void
2827
$this->assertSame($job->connection, $expected);
2928
}
3029

31-
/**
32-
* @dataProvider connectionDataProvider
33-
*/
30+
#[DataProvider('connectionDataProvider')]
3431
public function testAllOnConnection(mixed $connection, ?string $expected): void
3532
{
3633
$job = new FakeJob();
@@ -50,9 +47,7 @@ public static function queuesDataProvider(): array
5047
];
5148
}
5249

53-
/**
54-
* @dataProvider queuesDataProvider
55-
*/
50+
#[DataProvider('queuesDataProvider')]
5651
public function testOnQueue(mixed $queue, ?string $expected): void
5752
{
5853
$job = new FakeJob();
@@ -61,9 +56,7 @@ public function testOnQueue(mixed $queue, ?string $expected): void
6156
$this->assertSame($job->queue, $expected);
6257
}
6358

64-
/**
65-
* @dataProvider queuesDataProvider
66-
*/
59+
#[DataProvider('queuesDataProvider')]
6760
public function testAllOnQueue(mixed $queue, ?string $expected): void
6861
{
6962
$job = new FakeJob();

0 commit comments

Comments
 (0)