bluzphp /
framework
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Bluz Framework Component |
||
| 5 | * |
||
| 6 | * @copyright Bluz PHP Team |
||
| 7 | * @link https://github.com/bluzphp/framework |
||
| 8 | */ |
||
| 9 | |||
| 10 | declare(strict_types=1); |
||
| 11 | |||
| 12 | namespace Bluz\Proxy; |
||
| 13 | |||
| 14 | use Bluz\Registry\Registry as Instance; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Proxy to Registry |
||
| 18 | * |
||
| 19 | * Example of usage |
||
| 20 | * <code> |
||
| 21 | * use Bluz\Proxy\Registry; |
||
| 22 | * |
||
| 23 | * Registry::set('key', 'value'); |
||
| 24 | * Registry::get('key'); |
||
| 25 | * </code> |
||
| 26 | * |
||
| 27 | * @package Bluz\Proxy |
||
| 28 | * @author Anton Shevchuk |
||
| 29 | * |
||
| 30 | * @method static Instance getInstance() |
||
| 31 | * |
||
| 32 | * @method static void set($key, $value) |
||
| 33 | * @see Instance::set() |
||
| 34 | * |
||
| 35 | * @method static mixed get($key) |
||
| 36 | * @see Instance::get() |
||
| 37 | * |
||
| 38 | * @method static bool contains($key) |
||
| 39 | * @see Instance::contains() |
||
| 40 | * |
||
| 41 | * @method static void delete($key) |
||
| 42 | * @see Instance::delete() |
||
| 43 | */ |
||
| 44 | final class Registry |
||
| 45 | { |
||
| 46 | use ProxyTrait; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Init instance |
||
| 50 | * |
||
| 51 | * @return Instance |
||
| 52 | */ |
||
| 53 | 15 | private static function initInstance(): Instance |
|
|
0 ignored issues
–
show
|
|||
| 54 | { |
||
| 55 | 15 | $instance = new Instance(); |
|
| 56 | 15 | if ($data = Config::get('registry')) { |
|
| 57 | 15 | $instance->setFromArray($data); |
|
| 58 | } |
||
| 59 | 15 | return $instance; |
|
| 60 | } |
||
| 61 | } |
||
| 62 |
This check looks for private methods that have been defined, but are not used inside the class.