private function protectWithRedirect(Authentication $authentication, string $location): void
    {
        if (($this->authentication = $authentication->isLogged()) === false) {
            \header('Location: '.$location);
            throw new AuthenticationException('');
        }
    }
private function protectWithRedirect(Authentication $authentication, string $location): void
    {
        if (($this->authentication = $authentication->isLogged()) === false) {
            \header('Location: '.$location);
            throw new AuthenticationException('');
        }
    }
private function protectWithRedirect ( Authentication $ authentication , string $ location ) : void { if ( ( $ this -> authentication = $ authentication -> isLogged ( ) ) === false ) { \ header ( 'Location: ' . $ location ) ; throw new AuthenticationException ( '' ) ; } }
Allow access to controller class or methods only if logged
and do a redirection.

@param Authentication $authentication
@param string         $location

@return void

@throws AuthenticationException
Allow access to controller class or methods only if logged and do a redirection .