Passed
Push — master ( 9e2b32...3849b2 )
by Edson
02:50
created

Loop::repeat2()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace EdsonOnildo\Tpl\Tag;
4
5
class Loop extends Tag
6
{
7
    public function __construct()
8
    {
9
        $this->foreach();
10
        $this->endforeach();
11
12
        $this->for();
13
        $this->endfor();
14
    }
15
16
    private function for()
17
    {
18
        self::match('/@\s*for\s*\((.*?)\)/', function ($cond) {
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::match() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        self::/** @scrutinizer ignore-call */ 
19
              match('/@\s*for\s*\((.*?)\)/', function ($cond) {
Loading history...
19
20
            self::replace("<?php for ($cond) : ?>");
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::replace() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
            self::/** @scrutinizer ignore-call */ 
21
                  replace("<?php for ($cond) : ?>");
Loading history...
21
        });
22
    }
23
24
    private function endfor()
25
    {
26
        self::match('/@\s*\/for/', function () {
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::match() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        self::/** @scrutinizer ignore-call */ 
27
              match('/@\s*\/for/', function () {
Loading history...
27
28
            self::replace("<?php endfor ?>");
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::replace() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
            self::/** @scrutinizer ignore-call */ 
29
                  replace("<?php endfor ?>");
Loading history...
29
        });
30
    }
31
32
    private function foreach()
33
    {
34
        self::match('/@\s*foreach\s*\((.*?)\)/', function ($cond) {
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::match() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        self::/** @scrutinizer ignore-call */ 
35
              match('/@\s*foreach\s*\((.*?)\)/', function ($cond) {
Loading history...
35
36
            self::replace("<?php foreach ($cond) : ?>");
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::replace() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
            self::/** @scrutinizer ignore-call */ 
37
                  replace("<?php foreach ($cond) : ?>");
Loading history...
37
        });
38
    }
39
40
    private function endforeach()
41
    {
42
        self::match('/@\s*\/foreach/', function () {
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::match() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

42
        self::/** @scrutinizer ignore-call */ 
43
              match('/@\s*\/foreach/', function () {
Loading history...
43
44
            self::replace("<?php endforeach ?>");
0 ignored issues
show
Bug Best Practice introduced by
The method EdsonOnildo\Tpl\Tag\Tag::replace() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
            self::/** @scrutinizer ignore-call */ 
45
                  replace("<?php endforeach ?>");
Loading history...
45
        });
46
    }
47
}
48