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

CollectionValueTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A valToHtml() 0 12 2
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