Completed
Pull Request — master (#22)
by
unknown
01:15
created

DontSerialise::serialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dont;
6
7
use Dont\Exception\NonSerialisableObject;
8
use Dont\Exception\TypeError;
9
10
trait DontSerialise
11
{
12
    /**
13
     * @throws NonSerialisableObject
14
     * @throws TypeError
15
     */
16
    final public function __sleep() : void
17
    {
18
        throw NonSerialisableObject::fromAttemptedSerialisation($this);
19
    }
20
21
    /**
22
     * @throws NonSerialisableObject
23
     * @throws TypeError
24
     */
25
    final public function __serialize() : void
26
    {
27
        throw NonSerialisableObject::fromAttemptedSerialisation($this);
28
    }
29
30
    /**
31
     * @throws NonSerialisableObject
32
     * @throws TypeError
33
     */
34
    final public function serialize() : void
35
    {
36
        throw NonSerialisableObject::fromAttemptedSerialisation($this);
37
    }
38
}
39