Passed
Pull Request — master (#16)
by
unknown
06:16 queued 02:52
created

EasycreditRouteProviderPlugin::addRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 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\Easycredit\Plugin\Router;
9
10
use Spryker\Yves\Router\Plugin\RouteProvider\AbstractRouteProviderPlugin;
11
use Spryker\Yves\Router\Route\RouteCollection;
12
use Symfony\Component\HttpFoundation\Request;
13
14
class EasycreditRouteProviderPlugin extends AbstractRouteProviderPlugin
15
{
16
    /**
17
     * @var string
18
     */
19
    public const ROUTE_NAME_EASYCREDIT_SUCCESS_RESPONSE = 'easycredit/success-response';
20
21
    /**
22
     * {@inheritDoc}
23
     * - Adds Easycredit success response route to the RouteCollection.
24
     *
25
     * @api
26
     *
27
     * @param \Spryker\Yves\Router\Route\RouteCollection $routeCollection
28
     *
29
     * @return \Spryker\Yves\Router\Route\RouteCollection
30
     */
31
    public function addRoutes(RouteCollection $routeCollection): RouteCollection
32
    {
33
        $route = $this->buildRoute('/easycredit/payment/success', 'Easycredit', 'Easycredit', 'successEasycreditResponse');
34
        $route = $route->setMethods([Request::METHOD_GET]);
35
        $routeCollection->add(static::ROUTE_NAME_EASYCREDIT_SUCCESS_RESPONSE, $route);
36
37
        return $routeCollection;
38
    }
39
}
40