AcquiaSearchIndexProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Acquia\Search\Proxy\Silex;
4
5
use Silex\Application;
6
use Silex\ServiceProviderInterface;
7
8
class AcquiaSearchIndexProvider implements ServiceProviderInterface
9
{
10
    public function register(Application $app)
11
    {
12
        $app['acquia.search.indexes'] = $app->share(function ($app) {
13
            return new \Acquia\Rest\ServiceManager(array(
14
                'conf_dir' => dirname($app['acquia.search.proxy.auth_file'])
15
            ));
16
        });
17
18
        $app['acquia.search.index'] = $app->share(function ($app) {
19
            $group = basename($app['acquia.search.proxy.auth_file'], '.json');
20
            return $app['acquia.search.indexes']->getClient($group, $app['acquia.search.proxy.identifier']);
21
        });
22
    }
23
24
    public function boot(Application $app)
25
    {
26
        // Nothing to do ...
27
    }
28
}
29