You are here

public function CircleCiManager::getBuildHookDetailsForPluginConfiguration in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x modules/build_hooks_circleci/src/CircleCiManager.php \Drupal\build_hooks_circleci\CircleCiManager::getBuildHookDetailsForPluginConfiguration()

Returns the build hooks details based on plugin configuration.

Parameters

array $config: The plugin configuration array.

Return value

\Drupal\build_hooks\BuildHookDetails Build hooks detail object with info about the request to make.

Overrides CircleCiManagerInterface::getBuildHookDetailsForPluginConfiguration

File

modules/build_hooks_circleci/src/CircleCiManager.php, line 89

Class

CircleCiManager
Class CircleCiManager.

Namespace

Drupal\build_hooks_circleci

Code

public function getBuildHookDetailsForPluginConfiguration(array $config) {
  $buildHookDetails = new BuildHookDetails();
  $buildHookDetails
    ->setUrl($this
    ->buildCircleCiApiBuildUrlForEnvironment($config));
  $buildHookDetails
    ->setMethod('POST');
  $buildHookDetails
    ->setOptions([
    'json' => [
      'branch' => $config['branch'],
    ],
  ]);
  return $buildHookDetails;
}