| 1 | <?php |
||
| 21 | class Basic extends AbstractAuth |
||
| 22 | { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Constructor |
||
| 26 | * |
||
| 27 | * @param string|null $realm |
||
| 28 | */ |
||
| 29 | public function __construct($realm = null) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @{@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function send() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @{@inheritdoc} |
||
| 47 | * |
||
| 48 | * @link http://uk3.php.net/manual/en/features.http-auth.php |
||
| 49 | */ |
||
| 50 | public function authenticate() |
||
| 68 | |||
| 69 | } |
||
| 70 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: