Skip to content

Commit 5280f04

Browse files
Merge pull request #18125 from kamil-tekiela/UseIdenticalOverEqualWithSameTypeRector
Use identical over equal with same type rector
2 parents 41e9b64 + 8f7c28b commit 5280f04

32 files changed

Lines changed: 78 additions & 82 deletions

‎libraries/classes/BrowseForeigners.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ private function getHtmlForGotoPage(?array $foreignData): string
325325
*/
326326
public function getForeignLimit(?string $foreignShowAll): ?string
327327
{
328-
if (isset($foreignShowAll) && $foreignShowAll == __('Show all')) {
328+
if ($foreignShowAll === __('Show all')) {
329329
return null;
330330
}
331331

‎libraries/classes/Common.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public static function cleanupPathInfo(): void
424424
$path_info_pos = mb_strrpos($GLOBALS['PMA_PHP_SELF'], $_PATH_INFO);
425425
if ($path_info_pos !== false) {
426426
$path_info_part = mb_substr($GLOBALS['PMA_PHP_SELF'], $path_info_pos, mb_strlen($_PATH_INFO));
427-
if ($path_info_part == $_PATH_INFO) {
427+
if ($path_info_part === $_PATH_INFO) {
428428
$GLOBALS['PMA_PHP_SELF'] = mb_substr($GLOBALS['PMA_PHP_SELF'], 0, $path_info_pos);
429429
}
430430
}

‎libraries/classes/Config.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ public function selectServer(): int
11061106
if (
11071107
$server['host'] == $request
11081108
|| $server['verbose'] == $request
1109-
|| $verboseToLower == $serverToLower
1109+
|| $verboseToLower === $serverToLower
11101110
|| md5($verboseToLower) === $serverToLower
11111111
) {
11121112
$request = $i;

‎libraries/classes/ConfigStorage/Relation.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,9 @@ public function buildForeignDropdown(array $foreign, $data, $mode): array
837837
} else {
838838
$key = '0x' . bin2hex($key);
839839
if (str_contains($data, '0x')) {
840-
$selected = ($key == trim($data));
840+
$selected = ($key === trim($data));
841841
} else {
842-
$selected = ($key == '0x' . $data);
842+
$selected = ($key === '0x' . $data);
843843
}
844844
}
845845

‎libraries/classes/Controllers/Table/RelationController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public function getDropdownValueForDatabase(string $storageEngine): void
381381
$tables_rs = $this->dbi->query($query);
382382

383383
foreach ($tables_rs as $row) {
384-
if (! isset($row['Engine']) || mb_strtoupper($row['Engine']) != $storageEngine) {
384+
if (! isset($row['Engine']) || mb_strtoupper($row['Engine']) !== $storageEngine) {
385385
continue;
386386
}
387387

‎libraries/classes/Database/Designer/Common.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public function addNewRelation($db, $T1, $F1, $T2, $F2, $on_delete, $on_update,
554554
$type_T2 = mb_strtoupper($tables[$T2]['ENGINE'] ?? '');
555555

556556
// native foreign key
557-
if (ForeignKey::isSupported($type_T1) && ForeignKey::isSupported($type_T2) && $type_T1 == $type_T2) {
557+
if (ForeignKey::isSupported($type_T1) && ForeignKey::isSupported($type_T2) && $type_T1 === $type_T2) {
558558
// relation exists?
559559
$existrel_foreign = $this->relation->getForeigners($DB2, $T2, '', 'foreign');
560560
$foreigner = $this->relation->searchColumnInForeigners($existrel_foreign, $F2);
@@ -693,7 +693,7 @@ public function removeRelation($T1, $F1, $T2, $F2)
693693
$tables = $this->dbi->getTablesFull($DB2, $T2);
694694
$type_T2 = mb_strtoupper($tables[$T2]['ENGINE']);
695695

696-
if (ForeignKey::isSupported($type_T1) && ForeignKey::isSupported($type_T2) && $type_T1 == $type_T2) {
696+
if (ForeignKey::isSupported($type_T1) && ForeignKey::isSupported($type_T2) && $type_T1 === $type_T2) {
697697
// InnoDB
698698
$existrel_foreign = $this->relation->getForeigners($DB2, $T2, '', 'foreign');
699699
$foreigner = $this->relation->searchColumnInForeigners($existrel_foreign, $F2);

‎libraries/classes/Database/Qbe.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ private function getModifyColumnsRow()
819819
$htmlOutput .= $this->getAndOrColCell(
820820
$newColumnCount,
821821
$checkedOptions,
822-
$columnIndex + 1 == $this->criteriaColumnCount
822+
$columnIndex + 1 === $this->criteriaColumnCount
823823
);
824824
$newColumnCount++;
825825
}
@@ -1573,7 +1573,7 @@ private function fillJoinClauses(array &$finalized, array $relations, array $sea
15731573
}
15741574

15751575
// We are done if all tables are in $finalized
1576-
if (count($finalized) == count($searchTables)) {
1576+
if (count($finalized) === count($searchTables)) {
15771577
return;
15781578
}
15791579
}

‎libraries/classes/Database/Routines.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ private function processParamsAndBuild(
884884
}
885885
}
886886

887-
if ($i == count($itemParamName) - 1) {
887+
if ($i === count($itemParamName) - 1) {
888888
continue;
889889
}
890890

‎libraries/classes/Dbal/DbiMysqli.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function selectDb($databaseName, Connection $connection): bool
182182
public function realQuery(string $query, Connection $connection, int $options): MysqliResult|false
183183
{
184184
$method = MYSQLI_STORE_RESULT;
185-
if ($options == ($options | DatabaseInterface::QUERY_UNBUFFERED)) {
185+
if ($options === ($options | DatabaseInterface::QUERY_UNBUFFERED)) {
186186
$method = MYSQLI_USE_RESULT;
187187
}
188188

‎libraries/classes/Display/Results.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ private function setDisplayPartsForSelect(DisplayParts $displayParts): DisplayPa
526526
$isLink
527527
&& $previousTable != ''
528528
&& $fieldsMeta[$i]->table != ''
529-
&& $fieldsMeta[$i]->table != $previousTable
529+
&& $fieldsMeta[$i]->table !== $previousTable
530530
) {
531531
// don't display links
532532
$hasEditLink = false;
@@ -3636,7 +3636,7 @@ private function getSortedColumnMessage(
36363636
$sortedColumnIndex = false;
36373637

36383638
foreach ($fieldsMeta as $key => $meta) {
3639-
if (($meta->table == $sortTable) && ($meta->name == $sortColumn)) {
3639+
if (($meta->table === $sortTable) && ($meta->name === $sortColumn)) {
36403640
$sortedColumnIndex = $key;
36413641
break;
36423642
}

0 commit comments

Comments
 (0)