mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-77348 mod_lti: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is deprecated and emits a deprecation notice. So we need to add missing class properties that still need to be declared. While working on this issue, even though it's not related to the deprecation issue, I added 'use core_external\external_api' to avoid the 'Undefined type external_api' warning at mod_lti_testcase::generate_tool_proxy().
This commit is contained in:
parent
52f512e5cf
commit
67e583783c
@ -81,6 +81,9 @@ class OAuthConsumer {
|
||||
public $key;
|
||||
public $secret;
|
||||
|
||||
/** @var string|null callback URL. */
|
||||
public ?string $callback_url;
|
||||
|
||||
function __construct($key, $secret, $callback_url = null) {
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
|
@ -40,6 +40,12 @@ use stdClass;
|
||||
*/
|
||||
class registration_upgrade_choice_page implements renderable, templatable {
|
||||
|
||||
/** @var array array of tools. */
|
||||
protected array $tools = [];
|
||||
|
||||
/** @var string tool URL. */
|
||||
protected string $startregurl;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -48,6 +48,12 @@ use stdClass;
|
||||
*/
|
||||
class repost_crosssite_page implements renderable, templatable {
|
||||
|
||||
/** @var array POST params. */
|
||||
protected $params;
|
||||
|
||||
/** @var string URL to repost to. */
|
||||
protected string $url;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -76,8 +76,6 @@ class mod_lti_mod_form extends moodleform_mod {
|
||||
$showtypes = !$typeid;
|
||||
}
|
||||
|
||||
$this->typeid = 0;
|
||||
|
||||
$mform =& $this->_form;
|
||||
|
||||
// Adding the "general" fieldset, where all the common settings are shown.
|
||||
|
@ -302,7 +302,7 @@ class gradebookservices_test extends \advanced_testcase {
|
||||
$this->assertEquals(!empty($subreviewurl), isset($lineitem->submissionReview));
|
||||
if ($subreviewurl) {
|
||||
if ($subreviewurl == 'DEFAULT') {
|
||||
$this->assertFalse(isset($this->submissionReview->url));
|
||||
$this->assertFalse(isset($lineitem->submissionReview->url));
|
||||
} else {
|
||||
$this->assertEquals($subreviewurl, $lineitem->submissionReview->url);
|
||||
}
|
||||
@ -310,7 +310,7 @@ class gradebookservices_test extends \advanced_testcase {
|
||||
$custom = $lineitem->submissionReview->custom;
|
||||
$this->assertEquals($subreviewparams, join("\n", array_map(fn($k) => $k.'='.$custom[$k], array_keys($custom))));
|
||||
} else {
|
||||
$this->assertFalse(isset($this->submissionReview->custom));
|
||||
$this->assertFalse(isset($lineitem->submissionReview->custom));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use core_external\external_api;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
global $CFG;
|
||||
|
Loading…
x
Reference in New Issue
Block a user