[Authentication] Throw exception creating objects from this class
Callers must use Authentication::showPromptIfNeeded()
This commit is contained in:
parent
41d02554f3
commit
85685b7758
1 changed files with 10 additions and 2 deletions
|
@ -25,8 +25,6 @@
|
||||||
* @link https://httpd.apache.org/docs/2.4/howto/htaccess.html Apache HTTP Server
|
* @link https://httpd.apache.org/docs/2.4/howto/htaccess.html Apache HTTP Server
|
||||||
* Tutorial: .htaccess files
|
* 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
|
* @todo Configuration parameters should be stored internally instead of accessing
|
||||||
* the configuration class directly.
|
* the configuration class directly.
|
||||||
* @todo Add functions to detect if a user is authenticated or not. This can be
|
* @todo Add functions to detect if a user is authenticated or not. This can be
|
||||||
|
@ -34,6 +32,16 @@
|
||||||
*/
|
*/
|
||||||
class Authentication {
|
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.
|
* Requests the user for login credentials if necessary.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue