JsonVersioner::parseVersion()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 1
1
<?php
2
3
/*
4
 * This file is part of the webmozart/json package.
5
 *
6
 * (c) Bernhard Schussek <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Webmozart\Json\Versioning;
13
14
use stdClass;
15
16
/**
17
 * Parses and updates the version of a JSON object.
18
 *
19
 * @since  1.3
20
 *
21
 * @author Bernhard Schussek <[email protected]>
22
 */
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);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

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.

Loading history...
45
}
46