Skip to content

Commit 4453c78

Browse files
committed
Upgrade supported PHP versions
1 parent 3dee862 commit 4453c78

File tree

5 files changed

+22
-25
lines changed

5 files changed

+22
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php:
19-
- '8.1'
20-
- '8.2'
2119
- '8.3'
2220
- '8.4'
21+
- '8.5'
2322
dependencies: [ stable, beta, lowest ]
2423
experimental: [ false ]
2524
include:
@@ -63,7 +62,7 @@ jobs:
6362

6463
- name: Run PHPStan static analysis
6564
run: vendor/bin/phpstan
66-
if: ${{ matrix.dependencies != 'lowest' && !matrix.experimental }}
65+
if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }}
6766

6867
- name: Run automated tests
6968
run: vendor/bin/phpunit --coverage-text --coverage-xml build/coverage-xml --coverage-cobertura build/cobertura.xml

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
"gitlab"
1919
],
2020
"require": {
21-
"php": ">=8.1",
21+
"php": ">=8.3",
2222
"ext-mbstring": "*",
2323
"ext-intl": "*",
2424
"league/oauth2-client": "^2.4.1"
2525
},
2626
"require-dev": {
27-
"friendsofphp/php-cs-fixer": "^3.65.0",
28-
"guzzlehttp/psr7": "^2.7.0",
27+
"friendsofphp/php-cs-fixer": "^3.90.0",
28+
"guzzlehttp/psr7": "^2.8.0",
2929
"http-interop/http-factory-guzzle": "^1.2",
30-
"infection/infection": "^0.27.11",
31-
"m4tthumphrey/php-gitlab-api": "^11.14",
30+
"infection/infection": "^0.31.9",
31+
"m4tthumphrey/php-gitlab-api": "^11.14|^12.0",
3232
"mockery/mockery": "^1.6.12",
3333
"php-http/guzzle7-adapter": "^1.1.0",
3434
"phpstan/extension-installer": "^1.4.3",
35-
"phpstan/phpstan": "^2.0.4",
35+
"phpstan/phpstan": "^2.1.32",
3636
"phpstan/phpstan-mockery": "^2.0.0",
37-
"phpstan/phpstan-phpunit": "^2.0.3",
38-
"phpunit/phpunit": "^10.5.39"
37+
"phpstan/phpstan-phpunit": "^2.0.8",
38+
"phpunit/phpunit": "^12.4.4"
3939
},
4040
"suggest": {
4141
"m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token"

src/Provider/Gitlab.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ class Gitlab extends AbstractProvider
2929
{
3030
use BearerAuthorizationTrait;
3131

32-
public const DEFAULT_DOMAIN = 'https://gitlab.com';
33-
public const DEFAULT_SCOPE = 'api';
34-
public const SCOPE_SEPARATOR = ' ';
32+
public const string DEFAULT_DOMAIN = 'https://gitlab.com';
33+
public const string DEFAULT_SCOPE = 'api';
34+
public const string SCOPE_SEPARATOR = ' ';
3535

36-
private const PATH_API_USER = '/api/v4/user';
37-
private const PATH_AUTHORIZE = '/oauth/authorize';
38-
private const PATH_TOKEN = '/oauth/token';
36+
private const string PATH_API_USER = '/api/v4/user';
37+
private const string PATH_AUTHORIZE = '/oauth/authorize';
38+
private const string PATH_TOKEN = '/oauth/token';
3939

4040
public string $domain = self::DEFAULT_DOMAIN;
4141

src/Provider/GitlabResourceOwner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
*
2121
* @author Niels Keurentjes <[email protected]>
2222
*
23-
* @phpstan-type ResourceOwner array{id: int, is_admin: bool, name: string, username: string, email: string, avatar_url: string, web_url: string, state: string, external: bool}
23+
* @phpstan-type ResourceOwner array{id: ?int, is_admin: ?bool, name: string, username: string, email: string, avatar_url: string, web_url: string, state: ?string, external: ?bool}
2424
*/
2525
class GitlabResourceOwner implements ResourceOwnerInterface
2626
{
27-
public const PATH_API = '/api/v4/';
27+
public const string PATH_API = '/api/v4/';
2828

2929
/** @var ResourceOwner */
3030
private array $data;

test/src/Provider/GitlabTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Mockery as m;
1818
use Omines\OAuth2\Client\Provider\Gitlab;
1919
use Omines\OAuth2\Client\Provider\GitlabResourceOwner;
20+
use PHPUnit\Framework\Attributes\DataProvider;
21+
use PHPUnit\Framework\Attributes\Depends;
2022
use PHPUnit\Framework\TestCase;
2123

2224
class GitlabTest extends TestCase
@@ -218,9 +220,7 @@ public function testDefaultValuesForResourceOwner(): void
218220
$this->assertTrue($owner->isExternal());
219221
}
220222

221-
/**
222-
* @depends testUserData
223-
*/
223+
#[Depends('testUserData')]
224224
public function testApiClient(GitlabResourceOwner $owner): void
225225
{
226226
$client = $owner->getApiClient();
@@ -241,9 +241,7 @@ public static function provideErrorCodes(): array
241241
];
242242
}
243243

244-
/**
245-
* @dataProvider provideErrorCodes
246-
*/
244+
#[DataProvider('provideErrorCodes')]
247245
public function testExceptionThrownWhenErrorObjectReceived(int $status): void
248246
{
249247
$response = new Response($status, ['content-type' => 'json'], '{"message": "Validation Failed","errors": [{"resource": "Issue","field": "title","code": "missing_field"}]}');

0 commit comments

Comments
 (0)