Passed
Pull Request — master (#10)
by Joao
01:36
created
src/Row.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
             return json_decode(json_encode($this->row));
223 223
         } else {
224 224
             throw new UnexpectedValueException(
225
-                'I expected that getRawFormat is array() but ' . gettype($this->row) . ' was given'
225
+                'I expected that getRawFormat is array() but '.gettype($this->row).' was given'
226 226
             );
227 227
         }
228 228
     }
Please login to merge, or discard this patch.
src/IteratorFilterXPathFormatter.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,35 +26,35 @@
 block discarded – undo
26 26
 
27 27
         $data = [
28 28
             Relation::EQUAL => function ($field, $value) {
29
-                 return $field . "=" . $value;
29
+                    return $field . "=" . $value;
30 30
             },
31 31
 
32 32
             Relation::GREATER_THAN => function ($field, $value) {
33
-                 return $field . ">" . $value;
33
+                    return $field . ">" . $value;
34 34
             },
35 35
 
36 36
             Relation::LESS_THAN => function ($field, $value) {
37
-                 return $field . "<" . $value;
37
+                    return $field . "<" . $value;
38 38
             },
39 39
 
40 40
             Relation::GREATER_OR_EQUAL_THAN => function ($field, $value) {
41
-                 return $field . ">=" . $value;
41
+                    return $field . ">=" . $value;
42 42
             },
43 43
 
44 44
             Relation::LESS_OR_EQUAL_THAN => function ($field, $value) {
45
-                 return $field . "<=" . $value;
45
+                    return $field . "<=" . $value;
46 46
             },
47 47
 
48 48
             Relation::NOT_EQUAL => function ($field, $value) {
49
-                 return $field . "!=" . $value;
49
+                    return $field . "!=" . $value;
50 50
             },
51 51
 
52 52
             Relation::STARTS_WITH => function ($field, $value) {
53
-                 return " starts-with($field, $value) ";
53
+                    return " starts-with($field, $value) ";
54 54
             },
55 55
 
56 56
             Relation::CONTAINS => function ($field, $value) {
57
-                 return " contains($field, $value) ";
57
+                    return " contains($field, $value) ";
58 58
             },
59 59
         ];
60 60
 
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -15,45 +15,45 @@
 block discarded – undo
15 15
             return "/anydataset/row";
16 16
         }
17 17
 
18
-        return "/anydataset/row[" . $xpathFilter . "]";
18
+        return "/anydataset/row[".$xpathFilter."]";
19 19
     }
20 20
 
21 21
     public function getRelation($name, $relation, $value, &$param)
