Completed
Push — master ( 24bde1...aae982 )
by Ma
02:07
created
examples/Dictionary/Dictionary.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     $input = fgets(STDIN, 1024);
23 23
     $input = trim($input);
24 24
     parseInput($input, $trie);
25
-    if($input == 'quit') $running = false;
25
+    if ($input == 'quit') $running = false;
26 26
 }
27 27
 
28 28
 function parseInput($input, $trie)
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     if ($wordLen < $minLen) {
46 46
         return false;
47 47
     }
48
-    for ($i=$wordLen; $i > $minSearch; $i--) {
49
-        $wordPreffix = substr($word,0 , $i);
48
+    for ($i = $wordLen; $i > $minSearch; $i--) {
49
+        $wordPreffix = substr($word, 0, $i);
50 50
         $words = $trie->getByPrefix($wordPreffix);
51 51
         //return first element of $words array
52 52
         return reset($words);
Please login to merge, or discard this patch.