class BuildHookDetails in Build Hooks 8.2
Same name and namespace in other branches
- 3.x src/BuildHookDetails.php \Drupal\build_hooks\BuildHookDetails
Class BuildHookDetails.
Holds information to make the call to an external service for a build hook.
Hierarchy
- class \Drupal\build_hooks\BuildHookDetails
Expanded class hierarchy of BuildHookDetails
8 files declare their use of BuildHookDetails
- BitbucketManager.php in modules/
build_hooks_bitbucket/ src/ BitbucketManager.php - BitbucketManagerTest.php in modules/
build_hooks_bitbucket/ tests/ src/ Unit/ BitbucketManagerTest.php - BuildHookDetailsDeprecatedTest.php in tests/
src/ Unit/ BuildHookDetailsDeprecatedTest.php - CircleCiManager.php in modules/
build_hooks_circleci/ src/ CircleCiManager.php - CircleV2.php in modules/
build_hooks_circleci/ src/ Plugin/ FrontendEnvironment/ CircleV2.php
File
- src/
BuildHookDetails.php, line 10
Namespace
Drupal\build_hooksView source
class BuildHookDetails {
/**
* The url to call.
*
* @var string
*/
protected $url;
/**
* The method to use (POST,GET,...)
*
* @var string
*/
protected $method;
/**
* The options of the request.
*
* @var array
*/
protected $options;
/**
* BuildHookDetails constructor.
*/
public function __construct() {
$this->url = '';
$this->options = [];
$this->method = '';
}
/**
* Get the url.
*
* @return string
* The url.
*/
public function getUrl() : string {
return $this->url;
}
/**
* Set the url.
*
* @param string $url
* The url.
*/
public function setUrl(string $url) {
$this->url = $url;
}
/**
* Get the method.
*
* @return string
* The method.
*/
public function getMethod() : string {
return $this->method;
}
/**
* Set the method.
*
* @param string $method
* The method.
*/
public function setMethod(string $method) {
$this->method = $method;
}
/**
* Get the body.
*
* @return array
* The body.
*
* @deprecated in build_hooks:8.x-2.4 and is removed from build_hooks:8.x-3.0.
* The getBody() method is depcrecated. Use getOptions() method instead.
*
* @see https://www.drupal.org/node/3173753
*/
public function getBody() : array {
@trigger_error(__METHOD__ . ' is deprecated in build_hooks:8.x-2.4 and is removed from build_hooks:8.x-3.0. Instead, you should use Drupal\\build_hooks\\BuildHookDetails::getOptions. See https://www.drupal.org/node/3173753', E_USER_DEPRECATED);
return $this->options;
}
/**
* Get the options.
*
* @return array
* The options.
*/
public function getOptions() : array {
return $this->options;
}
/**
* Set the body.
*
* @param array $body
* The array.
*
* @deprecated in build_hooks:8.x-2.4 and is removed from build_hooks:8.x-3.0.
* The setBody() method is depcrecated. Use setOptions() method instead.
*
* @see https://www.drupal.org/node/3173753
*/
public function setBody(array $body) {
@trigger_error(__METHOD__ . ' is deprecated in build_hooks:8.x-2.4 and is removed from build_hooks:8.x-3.0. Instead, you should use Drupal\\build_hooks\\BuildHookDetails::setOptions. See https://www.drupal.org/node/3173753', E_USER_DEPRECATED);
$this->options = $body;
}
/**
* Set the options.
*
* @param array $options
* The array.
*/
public function setOptions(array $options) {
$this->options = $options;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BuildHookDetails:: |
protected | property | The method to use (POST,GET,...) | |
BuildHookDetails:: |
protected | property | The options of the request. | |
BuildHookDetails:: |
protected | property | The url to call. | |
BuildHookDetails:: |
public | function | Get the body. | |
BuildHookDetails:: |
public | function | Get the method. | |
BuildHookDetails:: |
public | function | Get the options. | |
BuildHookDetails:: |
public | function | Get the url. | |
BuildHookDetails:: |
public | function | Set the body. | |
BuildHookDetails:: |
public | function | Set the method. | |
BuildHookDetails:: |
public | function | Set the options. | |
BuildHookDetails:: |
public | function | Set the url. | |
BuildHookDetails:: |
public | function | BuildHookDetails constructor. |