PluginNode   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 25
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toSyntax() 0 3 1
A __construct() 0 3 1
A getStartingNodeMarkScore() 0 3 1
A increaseMark() 0 3 1
1
<?php
2
3
namespace dokuwiki\plugin\prosemirror\parser;
4
5
class PluginNode extends Node implements InlineNodeInterface
6
{
7
    protected $textNode;
8
9
    public function __construct($data, Node $parent, Node $previous = null)
10
    {
11
        $this->textNode = new TextNode($data['content'][0], $this, $previous);
12
    }
13
14
    public function toSyntax()
15
    {
16
        return $this->textNode->toSyntax();
17
    }
18
19
    /**
20
     * @param string $markType
21
     */
22
    public function increaseMark($markType)
23
    {
24
        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...
25
    }
26
27
    public function getStartingNodeMarkScore($markType)
28
    {
29
        return $this->textNode->getStartingNodeMarkScore($markType);
30
    }
31
}
32