Skip to content

Commit cc8dcb7

Browse files
authored
Merge pull request #5 from justbetter/feature/laravel12
Laravel 12 support
2 parents 0497537 + db9635e commit cc8dcb7

File tree

9 files changed

+30
-29
lines changed

9 files changed

+30
-29
lines changed

.github/workflows/analyse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.3]
12+
php: [8.3, 8.4]
1313
laravel: [11.*]
1414
stability: [prefer-stable]
1515
include:

.github/workflows/coverage.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.3]
12+
php: [8.4]
1313
laravel: [11.*]
1414
stability: [prefer-stable]
1515
include:
@@ -31,8 +31,7 @@ jobs:
3131

3232
- name: Install dependencies
3333
run: |
34-
composer config allow-plugins.pestphp/pest-plugin true
3534
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
3635
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
3736
- name: Execute tests
38-
run: XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100
37+
run: composer coverage

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.3
19+
php-version: 8.4
2020
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
2121
coverage: none
2222

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.2, 8.3]
12+
php: [8.3, 8.4]
1313
laravel: [11.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
include:

composer.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
"type": "package",
55
"license": "MIT",
66
"require": {
7-
"php": "^8.2",
7+
"php": "^8.3",
88
"guzzlehttp/guzzle": "^7.5",
9-
"laravel/framework": "^11.0",
109
"justbetter/laravel-magento-client": "^2.4",
11-
"justbetter/laravel-magento-webhooks": "^2.1"
10+
"justbetter/laravel-magento-webhooks": "^2.1",
11+
"laravel/framework": "^11.0|^12.0"
1212
},
1313
"require-dev": {
14-
"larastan/larastan": "^2.5",
15-
"laravel/pint": "^1.16",
14+
"larastan/larastan": "^3.0",
15+
"laravel/pint": "^1.20",
1616
"orchestra/testbench": "^9.0",
17-
"pestphp/pest": "^2.0",
18-
"phpstan/phpstan-mockery": "^1.1",
19-
"phpunit/phpunit": "^10.0"
17+
"pestphp/pest": "^3.7",
18+
"phpstan/phpstan-mockery": "^2.0",
19+
"phpunit/phpunit": "^11.5"
2020
},
2121
"authors": [
2222
{
@@ -42,14 +42,16 @@
4242
},
4343
"scripts": {
4444
"test": "phpunit",
45-
"analyse": "phpstan",
45+
"analyse": "phpstan --memory-limit=256M",
4646
"style": "pint --test",
4747
"quality": [
48-
"@test",
48+
"@style",
4949
"@analyse",
50-
"@style"
50+
"@test",
51+
"@coverage"
5152
],
52-
"fix-style": "pint"
53+
"fix-style": "pint",
54+
"coverage": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100"
5355
},
5456
"config": {
5557
"sort-packages": true,

src/Actions/RetryBulkRequest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ public function retry(BulkRequest $bulkRequest, bool $onlyFailed): ?BulkRequest
5252
default => throw new InvalidMethodException('Unsupported method "'.$bulkRequest->method.'"'),
5353
};
5454

55-
if ($retry !== null) {
56-
$bulkRequest->retries()->save($retry);
57-
}
55+
$bulkRequest->retries()->save($retry);
5856

5957
return $retry;
6058
}

src/Concerns/HasOperations.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* @mixin Model
1111
*
1212
* @codeCoverageIgnore
13+
*
14+
* @phpstan-ignore-next-line
1315
*/
1416
trait HasOperations
1517
{

src/Models/BulkOperation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @property ?string $subject_type
1515
* @property int $operation_id
1616
* @property ?OperationStatus $status
17-
* @property ?array $response
17+
* @property ?array<array-key, mixed> $response
1818
* @property ?Carbon $created_at
1919
* @property ?Carbon $updated_at
2020
* @property ?Model $subject
@@ -31,13 +31,13 @@ class BulkOperation extends Model
3131
'response' => 'array',
3232
];
3333

34-
/** @return MorphTo<Model, BulkOperation> */
34+
/** @return MorphTo<Model, covariant BulkOperation> */
3535
public function subject(): MorphTo
3636
{
3737
return $this->morphTo();
3838
}
3939

40-
/** @return BelongsTo<BulkRequest, BulkOperation> */
40+
/** @return BelongsTo<covariant BulkRequest, covariant BulkOperation> */
4141
public function request(): BelongsTo
4242
{
4343
return $this->belongsTo(BulkRequest::class, 'bulk_request_id');

src/Models/BulkRequest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* @property string $method
1717
* @property string $path
1818
* @property string $bulk_uuid
19-
* @property array $request
20-
* @property array $response
19+
* @property array<array-key, mixed> $request
20+
* @property array<array-key, mixed> $response
2121
* @property ?Carbon $started_at
2222
* @property ?Carbon $created_at
2323
* @property ?Carbon $updated_at
@@ -37,19 +37,19 @@ class BulkRequest extends Model
3737
'started_at' => 'datetime',
3838
];
3939

40-
/** @return HasMany<BulkOperation> */
40+
/** @return HasMany<BulkOperation, $this> */
4141
public function operations(): HasMany
4242
{
4343
return $this->hasMany(BulkOperation::class);
4444
}
4545

46-
/** @return HasMany<BulkRequest> */
46+
/** @return HasMany<BulkRequest, $this> */
4747
public function retries(): HasMany
4848
{
4949
return $this->hasMany(BulkRequest::class, 'retry_of', 'id');
5050
}
5151

52-
/** @return BelongsTo<BulkRequest, BulkRequest> */
52+
/** @return BelongsTo<covariant BulkRequest, covariant BulkRequest> */
5353
public function retryOf(): BelongsTo
5454
{
5555
return $this->belongsTo(BulkRequest::class, 'retry_of', 'id');

0 commit comments

Comments
 (0)