1 | <?php |
||
9 | class HashidManager extends Manager |
||
10 | { |
||
11 | /** |
||
12 | * Get a hashid connection instance. |
||
13 | * |
||
14 | * @param string|null $name |
||
15 | * @return mixed |
||
16 | */ |
||
17 | 13 | public function connection($name = null) |
|
21 | |||
22 | /** |
||
23 | * Get all of the created connections. |
||
24 | * |
||
25 | * @return array |
||
26 | */ |
||
27 | 1 | public function getConnections() |
|
31 | |||
32 | /** |
||
33 | * Get the default connection name. |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 4 | public function getDefaultConnection() |
|
41 | |||
42 | /** |
||
43 | * Set the default connection name. |
||
44 | * |
||
45 | * @param string $name |
||
46 | * @return $this |
||
47 | */ |
||
48 | 1 | public function setDefaultConnection($name) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 2 | public function getDefaultDriver() |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 13 | protected function createDriver($name) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 7 | protected function callCustomCreator($driver) |
|
89 | |||
90 | /** |
||
91 | * Create a new hashid connection instance for the driver. |
||
92 | * |
||
93 | * We will check to see if a creator method exists for the given driver, |
||
94 | * and will call the Closure if so, which allows us to have a more generic |
||
95 | * resolver for the drivers themselves which applies to all connections. |
||
96 | * |
||
97 | * @param string $driver |
||
98 | * @param array $config |
||
99 | * @return mixed |
||
100 | * |
||
101 | * @throws \InvalidArgumentException |
||
102 | */ |
||
103 | 7 | protected function createConnectionForDriver($driver, array $config = []) |
|
115 | |||
116 | /** |
||
117 | * Get the container binding for the driver. |
||
118 | * |
||
119 | * @param string $driver |
||
120 | * @return string|null |
||
121 | */ |
||
122 | 6 | protected function getBindingForDriver($driver) |
|
130 | |||
131 | /** |
||
132 | * Resolve the given binding from the container. |
||
133 | * |
||
134 | * NOTE: |
||
135 | * `Container::make($abstract, $parameters)` which can pass additional |
||
136 | * parameters to the constructor was removed in Laravel 5.4 |
||
137 | * (https://github.com/laravel/internals/issues/391), but then re-added |
||
138 | * as `makeWith()` in v5.4.16 (https://github.com/laravel/framework/pull/18271). |
||
139 | * And in L55 the `makeWith()` is just an alias to `make()`. |
||
140 | * |
||
141 | * @param string $abstract |
||
142 | * @param array $parameters |
||
143 | * @return mixed |
||
144 | */ |
||
145 | 5 | protected function resolveBinding($abstract, array $parameters = []) |
|
146 | { |
||
147 | 5 | if ($this->app->isShared($abstract)) { |
|
148 | 1 | return $this->app->make($abstract); |
|
149 | } |
||
150 | |||
151 | 4 | $makeWith = method_exists($this->app, 'makeWith') ? 'makeWith' : 'make'; |
|
152 | |||
153 | 4 | return $this->app->$makeWith($abstract, $parameters); |
|
154 | } |
||
155 | |||
156 | /** |
||
157 | * Get the configuration for a connection. |
||
158 | * |
||
159 | * @param string $name |
||
160 | * @return array |
||
161 | */ |
||
162 | 13 | protected function configuration($name) |
|
166 | } |
||
167 |