| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function convertToTask($project_id, $subtask_id) |
||
| 30 | { |
||
| 31 | $subtask = $this->subtaskModel->getById($subtask_id); |
||
|
|
|||
| 32 | |||
| 33 | $task_id = $this->taskModel->create([ |
||
| 34 | 'project_id' => $project_id, |
||
| 35 | 'title' => $subtask['title'], |
||
| 36 | 'time_estimated' => $subtask['time_estimated'], |
||
| 37 | 'time_spent' => $subtask['time_spent'], |
||
| 38 | 'owner_id' => $subtask['user_id'], |
||
| 39 | ]); |
||
| 40 | |||
| 41 | if ($task_id !== false) { |
||
| 42 | $this->subtaskModel->remove($subtask_id); |
||
| 43 | } |
||
| 44 | |||
| 45 | return $task_id; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.