MailxpertApp   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A getSecret() 0 4 1
A serialize() 0 4 1
A unserialize() 0 6 1
1
<?php
2
/**
3
 * sources.
4
 * Date: 14/08/15
5
 */
6
7
namespace Mailxpert;
8
9
/**
10
 * Class MailxpertApp
11
 * @package Mailxpert
12
 */
13
class MailxpertApp
14
{
15
    /**
16
     * @var string The app ID.
17
     */
18
    private $id;
19
20
    /**
21
     * @var string The app secret.
22
     */
23
    private $secret;
24
25
    /**
26
     * @param string $id
27
     * @param string $secret
28
     */
29
    public function __construct($id, $secret)
30
    {
31
        $this->id = $id;
32
        $this->secret = $secret;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getId()
39
    {
40
        return $this->id;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getSecret()
47
    {
48
        return $this->secret;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function serialize()
55
    {
56
        return serialize([$this->id, $this->secret]);
57
    }
58
59
    /**
60
     * @param string $serialized
61
     */
62
    public function unserialize($serialized)
63
    {
64
        list($id, $secret) = unserialize($serialized);
65
66
        $this->__construct($id, $secret);
67
    }
68
}
69