Skip to content

Commit 2675051

Browse files
More return types
1 parent 372af63 commit 2675051

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

src/RobotsMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class RobotsMiddleware
1313
*/
1414
protected $response;
1515

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

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

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

tests/TestMiddlewares/CustomTestMiddleware.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
class CustomTestMiddleware extends RobotsMiddleware
99
{
10-
/**
11-
* @return string|bool
12-
*/
13-
protected function shouldIndex(Request $request)
10+
protected function shouldIndex(Request $request) : string
1411
{
1512
if ($request->segment(1) === 'custom-tag') {
1613
return 'nofollow';

tests/TestMiddlewares/InvalidTestMiddleware.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class InvalidTestMiddleware extends RobotsMiddleware
99
{
10-
/**
11-
* @return string|bool
12-
*/
1310
protected function shouldIndex(Request $request) : array
1411
{
1512
return [];

tests/TestMiddlewares/SimpleTestMiddleware.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
class SimpleTestMiddleware extends RobotsMiddleware
99
{
10-
/**
11-
* @return string|bool
12-
*/
13-
protected function shouldIndex(Request $request)
10+
protected function shouldIndex(Request $request) : bool
1411
{
1512
return $request->segment(1) !== 'go-away';
1613
}

0 commit comments

Comments
 (0)