From c4c24cb440bcc2342e08963a25eb40412bb49706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 29 Dec 2019 16:52:13 +0100 Subject: [PATCH] Remove the deprecated Harmony::__invoke() method --- src/Harmony.php | 8 -------- tests/HarmonyTest.php | 12 ++++++------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Harmony.php b/src/Harmony.php index 523f8d7..699ba6e 100644 --- a/src/Harmony.php +++ b/src/Harmony.php @@ -31,14 +31,6 @@ public function run(): ResponseInterface return $this->handle($this->request); } - /** - * @deprecated since 6.1.0. Use Harmony::run() instead. - */ - public function __invoke(): ResponseInterface - { - return $this->handle($this->request); - } - /** * @internal */ diff --git a/tests/HarmonyTest.php b/tests/HarmonyTest.php index 4ad65ca..c6e8adb 100644 --- a/tests/HarmonyTest.php +++ b/tests/HarmonyTest.php @@ -55,7 +55,7 @@ public function invokeAllMiddleware(): void $harmony->addMiddleware(new FakeMiddleware()); $harmony->addMiddleware(new InternalServerErrorMiddleware(new DummyResponse())); - $response = $harmony(); + $response = $harmony->run(); $this->assertEquals(["dummy"], $response->getHeader("dummy")); $this->assertEquals(500, $response->getStatusCode()); @@ -71,7 +71,7 @@ public function returnAfterSecondMiddleware(): void $harmony->addMiddleware(new InternalServerErrorMiddleware(new DummyResponse())); $harmony->addMiddleware(new ExceptionMiddleware()); - $response = $harmony(); + $response = $harmony->run(); $this->assertEquals(500, $response->getStatusCode()); } @@ -84,7 +84,7 @@ public function getRequest(): void $harmony = $this->createHarmony(); $request = new DummyServerRequest(); - $harmony(); + $harmony->run(); $this->assertEquals($request, $harmony->getRequest()); } @@ -97,7 +97,7 @@ public function getResponse(): void $harmony = $this->createHarmony(); $response = new DummyResponse(); - $result = $harmony(); + $result = $harmony->run(); $this->assertEquals($response, $result); } @@ -161,7 +161,7 @@ static function (Harmony $harmony) use ($middleware): void { } ); - $harmony(); + $harmony->run(); $this->assertTrue($middleware->isInvoked()); } @@ -180,7 +180,7 @@ static function (Harmony $harmony) use ($middleware): void { } ); - $harmony(); + $harmony->run(); $this->assertFalse($middleware->isInvoked()); }