Completed
Push — master ( d44ef5...c7e879 )
by Fèvre
12s
created

Reply   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 85
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRoute() 0 4 1
A getUser() 0 4 1
A canContain() 0 4 1
A acceptsLines() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 0 4 1
1
<?php
2
namespace Xetaravel\Markdown\Reply;
3
4
use League\CommonMark\Block\Element\AbstractBlock;
5
use League\CommonMark\ContextInterface;
6
use League\CommonMark\Cursor;
7
8
class Reply extends AbstractBlock
9
{
10
    /**
11
     * The route used to display the post.
12
     *
13
     * @var string
14
     */
15
    protected $route;
16
17
    /**
18
     * The user of the reply.
19
     *
20
     * @var string
21
     */
22
    protected $user;
23
24
    /**
25
     * Constructor.
26
     *
27
     * @param string $route The route used to display the post.
28
     * @param string $user The user of the reply.
29
     */
30
    public function __construct(string $route, string $user)
31
    {
32
        $this->route = $route;
33
        $this->user = $user;
34
    }
35
36
    /**
37
     * Get the route.
38
     *
39
     * @return string
40
     */
41
    public function getRoute()
42
    {
43
        return $this->route;
44
    }
45
46
    /**
47
     * Get the user.
48
     *
49
     * @return string
50
     */
51
    public function getUser()
52
    {
53
        return $this->user;
54
    }
55
56
    /**
57
     * Returns true if this block can contain the given block as a child node
58
     *
59
     * @param AbstractBlock $block
60
     *
61
     * @return bool
62
     */
63
    public function canContain(AbstractBlock $block)
64
    {
65
        return false;
66
    }
67
68
    /**
69
     * Returns true if block type can accept lines of text
70
     *
71
     * @return bool
72
     */
73
    public function acceptsLines()
74
    {
75
        return true;
76
    }
77
78
    /**
79
     * Whether this is a code block
80
     *
81
     * @return bool
82
     */
83
    public function isCode()
84
    {
85
        return false;
86
    }
87
88
    public function matchesNextLine(Cursor $cursor)
89
    {
90
        return false;
91
    }
92
}
93