Merge pull request #1511 from carusogabriel/ternary-expressions

Remove unnecessary ternary expressions
This commit is contained in:
troosan 2018-12-26 23:15:49 +01:00 committed by GitHub
commit 254d300ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -507,7 +507,7 @@ class DocInfo
case 'date': // Date case 'date': // Date
return strtotime($propertyValue); return strtotime($propertyValue);
case 'bool': // Boolean case 'bool': // Boolean
return ($propertyValue == 'true') ? true : false; return $propertyValue == 'true';
} }
return $propertyValue; return $propertyValue;

View File

@ -1619,7 +1619,7 @@ class MsDoc extends AbstractReader implements ReaderInterface
break; break;
// sprmCFData // sprmCFData
case 0x06: case 0x06:
$sprmCFData = dechex($operand) == 0x00 ? false : true; $sprmCFData = dechex($operand) != 0x00;
break; break;
// sprmCFItalic // sprmCFItalic
case 0x36: case 0x36:

View File

@ -338,7 +338,7 @@ abstract class AbstractPart
} elseif ('w:tr' == $tblNode->nodeName) { // Row } elseif ('w:tr' == $tblNode->nodeName) { // Row
$rowHeight = $xmlReader->getAttribute('w:val', $tblNode, 'w:trPr/w:trHeight'); $rowHeight = $xmlReader->getAttribute('w:val', $tblNode, 'w:trPr/w:trHeight');
$rowHRule = $xmlReader->getAttribute('w:hRule', $tblNode, 'w:trPr/w:trHeight'); $rowHRule = $xmlReader->getAttribute('w:hRule', $tblNode, 'w:trPr/w:trHeight');
$rowHRule = $rowHRule == 'exact' ? true : false; $rowHRule = $rowHRule == 'exact';
$rowStyle = array( $rowStyle = array(
'tblHeader' => $xmlReader->elementExists('w:trPr/w:tblHeader', $tblNode), 'tblHeader' => $xmlReader->elementExists('w:trPr/w:tblHeader', $tblNode),
'cantSplit' => $xmlReader->elementExists('w:trPr/w:cantSplit', $tblNode), 'cantSplit' => $xmlReader->elementExists('w:trPr/w:cantSplit', $tblNode),

View File

@ -258,7 +258,7 @@ class ZipArchive
unlink($this->tempDir . DIRECTORY_SEPARATOR . $localnameParts['basename']); unlink($this->tempDir . DIRECTORY_SEPARATOR . $localnameParts['basename']);
} }
return ($res == 0) ? false : true; return $res != 0;
} }
/** /**
@ -289,7 +289,7 @@ class ZipArchive
// Remove temp file // Remove temp file
@unlink($this->tempDir . DIRECTORY_SEPARATOR . $filenameParts['basename']); @unlink($this->tempDir . DIRECTORY_SEPARATOR . $filenameParts['basename']);
return ($res == 0) ? false : true; return $res != 0;
} }
/** /**
@ -309,7 +309,7 @@ class ZipArchive
if (is_null($entries)) { if (is_null($entries)) {
$result = $zip->extract(PCLZIP_OPT_PATH, $destination); $result = $zip->extract(PCLZIP_OPT_PATH, $destination);
return ($result > 0) ? true : false; return $result > 0;
} }
// Extract by entries // Extract by entries

View File

@ -163,7 +163,7 @@ class XmlDocument
{ {
$nodeList = $this->getNodeList($path, $file); $nodeList = $this->getNodeList($path, $file);
return !($nodeList->length == 0); return $nodeList->length != 0;
} }
/** /**