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

getLockInformation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
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