@@ -26,14 +26,14 @@ |
||
| 26 | 26 | * @param PronamicMoney|null $pronamic_money Pronamic money to convert. |
| 27 | 27 | * @return Money|null |
| 28 | 28 | */ |
| 29 | - public static function transform( PronamicMoney $pronamic_money = null ) { |
|
| 30 | - if ( null === $pronamic_money ) { |
|
| 29 | + public static function transform(PronamicMoney $pronamic_money = null) { |
|
| 30 | + if (null === $pronamic_money) { |
|
| 31 | 31 | return null; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $money = new Money( |
| 35 | 35 | $pronamic_money->get_currency()->get_alphabetic_code(), |
| 36 | - intval( $pronamic_money->get_cents() ) |
|
| 36 | + intval($pronamic_money->get_cents()) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | return $money; |
@@ -99,7 +99,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -82,7 +82,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -26,8 +26,8 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -35,10 +35,10 @@ |
||
| 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 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @param string|null $email_address E-mailadress of the consumer. |
| 62 | 62 | */ |
| 63 | - public function set_email_address( $email_address ) { |
|
| 63 | + public function set_email_address($email_address) { |
|
| 64 | 64 | $this->email_address = $email_address; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @param DateTime|null $date_of_birth Date of birth. |
| 71 | 71 | */ |
| 72 | - public function set_date_of_birth( DateTime $date_of_birth = null ) { |
|
| 72 | + public function set_date_of_birth(DateTime $date_of_birth = null) { |
|
| 73 | 73 | $this->date_of_birth = $date_of_birth; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @param string|null $gender Gender. |
| 80 | 80 | */ |
| 81 | - public function set_gender( $gender ) { |
|
| 81 | + public function set_gender($gender) { |
|
| 82 | 82 | $this->gender = $gender; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * |
| 88 | 88 | * @param string|null $initials Initials. |
| 89 | 89 | */ |
| 90 | - public function set_initials( $initials ) { |
|
| 90 | + public function set_initials($initials) { |
|
| 91 | 91 | $this->initials = $initials; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @param string|null $telephone_number Telephone number. |
| 98 | 98 | */ |
| 99 | - public function set_telephone_number( $telephone_number ) { |
|
| 99 | + public function set_telephone_number($telephone_number) { |
|
| 100 | 100 | $this->telephone_number = $telephone_number; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -108,23 +108,23 @@ discard block |
||
| 108 | 108 | public function get_json() { |
| 109 | 109 | $object = (object) array(); |
| 110 | 110 | |
| 111 | - if ( null !== $this->email_address ) { |
|
| 111 | + if (null !== $this->email_address) { |
|
| 112 | 112 | $object->emailAddress = $this->email_address; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if ( null !== $this->date_of_birth ) { |
|
| 116 | - $object->dateOfBirth = $this->date_of_birth->format( 'd-m-Y' ); |
|
| 115 | + if (null !== $this->date_of_birth) { |
|
| 116 | + $object->dateOfBirth = $this->date_of_birth->format('d-m-Y'); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if ( null !== $this->gender ) { |
|
| 119 | + if (null !== $this->gender) { |
|
| 120 | 120 | $object->gender = $this->gender; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if ( null !== $this->initials ) { |
|
| 123 | + if (null !== $this->initials) { |
|
| 124 | 124 | $object->initials = $this->initials; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if ( null !== $this->telephone_number ) { |
|
| 127 | + if (null !== $this->telephone_number) { |
|
| 128 | 128 | $object->telephoneNumber = $this->telephone_number; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | * @param array $fields Fields. |
| 138 | 138 | * @return array |
| 139 | 139 | */ |
| 140 | - public function get_signature_fields( $fields = array() ) { |
|
| 140 | + public function get_signature_fields($fields = array()) { |
|
| 141 | 141 | $fields[] = $this->email_address; |
| 142 | - $fields[] = ( null === $this->date_of_birth ) ? null : $this->date_of_birth->format( 'd-m-Y' ); |
|
| 142 | + $fields[] = (null === $this->date_of_birth) ? null : $this->date_of_birth->format('d-m-Y'); |
|
| 143 | 143 | $fields[] = $this->gender; |
| 144 | 144 | $fields[] = $this->initials; |
| 145 | 145 | $fields[] = $this->telephone_number; |