Passed
Pull Request — master (#13)
by Joao
07:22
created
src/AnyDataset.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $this->currentRow = -1;
74 74
 
75 75
         $this->filename = null;
76
-        $this->defineSavePath($filename, function () {
76
+        $this->defineSavePath($filename, function() {
77 77
             if (!is_null($this->filename)) {
78 78
                 $this->createFrom($this->filename);
79 79
             }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 foreach ($fields as $field) {
129 129
                     $attr = $field->attributes->getNamedItem("name");
130 130
                     if (is_null($attr) || is_null($attr->nodeValue)) {
131
-                        throw new InvalidArgumentException('Malformed anydataset file ' . basename($filepath));
131
+                        throw new InvalidArgumentException('Malformed anydataset file '.basename($filepath));
132 132
                     }
133 133
 
134 134
                     $sr->addField($attr->nodeValue, $field->nodeValue);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public function save($filename = null)
161 161
     {
162
-        $this->defineSavePath($filename, function () {
162
+        $this->defineSavePath($filename, function() {
163 163
             if (is_null($this->filename)) {
164 164
                 throw new DatabaseException("No such file path to save anydataset");
165 165
             }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         $left = $right = array();
344 344
 
345 345
         $cntSeq = count($seq);
346
-        for ($i = 1; $i < $cntSeq; $i ++) {
346
+        for ($i = 1; $i < $cntSeq; $i++) {
347 347
             if ($seq[$i]->get($field) <= $key->get($field)) {
348 348
                 $left[] = $seq[$i];
349 349
             } else {
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
         return array_merge(
355 355
             $this->quickSortExec($left, $field),
356
-            [ $key ],
356
+            [$key],
357 357
             $this->quickSortExec($right, $field)
358 358
         );
359 359
     }
Please login to merge, or discard this patch.
src/IteratorFilterXPathFormatter.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -6,64 +6,64 @@
 block discarded – undo
6 6
 
7 7
 class IteratorFilterXPathFormatter extends IteratorFilterFormatter
8 8
 {
9
-     /**
10
-      * @inheritDoc
11
-      */
12
-     public function format($filters, $tableName = null, &$params = [], $returnFields = "*")
13
-     {
14
-          $param = [];
15
-          $xpathFilter = $this->getFilter($filters, $param);
9
+        /**
10
+         * @inheritDoc
11
+         */
12
+        public function format($filters, $tableName = null, &$params = [], $returnFields = "*")
13
+        {
14
+            $param = [];
15
+            $xpathFilter = $this->getFilter($filters, $param);
16 16
 
17
-          if ($xpathFilter == "") {
18
-               return "/anydataset/row";
19
-          }
17
+            if ($xpathFilter == "") {
18
+                return "/anydataset/row";
19
+            }
20 20
 
21
-          return "/anydataset/row[" . $xpathFilter . "]";
22
-     }
21
+            return "/anydataset/row[" . $xpathFilter . "]";
22
+        }
23 23
 
24
-     /**
25
-      * @inheritDoc
26
-      */
27
-     public function getRelation($name, $relation, $value, &$param)
28
-     {
29
-          $str = is_numeric($value) ? "" : "'";
30
-          $field = "field[@name='" . $name . "'] ";
31
-          $value = " $str$value$str ";
24
+        /**
25
+         * @inheritDoc
26
+         */
27
+        public function getRelation($name, $relation, $value, &$param)
28
+        {
29
+            $str = is_numeric($value) ? "" : "'";
30
+            $field = "field[@name='" . $name . "'] ";
31
+            $value = " $str$value$str ";
32 32
 
33
-          switch ($relation) {
34
-               case Relation::EQUAL:
33
+            switch ($relation) {
34
+                case Relation::EQUAL:
35 35
                     $return = $field . "=" . $value;
36 36
                     break;
37 37
 
38
-               case Relation::GREATER_THAN:
38
+                case Relation::GREATER_THAN:
39 39
                     $return = $field . ">" . $value;
40 40
                     break;
41 41
 
42
-               case Relation::LESS_THAN:
42
+                case Relation::LESS_THAN:
43 43
                     $return = $field . "<" . $value;
44 44
                     break;
45 45
 
46
-               case Relation::GREATER_OR_EQUAL_THAN:
46
+                case Relation::GREATER_OR_EQUAL_THAN:
47 47
                     $return = $field . ">=" . $value;
48 48
                     break;
49 49
 
50
-               case Relation::LESS_OR_EQUAL_THAN:
50
+                case Relation::LESS_OR_EQUAL_THAN:
51 51
                     $return = $field . "<=" . $value;
52 52
                     break;
53 53
 
54
-               case Relation::NOT_EQUAL:
54
+                case Relation::NOT_EQUAL:
55 55
                     $return = $field . "!=" . $value;
56 56
                     break;
57 57
 
58
-               case Relation::STARTS_WITH:
58
+                case Relation::STARTS_WITH:
59 59
                     $return = " starts-with($field, $value) ";
60 60
                     break;
61 61
 
62
-               default: // Relation::CONTAINS:
62
+                default: // Relation::CONTAINS:
63 63
                     $return = " contains($field, $value) ";
64 64
                     break;
65
-          }
65
+            }
66 66
 
67
-          return $return;
68
-     }
67
+            return $return;
68
+        }
69 69
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                return "/anydataset/row";
19 19
           }
20 20
 
21
-          return "/anydataset/row[" . $xpathFilter . "]";
21
+          return "/anydataset/row[".$xpathFilter."]";
22 22
      }
23 23
 
24 24
      /**
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
      public function getRelation($name, $relation, $value, &$param)
28 28
      {
29 29
           $str = is_numeric($value) ? "" : "'";
30
-          $field = "field[@name='" . $name . "'] ";
30
+          $field = "field[@name='".$name."'] ";
31 31
           $value = " $str$value$str ";
32 32
 
33 33
           switch ($relation) {
34 34
                case Relation::EQUAL:
35
-                    $return = $field . "=" . $value;
35
+                    $return = $field."=".$value;
36 36
                     break;
37 37
 
38 38
                case Relation::GREATER_THAN:
39
-                    $return = $field . ">" . $value;
39
+                    $return = $field.">".$value;
40 40
                     break;
41 41
 
42 42
                case Relation::LESS_THAN:
43
-                    $return = $field . "<" . $value;
43
+                    $return = $field."<".$value;
44 44
                     break;
45 45
 
46 46
                case Relation::GREATER_OR_EQUAL_THAN:
47
-                    $return = $field . ">=" . $value;
47
+                    $return = $field.">=".$value;
48 48
                     break;
49 49
 
50 50
                case Relation::LESS_OR_EQUAL_THAN:
51
-                    $return = $field . "<=" . $value;
51
+                    $return = $field."<=".$value;
52 52
                     break;
53 53
 
54 54
                case Relation::NOT_EQUAL:
55
-                    $return = $field . "!=" . $value;
55
+                    $return = $field."!=".$value;
56 56
                     break;
57 57
 
58 58
                case Relation::STARTS_WITH:
Please login to merge, or discard this patch.
src/RowValidator.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -151,11 +151,11 @@
 block discarded – undo
151 151
         return $this;
152 152
     }
153 153
 
154
-     /**
155
-     * @param array|string $field
156
-     * @param string $regEx
157
-     * @return RowValidator
158
-     */
154
+        /**
155
+         * @param array|string $field
156
+         * @param string $regEx
157
+         * @return RowValidator
158
+         */
159 159
     public function regexValidation($field, $regEx)
160 160
     {
161 161
         $this->setProperty($field, self::REGEX, $regEx);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
      */
11 11
     protected $fieldValidator = [];
12 12
 
13
-    const REQUIRED="required";
14
-    const NUMBER="number";
15
-    const REGEX="regex";
16
-    const CUSTOM="custom";
13
+    const REQUIRED = "required";
14
+    const NUMBER = "number";
15
+    const REGEX = "regex";
16
+    const CUSTOM = "custom";
17 17
 
18 18
     /**
19 19
      * @param string|array $fieldList
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             if (!isset($this->fieldValidator[$field])) {
28 28
                 $this->fieldValidator[$field] = [];
29 29
             }
30
-            $this->fieldValidator[$field] = [ $property => $value ];
30
+            $this->fieldValidator[$field] = [$property => $value];
31 31
         }
32 32
     }
33 33
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $result = null;
119 119
         if (isset($properties[self::CUSTOM]) && $properties[self::CUSTOM] instanceof Closure) {
120
-            $result =  $properties[self::CUSTOM]($value);
120
+            $result = $properties[self::CUSTOM]($value);
121 121
         }
122 122
         return empty($result) ? null : $result;
123 123
     }
Please login to merge, or discard this patch.