Completed
Push — master ( 4183d8...170803 )
by Ronan
02:51
created

Sscc::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 Sscc for European/International Article Number, 14 digits long code.
7
 *
8
 * @link https://en.wikipedia.org/wiki/Serial_shipping_container_code
9
 * @link http://www.gs1.org/serial-shipping-container-code-sscc
10
 * @link http://www.morovia.com/kb/Serial-Shipping-Container-Code-SSCC18-10601.html
11
 */
12
class Sscc extends Gtin implements IsoCodeInterface
13
{
14
    /**
15
     * @param mixed $sscc
16
     *
17
     * @return bool
18
     */
19
    public static function validate($sscc)
20
    {
21
        return parent::check($sscc, 18);
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...
22
    }
23
}
24