| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function addDescriptionContent($type, $text, $attrs = []) |
||
| 30 | { |
||
| 31 | $cf = new ContentField(); |
||
| 32 | |||
| 33 | $cf->type = $type; |
||
| 34 | |||
| 35 | if (!empty($attrs)) { |
||
| 36 | $cf->attrs = $attrs; |
||
| 37 | } |
||
| 38 | |||
| 39 | $cf->content[] = [ |
||
| 40 | 'type' => 'text', |
||
| 41 | 'text' => $text, |
||
| 42 | ]; |
||
| 43 | |||
| 44 | if (empty($this->content)) { |
||
| 45 | $this->content = []; |
||
| 46 | } |
||
| 47 | |||
| 48 | $this->content[] = $cf; |
||
| 49 | } |
||
| 51 |