Passed
Push — master ( 3be567...10f746 )
by Ferry
03:51
created
src/types/select/component.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
         <option value="">** Select a {{ $column->getLabel() }}</option>
9 9
         @if(!$column->getForeignKey())
10 10
             <?php
11
-                $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue();
11
+                $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue();
12 12
             ?>
13 13
             @foreach($column->getOptions() as $key=>$value)
14 14
                 <option {{ $columnValue==$key?'selected':'' }} value="{{ $key }}">{{ $value }}</option>
Please login to merge, or discard this patch.
src/controllers/scaffolding/traits/ColumnsRegister.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
         $data = new TextModel();
56 56
         $data = $this->setDefaultModelValue($data);
57 57
         $data->setLabel($label);
58
-        $data->setName($this->name($label,$name));
59
-        $data->setField($field_to_save?:$this->name($label, $name));
58
+        $data->setName($this->name($label, $name));
59
+        $data->setField($field_to_save ?: $this->name($label, $name));
60 60
         $data->setType("text");
61 61
 
62 62
         columnSingleton()->setColumn($this->index, $data);
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
         $data = new CheckboxModel();
72 72
         $data = $this->setDefaultModelValue($data);
73 73
         $data->setLabel($label);
74
-        $data->setName($this->name($label,$name));
75
-        $data->setField($field_to_save?:$this->name($label, $name));
74
+        $data->setName($this->name($label, $name));
75
+        $data->setField($field_to_save ?: $this->name($label, $name));
76 76
         $data->setType("checkbox");
77 77
 
78 78
         columnSingleton()->setColumn($this->index, $data);
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
         $data = new PasswordModel();
88 88
         $data = $this->setDefaultModelValue($data);
89 89
         $data->setLabel($label);
90
-        $data->setName($this->name($label,$name));
91
-        $data->setField($field_to_save?:$this->name($label, $name));
90
+        $data->setName($this->name($label, $name));
91
+        $data->setField($field_to_save ?: $this->name($label, $name));
92 92
         $data->setType("password");
93 93
         $data->setShowDetail(false);
94 94
         $data->setShowIndex(false);
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
         $data = new ImageModel();
106 106
         $data = $this->setDefaultModelValue($data);
107 107
         $data->setLabel($label);
108
-        $data->setName($this->name($label,$name));
109
-        $data->setField($field_to_save?:$this->name($label, $name));
108
+        $data->setName($this->name($label, $name));
109
+        $data->setField($field_to_save ?: $this->name($label, $name));
110 110
         $data->setType("image");
111 111
 
112 112
         columnSingleton()->setColumn($this->index, $data);
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         $data = new TextAreaModel();
122 122
         $data = $this->setDefaultModelValue($data);
123 123
         $data->setLabel($label);
124
-        $data->setName($this->name($label,$name));
125
-        $data->setField($field_to_save?:$this->name($label, $name));
124
+        $data->setName($this->name($label, $name));
125
+        $data->setField($field_to_save ?: $this->name($label, $name));
126 126
         $data->setType("text_area");
127 127
 
128 128
         columnSingleton()->setColumn($this->index, $data);
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
         $data = new SelectModel();
138 138
         $data = $this->setDefaultModelValue($data);
139 139
         $data->setLabel($label);
140
-        $data->setName($this->name($label,$name));
141
-        $data->setField($field_to_save?:$this->name($label, $name));
140
+        $data->setName($this->name($label, $name));
141
+        $data->setField($field_to_save ?: $this->name($label, $name));
142 142
         $data->setType("select");
143 143
 
144 144
         columnSingleton()->setColumn($this->index, $data);
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
         $data = new CustomModel();
155 155
         $data = $this->setDefaultModelValue($data);
156 156
         $data->setLabel($label);
157
-        $data->setName($this->name($label,$name));
158
-        $data->setField($field_to_save?:$this->name($label, $name));
157
+        $data->setName($this->name($label, $name));
158
+        $data->setField($field_to_save ?: $this->name($label, $name));
159 159
         $data->setType("custom");
160 160
 
161 161
         columnSingleton()->setColumn($this->index, $data);
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
         $data = new DateModel();
