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