Completed
Push — master ( d80d23...dbf644 )
by David
18s queued 11s
created

Product   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPrice() 0 3 1
A getName() 0 3 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Models;
5
6
7
use DateTimeInterface;
8
use Psr\Http\Message\UploadedFileInterface;
9
use TheCodingMachine\GraphQL\Controllers\Annotations\Field;
10
use TheCodingMachine\GraphQL\Controllers\Annotations\Type;
11
12
/**
13
 * @Type()
14
 */
15
class Product
16
{
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
    /**
22
     * @var float
23
     */
24
    private $price;
25
26
    /**
27
     * Product constructor.
28
     * @param string $name
29
     * @param float $price
30
     */
31
    public function __construct(string $name, float $price)
32
    {
33
        $this->name = $name;
34
        $this->price = $price;
35
    }
36
37
    /**
38
     * @Field(name="name")
39
     * @return string
40
     */
41
    public function getName(): string
42
    {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @Field(name="price")
48
     * @return float
49
     */
50
    public function getPrice(): float
51
    {
52
        return $this->price;
53
    }
54
}
55