Completed
Push — master ( c6286a...4a1f77 )
by Eymen
15s queued 11s
created

Nfc::setMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Passbook package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Passbook\Pass;
11
12
/**
13
 * NFC
14
 */
15
class Nfc implements NfcInterface
16
{
17
    /**
18
     * NFC message
19
     * @var string
20
     */
21
    protected $message = '';
22
23
    /**
24
     * Encryption Public Key
25
     * @var string
26
     */
27
    protected $encryptionPublicKey = '';
28
29
    public function __construct($message, $encryptionPublicKey)
30
    {
31
        $this->setMessage($message);
32
        $this->setEncryptionPublicKey($encryptionPublicKey);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function setMessage($message)
39
    {
40
        $this->message = $message;
41
        return $this;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function setEncryptionPublicKey($encryptionPublicKey)
48
    {
49
        $this->encryptionPublicKey = $encryptionPublicKey;
50
        return $this;
51
    }
52
53
    public function toArray()
54
    {
55
        $array = [
56
            'message' => $this->getMessage(),
57
            'encryptionPublicKey' => $this->getEncryptionPublicKey()
58
        ];
59
        return $array;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function getMessage()
66
    {
67
        return $this->message;
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function getEncryptionPublicKey()
74
    {
75
        return $this->encryptionPublicKey;
76
    }
77
}
78
79