Akeneo\Component\SpreadsheetParser\Xlsx\ValueTransformer::transform PHP Method

transform() public method

Formats a value
public transform ( string $value, string $type, string $style ) : mixed
$value string The value which should be transformed
$type string The type of the value
$style string The style of the value
return mixed
    public function transform($value, $type, $style)
    {
        switch ($type) {
            case static::TYPE_BOOL:
                return '1' === $value;
            case static::TYPE_SHARED_STRING:
                return rtrim($this->sharedStrings->get($value));
            case '':
            case static::TYPE_NUMBER:
                return $style && Styles::FORMAT_DATE === $this->styles->get($style) ? $this->dateTransformer->transform($value) : $value * 1;
            default:
                return rtrim($value);
        }
    }
ValueTransformer