EventInterface::setAggregateRootId()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
1
<?php
2
3
namespace PhpDDD\Domain\Event;
4
5
use PhpDDD\Domain\Exception\RuntimeException;
6
7
/**
8
 * Domain Events happen an Aggregate is modified.
9
 *
10
 * They are assumed be immutable objects that cannot change after instantiation.
11
 * Changing events can cause weird problems, so avoid this.
12
 */
13
interface EventInterface
14
{
15
    /**
16
     * @param mixed $aggregateRootId
17
     *
18
     * @throws RuntimeException When setting an aggregate id where one already exists.
19
     */
20
    public function setAggregateRootId($aggregateRootId);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
21
22
    /**
23
     * @return mixed
24
     */
25
    public function getAggregateRootId();
26
}
27