Credential   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 42
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getUser() 0 4 1
A getPassword() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Pachico\MaxMind\MinFraudChargeback. (https://github.com/pachico/maxmind-minfraud-chargeback)
5
 *
6
 * @link https://github.com/pachico/maxmind-minfraud-chargeback for the canonical source repository
7
 * @copyright Copyright (c) 2016-2017 Mariano F.co Benítez Mulet. (https://github.com/pachico/)
8
 * @license https://raw.githubusercontent.com/pachico/maxmind-minfraud-chargeback/master/LICENSE.md MIT
9
 */
10
11
namespace Pachico\MaxMind\MinFraudChargeback\Auth;
12
13
use Webmozart\Assert\Assert;
14
15
/**
16
 * Simple ValueObjet for pairing user and password
17
 */
18
class Credential
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $user;
24
    /**
25
     * @var string
26
     */
27
    protected $password;
28
29
    /**
30
     * @param string $user
31
     * @param string $password
32
     *
33
     * @throws InvalidArgumentException
34
     */
35 4
    public function __construct($user, $password)
36
    {
37 4
        Assert::stringNotEmpty($user);
38 3
        Assert::stringNotEmpty($password);
39
40 2
        $this->user = $user;
41 2
        $this->password = $password;
42 2
    }
43
44
    /**
45
     * @return string
46
     */
47 2
    public function getUser()
48
    {
49 2
        return $this->user;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 2
    public function getPassword()
56
    {
57 2
        return $this->password;
58
    }
59
}
60