Conditions | 4 |
Paths | 8 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
10 | public function setup() |
||
11 | { |
||
12 | $root = getcwd(); |
||
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->app = new Application($root); |
||
|
|||
19 | $this->get(Config::class)['service'] = $service; |
||
20 | $this->get(Config::class)['tarantool'] = "tcp://$host:$port"; |
||
21 | $this->dispatch('tarantool.migrate'); |
||
22 | } |
||
23 | |||
49 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: