1 | <?php |
||
9 | class MySQLBuilder { |
||
10 | /** @var PDO */ |
||
11 | private $pdo; |
||
12 | /** @var bool */ |
||
13 | private $useLocking = true; |
||
14 | /** @var string */ |
||
15 | private $lockPrefix = ''; |
||
16 | |||
17 | /** |
||
18 | * @param PDO $pdo |
||
19 | */ |
||
20 | public function __construct(PDO $pdo) { |
||
23 | |||
24 | /** |
||
25 | * Enabled by default. |
||
26 | * You can disable global locking (using MySQL's GET_LOCK) per service-run. |
||
27 | * A Lock will be optained before a service runs and will be released, is the service is done |
||
28 | * (or an exception was thrown during the run) |
||
29 | * |
||
30 | * @param bool $useLocking |
||
31 | * @return $this |
||
32 | */ |
||
33 | public function useLocking(bool $useLocking = true): self { |
||
37 | |||
38 | /** |
||
39 | * Set the lock-prefix for the MySQL-`GET_LOCK` name. |
||
40 | * |
||
41 | * You can think of it as calling the function like this: |
||
42 | * `SELECT GET_LOCK(CONCAT(<lock-prefix>, <registered-service-name>), 0)` |
||
43 | * |
||
44 | * Something like `my-app:` would result in `my-app:service-xy` if the particular service was registered as |
||
45 | * `service-xy`. The Lock is per service. Between two services, the lock will be released and reoptained. |
||
46 | * |
||
47 | * @param string $lockPrefix |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function setLockPrefix(string $lockPrefix = ''): self { |
||
54 | |||
55 | /** |
||
56 | * @return DefaultDispatcher |
||
57 | */ |
||
58 | public function build(): DefaultDispatcher { |
||
65 | } |
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: