Completed
Push — feature/EVO-7278-security-and-... ( ae4d63...67cd5b )
by
unknown
26:50 queued 21:17
created

EmptyHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0
ccs 0
cts 16
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A serializeEmptyToJson() 0 8 1
A deserializeEmptyFromJson() 0 8 1
1
<?php
2
/**
3
 * HashHandler class file
4
 */
5
6
namespace Graviton\DocumentBundle\Serializer\Handler;
7
8
use JMS\Serializer\Context;
9
use JMS\Serializer\JsonDeserializationVisitor;
10
use JMS\Serializer\JsonSerializationVisitor;
11
use Graviton\DocumentBundle\Entity\Hash;
12
13
/**
14
 * Hash handler for JMS serializer
15
 *
16
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
17
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
18
 * @link     http://swisscom.ch
19
 */
20
class EmptyHandler
21
{
22
    /**
23
     * Serialize Hash object
24
     *
25
     * @param JsonSerializationVisitor $visitor Visitor
26
     * @param Hash                     $data    Data
27
     * @param array                    $type    Type
28
     * @param Context                  $context Context
29
     * @return array
0 ignored issues
show
Documentation introduced by
Should the return type not be array|null? Also, consider making the array more specific, something like array<String>, or String[].

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
30
     */
31
    public function serializeEmptyToJson(
32
        JsonSerializationVisitor $visitor,
0 ignored issues
show
Unused Code introduced by
The parameter $visitor is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
        $data,
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
        array $type,
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
        Context $context
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
    ) {
37
        return null;
38
    }
39
40
    /**
41
     * Deserialize Hash object
42
     *
43
     * @param JsonDeserializationVisitor $visitor Visitor
44
     * @param array                      $data    Data
45
     * @param array                      $type    Type
46
     * @param Context                    $context Context
47
     * @return Hash
0 ignored issues
show
Documentation introduced by
Should the return type not be Hash|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
48
     */
49
    public function deserializeEmptyFromJson(
50
        JsonDeserializationVisitor $visitor,
0 ignored issues
show
Unused Code introduced by
The parameter $visitor is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
51
        $data,
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
        array $type,
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
        Context $context
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    ) {
55
        return null;
56
    }
57
}
58