| 1 |
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 |
/** |
| 3 |
* Authorizer |
| 4 |
* |
| 5 |
* @license GPL-2.0+ |
| 6 |
* @link https://github.com/uhm-coe/authorizer |
| 7 |
* @package authorizer |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Authorizer; |
| 11 |
|
| 12 |
/** |
| 13 |
* Base class that all other classes extend (provides static accessor variable). |
| 14 |
*/ |
| 15 |
abstract class Static_Instance { |
| 16 |
/** |
| 17 |
* Plugin instance. |
| 18 |
* |
| 19 |
* @var object Plugin instance. |
| 20 |
*/ |
| 21 |
protected static $instance = null; |
| 22 |
|
| 23 |
|
| 24 |
/** |
| 25 |
* Access this plugin's working instance. |
| 26 |
* |
| 27 |
* @return object Object of this class. |
| 28 |
*/ |
| 29 |
public static function get_instance() { |
| 30 |
return null === static::$instance ? new static() : static::$instance; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
/** |
| 35 |
* Constructor intentionally left empty and public. |
| 36 |
*/ |
| 37 |
public function __construct() { |
| 38 |
} |
| 39 |
|
| 40 |
} |
| 41 |
|