Skip to content

Commit

Permalink
ENH BaseElement::getType() use static::class instead of __CLASS__ for…
Browse files Browse the repository at this point in the history
… 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`.
  • Loading branch information
christopherdarling authored Jan 19, 2024
1 parent d13eec6 commit bf8d867
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function getType()
{
$default = $this->i18n_singular_name() ?: 'Block';

return _t(__CLASS__ . '.BlockType', $default);
return _t(static::class . '.BlockType', $default);
}

/**
Expand Down

0 comments on commit bf8d867

Please sign in to comment.