1 | <?php |
||
7 | class Format |
||
8 | { |
||
9 | /** |
||
10 | * The simple name instance to format |
||
11 | * |
||
12 | * @var Simple |
||
13 | */ |
||
14 | protected $name; |
||
15 | |||
16 | /** |
||
17 | * Create a new formatter. |
||
18 | * |
||
19 | * @param Simple $name The name to format. |
||
20 | */ |
||
21 | public function __construct(Simple $name) |
||
25 | |||
26 | /** |
||
27 | * A quick way to format a name. |
||
28 | * |
||
29 | * @param Simple $name The name to format. |
||
30 | * @param string $format_string The format string. |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public static function nameLike(Simple $name, $format_string) |
||
39 | |||
40 | /** |
||
41 | * Formats the name like the given format string describes. |
||
42 | * |
||
43 | * @param string $format_string The format string. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function like($format_string) |
||
59 | |||
60 | /** |
||
61 | * Format the given name segment/part. |
||
62 | * |
||
63 | * @param string $part The part. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | protected function format($part) |
||
100 | |||
101 | /** |
||
102 | * Tries to extract the long version of the given name from this part. |
||
103 | * |
||
104 | * @param string $part The part to process. |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | protected function tryGetLongVersion($part) |
||
114 | |||
115 | /** |
||
116 | * Tries to extract the short version of the given name from this part. |
||
117 | * |
||
118 | * @param string $part The part to process. |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | protected function tryGetShortVersion($part) |
||
128 | } |
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: