Passed
Pull Request — master (#9)
by Volodymyr
05:00
created

PaypalExpressControllerProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 52
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A defineControllers() 0 6 1
A addPaypalExpressSuccessResponseRoute() 0 11 1
A addPaypalExpressAddShipmentRoute() 0 11 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Yves\Braintree\Plugin\Provider;
9
10
use Silex\Application;
11
use SprykerShop\Yves\ShopApplication\Plugin\Provider\AbstractYvesControllerProvider;
0 ignored issues
show
Bug introduced by
The type SprykerShop\Yves\ShopApp...tYvesControllerProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
class PaypalExpressControllerProvider extends AbstractYvesControllerProvider
14
{
15
    public const ROUTE_PAYPAL_EXPRESS_SUCCESS_RESPONSE = 'paypal-express-success';
16
    public const ROUTE_PAYPAL_EXPRESS_SHIPMENT_ADD = 'paypal-express-shipment-add';
17
18
    /**
19
     * @param \Silex\Application $app
20
     *
21
     * @return $this
22
     */
23
    protected function defineControllers(Application $app)
24
    {
25
        $this->addPaypalExpressSuccessResponseRoute();
26
        $this->addPaypalExpressAddShipmentRoute();
27
28
        return $this;
29
    }
30
31
    /**
32
     * @uses \SprykerEco\Yves\Braintree\Controller\PaypalExpressController::successAction()
33
     *
34
     * @return $this
35
     */
36
    protected function addPaypalExpressSuccessResponseRoute()
37
    {
38
        $this->createController(
39
            '/paypal-express/payment/success',
40
            static::ROUTE_PAYPAL_EXPRESS_SUCCESS_RESPONSE,
41
            'Braintree',
42
            'PaypalExpress',
43
            'success'
44
        );
45
46
        return $this;
47
    }
48
49
    /**
50
     * @uses \SprykerEco\Yves\Braintree\Controller\PaypalExpressController::successAction()
51
     *
52
     * @return $this
53
     */
54
    protected function addPaypalExpressAddShipmentRoute()
55
    {
56
        $this->createController(
57
            '/paypal-express/shipment/add',
58
            static::ROUTE_PAYPAL_EXPRESS_SHIPMENT_ADD,
59
            'Braintree',
60
            'PaypalExpress',
61
            'addShipment'
62
        );
63
64
        return $this;
65
    }
66
}
67