Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
23 | interface JsonVersioner |
||
24 | { |
||
25 | /** |
||
26 | * Parses and returns the version of a JSON object. |
||
27 | * |
||
28 | * @param stdClass $jsonData The JSON object |
||
29 | * |
||
30 | * @return string The version |
||
31 | * |
||
32 | * @throws CannotParseVersionException If the version cannot be parsed |
||
33 | */ |
||
34 | public function parseVersion(stdClass $jsonData); |
||
35 | |||
36 | /** |
||
37 | * Updates the version of a JSON object. |
||
38 | * |
||
39 | * @param stdClass $jsonData The JSON object |
||
40 | * @param string $version The version to set |
||
41 | * |
||
42 | * @throws CannotUpdateVersionException If the version cannot be updated |
||
43 | */ |
||
44 | public function updateVersion(stdClass $jsonData, $version); |
||
45 | } |
||
46 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.