1 | <?php |
||
44 | class XML |
||
45 | { |
||
46 | |||
47 | /** |
||
48 | * Quote XML string. |
||
49 | * |
||
50 | * @param string $string String to be quoted |
||
51 | * @param string $encoding Encoding used for quotation |
||
52 | * @return string |
||
53 | */ |
||
54 | 5 | public static function quote($string, $encoding = 'UTF-8') |
|
55 | { |
||
56 | 5 | $flags = ENT_QUOTES; |
|
57 | |||
58 | 5 | if (defined('ENT_XML1')) { |
|
59 | 4 | $flags |= ENT_XML1; |
|
60 | 4 | } |
|
61 | |||
62 | 5 | return htmlspecialchars($string, $flags, $encoding); |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * Replace variables in a string and quote them before. |
||
67 | * |
||
68 | * <b>Hint:</b> this function works like <code>sprintf</code> |
||
69 | * |
||
70 | * @param string $message |
||
71 | * @param mixed $args |
||
|
|||
72 | * @param mixed $... |
||
73 | * @return string |
||
74 | */ |
||
75 | 6 | public static function quoteMessage($message) |
|
95 | |||
96 | /** |
||
97 | * Generate a unique id. |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | 3 | public static function generateId() |
|
105 | |||
106 | /** |
||
107 | * Encode a string with Base64 and quote it. |
||
108 | * |
||
109 | * @param string $data |
||
110 | * @param string $encoding |
||
111 | * @return string |
||
112 | */ |
||
113 | 3 | public static function base64Encode($data, $encoding = 'UTF-8') |
|
117 | |||
118 | /** |
||
119 | * Decode a Base64 encoded string. |
||
120 | * |
||
121 | * @param string $data |
||
122 | * @return string |
||
123 | */ |
||
124 | 3 | public static function base64Decode($data) |
|
128 | } |
||
129 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.