Replace empty() with falsy check

empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)

Change-Id: Ia4e25651d753b7b4d3bcd780123c66c3d90cdf1b
This commit is contained in:
Umherirrender 2023-10-21 20:56:18 +02:00
parent 030d0bbbf9
commit ceb2da0f60

View file

@ -662,7 +662,7 @@ abstract class DiscussionParser {
$sectionSpan = self::getSectionSpan( $nextSectionStart, $changes['_info']['rhs'] );
$nextSectionStart = $sectionSpan[1] + 1;
$sectionSignedUsers = self::extractSignatures( $section['content'], $title );
if ( !empty( $sectionSignedUsers ) ) {
if ( $sectionSignedUsers ) {
$signedSections[] = $sectionSpan;
if ( !$section['header'] ) {
$fullSection = self::getFullSection(
@ -725,7 +725,7 @@ abstract class DiscussionParser {
}
}
if ( !empty( $signedSections ) ) {
if ( $signedSections ) {
$actions = self::convertToUnknownSignedChanges( $signedSections, $actions );
}