protected function generateRequestBody($src)
	{
		$params = [
			'compilation_level' => $this->compilationLevel,
			'js_code'           => $src,
			'output_format'     => 'json',
			'output_info'       => 'compiled_code'
		];

		// Add our custom externs if default externs are disabled
		if ($this->excludeDefaultExterns && $this->compilationLevel === 'ADVANCED_OPTIMIZATIONS')
		{
			$params['exclude_default_externs'] = 'true';
			$params['js_externs'] = $this->externs;
		}

		// Add dupe variables by hand
		$body = http_build_query($params) . '&output_info=errors';

		return $body;
	}
protected function generateRequestBody($src)
	{
		$params = [
			'compilation_level' => $this->compilationLevel,
			'js_code'           => $src,
			'output_format'     => 'json',
			'output_info'       => 'compiled_code'
		];

		// Add our custom externs if default externs are disabled
		if ($this->excludeDefaultExterns && $this->compilationLevel === 'ADVANCED_OPTIMIZATIONS')
		{
			$params['exclude_default_externs'] = 'true';
			$params['js_externs'] = $this->externs;
		}

		// Add dupe variables by hand
		$body = http_build_query($params) . '&output_info=errors';

		return $body;
	}
protected function generateRequestBody ( $ src ) { $ params = [ 'compilation_level' => $ this -> compilationLevel , 'js_code' => $ src , 'output_format' => 'json' , 'output_info' => 'compiled_code' ] ; // Add our custom externs if default externs are disabled if ( $ this -> excludeDefaultExterns && $ this -> compilationLevel === 'ADVANCED_OPTIMIZATIONS' ) { $ params [ 'exclude_default_externs' ] = 'true' ; $ params [ 'js_externs' ] = $ this -> externs ; } // Add dupe variables by hand $ body = http_build_query ( $ params ) . '&output_info=errors' ; return $ body ; }
Generate the request body for given code

@param  string $src JavaScript source
@return string      Compiled source
Generate the request body for given code