Passed
Push — master ( ee4ff9...cdd471 )
by Jean
03:27
created
src/Filterer/FiltererInterface.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      * @param LogicalFilter $filter
17 17
      * @param Iterable      $data_to_filter
18 18
      */
19
-    public function apply( LogicalFilter $filter, $tree_to_filter, $options=[] );
19
+    public function apply(LogicalFilter $filter, $tree_to_filter, $options = []);
20 20
 
21 21
     public function validateRule($field, $operator, $value, $row, array $path, $all_operands, $options);
22 22
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 {
15 15
     /**
16 16
      * @param LogicalFilter $filter
17
-     * @param Iterable      $data_to_filter
17
+     * @param Iterable      $tree_to_filter
18 18
      */
19 19
     public function apply( LogicalFilter $filter, $tree_to_filter, $options=[] );
20 20
 
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @author  Jean Claveau
7 7
  */
8 8
 namespace JClaveau\LogicalFilter\Filterer;
9
-use       JClaveau\LogicalFilter\LogicalFilter;
9
+use JClaveau\LogicalFilter\LogicalFilter;
10 10
 
11 11
 /**
12 12
  */
Please login to merge, or discard this patch.
src/Filterer/CustomizableFilterer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     /**
18 18
      */
19
-    public function __construct( callable $rule_validator )
19
+    public function __construct(callable $rule_validator)
20 20
     {
21 21
         $this->rule_validator = $rule_validator;
22 22
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function validateRule($field, $operator, $value, $row, array $path, $all_operands, $options)
27 27
     {
28
-        return call_user_func_array( $this->rule_validator, get_defined_vars() );
28
+        return call_user_func_array($this->rule_validator, get_defined_vars());
29 29
     }
30 30
 
31 31
     /**/
Please login to merge, or discard this patch.
src/Converter/ConverterInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     /**
35 35
      * @param LogicalFilter $filter
36 36
      */
37
-    public function convert( LogicalFilter $filter );
37
+    public function convert(LogicalFilter $filter);
38 38
 
39 39
     /**/
40 40
 }
Please login to merge, or discard this patch.
src/Converter/CustomizableMinimalConverter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function onOpenOr()
32 32
     {
33
-        call_user_func( $this->callbacks[ __FUNCTION__ ] );
33
+        call_user_func($this->callbacks[__FUNCTION__]);
34 34
     }
35 35
 
36 36
     /**
37 37
      */
38 38
     public function onCloseOr()
39 39
     {
40
-        call_user_func( $this->callbacks[ __FUNCTION__ ] );
40
+        call_user_func($this->callbacks[__FUNCTION__]);
41 41
     }
42 42
 
43 43
     /**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function onAndPossibility($field, $operator, $operand, array $allOperandsByField)
48 48
     {
49 49
         call_user_func(
50
-            $this->callbacks[ __FUNCTION__ ],
50
+            $this->callbacks[__FUNCTION__],
51 51
             $field,
52 52
             $operator,
53 53
             $operand,
Please login to merge, or discard this patch.
src/Rule/BetweenOrEqualBothRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
 
15 15
     /**
16 16
      */
17
-    public function __construct( $field, array $limits )
17
+    public function __construct($field, array $limits)
18 18
     {
19
-        $this->addOperand( new AboveOrEqualRule($field, $limits[0]) );
20
-        $this->addOperand( new BelowOrEqualRule($field, $limits[1]) );
19
+        $this->addOperand(new AboveOrEqualRule($field, $limits[0]));
20
+        $this->addOperand(new BelowOrEqualRule($field, $limits[1]));
21 21
     }
22 22
 
23 23
     /**
Please login to merge, or discard this patch.
src/Rule/Trait_RuleWithOptions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     /**
31 31
      */
32
-    public function getOption($name, array $contextual_options=[])
32
+    public function getOption($name, array $contextual_options = [])
33 33
     {
34 34
         $options = $this->getOptions($contextual_options);
35 35
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     /**
40 40
      * @param $contextual_options
41 41
      */
42
-    public function getOptions(array $contextual_options=[])
42
+    public function getOptions(array $contextual_options = [])
43 43
     {
44 44
         $default_options = LogicalFilter::getDefaultOptions();
45 45
 
Please login to merge, or discard this patch.
src/Rule/EqualRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @param string $field The field to apply the rule on.
17 17
      * @param array  $value The value the field can equal to.
18 18
      */
19
-    public function __construct( $field, $value )
19
+    public function __construct($field, $value)
20 20
     {
21 21
         $this->field = $field;
22 22
         $this->value = $value;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      *
43 43
      * @return bool
44 44
      */
45
-    public function hasSolution(array $contextual_options=[])
45
+    public function hasSolution(array $contextual_options = [])
46 46
     {
47 47
         return true;
48 48
     }
Please login to merge, or discard this patch.
src/Rule/Trait_RuleWithField.php 3 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,13 +50,11 @@
 block discarded – undo
50 50
     {
51 51
         if (is_callable($renamings)) {
52 52
             $this->setField( call_user_func($renamings, $this->field) );
53
-        }
54
-        elseif (is_array($renamings)) {
53
+        } elseif (is_array($renamings)) {
55 54
             if (isset($renamings[$this->field])) {
56 55
                 $this->setField( $renamings[$this->field] );
57 56
             }
58
-        }
59
-        else {
57
+        } else {
60 58
             throw new \InvalidArgumentException(
61 59
                 "\$renamings MUST be a callable or an associative array "
62 60
                 ."instead of: " . var_export($renamings, true)
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
     /**
24 24
      * @return string $field
25 25
      */
26
-    final public function setField( $field )
26
+    final public function setField($field)
27 27
     {
28
-        if ( ! is_scalar($field)) {
28
+        if (!is_scalar($field)) {
29 29
             throw new \InvalidArgumentEXception(
30 30
                 "\$field property of a logical rule must be a scalar contrary to: "
31 31
                 .var_export($field, true)
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
     final public function renameField($renamings)
50 50
     {
51 51
         if (is_callable($renamings)) {
52
-            $this->setField( call_user_func($renamings, $this->field) );
52
+            $this->setField(call_user_func($renamings, $this->field));
53 53
         }
54 54
         elseif (is_array($renamings)) {
55 55
             if (isset($renamings[$this->field])) {
56
-                $this->setField( $renamings[$this->field] );
56
+                $this->setField($renamings[$this->field]);
57 57
             }
58 58
         }
59 59
         else {
60 60
             throw new \InvalidArgumentException(
61 61
                 "\$renamings MUST be a callable or an associative array "
62
-                ."instead of: " . var_export($renamings, true)
62
+                ."instead of: ".var_export($renamings, true)
63 63
             );
64 64
         }
65 65
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     }
22 22
 
23 23
     /**
24
-     * @return string $field
24
+     * @return Trait_RuleWithField $field
25 25
      */
26 26
     final public function setField( $field )
27 27
     {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param  array|callable Associative array of renamings or callable
45 45
      *                        that would rename the fields.
46 46
      *
47
-     * @return AbstractAtomicRule $this
47
+     * @return Trait_RuleWithField $this
48 48
      */
49 49
     final public function renameField($renamings)
50 50
     {
Please login to merge, or discard this patch.
src/Rule/BetweenOrEqualLowerRule.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
             // So if the two limits are equal we only consider the equality
22 22
             $this->addOperand( new EqualRule($field, $limits[0]) );
23 23
             $this->addOperand( new EqualRule($field, $limits[0]) );
24
-        }
25
-        else {
24
+        } else {
26 25
             $this->addOperand( new AboveOrEqualRule($field, $limits[0]) );
27 26
             $this->addOperand( new BelowRule($field, $limits[1]) );
28 27
         }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
 
15 15
     /**
16 16
      */
17
-    public function __construct( $field, array $limits )
17
+    public function __construct($field, array $limits)
18 18
     {
19 19
         if ($limits[0] == $limits[1]) {
20 20
             // (A = 1 || A > 1) && A < 1 <=> no sens
21 21
             // So if the two limits are equal we only consider the equality
22
-            $this->addOperand( new EqualRule($field, $limits[0]) );
23
-            $this->addOperand( new EqualRule($field, $limits[0]) );
22
+            $this->addOperand(new EqualRule($field, $limits[0]));
23
+            $this->addOperand(new EqualRule($field, $limits[0]));
24 24
         }
25 25
         else {
26
-            $this->addOperand( new AboveOrEqualRule($field, $limits[0]) );
27
-            $this->addOperand( new BelowRule($field, $limits[1]) );
26
+            $this->addOperand(new AboveOrEqualRule($field, $limits[0]));
27
+            $this->addOperand(new BelowRule($field, $limits[1]));
28 28
         }
29 29
     }
30 30
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getMaximum()
47 47
     {
48
-        if ( ! $this->getOperandAt(1)) {
48
+        if (!$this->getOperandAt(1)) {
49 49
             return $this->getOperandAt(0)->getValue();
50 50
         }
51 51
 
Please login to merge, or discard this patch.