Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| HomeController | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| index | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Engelsystem\Controllers; |
| 6 | |
| 7 | use Engelsystem\Config\Config; |
| 8 | use Engelsystem\Helpers\Authenticator; |
| 9 | use Engelsystem\Http\Redirector; |
| 10 | use Engelsystem\Http\Response; |
| 11 | |
| 12 | class HomeController extends BaseController |
| 13 | { |
| 14 | public function __construct(protected Authenticator $auth, protected Config $config, protected Redirector $redirect) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | public function index(): Response |
| 19 | { |
| 20 | return $this->redirect->to($this->auth->user() ? $this->config->get('home_site') : 'login'); |
| 21 | } |
| 22 | } |