| Code Coverage | ||||||||||
| Lines | Functions and Methods | Classes and Traits | ||||||||
| Total |  | 100.00% | 14 / 14 |  | 100.00% | 8 / 8 | CRAP |  | 100.00% | 1 / 1 | 
| LtiLaunchCommand |  | 100.00% | 14 / 14 |  | 100.00% | 8 / 8 | 8 |  | 100.00% | 1 / 1 | 
| __construct |  | 100.00% | 7 / 7 |  | 100.00% | 1 / 1 | 1 | |||
| getLtiProvider |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getRoles |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getClaims |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getResourceIdentifier |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getUser |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getOpenIdLoginHint |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| getLaunchUrl |  | 100.00% | 1 / 1 |  | 100.00% | 1 / 1 | 1 | |||
| 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) 2020 (original work) Open Assessment Technologies SA | 
| 19 | */ | 
| 20 | |
| 21 | declare(strict_types=1); | 
| 22 | |
| 23 | namespace oat\taoLti\models\classes\Tool; | 
| 24 | |
| 25 | use oat\oatbox\user\User; | 
| 26 | use oat\taoLti\models\classes\LtiProvider\LtiProvider; | 
| 27 | |
| 28 | class LtiLaunchCommand implements LtiLaunchCommandInterface | 
| 29 | { | 
| 30 | /** @var LtiProvider */ | 
| 31 | private $ltiProvider; | 
| 32 | |
| 33 | /** @var User */ | 
| 34 | private $user; | 
| 35 | |
| 36 | /** @var bool */ | 
| 37 | private $openIdLoginHint; | 
| 38 | |
| 39 | /** @var array */ | 
| 40 | private $roles; | 
| 41 | |
| 42 | /** @var array */ | 
| 43 | private $claims; | 
| 44 | |
| 45 | /** @var string */ | 
| 46 | private $resourceIdentifier; | 
| 47 | |
| 48 | /** @var string */ | 
| 49 | private $launchUrl; | 
| 50 | |
| 51 | public function __construct( | 
| 52 | LtiProvider $ltiProvider, | 
| 53 | array $roles, | 
| 54 | array $claims, | 
| 55 | string $resourceIdentifier, | 
| 56 | User $user, | 
| 57 | string $openIdLoginHint, | 
| 58 | string $launchUrl = null | 
| 59 | ) { | 
| 60 | $this->ltiProvider = $ltiProvider; | 
| 61 | $this->roles = $roles; | 
| 62 | $this->claims = $claims; | 
| 63 | $this->resourceIdentifier = $resourceIdentifier; | 
| 64 | $this->user = $user; | 
| 65 | $this->openIdLoginHint = $openIdLoginHint; | 
| 66 | $this->launchUrl = $launchUrl; | 
| 67 | } | 
| 68 | |
| 69 | public function getLtiProvider(): LtiProvider | 
| 70 | { | 
| 71 | return $this->ltiProvider; | 
| 72 | } | 
| 73 | |
| 74 | public function getRoles(): array | 
| 75 | { | 
| 76 | return $this->roles; | 
| 77 | } | 
| 78 | |
| 79 | public function getClaims(): array | 
| 80 | { | 
| 81 | return $this->claims; | 
| 82 | } | 
| 83 | |
| 84 | public function getResourceIdentifier(): string | 
| 85 | { | 
| 86 | return $this->resourceIdentifier; | 
| 87 | } | 
| 88 | |
| 89 | public function getUser(): User | 
| 90 | { | 
| 91 | return $this->user; | 
| 92 | } | 
| 93 | |
| 94 | public function getOpenIdLoginHint(): string | 
| 95 | { | 
| 96 | return $this->openIdLoginHint; | 
| 97 | } | 
| 98 | |
| 99 | public function getLaunchUrl(): ?string | 
| 100 | { | 
| 101 | return $this->launchUrl; | 
| 102 | } | 
| 103 | } |