Completed
Push — master ( e0efcd...d9b2af )
by Ronan
05:45
created

Gln   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 4 1
1
<?php
2
3
namespace IsoCodes;
4
5
/**
6
 * The Global Location Number (GLN) is part of the GS1 systems of standards.
7
 * It is a simple tool used to identify a location and can identify locations uniquely where required.
8
 * The mechanism for GLN is the same as GTIN-13.
9
 *
10
 * @link https://en.wikipedia.org/wiki/Global_Location_Number
11
 * @link https://en.wikipedia.org/wiki/Global_Trade_Item_Number
12
 */
13
class Gln extends Gtin13 implements IsoCodeInterface
14
{
15
    /**
16
     * @param mixed $gln
17
     *
18
     * @return bool
19
     */
20
    public static function validate($gln)
21
    {
22
        return parent::check($gln, 13);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (check() instead of validate()). Are you sure this is correct? If so, you might want to change this to $this->check().

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...
23
    }
24
}
25