Completed
Push — master ( 228573...1c9069 )
by Pol
06:31
created
src/NGramsTrait.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
 
33 33
     /**
34 34
      * @param $data
35
-     * @param $n
36
-     * @param $cyclic
35
+     * @param integer $n
36
+     * @param boolean $cyclic
37 37
      *
38 38
      * @return array
39 39
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function ngramString($data, $n = 1, $cyclic = true)
27 27
     {
28
-        return array_map(function ($data) {
28
+        return array_map(function($data) {
29 29
             return implode('', $data);
30 30
         }, $this->doNgram(str_split($data), $n, $cyclic));
31 31
     }
Please login to merge, or discard this patch.
spec/drupol/phpngrams/NGramsSpec.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function it_can_get_ngram_from_an_array()
43 43
     {
44 44
         $result = [
45
-            ['h', 'e'], ['e','l'], ['l','l'], ['l','o'], ['o','h']
45
+            ['h', 'e'], ['e', 'l'], ['l', 'l'], ['l', 'o'], ['o', 'h']
46 46
         ];
47 47
 
48 48
         $this->ngramArray(['h', 'e', 'l', 'l', 'o'], 2)->shouldBe($result);
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
     public function it_can_get_ngram_from_an_array_with_big_n()
52 52
     {
53 53
         $result = [
54
-            ['h','e','l','l','o'],
55
-            ['e','l','l','o','h'],
56
-            ['l','l','o','h','e'],
57
-            ['l','o','h','e','l'],
58
-            ['o','h','e','l','l'],
54
+            ['h', 'e', 'l', 'l', 'o'],
55
+            ['e', 'l', 'l', 'o', 'h'],
56
+            ['l', 'l', 'o', 'h', 'e'],
57
+            ['l', 'o', 'h', 'e', 'l'],
58
+            ['o', 'h', 'e', 'l', 'l'],
59 59
         ];
60 60
 
61 61
         $this->ngramArray(['h', 'e', 'l', 'l', 'o'], 10)->shouldBe($result);
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
     public function it_can_get_ngram_from_an_array_without_cycling()
65 65
     {
66 66
         $result = [
67
-            ['h','e','l'],
68
-            ['e','l','l'],
69
-            ['l','l','o'],
70
-            ['l','o',' '],
71
-            ['o',' ','w'],
72
-            [' ','w','o'],
73
-            ['w','o','r'],
74
-            ['o','r','l'],
75
-            ['r','l','d'],
67
+            ['h', 'e', 'l'],
68
+            ['e', 'l', 'l'],
69
+            ['l', 'l', 'o'],
70
+            ['l', 'o', ' '],
71
+            ['o', ' ', 'w'],
72
+            [' ', 'w', 'o'],
73
+            ['w', 'o', 'r'],
74
+            ['o', 'r', 'l'],
75
+            ['r', 'l', 'd'],
76 76
         ];
77 77
 
78 78
         $this->ngramArray(['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'], 3, false)->shouldBe($result);
Please login to merge, or discard this patch.