This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
11
{
12
/**
13
* @var BurgerInterface
14
*/
15
private $burger;
16
17
/**
18
* CheeseBurger constructor.
19
* @param BurgerInterface $burger
20
*/
21
2
public function __construct(BurgerInterface $burger)
22
{
23
2
$this->burger = $burger;
24
2
}
25
26
/**
27
* @return int
28
*/
29
2
public function getPrice(): int
30
{
31
2
return $this->burger->getPrice() + 3;
32
}
33
34
/**
35
* @return string
36
*/
37
2
public function getDescription(): string
38
{
39
2
return $this->burger->getDescription() . ' with avocado';
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.