Remove unnecessary ternary expressions

This commit is contained in:
Gabriel Caruso 2018-11-19 01:32:28 -02:00
parent 49eb9d1f17
commit 3cf0770376
No known key found for this signature in database
GPG Key ID: EA85C7988F5A6877
5 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

@ -336,7 +336,7 @@ abstract class AbstractPart
} elseif ('w:tr' == $tblNode->nodeName) { // Row
$rowHeight = $xmlReader->getAttribute('w:val', $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(
'tblHeader' => $xmlReader->elementExists('w:trPr/w:tblHeader', $tblNode),
'cantSplit' => $xmlReader->elementExists('w:trPr/w:cantSplit', $tblNode),

View File

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

View File

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