Skip to content

Commit

Permalink
Remove the deprecated Harmony::__invoke() method
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Dec 29, 2019
1 parent 5071b85 commit c4c24cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/Harmony.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
12 changes: 6 additions & 6 deletions tests/HarmonyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
}
Expand All @@ -84,7 +84,7 @@ public function getRequest(): void
$harmony = $this->createHarmony();
$request = new DummyServerRequest();

$harmony();
$harmony->run();

$this->assertEquals($request, $harmony->getRequest());
}
Expand All @@ -97,7 +97,7 @@ public function getResponse(): void
$harmony = $this->createHarmony();
$response = new DummyResponse();

$result = $harmony();
$result = $harmony->run();

$this->assertEquals($response, $result);
}
Expand Down Expand Up @@ -161,7 +161,7 @@ static function (Harmony $harmony) use ($middleware): void {
}
);

$harmony();
$harmony->run();

$this->assertTrue($middleware->isInvoked());
}
Expand All @@ -180,7 +180,7 @@ static function (Harmony $harmony) use ($middleware): void {
}
);

$harmony();
$harmony->run();

$this->assertFalse($middleware->isInvoked());
}
Expand Down

0 comments on commit c4c24cb

Please sign in to comment.