MarkdownFormatter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A asTitle() 0 4 1
A asBody() 0 4 1
A getDelimiter() 0 4 1
1
<?php
2
3
namespace Sugarcrm\UpgradeSpec\Formatter;
4
5
class MarkdownFormatter implements FormatterInterface
6
{
7
    /**
8
     * @param $text
9
     * @param int $level
10
     *
11
     * @return string
12
     */
13
    public function asTitle($text, $level = 1)
14
    {
15
        return str_repeat('#', $level) . ' ' . ucfirst($text);
16
    }
17
18
    /**
19
     * @param $text
20
     *
21
     * @return string
22
     */
23
    public function asBody($text)
24
    {
25
        return $text;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getDelimiter()
32
    {
33
        return PHP_EOL . PHP_EOL;
34
    }
35
}
36