1 | <?php declare(strict_types=1); |
||
11 | class AsyncTableRegistry implements PoolUtilizerInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var AsyncTable[] |
||
15 | */ |
||
16 | protected static $tables = []; |
||
17 | |||
18 | /** |
||
19 | * @var AsyncTableRegistry |
||
20 | */ |
||
21 | protected static $instance = null; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | protected static $reset = false; |
||
27 | |||
28 | /** |
||
29 | * @param LoopInterface $loop |
||
30 | * @param array $config |
||
31 | */ |
||
32 | public static function init(LoopInterface $loop, array $config = []) |
||
36 | |||
37 | /** |
||
38 | * @param Table $table |
||
39 | * |
||
40 | * @return AsyncTable |
||
|
|||
41 | */ |
||
42 | public static function get(Table $table) |
||
68 | 3 | ||
69 | public static function paginate($tableName, $params, $settings) |
||
73 | |||
74 | public static function getInstance() |
||
83 | |||
84 | public static function reset() |
||
88 | |||
89 | /** |
||
90 | * @inheritDoc |
||
91 | */ |
||
92 | public function info() |
||
96 | } |
||
97 |
In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.
If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.