Skip to content

Commit dc754c3

Browse files
authored
Laravel 12 support (#48)
* Laravel 12 support
1 parent f9dd50a commit dc754c3

File tree

9 files changed

+41
-49
lines changed

9 files changed

+41
-49
lines changed

.github/workflows/analyse.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.3]
13-
laravel: [10.*, 11.*]
12+
php: [8.3, 8.4]
13+
laravel: [11.*]
1414
stability: [prefer-stable]
1515
include:
16-
- laravel: 10.*
17-
testbench: 8.*
1816
- laravel: 11.*
1917
testbench: 9.*
2018

.github/workflows/coverage.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.3]
13-
laravel: [10.*, 11.*]
12+
php: [8.4]
13+
laravel: [11.*]
1414
stability: [prefer-stable]
1515
include:
16-
- laravel: 10.*
17-
testbench: 8.*
1816
- laravel: 11.*
1917
testbench: 9.*
2018

@@ -33,8 +31,7 @@ jobs:
3331

3432
- name: Install dependencies
3533
run: |
36-
composer config allow-plugins.pestphp/pest-plugin true
3734
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
3835
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
3936
- name: Execute tests
40-
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: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.1, 8.2, 8.3]
13-
laravel: [10.*, 11.*]
12+
php: [8.3, 8.4]
13+
laravel: [11.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
include:
16-
- laravel: 10.*
17-
testbench: 8.*
1816
- laravel: 11.*
1917
testbench: 9.*
20-
exclude:
21-
- laravel: 11.*
22-
php: 8.1
2318

2419
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2520

composer.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"require": {
77
"php": "^8.1",
88
"guzzlehttp/guzzle": "^7.5",
9-
"laravel/framework": "^10.0|^11.0",
9+
"laravel/framework": "^11.0|^12.0",
1010
"league/oauth1-client": "^1.10"
1111
},
1212
"require-dev": {
13-
"laravel/pint": "^1.7",
14-
"larastan/larastan": "^2.5",
15-
"phpstan/phpstan-mockery": "^1.1",
16-
"phpunit/phpunit": "^10.1",
17-
"orchestra/testbench": "^8.0|^9.0",
18-
"pestphp/pest": "^2.0"
13+
"larastan/larastan": "^3.0",
14+
"laravel/pint": "^1.20",
15+
"orchestra/testbench": "^9.0",
16+
"pestphp/pest": "^3.7",
17+
"phpstan/phpstan-mockery": "^2.0",
18+
"phpunit/phpunit": "^11.5"
1919
},
2020
"authors": [
2121
{
@@ -41,14 +41,16 @@
4141
},
4242
"scripts": {
4343
"test": "phpunit",
44-
"analyse": "phpstan",
44+
"analyse": "phpstan --memory-limit=256M",
4545
"style": "pint --test",
4646
"quality": [
47-
"@test",
47+
"@style",
4848
"@analyse",
49-
"@style"
49+
"@test",
50+
"@coverage"
5051
],
51-
"fix-style": "pint"
52+
"fix-style": "pint",
53+
"coverage": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100"
5254
},
5355
"config": {
5456
"sort-packages": true,

src/OAuth/KeyStore/DatabaseKeyStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function get(string $connection): array
1111
/** @var ?OAuthKey $key */
1212
$key = OAuthKey::query()->firstWhere('magento_connection', '=', $connection);
1313

14-
return $key?->keys ?? [];
14+
return $key->keys ?? [];
1515
}
1616

1717
public function set(string $connection, array $data): void

src/OAuth/MagentoServer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function createTemporaryCredentials($body): TemporaryCredentials
4848
{
4949
parse_str($body, $data);
5050

51-
if (! $data || ! is_array($data)) {
51+
if (! $data ) {
5252
throw new CredentialsException('Unable to parse temporary credentials response.');
5353
}
5454

@@ -80,13 +80,13 @@ public function userUid($data, TokenCredentials $tokenCredentials): int
8080
return 0;
8181
}
8282

83-
public function userEmail($data, TokenCredentials $tokenCredentials)
83+
public function userEmail($data, TokenCredentials $tokenCredentials): ?string
8484
{
85-
//
85+
return null;
8686
}
8787

88-
public function userScreenName($data, TokenCredentials $tokenCredentials)
88+
public function userScreenName($data, TokenCredentials $tokenCredentials): ?string
8989
{
90-
//
90+
return null;
9191
}
9292
}

tests/OAuth/KeyStore/FileKeyStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function it_can_get_data(): void
2828
/** @var FileKeyStore $store */
2929
$store = KeyStore::instance();
3030

31-
/** @var string $encoded */
31+
/** @var non-empty-string $encoded */
3232
$encoded = json_encode($content);
3333

3434
Storage::disk($store->disk)->put($store->path.'/default.json', $encoded);
@@ -61,7 +61,7 @@ public function it_can_merge_data(): void
6161
'key' => 'value',
6262
];
6363

64-
/** @var string $encoded */
64+
/** @var non-empty-string $encoded */
6565
$encoded = json_encode($content);
6666

6767
/** @var FileKeyStore $store */

tests/Query/SearchCriteriaTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function test_it_can_add_multiple_wheres(): void
5151
], $searchCriteria);
5252
}
5353

