Passed
Push — bugfix/supesc-135-eco-easycred... ( 1877cf )
by Andrii
04:25
created

EasycreditRouteProviderPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addRoutes() 0 7 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Easycredit\Plugin\Router;
9
10
use Spryker\Yves\Router\Plugin\RouteProvider\AbstractRouteProviderPlugin;
0 ignored issues
show
Bug introduced by
The type Spryker\Yves\Router\Plug...ractRouteProviderPlugin 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...
11
use Spryker\Yves\Router\Route\RouteCollection;
0 ignored issues
show
Bug introduced by
The type Spryker\Yves\Router\Route\RouteCollection 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
use Symfony\Component\HttpFoundation\Request;
13
14
class EasycreditRouteProviderPlugin extends AbstractRouteProviderPlugin
15
{
16
    public const ROUTE_EASYCREDIT_SUCCESS_RESPONSE = 'easycredit/success-response';
17
18
    /**
19
     * Specification:
20
     * - Adds Routes to the RouteCollection.
21
     *
22
     * @api
23
     *
24
     * @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection
25
     *
26
     * @return \Spryker\Yves\Router\Route\RouteCollection
27
     */
28
    public function addRoutes(RouteCollection $routeCollection): RouteCollection
29
    {
30
        $route = $this->buildRoute('/easycredit/payment/success', 'Easycredit', 'Easycredit', 'successEasycreditResponse');
31
        $route = $route->setMethods([Request::METHOD_GET]);
32
        $routeCollection->add(static::ROUTE_EASYCREDIT_SUCCESS_RESPONSE, $route);
33
34
        return $routeCollection;
35
    }
36
}
37