Completed
Pull Request — master (#358)
by Nic
03:16
created
src/Form/FoxyStripePurchaseForm.php 1 patch
Spacing   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -117,12 +117,10 @@  discard block
 block discarded – undo
117 117
         $this->setSiteConfig($siteConfig);
118 118
 
119 119
         $fields = ($fields != null && $fields->exists()) ?
120
-            $this->getProductFields($fields) :
121
-            $this->getProductFields(FieldList::create());
120
+            $this->getProductFields($fields) : $this->getProductFields(FieldList::create());
122 121
 
123 122
         $actions = ($actions != null && $actions->exists()) ?
124
-            $this->getProductActions($actions) :
125
-            $this->getProductActions(FieldList::create());
123
+            $this->getProductActions($actions) : $this->getProductActions(FieldList::create());
126 124
         $validator = (!empty($validator) || $validator != null) ? $validator : RequiredFields::create();
127 125
 
128 126
         parent::__construct($controller, $name, $fields, $actions, $validator);
@@ -131,7 +129,7 @@  discard block
 block discarded – undo
131 129
         $this->setAttribute('action', FoxyCart::FormActionURL());
132 130
         $this->disableSecurityToken();
133 131
 
134
-        $this->setHTMLID($this->getTemplateHelper()->generateFormID($this) . "_{$product->ID}");
132
+        $this->setHTMLID($this->getTemplateHelper()->generateFormID($this)."_{$product->ID}");
135 133
     }
136 134
 
137 135
     /**
@@ -143,8 +141,7 @@  discard block
 block discarded – undo
143 141
     {
144 142
         //Requirements::javascript('dynamic/foxystripe: client/dist/javascript/scripts.min.js');
145 143
         $hiddenTitle = ($this->product->ReceiptTitle) ?
146
-            htmlspecialchars($this->product->ReceiptTitle) :
147
-            htmlspecialchars($this->product->Title);
144
+            htmlspecialchars($this->product->ReceiptTitle) : htmlspecialchars($this->product->Title);
148 145
         $code = $this->product->Code;
149 146
 
150 147
         if ($this->product->Available) {
@@ -172,7 +169,7 @@  discard block
 block discarded – undo
172 169
                 $code,
173 170
                 'price',
174 171
                 $this->product->Price
175
-            ))->setValue($this->product->Price));//can't override id
172
+            ))->setValue($this->product->Price)); //can't override id
176 173
             $fields->push(HiddenField::create(ProductPage::getGeneratedValue(
177 174
                 $code,
178 175
                 'weight',
@@ -207,13 +204,13 @@  discard block
 block discarded – undo
207 204
             $fields->push(HiddenField::create('quantity')->setValue(ProductPage::getGeneratedValue($this->Code,
208 205
                 'quantity', 1, 'value')));
209 206
 
210
-            $fields->push(HeaderField::create('submitPrice', '$' . $this->product->Price, 4)
207
+            $fields->push(HeaderField::create('submitPrice', '$'.$this->product->Price, 4)
211 208
                 ->addExtraClass('submit-price'));
212 209
             $fields->push(HeaderField::create('unavailableText', 'Selection unavailable', 4)
213 210
                 ->addExtraClass('hidden unavailable-text'));
214 211
 
215 212
             $this->extend('updatePurchaseFormFields', $fields);
216
-        } else {
213
+        }else {
217 214
             $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4));
218 215
         }
219 216
 
@@ -259,7 +256,7 @@  discard block
 block discarded – undo
259 256
      */
260 257
     protected function getProductOptionSet()
261 258
     {
262
-        $assignAvailable = function ($self) {
259
+        $assignAvailable = function($self) {
263 260
             /** @var OptionItem $self */
264 261
             $this->extend('updateFoxyStripePurchaseForm', $form);
265 262
             $self->Available = ($self->getAvailability()) ? true : false;
Please login to merge, or discard this patch.