From c379815f76de6e76e7063f6e95a6d3d68a360496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9A=D1=80=D0=B8?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Tue, 4 Mar 2025 19:19:35 +0300 Subject: [PATCH] Upd GH actions config && add calling setEventDispatcher method in CLientFactory --- .github/workflows/ci.yml | 12 +++++++++--- src/Factory/ClientFactory.php | 1 + src/Traits/EventDispatcherAwareTrait.php | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99a7fb9..6f302fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,24 +17,30 @@ jobs: php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Check out code into the workspace - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: pcov + - name: Composer cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.HOME }}/.composer/cache key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + - name: Install dependencies run: composer install -o + - name: Configure matchers uses: mheap/phpunit-matcher-action@v1 + - name: Run tests run: composer run-script phpunit-ci + - name: Coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: verbose: true diff --git a/src/Factory/ClientFactory.php b/src/Factory/ClientFactory.php index fbacdd8..10eb114 100644 --- a/src/Factory/ClientFactory.php +++ b/src/Factory/ClientFactory.php @@ -285,6 +285,7 @@ class ClientFactory implements ClientFactoryInterface, EventDispatcherAwareInter ->setStreamFactory($this->streamFactory) ->setRequestFactory($this->requestFactory) ->setUriFactory($this->uriFactory) + ->setEventDispatcher($this->eventDispatcher) ->appendRequestHandlers($this->requestHandlers) ->appendResponseHandlers($this->responseHandlers) ->build(); diff --git a/src/Traits/EventDispatcherAwareTrait.php b/src/Traits/EventDispatcherAwareTrait.php index 718c50b..33c18f8 100644 --- a/src/Traits/EventDispatcherAwareTrait.php +++ b/src/Traits/EventDispatcherAwareTrait.php @@ -27,7 +27,7 @@ trait EventDispatcherAwareTrait * * @param \Psr\EventDispatcher\EventDispatcherInterface|null $eventDispatcher * - * @return object + * @return static */ public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher): object {