Completed
Branch master (97bfcc)
by Ma
02:04
created
src/Autocomplete/Container/Trie/Node.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -21,6 +21,9 @@
 block discarded – undo
21 21
      */
22 22
     private $endNode;
23 23
 
24
+    /**
25
+     * @param string $value
26
+     */
24 27
     public function __construct($value)
25 28
     {
26 29
         $this->value = $value;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 
74 74
     public function addSuffix($suffix, $word)
75 75
     {
76
-         if (count($suffix) < 1) {
76
+            if (count($suffix) < 1) {
77 77
             $this->endNode = $word;
78 78
             return true;
79 79
         }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $child = $this;
44 44
         $prefix = str_split($prefix);
45
-        foreach($prefix as $char) {
46
-            if($child) {
45
+        foreach ($prefix as $char) {
46
+            if ($child) {
47 47
                 $child = $child->getChild($char);
48 48
             }
49 49
         }
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 
53 53
     public function getPostfix($prefix, $postFixes = [])
54 54
     {
55
-        if($this->endNode) {
55
+        if ($this->endNode) {
56 56
             $postFixes[] = $this->endNode;
57 57
         }
58
-        foreach($this->children as $child) {
58
+        foreach ($this->children as $child) {
59 59
             $postFixes = $child->getPostfix($prefix, $postFixes);
60 60
         }
61 61
         return $postFixes;
Please login to merge, or discard this patch.
src/Autocomplete/Factory/ContainerFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
     public function build($name, $args = [])
21 21
     {
22 22
         $className = $this->namespace.$name.'\\'.$name;
23
-        if( ! class_exists($className)) {
23
+        if ( ! class_exists($className)) {
24 24
             throw new \Exception('Class: '.$className.' not found.');
25 25
         }
26 26
         $container = new \ReflectionClass($className);
27 27
         $container = $container->newInstanceArgs($args);
28
-        if( ! $container instanceof ContainerInterface) {
28
+        if ( ! $container instanceof ContainerInterface) {
29 29
             throw new \Exception('Bad container implementation');
30 30
         }
31 31
         return $container;
Please login to merge, or discard this patch.
src/Autocomplete/Container/Trie/Trie.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     {
49 49
         $this->inputParse($prefix);
50 50
         $child = $this->root->getClosest($prefix);
51
-         if( ! $child) {
51
+            if( ! $child) {
52 52
             return [];
53 53
         }
54 54
         $postFixes = $child->getPostfix($prefix);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     private function inputParse(&$input)
28 28
     {
29
-        if( ! $this->caseSensitive) {
29
+        if ( ! $this->caseSensitive) {
30 30
             $input = strtolower($input);
31 31
         }
32 32
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $this->inputParse($prefix);
50 50
         $child = $this->root->getClosest($prefix);
51
-         if( ! $child) {
51
+         if ( ! $child) {
52 52
             return [];
53 53
         }
54 54
         $postFixes = $child->getPostfix($prefix);
Please login to merge, or discard this patch.