Completed
Push — Recipes ( c0466a...7632b6 )
by Laurent
04:22
created

Tva   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 74
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setRate() 0 5 1
A getName() 0 3 1
A getId() 0 3 1
A __toString() 0 3 1
A getRate() 0 3 1
1
<?php
2
3
/**
4
 * Entity Tva.
5
 *
6
 * PHP Version 7
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2018 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: $Id$
13
 *
14
 * @see https://github.com/Dev-Int/glsr
15
 */
16
17
namespace App\Entity\Settings\Diverse;
18
19
use Doctrine\ORM\Mapping as ORM;
20
21
/**
22
 * Tva Entity.
23
 *
24
 * @category Entity
25
 *
26
 * @ORM\Table(name="app_tva")
27
 * @ORM\Entity(repositoryClass="App\Repository\Settings\Diverse\TvaRepository")
28
 */
29
class Tva
30
{
31
    /**
32
     * @var int Id of the VAT rate
33
     *
34
     * @ORM\Column(name="id", type="integer")
35
     * @ORM\Id
36
     * @ORM\GeneratedValue(strategy="AUTO")
37
     */
38
    private $id;
39
40
    /**
41
     * @var decimal VAT rate
0 ignored issues
show
Bug introduced by
The type App\Entity\Settings\Diverse\decimal was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
42
     *
43
     * @ORM\Column(name="rate", type="decimal", precision=4, scale=3)
44
     */
45
    private $rate;
46
47
    /**
48
     * Get id.
49
     *
50
     * @return int
51
     */
52
    public function getId()
53
    {
54
        return $this->id;
55
    }
56
57
    /**
58
     * Set rate.
59
     *
60
     * @param decimal $rate VAT rate
61
     *
62
     * @return Settings\Diverse\Tva
0 ignored issues
show
Bug introduced by
The type App\Entity\Settings\Diverse\Settings\Diverse\Tva was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
63
     */
64
    public function setRate($rate)
65
    {
66
        $this->rate = $rate;
67
68
        return $this;
69
    }
70
71
    /**
72
     * Get rate.
73
     *
74
     * @return decimal
75
     */
76
    public function getRate()
77
    {
78
        return $this->rate;
79
    }
80
81
    /**
82
     * Get name.
83
     *
84
     * @return string
85
     */
86
    public function getName()
87
    {
88
        return (number_format($this->getRate() * 100, 1)).' %';
89
    }
90
91
    /**
92
     * This method allows to make "echo $tva".
93
     * <p> So, to "show" $tva,
94
     * PHP will actually show the return of this method. <br />
95
     * Here, the name, so "echo $tva"
96
     * is equivalent to "echo $tva->getName()". </p>.
97
     *
98
     * @return string name
99
     */
100
    public function __toString()
101
    {
102
        return (string) $this->getName();
103
    }
104
}
105