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

DontDeserialise::unserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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