コード例 #1
0
 /**
  * Formats a value
  *
  * @param string $value The value which should be transformed
  * @param string $type  The type of the value
  * @param string $style 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);
     }
 }