-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.3] Code cleanup #44586
base: 5.3-dev
Are you sure you want to change the base?
[5.3] Code cleanup #44586
Conversation
@@ -52,13 +52,13 @@ public function thumb($template, $clientId = 0) | |||
$template->xmldata = TemplatesHelper::parseXMLTemplateFile($client->id === 0 ? JPATH_ROOT : JPATH_ROOT . '/administrator', $template->name); | |||
} | |||
|
|||
if ((isset($template->xmldata->inheritable) && (bool) $template->xmldata->inheritable) || isset($template->xmldata->parent)) { | |||
if (isset($template->xmldata->parent) && (string) $template->xmldata->parent !== '' && file_exists(JPATH_ROOT . '/media/templates/' . $client->name . '/' . (string) $template->xmldata->parent . '/images/template_thumbnail.png')) { | |||
if ((isset($template->xmldata->inheritable) && $template->xmldata->inheritable) || isset($template->xmldata->parent)) { |
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.
is it not better to cast the value of inheritable to a boolean. This ensures that any non-boolean value is explicitly converted to true or false otherwise the value is evaluated in its original type ???
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.
It's implicitly coerced to boolean, that's why the type cast is redundant. See https://www.php.net/manual/en/language.types.type-juggling.php
administrator/components/com_menus/src/Model/MenutypesModel.php
Outdated
Show resolved
Hide resolved
c9d4371
to
b3b5b05
Compare
b3b5b05
to
fc8d2d6
Compare
Summary of Changes
dirname(__FILE__)
with__DIR__
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed