MDL-62599 mod_lti: fix coding style issues
This commit is contained in:
@@ -3144,9 +3144,9 @@ function lti_convert_from_jwt($typeid, $jwtparam) {
|
||||
if (!empty($value) && $mapping['isarray']) {
|
||||
if (is_array($value)) {
|
||||
if (is_array($value[0])) {
|
||||
$value = json_encode($value);
|
||||
$value = json_encode($value);
|
||||
} else {
|
||||
$value = implode(',', $value);
|
||||
$value = implode(',', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3262,7 +3262,8 @@ function lti_post_launch_html($newparms, $endpoint, $debug=false) {
|
||||
* @param string $text Description of content item
|
||||
* @return string
|
||||
*/
|
||||
function lti_initiate_login($courseid, $id, $instance, $config, $messagetype = 'basic-lti-launch-request', $title = '', $text = '') {
|
||||
function lti_initiate_login($courseid, $id, $instance, $config, $messagetype = 'basic-lti-launch-request', $title = '',
|
||||
$text = '') {
|
||||
global $SESSION, $USER;
|
||||
|
||||
if (!empty($instance)) {
|
||||
|
||||
@@ -1188,13 +1188,13 @@ MwIDAQAB
|
||||
$objgraph->title = 'Test title';
|
||||
$objgraph->text = 'Test text';
|
||||
$objgraph->frame = [];
|
||||
$objgraph->$strtype = 'LtiLinkItem';
|
||||
$objgraph->{$strtype} = 'LtiLinkItem';
|
||||
$objgraph->mediaType = 'application\/vnd.ims.lti.v1.ltilink';
|
||||
|
||||
$expected = new stdClass();
|
||||
$expected->$strcontext = 'http://purl.imsglobal.org/ctx/lti/v1/ContentItem';
|
||||
$expected->$strgraph = [];
|
||||
$expected->$strgraph[] = $objgraph;
|
||||
$expected->{$strcontext} = 'http://purl.imsglobal.org/ctx/lti/v1/ContentItem';
|
||||
$expected->{$strgraph} = [];
|
||||
$expected->{$strgraph}[] = $objgraph;
|
||||
|
||||
$this->assertEquals($expected, $jsondecode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user