Completed
Push — master ( ef4007...299526 )
by Ronan
06:13
created

Ismn   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
c 1
b 1
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 Ismn for International Standard Music Number or ISMN (ISO 10957)
7
 * From 1 January 2008 the ISMN was defined as a thirteen digit identifier beginning 979-0 where the zero replaced M
8
 * in the old-style number. The resulting number is identical with its EAN-13 number as encoded in the item's barcode.
9
 *
10
 * @link https://en.wikipedia.org/wiki/International_Standard_Music_Number
11
 * @link http://www.ismn-international.org/
12
 * @link http://www.ismn-international.org/whatis.html
13
 * @link https://en.wikipedia.org/wiki/International_Article_Number_(EAN)
14
 */
15
class Ismn extends Gtin13 implements IsoCodeInterface
16
{
17
    /**
18
     * @param mixed $ean13
19
     *
20
     * @return bool
21
     */
22
    public static function validate($ean13)
23
    {
24
        return parent::check($ean13, 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...
25
    }
26
}
27