171 171
         $data = $this->setDefaultModelValue($data);
172 172
         $data->setLabel($label);
173
-        $data->setName($this->name($label,$name));
174
-        $data->setField($field_to_save?:$this->name($label, $name));
173
+        $data->setName($this->name($label, $name));
174
+        $data->setField($field_to_save ?: $this->name($label, $name));
175 175
         $data->setType("date");
176 176
 
177 177
         columnSingleton()->setColumn($this->index, $data);
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
         $data = new DatetimeModel();
187 187
         $data = $this->setDefaultModelValue($data);
188 188
         $data->setLabel($label);
189
-        $data->setName($this->name($label,$name));
190
-        $data->setField($field_to_save?:$this->name($label, $name));
189
+        $data->setName($this->name($label, $name));
190
+        $data->setField($field_to_save ?: $this->name($label, $name));
191 191
         $data->setType("datetime");
192 192
 
193 193
         columnSingleton()->setColumn($this->index, $data);
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
         $data = new EmailModel();
203 203
         $data = $this->setDefaultModelValue($data);
204 204
         $data->setLabel($label);
205
-        $data->setName($this->name($label,$name));
206
-        $data->setField($field_to_save?:$this->name($label, $name));
205
+        $data->setName($this->name($label, $name));
206
+        $data->setField($field_to_save ?: $this->name($label, $name));
207 207
         $data->setType("email");
208 208
 
209 209
         columnSingleton()->setColumn($this->index, $data);
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
         $data = new FileModel();
219 219
         $data = $this->setDefaultModelValue($data);
220 220
         $data->setLabel($label);
221
-        $data->setName($this->name($label,$name));
222
-        $data->setField($field_to_save?:$this->name($label, $name));
221
+        $data->setName($this->name($label, $name));
222
+        $data->setField($field_to_save ?: $this->name($label, $name));
223 223
         $data->setType("file");
224 224
 
225 225
         columnSingleton()->setColumn($this->index, $data);
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
         $data = new HiddenModel();
236 236
         $data = $this->setDefaultModelValue($data);
237 237
         $data->setLabel($label);
238
-        $data->setName($this->name($label,$name));
239
-        $data->setField($field_to_save?:$this->name($label, $name));
238
+        $data->setName($this->name($label, $name));
239
+        $data->setField($field_to_save ?: $this->name($label, $name));
240 240
         $data->setType("hidden");
241 241
 
242 242
         columnSingleton()->setColumn($this->index, $data);
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
         $data = new NumberModel();
252 252
         $data = $this->setDefaultModelValue($data);
253 253
         $data->setLabel($label);
254
-        $data->setName($this->name($label,$name));
255
-        $data->setField($field_to_save?:$this->name($label, $name));
254
+        $data->setName($this->name($label, $name));
255
+        $data->setField($field_to_save ?: $this->name($label, $name));
256 256
         $data->setType("number");
257 257
 
258 258
         columnSingleton()->setColumn($this->index, $data);
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
         $data = new MoneyModel();
268 268
         $data = $this->setDefaultModelValue($data);
269 269
         $data->setLabel($label);
270
-        $data->setName($this->name($label,$name));
271
-        $data->setField($field_to_save?:$this->name($label, $name));
270
+        $data->setName($this->name($label, $name));
271
+        $data->setField($field_to_save ?: $this->name($label, $name));
272 272
         $data->setType("money");
273 273
 
274 274
         columnSingleton()->setColumn($this->index, $data);
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
         $data = new RadioModel();
284 284
         $data = $this->setDefaultModelValue($data);
285 285
         $data->setLabel($label);
286
-        $data->setName($this->name($label,$name));
287
-        $data->setField($field_to_save?:$this->name($label, $name));
286
+        $data->setName($this->name($label, $name));
287
+        $data->setField($field_to_save ?: $this->name($label, $name));
288 288
         $data->setType("radio");
289 289
 
290 290
         columnSingleton()->setColumn($this->index, $data);
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         $data = new WysiwygModel();
300 300
         $data = $this->setDefaultModelValue($data);
301 301
         $data->setLabel($label);
