Skip to content

Commit 87acd37

Browse files
committed
Clean elses
1 parent 194e5c4 commit 87acd37

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/PhpWord/Shared/OLERead.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function read($sFileName)
115115
$bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS)/4;
116116
}
117117
// @codeCoverageIgnoreEnd
118-
118+
119119
for ($i = 0; $i < $bbdBlocks; ++$i) {
120120
$bigBlockDepotBlocks[$i] = self::getInt4d($this->data, $pos);
121121
$pos += 4;
@@ -193,26 +193,26 @@ public function getStream($stream)
193193
}
194194

195195
return $streamData;
196-
} else {
197-
$numBlocks = $this->props[$stream]['size'] / self::BIG_BLOCK_SIZE;
198-
if ($this->props[$stream]['size'] % self::BIG_BLOCK_SIZE != 0) {
199-
++$numBlocks;
200-
}
196+
}
201197

202-
if ($numBlocks == 0) {
203-
return '';// @codeCoverageIgnore
204-
}
198+
$numBlocks = $this->props[$stream]['size'] / self::BIG_BLOCK_SIZE;
199+
if ($this->props[$stream]['size'] % self::BIG_BLOCK_SIZE != 0) {
200+
++$numBlocks;
201+
}
205202

206-
$block = $this->props[$stream]['startBlock'];
203+
if ($numBlocks == 0) {
204+
return '';// @codeCoverageIgnore
205+
}
207206

208-
while ($block != -2) {
209-
$pos = ($block + 1) * self::BIG_BLOCK_SIZE;
210-
$streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE);
211-
$block = self::getInt4d($this->bigBlockChain, $block*4);
212-
}
207+
$block = $this->props[$stream]['startBlock'];
213208

214-
return $streamData;
209+
while ($block != -2) {
210+
$pos = ($block + 1) * self::BIG_BLOCK_SIZE;
211+
$streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE);
212+
$block = self::getInt4d($this->bigBlockChain, $block*4);
215213
}
214+
215+
return $streamData;
216216
}
217217

218218
/**

src/PhpWord/Shared/PCLZip/pclzip.lib.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,9 +1244,9 @@ public function errorCode()
12441244
{
12451245
if (PCLZIP_ERROR_EXTERNAL == 1) {
12461246
return (PclErrorCode());
1247-
} else {
1248-
return ($this->error_code);
12491247
}
1248+
1249+
return ($this->error_code);
12501250
}
12511251
// --------------------------------------------------------------------------------
12521252

@@ -1289,9 +1289,9 @@ public function errorName($p_with_code = false)
12891289

12901290
if ($p_with_code) {
12911291
return ($v_value . ' (' . $this->error_code . ')');
1292-
} else {
1293-
return ($v_value);
12941292
}
1293+
1294+
return ($v_value);
12951295
}
12961296
// --------------------------------------------------------------------------------
12971297

@@ -1304,13 +1304,13 @@ public function errorInfo($p_full = false)
13041304
{
13051305
if (PCLZIP_ERROR_EXTERNAL == 1) {
13061306
return (PclErrorString());
1307-
} else {
1308-
if ($p_full) {
1309-
return ($this->errorName(true) . " : " . $this->error_string);
1310-
} else {
1311-
return ($this->error_string . " [code " . $this->error_code . "]");
1312-
}
13131307
}
1308+
1309+
if ($p_full) {
1310+
return ($this->errorName(true) . " : " . $this->error_string);
1311+
}
1312+
1313+
return ($this->error_string . " [code " . $this->error_code . "]");
13141314
}
13151315
// --------------------------------------------------------------------------------
13161316

0 commit comments

Comments
 (0)