ConfigProvider::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 43

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 43
rs 9.232
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Category;
4
5
class ConfigProvider
6
{
7
    public function __invoke()
8
    {
9
        return [
10
            'templates' => [
11
                'paths' => [
12
                    'category' => [__DIR__.'/../templates/category'],
13
                ],
14
            ],
15
16
            'dependencies' => [
17
                'factories' => [
18
                    // Service
19
                    Service\CategoryService::class    => Factory\Service\CategoryServiceFactory::class,
20
                    Mapper\CategoryMapper::class      => \Std\MapperFactory::class,
21
                    Filter\CategoryFilter::class      => \Zend\ServiceManager\Factory\InvokableFactory::class,
22
23
                    // Controller
24
                    Controller\IndexController::class => Factory\Controller\IndexFactory::class,
25
                ],
26
            ],
27
28
            'routes' => [
29
                [
30
                    'name'            => 'admin.categories',
31
                    'path'            => '/admin/categories',
32
                    'middleware'      => Controller\IndexController::class,
33
                    'allowed_methods' => ['GET'],
34
                ],
35
                [
36
                    'name'            => 'admin.categories.action',
37
                    'path'            => '/admin/categories/{action}/{id}',
38
                    'middleware'      => Controller\IndexController::class,
39
                    'allowed_methods' => ['GET', 'POST'],
40
                ],
41
            ],
42
43
            'view_helpers' => [
44
                'factories' => [
45
                    'category' => View\Helper\CategoryHelperFactory::class,
46
                ],
47
            ],
48
        ];
49
    }
50
}
51