-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Improve typing to support refactored template layer #647
ENH Improve typing to support refactored template layer #647
Conversation
d287e85
to
166cd9f
Compare
35782de
to
070f521
Compare
$key = SSTemplateEngine::config()->get('global_key'); | ||
$engine = SSTemplateEngine::create(); | ||
$globalKey = md5($engine->renderString($key, ViewLayerData::create([]))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly use SSTemplateEngine
instead of getting whatever's registered against TemplateEngine
because this config is specific to SSTemplateEngine
and is explicitly ss template syntax.
* | ||
* @return string | ||
*/ | ||
public function getTag() | ||
public function getTag(): string | ||
{ | ||
$template = $this->File->getFrontendTemplate(); | ||
if (empty($template)) { | ||
return ''; | ||
} | ||
return (string)$this->renderWith($template); | ||
return $this->renderWith($template); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a bit of type safety since this method gets used in forTemplate()
above.
070f521
to
313c34c
Compare
$next = $record->dbObject($field)->getValue(); | ||
$next = $record->dbObject($field)?->getValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbObject()
can return null
Issue