Completed
Push — master ( c29fe7...c5a2a9 )
by Dmitry
03:44
created

Tester::__construct()   B

Complexity

Conditions 5
Paths 16

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 30

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 13
cp 0
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 10
nc 16
nop 1
crap 30
1
<?php
2
3
namespace Basis;
4
5
class Tester extends Application
6
{
7
    public function __construct($root = null)
8
    {
9
        if (!$root) {
10
            $root = getcwd();
11
        }
12
        parent::__construct($root);
13
14
        $service = getenv('SERVICE_NAME') ?: basename($root);
15
        $host = getenv('TARANTOOL_SERVICE_HOST') ?: '127.0.0.1';
16
        $port = getenv('TARANTOOL_SERVICE_PORT') ?: '3302';
17
18
        $this->get(Config::class)['service'] = $service;
19
        $this->get(Config::class)['tarantool'] = "tcp://$host:$port";
20
21
        $this->dispatch('tarantool.migrate');
22
    }
23
}
24