Completed
Pull Request — master (#4)
by Nate
03:04
created

CreateFromInstance::construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
namespace Tebru\Gson\Internal\ObjectConstructor;
8
9
use Tebru\Gson\Internal\ObjectConstructor;
10
11
/**
12
 * Class CreateFromInstance
13
 *
14
 * @author Nate Brunette <[email protected]>
15
 */
16
class CreateFromInstance implements ObjectConstructor
17
{
18
    /**
19
     * The already instantiated object
20
     *
21
     * @var object
22
     */
23
    private $object;
24
25
    /**
26
     * Constructor
27
     *
28
     * @param object $object
29
     */
30 1
    public function __construct($object)
31
    {
32 1
        $this->object = $object;
33 1
    }
34
35
    /**
36
     * Returns the instantiated object
37
     *
38
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use object.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
39
     */
40 1
    public function construct()
41
    {
42 1
        return $this->object;
43
    }
44
}
45