Completed
Push — caching ( 6c9b2f )
by Nate
03:39
created

CreateFromInstance::canCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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\ObjectConstructor;
10
11
use Tebru\Gson\Internal\ObjectConstructor;
12
13
/**
14
 * Class CreateFromInstance
15
 *
16
 * @author Nate Brunette <[email protected]>
17
 */
18
final class CreateFromInstance implements ObjectConstructor
19
{
20
    /**
21
     * The already instantiated object
22
     *
23
     * @var object
24
     */
25
    private $object;
26
27
    /**
28
     * Constructor
29
     *
30
     * @param object $object
31
     */
32
    public function __construct($object)
33
    {
34
        $this->object = $object;
35
    }
36
37
    /**
38
     * Returns the instantiated object
39
     *
40
     * @return object
41
     */
42
    public function construct()
43
    {
44
        return $this->object;
45
    }
46
47
    /**
48
     * Return true if object can be written to disk
49
     *
50
     * @return bool
51
     */
52
    public function canCache(): bool
53
    {
54
        return false;
55
    }
56
}
57