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

ProductServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A addRoutes() 0 4 1
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