| Conditions | 2 |
| Paths | 2 |
| Total Lines | 28 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function addReminder($content, $done = false, \DateTime $date = null) |
||
| 21 | { |
||
| 22 | $fieldNames = [ |
||
| 23 | 'content', |
||
| 24 | 'done', |
||
| 25 | 'remind', |
||
| 26 | ]; |
||
| 27 | $reminder = new Reminder(); |
||
| 28 | $reminder->content = $content; |
||
| 29 | $reminder->done = $done; |
||
| 30 | $reminder->remind = false; |
||
| 31 | if (null !== $date) |
||
| 32 | { |
||
| 33 | $reminder->remind = true; |
||
| 34 | $reminder->date = $date->format('Y/m/d'); |
||
| 35 | $reminder->hour = $date->format('H'); |
||
| 36 | $fieldNames = array_merge($fieldNames, [ |
||
| 37 | 'date', |
||
| 38 | 'hour', |
||
| 39 | ]); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** @var Reminders $reminders */ |
||
| 43 | $reminders = $this->getReminders(); |
||
| 44 | $result = $reminders->create($reminder, $fieldNames); |
||
| 45 | |||
| 46 | return $result; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.