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\Db\Db as Instance; |
||
15 | use Bluz\Db\Query; |
||
16 | |||
17 | /** |
||
18 | * Proxy to Db |
||
19 | * |
||
20 | * Example of usage |
||
21 | * <code> |
||
22 | * use Bluz\Proxy\Db; |
||
23 | * |
||
24 | * Db::fetchAll('SELECT * FROM users'); |
||
25 | * </code> |
||
26 | * |
||
27 | * @package Bluz\Proxy |
||
28 | * @author Anton Shevchuk |
||
29 | * |
||
30 | * @method static Instance getInstance() |
||
31 | * |
||
32 | * @method static mixed getOption($key, $section = null) |
||
33 | * @see Instance::getOption() |
||
34 | * |
||
35 | * @method static \PDO handler() |
||
36 | * @see Instance::handler() |
||
37 | * |
||
38 | * @method static string quote($value) |
||
39 | * @see Instance::quote() |
||
40 | * |
||
41 | * @method static string quoteIdentifier($identifier) |
||
42 | * @see Instance::quoteIdentifier() |
||
43 | * |
||
44 | * @method static integer query($sql, $params = [], $types = []) |
||
45 | * @see Instance::query() |
||
46 | * |
||
47 | * @method static Query\Select select(...$select) |
||
48 | * @see Instance::select() |
||
49 | * |
||
50 | * @method static Query\Insert insert($table) |
||
51 | * @see Instance::insert() |
||
52 | * |
||
53 | * @method static Query\Update update($table) |
||
54 | * @see Instance::update() |
||
55 | * |
||
56 | * @method static Query\Delete delete($table) |
||
57 | * @see Instance::delete() |
||
58 | * |
||
59 | * @method static string fetchOne($sql, $params = []) |
||
60 | * @see Instance::fetchOne() |
||
61 | * |
||
62 | * @method static array fetchRow($sql, $params = []) |
||
63 | * @see Instance::fetchRow() |
||
64 | * |
||
65 | * @method static array fetchAll($sql, $params = []) |
||
66 | * @see Instance::fetchAll() |
||
67 | * |
||
68 | * @method static array fetchColumn($sql, $params = []) |
||
69 | * @see Instance::fetchColumn() |
||
70 | * |
||
71 | * @method static array fetchGroup($sql, $params = [], $object = null)) |
||
72 | * @see Instance::fetchGroup() |
||
73 | * |
||
74 | * @method static array fetchColumnGroup($sql, $params = []) |
||
75 | * @see Instance::fetchColumnGroup() |
||
76 | * |
||
77 | * @method static array fetchUniqueGroup($sql, $params = []) |
||
78 | * @see Instance::fetchUniqueGroup() |
||
79 | * |
||
80 | * @method static array fetchPairs($sql, $params = []) |
||
81 | * @see Instance::fetchPairs() |
||
82 | * |
||
83 | * @method static array fetchObject($sql, $params = [], $object = "stdClass") |
||
84 | * @see Instance::fetchObject() |
||
85 | * |
||
86 | * @method static array fetchObjects($sql, $params = [], $object = null) |
||
87 | * @see Instance::fetchObjects() |
||
88 | * |
||
89 | * @method static array fetchRelations($sql, $params = []) |
||
90 | * @see Instance::fetchRelations() |
||
91 | * |
||
92 | * @method static bool transaction($process) |
||
93 | * @see Instance::transaction() |
||
94 | * |
||
95 | * @method static void disconnect() |
||
96 | * @see Instance::disconnect() |
||
97 | */ |
||
98 | final class Db |
||
99 | { |
||
100 | use ProxyTrait; |
||
101 | |||
102 | /** |
||
103 | * Init instance |
||
104 | * |
||
105 | * @return Instance |
||
106 | */ |
||
107 | 30 | private static function initInstance(): Instance |
|
0 ignored issues
–
show
|
|||
108 | { |
||
109 | 30 | $instance = new Instance(); |
|
110 | 30 | $instance->setOptions(Config::get('db')); |
|
111 | 30 | return $instance; |
|
112 | } |
||
113 | } |
||
114 |
This check looks for private methods that have been defined, but are not used inside the class.