Passed
Push — master ( 1710e4...0562aa )
by nguereza
03:29 queued 01:31
created

ProductServiceProvider::addRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Platine\App\Provider;
6
7
use Platine\App\Http\Action\Product\CategoryAction;
8
use Platine\App\Model\Repository\ProductCategoryRepository;
9
use Platine\Framework\Service\ServiceProvider;
10
use Platine\Route\Router;
11
12
/**
13
* @class ProductServiceProvider
14
* @package Platine\App\Provider
15
*/
16
class ProductServiceProvider extends ServiceProvider
17
{
18
    /**
19
    * {@inheritdoc}
20
    */
21
    public function register(): void
22
    {
23
        $this->app->bind(ProductCategoryRepository::class);
24
        $this->app->bind(CategoryAction::class);
25
    }
26
27
28
    /**
29
    * {@inheritdoc}
30
    */
31
    public function addRoutes(Router $router): void
32
    {
33
        $router->group('/product', function (Router $router) {
34
            $router->resource('/category', CategoryAction::class, 'product_category');
35
        });
36
    }
37
}
38