Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
70.00% |
7 / 10 |
|
50.00% |
3 / 6 |
CRAP | |
0.00% |
0 / 1 |
| UserDataSessionContext | |
70.00% |
7 / 10 |
|
50.00% |
3 / 6 |
6.97 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| getUserId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUserLogin | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUserName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUserEmail | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLocale | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2013-2024 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | */ |
| 20 | |
| 21 | namespace oat\tao\model\session\Context; |
| 22 | |
| 23 | use oat\oatbox\session\SessionContext; |
| 24 | |
| 25 | class UserDataSessionContext implements SessionContext |
| 26 | { |
| 27 | private ?string $userId; |
| 28 | private ?string $userLogin; |
| 29 | private ?string $userName; |
| 30 | private ?string $userEmail; |
| 31 | private ?string $locale; |
| 32 | |
| 33 | public function __construct( |
| 34 | string $userId = null, |
| 35 | string $userLogin = null, |
| 36 | string $userName = null, |
| 37 | string $userEmail = null, |
| 38 | string $locale = null |
| 39 | ) { |
| 40 | $this->userId = $userId; |
| 41 | $this->userLogin = $userLogin; |
| 42 | $this->userName = $userName; |
| 43 | $this->userEmail = $userEmail; |
| 44 | $this->locale = $locale; |
| 45 | } |
| 46 | |
| 47 | public function getUserId(): ?string |
| 48 | { |
| 49 | return $this->userId; |
| 50 | } |
| 51 | |
| 52 | public function getUserLogin(): ?string |
| 53 | { |
| 54 | return $this->userLogin; |
| 55 | } |
| 56 | |
| 57 | public function getUserName(): ?string |
| 58 | { |
| 59 | return $this->userName; |
| 60 | } |
| 61 | |
| 62 | public function getUserEmail(): ?string |
| 63 | { |
| 64 | return $this->userEmail; |
| 65 | } |
| 66 | |
| 67 | public function getLocale(): ?string |
| 68 | { |
| 69 | return $this->locale; |
| 70 | } |
| 71 | } |