Passed
Push — master ( 572de6...b677aa )
by Andreas
03:25
created

SmileyNode::increaseMark()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace dokuwiki\plugin\prosemirror\parser;
4
5
6
class SmileyNode extends Node implements InlineNodeInterface
7
{
8
9
    protected $parent;
10
    protected $data;
11
12
    /** @var TextNode */
13
    protected $textNode;
14
15
    public function __construct($data, Node $parent, Node $previous = null)
16
    {
17
        $this->parent = &$parent;
18
        $this->data = $data;
19
20
        // every inline node needs a TextNode to track marks
21
        $this->textNode = new TextNode(['marks' => $data['marks']], $parent, $previous);
22
    }
23
24
    /**
25
     * Get the node's representation as DokuWiki Syntax
26
     *
27
     * @return string
28
     */
29
    public function toSyntax()
30
    {
31
        return $this->data['attrs']['syntax'];
32
    }
33
34
    /**
35
     * @param string $markType
36
     */
37
    public function increaseMark($markType)
38
    {
39
        return $this->textNode->increaseMark($markType);
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->textNode->increaseMark($markType) targeting dokuwiki\plugin\prosemir...extNode::increaseMark() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
40
    }
41
42
    /**
43
     * @param string $markType
44
     * @return int|null
45
     * @throws \Exception
46
     */
47
    public function getStartingNodeMarkScore($markType)
48
    {
49
        return $this->textNode->getStartingNodeMarkScore($markType);
50
    }
51
}
52