| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function index( FunFunFactory $ffFactory, Request $httpRequest ): Response { |
||
| 17 | $params = [ |
||
| 18 | 'urls' => Routes::getNamedRouteUrls( $ffFactory->getUrlGenerator() ) |
||
| 19 | ]; |
||
| 20 | $params['showMembershipTypeOption'] = $httpRequest->query->get( 'type' ) !== 'sustaining'; |
||
| 21 | |||
| 22 | $useCase = $ffFactory->newGetDonationUseCase( $httpRequest->query->get( 'donationAccessToken', '' ) ); |
||
| 23 | $responseModel = $useCase->showConfirmation( |
||
| 24 | new GetDonationRequest( |
||
| 25 | $httpRequest->query->getInt( 'donationId' ) |
||
| 26 | ) |
||
| 27 | ); |
||
| 28 | |||
| 29 | if ( $responseModel->accessIsPermitted() ) { |
||
| 30 | $adapter = new DonationMembershipApplicationAdapter(); |
||
| 31 | $params['initialFormValues'] = $adapter->getInitialMembershipFormValues( |
||
| 32 | $responseModel->getDonation() |
||
| 33 | ); |
||
| 34 | $params['initialValidationResult'] = $adapter->getInitialValidationState( |
||
| 35 | $responseModel->getDonation() |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | return new Response( $ffFactory->getMembershipApplicationFormTemplate()->render( $params ) ); |
||
| 40 | } |
||
| 42 |