31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-09-27 20:19:01 +00:00

Less else

This commit is contained in:
Michael Babker 2015-02-22 19:07:05 -05:00
parent 003b9c5791
commit cbd5fcc1dc
2 changed files with 26 additions and 30 deletions

View File

@ -425,14 +425,12 @@ class PullsModel extends \JModelDatabase
return (int) $this->getDb()->loadResult();
}
// Otherwise fall back to inefficient way of counting all results.
else
{
$this->getDb()->setQuery($query)->execute();
return (int) $this->getDb()->getNumRows();
}
}
/**
* Method to cache the last query constructed.

View File

@ -31,8 +31,11 @@ class DefaultHtmlView extends \JViewHtml
$file = isset($tpl) ? $this->getLayout() . '_' . $tpl : $this->getLayout();
$path = $this->getPath($file);
if ($path)
if (!$path)
{
throw new \RuntimeException(\JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500);
}
// Unset so as not to introduce into template scope
unset($tpl);
unset($file);
@ -54,9 +57,4 @@ class DefaultHtmlView extends \JViewHtml
return $output;
}
else
{
throw new \RuntimeException(\JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500);
}
}
}