Product::setName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Entity;
4
5
use App\Repository\ProductRepository;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * The Product class.
10
 */
11
#[ORM\Entity(repositoryClass: ProductRepository::class)]
12
class Product
13
{
14
    #[ORM\Id]
15
    #[ORM\GeneratedValue]
16
    #[ORM\Column]
17
    private ?int $id = null;
18
19
    #[ORM\Column(length: 255)]
20
    private ?string $name = null;
21
22
    #[ORM\Column]
23
    private ?int $value = null;
24
25
    /**
26
     * Get the id for the product.
27
     */
28 1
    public function getId(): ?int
29
    {
30 1
        return $this->id;
31
    }
32
33
    /**
34
     * Get the name for the product.
35
     */
36 1
    public function getName(): ?string
37
    {
38 1
        return $this->name;
39
    }
40
41
    /**
42
     * Set the name for the product.
43
     */
44 1
    public function setName(string $name): static
45
    {
46 1
        $this->name = $name;
47
48 1
        return $this;
49
    }
50
51
    /**
52
     * Get the value for the product.
53
     */
54 1
    public function getValue(): ?int
55
    {
56 1
        return $this->value;
57
    }
58
59
    /**
60
     * Set the value for the product.
61
     */
62 1
    public function setValue(int $value): static
63
    {
64 1
        $this->value = $value;
65
66 1
        return $this;
67
    }
68
}
69