Skip to content

Commit 4f70cff

Browse files
committed
compatible with laravel/framework ^10.0
1 parent 4f2f1d9 commit 4f70cff

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"autoload": {
1111
"psr-4": {
1212
"Circle33\\LaravelBusFluentable\\": "src/"
13-
}
13+
},
14+
"files": [
15+
"src/helpers.php"
16+
]
1417
},
1518
"authors": [
1619
{
@@ -20,9 +23,9 @@
2023
],
2124
"minimum-stability": "stable",
2225
"require-dev": {
23-
"laravel/framework": "^11.20.0",
24-
"phpunit/phpunit": "^10.5|^11.0",
25-
"orchestra/testbench-core": "^9.1.5",
26+
"laravel/framework": "10.*|11.*",
27+
"orchestra/testbench-core": "^8.0|^9.0",
28+
"phpunit/phpunit": "^10.0",
2629
"friendsofphp/php-cs-fixer": "^3.65",
2730
"phpstan/phpstan": "^2.0"
2831
},

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
failOnWarning="true"
99
failOnRisky="true"
1010
failOnEmptyTestSuite="true"
11-
failOnPhpunitDeprecation="true"
1211
beStrictAboutOutputDuringTests="true"
1312
>
1413
<testsuites>

src/FluentPendingBatch.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Circle33\LaravelBusFluentable;
44

55
use Closure;
6-
use Illuminate\Support\Number;
76
use Illuminate\Support\Testing\Fakes\PendingBatchFake;
87
use PHPUnit\Framework\Assert as PHPUnit;
98
use Throwable;
@@ -184,7 +183,7 @@ public function nth(int $index, Closure|string $callback, array $parameters = []
184183
} catch (Throwable $e) {
185184
throw new $e(sprintf(
186185
'The [%s] one in the batch does not matches the given callback: %s',
187-
Number::ordinal($index, 'en'),
186+
number_ordinal($index, 'en'),
188187
$e->getMessage()
189188
));
190189
}
@@ -242,7 +241,7 @@ public function equal(array $expectedJobs)
242241
} catch (Throwable $e) {
243242
throw new $e(sprintf(
244243
'The [%s] one in the batch at index [%s] does not match: %s',
245-
Number::ordinal($nth, 'en'),
244+
number_ordinal($nth, 'en'),
246245
$index,
247246
$e->getMessage()
248247
));

src/helpers.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
if (! function_exists('number_ordinal')) {
4+
/**
5+
* Convert the given number to ordinal form.
6+
*
7+
* @param int|float $number
8+
* @param string|null $locale
9+
* @return string
10+
*/
11+
function number_ordinal(int|float $number, ?string $locale = null)
12+
{
13+
return (new NumberFormatter($locale ?? 'en', NumberFormatter::ORDINAL))->format($number);
14+
}
15+
}

0 commit comments

Comments
 (0)