54-
public function test_it_can_add_orWhere(): void
54+
public function test_it_can_add_or_where(): void
5555
{
5656
$searchCriteria = SearchCriteria::make()
5757
->where('sku', '=', '::some-sku::')
@@ -68,7 +68,7 @@ public function test_it_can_add_orWhere(): void
6868
], $searchCriteria);
6969
}
7070

71-
public function test_it_can_add_multiple_orWhere(): void
71+
public function test_it_can_add_multiple_or_where(): void
7272
{
7373
$searchCriteria = SearchCriteria::make()
7474
->where('sku', '=', '::some-sku::')
@@ -97,7 +97,7 @@ public function test_it_can_add_multiple_orWhere(): void
9797
], $searchCriteria);
9898
}
9999

100-
public function test_it_can_add_whereIn(): void
100+
public function test_it_can_add_where_in(): void
101101
{
102102
$searchCriteria = SearchCriteria::make()
103103
->whereIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
@@ -110,7 +110,7 @@ public function test_it_can_add_whereIn(): void
110110
], $searchCriteria);
111111
}
112112

113-
public function test_it_can_add_orWhereIn(): void
113+
public function test_it_can_add_or_where_in(): void
114114
{
115115
$searchCriteria = SearchCriteria::make()
116116
->whereIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
@@ -128,7 +128,7 @@ public function test_it_can_add_orWhereIn(): void
128128
], $searchCriteria);
129129
}
130130

131-
public function test_it_can_add_whereNotIn(): void
131+
public function test_it_can_add_where_not_in(): void
132132
{
133133
$searchCriteria = SearchCriteria::make()
134134
->whereNotIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
@@ -141,7 +141,7 @@ public function test_it_can_add_whereNotIn(): void
141141
], $searchCriteria);
142142
}
143143

144-
public function test_it_can_add_orWhereNotIn(): void
144+
public function test_it_can_add_or_where_not_in(): void
145145
{
146146
$searchCriteria = SearchCriteria::make()
147147
->whereNotIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
@@ -199,7 +199,7 @@ public function test_it_can_dd(): void
199199
$searchCriteria->dd();
200200
}
201201

202-
public function test_it_can_add_whereNull(): void
202+
public function test_it_can_add_where_null(): void
203203
{
204204
$searchCriteria = SearchCriteria::make()
205205
->where('sku', '=', '::sku::')
@@ -215,7 +215,7 @@ public function test_it_can_add_whereNull(): void
215215
], $searchCriteria);
216216
}
217217

218-
public function test_it_can_add_orWhereNull(): void
218+
public function test_it_can_add_or_where_null(): void
219219
{
220220
$searchCriteria = SearchCriteria::make()
221221
->whereNull('::some_field::')
@@ -230,7 +230,7 @@ public function test_it_can_add_orWhereNull(): void
230230
], $searchCriteria);
231231
}
232232

233-
public function test_it_can_add_whereNotNull(): void
233+
public function test_it_can_add_where_not_null(): void
234234
{
235235
$searchCriteria = SearchCriteria::make()
236236
->where('sku', '=', '::sku::')
@@ -246,7 +246,7 @@ public function test_it_can_add_whereNotNull(): void
246246
], $searchCriteria);
247247
}
248248

249-
public function test_it_can_add_orWhereNotNull(): void
249+
public function test_it_can_add_or_where_not_null(): void
250250
{
251251
$searchCriteria = SearchCriteria::make()
252252
->whereNotNull('::some_field::')
@@ -261,7 +261,7 @@ public function test_it_can_add_orWhereNotNull(): void
261261
], $searchCriteria);
262262
}
263263

264-
public function test_it_can_orderBy(): void
264+
public function test_it_can_order_by(): void
265265
{
266266
$searchCriteria = SearchCriteria::make()
267267
->orderBy('sku')
@@ -273,7 +273,7 @@ public function test_it_can_orderBy(): void
273273
], $searchCriteria);
274274
}
275275

276-
public function test_it_can_orderByDesc(): void
276+
public function test_it_can_order_by_desc(): void
277277
{
278278
$searchCriteria = SearchCriteria::make()
279279
->orderByDesc('sku')

0 commit comments

Comments
 (0)