Skip to content

Commit ddd497c

Browse files
committed
rename factory method to create
1 parent a5b5d18 commit ddd497c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Middleware/ErrorCatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
3737
$t = new CompositeException($e, $t);
3838
}
3939

40-
return $this->throwableResponseFactory->handle($request, $t);
40+
return $this->throwableResponseFactory->create($request, $t);
4141
}
4242
}
4343
}

src/ThrowableResponseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424
) {
2525
}
2626

27-
public function handle(ServerRequestInterface $request, Throwable $throwable): ResponseInterface
27+
public function create(ServerRequestInterface $request, Throwable $throwable): ResponseInterface
2828
{
2929
$renderer = $this->rendererProvider->get($request);
3030

src/ThrowableResponseFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ interface ThrowableResponseFactoryInterface
1616
/**
1717
* Handles a `Throwable` object and produces a response.
1818
*/
19-
public function handle(ServerRequestInterface $request, Throwable $throwable): ResponseInterface;
19+
public function create(ServerRequestInterface $request, Throwable $throwable): ResponseInterface;
2020
}

tests/Middleware/ErrorCatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testErrorWithEventDispatcher(): void
6969
private function createThrowableResponseFactory(): ThrowableResponseFactoryInterface
7070
{
7171
return new class () implements ThrowableResponseFactoryInterface {
72-
public function handle(ServerRequestInterface $request, Throwable $throwable): ResponseInterface
72+
public function create(ServerRequestInterface $request, Throwable $throwable): ResponseInterface
7373
{
7474
return new Response(Status::INTERNAL_SERVER_ERROR);
7575
}

tests/ThrowableResponseFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class ThrowableResponseFactoryTest extends TestCase
2323
{
2424
public function testBase(): void
2525
{
26-
$action = new ThrowableResponseFactory(
26+
$factory = new ThrowableResponseFactory(
2727
new ResponseFactory(),
2828
new ErrorHandler(
2929
new PlainTextRenderer(),
@@ -33,7 +33,7 @@ public function testBase(): void
3333
),
3434
);
3535

36-
$response = $action->handle(
36+
$response = $factory->create(
3737
TestHelper::createRequest(),
3838
new LogicException('test message')
3939
);
@@ -44,7 +44,7 @@ public function testBase(): void
4444

4545
public function testHeaders(): void
4646
{
47-
$action = new ThrowableResponseFactory(
47+
$factory = new ThrowableResponseFactory(
4848
new ResponseFactory(),
4949
new ErrorHandler(
5050
new PlainTextRenderer(),
@@ -55,7 +55,7 @@ public function testHeaders(): void
5555
new HeadersProvider(['X-Test' => ['on'], 'X-Test-Custom' => 'hello'])
5656
);
5757

58-
$response = $action->handle(
58+
$response = $factory->create(
5959
TestHelper::createRequest(),
6060
new LogicException('test message')
6161
);

0 commit comments

Comments
 (0)