From 208c4a99a9a054cdfcd4de4f44e44c662e29c046 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 6 Mar 2023 11:27:27 +0000 Subject: [PATCH] Bumped versions --- .github/workflows/static.yml | 28 ++++++++++++++++------------ .github/workflows/tests.yml | 12 +++++++----- Makefile | 16 ++++++++-------- README.md | 8 +++++--- composer.json | 21 ++++++++++++++------- phpstan-baseline.neon | 7 ++++++- src/ResultPager.php | 2 +- vendor-bin/phpstan/composer.json | 8 ++++---- vendor-bin/psalm/composer.json | 4 ++-- 9 files changed, 63 insertions(+), 43 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index f54ccd03..42c11f17 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -7,28 +7,30 @@ on: jobs: phpstan: name: PHPStan - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' - tools: composer:2.1 + php-version: '8.1' + tools: composer:v2 coverage: none + env: + update: true - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install PHPStan - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 @@ -39,28 +41,30 @@ jobs: psalm: name: Psalm - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' - tools: composer:2.1 + php-version: '8.1' + tools: composer:v2 coverage: none + env: + update: true - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install Psalm - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3464fb5b..8250f3b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: jobs: tests: name: PHP ${{ matrix.php }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: @@ -15,27 +15,29 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - tools: composer:2.1 + tools: composer:v2 coverage: none + env: + update: true - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install PHPUnit - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 diff --git a/Makefile b/Makefile index 384c41c0..a451bbc1 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,24 @@ install: - @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.0-base update - @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.0-base bin all update + @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.1-base update + @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.1-base bin all update phpunit: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.0-cli + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.1-cli phpstan-analyze: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.0-cli analyze + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.1-cli analyze phpstan-baseline: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.0-cli analyze --generate-baseline + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.1-cli analyze --generate-baseline psalm-analyze: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.1-cli psalm-baseline: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli --set-baseline=psalm-baseline.xml + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.1-cli --set-baseline=psalm-baseline.xml psalm-show-info: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli --show-info=true + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.1-cli --show-info=true test: phpunit phpstan-analyze psalm-analyze diff --git a/README.md b/README.md index 4a85aa4d..66ee3eba 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ This version supports [PHP](https://php.net) 7.4-8.1. To get started, simply req ### Standard Installation ```bash -$ composer require "m4tthumphrey/php-gitlab-api:^11.8" "guzzlehttp/guzzle:^7.4" "http-interop/http-factory-guzzle:^1.2" +$ composer require "m4tthumphrey/php-gitlab-api:^11.9" \ + "guzzlehttp/guzzle:^7.5" "http-interop/http-factory-guzzle:^1.2" ``` ### Framework Integration @@ -36,13 +37,14 @@ $ composer require "m4tthumphrey/php-gitlab-api:^11.8" "guzzlehttp/guzzle:^7.4" #### Laravel: ```bash -$ composer require "graham-campbell/gitlab:^6.1" +$ composer require "graham-campbell/gitlab:^7.0" ``` #### Symfony: ```bash -$ composer require "zeichen32/gitlabapibundle:^6.0" "symfony/http-client:^5.4" "nyholm/psr7:^1.4" +$ composer require "zeichen32/gitlabapibundle:^6.0" \ + "symfony/http-client:^5.4" "nyholm/psr7:^1.4" ``` 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). diff --git a/composer.json b/composer.json index a8f1dd16..d7497ce5 100644 --- a/composer.json +++ b/composer.json @@ -30,20 +30,20 @@ "ext-json": "*", "ext-xml": "*", "php-http/cache-plugin": "^1.7.5", - "php-http/client-common": "^2.5", - "php-http/discovery": "^1.14", - "php-http/httplug": "^2.2", + "php-http/client-common": "^2.6", + "php-http/discovery": "^1.15", + "php-http/httplug": "^2.3", "php-http/multipart-stream-builder": "^1.2", "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", "psr/http-message": "^1.0", "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" + "symfony/polyfill-php80": "^1.26" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "guzzlehttp/guzzle": "^7.4", + "bamarni/composer-bin-plugin": "^1.8.2", + "guzzlehttp/guzzle": "^7.5", "http-interop/http-factory-guzzle": "^1.0" }, "autoload": { @@ -59,7 +59,14 @@ "config": { "preferred-install": "dist", "allow-plugins": { - "bamarni/composer-bin-plugin": true + "bamarni/composer-bin-plugin": true, + "php-http/discovery": true + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false } } } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1c3433e2..34beb6de 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,7 +1,7 @@ parameters: ignoreErrors: - - message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int, array\\)\\: bool\\)\\|null, Closure\\(\\)\\: void given\\.$#" + message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, Closure\\(\\)\\: void given\\.$#" count: 1 path: src/Api/AbstractApi.php @@ -10,6 +10,11 @@ parameters: count: 1 path: src/Api/AbstractApi.php + - + message: "#^Parameter \\#4 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + count: 1 + path: src/Api/AbstractApi.php + - message: "#^Property Gitlab\\\\Api\\\\AbstractApi\\:\\:\\$perPage is never written, only read\\.$#" count: 1 diff --git a/src/ResultPager.php b/src/ResultPager.php index 55bac330..5c22d795 100644 --- a/src/ResultPager.php +++ b/src/ResultPager.php @@ -259,6 +259,7 @@ private function get(string $key): array */ private static function bindPerPage(AbstractApi $api, int $perPage): AbstractApi { + /** @var Closure(AbstractApi): AbstractApi */ $closure = Closure::bind(static function (AbstractApi $api) use ($perPage): AbstractApi { $clone = clone $api; @@ -267,7 +268,6 @@ private static function bindPerPage(AbstractApi $api, int $perPage): AbstractApi return $clone; }, null, AbstractApi::class); - /** @var AbstractApi */ return $closure($api); } } diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 4ba502da..88a5f740 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,9 +1,9 @@ { "require": { - "php": "^8.0.2", - "phpstan/phpstan": "1.4.2", - "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-strict-rules": "1.1.0", + "php": "^8.1", + "phpstan/phpstan": "1.10.3", + "phpstan/phpstan-deprecation-rules": "1.1.2", + "phpstan/phpstan-strict-rules": "1.5.0", "thecodingmachine/phpstan-strict-rules": "1.0.0", "ergebnis/phpstan-rules": "1.0.0" }, diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index abd249a3..5060e693 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { - "php": "^8.0.2", - "psalm/phar": "4.18.1" + "php": "^8.1", + "psalm/phar": "5.7.6" }, "config": { "preferred-install": "dist"