22 22
     {
23 23
         $str = is_numeric($value) ? "" : "'";
24
-        $field = "field[@name='" . $name . "'] ";
24
+        $field = "field[@name='".$name."'] ";
25 25
         $value = " $str$value$str ";
26 26
 
27 27
         $data = [
28
-            Relation::EQUAL => function ($field, $value) {
29
-                 return $field . "=" . $value;
28
+            Relation::EQUAL => function($field, $value) {
29
+                 return $field."=".$value;
30 30
             },
31 31
 
32
-            Relation::GREATER_THAN => function ($field, $value) {
33
-                 return $field . ">" . $value;
32
+            Relation::GREATER_THAN => function($field, $value) {
33
+                 return $field.">".$value;
34 34
             },
35 35
 
36
-            Relation::LESS_THAN => function ($field, $value) {
37
-                 return $field . "<" . $value;
36
+            Relation::LESS_THAN => function($field, $value) {
37
+                 return $field."<".$value;
38 38
             },
39 39
 
40
-            Relation::GREATER_OR_EQUAL_THAN => function ($field, $value) {
41
-                 return $field . ">=" . $value;
40
+            Relation::GREATER_OR_EQUAL_THAN => function($field, $value) {
41
+                 return $field.">=".$value;
42 42
             },
43 43
 
44
-            Relation::LESS_OR_EQUAL_THAN => function ($field, $value) {
45
-                 return $field . "<=" . $value;
44
+            Relation::LESS_OR_EQUAL_THAN => function($field, $value) {
45
+                 return $field."<=".$value;
46 46
             },
47 47
 
48
-            Relation::NOT_EQUAL => function ($field, $value) {
49
-                 return $field . "!=" . $value;
48
+            Relation::NOT_EQUAL => function($field, $value) {
49
+                 return $field."!=".$value;
50 50
             },
51 51
 
52
-            Relation::STARTS_WITH => function ($field, $value) {
52
+            Relation::STARTS_WITH => function($field, $value) {
53 53
                  return " starts-with($field, $value) ";
54 54
             },
55 55
 
56
-            Relation::CONTAINS => function ($field, $value) {
56
+            Relation::CONTAINS => function($field, $value) {
57 57
                  return " contains($field, $value) ";
58 58
             },
59 59
         ];
Please login to merge, or discard this patch.
src/IteratorFilter.php 2 patches
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,6 @@  discard block
 block discarded – undo
140 140
 
141 141
     /**
142 142
      * Add a "("
143
-
144 143
      */
145 144
     public function startGroup()
146 145
     {
@@ -149,7 +148,6 @@  discard block
 block discarded – undo
149 148
 
150 149
     /**
151 150
      * Add a ")"
152
-
153 151
      */
154 152
     public function endGroup()
155 153
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,35 +72,35 @@
 block discarded – undo
72 72
             }
73 73
 
74 74
             $data = [
75
-                Relation::EQUAL => function ($valueparam, $value) {
75
+                Relation::EQUAL => function($valueparam, $value) {
76 76
                     return ($valueparam == $value);
77 77
                 },
78 78
 
79
-                Relation::GREATER_THAN => function ($valueparam, $value) {
79
+                Relation::GREATER_THAN => function($valueparam, $value) {
80 80
                     return ($valueparam > $value);
81 81
                 },
82 82
 
83
-                Relation::LESS_THAN => function ($valueparam, $value) {
83
+                Relation::LESS_THAN => function($valueparam, $value) {
84 84
                     return ($valueparam < $value);
85 85
                 },
86 86
 
87
-                Relation::GREATER_OR_EQUAL_THAN => function ($valueparam, $value) {
87
+                Relation::GREATER_OR_EQUAL_THAN => function($valueparam, $value) {
88 88
                     return ($valueparam >= $value);
89 89
                 },
90 90
 
91
-                Relation::LESS_OR_EQUAL_THAN => function ($valueparam, $value) {
91
+                Relation::LESS_OR_EQUAL_THAN => function($valueparam, $value) {
92 92
                     return ($valueparam <= $value);
93 93
                 },
94 94
 
95
-                Relation::NOT_EQUAL => function ($valueparam, $value) {
95
+                Relation::NOT_EQUAL => function($valueparam, $value) {
96 96
                     return ($valueparam != $value);
97 97
                 },
98 98
 
99
-                Relation::STARTS_WITH => function ($valueparam, $value) {
99
+                Relation::STARTS_WITH => function($valueparam, $value) {
100 100
                     return (strpos($valueparam, $value) === 0);
101 101
                 },
102 102
 
103
-                Relation::CONTAINS => function ($valueparam, $value) {
103
+                Relation::CONTAINS => function($valueparam, $value) {
104 104
                     return (strpos($valueparam, $value) !== false);
105 105
                 },
106 106
             ];
Please login to merge, or discard this patch.
src/AnyDataset.php 2 patches
Indentation   -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@  discard block
 block discarded – undo
13 13
  * Anydataset files have extension ".anydata.xml" and have many classes to put and get data into anydataset xml file.
14 14
  * Anydataset class just read and write files. To search elements you need use AnyIterator
15 15
  * and IteratorFilter. Each row have a class Row.
16
-
17 16
  * XML Structure
18 17
  * <code>
19 18
  * <anydataset>
@@ -28,17 +27,14 @@  discard block
 block discarded – undo
28 27
  *    </row>
29 28
  * </anydataset>
30 29
  * </code>
31
-
32 30
  * How to use:
33 31
  * <code>
34 32
  * $any = new AnyDataset();
35 33
  * </code>
36
-
37 34
  *
38 35
 *@see Row
39 36
  * @see AnyIterator
40 37
  * @see IteratorFilter
41
-
42 38
  */
43 39
 class AnyDataset
44 40
 {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $this->currentRow = -1;
73 73
 
74 74
         $this->filename = null;
75
-        $this->defineSavePath($filename, function () {
75
+        $this->defineSavePath($filename, function() {
76 76
             if (!is_null($this->filename)) {
77 77
                 $this->createFrom($this->filename);
78 78
             }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 foreach ($fields as $field) {
122 122
                     $attr = $field->attributes->getNamedItem("name");
123 123
                     if (is_null($attr)) {
124
-                        throw new \InvalidArgumentException('Malformed anydataset file ' . basename($filepath));
124
+                        throw new \InvalidArgumentException('Malformed anydataset file '.basename($filepath));
125 125
                     }
126 126
 
127 127
                     $sr->addField($attr->nodeValue, $field->nodeValue);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public function save($filename = null)
173 173
     {
174
-        $this->defineSavePath($filename, function () {
174
+        $this->defineSavePath($filename, function() {
175 175
             if (is_null($this->filename)) {
176 176
                 throw new DatabaseException("No such file path to save anydataset");
177 177
             }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         $left = $right = array();
348 348
 
349 349
         $cntSeq = count($seq);
350
-        for ($i = 1; $i < $cntSeq; $i ++) {
350
+        for ($i = 1; $i < $cntSeq; $i++) {
351 351
             if ($seq[$i]->get($field) <= $key->get($field)) {
352 352
                 $left[] = $seq[$i];
353 353
             } else {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 
358 358
         return array_merge(
359 359
             $this->quickSortExec($left, $field),
360
-            [ $key ],
360
+            [$key],
361 361
             $this->quickSortExec($right, $field)
362 362
         );
363 363
     }
Please login to merge, or discard this patch.