Pizza   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 3
Metric Value
eloc 5
c 5
b 0
f 3
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bake() 0 3 1
A whenPizzaWasBaked() 0 3 1
A getIngredients() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/event-sourcing project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Tests\EventSourcing\Aggregate\Mock;
10
11
use Daikon\EventSourcing\Aggregate\AggregateRoot;
12
use Daikon\ValueObject\TextList;
13
14
/**
15
 * @codeCoverageIgnore
16
 */
17
final class Pizza extends AggregateRoot
18
{
19
    private TextList $ingredients;
20
21
    public static function bake(PizzaWasBaked $pizzaWasBaked): self
22
    {
23
        return (new self($pizzaWasBaked->getAggregateId()))->reflectThat($pizzaWasBaked);
24
    }
25
26
    public function getIngredients(): TextList
27
    {
28
        return $this->ingredients;
29
    }
30
31
    protected function whenPizzaWasBaked(PizzaWasBaked $pizzaWasBaked): void
32
    {
33
        $this->ingredients = $pizzaWasBaked->getIngredients();
34
    }
35
}
36