Simplification of the code

This commit is contained in:
Alexander Rakushin 2019-09-29 19:13:11 +03:00 committed by Adrien Loison
parent e8c6d83104
commit d4e12b1812

View File

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