Passed
Pull Request — master (#9)
by Volodymyr
04:52
created

PaypalExpressController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A successAction() 0 8 1
1
<?php
2
3
namespace SprykerEco\Yves\Braintree\Controller;
4
5
use Spryker\Yves\Kernel\Controller\AbstractController;
6
use Symfony\Component\HttpFoundation\Request;
7
8
/**
9
 * @method \SprykerEco\Yves\Braintree\BraintreeFactory getFactory()
10
 */
11
class PaypalExpressController extends AbstractController
12
{
13
    public function successAction(Request $request)
14
    {
15
        $payload = $this->getFactory()->getUtilEncodingService()->decodeJson($request->getContent(), true);
16
17
        $this->getFactory()->createResponseProcessor()->processSuccessResponse($payload);
0 ignored issues
show
Bug introduced by
It seems like $payload can also be of type null; however, parameter $payload of SprykerEco\Yves\Braintre...rocessSuccessResponse() does only seem to accept array, 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

17
        $this->getFactory()->createResponseProcessor()->processSuccessResponse(/** @scrutinizer ignore-type */ $payload);
Loading history...
18
19
        return $this->jsonResponse([
20
            'redirectUrl' => 'http://www.de.suite-nonsplit.local/checkout/summary'
21
        ]);
22
    }
23
}