Completed
Push — master ( bafc2b...789f6f )
by Oscar
03:26
created

CollectionValueTrait::valToHtml()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace Folk\Formats\Traits;
4
5
trait CollectionValueTrait
6
{
7
    /**
8
     * Returns the value as html.
9
     *
10
     * @return string
11
     */
12
    public function valToHtml()
13
    {
14
        $html = '<ul>';
15
16
        foreach ($this as $field) {
0 ignored issues
show
Bug introduced by
The expression $this of type this<Folk\Formats\Traits\CollectionValueTrait> is not traversable.
Loading history...
17
            $html .= '<li>'.$field->valToHtml().'</li>';
18
        }
19
20
        $html .= '</ul>';
21
22
        return $html;
23
    }
24
}
25