Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janschoenherr committed Dec 3, 2024
1 parent 9800738 commit 0e383a7
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion components/com_config/src/Model/ModulesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
}

// Attempt to load the xml file.
if (!$xml = simplexml_load_file($formFile)) {
if (!simplexml_load_file($formFile)) {
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/com_config/src/Model/TemplatesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
}

// Attempt to load the xml file.
if (!$xml = simplexml_load_file($formFile)) {
if (!simplexml_load_file($formFile)) {
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
}

Expand Down
4 changes: 2 additions & 2 deletions components/com_contact/src/Model/CategoriesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ public function getItems()
}

/**
* Gets the id of the parent category for the selected list of categories
* Gets the parent category for the selected list of categories
*
* @return integer The id of the parent category
* @return CategoryNode|null The parent category
*
* @since 1.6.0
*/
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/src/Model/ContactModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function getItem($pk = null)
}

// Compute access permissions.
if (($access = $this->getState('filter.access'))) {
if ($this->getState('filter.access')) {
// If the access filter has been set, we already know this user can view.
$data->params->set('access-view', true);
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getCategorySegment($id, $query)

if ($this->noIDs) {
foreach ($path as &$segment) {
list($id, $segment) = explode(':', $segment, 2);
[, $segment] = explode(':', $segment, 2);
}
}

Expand Down
2 changes: 0 additions & 2 deletions components/com_content/src/Helper/QueryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ public static function orderbySecondary($orderby, $orderDate = 'created', ?Datab
*/
public static function getQueryDate($orderDate, ?DatabaseInterface $db = null)
{
$db = $db ?: Factory::getDbo();

switch ($orderDate) {
case 'modified':
$queryDate = ' CASE WHEN a.modified IS NULL THEN a.created ELSE a.modified END';
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/src/Model/ArticleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function getItem($pk = null)
}

// Compute view access permissions.
if ($access = $this->getState('filter.access')) {
if ($this->getState('filter.access')) {
// If the access filter has been set, we already know this user can view.
$data->params->set('access-view', true);
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function getCategorySegment($id, $query)

if ($this->noIDs) {
foreach ($path as &$segment) {
list($id, $segment) = explode(':', $segment, 2);
[, $segment] = explode(':', $segment, 2);
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/com_finder/src/Model/SearchModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getItems()
$results = [];

// Convert the rows to result objects.
foreach ($items as $rk => $row) {
foreach ($items as $row) {
// Build the result object.
if (\is_resource($row->object)) {
$result = unserialize(stream_get_contents($row->object));
Expand Down
2 changes: 1 addition & 1 deletion components/com_newsfeeds/src/Model/NewsfeedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function &getItem($pk = null)

// Compute access permissions.

if ($access = $this->getState('filter.access')) {
if ($this->getState('filter.access')) {
// If the access filter has been set, we already know this user can view.
$data->params->set('access-view', true);
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/com_newsfeeds/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function getCategorySegment($id, $query)

if ($this->noIDs) {
foreach ($path as &$segment) {
list($id, $segment) = explode(':', $segment, 2);
[, $segment] = explode(':', $segment, 2);
}
}

Expand Down
4 changes: 0 additions & 4 deletions components/com_privacy/src/Model/RemindModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\UserHelper;
use Joomla\Component\Privacy\Administrator\Table\ConsentTable;
use Joomla\Database\Exception\ExecutionFailureException;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -70,9 +69,6 @@ public function remindRequest($data)
return false;
}

/** @var ConsentTable $table */
$table = $this->getTable();

$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName(['r.id', 'r.user_id', 'r.token']));
Expand Down
2 changes: 1 addition & 1 deletion components/com_tags/src/Service/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function build(&$query)

foreach ($segments as &$segment) {
if (strpos($segment, ':')) {
[$void, $segment] = explode(':', $segment, 2);
[, $segment] = explode(':', $segment, 2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/com_users/src/Model/ResetModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getForm($data = [], $loadData = true)
public function getResetCompleteForm($data = [], $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_users.reset_complete', 'reset_complete', $options = ['control' => 'jform']);
$form = $this->loadForm('com_users.reset_complete', 'reset_complete', ['control' => 'jform']);

if (empty($form)) {
return false;
Expand All @@ -99,7 +99,7 @@ public function getResetCompleteForm($data = [], $loadData = true)
public function getResetConfirmForm($data = [], $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_users.reset_confirm', 'reset_confirm', $options = ['control' => 'jform']);
$form = $this->loadForm('com_users.reset_confirm', 'reset_confirm', ['control' => 'jform']);

if (empty($form)) {
return false;
Expand Down

0 comments on commit 0e383a7

Please sign in to comment.