302
-        $data->setName($this->name($label,$name));
303
-        $data->setField($field_to_save?:$this->name($label, $name));
302
+        $data->setName($this->name($label, $name));
303
+        $data->setField($field_to_save ?: $this->name($label, $name));
304 304
         $data->setType("wysiwyg");
305 305
 
306 306
         columnSingleton()->setColumn($this->index, $data);
Please login to merge, or discard this patch.
src/types/money/Hook.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@
 block discarded – undo
21 21
      */
22 22
     public function assignment($value, $column)
23 23
     {
24
-        $value = str_replace($column->getThousands()?:",","", $value);
25
-        $value = str_replace($column->getDecimal()?:".",".",$value);
24
+        $value = str_replace($column->getThousands() ?: ",", "", $value);
25
+        $value = str_replace($column->getDecimal() ?: ".", ".", $value);
26 26
         return $value;
27 27
     }
28 28
 
29 29
     public function indexRender($row, $column)
30 30
     {
31 31
         $value = $row->{$column->getField()};
32
-        $prefix = ($column->getPrefix())?:"";
33
-        return $prefix.number_format($value, $column->getPrecision()?:0, $column->getDecimal()?:".", $column->getThousands()?:",");
32
+        $prefix = ($column->getPrefix()) ?: "";
33
+        return $prefix.number_format($value, $column->getPrecision() ?: 0, $column->getDecimal() ?: ".", $column->getThousands() ?: ",");
34 34
     }
35 35
 
36 36
     public function detailRender($row, $column)
