MiddlewareServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 69.23%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 5
dl 0
loc 27
ccs 9
cts 13
cp 0.6923
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 18 1
A boot() 0 4 1
1
<?php
2
3
namespace Alchemy\RestProvider;
4
5
use Silex\Application;
6
use Silex\ServiceProviderInterface;
7
8
class MiddlewareServiceProvider implements ServiceProviderInterface
9
{
10
11 2
    public function register(Application $app)
12
    {
13
        $app['alchemy_rest.middleware.parse_date_params'] = $app->share(function () {
14
            return new Middleware\SetDateAttributesMiddlewareFactory();
15 2
        });
16
17
        $app['alchemy_rest.middleware.parse_list_params'] = $app->share(function () {
18
            return new Middleware\SetPaginationAndSortAttributesMiddlewareFactory();
19 2
        });
20
21
        $app['alchemy_rest.middleware.transform_response'] = $app->share(function () {
22
            return new Middleware\SetTransformAttributeMiddlewareFactory();
23 2
        });
24
25 2
        $app['alchemy_rest.middleware.json_encoder'] = $app->share(function () {
26
            return new Middleware\SetEncodingAttributeMiddlewareFactory();
27 2
        });
28 2
    }
29
30 2
    public function boot(Application $app)
31
    {
32
        // no-op
33 2
    }
34
}
35