Completed
Push — master ( d387da...d21571 )
by Ronan
01:52
created

Gtin::check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 4
1
<?php
2
3
namespace IsoCodes;
4
5
/**
6
 * Abstract Class Gtin Global Trade Item Numbers.
7
 *
8
 * @link http://www.gs1.org/how-calculate-check-digit-manually
9
 */
10
abstract class Gtin extends Luhn
11
{
12
    const HYPHENS = ['‐', '-', ' ']; // regular dash, authentic hyphen (rare!) and space
13
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public static function check($gtin, $length, $unDecorate = true, $hyphens = self::HYPHENS)
18
    {
19
        return parent::check($gtin, $length, true, $hyphens);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public static function unDecorate($gtin, $hyphens = self::HYPHENS)
26
    {
27
        return parent::unDecorate($gtin, $hyphens);
28
    }
29
}
30