Pizza::getIngredients()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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