MDL-76583 core_external: Migrate external_description class

This commit is contained in:
Andrew Nicols
2023-01-19 07:33:34 +08:00
parent cdd51a663b
commit 6f185f1873
2 changed files with 51 additions and 33 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_external;
/**
* Common ancestor of all parameter description classes
*
* @package core_webservice
* @copyright 2009 Petr Skodak
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0
*/
abstract class external_description {
/** @var string Description of element */
public $desc;
/** @var bool Element value required, null not allowed */
public $required;
/** @var mixed Default value */
public $default;
/**
* Contructor
*
* @param string $desc
* @param bool $required
* @param mixed $default
* @since Moodle 2.0
*/
public function __construct($desc, $required, $default) {
$this->desc = $desc;
$this->required = $required;
$this->default = $default;
}
}
+1 -33
View File
@@ -45,39 +45,7 @@ class restricted_context_exception extends moodle_exception {
}
class_alias(\core_external\external_api::class, 'external_api');
/**
* Common ancestor of all parameter description classes
*
* @package core_webservice
* @copyright 2009 Petr Skodak
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0
*/
abstract class external_description {
/** @var string Description of element */
public $desc;
/** @var bool Element value required, null not allowed */
public $required;
/** @var mixed Default value */
public $default;
/**
* Contructor
*
* @param string $desc
* @param bool $required
* @param mixed $default
* @since Moodle 2.0
*/
public function __construct($desc, $required, $default) {
$this->desc = $desc;
$this->required = $required;
$this->default = $default;
}
}
class_alias(\core_external\external_description::class, 'external_description');
/**
* Scalar value description class