Test Setup Failed
Branch master (ebc440)
by Anton
02:29
created
BraintreeForm.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace tuyakhov\braintree;
3 3
 
4
-use yii\base\InvalidCallException;
5 4
 use yii\base\Model;
6
-use yii\base\ModelEvent;
7 5
 
8 6
 class BraintreeForm extends Model
9 7
 {
Please login to merge, or discard this patch.
Braintree.php 1 patch
Braces   +19 added lines, -10 removed lines patch added patch discarded remove patch
@@ -132,10 +132,18 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $this->options['creditCard'] = [];
134 134
         $this->options['creditCard']['number'] = $number;
135
-        if (isset($cvv)) $this->options['creditCard']['cvv'] = $cvv;
136
-        if (isset($expirationMonth)) $this->options['creditCard']['expirationMonth'] = $expirationMonth;
137
-        if (isset($expirationYear)) $this->options['creditCard']['expirationYear'] = $expirationYear;
138
-        if (isset($expirationDate)) $this->options['creditCard']['expirationDate'] = $expirationDate;
135
+        if (isset($cvv)) {
136
+            $this->options['creditCard']['cvv'] = $cvv;
137
+        }
138
+        if (isset($expirationMonth)) {
139
+            $this->options['creditCard']['expirationMonth'] = $expirationMonth;
140
+        }
141
+        if (isset($expirationYear)) {
142
+            $this->options['creditCard']['expirationYear'] = $expirationYear;
143
+        }
144
+        if (isset($expirationDate)) {
145
+            $this->options['creditCard']['expirationDate'] = $expirationDate;
146
+        }
139 147
     }
140 148
 
141 149
     public function getCreditCard($input_values)
@@ -155,12 +163,13 @@  discard block
 block discarded – undo
155 163
     {
156 164
         if (!empty($values)) {
157 165
             foreach ($values as $key => $value) {
158
-                if ($key == 'amount')
159
-                    $this->setAmount($values['amount']);
160
-                elseif ($key == 'creditCard')
161
-                    $this->getCreditCard($values['creditCard']);
162
-                else
163
-                    $this->options[$key] = $value;
166
+                if ($key == 'amount') {
167
+                                    $this->setAmount($values['amount']);
168
+                } elseif ($key == 'creditCard') {
169
+                                    $this->getCreditCard($values['creditCard']);
170
+                } else {
171
+                                    $this->options[$key] = $value;
172
+                }
164 173
             }
165 174
         }
166 175
     }
Please login to merge, or discard this patch.
ActiveField.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @author Anton Tuyakhov <[email protected]>
4
- */
3
+     * @author Anton Tuyakhov <[email protected]>
4
+     */
5 5
 
6 6
 namespace tuyakhov\braintree;
7 7
 
Please login to merge, or discard this patch.