Skip to content

Commit

Permalink
[4.0] Use identical operators for plugins (#19699)
Browse files Browse the repository at this point in the history
* Update dependencies

* Use identical operators for plugins

* Update calendar.php

* Update color.php

* Update editor.php

* Update imagelist.php

* Update integer.php

* Update list.php

* Update radio.php

* Update url.php

* Update usergrouplist.php

* Update user.php

* Update textarea.php

* Update text.php

* Update sql.php

* Update media.php

* Update blog.php

* Update imagelist.php
  • Loading branch information
C-Lodder authored and laoneo committed Oct 15, 2018
1 parent 4552016 commit 188b7b7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions plugins/content/fields/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class PlgContentFields extends CMSPlugin
public function onContentPrepare($context, &$item, &$params, $page = 0)
{
// If the item has a context, overwrite the existing one
if ($context == 'com_finder.indexer' && !empty($item->context))
if ($context === 'com_finder.indexer' && !empty($item->context))
{
$context = $item->context;
}
elseif ($context == 'com_finder.indexer')
elseif ($context === 'com_finder.indexer')
{
// Don't run this plugin when the content is being indexed and we have no real context
return;
Expand Down Expand Up @@ -119,7 +119,7 @@ private function prepare($string, $context, $item)
$layout = !empty($explode[1]) ? trim($explode[1]) : 'render';
$output = '';

if ($match[1] == 'field' && $id)
if ($match[1] === 'field' && $id)
{
if (isset($fieldsById[$id]))
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/content/vote/tmpl/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @var string $path Path to this file
*/

if ($context == 'com_content.categories')
if ($context === 'com_content.categories')
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/search/categories/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu
$wheres2[] = 'a.description LIKE ' . $word;
$wheres[] = implode(' OR ', $wheres2);
}
$where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')';
$where = '(' . implode(($phrase === 'all' ? ') AND (' : ') OR ('), $wheres) . ')';
break;
}
*/
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function onAfterInitialise()
$results = $this->app->triggerEvent('onPageCacheSetCaching');
$caching = !in_array(false, $results, true);

if ($caching && $user->get('guest') && $app->input->getMethod() == 'GET')
if ($caching && $user->get('guest') && $app->input->getMethod() === 'GET')
{
$this->_cache->setCaching(true);
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/system/fields/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function onContentAfterSave($context, $item, $isNew, $data = array())
}

// Create correct context for category
if ($context == 'com_categories.category')
if ($context === 'com_categories.category')
{
$context = $item->extension . '.categories';

Expand Down Expand Up @@ -361,7 +361,7 @@ private function display($context, $item, $params, $displayType)
}

// If we have a category, set the catid field to fetch only the fields which belong to it
if ($parts[1] == 'categories' && !isset($item->catid))
if ($parts[1] === 'categories' && !isset($item->catid))
{
$item->catid = $item->id;
}
Expand All @@ -388,13 +388,13 @@ private function display($context, $item, $params, $displayType)
{
$app = Factory::getApplication();

if ($app->isClient('site') && Multilanguage::isEnabled() && isset($item->language) && $item->language == '*')
if ($app->isClient('site') && Multilanguage::isEnabled() && isset($item->language) && $item->language === '*')
{
$lang = $app->getLanguage()->getTag();

foreach ($fields as $key => $field)
{
if ($field->language == '*' || $field->language == $lang)
if ($field->language === '*' || $field->language == $lang)
{
continue;
}
Expand Down

0 comments on commit 188b7b7

Please sign in to comment.