Test Setup Failed
Pull Request — master (#2)
by
unknown
07:49
created
Category
OptionTrait.php 1 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
             $key = (strpos($prop, "on") !== 0) ? Inflector::underscore($prop) : $prop;
27 27
 
28
-            if ($value instanceof Optionable){
28
+            if ($value instanceof Optionable) {
29 29
                 $value = $value->toOptions();
30 30
             } elseif (is_array($value)) {
31 31
                 foreach ($value as $k => $v) {
Please login to merge, or discard this patch.
QueryBuilderForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         }
109 109
 
110 110
         echo $this->builder->run();
111
-        echo Html::beginForm($this->action, $this->method, ['id' =>  $this->getId(),$this->options]);
111
+        echo Html::beginForm($this->action, $this->method, ['id' =>  $this->getId(), $this->options]);
112 112
         echo Html::hiddenInput($this->rulesParam);
113 113
     }
114 114
 
Please login to merge, or discard this patch.
Translator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
         $this->_operators = [
59 59
             'equal' =>            '= ?',
60 60
             'not_equal' =>        '<> ?',
61
-            'in' =>               ['op' => 'IN (?)',     'list' => true, 'sep' => ', ' ],
61
+            'in' =>               ['op' => 'IN (?)', 'list' => true, 'sep' => ', '],
62 62
             'not_in' =>           ['op' => 'NOT IN (?)', 'list' => true, 'sep' => ', '],
63 63
             'less' =>             '< ?',
64 64
             'less_or_equal' =>    '<= ?',
65 65
             'greater' =>          '> ?',
66 66
             'greater_or_equal' => '>= ?',
67
-            'between' =>          ['op' => 'BETWEEN ?',   'list' => true, 'sep' => ' AND '],
68
-            'begins_with' =>      ['op' => 'LIKE ?',     'fn' => function($value){ return "$value%"; } ],
69
-            'not_begins_with' =>  ['op' => 'NOT LIKE ?', 'fn' => function($value){ return "$value%"; } ],
70
-            'contains' =>         ['op' => 'LIKE ?',     'fn' => function($value){ return "%$value%"; } ],
71
-            'not_contains' =>     ['op' => 'NOT LIKE ?', 'fn' => function($value){ return "%$value%"; } ],
72
-            'ends_with' =>        ['op' => 'LIKE ?',     'fn' => function($value){ return "%$value"; } ],
73
-            'not_ends_with' =>    ['op' => 'NOT LIKE ?', 'fn' => function($value){ return "%$value"; } ],
67
+            'between' =>          ['op' => 'BETWEEN ?', 'list' => true, 'sep' => ' AND '],
68
+            'begins_with' =>      ['op' => 'LIKE ?', 'fn' => function($value) { return "$value%"; }],
69
+            'not_begins_with' =>  ['op' => 'NOT LIKE ?', 'fn' => function($value) { return "$value%"; }],
70
+            'contains' =>         ['op' => 'LIKE ?', 'fn' => function($value) { return "%$value%"; }],
71
+            'not_contains' =>     ['op' => 'NOT LIKE ?', 'fn' => function($value) { return "%$value%"; }],
72
+            'ends_with' =>        ['op' => 'LIKE ?', 'fn' => function($value) { return "%$value"; }],
73
+            'not_ends_with' =>    ['op' => 'NOT LIKE ?', 'fn' => function($value) { return "%$value"; }],
74 74
             'is_empty' =>         '= ""',
75 75
             'is_not_empty' =>     '<> ""',
76 76
             'is_null' =>          'IS NULL',
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         } else {
97 97
             $op = ArrayHelper::getValue($pattern, 'op');
98 98
             $list = ArrayHelper::getValue($pattern, 'list');
99
-            if ($list){
99
+            if ($list) {
100 100
                 $sep = ArrayHelper::getValue($pattern, 'sep');
101 101
                 $replacement = implode($sep, $keys);
102 102
             } else {
Please login to merge, or discard this patch.
tests/unit/TranslatorTest.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -13,82 +13,82 @@
 block discarded – undo
13 13
         return [
14 14
             [
15 15
                 ['condition' => "and", 'rules' => [
16
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'joe'],
17
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'not_equal', 'value' => 'bruce']
16
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'joe'],
17
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'not_equal', 'value' => 'bruce']
18 18
                 ]],
19 19
                 ['(name = :p0 and name <> :p1)', [':p0' => 'joe', ':p1' => 'bruce']]
20 20
             ],
21 21
             [
22 22
                 ['condition' => "and", 'rules' => [
23
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'in', 'value' => [1,2,3]],
24
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'not_in', 'value' => [4,5]]
23
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'in', 'value' => [1, 2, 3]],
24
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'not_in', 'value' => [4, 5]]
25 25
                 ]],
26 26
                 ['(id IN (:p0, :p1, :p2) and id NOT IN (:p3, :p4))', [':p0'=>1, ':p1'=>2, ':p2'=>3, ':p3'=>4, ':p4'=>5]]
27 27
             ],
