Skip to content

Commit e7d1ecb

Browse files
Merge pull request #18419 from kamil-tekiela/UseIdenticalOverEqualWithSameTypeRector
UseIdenticalOverEqualWithSameTypeRector
2 parents 78be90b + 0f351a5 commit e7d1ecb

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

libraries/classes/ConfigStorage/Relation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ public function buildForeignDropdown(array $foreign, string $data, string $mode)
812812
$value = (string) $value;
813813

814814
if (mb_check_encoding($key, 'utf-8') && ! preg_match('/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', $key)) {
815-
$selected = ($key == $data);
815+
$selected = ($key === $data);
816816
// show as text if it's valid utf-8
817817
$key = htmlspecialchars($key);
818818
} else {
@@ -1245,7 +1245,7 @@ public function renameTable(string $sourceDb, string $targetDb, string $sourceTa
12451245
}
12461246

12471247
if ($relationParameters->pdfFeature !== null) {
1248-
if ($sourceDb == $targetDb) {
1248+
if ($sourceDb === $targetDb) {
12491249
// rename within the database can be handled
12501250
$this->renameSingleTable(
12511251
$relationParameters->pdfFeature->database,
@@ -1740,7 +1740,7 @@ public function getTables(string $foreignDb, string $tblStorageEngine): array
17401740
$tables = [];
17411741
$tablesRows = $this->dbi->query('SHOW TABLE STATUS FROM ' . Util::backquote($foreignDb));
17421742
while ($row = $tablesRows->fetchRow()) {
1743-
if (! isset($row[1]) || mb_strtoupper($row[1]) != $tblStorageEngine) {
1743+
if (! isset($row[1]) || mb_strtoupper($row[1]) !== $tblStorageEngine) {
17441744
continue;
17451745
}
17461746

libraries/classes/IpAllowDeny.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private function allowDeny(string $type): bool
268268
$ruleData = explode(' ', $rule);
269269

270270
// check for rule type
271-
if ($ruleData[0] != $type) {
271+
if ($ruleData[0] !== $type) {
272272
continue;
273273
}
274274

libraries/classes/Navigation/Nodes/Node.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ public function getChild(string $name, bool $realName = false): Node|null
170170
{
171171
if ($realName) {
172172
foreach ($this->children as $child) {
173-
if ($child->realName == $name) {
173+
if ($child->realName === $name) {
174174
return $child;
175175
}
176176
}
177177
} else {
178178
foreach ($this->children as $child) {
179-
if ($child->name == $name && ! $child->isNew) {
179+
if ($child->name === $name && ! $child->isNew) {
180180
return $child;
181181
}
182182
}
@@ -193,7 +193,7 @@ public function getChild(string $name, bool $realName = false): Node|null
193193
public function removeChild(string $name): void
194194
{
195195
foreach ($this->children as $key => $child) {
196-
if ($child->name == $name) {
196+
if ($child->name === $name) {
197197
unset($this->children[$key]);
198198
break;
199199
}

libraries/classes/Operations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ public function changeAllColumnsCollation(string $db, string $table, string $tab
836836
[$charset] = explode('_', $tableCollation);
837837

838838
$changeAllCollationsQuery .= ' CHARACTER SET ' . $charset
839-
. ($charset == $tableCollation ? '' : ' COLLATE ' . $tableCollation);
839+
. ($charset === $tableCollation ? '' : ' COLLATE ' . $tableCollation);
840840

841841
$this->dbi->query($changeAllCollationsQuery);
842842
}
@@ -867,7 +867,7 @@ public function moveOrCopyTable(string $db, string $table): Message
867867
* A target table name has been sent to this script -> do the work
868868
*/
869869
if (isset($_POST['new_name']) && is_scalar($_POST['new_name']) && (string) $_POST['new_name'] !== '') {
870-
if ($db == $targetDb && $table == $_POST['new_name']) {
870+
if ($db === $targetDb && $table == $_POST['new_name']) {
871871
if (isset($_POST['submit_move'])) {
872872
$message = Message::error(__('Can\'t move table to same one!'));
873873
} else {

libraries/classes/Sql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public function storeTheQueryAsBookmark(
528528
if ($bookmarkReplace && $bookmarkFeature !== null) {
529529
$bookmarks = Bookmark::getList($bookmarkFeature, $this->dbi, $GLOBALS['cfg']['Server']['user'], $db);
530530
foreach ($bookmarks as $bookmark) {
531-
if ($bookmark->getLabel() != $bookmarkLabel) {
531+
if ($bookmark->getLabel() !== $bookmarkLabel) {
532532
continue;
533533
}
534534

libraries/classes/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ public function rename(string $newName, string|null $newDb = null): bool
13951395

13961396
// If the table is moved to a different database drop its triggers first
13971397
$triggers = Triggers::getDetails($this->dbi, $this->getDbName(), $this->getName(), '');
1398-
$handleTriggers = $this->getDbName() != $newDb && $triggers;
1398+
$handleTriggers = $this->getDbName() !== $newDb && $triggers;
13991399
if ($handleTriggers) {
14001400
foreach ($triggers as $trigger) {
14011401
$sql = 'DROP TRIGGER IF EXISTS '
@@ -2379,7 +2379,7 @@ private function getSQLToCreateForeignKey(
23792379
}
23802380

23812381
$sqlQuery .= ' FOREIGN KEY (' . implode(', ', $field) . ') REFERENCES '
2382-
. ($this->dbName != $foreignDb
2382+
. ($this->dbName !== $foreignDb
23832383
? Util::backquote($foreignDb) . '.' : '')
23842384
. Util::backquote($foreignTable)
23852385
. '(' . implode(', ', $foreignField) . ')';

0 commit comments

Comments
 (0)