Skip to content

Commit

Permalink
Tiny refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
  • Loading branch information
kamil-tekiela committed Jun 3, 2022
1 parent 03e1859 commit ec888c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/classes/Controllers/Table/ReplaceController.php
Expand Up @@ -325,7 +325,7 @@ public function __invoke(): void
);

// Builds the sql query
if ($isInsert && count($valueSets) > 0) {
if ($isInsert && $valueSets !== []) {
$GLOBALS['query'] = $this->insertEdit->buildSqlQuery($isInsertignore, $queryFields, $valueSets);
} elseif (empty($GLOBALS['query']) && ! isset($_POST['preview_sql']) && ! $rowSkipped) {
// No change -> move back to the calling script
Expand Down Expand Up @@ -399,7 +399,7 @@ public function __invoke(): void
$returnToSqlQuery,
] = $this->insertEdit->executeSqlQuery($GLOBALS['urlParams'], $GLOBALS['query']);

if ($isInsert && (count($valueSets) > 0 || $rowSkipped)) {
if ($isInsert && ($valueSets !== [] || $rowSkipped)) {
$GLOBALS['message'] = Message::getMessageForInsertedRows($totalAffectedRows);
$GLOBALS['unsaved_values'] = array_values($GLOBALS['unsaved_values']);
} else {
Expand Down Expand Up @@ -437,7 +437,7 @@ public function __invoke(): void
* link/transformed value and exit
*/
if (isset($_POST['rel_fields_list']) && $_POST['rel_fields_list'] != '') {
$map = $this->relation->getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'both');
$map = $this->relation->getForeigners($GLOBALS['db'], $GLOBALS['table']);

/** @var array<int,array> $relation_fields */
$relation_fields = [];
Expand Down

0 comments on commit ec888c4

Please sign in to comment.