| Conditions | 4 |
| Paths | 8 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | protected function newEditor($fields) |
||
| 58 | { |
||
| 59 | if ($fields instanceof Editor) { |
||
| 60 | $editor = $fields; |
||
| 61 | } else { |
||
| 62 | $editor = new Editor; |
||
| 63 | $editor->fields($fields); |
||
| 64 | } |
||
| 65 | |||
| 66 | if (! $editor->table) { |
||
| 67 | $editor->table($this->getTableAttribute('id')); |
||
| 68 | } |
||
| 69 | |||
| 70 | if (! $editor->ajax) { |
||
| 71 | $editor->ajax($this->getAjaxUrl()); |
||
| 72 | } |
||
| 73 | |||
| 74 | return $editor; |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
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: