Bootstrap::createRegistry()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Vivait\TenantBundle;
4
5
use Vivait\TenantBundle\Locator\TenantLocator;
6
use Vivait\TenantBundle\Provider\TenantProvider;
7
use Vivait\TenantBundle\Registry\TenantRegistry;
8
9
class Bootstrap {
10
11
    public static function createRegistry(TenantProvider $provider, TenantLocator $locator) {
12
        // Populate the tenants from the provider
13
        $registry = new TenantRegistry($provider->loadTenants());
14
15
        $registry->setCurrent( $registry->get($locator->getTenant()) );
16
17
        return $registry;
18
    }
19
20
}
21