Skip to content

Commit bd958b5

Browse files
committed
Add php-gitlab-api v10 support
1 parent 807861e commit bd958b5

File tree

6 files changed

+36
-38
lines changed

6 files changed

+36
-38
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/build
22
/log
33
/vendor
4-
.php_cs.cache
4+
.*.cache
55
composer.phar
66
composer.lock
77
infection.json

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to `oauth2-gitlab` will be documented in this file
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
Nothing yet.
7+
8+
## [3.3.0] - 2020-02-10
9+
### Added
10+
- Compatibility with php-gitlab-api v10
611

712
## [3.2.0] - 2020-02-10
813
### Changed
@@ -55,7 +60,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5560
### Added
5661
- Original fork, feature complete
5762

58-
[Unreleased]: https://github.com/omines/oauth2-gitlab/compare/3.2.0...master
63+
[Unreleased]: https://github.com/omines/oauth2-gitlab/compare/3.3.0...master
64+
[3.3.0]: https://github.com/omines/oauth2-gitlab/compare/3.2.0...3.3.0
5965
[3.2.0]: https://github.com/omines/oauth2-gitlab/compare/3.1.2...3.2.0
6066
[3.1.2]: https://github.com/omines/oauth2-gitlab/compare/3.1.1...3.1.2
6167
[3.1.1]: https://github.com/omines/oauth2-gitlab/compare/3.1.0...3.1.1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ Install [`m4tthumphrey/php-gitlab-api`](https://packagist.org/packages/m4tthumph
9595
Gitlab API after authentication. Either connect manually:
9696

9797
```php
98-
$client = new \Gitlab\Client('https://my.gitlab.url/api/v4/');
98+
$client = new \Gitlab\Client();
99+
$client->setUrl('https://my.gitlab.url/api/v4/');
99100
$client->authenticate($token->getToken(), \Gitlab\Client::AUTH_OAUTH_TOKEN);
100101
```
101102
Or call the `getApiClient` method on `GitlabResourceOwner` which does the same implicitly.

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
},
2424
"require-dev": {
2525
"friendsofphp/php-cs-fixer": "^2.0",
26+
"guzzlehttp/psr7": "^1.6",
27+
"http-interop/http-factory-guzzle": "^1.0",
2628
"mockery/mockery": "^1.0",
27-
"m4tthumphrey/php-gitlab-api": "^9.0.0",
28-
"php-http/guzzle6-adapter": "^2.0.1",
29+
"m4tthumphrey/php-gitlab-api": "^9.0|^10.0",
30+
"php-http/guzzle6-adapter": "^2.0",
2931
"phpunit/phpunit": "^8.0|^9.0"
3032
},
3133
"suggest": {

phpunit.xml.dist

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
>
12-
<logging>
13-
<log type="coverage-html"
14-
target="./build/coverage/html"
15-
lowUpperBound="35"
16-
highLowerBound="70"/>
17-
<log type="coverage-clover"
18-
target="./build/coverage/log/coverage.xml"/>
19-
</logging>
20-
<testsuites>
21-
<testsuite name="Package Test Suite">
22-
<directory suffix=".php">./test/</directory>
23-
</testsuite>
24-
</testsuites>
25-
<filter>
26-
<whitelist>
27-
<directory suffix=".php">./</directory>
28-
<exclude>
29-
<directory suffix=".php">./vendor</directory>
30-
<directory suffix=".php">./test</directory>
31-
</exclude>
32-
</whitelist>
33-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">./</directory>
6+
</include>
7+
<exclude>
8+
<directory suffix=".php">./vendor</directory>
9+
<directory suffix=".php">./test</directory>
10+
</exclude>
11+
<report>
12+
<clover outputFile="./build/coverage/log/coverage.xml"/>
13+
<html outputDirectory="./build/coverage/html" lowUpperBound="35" highLowerBound="70"/>
14+
</report>
15+
</coverage>
16+
<logging/>
17+
<testsuites>
18+
<testsuite name="Package Test Suite">
19+
<directory suffix=".php">./test/</directory>
20+
</testsuite>
21+
</testsuites>
3422
</phpunit>

src/Provider/GitlabResourceOwner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public function getApiClient()
6363
if (!class_exists('\\Gitlab\\Client')) {
6464
throw new \LogicException(__METHOD__ . ' requires package m4tthumphrey/php-gitlab-api to be installed and autoloaded'); // @codeCoverageIgnore
6565
}
66-
$client = \Gitlab\Client::create(rtrim($this->domain, '/') . self::PATH_API);
66+
$client = new \Gitlab\Client();
67+
$client->setUrl(rtrim($this->domain, '/') . self::PATH_API);
6768

6869
return $client->authenticate($this->token->getToken(), Client::AUTH_OAUTH_TOKEN);
6970
}

0 commit comments

Comments
 (0)