GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#31)
by
unknown
03:24
created

EntitySerializer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Zumba\JsonSerializer\EntitySerializers;
4
5
use Zumba\Contracts\EntitySerializer as Contract;
6
7
class EntitySerializer implements Contract
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $type;
13
14
    /**
15
     * @var \Closure
16
     */
17
    protected $serializeClosure;
18
19
    /**
20
     * @var \Closure
21
     */
22
    protected $unserializeClosure;
23
24
    /**
25
     * EntitySerializer constructor.
26
     * @param string $type
27
     * @param \Closure $serializeClosure
28
     * @param \Closure $unserializeClosure
29
     */
30
    public function __construct($type, \Closure $serializeClosure, \Closure $unserializeClosure)
31
    {
32
        $this->type = $type;
33
        $this->serializeClosure = $serializeClosure;
34
        $this->unserializeClosure = $unserializeClosure;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getType()
41
    {
42
        return $this->type;
43
    }
44
45
    /**
46
     * @param $object
47
     * @return mixed
48
     */
49
    public function serialize($object)
50
    {
51
        return $this->serializeClosure($object);
0 ignored issues
show
Bug introduced by
The method serializeClosure() does not exist on Zumba\JsonSerializer\Ent...lizers\EntitySerializer. Did you maybe mean serialize()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
52
    }
53
54
    /**
55
     * @param array $data
56
     * @return mixed
57
     */
58
    public function unserialize($data)
59
    {
60
        return $this->unserializeClosure($data);
0 ignored issues
show
Bug introduced by
The method unserializeClosure() does not exist on Zumba\JsonSerializer\Ent...lizers\EntitySerializer. Did you maybe mean serialize()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
61
    }
62
}
63