Completed
Push — multimodel-dp ( 745c1d...bcd65b )
by Peter
03:53
created

TypeNamer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A nameType() 0 5 1
1
<?php
2
3
namespace Maslosoft\Manganel\Helpers;
4
5
use Maslosoft\Mangan\Helpers\CollectionNamer;
6
7
/**
8
 * TypeNamer
9
 *
10
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
11
 */
12
class TypeNamer extends CollectionNamer
13
{
14
15 47
	public static function nameType($model)
16
	{
17 47
		$collectionName = parent::nameCollection($model);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (nameCollection() instead of nameType()). Are you sure this is correct? If so, you might want to change this to $this->nameCollection().

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...
18 47
		return str_replace('.', '_', $collectionName);
19
	}
20
21
}
22