Test Failed
Push — master ( ba1fe5...03a684 )
by Mikael
02:03
created

DatabaseConfigure::setDefaultsFromConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Anax\Database;
4
5
use \Anax\Common\ConfigureInterface;
6
use \Anax\Common\ConfigureTrait;
7
8
/**
9
 * Namespaced exception.
10
 */
11
class DatabaseConfigure extends Database implements ConfigureInterface
12
{
13
    use ConfigureTrait {
14
        configure as protected loadConfiguration;
15
    }
16
17
18
19
    /**
20
     * Load and apply configurations.
21
     *
22
     * @param array|string $what is an array with key/value config options
23
     *                           or a file to be included which returns such
24
     *                           an array.
25
     *
26
     * @return void
27
     */
28
    public function configure($what)
29
    {
30
        $this->loadConfiguration($what);
31
        parent::setOptions($this->config);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (setOptions() instead of configure()). Are you sure this is correct? If so, you might want to change this to $this->setOptions().

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...
32
    }
33
}
34