Skip to content

Commit 4a99094

Browse files
authored
Merge pull request #217 from curse89/master
Add calling setEventDispatcher method in ClientFactory
2 parents 27e9e8e + c379815 commit 4a99094

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,30 @@ jobs:
1717
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1818
steps:
1919
- name: Check out code into the workspace
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
21+
2122
- name: Setup PHP ${{ matrix.php-version }}
2223
uses: shivammathur/setup-php@v2
2324
with:
2425
php-version: ${{ matrix.php-version }}
2526
coverage: pcov
27+
2628
- name: Composer cache
27-
uses: actions/cache@v2
29+
uses: actions/cache@v4
2830
with:
2931
path: ${{ env.HOME }}/.composer/cache
3032
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
33+
3134
- name: Install dependencies
3235
run: composer install -o
36+
3337
- name: Configure matchers
3438
uses: mheap/phpunit-matcher-action@v1
39+
3540
- name: Run tests
3641
run: composer run-script phpunit-ci
42+
3743
- name: Coverage
38-
uses: codecov/codecov-action@v2
44+
uses: codecov/codecov-action@v4
3945
with:
4046
verbose: true

src/Factory/ClientFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ public function createClient(string $apiUrl, string $apiKey): Client
285285
->setStreamFactory($this->streamFactory)
286286
->setRequestFactory($this->requestFactory)
287287
->setUriFactory($this->uriFactory)
288+
->setEventDispatcher($this->eventDispatcher)
288289
->appendRequestHandlers($this->requestHandlers)
289290
->appendResponseHandlers($this->responseHandlers)
290291
->build();

src/Traits/EventDispatcherAwareTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait EventDispatcherAwareTrait
2727
*
2828
* @param \Psr\EventDispatcher\EventDispatcherInterface|null $eventDispatcher
2929
*
30-
* @return object
30+
* @return static
3131
*/
3232
public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher): object
3333
{

0 commit comments

Comments
 (0)