Simplification of the code

This commit is contained in:
Alexander Rakushin 2019-09-29 19:13:11 +03:00
parent 29bb8d322d
commit 804b668a9c

View File

@ -148,11 +148,7 @@ class StyleRegistry extends \Box\Spout\Writer\Common\Manager\Style\StyleRegistry
} else {
$this->registeredFormats[$format] = $styleId;
if (isset(self::$builtinNumFormatToIdMapping[$format])) {
$id = self::$builtinNumFormatToIdMapping[$format];
} else {
$id = $this->formatIndex++;
}
$id = self::$builtinNumFormatToIdMapping[$format] ?? $this->formatIndex++;
$this->styleIdToFormatsMappingTable[$styleId] = $id;
}
} else {
@ -168,9 +164,7 @@ class StyleRegistry extends \Box\Spout\Writer\Common\Manager\Style\StyleRegistry
*/
public function getFormatIdForStyleId($styleId)
{
return (isset($this->styleIdToFormatsMappingTable[$styleId])) ?
$this->styleIdToFormatsMappingTable[$styleId] :
null;
return $this->styleIdToFormatsMappingTable[$styleId] ?? null;
}
/**