Skip to content

Commit

Permalink
Coding standards fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
becw committed Nov 10, 2022
1 parent 5569bfc commit bd356d0
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ function the_build_utility_install() {
$date_settings->save(TRUE);

// Install modules that we want but are not included with standard profile.
$install = ['admin_toolbar', 'admin_toolbar_tools', 'config_split', 'devel', 'workbench', 'workbench_tabs'];
$install = [
'admin_toolbar',
'admin_toolbar_tools',
'config_split',
'devel',
'workbench',
'workbench_tabs',
];
\Drupal::service('module_installer')->install($install);

// Remove comment fields so that comment module can be uninstalled.
Expand All @@ -65,6 +72,14 @@ function the_build_utility_install() {
\Drupal::state()->delete('comment.node_comment_statistics_scale');

// Uninstall the modules from the standard profile that we don't want.
$uninstall = ['automated_cron', 'big_pipe', 'comment', 'contact', 'history', 'search', 'tour'];
$uninstall = [
'automated_cron',
'big_pipe',
'comment',
'contact',
'history',
'search',
'tour',
];
\Drupal::service('module_installer')->uninstall($uninstall);
}
39 changes: 24 additions & 15 deletions src/TheBuild/Acquia/AcquiaTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
namespace TheBuild\Acquia;

/**
*
* Phing task for making queries against the Acquia Cloud v1 API.
*/
abstract class AcquiaTask extends \Task {

/**
* Required. The Acquia Cloud credentials file containing a json array with
* 'mail' and 'key' values.
* Required. The Acquia Cloud credentials file.
*
* This file can be downloaded from your Acquia user account area and contains
* a json array with 'mail' and 'key' values.
*
* @var \PhingFile
*/
protected $credentialsFile;

/**
* Email address associated with the Acquia Cloud access. This value is set
* from the credentials file.
* Email address associated with the Acquia Cloud access.
*
* This value is set from the credentials file.
*
* @var string
*/
protected $mail;

/**
* Secure key associated with the Acquia Cloud access. This value is set from
* the credentials file.
* Secure key associated with the Acquia Cloud access.
*
* This value is set from the credentials file.
*
* @var string
*/
protected $key;

/**
* The Acquia Cloud API endpoint. This code is specific to version 1 of the
* API.
* The Acquia Cloud API v1 endpoint.
*
* @var string
*/
Expand Down Expand Up @@ -70,11 +73,13 @@ protected function loadCredentials() {
/**
* Build an HTTP request object against the Acquia Cloud API.
*
* @param $path
* @param string $path
* Acquia Cloud API path.
*
* @return \HTTP_Request2
* Request object.
*/
protected function createRequest($path) {
protected function createRequest(string $path) : \HTTP_Request2 {
$this->loadCredentials();

$uri = $this->endpoint . '/' . ltrim($path, '/');
Expand All @@ -89,13 +94,13 @@ protected function createRequest($path) {
/**
* Example of how to query the Acquia Cloud API.
*
* @param $path
* @param string $path
* Acquia Cloud API path.
*
* @return string
*
* @throws \HTTP_Request2_Exception
* API response.
*/
protected function getApiResponseBody($path) {
protected function getApiResponseBody(string $path) : string {
$request = $this->createRequest($path);

$this->log('GET ' . $request->getUrl());
Expand All @@ -104,7 +109,11 @@ protected function getApiResponseBody($path) {
}

/**
* Set the Acquia credentials file.
*
* @param \PhingFile $file
* Acquia credentials file.
*
* @throws \IOException
* @throws \NullPointerException
*/
Expand Down
Loading

0 comments on commit bd356d0

Please sign in to comment.