original_string: private function normToView($value)
      {
          // Scalar values should  be converted to strings to
          // facilitate differentiation between empty ("") and zero (0).
          // Only do this for simple forms, as the resulting value in
          // compound forms is passed to the data mapper and thus should
          // not be converted to a string before.
          if (!($transformers = $this->config->getViewTransformers()) && !$this->config->getCompound()) {
              return null === $value || is_scalar($value) ? (string) $value : $value;
          }
  
          try {
              foreach ($transformers as $transformer) {
                  $value = $transformer->transform($value);
              }
          } catch (TransformationFailedException $exception) {
              throw new TransformationFailedException('Unable to transform value for property path "'.$this->getPropertyPath().'": '.$exception->getMessage(), $exception->getCode(), $exception, $exception->getInvalidMessage(), $exception->getInvalidMessageParameters());
          }
  
          return $value;
      }
code: private function normToView($value)
      {
          // Scalar values should  be converted to strings to
          // facilitate differentiation between empty ("") and zero (0).
          // Only do this for simple forms, as the resulting value in
          // compound forms is passed to the data mapper and thus should
          // not be converted to a string before.
          if (!($transformers = $this->config->getViewTransformers()) && !$this->config->getCompound()) {
              return null === $value || is_scalar($value) ? (string) $value : $value;
          }
  
          try {
              foreach ($transformers as $transformer) {
                  $value = $transformer->transform($value);
              }
          } catch (TransformationFailedException $exception) {
              throw new TransformationFailedException('Unable to transform value for property path "'.$this->getPropertyPath().'": '.$exception->getMessage(), $exception->getCode(), $exception, $exception->getInvalidMessage(), $exception->getInvalidMessageParameters());
          }
  
          return $value;
      }
code_tokens: private function normToView ( $ value ) { // Scalar values should  be converted to strings to // facilitate differentiation between empty ("") and zero (0). // Only do this for simple forms, as the resulting value in // compound forms is passed to the data mapper and thus should // not be converted to a string before. if ( ! ( $ transformers = $ this -> config -> getViewTransformers ( ) ) && ! $ this -> config -> getCompound ( ) ) { return null === $ value || is_scalar ( $ value ) ? ( string ) $ value : $ value ; } try { foreach ( $ transformers as $ transformer ) { $ value = $ transformer -> transform ( $ value ) ; } } catch ( TransformationFailedException $ exception ) { throw new TransformationFailedException ( 'Unable to transform value for property path "' . $ this -> getPropertyPath ( ) . '": ' . $ exception -> getMessage ( ) , $ exception -> getCode ( ) , $ exception , $ exception -> getInvalidMessage ( ) , $ exception -> getInvalidMessageParameters ( ) ) ; } return $ value ; }
docstring: Transforms the value if a view transformer is set.
  
  @param mixed $value The value to transform
  
  @return mixed
  
  @throws TransformationFailedException If the normalized value cannot be transformed to "view" format
docstring_tokens: Transforms the value if a view transformer is set .