@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\App\Controllers; |
| 6 | 6 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $response = $useCase->changeAddress( $addressChangeRequest ); |
| 24 | 24 | |
| 25 | 25 | if ( !$response->isSuccess() ) { |
| 26 | - $ffFactory->getLogger()->error( 'Address change failed', [ 'domain_errors' => $response->getErrors() ] ); |
|
| 26 | + $ffFactory->getLogger()->error( 'Address change failed', ['domain_errors' => $response->getErrors()] ); |
|
| 27 | 27 | return new Response( $ffFactory->newErrorPageHtmlPresenter()->present( implode( "\n", $response->getErrors() ) ) ); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | private function addReceiptParams( ChangeAddressRequest $request, ParameterBag $params ) { |
| 76 | - if ( ! $params->get( 'receiptOptOut', '' ) ) { |
|
| 76 | + if ( !$params->get( 'receiptOptOut', '' ) ) { |
|
| 77 | 77 | $request->setIsOptOutOnly( false ); |
| 78 | 78 | $request->setDonationReceipt( false ); |
| 79 | 79 | return; |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | private function isOptOutOnly( ParameterBag $params ): bool { |
| 86 | - $requirePostalFields = [ 'street', 'postcode', 'city' ]; |
|
| 86 | + $requirePostalFields = ['street', 'postcode', 'city']; |
|
| 87 | 87 | $requiredNameFiels = $params->get( 'addressType', '' ) == 'person' ? |
| 88 | - [ 'firstName', 'lastName' ] : [ 'company' ]; |
|
| 88 | + ['firstName', 'lastName'] : ['company']; |
|
| 89 | 89 | $requiredFields = array_merge( $requiredNameFiels, $requirePostalFields ); |
| 90 | 90 | $allFieldsAreEmpty = true; |
| 91 | - foreach( $requiredFields as $field ) { |
|
| 91 | + foreach ( $requiredFields as $field ) { |
|
| 92 | 92 | if ( $params->get( $field, '' ) !== '' ) { |
| 93 | 93 | $allFieldsAreEmpty = false; |
| 94 | 94 | break; |