Skip to content

Commit 1bd45ca

Browse files
authored
Merge branch '12.0' into pkolmann_registriy
2 parents f5a1c75 + 362450f commit 1bd45ca

File tree

97 files changed

+1606
-5310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1606
-5310
lines changed

.github/SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Supported Versions
44

55
After each new major release, the previous release will be supported for no
6-
less than 2 years, unless explictly stated otherwise. This may mean that there
6+
less than 2 years, unless explicitly stated otherwise. This may mean that there
77
are multiple supported versions at any given time.
88

99
## Reporting a Vulnerability

.github/workflows/static.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
phpstan:
99
name: PHPStan
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111

1212
steps:
1313
- name: Checkout code
@@ -23,14 +23,14 @@ jobs:
2323
update: true
2424

2525
- name: Install Dependencies
26-
uses: nick-invision/retry@v2
26+
uses: nick-invision/retry@v3
2727
with:
2828
timeout_minutes: 5
2929
max_attempts: 5
3030
command: composer update --no-interaction --no-progress
3131

3232
- name: Install PHPStan
33-
uses: nick-invision/retry@v2
33+
uses: nick-invision/retry@v3
3434
with:
3535
timeout_minutes: 5
3636
max_attempts: 5
@@ -41,7 +41,7 @@ jobs:
4141

4242
psalm:
4343
name: Psalm
44-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
4545

4646
steps:
4747
- name: Checkout code
@@ -57,14 +57,14 @@ jobs:
5757
update: true
5858

5959
- name: Install Dependencies
60-
uses: nick-invision/retry@v2
60+
uses: nick-invision/retry@v3
6161
with:
6262
timeout_minutes: 5
6363
max_attempts: 5
6464
command: composer update --no-interaction --no-progress
6565

6666
- name: Install Psalm
67-
uses: nick-invision/retry@v2
67+
uses: nick-invision/retry@v3
6868
with:
6969
timeout_minutes: 5
7070
max_attempts: 5

.github/workflows/tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ on:
77
jobs:
88
tests:
99
name: PHP ${{ matrix.php }}
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111

1212
strategy:
1313
matrix:
14-
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
14+
php: ['8.1', '8.2', '8.3', '8.4']
1515

1616
steps:
1717
- name: Checkout Code
@@ -30,14 +30,14 @@ jobs:
3030
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
3131

3232
- name: Install Dependencies
33-
uses: nick-invision/retry@v2
33+
uses: nick-invision/retry@v3
3434
with:
3535
timeout_minutes: 5
3636
max_attempts: 5
3737
command: composer update --no-interaction --no-progress
3838

3939
- name: Install PHPUnit
40-
uses: nick-invision/retry@v2
40+
uses: nick-invision/retry@v3
4141
with:
4242
timeout_minutes: 5
4343
max_attempts: 5

.styleci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ enabled:
1616
disabled:
1717
- native_constant_invocation_symfony
1818
- native_function_invocation_symfony
19-
- no_superfluous_phpdoc_tags_symfony
2019
- phpdoc_align
2120
- phpdoc_to_comment
2221
- phpdoc_var_without_name

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [12.0.0] - 2025-02-23
9+
10+
* Add PHP 8.4 support
11+
* Drop support for PHP earlier than 8.1
12+
* Moved various param types to native PHP types
13+
814
## [11.14.0] - 2024-03-11
915

