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

Gtin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 4 1
A unDecorate() 0 4 1
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