IpLockHolder::get_lock_holder()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Ingenerator\RunSingle;
4
5
6
class IpLockHolder implements LockHolder {
7
8
    protected $lock_holder;
9
10
    public function get_lock_holder()
11
    {
12
        if(!$this->lock_holder) {
13
            $host_name = \gethostname();
14
            $ip = \gethostbyname($host_name);
15
16
            $this->lock_holder = $ip;
17
        }
18
        return $this->lock_holder;
19
    }
20
21
}
22