| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function fromArray() |
||
| 20 | { |
||
| 21 | $now = new \DateTime(); |
||
| 22 | $input = [ |
||
| 23 | 'type' => 'a type', |
||
| 24 | 'date' => $now->format('r'), |
||
| 25 | ]; |
||
| 26 | |||
| 27 | $summary = Date::fromArray($input); |
||
| 28 | |||
| 29 | $this->assertSame($input['type'], $summary->getType()); |
||
|
|
|||
| 30 | $this->assertSame($input['date'], $summary->getDate()->format('r')); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: