Errors   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A p() 0 8 2
1
<?php
2
namespace Tuum\Form\Data;
3
4
class Errors extends AbstractData
5
{
6
    /**
7
     * @var string
8
     */
9
    public $format = '<p class="text-danger">%s</p>';
10
11
    /**
12
     * prints out error message in a format.
13
     *
14
     * @param string $name
15
     * @return string
16
     */
17
    public function p($name)
18
    {
19
        $msg = $this->raw($name);
20
        if (!$msg) {
21
            return '';
22
        }
23
        return sprintf($this->format, $msg);
24
    }
25
}