Passed
Push — master ( f60792...941b97 )
by Mauro
04:33
created
src/Filters/SortingFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     private static function sort($results, $sortingArray)
45 45
     {
46
-        usort($results, function ($first, $second) use ($sortingArray) {
46
+        usort($results, function($first, $second) use ($sortingArray) {
47 47
             $valueA = self::getArrayElementValueFromKey($sortingArray['key'], $first);
48 48
             $valueB = self::getArrayElementValueFromKey($sortingArray['key'], $second);
49 49
 
Please login to merge, or discard this patch.
src/QueryBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function removeElement($key)
110 110
     {
111
-        if(!isset($this->array[$key])){
111
+        if (!isset($this->array[$key])) {
112 112
             throw new NotExistingElementException(sprintf('Element with key %s does not exists.', $key));
113 113
         }
114 114
 
@@ -323,12 +323,12 @@  discard block
 block discarded – undo
323 323
 
324 324
         foreach ($this->criteria as $criterion) {
325 325
             $results = array_filter(
326
-                (isset($results)) ? $results : $array, function ($element) use ($criterion) {
326
+                (isset($results)) ? $results : $array, function($element) use ($criterion) {
327 327
                     return CriterionFilter::filter($criterion, $element);
328 328
                 }
329 329
             );
330 330
 
331
-            $results = array_map(function ($result) use ($criterion) {
331
+            $results = array_map(function($result) use ($criterion) {
332 332
                 $key = explode(Constants::ALIAS_DELIMITER, $criterion['key']);
333 333
                 if (count($key) > 1) {
334 334
                     $oldkey = explode(Constants::ARRAY_SEPARATOR, $key[0]);
Please login to merge, or discard this patch.
src/Filters/AbstractFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      */
38 38
     private static function getValueFromKeysArray($keysArray, $arrayElement)
39 39
     {
40
-        if (count($keysArray)>1) {
40
+        if (count($keysArray) > 1) {
41 41
             $key = array_shift($keysArray);
42 42
 
43 43
             return self::getValueFromKeysArray($keysArray, ArrayHelper::convertToPlainArray($arrayElement[$key]));
Please login to merge, or discard this patch.
src/Helpers/ConsistencyChecker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
             return false;
36 36
         }
37 37
 
38
-        if(false === ArrayHelper::compareElementToItemKeyMap($firstItem, $element)) {
38
+        if (false === ArrayHelper::compareElementToItemKeyMap($firstItem, $element)) {
39 39
             return false;
40 40
         }
41 41
 
Please login to merge, or discard this patch.
src/Helpers/ArrayHelper.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public static function compareElementToItemKeyMap($itemToCompare, $element)
35 35
     {
36
-        foreach ($itemToCompare as $key => $item){
37
-            if(is_array($item) && ArrayHelper::isAnAssociativeArray($item)){
36
+        foreach ($itemToCompare as $key => $item) {
37
+            if (is_array($item) && ArrayHelper::isAnAssociativeArray($item)) {
38 38
                 if (false === ArrayHelper::checkIfTwoArraysAreConsistent(array_keys($item), array_keys($element[$key]))) {
39 39
                     return false;
40 40
                 }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         array_shift($key);
92 92
         $value = $array[$key[0]];
93 93
 
94
-        if(is_array($value)){
94
+        if (is_array($value)) {
95 95
             return self::getValueFromNestedArray($key, $value);
96 96
         }
97 97
 
@@ -106,6 +106,6 @@  discard block
 block discarded – undo
106 106
     {
107 107
         if ([] === $array) return false;
108 108
 
109
-        return array_keys($array) !== range(0, count($array) - 1);
109
+        return array_keys($array) !== range(0, count($array)-1);
110 110
     }
111 111
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,9 @@
 block discarded – undo
104 104
      */
105 105
     public static function isAnAssociativeArray(array $array)
106 106
     {
107
-        if ([] === $array) return false;
107
+        if ([] === $array) {
108
+            return false;
109
+        }
108 110
 
109 111
         return array_keys($array) !== range(0, count($array) - 1);
110 112
     }
Please login to merge, or discard this patch.