Merge branch 'MDL-87799' of https://github.com/paulholden/moodle
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
issueNumber: MDL-87799
|
||||
notes:
|
||||
core:
|
||||
- message: >-
|
||||
New `\core\attribute\description` attribute, previously
|
||||
`\core_sms\description`, for representing a language string in code
|
||||
attributes
|
||||
type: improved
|
||||
@@ -14,15 +14,17 @@
|
||||
// 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_sms;
|
||||
namespace core\attribute;
|
||||
|
||||
use core\lang_string;
|
||||
|
||||
/**
|
||||
* A language string attribute used for a description.
|
||||
*
|
||||
* @package core_sms
|
||||
* @package core
|
||||
* @copyright 2024 Andrew Lyons <andrew@nicols.co.uk>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
#[\Attribute]
|
||||
class description extends \lang_string {
|
||||
class description extends lang_string {
|
||||
}
|
||||
@@ -45,4 +45,6 @@ $renamedclasses = [
|
||||
// Since Moodle 5.1.
|
||||
'core_xml_parser' => 'core\\xml_parser',
|
||||
'xml_format_exception' => 'core\\exception\\xml_format_exception',
|
||||
// Since Moodle 5.2.
|
||||
'core_sms\\description' => 'core\\attribute\\description',
|
||||
];
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
namespace core_sms;
|
||||
|
||||
use core\attribute_helper;
|
||||
use core\attribute\description;
|
||||
|
||||
/**
|
||||
* The general status of a message. Gateways are able to provide more specific statuses to supplement these.
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
namespace core_sms;
|
||||
|
||||
use core\lang_string;
|
||||
|
||||
/**
|
||||
* Tests for sms
|
||||
@@ -51,7 +52,7 @@ final class message_status_test extends \advanced_testcase {
|
||||
|
||||
public function test_description(): void {
|
||||
foreach (message_status::cases() as $case) {
|
||||
$this->assertInstanceOf(\lang_string::class, $case->description());
|
||||
$this->assertInstanceOf(lang_string::class, $case->description());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user