1 | <?php namespace Arcanedev\GeoIP; |
||
13 | class DriverManager extends Manager implements DriverFactory |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Constructor |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * DriverManager constructor. |
||
21 | * |
||
22 | * @param \Illuminate\Contracts\Foundation\Application $app |
||
23 | */ |
||
24 | 96 | public function __construct(Application $app) |
|
28 | |||
29 | /* ------------------------------------------------------------------------------------------------ |
||
30 | | Getters & Setters |
||
31 | | ------------------------------------------------------------------------------------------------ |
||
32 | */ |
||
33 | /** |
||
34 | * Get the default driver name. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | 42 | public function getDefaultDriver() |
|
42 | |||
43 | /** |
||
44 | * Get the driver class. |
||
45 | * |
||
46 | * @param string $key |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | 90 | private function getDriverClass($key) |
|
54 | |||
55 | /** |
||
56 | * Get the driver options. |
||
57 | * |
||
58 | * @param string $key |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | 90 | private function getDriverOptions($key) |
|
66 | |||
67 | /** |
||
68 | * Get the config. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * @param mixed|null $default |
||
72 | * |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 90 | public function getConfig($key, $default = null) |
|
79 | |||
80 | /** |
||
81 | * Get the config instance. |
||
82 | * |
||
83 | * @return \Illuminate\Contracts\Config\Repository |
||
84 | */ |
||
85 | 90 | private function config() |
|
89 | |||
90 | /* ------------------------------------------------------------------------------------------------ |
||
91 | | Main Functions |
||
92 | | ------------------------------------------------------------------------------------------------ |
||
93 | */ |
||
94 | /** |
||
95 | * Build the 'ip-api' driver. |
||
96 | * |
||
97 | * @return Drivers\IpApiDriver |
||
98 | */ |
||
99 | 18 | protected function createIpApiDriver() |
|
103 | |||
104 | /** |
||
105 | * Build the 'freegeoip' driver. |
||
106 | * |
||
107 | * @return Drivers\FreeGeoIpDriver |
||
108 | */ |
||
109 | 60 | protected function createFreegeoipDriver() |
|
113 | |||
114 | /** |
||
115 | * Get the 'maxmind-database' driver. |
||
116 | * |
||
117 | * @return mixed |
||
118 | */ |
||
119 | 24 | protected function createMaxmindDatabaseDriver() |
|
123 | |||
124 | /** |
||
125 | * Get the 'maxmind-api' driver. |
||
126 | * |
||
127 | * @return Drivers\MaxmindApiDriver |
||
128 | */ |
||
129 | 6 | protected function createMaxmindApiDriver() |
|
133 | |||
134 | /* ------------------------------------------------------------------------------------------------ |
||
135 | | Other Functions |
||
136 | | ------------------------------------------------------------------------------------------------ |
||
137 | */ |
||
138 | /** |
||
139 | * Build the driver. |
||
140 | * |
||
141 | * @param string $key |
||
142 | * |
||
143 | * @return mixed |
||
144 | */ |
||
145 | 90 | private function buildDriver($key) |
|
151 | } |
||
152 |
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: