Completed
Push — master ( 577058...958f25 )
by Hannes
02:13
created

Markdown::isExampleStart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace hanneskod\readmetester\Format;
4
5
/**
6
 * Identify markdown formatted php code blocks
7
 */
8
class Markdown implements FormatInterface
9
{
10
    public function getName()
11
    {
12
        return "Markdown";
13
    }
14
15
    public function isExampleStart($line)
16
    {
17
        return !!preg_match('/^```php\s*$/i', $line);
18
    }
19
20
    public function isExampleEnd($line)
21
    {
22
        return !!preg_match('/^```\s*$/', $line);
23
    }
24
}
25