Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/Service/IteratePagesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ public function handle(string $path = null): CancellablePromiseInterface
) use ($path) {
$promise = $this->requestService->
handle(new Request('GET', $path))->
done(function ($response) use ($observer) {
return $this->handleResponse($response, $observer);
})
then(
function ($response) use ($observer) {
return $this->handleResponse($response, $observer);
},
function ($error) use ($observer) {
$observer->onError($error);
}
)
;

return new CallbackDisposable(function () use ($promise) {
Expand Down Expand Up @@ -93,6 +98,9 @@ private function handleResponseContentsComplete(
return $this->handleResponseContents($response, $observer)->then(function () use ($observer) {
$observer->onCompleted();
return new FulfilledPromise();
}, function ($error) use ($observer) {
$observer->onError($error);
return new FulfilledPromise();
});
}

Expand Down
4 changes: 2 additions & 2 deletions tests/CommandBus/Command/IteratePagesCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use ApiClients\Client\Github\CommandBus\Command\IteratePagesCommand;
use ApiClients\Tools\TestUtilities\TestCase;

class IteratePagesCommandTest extends TestCase
final class IteratePagesCommandTest extends TestCase
{
public function testCommand()
{
$path = '/foo.bar';
$command = new IteratePagesCommand($path);
$this->assertSame($path, $command->getPath());
self::assertSame($path, $command->getPath());
}
}