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

Markdown   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A isExampleStart() 0 4 1
A isExampleEnd() 0 4 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