Language   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 8 1
A getDefaultKey() 0 4 1
1
<?php
2
namespace Bpost\BpostApiClient\Common\BasicAttribute;
3
4
use Bpost\BpostApiClient\Common\BasicAttribute;
5
use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException;
6
7
class Language extends BasicAttribute
8
{
9
10
    const LANGUAGE_EN = 'EN';
11
    const LANGUAGE_FR = 'FR';
12
    const LANGUAGE_NL = 'NL';
13
14
    /**
15
     * @throws BpostInvalidValueException
16
     */
17 4
    public function validate()
18
    {
19 4
        $this->validateChoice(array(
20 4
            self::LANGUAGE_EN,
21 4
            self::LANGUAGE_FR,
22 4
            self::LANGUAGE_NL,
23 4
        ));
24 4
    }
25
26
    /**
27
     * @return string
28
     */
29 4
    protected function getDefaultKey()
30
    {
31 4
        return 'language';
32
    }
33
}
34