| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | class LtiProvider |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Get the class instance. |
||
| 19 | * |
||
| 20 | * @staticvar LtiProvider $result |
||
| 21 | * |
||
| 22 | * @return LtiProvider |
||
| 23 | */ |
||
| 24 | public static function create() |
||
| 25 | { |
||
| 26 | static $result = null; |
||
| 27 | |||
| 28 | return $result ?: $result = new self(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Oidc login and register. |
||
| 33 | * |
||
| 34 | * @throws Lti1p3\OidcException |
||
| 35 | */ |
||
| 36 | public function login($request = null) |
||
| 37 | { |
||
| 38 | LtiOidcLogin::new(new Lti13Database(), new Lti13Cache(), new Lti13Cookie()) |
||
| 39 | ->doOidcLoginRedirect(api_get_path(WEB_PLUGIN_PATH)."lti_provider/web/game.php", $request) |
||
| 40 | ->doRedirect(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Lti Message Launch. |
||
| 45 | */ |
||
| 46 | public function launch(bool $fromCache = false, ?int $launchId = null): LtiMessageLaunch |
||
| 55 | } |
||
| 56 | } |
||
| 57 |