29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-08-05 10:40:29 +00:00

[4.0] Codestyle fixes for new CMS codestyle Batch 5/16 (#25456)

This commit is contained in:
Hannes Papenberg 2019-07-11 22:44:58 +02:00 committed by George Wilson
parent 556a2b301a
commit 8ab6fe0c90
20 changed files with 116 additions and 94 deletions

View File

@ -51,7 +51,8 @@ class TagsController extends AdminController
$this->setRedirect(Route::_('index.php?option=com_tags&view=tags', false));
/* @var \Joomla\Component\Tags\Administrator\Model\TagModel $model */
/** @var \Joomla\Component\Tags\Administrator\Model\TagModel $model */
$model = $this->getModel();
if ($model->rebuild())

View File

@ -243,7 +243,8 @@ class TagModel extends AdminModel
*/
public function save($data)
{
/* @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
/** @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
$table = $this->getTable();
$input = Factory::getApplication()->input;
$pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState($this->getName() . '.id');
@ -364,7 +365,8 @@ class TagModel extends AdminModel
public function rebuild()
{
// Get an instance of the table object.
/* @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
/** @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
$table = $this->getTable();
if (!$table->rebuild())
@ -395,7 +397,8 @@ class TagModel extends AdminModel
public function saveorder($idArray = null, $lft_array = null)
{
// Get an instance of the table object.
/* @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
/** @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
$table = $this->getTable();
if (!$table->saveorder($idArray, $lft_array))
@ -425,7 +428,8 @@ class TagModel extends AdminModel
protected function generateNewTitle($parent_id, $alias, $title)
{
// Alter the title & alias
/* @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
/** @var \Joomla\Component\Tags\Administrator\Table\Tag $table */
$table = $this->getTable();
while ($table->load(array('alias' => $alias, 'parent_id' => $parent_id)))

View File

@ -59,6 +59,7 @@ class WorkflowsController extends AdminController
throw new \InvalidArgumentException(Text::_('COM_WORKFLOW_ERROR_EXTENSION_NOT_SET'));
}
}
$this->registerTask('unsetDefault', 'setDefault');
}

View File

@ -188,9 +188,11 @@ class CategoryModel extends ListModel
if ($this->getState('filter.publish_date'))
{
$query->where('(' . $query->isNullDatetime($db->quoteName('a.publish_up'))
. ' OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)')
. ' OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)'
)
->where('(' . $query->isNullDatetime($db->quoteName('a.publish_down'))
. ' OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)')
. ' OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)'
)
->bind(':publish_up', $nowDate)
->bind(':publish_down', $nowDate);
}

View File

@ -356,9 +356,11 @@ class ContactModel extends FormModel
{
$query->where('a.state IN (1,2)')
->where('(' . $db->quoteName('a.publish_up') . ' = :null' .
' OR ' . $db->quoteName('a.publish_up') . ' <= :now' . ')')
' OR ' . $db->quoteName('a.publish_up') . ' <= :now' . ')'
)
->where('(' . $db->quoteName('a.publish_down') . ' = :null' .
' OR ' . $db->quoteName('a.publish_down') . ' >= :now' . ')')
' OR ' . $db->quoteName('a.publish_down') . ' >= :now' . ')'
)
->bind(':null', $nullDate)
->bind(':now', $nowDate);
}

View File

@ -122,9 +122,11 @@ class FeaturedModel extends ListModel
$nowDate = $db->quote($date->toSql());
$query->where('(' . $query->isNullDatetime($db->quoteName('a.publish_up')) .
' OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)')
' OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)'
)
->where('(' . $query->isNullDatetime($db->quoteName('a.publish_down')) .
' OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)')
' OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)'
)
->bind(':publish_up', $nowDate)
->bind(':publish_down', $nowDate);
}

View File

@ -44,7 +44,7 @@ class HtmlView extends CategoryView
/**
* Run the standard Joomla plugins
*
* @var bool
* @var boolean
* @since 3.5
*/
protected $runPlugins = true;

View File

@ -65,7 +65,7 @@ class HtmlView extends BaseHtmlView
/**
* Should we show a captcha form for the submission of the contact request?
*
* @var bool
* @var boolean
* @since 3.6.3
*/
protected $captchaEnabled = false;

View File

@ -119,7 +119,8 @@ class ArticleModel extends ItemModel
// Join on category table.
$query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access,' .
'c.language AS category_language')
'c.language AS category_language'
)
->innerJoin('#__categories AS c on c.id = a.catid')
->where('c.published > 0');
@ -135,7 +136,8 @@ class ArticleModel extends ItemModel
// Join over the categories to get parent category titles
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route,' .
'parent.alias as parent_alias, parent.language as parent_language')
'parent.alias as parent_alias, parent.language as parent_language'
)
->join('LEFT', '#__categories as parent ON parent.id = c.parent_id');
// Join on voting table

View File

@ -251,7 +251,8 @@ class ArticlesModel extends ListModel
// Join over the categories.
$query->select('c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,' .
'c.language AS category_language')
'c.language AS category_language'
)
->select('c.published, c.published AS parents_published, c.lft')
->join('LEFT', '#__categories AS c ON c.id = a.catid');
@ -263,14 +264,16 @@ class ArticlesModel extends ListModel
// Join over the categories to get parent category titles
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,' .
'parent.language as parent_language')
'parent.language as parent_language'
)
->join('LEFT', '#__categories as parent ON parent.id = c.parent_id');
if (PluginHelper::isEnabled('content', 'vote'))
{
// Join on voting table
$query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count')
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count'
)
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
}
@ -292,7 +295,8 @@ class ArticlesModel extends ListModel
* Or categogy is published then article has to be archived.
*/
$query->where('((c.published = 2 AND ws.condition > ' . (int) ContentComponent::CONDITION_UNPUBLISHED .
') OR (c.published = 1 AND ws.condition = ' . (int) ContentComponent::CONDITION_ARCHIVED . '))');
') OR (c.published = 1 AND ws.condition = ' . (int) ContentComponent::CONDITION_ARCHIVED . '))'
);
}
elseif (is_numeric($condition))
{

View File

@ -429,7 +429,8 @@ class SearchModel extends ListModel
$this->setState('list.start', $input->get('limitstart', 0, 'uint'));
$this->setState('list.limit', $input->get('limit', $app->get('list_limit', 20), 'uint'));
/* Load the sort ordering.
/*
* Load the sort ordering.
* Currently this is 'hard' coded via menu item parameter but may not satisfy a users need.
* More flexibility was way more user friendly. So we allow the user to pass a custom value
* from the pool of fields that are indexed like the 'title' field.
@ -437,6 +438,7 @@ class SearchModel extends ListModel
*/
$order = $input->getWord('filter_order', $params->get('sort_order', 'relevance'));
$order = StringHelper::strtolower($order);
switch ($order)
{
case 'date':
@ -461,13 +463,15 @@ class SearchModel extends ListModel
break;
}
/* Load the sort direction.
/*
* Load the sort direction.
* Currently this is 'hard' coded via menu item parameter but may not satisfy a users need.
* More flexibility was way more user friendly. So we allow to be inverted.
* Also, we allow this parameter to be passed in either case (lower/upper).
*/
$dirn = $input->getWord('filter_order_Dir', $params->get('sort_direction', 'desc'));
$dirn = StringHelper::strtolower($dirn);
switch ($dirn)
{
case 'asc':