1016
* Add support for `php-http/cache-plugin:^2.0`

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33
Copyright (c) 2012-2018 Matt Humphrey <[email protected]>
4-
Copyright (c) 2018-2024 Graham Campbell <[email protected]>
4+
Copyright (c) 2018-2025 Graham Campbell <[email protected]>
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,26 @@ Check out the [change log](CHANGELOG.md), [releases](https://github.com/GitLabPH
2323

2424
## Installation
2525

26-
This version supports [PHP](https://php.net) 7.4-8.3. To get started, simply require the project using [Composer](https://getcomposer.org). You will also need to install packages that "provide" [`psr/http-client-implementation`](https://packagist.org/providers/psr/http-client-implementation) and [`psr/http-factory-implementation`](https://packagist.org/providers/psr/http-factory-implementation).
26+
This version supports [PHP](https://php.net) 8.1-8.4. To get started, simply require the project using [Composer](https://getcomposer.org). You will also need to install packages that "provide" [`psr/http-client-implementation`](https://packagist.org/providers/psr/http-client-implementation) and [`psr/http-factory-implementation`](https://packagist.org/providers/psr/http-factory-implementation).
2727

2828
### Standard Installation
2929

3030
```bash
31-
$ composer require "m4tthumphrey/php-gitlab-api:^11.14" \
32-
"guzzlehttp/guzzle:^7.8" "http-interop/http-factory-guzzle:^1.2"
31+
$ composer require "m4tthumphrey/php-gitlab-api:^12.0" "guzzlehttp/guzzle:^7.9.2"
3332
```
3433

3534
### Framework Integration
3635

3736
#### Laravel:
3837

3938
```bash
40-
$ composer require "graham-campbell/gitlab:^7.5"
39+
$ composer require "graham-campbell/gitlab:^8.0"
4140
```
4241

4342
#### Symfony:
4443

4544
```bash
46-
$ composer require "zeichen32/gitlabapibundle:^6.1"
45+
$ composer require "zeichen32/gitlabapibundle:^7.0"
4746
```
4847

4948
We are decoupled from any HTTP messaging client by using [PSR-7](https://www.php-fig.org/psr/psr-7/), [PSR-17](https://www.php-fig.org/psr/psr-17/), [PSR-18](https://www.php-fig.org/psr/psr-18/), and [HTTPlug](https://httplug.io/). You can visit [HTTPlug for library users](https://docs.php-http.org/en/latest/httplug/users.html) to get more information about installing HTTPlug related packages. The framework integration [graham-campbell/gitlab](https://github.com/GrahamCampbell/Laravel-GitLab) is by [Graham Campbell](https://github.com/GrahamCampbell) and [zeichen32/gitlabapibundle](https://github.com/Zeichen32/GitLabApiBundle) is by [Jens Averkamp](https://github.com/Zeichen32).
@@ -96,7 +95,7 @@ $builder->addPlugin($plugin);
9695
$client = new Gitlab\Client($builder);
9796
```
9897

99-
One can read more about HTTPlug plugins [here](https://docs.php-http.org/en/latest/plugins/introduction.html#how-it-works). Take a look around the [API methods](https://github.com/GitLabPHP/Client/tree/11.2/src/Api), and please feel free to report any bugs, noting our [code of conduct](.github/CODE_OF_CONDUCT.md).
98+
One can read more about HTTPlug plugins [here](https://docs.php-http.org/en/latest/plugins/introduction.html#how-it-works). Take a look around the [API methods](https://github.com/GitLabPHP/Client/tree/12.0/src/Api), and please feel free to report any bugs, noting our [code of conduct](.github/CODE_OF_CONDUCT.md).
10099

101100

102101
## Contributing

composer.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,23 @@
2626
}
2727
],
2828
"require": {
29-
"php": "^7.4.15 || ^8.0.2",
29+
"php": "^8.1",
3030
"ext-json": "*",
3131
"ext-xml": "*",
32-
"php-http/cache-plugin": "^1.8.1 || ^2.0",
33-
"php-http/client-common": "^2.7.1",
34-
"php-http/discovery": "^1.19.2",
35-
"php-http/httplug": "^2.4",
36-
"php-http/multipart-stream-builder": "^1.3",
37-
"psr/cache": "^1.0 || ^2.0 || ^3.0",
32+
"php-http/cache-plugin": "^2.0.1",
33+
"php-http/client-common": "^2.7.2",
34+
"php-http/discovery": "^1.20.0",
35+
"php-http/httplug": "^2.4.1",
36+
"php-http/multipart-stream-builder": "^1.4.2",
37+
"psr/cache": "^2.0 || ^3.0",
3838
"psr/http-client-implementation": "^1.0",
3939
"psr/http-factory-implementation": "^1.0",
4040
"psr/http-message": "^1.1 || ^2.0",
41-
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0",
42-
"symfony/polyfill-php80": "^1.26"
41+
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0"
4342
},
4443
"require-dev": {
4544
"bamarni/composer-bin-plugin": "^1.8.2",
46-
"guzzlehttp/guzzle": "^7.8",
47-
"http-interop/http-factory-guzzle": "^1.2"
45+
"guzzlehttp/guzzle": "^7.9.2"
4846
},
4947
"autoload": {
5048
"psr-4": {

phpstan-baseline.neon

+70-8
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,104 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, Closure\\(\\)\\: void given\\.$#"
4+
message: '#^Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int\)\: bool\)\|null, Closure\(\)\: void given\.$#'
5+
identifier: argument.type
56
count: 1
67
path: src/Api/AbstractApi.php
78

89
-
9-
message: "#^Parameter \\#2 \\$resource of method Http\\\\Message\\\\MultipartStream\\\\MultipartStreamBuilder\\:\\:addResource\\(\\) expects Psr\\\\Http\\\\Message\\\\StreamInterface\\|resource\\|string, mixed given\\.$#"
10+
message: '#^Parameter \#2 \$resource of method Http\\Message\\MultipartStream\\MultipartStreamBuilder\:\:addResource\(\) expects Psr\\Http\\Message\\StreamInterface\|resource\|string, mixed given\.$#'
11+
identifier: argument.type
1012
count: 1
1113
path: src/Api/AbstractApi.php
1214

1315
-
14-
message: "#^Parameter \\#4 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
16+
message: '#^Parameter \#4 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
17+
identifier: argument.type
1518
count: 1
1619
path: src/Api/AbstractApi.php
1720

1821
-
19-
message: "#^Property Gitlab\\\\Api\\\\AbstractApi\\:\\:\\$perPage is never written, only read\\.$#"
22+
message: '#^Property Gitlab\\Api\\AbstractApi\:\:\$perPage \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
23+
identifier: property.unusedType
2024
count: 1
2125
path: src/Api/AbstractApi.php
2226

2327
-
24-
message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> but interface Http\\\\Promise\\\\Promise is not generic\\.$#"
28+
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
29+
identifier: foreach.nonIterable
30+
count: 1
31+
path: src/Api/Groups.php
32+
33+
-
34+
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
35+
identifier: foreach.nonIterable
36+
count: 2
37+
path: src/Api/Projects.php
38+
39+
-
40+
message: '#^Parameter \#1 \$array of function array_values expects array\<T\>, mixed given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: src/Api/Projects.php
44+
45+
-
46+
message: '#^Parameter \#1 \$options of method Symfony\\Component\\OptionsResolver\\OptionsResolver\:\:resolve\(\) expects array, mixed given\.$#'
47+
identifier: argument.type
48+
count: 1
49+
path: src/Api/Repositories.php
50+
51+
-
52+
message: '#^Parameter \#1 \$uri of static method Gitlab\\Api\\AbstractApi\:\:encodePath\(\) expects int\|string, mixed given\.$#'
53+
identifier: argument.type
54+
count: 3
55+
path: src/Api/RepositoryFiles.php
56+
57+
-
58+
message: '#^Parameter \#1 \$message of static method Gitlab\\HttpClient\\Message\\ResponseMediator\:\:getMessageAsString\(\) expects array, mixed given\.$#'
59+
identifier: argument.type
60+
count: 1
61+
path: src/HttpClient/Message/ResponseMediator.php
62+
63+
-
64+
message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
65+
identifier: argument.type
66+
count: 2
67+
path: src/HttpClient/Message/ResponseMediator.php
68+
69+
-
70+
message: '#^PHPDoc tag @return contains generic type Http\\Promise\\Promise\<Psr\\Http\\Message\\ResponseInterface\> but interface Http\\Promise\\Promise is not generic\.$#'
71+
identifier: generics.notGeneric
2572
count: 1
2673
path: src/HttpClient/Plugin/Authentication.php
2774

2875
-
29-
message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> but interface Http\\\\Promise\\\\Promise is not generic\\.$#"
76+
message: '#^PHPDoc tag @return contains generic type Http\\Promise\\Promise\<Psr\\Http\\Message\\ResponseInterface\> but interface Http\\Promise\\Promise is not generic\.$#'
77+
identifier: generics.notGeneric
3078
count: 1
3179
path: src/HttpClient/Plugin/ExceptionThrower.php
3280

3381
-
34-
message: "#^Cannot cast mixed to string\\.$#"
82+
message: '#^PHPDoc tag @var with type string is not subtype of native type non\-empty\-string\|false\.$#'
83+
identifier: varTag.nativeType
84+
count: 1
85+
path: src/HttpClient/Util/JsonArray.php
86+
87+
-
88+
message: '#^Cannot cast mixed to string\.$#'
89+
identifier: cast.string
3590
count: 1
3691
path: src/HttpClient/Util/QueryStringBuilder.php
3792

3893
-
39-
message: "#^Variable method call on Gitlab\\\\Api\\\\AbstractApi\\.$#"
94+
message: '#^PHPDoc tag @var with type Closure\(Gitlab\\Api\\AbstractApi\)\: Gitlab\\Api\\AbstractApi is not subtype of type Closure\(Gitlab\\Api\\AbstractApi\)\: Gitlab\\Api\\AbstractApi\.$#'
95+
identifier: varTag.type
96+
count: 1
97+
path: src/ResultPager.php
98+
99+
-
100+
message: '#^Variable method call on Gitlab\\Api\\AbstractApi\.$#'
101+
identifier: method.dynamicName
40102
count: 1
41103
path: src/ResultPager.php
42104

phpstan.neon.dist

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ includes:
22
- phpstan-baseline.neon
33
- vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
44
- vendor-bin/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
5-
- vendor-bin/phpstan/vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
6-
7-
rules:
8-
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
9-
- Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
10-
- Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
11-
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
12-
- Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
135

146
parameters:
157
level: max
16-
checkMissingIterableValueType: false
178
paths:
189
- src
1910
ignoreErrors:
2011
- '#Only booleans are allowed in an if condition#'
2112
- '#PHPDoc tag \@var above a method has no effect.#'
13+
- '#return type has no value type specified in iterable type array#'
14+
- '#no value type specified in iterable type array#'
15+
- '#expects array\<string, mixed\>, array given#'
16+
- '#expects array\<string, string\>, array given#'

psalm-baseline.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
2+
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
33
<file src="src/Api/AbstractApi.php">
44
<InvalidArgument>
55
<code><![CDATA[function () use ($filename, $mode, &$ex): void {

0 commit comments

Comments
 (0)