Passed
Push — feature/post-pay ( 7e10da...50af39 )
by Remco
04:31
created
src/Category.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
 	 * @param string $type Pronamic payment line type.
41 41
 	 * @return string
42 42
 	 */
43
-	public static function transform( $type ) {
44
-		switch ( $type ) {
43
+	public static function transform($type) {
44
+		switch ($type) {
45 45
 			case PaymentLineType::DIGITAL:
46 46
 				return self::DIGITAL;
47 47
 			case PaymentLineType::DISCOUNT:
Please login to merge, or discard this patch.
src/OrderItems.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @param array $items Order items.
32 32
 	 */
33
-	public function __construct( $items = null ) {
34
-		if ( is_array( $items ) ) {
35
-			foreach ( $items as $item ) {
36
-				$this->add_item( $item );
33
+	public function __construct($items = null) {
34
+		if (is_array($items)) {
35
+			foreach ($items as $item) {
36
+				$this->add_item($item);
37 37
 			}
38 38
 		}
39 39
 	}
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	 * @param string $category Category.
48 48
 	 * @return OrderItem
49 49
 	 */
50
-	public function new_item( $name, $quantity, Money $amount, $category ) {
51
-		$item = new OrderItem( $name, $quantity, $amount, $category );
50
+	public function new_item($name, $quantity, Money $amount, $category) {
51
+		$item = new OrderItem($name, $quantity, $amount, $category);
52 52
 
53
-		$this->add_item( $item );
53
+		$this->add_item($item);
54 54
 
55 55
 		return $item;
56 56
 	}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @param OrderItem $item Order item.
62 62
 	 */
63
-	public function add_item( OrderItem $item ) {
63
+	public function add_item(OrderItem $item) {
64 64
 		$this->order_items[] = $item;
65 65
 	}
66 66
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function get_json() {
82 82
 		$data = array_map(
83
-			function( $item ) {
83
+			function($item) {
84 84
 				return $item->get_json();
85 85
 			},
86 86
 			$this->get_order_items()
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	 * @param array $fields Fields.
96 96
 	 * @return array
97 97
 	 */
98
-	public function get_signature_fields( $fields = array() ) {
99
-		foreach ( $this->get_order_items() as $item ) {
100
-			$fields = $item->get_signature_fields( $fields );
98
+	public function get_signature_fields($fields = array()) {
99
+		foreach ($this->get_order_items() as $item) {
100
+			$fields = $item->get_signature_fields($fields);
101 101
 		}
102 102
 
103 103
 		return $fields;
Please login to merge, or discard this patch.
src/Order.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
 	 * @param Money  $amount               Amount.
155 155
 	 * @param string $merchant_return_url  Merchant return URL.
156 156
 	 */
157
-	public function __construct( $merchant_order_id, $amount, $merchant_return_url ) {
158
-		$this->set_timestamp( new DateTime() );
159
-		$this->set_merchant_order_id( $merchant_order_id );
160
-		$this->set_amount( $amount );
161
-		$this->set_merchant_return_url( $merchant_return_url );
157
+	public function __construct($merchant_order_id, $amount, $merchant_return_url) {
158
+		$this->set_timestamp(new DateTime());
159
+		$this->set_merchant_order_id($merchant_order_id);
160
+		$this->set_amount($amount);
161
+		$this->set_merchant_return_url($merchant_return_url);
162 162
 	}
163 163
 
164 164
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @param DateTime $timestamp Timestamp.
168 168
 	 */
169
-	public function set_timestamp( DateTime $timestamp ) {
169
+	public function set_timestamp(DateTime $timestamp) {
170 170
 		$this->timestamp = $timestamp;
171 171
 	}
172 172
 
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 	 * @param string $merchant_order_id Merchant order ID.
177 177
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..max 10`.
178 178
 	 */
179
-	public function set_merchant_order_id( $merchant_order_id ) {
180
-		DataHelper::validate_an( $merchant_order_id, 10 );
179
+	public function set_merchant_order_id($merchant_order_id) {
180
+		DataHelper::validate_an($merchant_order_id, 10);
181 181
 
182 182
 		$this->merchant_order_id = $merchant_order_id;
183 183
 	}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 *
188 188
 	 * @param Money $amount Amount.
189 189
 	 */
190
-	public function set_amount( Money $amount ) {
190
+	public function set_amount(Money $amount) {
191 191
 		$this->amount = $amount;
192 192
 	}
193 193
 
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 	 * @param string $url Merchant return URL.
200 200
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..max 1024`.
201 201
 	 */
202
-	public function set_merchant_return_url( $url ) {
203
-		DataHelper::validate_an( $url, 1024 );
202
+	public function set_merchant_return_url($url) {
203
+		DataHelper::validate_an($url, 1024);
204 204
 
205 205
 		$this->merchant_return_url = $url;
206 206
 	}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 * @param string|null $description Description.
212 212
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..max 35`.
213 213
 	 */
214
-	public function set_description( $description ) {
214
+	public function set_description($description) {
215 215
 		$this->description = $description;
216 216
 	}
217 217
 
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 * @param string|null $language Language.
222 222
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..2`.
223 223
 	 */
224
-	public function set_language( $language ) {
225
-		DataHelper::validate_null_or_an( $language, 2 );
224
+	public function set_language($language) {
225
+		DataHelper::validate_null_or_an($language, 2);
226 226
 
227 227
 		$this->language = $language;
228 228
 	}
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 	 * @param string|null $payment_brand Payment brand.
234 234
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..50`.
235 235
 	 */
236
-	public function set_payment_brand( $payment_brand ) {
237
-		DataHelper::validate_null_or_an( $payment_brand, 50 );
236
+	public function set_payment_brand($payment_brand) {
237
+		DataHelper::validate_null_or_an($payment_brand, 50);
238 238
 
239 239
 		$this->payment_brand = $payment_brand;
240 240
 	}
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 	 * @param string|null $payment_brand_force Payment brand force.
246 246
 	 * @throws InvalidArgumentException Throws invalid argument exception when value does not apply to format `AN..50`.
247 247
 	 */
248
-	public function set_payment_brand_force( $payment_brand_force ) {
249
-		DataHelper::validate_null_or_an( $payment_brand_force, 50 );
248
+	public function set_payment_brand_force($payment_brand_force) {
249
+		DataHelper::validate_null_or_an($payment_brand_force, 50);
250 250
 
251 251
 		$this->payment_brand_force = $payment_brand_force;
252 252
 	}
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 *
268 268
 	 * @param OrderItems|null $order_items Order items.
269 269
 	 */
270
-	public function set_order_items( OrderItems $order_items = null ) {
270
+	public function set_order_items(OrderItems $order_items = null) {
271 271
 		$this->order_items = $order_items;
272 272
 	}
273 273
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 *
277 277
 	 * @param Address|null $shipping_detail Shipping address details.
278 278
 	 */
279
-	public function set_shipping_detail( Address $shipping_detail = null ) {
279
+	public function set_shipping_detail(Address $shipping_detail = null) {
280 280
 		$this->shipping_detail = $shipping_detail;
281 281
 	}
282 282
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 *
286 286
 	 * @param Address|null $billing_detail Billing address details.
287 287
 	 */
288
-	public function set_billing_detail( Address $billing_detail = null ) {
288
+	public function set_billing_detail(Address $billing_detail = null) {
289 289
 		$this->billing_detail = $billing_detail;
290 290
 	}
291 291
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 *
295 295
 	 * @param CustomerInformation $customer_information Customer information.
296 296
 	 */
297
-	public function set_customer_information( CustomerInformation $customer_information ) {
297
+	public function set_customer_information(CustomerInformation $customer_information) {
298 298
 		$this->customer_information = $customer_information;
299 299
 	}
300 300
 
@@ -306,42 +306,42 @@  discard block
 block discarded – undo
306 306
 	public function get_json() {
307 307
 		$object = (object) array();
308 308
 
309
-		$object->timestamp       = $this->timestamp->format( DATE_ATOM );
309
+		$object->timestamp       = $this->timestamp->format(DATE_ATOM);
310 310
 		$object->merchantOrderId = $this->merchant_order_id;
311 311
 
312
-		if ( null !== $this->description ) {
312
+		if (null !== $this->description) {
313 313
 			$object->description = $this->description;
314 314
 		}
315 315
 
316
-		if ( null !== $this->order_items ) {
316
+		if (null !== $this->order_items) {
317 317
 			$object->orderItems = $this->order_items->get_json();
318 318
 		}
319 319
 
320 320
 		$object->amount = $this->amount->get_json();
321 321
 
322
-		if ( null !== $this->shipping_detail ) {
322
+		if (null !== $this->shipping_detail) {
323 323
 			$object->shippingDetail = $this->shipping_detail->get_json();
324 324
 		}
325 325
 
326
-		if ( null !== $this->billing_detail ) {
326
+		if (null !== $this->billing_detail) {
327 327
 			$object->billingDetail = $this->billing_detail->get_json();
328 328
 		}
329 329
 
330
-		if ( null !== $this->customer_information ) {
330
+		if (null !== $this->customer_information) {
331 331
 			$object->customerInformation = $this->customer_information->get_json();
332 332
 		}
333 333
 
334
-		if ( null !== $this->language ) {
334
+		if (null !== $this->language) {
335 335
 			$object->language = $this->language;
336 336
 		}
337 337
 
338 338
 		$object->merchantReturnURL = $this->merchant_return_url;
339 339
 
340
-		if ( null !== $this->payment_brand ) {
340
+		if (null !== $this->payment_brand) {
341 341
 			$object->paymentBrand = $this->payment_brand;
342 342
 		}
343 343
 
344
-		if ( null !== $this->payment_brand_force ) {
344
+		if (null !== $this->payment_brand_force) {
345 345
 			$object->paymentBrandForce = $this->payment_brand_force;
346 346
 		}
347 347
 
@@ -354,38 +354,38 @@  discard block
 block discarded – undo
354 354
 	 * @param array $fields Fields.
355 355
 	 * @return array
356 356
 	 */
357
-	public function get_signature_fields( $fields = array() ) {
358
-		$fields[] = $this->timestamp->format( DATE_ATOM );
357
+	public function get_signature_fields($fields = array()) {
358
+		$fields[] = $this->timestamp->format(DATE_ATOM);
359 359
 		$fields[] = $this->merchant_order_id;
360 360
 
361
-		$fields = $this->amount->get_signature_fields( $fields );
361
+		$fields = $this->amount->get_signature_fields($fields);
362 362
 
363 363
 		$fields[] = $this->language;
364 364
 		$fields[] = $this->description;
365 365
 		$fields[] = $this->merchant_return_url;
366 366
 
367
-		if ( null !== $this->order_items ) {
368
-			$fields = $this->order_items->get_signature_fields( $fields );
367
+		if (null !== $this->order_items) {
368
+			$fields = $this->order_items->get_signature_fields($fields);
369 369
 		}
370 370
 
371
-		if ( null !== $this->shipping_detail ) {
372
-			$fields = $this->shipping_detail->get_signature_fields( $fields );
371
+		if (null !== $this->shipping_detail) {
372
+			$fields = $this->shipping_detail->get_signature_fields($fields);
373 373
 		}
374 374
 
375
-		if ( null !== $this->payment_brand ) {
375
+		if (null !== $this->payment_brand) {
376 376
 			$fields[] = $this->payment_brand;
377 377
 		}
378 378
 
379
-		if ( null !== $this->payment_brand_force ) {
379
+		if (null !== $this->payment_brand_force) {
380 380
 			$fields[] = $this->payment_brand_force;
381 381
 		}
382 382
 
383
-		if ( null !== $this->customer_information ) {
384
-			$fields = $this->customer_information->get_signature_fields( $fields );
383
+		if (null !== $this->customer_information) {
384
+			$fields = $this->customer_information->get_signature_fields($fields);
385 385
 		}
386 386
 
387
-		if ( null !== $this->billing_detail ) {
388
-			$fields = $this->billing_detail->get_signature_fields( $fields );
387
+		if (null !== $this->billing_detail) {
388
+			$fields = $this->billing_detail->get_signature_fields($fields);
389 389
 		}
390 390
 
391 391
 		return $fields;
Please login to merge, or discard this patch.
src/Money.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param string $currency Authentication.
45 45
 	 * @param int    $amount   Amount in cents.
46 46
 	 */
47
-	public function __construct( $currency, $amount ) {
47
+	public function __construct($currency, $amount) {
48 48
 		$this->currency = $currency;
49 49
 		$this->amount   = $amount;
50 50
 	}
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 	 * @return Money
87 87
 	 * @throws InvalidArgumentException Throws invalid argument exception when object does not contains the required properties.
88 88
 	 */
89
-	public static function from_object( stdClass $object ) {
90
-		if ( ! isset( $object->currency ) ) {
91
-			throw new InvalidArgumentException( 'Object must contain `currency` property.' );
89
+	public static function from_object(stdClass $object) {
90
+		if ( ! isset($object->currency)) {
91
+			throw new InvalidArgumentException('Object must contain `currency` property.');
92 92
 		}
93 93
 
94
-		if ( ! isset( $object->amount ) ) {
95
-			throw new InvalidArgumentException( 'Object must contain `amount` property.' );
94
+		if ( ! isset($object->amount)) {
95
+			throw new InvalidArgumentException('Object must contain `amount` property.');
96 96
 		}
97 97
 
98 98
 		return new self(
@@ -108,20 +108,20 @@  discard block
 block discarded – undo
108 108
 	 * @return Money
109 109
 	 * @throws \JsonSchema\Exception\ValidationException Throws JSON schema validation exception when JSON is invalid.
110 110
 	 */
111
-	public static function from_json( $json ) {
112
-		$data = json_decode( $json );
111
+	public static function from_json($json) {
112
+		$data = json_decode($json);
113 113
 
114 114
 		$validator = new Validator();
115 115
 
116 116
 		$validator->validate(
117 117
 			$data,
118 118
 			(object) array(
119
-				'$ref' => 'file://' . realpath( __DIR__ . '/../json-schemas/json-schema-money.json' ),
119
+				'$ref' => 'file://' . realpath(__DIR__ . '/../json-schemas/json-schema-money.json'),
120 120
 			),
121 121
 			Constraint::CHECK_MODE_EXCEPTIONS
122 122
 		);
123 123
 
124
-		return self::from_object( $data );
124
+		return self::from_object($data);
125 125
 	}
126 126
 
127 127
 	/**
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	 * @param array $fields Fields.
131 131
 	 * @return array
132 132
 	 */
133
-	public function get_signature_fields( $fields = array() ) {
133
+	public function get_signature_fields($fields = array()) {
134 134
 		$fields[] = $this->get_currency();
135
-		$fields[] = strval( $this->get_amount() );
135
+		$fields[] = strval($this->get_amount());
136 136
 
137 137
 		return $fields;
138 138
 	}
Please login to merge, or discard this patch.
src/DataHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param int    $max   Max length of value.
29 29
 	 * @throws InvalidArgumentException Throws invalid argument exception when string is longer then max length.
30 30
 	 */
31
-	public static function validate_an( $value, $max ) {
32
-		if ( strlen( $value ) > $max ) {
31
+	public static function validate_an($value, $max) {
32
+		if (strlen($value) > $max) {
33 33
 			throw new InvalidArgumentException(
34 34
 				sprintf(
35 35
 					'Value "%s" can not be longer then `%d`.',
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 	 * @param int         $max   Max length of value.
50 50
 	 * @throws InvalidArgumentException Throws invalid argument exception when value is not null and longer then max length.
51 51
 	 */
52
-	public static function validate_null_or_an( $value, $max ) {
53
-		if ( null === $value ) {
52
+	public static function validate_null_or_an($value, $max) {
53
+		if (null === $value) {
54 54
 			return true;
55 55
 		}
56 56
 
57
-		return self::validate_an( $value, $max );
57
+		return self::validate_an($value, $max);
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
src/Address.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @param string $city         City.
100 100
 	 * @param string $country_code Country code.
101 101
 	 */
102
-	public function __construct( $last_name, $street, $postal_code, $city, $country_code ) {
102
+	public function __construct($last_name, $street, $postal_code, $city, $country_code) {
103 103
 		$this->last_name    = $last_name;
104 104
 		$this->street       = $street;
105 105
 		$this->postal_code  = $postal_code;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 *
122 122
 	 * @param string $first_name First name.
123 123
 	 */
124
-	public function set_first_name( $first_name ) {
124
+	public function set_first_name($first_name) {
125 125
 		$this->first_name = $first_name;
126 126
 	}
127 127
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 *
140 140
 	 * @param string $middle_name Middle name.
141 141
 	 */
142
-	public function set_middle_name( $middle_name ) {
142
+	public function set_middle_name($middle_name) {
143 143
 		$this->middle_name = $middle_name;
144 144
 	}
145 145
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 *
158 158
 	 * @param string $last_name Last name.
159 159
 	 */
160
-	public function set_last_name( $last_name ) {
160
+	public function set_last_name($last_name) {
161 161
 		$this->last_name = $last_name;
162 162
 	}
163 163
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	 *
176 176
 	 * @param string $street Street.
177 177
 	 */
178
-	public function set_street( $street ) {
178
+	public function set_street($street) {
179 179
 		$this->street = $street;
180 180
 	}
181 181
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @param string|null $house_number House number.
195 195
 	 */
196
-	public function set_house_number( $house_number ) {
196
+	public function set_house_number($house_number) {
197 197
 		$this->house_number = $house_number;
198 198
 	}
199 199
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 *
212 212
 	 * @param string|null $house_number_addition House number addition.
213 213
 	 */
214
-	public function set_house_number_addition( $house_number_addition ) {
214
+	public function set_house_number_addition($house_number_addition) {
215 215
 		$this->house_number_addition = $house_number_addition;
216 216
 	}
217 217
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 *
230 230
 	 * @param string $postal_code Postal code.
231 231
 	 */
232
-	public function set_postal_code( $postal_code ) {
232
+	public function set_postal_code($postal_code) {
233 233
 		$this->postal_code = $postal_code;
234 234
 	}
235 235
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @param string $city City.
249 249
 	 */
250
-	public function set_city( $city ) {
250
+	public function set_city($city) {
251 251
 		$this->city = $city;
252 252
 	}
253 253
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 *
266 266
 	 * @param string $country_code Country code.
267 267
 	 */
268
-	public function set_country_code( $country_code ) {
268
+	public function set_country_code($country_code) {
269 269
 		$this->country_code = $country_code;
270 270
 	}
271 271
 
@@ -282,11 +282,11 @@  discard block
 block discarded – undo
282 282
 		$object->lastName   = $this->last_name;
283 283
 		$object->street     = $this->street;
284 284
 
285
-		if ( null !== $this->house_number ) {
285
+		if (null !== $this->house_number) {
286 286
 			$object->houseNumber = $this->house_number;
287 287
 		}
288 288
 
289
-		if ( null !== $this->house_number_addition ) {
289
+		if (null !== $this->house_number_addition) {
290 290
 			$object->houseNumberAddition = $this->house_number_addition;
291 291
 		}
292 292
 
@@ -303,17 +303,17 @@  discard block
 block discarded – undo
303 303
 	 * @param array $fields Fields.
304 304
 	 * @return array
305 305
 	 */
306
-	public function get_signature_fields( $fields = array() ) {
306
+	public function get_signature_fields($fields = array()) {
307 307
 		$fields[] = $this->first_name;
308 308
 		$fields[] = $this->middle_name;
309 309
 		$fields[] = $this->last_name;
310 310
 		$fields[] = $this->street;
311 311
 
312
-		if ( null !== $this->house_number ) {
312
+		if (null !== $this->house_number) {
313 313
 			$fields[] = $this->house_number;
314 314
 		}
315 315
 
316
-		if ( null !== $this->house_number_addition ) {
316
+		if (null !== $this->house_number_addition) {
317 317
 			$fields[] = $this->house_number_addition;
318 318
 		}
319 319
 
Please login to merge, or discard this patch.
src/OrderItem.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param Money  $amount   Amount.
83 83
 	 * @param string $category Category.
84 84
 	 */
85
-	public function __construct( $name, $quantity, Money $amount, $category ) {
85
+	public function __construct($name, $quantity, Money $amount, $category) {
86 86
 		$this->name     = $name;
87 87
 		$this->quantity = $quantity;
88 88
 		$this->amount   = $amount;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 *
104 104
 	 * @param string|null $id ID.
105 105
 	 */
106
-	public function set_id( $id = null ) {
106
+	public function set_id($id = null) {
107 107
 		$this->id = $id;
108 108
 	}
109 109
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @param string|null $description Description.
132 132
 	 */
133
-	public function set_description( $description ) {
133
+	public function set_description($description) {
134 134
 		$this->description = $description;
135 135
 	}
136 136
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @param Money|null $tax Tax.
168 168
 	 */
169
-	public function set_tax( Money $tax = null ) {
169
+	public function set_tax(Money $tax = null) {
170 170
 		$this->tax = $tax;
171 171
 	}
172 172
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @param int|null $vat_category VAT category.
195 195
 	 */
196
-	public function set_vat_category( $vat_category ) {
196
+	public function set_vat_category($vat_category) {
197 197
 		$this->vat_category = $vat_category;
198 198
 	}
199 199
 
@@ -205,26 +205,26 @@  discard block
 block discarded – undo
205 205
 	public function get_json() {
206 206
 		$object = (object) array();
207 207
 
208
-		if ( null !== $this->id ) {
208
+		if (null !== $this->id) {
209 209
 			$object->id = $this->id;
210 210
 		}
211 211
 
212 212
 		$object->name = $this->name;
213 213
 
214
-		if ( null !== $this->description ) {
214
+		if (null !== $this->description) {
215 215
 			$object->description = $this->description;
216 216
 		}
217 217
 
218 218
 		$object->quantity = $this->quantity;
219 219
 		$object->amount   = $this->amount->get_json();
220 220
 
221
-		if ( null !== $this->tax ) {
221
+		if (null !== $this->tax) {
222 222
 			$object->tax = $this->tax->get_json();
223 223
 		}
224 224
 
225 225
 		$object->category = $this->category;
226 226
 
227
-		if ( null !== $this->vat_category ) {
227
+		if (null !== $this->vat_category) {
228 228
 			$object->vatCategory = $this->vat_category;
229 229
 		}
230 230
 
@@ -237,26 +237,26 @@  discard block
 block discarded – undo
237 237
 	 * @param array $fields Fields.
238 238
 	 * @return array
239 239
 	 */
240
-	public function get_signature_fields( $fields = array() ) {
241
-		if ( null !== $this->id ) {
240
+	public function get_signature_fields($fields = array()) {
241
+		if (null !== $this->id) {
242 242
 			$fields[] = $this->id;
243 243
 		}
244 244
 
245 245
 		$fields[] = $this->name;
246 246
 		$fields[] = $this->description;
247
-		$fields[] = strval( $this->quantity );
247
+		$fields[] = strval($this->quantity);
248 248
 
249
-		$fields = $this->amount->get_signature_fields( $fields );
249
+		$fields = $this->amount->get_signature_fields($fields);
250 250
 
251
-		if ( null === $this->tax ) {
251
+		if (null === $this->tax) {
252 252
 			$fields[] = null;
253 253
 		} else {
254
-			$fields = $this->tax->get_signature_fields( $fields );
254
+			$fields = $this->tax->get_signature_fields($fields);
255 255
 		}
256 256
 
257 257
 		$fields[] = $this->category;
258 258
 
259
-		if ( null !== $this->vat_category ) {
259
+		if (null !== $this->vat_category) {
260 260
 			$fields[] = $this->vat_category;
261 261
 		}
262 262
 
Please login to merge, or discard this patch.
src/AddressTransformer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param PronamicAddress|null $pronamic_address Pronamic address to convert.
27 27
 	 * @return Address|null
28 28
 	 */
29
-	public static function transform( PronamicAddress $pronamic_address = null ) {
30
-		if ( null === $pronamic_address ) {
29
+	public static function transform(PronamicAddress $pronamic_address = null) {
30
+		if (null === $pronamic_address) {
31 31
 			return null;
32 32
 		}
33 33
 
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 		$city         = $pronamic_address->get_city();
40 40
 		$country_code = $pronamic_address->get_country_code();
41 41
 
42
-		if ( ! isset( $last_name, $street, $postal_code, $city, $country_code ) ) {
42
+		if ( ! isset($last_name, $street, $postal_code, $city, $country_code)) {
43 43
 			return null;
44 44
 		}
45 45
 
46
-		$address = new Address( $last_name, $street, $postal_code, $city, $country_code );
46
+		$address = new Address($last_name, $street, $postal_code, $city, $country_code);
47 47
 
48
-		if ( null !== $name ) {
49
-			$address->set_first_name( $name->get_first_name() );
50
-			$address->set_middle_name( $name->get_middle_name() );
48
+		if (null !== $name) {
49
+			$address->set_first_name($name->get_first_name());
50
+			$address->set_middle_name($name->get_middle_name());
51 51
 		}
52 52
 
53
-		$address->set_house_number( $pronamic_address->get_house_number() );
54
-		$address->set_house_number_addition( $pronamic_address->get_house_number_addition() );
53
+		$address->set_house_number($pronamic_address->get_house_number());
54
+		$address->set_house_number_addition($pronamic_address->get_house_number_addition());
55 55
 
56 56
 		return $address;
57 57
 	}
Please login to merge, or discard this patch.
src/Integration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@
 block discarded – undo
35 35
 		 *
36 36
 		 * @var callable $webhook_listener_function
37 37
 		 */
38
-		$webhook_listener_function = array( __NAMESPACE__ . '\WebhookListener', 'listen' );
38
+		$webhook_listener_function = array(__NAMESPACE__ . '\WebhookListener', 'listen');
39 39
 
40
-		if ( ! has_action( 'wp_loaded', $webhook_listener_function ) ) {
41
-			add_action( 'wp_loaded', $webhook_listener_function );
40
+		if ( ! has_action('wp_loaded', $webhook_listener_function)) {
41
+			add_action('wp_loaded', $webhook_listener_function);
42 42
 		}
43 43
 	}
44 44
 
Please login to merge, or discard this patch.