original_string: public static function type_json_encode($var, array $settings)
  	{
  		$var = json_encode($var);
  
  		if (array_key_exists('character_maximum_length', $settings))
  		{
  			$length  = intval($settings['character_maximum_length']);
  			if ($length > 0 and strlen($var) > $length)
  			{
  				throw new InvalidContentType('Value could not be JSON encoded, exceeds max string length for field.');
  			}
  		}
  
  		return $var;
  	}
code: public static function type_json_encode($var, array $settings)
  	{
  		$var = json_encode($var);
  
  		if (array_key_exists('character_maximum_length', $settings))
  		{
  			$length  = intval($settings['character_maximum_length']);
  			if ($length > 0 and strlen($var) > $length)
  			{
  				throw new InvalidContentType('Value could not be JSON encoded, exceeds max string length for field.');
  			}
  		}
  
  		return $var;
  	}
code_tokens: public static function type_json_encode ( $ var , array $ settings ) { $ var = json_encode ( $ var ) ; if ( array_key_exists ( 'character_maximum_length' , $ settings ) ) { $ length = intval ( $ settings [ 'character_maximum_length' ] ) ; if ( $ length > 0 and strlen ( $ var ) > $ length ) { throw new InvalidContentType ( 'Value could not be JSON encoded, exceeds max string length for field.' ) ; } } return $ var ; }
docstring: JSON encodes the input
  
  @param   mixed  value
  @param   array  any options to be passed
  
  @throws  InvalidContentType
  
  @return  string
docstring_tokens: JSON encodes the input