1 | <?php |
||
16 | class AuraSqlModule extends AbstractModule |
||
17 | { |
||
18 | const PARSE_PDO_DSN_REGEX = '/(.*?)\:(?:(host|server)=.*?;)?(.*)/i'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $dsn; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $user; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $password; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $slave; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $options; |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | private $attributes; |
||
49 | |||
50 | /** |
||
51 | * @param string $dsn |
||
52 | * @param string $user |
||
53 | * @param string $password |
||
54 | * @param string $slave comma separated slave host list |
||
55 | * @param array $options |
||
56 | */ |
||
57 | public function __construct(string $dsn, string $user = '', string $password = '', string $slave = '', array $options = [], array $attributes) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | protected function configure() |
||
81 | |||
82 | private function configureSingleDsn() |
||
91 | |||
92 | private function configureMasterSlaveDsn() |
||
105 | |||
106 | private function changeHost($dsn, $host) : string |
||
116 | } |
||
117 |
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: