Completed
Push — pr33 ( 0a4bbb )
by Kamil
02:37
created

ResolvedHostnameLockInformationProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLockInformation() 0 7 1
1
<?php
2
/**
3
 * This file is part of ninja-mutex.
4
 *
5
 * (C) Kamil Dziedzic <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NinjaMutex\Lock;
12
13
14
class ResolvedHostnameLockInformationProvider extends BasicLockInformationProvider
15
{
16
    /**
17
     * Adds resolved host IP to the provided information
18
     * (WARNING! Using DNS queries at runtime may introduce significant delays to script execution, use with caution!)
19
     * @return array
20
     */
21
    public function getLockInformation()
22
    {
23
        $params = parent::gatherInformation();
0 ignored issues
show
Bug introduced by
The method gatherInformation() does not seem to exist on object<NinjaMutex\Lock\B...ockInformationProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Comprehensibility Bug introduced by
It seems like you call parent on a different method (gatherInformation() instead of getLockInformation()). Are you sure this is correct? If so, you might want to change this to $this->gatherInformation().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
24
        $params[] = gethostbyname(gethostname());
25
26
        return $params;
27
    }
28
29
}
30