getObjectToSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
declare(strict_types=1);
8
9
namespace Tebru\Gson\Internal;
10
11
use Tebru\Gson\Context\WriterContext;
12
use Tebru\Gson\Exclusion\SerializationExclusionData;
13
14
/**
15
 * Class DefaultSerializationExclusionData
16
 *
17
 * @author Nate Brunette <[email protected]>
18
 */
19
class DefaultSerializationExclusionData implements SerializationExclusionData
20
{
21
    /**
22
     * The object that's currently being serialized
23
     *
24
     * @var object
25
     */
26
    private $objectToSerialize;
27
    /**
28
     * @var WriterContext
29
     */
30
    private $context;
31
32
    /**
33
     * Constructor
34
     *
35
     * @param object $objectToSerialize
36
     * @param WriterContext $context
37
     */
38 1
    public function __construct($objectToSerialize, WriterContext $context)
39
    {
40 1
        $this->objectToSerialize = $objectToSerialize;
41 1
        $this->context = $context;
42 1
    }
43
44
    /**
45
     * Get the object currently being serialized
46
     *
47
     * @return object
48
     */
49 1
    public function getObjectToSerialize()
50
    {
51 1
        return $this->objectToSerialize;
52
    }
53
54
    /**
55
     * Get the writer context
56
     *
57
     * @return WriterContext
58
     */
59 1
    public function getContext(): WriterContext
60
    {
61 1
        return $this->context;
62
    }
63
}
64