| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function routeNotificationFor($channel) |
||
| 47 | { |
||
| 48 | if (method_exists($this, $method = 'routeNotificationFor'.Inflector::id2camel($channel))) { |
||
| 49 | return $this->{$method}(); |
||
| 50 | } |
||
| 51 | switch ($channel) { |
||
| 52 | case 'mail': |
||
| 53 | return $this->email; |
||
| 54 | case 'nexmo': |
||
| 55 | return $this->phone_number; |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: