| 1 | <?php |
||
| 9 | class StringBuilder |
||
| 10 | {
|
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $string; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param $string |
||
| 18 | */ |
||
| 19 | 2 | public function __construct($string = '') |
|
| 23 | |||
| 24 | 1 | public function __toString() |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 2 | public function get() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $delimiter |
||
| 39 | * |
||
| 40 | * @return array |
||
| 41 | */ |
||
| 42 | public function explode($delimiter) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Добавление к строке следующую |
||
| 49 | * |
||
| 50 | * @param string $string |
||
| 51 | * @param null $prefix префикс|символ перед основной строкой |
||
| 52 | * |
||
| 53 | * @return StringBuilder |
||
| 54 | */ |
||
| 55 | 1 | public function append($string, $prefix = null) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @param $string |
||
| 63 | * |
||
| 64 | * @return StringBuilder |
||
| 65 | */ |
||
| 66 | 2 | public function remove($string) |
|
| 71 | |||
| 72 | /** |
||
| 73 | * @param string $search |
||
| 74 | * @param string|callable $replace |
||
| 75 | * @param bool $regexp |
||
| 76 | * |
||
| 77 | * @return $this |
||
| 78 | */ |
||
| 79 | 2 | public function replace($search, $replace, $regexp = false) |
|
| 99 | } |
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: