1 | <?php |
||
2 | /** |
||
3 | * LabelUser.php |
||
4 | * Copyright (c) 2018 [email protected] |
||
5 | * |
||
6 | * This file is part of Firefly III. |
||
7 | * |
||
8 | * Firefly III is free software: you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU General Public License as published by |
||
10 | * the Free Software Foundation, either version 3 of the License, or |
||
11 | * (at your option) any later version. |
||
12 | * |
||
13 | * Firefly III is distributed in the hope that it will be useful, |
||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
16 | * GNU General Public License for more details. |
||
17 | * |
||
18 | * You should have received a copy of the GNU General Public License |
||
19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
||
20 | */ |
||
21 | |||
22 | declare(strict_types=1); |
||
23 | |||
24 | namespace FireflyIII\Services\Bunq\Object; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Class LabelUser |
||
29 | */ |
||
30 | class LabelUser extends BunqObject |
||
31 | { |
||
32 | /** @var Avatar */ |
||
33 | private $avatar; |
||
34 | /** @var string */ |
||
35 | private $country; |
||
36 | /** @var string */ |
||
37 | private $displayName; |
||
38 | /** @var string */ |
||
39 | private $publicNickName; |
||
40 | /** @var string */ |
||
41 | private $uuid; |
||
42 | |||
43 | /** |
||
44 | * LabelUser constructor. |
||
45 | * |
||
46 | * @param array $data |
||
47 | */ |
||
48 | public function __construct(array $data) |
||
49 | { |
||
50 | $this->uuid = $data['uuid']; |
||
51 | $this->displayName = $data['display_name']; |
||
52 | $this->country = $data['country']; |
||
53 | $this->publicNickName = $data['public_nick_name']; |
||
54 | $this->avatar = new Avatar($data['avatar']); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return Avatar |
||
59 | */ |
||
60 | public function getAvatar(): Avatar |
||
61 | { |
||
62 | return $this->avatar; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getDisplayName(): string |
||
69 | { |
||
70 | return $this->displayName; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getPublicNickName(): string |
||
77 | { |
||
78 | return $this->publicNickName; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | public function toArray(): array |
||
85 | { |
||
86 | die(sprintf('Cannot convert %s to array.', get_class($this))); |
||
0 ignored issues
–
show
|
|||
87 | } |
||
88 | } |
||
89 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.