Completed
Pull Request — master (#1942)
by
unknown
81:19 queued 16:13
created

ValidateIbanController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 4 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\App\Controllers\Validation;
6
7
use Symfony\Component\HttpFoundation\JsonResponse;
8
use Symfony\Component\HttpFoundation\Request;
9
use Symfony\Component\HttpFoundation\Response;
10
use WMDE\Fundraising\Frontend\Factories\FunFunFactory;
11
use WMDE\Fundraising\PaymentContext\Domain\Model\Iban;
12
13
class ValidateIbanController {
14
15
	public function index( Request $request, FunFunFactory $ffFactory ): Response {
16
		$useCase = $ffFactory->newCheckIbanUseCase();
17
		$checkIbanResponse = $useCase->checkIban( new Iban( $request->query->get( 'iban', '' ) ) );
18
		return new JsonResponse( $ffFactory->newIbanPresenter()->present( $checkIbanResponse ) );
19
	}
20
}
21