Completed
Push — master ( e4f635...4183d8 )
by Ronan
02:53
created

Gtin8   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
 * Class Gtin8 for former EAN-8 European/International Article Number, 8 digits long codes.
7
 *
8
 * GTIN-8 (formerly EAN-8) is derived from EAN-13, introduced for use on small packages where an EAN-13 barcode would be too large;
9
 * for example on cigarettes, pencils, and chewing gum packets.
10
 *
11
 * @link https://en.wikipedia.org/wiki/EAN-8
12
 * @link https://en.wikipedia.org/wiki/International_Article_Number_(EAN)
13
 * @link https://en.wikipedia.org/wiki/Global_Trade_Item_Number
14
 */
15
class Gtin8 extends Gtin implements IsoCodeInterface
16
{
17
    /**
18
     * @param mixed $gtin8
19
     *
20
     * @return bool
21
     */
22
    public static function validate($gtin8)
23
    {
24
        return parent::check($gtin8, 8);
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...
25
    }
26
}
27