Completed
Push — master ( 0a933f...8a8a33 )
by Ma
02:04
created

AddSuffix::childIsInvalid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 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
}