IpLockHolder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_lock_holder() 0 10 2
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