CreateFromInstance   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A construct() 0 3 1
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 1
    public function __construct($object)
33
    {
34 1
        $this->object = $object;
35 1
    }
36
37
    /**
38
     * Returns the instantiated object
39
     *
40
     * @return object
41
     */
42 1
    public function construct()
43
    {
44 1
        return $this->object;
45
    }
46
}
47