Completed
Push — master ( ad1530...714f57 )
by Marco
13s queued 12s
created

DontDeserialise   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __wakeup() 0 4 1
A unserialize() 0 4 1
A __unserialize() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dont;
6
7
use Dont\Exception\NonDeserialisableObject;
8
use Dont\Exception\TypeError;
9
10
trait DontDeserialise
11
{
12
    /**
13
     * @throws NonDeserialisableObject
14
     * @throws TypeError
15
     */
16 1
    final public function __wakeup() : void
17
    {
18 1
        throw NonDeserialisableObject::fromAttemptedDeSerialisation($this);
19
    }
20
21
    /**
22
     * @throws NonDeserialisableObject
23
     * @throws TypeError
24
     */
25 3
    final public function __unserialize() : array
26
    {
27 3
        throw NonDeserialisableObject::fromAttemptedDeSerialisation($this);
28
    }
29
30
    /**
31
     * @throws NonDeserialisableObject
32
     * @throws TypeError
33
     */
34 2
    final public function unserialize($_) : array
0 ignored issues
show
Unused Code introduced by
The parameter $_ 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
    {
36 2
        throw NonDeserialisableObject::fromAttemptedDeSerialisation($this);
37
    }
38
}
39