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

ValidateIbanController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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