[Authentication] Throw exception creating objects from this class

Callers must use Authentication::showPromptIfNeeded()
This commit is contained in:
logmanoriginal 2018-11-18 15:20:40 +01:00
parent 41d02554f3
commit 85685b7758

View file

@ -25,8 +25,6 @@
* @link https://httpd.apache.org/docs/2.4/howto/htaccess.html Apache HTTP Server
* Tutorial: .htaccess files
*
* @todo This class should respond with an error when creating an object from it.
* See {@see Bridge}, {@see Cache} or {@see Format} for reference.
* @todo Configuration parameters should be stored internally instead of accessing
* the configuration class directly.
* @todo Add functions to detect if a user is authenticated or not. This can be
@ -34,6 +32,16 @@
*/
class Authentication {
/**
* Throw an exception when trying to create a new instance of this class.
* Use {@see Authentication::showPromptIfNeeded()} instead!
*
* @throws \LogicException if called.
*/
public function __construct(){
throw new \LogicException('Use ' . __CLASS__ . '::showPromptIfNeeded()!');
}
/**
* Requests the user for login credentials if necessary.
*