1
0
mirror of synced 2025-03-25 17:44:00 +03:00

Merge pull request #217 from curse89/master

Add calling setEventDispatcher method in ClientFactory
This commit is contained in:
Pavel 2025-03-04 19:42:56 +03:00 committed by GitHub
commit 4a99094294
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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();

View File

@ -27,7 +27,7 @@ trait EventDispatcherAwareTrait
*
* @param \Psr\EventDispatcher\EventDispatcherInterface|null $eventDispatcher
*
* @return object
* @return static
*/
public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher): object
{