Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
HomeController
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 index
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Controllers;
6
7use Engelsystem\Config\Config;
8use Engelsystem\Helpers\Authenticator;
9use Engelsystem\Http\Redirector;
10use Engelsystem\Http\Response;
11
12class 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}