public function encode($value)
	{
		$type = gettype($value);
		if (!isset($this->typeEncoders[$type]))
		{
			throw new RuntimeException('Cannot encode ' . $type . ' value');
		}

		return $this->typeEncoders[$type]($value);
	}
public function encode($value)
	{
		$type = gettype($value);
		if (!isset($this->typeEncoders[$type]))
		{
			throw new RuntimeException('Cannot encode ' . $type . ' value');
		}

		return $this->typeEncoders[$type]($value);
	}
public function encode ( $ value ) { $ type = gettype ( $ value ) ; if ( ! isset ( $ this -> typeEncoders [ $ type ] ) ) { throw new RuntimeException ( 'Cannot encode ' . $ type . ' value' ) ; } return $ this -> typeEncoders [ $ type ] ( $ value ) ; }
Encode a value into JavaScript

@param  mixed  $value
@return string
Encode a value into JavaScript