Parser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
dl 0
loc 24
wmc 2
lcom 1
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A parse() 0 4 1
1
<?php
2
3
namespace Pagemark;
4
5
use Pagemark\Contracts\Parseable;
6
use Parsedown;
7
8
class Parser implements Parseable
9
{
10
    /**
11
     * @var Parsedown
12
     */
13
    private $parser;
14
15
    /**
16
     * @param Parsedown $parser
17
     */
18
    public function __construct(Parsedown $parser)
19
    {
20
        $this->parser = $parser;
21
    }
22
23
    /**
24
     * @param string $post
25
     * @return string
26
     */
27
    public function parse($post)
28
    {
29
        return $this->parser->text($post);
30
    }
31
}