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

Ean8::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace IsoCodes;
4
5
/**
6
 * Class Ean8 for former EAN/UCC-8 European/International Article Number, 8 digits long codes.
7
 * This is a symlink, for convenience purposes only.
8
 *
9
 * @link https://en.wikipedia.org/wiki/International_Article_Number_(EAN)
10
 * @link https://en.wikipedia.org/wiki/Global_Trade_Item_Number
11
 */
12
class Ean8 extends Gtin8 implements IsoCodeInterface
13
{
14
    /**
15
     * @param mixed $ean8
16
     *
17
     * @deprecated in favor of Gtin8
18
     *
19
     * @return bool
20
     */
21
    public static function validate($ean8)
22
    {
23
        return parent::check($ean8, 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...
24
    }
25
}
26