Please login to merge, or discard this patch.
src/controllers/scaffolding/singletons/ColumnSingleton.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     public function valueAssignment($data_row = null) {
43 43
         foreach ($this->getColumns() as $index=>$column) {
44 44
 
45
-            if (! $column->getName()) {
45
+            if (!$column->getName()) {
46 46
                 continue;
47 47
             }
48 48
 
49 49
             /** @var ColumnModel $column */
50
-            if($data_row) {
51
-                $value = (isset($data_row->{$column->getField()}))?$data_row->{ $column->getField() }:null;
52
-            }else{
50
+            if ($data_row) {
51
+                $value = (isset($data_row->{$column->getField()})) ? $data_row->{ $column->getField() }:null;
52
+            } else {
53 53
                 $value = request($column->getName());
54 54
 
55
-                if(!$value && $column->getDefaultValue()) {
55
+                if (!$value && $column->getDefaultValue()) {
56 56
                     $value = $column->getDefaultValue();
57 57
                 }
58 58
 
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $data = $this->columns;
70 70
         $newData = [];
71
-        foreach($data as $i=>$item) {
71
+        foreach ($data as $i=>$item) {
72 72
             /** @var ColumnModel $item */
73
-            if($item->getShowIndex()) {
73
+            if ($item->getShowIndex()) {
74 74
                 $newData[] = $item;
75 75
             }
76 76
         }
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $data = $this->columns;
83 83
         $newData = [];
84
-        foreach($data as $i=>$item) {
84
+        foreach ($data as $i=>$item) {
85 85
             /** @var ColumnModel $item */
86
-            if($item->getShowAdd() || $item->getShowEdit()) {
86
+            if ($item->getShowAdd() || $item->getShowEdit()) {
87 87
                 $newData[] = $item;
88 88
             }
89 89
         }
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $data = $this->columns;
96 96
         $newData = [];
97
-        foreach($data as $i=>$item) {
97
+        foreach ($data as $i=>$item) {
98 98
             /** @var ColumnModel $item */
99
-            if($item->getShowEdit()) {
99
+            if ($item->getShowEdit()) {
100 100
                 $newData[] = $item;
101 101
             }
102 102
         }
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $data = $this->columns;
109 109
         $newData = [];
110
-        foreach($data as $i=>$item) {
110
+        foreach ($data as $i=>$item) {
111 111
             /** @var ColumnModel $item */
112
-            if($item->getShowAdd()) {
112
+            if ($item->getShowAdd()) {
113 113
                 $newData[] = $item;
114 114
             }
115 115
         }
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $data = $this->columns;
122 122
         $newData = [];
123
-        foreach($data as $i=>$item) {
123
+        foreach ($data as $i=>$item) {
124 124
             /** @var ColumnModel $item */
125
-            if($item->getShowDetail()) {
125
+            if ($item->getShowDetail()) {
126 126
                 $newData[] = $item;
127 127
             }
128 128
         }
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
     public function getAssignmentData()
133 133
     {
134 134
         $data = [];
135
-        foreach($this->columns as $column) {
135
+        foreach ($this->columns as $column) {
136 136
             /** @var ColumnModel $column */
137 137
 
138
-            if(is_array($column->getValue())) {
139
-                foreach($column->getValue() as $key=>$val) {
138
+            if (is_array($column->getValue())) {
139
+                foreach ($column->getValue() as $key=>$val) {
140 140
                     $data[$key] = $val;
141 141
                 }
142
-            }else{
142
+            } else {
143 143
                 $data[$column->getField()] = $column->getValue();
144 144
             }
145 145
         }
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
     public function removeColumn($label_or_name)
150 150
     {
151 151
         $data = $this->getColumns();
152
-        foreach($data as $i=>$d)
152
+        foreach ($data as $i=>$d)
153 153
         {
154 154
             /** @var ColumnModel $d */
155
-            if($d->getLabel() == $label_or_name || $d->getName() == $label_or_name) {
155
+            if ($d->getLabel() == $label_or_name || $d->getName() == $label_or_name) {
156 156
                 unset($data[$i]);
157 157
             }
158 158
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     public function getColumnNameOnly()
163 163
     {
164 164
         $result = [];
165
-        foreach($this->columns as $column) {
165
+        foreach ($this->columns as $column) {
166 166
             /** @var ColumnModel $column */
167 167
             $result[] = $column->getName();
168 168
         }
Please login to merge, or discard this patch.
src/controllers/scaffolding/traits/ColumnsBasic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     private function name($label, $name = null)
20 20
     {
21
-        return (!$name)?strtolower(slug($label,"_")):$name;
21
+        return (!$name) ?strtolower(slug($label, "_")) : $name;
22 22
     }
23 23
 
24 24
     /**
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         $model->setShowAdd(true);
40 40
         $model->setShowEdit(true);
41 41
         $model->setShowDetail(true);
42
-        $model->setIndexDisplayTransform(function ($value, $row) { return $value; });
43
-        $model->setDetailDisplayTransform(function ($value, $row) { return $value; });
42
+        $model->setIndexDisplayTransform(function($value, $row) { return $value; });
43
+        $model->setDetailDisplayTransform(function($value, $row) { return $value; });
44 44
         return $model;
45 45
     }
46 46
 
Please login to merge, or discard this patch.
src/types/TypesHook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
 
27 27
     public function indexRender($row, $column)
28 28
     {
29
-        return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null;
29
+        return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null;
30 30
     }
31 31
 
32 32
     public function detailRender($row, $column)
33 33
     {
34
-        return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null;
34
+        return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null;
35 35
     }
36 36
 
37 37
     /**
Please login to merge, or discard this patch.
src/types/select/Select.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function optionsFromTable($table, $key_field, $display_field, $SQLCondition = null) {
43 43
         $data = DB::table($table);
44
-        if($SQLCondition && is_callable($SQLCondition)) {
44
+        if ($SQLCondition && is_callable($SQLCondition)) {
45 45
             $data = call_user_func($SQLCondition, $data);
46 46
         }elseif ($SQLCondition && is_string($SQLCondition)) {
47 47
             $data->whereRaw($SQLCondition);
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
         $data = $data->get();
50 50
         $options = [];
51 51
         foreach ($data as $d) {
52
-            $options[ $d->$key_field ] = $d->$display_field;
52
+            $options[$d->$key_field] = $d->$display_field;
53 53
         }
54 54
         $data = columnSingleton()->getColumn($this->index);
55 55
         /** @var $data SelectModel */
56
-        $data->setOptionsFromTable(["table"=>$table,"key_field"=>$key_field,"display_field"=>$display_field,"sql_condition"=>$SQLCondition]);
56
+        $data->setOptionsFromTable(["table"=>$table, "key_field"=>$key_field, "display_field"=>$display_field, "sql_condition"=>$SQLCondition]);
57 57
         columnSingleton()->setColumn($this->index, $data);
58 58
 
59 59
         $this->options($options);
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
         columnSingleton()->setColumn($this->index, $data);
70 70
 
71 71
         $result = call_user_func($query);
72
-        if($result) {
72
+        if ($result) {
73 73
             $options = [];
74
-            foreach($result as $r) {
75
-                $options[ $r->key ] = $r->label;
74
+            foreach ($result as $r) {
75
+                $options[$r->key] = $r->label;
76 76
             }
77 77
             $this->options($options);
78 78
         }
Please login to merge, or discard this patch.
src/types/image/ImageController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 block discarded – undo
14 14
 {
15 15
     public function postUploadImage()
16 16
     {
17
-        if(auth()->guest()) return redirect(cb()->getLoginUrl());
17
+        if (auth()->guest()) return redirect(cb()->getLoginUrl());
18 18
 
19 19
         $file = null;
20 20
         try {
21 21
 
22 22
             cb()->validation([
23
-                'userfile' => 'required|mimes:' . implode(",",config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED'))
23
+                'userfile' => 'required|mimes:'.implode(",", config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED'))
24 24
             ]);
25 25
 
26
-            $file = cb()->uploadFile('userfile', request("encrypt")?true:false, request("resize_width"), request("resize_height"));
26
+            $file = cb()->uploadFile('userfile', request("encrypt") ?true:false, request("resize_width"), request("resize_height"));
27 27
 
28 28
         } catch (CBValidationException $e) {
29
-            return response()->json(['status'=>false,'message'=>$e->getMessage()]);
29
+            return response()->json(['status'=>false, 'message'=>$e->getMessage()]);
30 30
         } catch (\Exception $e) {
31
-            return response()->json(['status'=>false,'message'=>$e->getMessage()]);
31
+            return response()->json(['status'=>false, 'message'=>$e->getMessage()]);
32 32
         }
33 33
 
34 34
         return response()->json([
Please login to merge, or discard this patch.
src/controllers/AdminAuthController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
     public function getLogin()
10 10
     {
11
-        if(!auth()->guest()) return redirect(cb()->getAdminUrl());
11
+        if (!auth()->guest()) return redirect(cb()->getAdminUrl());
12 12
 
13 13
         cbHook()->hookGetLogin();
14 14
 
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 
18 18
     public function postLogin()
19 19
     {
20
-        try{
20
+        try {
21 21
             cb()->validation([
22 22
                 'email'=>'required|email',
23 23
                 'password'=>'required'
24 24
             ]);
25
-            $credential = request()->only(['email','password']);
25
+            $credential = request()->only(['email', 'password']);
26 26
             if (auth()->attempt($credential)) {
27 27
                 cbHook()->hookPostLogin();
28 28
                 return redirect(cb()->getAdminUrl());
29 29
             } else {
30
-                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']);
30
+                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'), 'message_type'=>'warning']);
31 31
             }
32
-        }catch (CBValidationException $e) {
33
-            return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
32
+        } catch (CBValidationException $e) {
33
+            return cb()->redirect(cb()->getAdminUrl("login"), $e->getMessage(), 'warning');
34 34
         }
35 35
     }
36 36
 
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     public function postLoginDeveloper() {
48
-        try{
48
+        try {
49 49
             cb()->validation([
50 50
                 'username'=>'required',
51 51
                 'password'=>'required'
52 52
             ]);
53 53
 
54
-            if(request('username') == config('crudbooster.DEV_USERNAME')
54
+            if (request('username') == config('crudbooster.DEV_USERNAME')
55 55
                 && request('password') == Cache::get("developer_password")) {
56 56
 
57 57
                 session(['developer'=>1]);
58 58
 
59 59
                 return redirect(cb()->getDeveloperUrl());
60 60
 
61
-            }else{
61
+            } else {
62 62
                 return cb()->redirectBack("Username and or password is wrong!");
63 63
             }
64 64
 
65
-        }catch (CBValidationException $e) {
66
-            return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
65
+        } catch (CBValidationException $e) {
66
+            return cb()->redirect(cb()->getLoginUrl(), $e->getMessage(), 'warning');
67 67
         }
68 68
     }
69 69
 
Please login to merge, or discard this patch.