28 28
             [
29 29
                 ['condition' => "and", 'rules' => [
30
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'less', 'value' => 100],
31
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'less_or_equal', 'value' => 50],
30
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'less', 'value' => 100],
31
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'less_or_equal', 'value' => 50],
32 32
                 ]],
33 33
                 ['(id < :p0 and id <= :p1)', [':p0'=>100, ':p1'=>50]]
34 34
             ],
35 35
             [
36 36
                 ['condition' => "and", 'rules' => [
37
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'greater', 'value' => 10],
38
-                    [ 'field' => 'id', 'type' => 'integer', 'operator' => 'greater_or_equal', 'value' => 20],
37
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'greater', 'value' => 10],
38
+                    ['field' => 'id', 'type' => 'integer', 'operator' => 'greater_or_equal', 'value' => 20],
39 39
                 ]],
40 40
                 ['(id > :p0 and id >= :p1)', [':p0'=>10, ':p1'=>20]]
41 41
             ],
42 42
             [
43 43
                 ['condition' => "and", 'rules' => [
44
-                    [ 'field' => 'date', 'type' => 'date', 'operator' => 'between', 'value' => ['2015-01-01','2015-01-30']],
44
+                    ['field' => 'date', 'type' => 'date', 'operator' => 'between', 'value' => ['2015-01-01', '2015-01-30']],
45 45
                 ]],
46 46
                 ['(date BETWEEN :p0 AND :p1)', [':p0'=>'2015-01-01', ':p1'=>'2015-01-30']]
47 47
             ],
48 48
             [
49 49
                 ['condition' => "and", 'rules' => [
50
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'begins_with', 'value' => 'joe'],
51
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'not_begins_with', 'value' => 'bruce'],
50
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'begins_with', 'value' => 'joe'],
51
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'not_begins_with', 'value' => 'bruce'],
52 52
                 ]],
53 53
                 ['(name LIKE :p0 and name NOT LIKE :p1)', [':p0'=>'joe%', ':p1'=> 'bruce%']]
54 54
             ],
55 55
             [
56 56
                 ['condition' => "and", 'rules' => [
57
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'contains', 'value' => 'thomas'],
58
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'not_contains', 'value' => 'paul'],
57
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'contains', 'value' => 'thomas'],
58
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'not_contains', 'value' => 'paul'],
59 59
                 ]],
60 60
                 ['(name LIKE :p0 and name NOT LIKE :p1)', [':p0'=>'%thomas%', ':p1'=> '%paul%']]
61 61
             ],
62 62
             [
63 63
                 ['condition' => "and", 'rules' => [
64
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'ends_with', 'value' => 'brian'],
65
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'not_ends_with', 'value' => 'david'],
64
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'ends_with', 'value' => 'brian'],
65
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'not_ends_with', 'value' => 'david'],
66 66
                 ]],
67 67
                 ['(name LIKE :p0 and name NOT LIKE :p1)', [':p0'=>'%brian', ':p1'=> '%david']]
68 68
             ],
69 69
             [
70 70
                 ['condition' => "or", 'rules' => [
71
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'is_empty'],
72
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'is_not_empty'],
73
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'is_null'],
74
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'is_not_null'],
71
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'is_empty'],
72
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'is_not_empty'],
73
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'is_null'],
74
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'is_not_null'],
75 75
                 ]],
76 76
                 ['(name = "" or name <> "" or name IS NULL or name IS NOT NULL)', []]
77 77
             ],
78 78
             [
79 79
                 ['condition' => "and", 'rules' => [
80
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'begins_with', 'value' => 'kurt'],
81
-                    [ 'field' => 'name', 'type' => 'string', 'operator' => 'ends_with', 'value' => 'cobain'],
80
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'begins_with', 'value' => 'kurt'],
81
+                    ['field' => 'name', 'type' => 'string', 'operator' => 'ends_with', 'value' => 'cobain'],
82 82
                     ['condition' => 'or', 'rules'=>[
83
-                        [ 'field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'joe'],
84
-                        [ 'field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'paul'],
83
+                        ['field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'joe'],
84
+                        ['field' => 'name', 'type' => 'string', 'operator' => 'equal', 'value' => 'paul'],
85 85
                         ['condition' => 'and', 'rules'=>[
86
-                            [ 'field' => 'id', 'type' => 'integer', 'operator' => 'equal', 'value' => 10],
86
+                            ['field' => 'id', 'type' => 'integer', 'operator' => 'equal', 'value' => 10],
87 87
                         ]]
88 88
                     ]]
89 89
                 ]],
90 90
                 ['(name LIKE :p0 and name LIKE :p1 and (name = :p2 or name = :p3 or (id = :p4)))', [
91
-                    ':p0'=>'kurt%',':p1' =>'%cobain', ':p2' => 'joe', ':p3' => 'paul', ':p4' => 10
91
+                    ':p0'=>'kurt%', ':p1' =>'%cobain', ':p2' => 'joe', ':p3' => 'paul', ':p4' => 10
92 92
                 ]]
93 93
             ]
94 94
 
Please login to merge, or discard this patch.