1 | <?php |
||
18 | class ChildishServer |
||
19 | { |
||
20 | /** |
||
21 | * @var \Childish\database\DatabaseManager $manager |
||
22 | */ |
||
23 | protected $manager; |
||
24 | |||
25 | /** |
||
26 | * The current globally used instance. |
||
27 | * |
||
28 | * @var ChildishServer |
||
29 | */ |
||
30 | protected static $instance; |
||
31 | |||
32 | /** |
||
33 | * @var \Childish\support\Container $container |
||
34 | */ |
||
35 | protected $container; |
||
36 | |||
37 | /** |
||
38 | * ChildishServer constructor. |
||
39 | */ |
||
40 | public function __construct() |
||
46 | |||
47 | /** |
||
48 | * setupContainer |
||
49 | * |
||
50 | * @param \Childish\support\Container $container |
||
51 | */ |
||
52 | protected function setupContainer(Container $container) |
||
59 | |||
60 | /** |
||
61 | * Make this capsule instance available globally. |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | public function setAsGlobal() |
||
69 | |||
70 | /** |
||
71 | * Get the IoC container instance. |
||
72 | * |
||
73 | * @return \Childish\support\Container $container |
||
74 | */ |
||
75 | public function getContainer() |
||
79 | |||
80 | /** |
||
81 | * Setup the default database configuration options. |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function setupDefaultConfiguration() |
||
91 | |||
92 | /** |
||
93 | * Build the database manager instance. |
||
94 | * |
||
95 | * @return void |
||
96 | */ |
||
97 | protected function setupManager() |
||
102 | |||
103 | /** |
||
104 | * Get a connection instance from the global manager. |
||
105 | * |
||
106 | * @param string $connection |
||
107 | * @return \Childish\connection\Connection |
||
108 | */ |
||
109 | public static function connection($connection = null) |
||
113 | |||
114 | /** |
||
115 | * Get a fluent query builder instance. |
||
116 | * |
||
117 | * @param string $table |
||
118 | * @param string $connection |
||
119 | * @return \Childish\query\Builder; |
||
120 | */ |
||
121 | public static function table($table, $connection = null) |
||
125 | |||
126 | /** |
||
127 | * @param string $name |
||
128 | * @return \\Connection |
||
129 | */ |
||
130 | /** |
||
131 | * Get a registered connection instance. |
||
132 | * |
||
133 | * @param null $name |
||
134 | * @return \Childish\connection\Connection |
||
135 | */ |
||
136 | public function getConnection($name = null) |
||
140 | |||
141 | /** |
||
142 | * Register a connection with the manager. |
||
143 | * |
||
144 | * @param array $config |
||
145 | * @param string $name |
||
146 | * @return void |
||
147 | */ |
||
148 | public function addConnection(array $config, $name = 'default') |
||
156 | |||
157 | /** |
||
158 | * Set the fetch mode for the database connections. |
||
159 | * |
||
160 | * @param int $fetchMode |
||
161 | * @return $this |
||
162 | */ |
||
163 | public function setFetchMode($fetchMode) |
||
169 | |||
170 | /** |
||
171 | * Get the database manager instance. |
||
172 | * |
||
173 | * @return mixed |
||
174 | */ |
||
175 | public function getDatabaseManager() |
||
179 | |||
180 | /** |
||
181 | * bootEloquent |
||
182 | * |
||
183 | * @return void |
||
184 | */ |
||
185 | public function bootEloquent() |
||
189 | |||
190 | /** |
||
191 | * Dynamically pass methods to the default connection. |
||
192 | * |
||
193 | * @param string $method |
||
194 | * @param array $parameters |
||
195 | * @return mixed |
||
196 | */ |
||
197 | public static function __callStatic($method, $parameters) |
||
201 | } |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.