Issues (38)

src/Controller/Paypal/VaultController.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App\Controller\Paypal;
4
5
use App\Service\SettingsService;
6
use Symfony\Component\Routing\Annotation\Route;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * Class VaultController
11
 * @package App\Controller\Paypal
12
 *
13
 * @Route("/paypal/vault", name="paypal-vault-")
14
 */
15
class VaultController extends AbstractController
16
{
17
    /**
18
     * @Route("/payment", name="payment", methods={"GET"}, defaults={"action" = "payment"})
19
     *
20
     * @param string $action
21
     *
22
     * @return Response
23
     */
24
    public function vaultPayment(string $action)
25
    {
26
        $customerId = $this->settingsService->getSetting('settings-customer-id');
27
        $dataUserIdToken = $this->paypalService->getVaultService()->getDataUserIdToken($customerId);
0 ignored issues
show
It seems like $customerId can also be of type null; however, parameter $clientId of App\Service\Paypal\Vault...e::getDataUserIdToken() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
        $dataUserIdToken = $this->paypalService->getVaultService()->getDataUserIdToken(/** @scrutinizer ignore-type */ $customerId);
Loading history...
28
        return $this->render('paypal/vault/'. $action .'.html.twig', [
29
            'dataUserIdToken' => $dataUserIdToken,
30
31
        ]);
32
    }
33
}
34