Completed
Push — 6.13 ( 7e7b66...6c34c5 )
by André
53:02 queued 27:51
created

DriverFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerAndCreateDriver() 0 6 1
1
<?php
2
3
/**
4
 * File containing the DriverFactory class.
5
 *
6
 * @copyright Copyright (c) 2014, Robert Hafner, Josh Hall-Bachner. All rights reserved.
7
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
8
 *
9
 * Original source: https://github.com/tedious/TedivmStashBundle/blob/master/Factory/DriverFactory.php
10
 *
11
 * @license For full copyright and license information view LICENSE file distributed with this source code.
12
 */
13
namespace eZ\Bundle\EzPublishCoreBundle\Cache\Driver;
14
15
use Stash\DriverList;
16
use Tedivm\StashBundle\Factory\DriverFactory as StashDriverFactory;
17
18
class DriverFactory extends StashDriverFactory
19
{
20
    public static function registerAndCreateDriver($name, $class, $types, $options)
21
    {
22
        DriverList::registerDriver($name, $class);
23
24
        return parent::createDriver($types, $options);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (createDriver() instead of registerAndCreateDriver()). Are you sure this is correct? If so, you might want to change this to $this->createDriver().

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...
25
    }
26
}
27