| 1 | <?php |
||
| 12 | class Identifier |
||
| 13 | { |
||
| 14 | const FALLBACK_LENGTH = 5; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param ElementInterface $root |
||
| 18 | * @param string $tag |
||
| 19 | * |
||
| 20 | * @return string |
||
| 21 | */ |
||
| 22 | 1 | public static function sequential(ElementInterface $root, $tag) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Generates random string with prepended `$prefix`. |
||
| 32 | * |
||
| 33 | * @param string $prefix The prefix of string. |
||
| 34 | * @param int $length The length of string. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 58 | public static function random($prefix, $length) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * To avoid duplication. |
||
| 53 | * |
||
| 54 | * @param $length |
||
| 55 | * |
||
| 56 | * @return int |
||
| 57 | */ |
||
| 58 | 58 | private static function tryApplyFallback(&$length) |
|
| 65 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: