Passed
Push — master ( 0db193...9534e6 )
by Rob
04:00
created

Html::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace devtoolboxuk\cerberus\Wrappers;
4
5
class Html extends Base
6
{
7
8
    public function process()
9
    {
10
        $this->initWrapper($this->setLocalName());
11
12
        if (preg_match("/<\/?\w+((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/", $this->getReference())) {
13
            $this->setScore($this->getRealScore());
14
            $this->setResult();
15
        }
16
    }
17
18
    private function setLocalName()
19
    {
20
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
21
        return str_replace('Wrapper', '', $name);
22
    }
23
24
}