Completed
Pull Request — master (#143)
by
unknown
02:35
created

ConfigProvider::__invoke()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 44
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 25
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ContactUs;
6
7
use Zend\ServiceManager\Factory\InvokableFactory;
8
9
/**
10
 * Class ConfigProvider
11
 *
12
 * @package ContactUs
13
 * @author  Djordje Stojiljkovic <[email protected]>
14
 */
15
class ConfigProvider
16
{
17
    public function __invoke()
18
    {
19
        return [
20
            'templates' => [
21
                'map'   => [
22
                    'contact-us/pagination' => __DIR__.'/../templates/partial/pagination.php',
23
                    'contact-us/errors'     => __DIR__.'/../templates/partial/errors.php'
24
                ],
25
                'paths' => [
26
                    'contact-us' => [__DIR__.'/../templates/contact-us'],
27
                ]
28
            ],
29
30
            'dependencies'  => [
31
                'factories' => [
32
                    Controller\ContactUsController::class => Controller\ContactUsControllerFactory::class,
33
                    Service\ContactUsService::class       => Service\ContactUsServiceFactory::class,
34
                    Mapper\ContactUsMapper::class         => Mapper\ContactUsMapperFactory::class,
35
                    Filter\ContactUsFilter::class         => InvokableFactory::class,
36
                ]
37
            ],
38
39
            'routes' => [
40
                [
41
                    'name'            => 'admin.contact-us',
42
                    'path'            => '/admin/contact-us/',
43
                    'middleware'      => Controller\ContactUsController::class,
44
                    'allowed_methods' => ['GET'],
45
                ],
46
                [
47
                    'name'            => 'admin.contact-us.action',
48
                    'path'            => '/admin/contact-us/{action}/{id}',
49
                    'middleware'      => Controller\ContactUsController::class,
50
                    'allowed_methods' => ['GET', 'POST'],
51
                ]
52
            ],
53
54
            'view_helpers' => [
55
                'factories' => [
56
57
                ]
58
            ]
59
        ];
60
    }
61
}
62