ExampleProductSaleRouteProviderPlugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addRoutes() 0 9 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace Pyz\Yves\ExampleProductSalePage\Plugin\Router;
11
12
use Spryker\Yves\Router\Plugin\RouteProvider\AbstractRouteProviderPlugin;
13
use Spryker\Yves\Router\Route\RouteCollection;
14
15
class ExampleProductSaleRouteProviderPlugin extends AbstractRouteProviderPlugin
16
{
17
    public const ROUTE_NAME_SALE = 'sale';
18
19
    public function addRoutes(RouteCollection $routeCollection): RouteCollection
20
    {
21
        $route = $this->buildRoute('/outlet{categoryPath}', 'ExampleProductSalePage', 'Sale', 'indexAction');
22
        $route = $route->setRequirement('categoryPath', '\/.+');
23
        $route = $route->setDefault('categoryPath', null);
24
25
        $routeCollection->add(static::ROUTE_NAME_SALE, $route);
26
27
        return $routeCollection;
28
    }
29
}
30