Fix some "Assignment expression not allowed"
Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull
Change-Id: I9bc2eff20a317a74671acd49749bb336a0fd9f67
for ( $yi = $skip; $yi < $n_to - $endskip; $yi++ ) {
$line = $to_lines[$yi];
for ( $yi = $skip; $yi < $n_to - $endskip; $yi++ ) {
$line = $to_lines[$yi];
- if ( ( $this->ychanged[$yi] = empty( $xhash[$this->lineHash( $line )] ) ) ) {
+ $this->ychanged[$yi] = empty( $xhash[$this->lineHash( $line )] );
+ if ( $this->ychanged[$yi] ) {
continue;
}
$yhash[$this->lineHash( $line )] = 1;
continue;
}
$yhash[$this->lineHash( $line )] = 1;
}
for ( $xi = $skip; $xi < $n_from - $endskip; $xi++ ) {
$line = $from_lines[$xi];
}
for ( $xi = $skip; $xi < $n_from - $endskip; $xi++ ) {
$line = $from_lines[$xi];
- if ( ( $this->xchanged[$xi] = empty( $yhash[$this->lineHash( $line )] ) ) ) {
+ $this->xchanged[$xi] = empty( $yhash[$this->lineHash( $line )] );
+ if ( $this->xchanged[$xi] ) {
continue;
}
$this->xv[] = $line;
continue;
}
$this->xv[] = $line;
# Notice that WordLevelDiff returns HTML-escaped output.
# Hence, we will be calling addedLine/deletedLine without HTML-escaping.
# Notice that WordLevelDiff returns HTML-escaped output.
# Hence, we will be calling addedLine/deletedLine without HTML-escaping.
- while ( $line = array_shift( $del ) ) {
+ $line = array_shift( $del );
+ while ( $line ) {
$aline = array_shift( $add );
echo '<tr>' . $this->deletedLine( $line ) .
$this->addedLine( $aline ) . "</tr>\n";
$aline = array_shift( $add );
echo '<tr>' . $this->deletedLine( $line ) .
$this->addedLine( $aline ) . "</tr>\n";
+ $line = array_shift( $del );
}
foreach ( $add as $line ) { # If any leftovers
echo '<tr>' . $this->emptyLine() .
}
foreach ( $add as $line ) { # If any leftovers
echo '<tr>' . $this->emptyLine() .
$shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) );
}
$shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) );
}
- if ( !$fh = fopen( $filename, 'w' ) ) {
+ $fh = fopen( $filename, 'w' );
+ if ( !$fh ) {
throw new Exception( "couldn't open $filename for writing" );
}
fwrite( $fh, $svg->asXML() );
throw new Exception( "couldn't open $filename for writing" );
}
fwrite( $fh, $svg->asXML() );