Simplification of the code

This commit is contained in:
Alexander Rakushin authored and Adrien Loison committed 2019-10-01 20:08:54 +00:00
1 parent e8c6d83104
commit d4e12b1812
1 file changed
+2 -8
@@ -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;
}
/**