| 1 | <?php |
||
| 7 | class Channel |
||
| 8 | { |
||
| 9 | private $name; |
||
| 10 | private $driver; |
||
| 11 | |||
| 12 | 1 | public function __construct(string $name, Driver $driver) |
|
| 17 | |||
| 18 | /** |
||
| 19 | * Name of the channel. |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | 1 | public function getName(): string |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Get driver. |
||
| 30 | * |
||
| 31 | * @return Driver |
||
| 32 | */ |
||
| 33 | 1 | public function getDriver(): Driver |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Get webhook URL. |
||
| 40 | * |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function getWebhookUrl(): string |
||
| 47 | } |
||
| 48 |
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: