HTML   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
dl 0
loc 19
wmc 3
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A reformat() 0 16 3
1
<?php
2
3
namespace TheSupportGroup\Common\Validator\Format;
4
5
use TheSupportGroup\Common\Validator\Contracts\Format\FormatInterface;
6
7
class HTML implements FormatInterface
8
{
9
    public function reformat($messages)
10
    {
11
        $li_lists = '';
12
13
        $ul = "<ul>\n%s</ul>";
14
15
        foreach ($messages as $message) {
16
            foreach ($message as $content) {
17
                $li = "<li>%s</li>\n";
18
19
                $li_lists .= sprintf($li, $content);
20
            }
21
        }
22
23
        return sprintf($ul, $li_lists);
24
    }
25
}
26