AddSuffix   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 2
cbo 1
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ifStringEnd() 0 5 1
A childIsInvalid() 0 9 1
1
<?php
2
namespace Autocomplete\Container\Trie\Method;
3
4
class AddSuffix extends Template
5
{
6
7
    public function ifStringEnd()
8
    {
9
        $this->child->setEndNode($this->word);
10
        return true;
11
    }
12
13
    public function childIsInvalid(&$prevChild)
14
    {
15
        $child = $prevChild->addChild($this->char);
16
        return 
17
        [
18
            'return' => false,
19
            'returnValue' => $child
20
        ];
21
    }
22
}
23