Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace C4tech\RayEmitter\Contracts\Domain; |
||
3 | interface Entity |
||
4 | { |
||
5 | /** |
||
6 | * Constructor |
||
7 | * |
||
8 | * Instantiate an Entity using its identifier. |
||
9 | * @param ValueObjectInterface $identifier The identity Value Object. |
||
10 | * @return static |
||
|
|||
11 | */ |
||
12 | public function __construct(ValueObject $identifier); |
||
13 | |||
14 | /** |
||
15 | * Get Id |
||
16 | * |
||
17 | * Return the identifier Value Object. |
||
18 | * @return ValueObjectInterface |
||
19 | */ |
||
20 | public function getId(); |
||
21 | |||
22 | /** |
||
23 | * Magic Getter |
||
24 | * |
||
25 | * Expose getter methods as properties. |
||
26 | * @param string $property Requested "property" |
||
27 | * @return mixed |
||
28 | */ |
||
29 | public function __get($property); |
||
30 | } |
||
31 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.