Skip to content

Commit d9e8867

Browse files
committed
return types
1 parent fe986eb commit d9e8867

File tree

21 files changed

+45
-44
lines changed

21 files changed

+45
-44
lines changed

src/About/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function __construct($message)
2222
/**
2323
* @return \Closure
2424
*/
25-
function __invoke()
25+
function __invoke() : \Closure
2626
{
2727
return function() {
2828
echo $this->message;

src/About/Explore/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Controller
2525
* @param callable $next
2626
* @return Response
2727
*/
28-
function __invoke(Request $request, Response $response, callable $next)
28+
function __invoke(Request $request, Response $response, callable $next) : Response
2929
{
3030
$layout = $this->layout([Arg::CHILD_MODEL => $this->view('about/explore')]);
3131

src/About/More/Controller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
use Arc5\Response;
99
use Arc5\Service;
1010
use Message;
11+
use Mvc5\Http;
1112
use View;
1213

1314
class Controller
1415
{
1516
/**
16-
* @return mixed
17+
* @return Http\Response
1718
*/
18-
function __invoke()
19+
function __invoke() : Http\Response
1920
{
2021
Message::info(Service::plugin('message'));
2122

src/Dashboard/Add/Respond.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Respond
1414
* @param ViewModel $model
1515
* @return ViewModel
1616
*/
17-
function __invoke(Response $response, ViewModel $model = null)
17+
function __invoke(Response $response, ViewModel $model = null) : ViewModel
1818
{
1919
return $model->with(['args' => array_merge([__CLASS__], $model['args'])]);
2020
}

src/Dashboard/Add/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Save
1111
* @param ViewModel $model
1212
* @return ViewModel
1313
*/
14-
function __invoke(ViewModel $model)
14+
function __invoke(ViewModel $model) : ViewModel
1515
{
1616
return $model->with(['args' => array_merge([__CLASS__], $model['args'])]);
1717
}

src/Dashboard/Add/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Validate
1414
* @param ViewModel $model
1515
* @return ViewModel
1616
*/
17-
function __invoke(Request $request, ViewModel $model)
17+
function __invoke(Request $request, ViewModel $model) : ViewModel
1818
{
1919
return $model->with(['params' => $request->params(), 'args' => [__CLASS__]]);
2020
}

src/Dashboard/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ function __construct(ViewModel $model, $template)
3030
}
3131

3232
/**
33-
* @return mixed
33+
* @return ViewModel
3434
*/
35-
function test()
35+
function test() : ViewModel
3636
{
3737
$model = $this->view($this->template);
3838

src/Demo/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Controller
1111
/**
1212
* @return ReadFile
1313
*/
14-
function __invoke()
14+
function __invoke() : ReadFile
1515
{
1616
return new ReadFile(__DIR__ . '/DEMO');
1717
}

src/Home/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Controller
2323

2424
/**
2525
* @param Request $request
26-
* @return string
26+
* @return ViewModel
2727
*/
28-
function __invoke(Request $request)
28+
function __invoke(Request $request) : ViewModel
2929
{
3030
return $this->model(['request' => $request]);
3131
}

src/Home/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Factory
1818
* @param array $config
1919
* @return Controller
2020
*/
21-
function __invoke(array $config)
21+
function __invoke(array $config) : Controller
2222
{
2323
return new Controller($this->service);
2424
}

0 commit comments

Comments
 (0)