1 | <?php |
||
26 | class RedisSentinelServiceProvider extends ServiceProvider |
||
27 | { |
||
28 | /** |
||
29 | * Loads the package's configuration and provides configuration values. |
||
30 | * |
||
31 | * @var ConfigurationLoader |
||
32 | */ |
||
33 | protected $config; |
||
34 | |||
35 | /** |
||
36 | * Boot the service by registering extensions with Laravel's cache, queue, |
||
37 | * and session managers for the "redis-sentinel" driver. |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | public function boot() |
||
42 | { |
||
43 | $this->addRedisSentinelBroadcaster(); |
||
44 | $this->addRedisSentinelCacheStore(); |
||
45 | $this->addRedisSentinelQueueConnector(); |
||
46 | |||
47 | // Since version 5.2, Lumen does not include support for sessions by |
||
48 | // default, so we'll only register the session handler if enabled: |
||
49 | if ($this->config->supportsSessions) { |
||
50 | $this->addRedisSentinelSessionHandler(); |
||
51 | } |
||
52 | |||
53 | // If we want Laravel's Redis API to use Sentinel, we'll remove the |
||
54 | // "redis" service from the deferred services in the container: |
||
55 | if ($this->config->shouldOverrideLaravelRedisApi()) { |
||
56 | $this->removeDeferredRedisServices(); |
||
57 | } |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Bind the "redis-sentinel" database driver to the application service |
||
62 | * container. |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | public function register() |
||
85 | |||
86 | /** |
||
87 | * Replace the standard Laravel Redis service with the Redis Sentinel |
||
88 | * database driver so all Redis operations use Sentinel connections. |
||
89 | * |
||
90 | * @return void |
||
91 | */ |
||
92 | protected function registerOverrides() |
||
102 | |||
103 | /** |
||
104 | * Remove the standard Laravel Redis service from the bound deferred |
||
105 | * services so they don't overwrite Redis Sentinel registrations. |
||
106 | * |
||
107 | * @return void |
||
108 | */ |
||
109 | protected function removeDeferredRedisServices() |
||
122 | |||
123 | /** |
||
124 | * Add "redis-sentinel" as an available brodcaster option to the Laravel |
||
125 | * event broadcasting manager. |
||
126 | * |
||
127 | * @return void |
||
128 | */ |
||
129 | protected function addRedisSentinelBroadcaster() |
||
139 | |||
140 | /** |
||
141 | * Add "redis-sentinel" as an available cache store option to the Laravel |
||
142 | * cache manager. |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | protected function addRedisSentinelCacheStore() |
||
158 | |||
159 | /** |
||
160 | * Add "redis-sentinel" as an available driver option to the Laravel |
||
161 | * session manager. |
||
162 | * |
||
163 | * @return void |
||
164 | */ |
||
165 | protected function addRedisSentinelSessionHandler() |
||
178 | |||
179 | /** |
||
180 | * Add "redis-sentinel" as an available queue connection driver option to |
||
181 | * the Laravel queue manager. |
||
182 | * |
||
183 | * @return void |
||
184 | */ |
||
185 | protected function addRedisSentinelQueueConnector() |
||
193 | |||
194 | /** |
||
195 | * Get the fully-qualified class name of the RedisSentinelManager class |
||
196 | * for the current version of Laravel or Lumen. |
||
197 | * |
||
198 | * @return string The class name of the appropriate RedisSentinelManager |
||
199 | * with its namespace |
||
200 | */ |
||
201 | protected function getVersionedRedisSentinelManagerClass() |
||
217 | } |
||
218 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: