Commit aeed3993 authored by alexpott's avatar alexpott

Issue #2502867 by Peacog, trwad, jhodgdon: Document all drupal(Post|Get)(*) methods $path parameter

parent d1cfbeac
......@@ -1546,10 +1546,10 @@ protected function drupalGet($path, array $options = array(), array $headers = a
}
/**
* Retrieves a Drupal path or an absolute path and JSON decode the result.
* Retrieves a Drupal path or an absolute path and JSON decodes the result.
*
* @param string $path
* Path to request AJAX from.
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request AJAX from.
* @param array $options
* Array of URL options.
* @param array $headers
......@@ -1557,7 +1557,6 @@ protected function drupalGet($path, array $options = array(), array $headers = a
*
* @return array
* Decoded json.
* Requests a Drupal path in JSON format, and JSON decodes the response.
*/
protected function drupalGetJSON($path, array $options = array(), array $headers = array()) {
return Json::decode($this->drupalGetWithFormat($path, 'json', $options, $headers));
......@@ -1566,8 +1565,8 @@ protected function drupalGetJSON($path, array $options = array(), array $headers
/**
* Retrieves a Drupal path or an absolute path for a given format.
*
* @param string $path
* Path to request AJAX from.
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request given format from.
* @param string $format
* The wanted request format.
* @param array $options
......@@ -1584,7 +1583,17 @@ protected function drupalGetWithFormat($path, $format, array $options = [], arra
}
/**
* Requests a Drupal path in drupal_ajax format and JSON-decodes the response.
* Requests a path or URL in drupal_ajax format and JSON-decodes the response.
*
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request from.
* @param array $options
* Array of URL options.
* @param array $headers
* Array of headers.
*
* @return array
* Decoded JSON.
*/
protected function drupalGetAjax($path, array $options = array(), array $headers = array()) {
if (!isset($options['query'][MainContentViewSubscriber::WRAPPER_FORMAT])) {
......@@ -1594,7 +1603,17 @@ protected function drupalGetAjax($path, array $options = array(), array $headers
}
/**
* Requests a Drupal path as if it is a XMLHttpRequest.
* Requests a Drupal path or an absolute path as if it is a XMLHttpRequest.
*
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request from.
* @param array $options
* Array of URL options.
* @param array $headers
* Array of headers.
*
* @return string
* The retrieved content.
*/
protected function drupalGetXHR($path, array $options = array(), array $headers = array()) {
$headers[] = 'X-Requested-With: XMLHttpRequest';
......@@ -1606,7 +1625,7 @@ protected function drupalGetXHR($path, array $options = array(), array $headers
*
* It will be done as usual POST request with SimpleBrowser.
*
* @param $path
* @param \Drupal\Core\Url|string $path
* Location of the post form. Either a Drupal path or an absolute path or
* NULL to post to the current page. For multi-stage forms you can set the
* path to NULL and have it post to the last received page. Example:
......@@ -1796,7 +1815,7 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
* update $this->content via drupalProcessAjaxResponse(). It also returns
* the array of AJAX commands received.
*
* @param $path
* @param \Drupal\Core\Url|string $path
* Location of the form containing the Ajax enabled element to test. Can be
* either a Drupal path or an absolute path or NULL to use the current page.
* @param $edit
......@@ -2057,9 +2076,8 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr
/**
* Perform a POST HTTP request.
*
* @param string $path
* Drupal path where the request should be POSTed to. Will be transformed
* into an absolute path automatically.
* @param string|\Drupal\Core\Url $path
* Drupal path or absolute path where the request should be POSTed.
* @param string $accept
* The value for the "Accept" header. Usually either 'application/json' or
* 'application/vnd.drupal-ajax'.
......@@ -2092,9 +2110,8 @@ protected function drupalPost($path, $accept, array $post, $options = array()) {
/**
* Performs a POST HTTP request with a specific format.
*
* @param string $path
* Drupal path where the request should be POSTed to. Will be transformed
* into an absolute path automatically.
* @param string|\Drupal\Core\Url $path
* Drupal path or absolute path where the request should be POSTed.
* @param string $format
* The request format.
* @param array $post
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment