aboutsummaryrefslogtreecommitdiffstats
path: root/includes/diff
diff options
context:
space:
mode:
authorumherirrender <umherirrender_de.wp@web.de>2015-11-12 20:07:59 +0100
committerUmherirrender <umherirrender_de.wp@web.de>2015-11-16 20:56:32 +0000
commit493f4222cb0e5305b0edb7a6ac0d26ac8ed56bf3 (patch)
treec868f452c01ef9061fbe43b6e756221dcab5b7be /includes/diff
parent865f4f8d6b22d166039f6721bbfe098309594aff (diff)
downloadmediawikicore-493f4222cb0e5305b0edb7a6ac0d26ac8ed56bf3.tar.gz
mediawikicore-493f4222cb0e5305b0edb7a6ac0d26ac8ed56bf3.zip
phpcs: Assignment expression not allowed
Fix some "Assignment expression not allowed" Found by tests: https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull Change-Id: I9bc2eff20a317a74671acd49749bb336a0fd9f67
Diffstat (limited to 'includes/diff')
-rw-r--r--includes/diff/DairikiDiff.php6
-rw-r--r--includes/diff/TableDiffFormatter.php4
2 files changed, 7 insertions, 3 deletions
diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php
index 14810da49cd5..264c87fdfcd8 100644
--- a/includes/diff/DairikiDiff.php
+++ b/includes/diff/DairikiDiff.php
@@ -324,7 +324,8 @@ class DiffEngine {
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;
@@ -333,7 +334,8 @@ class DiffEngine {
}
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;
diff --git a/includes/diff/TableDiffFormatter.php b/includes/diff/TableDiffFormatter.php
index 4737f08546b0..be38e8759c3d 100644
--- a/includes/diff/TableDiffFormatter.php
+++ b/includes/diff/TableDiffFormatter.php
@@ -204,10 +204,12 @@ class TableDiffFormatter extends DiffFormatter {
# 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";
+ $line = array_shift( $del );
}
foreach ( $add as $line ) { # If any leftovers
echo '<tr>' . $this->emptyLine() .