From bf8d867ede2cd6d2ad14b37d02140c6b85c653f7 Mon Sep 17 00:00:00 2001 From: Christopher Darling Date: Fri, 19 Jan 2024 08:48:00 +0000 Subject: [PATCH] ENH BaseElement::getType() use static::class instead of __CLASS__ for better defaults Without this then the default is always the singular name of `BaseElement` ('Block'). This allows each subclass to have a more sensible default based on `$singular_name`. --- src/Models/BaseElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php index d0ca9805..e1078558 100644 --- a/src/Models/BaseElement.php +++ b/src/Models/BaseElement.php @@ -441,7 +441,7 @@ public function getType() { $default = $this->i18n_singular_name() ?: 'Block'; - return _t(__CLASS__ . '.BlockType', $default); + return _t(static::class . '.BlockType', $default); } /**