Simplification of the code
This commit is contained in:
parent
e8c6d83104
commit
d4e12b1812
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user