Passed
Push — master ( f47d5f...f7335a )
by Gabor
05:38
created

ServiceAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0
ccs 0
cts 8
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A parse() 0 4 1
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 7.1
6
 *
7
 * @copyright 2012 - 2017 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
declare(strict_types = 1);
13
14
namespace WebHemi\Parser\ServiceAdapter\Parsedown;
15
16
use Parsedown;
17
use WebHemi\Parser\ServiceInterface;
18
19
/**
20
 * Class ServiceAdapter
21
 */
22
class ServiceAdapter implements ServiceInterface
23
{
24
    /** @var Parsedown */
25
    private $adapter;
26
27
    /**
28
     * ServiceAdapter constructor.
29
     */
30
    public function __construct()
31
    {
32
        $this->adapter = new Parsedown();
33
    }
34
35
    /**
36
     * Parses the input.
37
     *
38
     * @param string $text
39
     * @return string
40
     */
41
    public function parse(string $text) : string
42
    {
43
        return $this->adapter->text($text);
44
    }
45
}
46