diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dacc87..969208e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,9 +10,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] + php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Install PHP ${{ matrix.php }} uses: "shivammathur/setup-php@v2" with: @@ -20,16 +21,8 @@ jobs: ini-values: "memory_limit=-1, phar.readonly=0" php-version: ${{ matrix.php }} - - name: "Determine composer cache directory" - id: "determine-composer-cache-directory" - run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v1" - with: - path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" - key: "php-${{ matrix.php }}-ci" - restore-keys: "php-${{ matrix.php }}" + - name: Install dependencies + uses: ramsey/composer-install@v3 - name: "Install dependencies" run: composer update --no-progress -o --prefer-dist diff --git a/lib/Bitbucket/API/Api.php b/lib/Bitbucket/API/Api.php index fee0909..3685d7f 100644 --- a/lib/Bitbucket/API/Api.php +++ b/lib/Bitbucket/API/Api.php @@ -49,7 +49,7 @@ class Api * @param OptionalClientOption $options * @param ClientInterface $client */ - public function __construct(array $options = array(), ClientInterface $client = null) + public function __construct(array $options = array(), ?ClientInterface $client = null) { $this->httpClient = (null !== $client) ? $client : new Client($options, null); diff --git a/lib/Bitbucket/API/Http/Client.php b/lib/Bitbucket/API/Http/Client.php index 2979e44..1f0d0bf 100644 --- a/lib/Bitbucket/API/Http/Client.php +++ b/lib/Bitbucket/API/Http/Client.php @@ -51,7 +51,7 @@ class Client implements ClientInterface /** * @param OptionalClientOption $options */ - public function __construct(array $options = array(), HttpPluginClientBuilder $httpClientBuilder = null) + public function __construct(array $options = array(), ?HttpPluginClientBuilder $httpClientBuilder = null) { $this->responseHistory = new HistoryPlugin(); $this->options = array_merge(array_merge($this->options, $options)); diff --git a/lib/Bitbucket/API/Http/HttpPluginClientBuilder.php b/lib/Bitbucket/API/Http/HttpPluginClientBuilder.php index e2d9ad3..d3d86d9 100644 --- a/lib/Bitbucket/API/Http/HttpPluginClientBuilder.php +++ b/lib/Bitbucket/API/Http/HttpPluginClientBuilder.php @@ -30,7 +30,7 @@ class HttpPluginClientBuilder /** * @param MessageFactory|RequestFactoryInterface|null $requestFactory */ - public function __construct(ClientInterface $httpClient = null, $requestFactory = null, StreamFactoryInterface $streamFactory = null) + public function __construct(?ClientInterface $httpClient = null, $requestFactory = null, ?StreamFactoryInterface $streamFactory = null) { $requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); if ($requestFactory instanceof MessageFactory) { diff --git a/lib/Bitbucket/API/Http/Plugin/ApiVersionPlugin.php b/lib/Bitbucket/API/Http/Plugin/ApiVersionPlugin.php index a8f7aa5..ebf50d7 100644 --- a/lib/Bitbucket/API/Http/Plugin/ApiVersionPlugin.php +++ b/lib/Bitbucket/API/Http/Plugin/ApiVersionPlugin.php @@ -27,7 +27,7 @@ public function __construct($version) * @param callable $next Next middleware in the chain, the request is passed as the first argument * @param callable $first First middleware in the chain, used to to restart a request * - * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient). + * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient). */ protected function doHandleRequest(RequestInterface $request, callable $next, callable $first) { diff --git a/lib/Bitbucket/API/Http/Response/Pager.php b/lib/Bitbucket/API/Http/Response/Pager.php index ed50b8c..ef5921b 100644 --- a/lib/Bitbucket/API/Http/Response/Pager.php +++ b/lib/Bitbucket/API/Http/Response/Pager.php @@ -38,7 +38,7 @@ public function __construct( HttpPluginClientBuilder $httpPluginClientBuilder, ResponseInterface $response, $messageFactory = null, - StreamFactoryInterface $streamFactory = null + ?StreamFactoryInterface $streamFactory = null ) { /** @var ResponseInterface $response */ if ($response->getStatusCode() >= 400) {