Skip to content

Commit

Permalink
More return types
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandedeyne committed Jan 5, 2016
1 parent 372af63 commit 2675051
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/RobotsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RobotsMiddleware
*/
protected $response;

public function handle(Request $request, Closure $next)
public function handle(Request $request, Closure $next) : Response
{
$this->response = $next($request);

Expand All @@ -34,7 +34,7 @@ public function handle(Request $request, Closure $next)
throw new InvalidIndexRule('An indexing rule needs to return a boolean or a string');
}

protected function responseWithRobots(string $contents)
protected function responseWithRobots(string $contents) : Response
{
$this->response->header('x-robots-tag', $contents);

Expand Down
5 changes: 1 addition & 4 deletions tests/TestMiddlewares/CustomTestMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class CustomTestMiddleware extends RobotsMiddleware
{
/**
* @return string|bool
*/
protected function shouldIndex(Request $request)
protected function shouldIndex(Request $request) : string
{
if ($request->segment(1) === 'custom-tag') {
return 'nofollow';
Expand Down
3 changes: 0 additions & 3 deletions tests/TestMiddlewares/InvalidTestMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

class InvalidTestMiddleware extends RobotsMiddleware
{
/**
* @return string|bool
*/
protected function shouldIndex(Request $request) : array
{
return [];
Expand Down
5 changes: 1 addition & 4 deletions tests/TestMiddlewares/SimpleTestMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class SimpleTestMiddleware extends RobotsMiddleware
{
/**
* @return string|bool
*/
protected function shouldIndex(Request $request)
protected function shouldIndex(Request $request) : bool
{
return $request->segment(1) !== 'go-away';
}
Expand Down

0 comments on commit 2675051

Please sign in to comment.