Skip to content

Commit

Permalink
Laravel 12 support (#48)
Browse files Browse the repository at this point in the history
* Laravel 12 support
  • Loading branch information
VincentBean authored Feb 13, 2025
1 parent f9dd50a commit dc754c3
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 49 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3]
laravel: [10.*, 11.*]
php: [8.3, 8.4]
laravel: [11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3]
laravel: [10.*, 11.*]
php: [8.4]
laravel: [11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

Expand All @@ -33,8 +31,7 @@ jobs:

- name: Install dependencies
run: |
composer config allow-plugins.pestphp/pest-plugin true
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100
run: composer coverage
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
php: [8.3, 8.4]
laravel: [11.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

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

Expand Down
24 changes: 13 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.5",
"laravel/framework": "^10.0|^11.0",
"laravel/framework": "^11.0|^12.0",
"league/oauth1-client": "^1.10"
},
"require-dev": {
"laravel/pint": "^1.7",
"larastan/larastan": "^2.5",
"phpstan/phpstan-mockery": "^1.1",
"phpunit/phpunit": "^10.1",
"orchestra/testbench": "^8.0|^9.0",
"pestphp/pest": "^2.0"
"larastan/larastan": "^3.0",
"laravel/pint": "^1.20",
"orchestra/testbench": "^9.0",
"pestphp/pest": "^3.7",
"phpstan/phpstan-mockery": "^2.0",
"phpunit/phpunit": "^11.5"
},
"authors": [
{
Expand All @@ -41,14 +41,16 @@
},
"scripts": {
"test": "phpunit",
"analyse": "phpstan",
"analyse": "phpstan --memory-limit=256M",
"style": "pint --test",
"quality": [
"@test",
"@style",
"@analyse",
"@style"
"@test",
"@coverage"
],
"fix-style": "pint"
"fix-style": "pint",
"coverage": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100"
},
"config": {
"sort-packages": true,
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth/KeyStore/DatabaseKeyStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function get(string $connection): array
/** @var ?OAuthKey $key */
$key = OAuthKey::query()->firstWhere('magento_connection', '=', $connection);

return $key?->keys ?? [];
return $key->keys ?? [];
}

public function set(string $connection, array $data): void
Expand Down
10 changes: 5 additions & 5 deletions src/OAuth/MagentoServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function createTemporaryCredentials($body): TemporaryCredentials
{
parse_str($body, $data);

if (! $data || ! is_array($data)) {
if (! $data ) {
throw new CredentialsException('Unable to parse temporary credentials response.');
}

Expand Down Expand Up @@ -80,13 +80,13 @@ public function userUid($data, TokenCredentials $tokenCredentials): int
return 0;
}

public function userEmail($data, TokenCredentials $tokenCredentials)
public function userEmail($data, TokenCredentials $tokenCredentials): ?string
{
//
return null;
}

public function userScreenName($data, TokenCredentials $tokenCredentials)
public function userScreenName($data, TokenCredentials $tokenCredentials): ?string
{
//
return null;
}
}
4 changes: 2 additions & 2 deletions tests/OAuth/KeyStore/FileKeyStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function it_can_get_data(): void
/** @var FileKeyStore $store */
$store = KeyStore::instance();

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

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

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

/** @var FileKeyStore $store */
Expand Down
24 changes: 12 additions & 12 deletions tests/Query/SearchCriteriaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function test_it_can_add_multiple_wheres(): void
], $searchCriteria);
}

public function test_it_can_add_orWhere(): void
public function test_it_can_add_or_where(): void
{
$searchCriteria = SearchCriteria::make()
->where('sku', '=', '::some-sku::')
Expand All @@ -68,7 +68,7 @@ public function test_it_can_add_orWhere(): void
], $searchCriteria);
}

public function test_it_can_add_multiple_orWhere(): void
public function test_it_can_add_multiple_or_where(): void
{
$searchCriteria = SearchCriteria::make()
->where('sku', '=', '::some-sku::')
Expand Down Expand Up @@ -97,7 +97,7 @@ public function test_it_can_add_multiple_orWhere(): void
], $searchCriteria);
}

public function test_it_can_add_whereIn(): void
public function test_it_can_add_where_in(): void
{
$searchCriteria = SearchCriteria::make()
->whereIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
Expand All @@ -110,7 +110,7 @@ public function test_it_can_add_whereIn(): void
], $searchCriteria);
}

public function test_it_can_add_orWhereIn(): void
public function test_it_can_add_or_where_in(): void
{
$searchCriteria = SearchCriteria::make()
->whereIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
Expand All @@ -128,7 +128,7 @@ public function test_it_can_add_orWhereIn(): void
], $searchCriteria);
}

public function test_it_can_add_whereNotIn(): void
public function test_it_can_add_where_not_in(): void
{
$searchCriteria = SearchCriteria::make()
->whereNotIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
Expand All @@ -141,7 +141,7 @@ public function test_it_can_add_whereNotIn(): void
], $searchCriteria);
}

public function test_it_can_add_orWhereNotIn(): void
public function test_it_can_add_or_where_not_in(): void
{
$searchCriteria = SearchCriteria::make()
->whereNotIn('sku', ['::sku_1::', '::sku_2::', '::sku_3::'])
Expand Down Expand Up @@ -199,7 +199,7 @@ public function test_it_can_dd(): void
$searchCriteria->dd();
}

public function test_it_can_add_whereNull(): void
public function test_it_can_add_where_null(): void
{
$searchCriteria = SearchCriteria::make()
->where('sku', '=', '::sku::')
Expand All @@ -215,7 +215,7 @@ public function test_it_can_add_whereNull(): void
], $searchCriteria);
}

public function test_it_can_add_orWhereNull(): void
public function test_it_can_add_or_where_null(): void
{
$searchCriteria = SearchCriteria::make()
->whereNull('::some_field::')
Expand All @@ -230,7 +230,7 @@ public function test_it_can_add_orWhereNull(): void
], $searchCriteria);
}

public function test_it_can_add_whereNotNull(): void
public function test_it_can_add_where_not_null(): void
{
$searchCriteria = SearchCriteria::make()
->where('sku', '=', '::sku::')
Expand All @@ -246,7 +246,7 @@ public function test_it_can_add_whereNotNull(): void
], $searchCriteria);
}

public function test_it_can_add_orWhereNotNull(): void
public function test_it_can_add_or_where_not_null(): void
{
$searchCriteria = SearchCriteria::make()
->whereNotNull('::some_field::')
Expand All @@ -261,7 +261,7 @@ public function test_it_can_add_orWhereNotNull(): void
], $searchCriteria);
}

public function test_it_can_orderBy(): void
public function test_it_can_order_by(): void
{
$searchCriteria = SearchCriteria::make()
->orderBy('sku')
Expand All @@ -273,7 +273,7 @@ public function test_it_can_orderBy(): void
], $searchCriteria);
}

public function test_it_can_orderByDesc(): void
public function test_it_can_order_by_desc(): void
{
$searchCriteria = SearchCriteria::make()
->orderByDesc('sku')
Expand Down

0 comments on commit dc754c3

Please sign in to comment.