From 6f069b734142d63c0f9ee3ea7f22f16eae13bd13 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Fri, 10 Nov 2023 16:15:33 +0530 Subject: [PATCH] ACMS-3281: PHPCS fixes. --- README.md | 31 +++++++++++++-------- composer.json | 3 -- settings/acquia-recommended.settings.php | 4 ++- settings/global/default.global.settings.php | 7 +++-- src/Helpers/EnvironmentDetector.php | 2 ++ src/Settings.php | 1 - 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 109a674..240d010 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # Acquia Drupal Recommended Settings -The Acquia Drupal Recommended Settings plugin adds the recommended settings to the Drupal project, so developers won't have to edit settings.php manually. +The Acquia Drupal Recommended Settings plugin adds the recommended settings to +the Drupal project, so developers won't have to edit settings.php manually. The recommended settings includes: -- the required database credentials +- the required database credentials. - configuration sync directory path. - public/private etc. file directory path. - Acquia site studio sync directory path. -- Includes Drupal module [Config sync without site uuid](https://www.drupal.org/project/config_sync_without_site_uuid) features. -It allows your websites to be easily installed in both Acquia Cloud IDE & local and deployable on Acquia Cloud. +It allows your websites to be easily installed in both Acquia Cloud IDE & local +and deployable on Acquia Cloud. ## Installation @@ -18,16 +19,16 @@ You can also install this using Composer like so: composer require acquia/drupal-recommended-settings ``` -## Steps to switch from BLT to Acquia Drupal Recommended Settings -This plugin doesn't work with the acquia/blt plugin. If the plugin exists, it must be removed. +## Steps to use Acquia Drupal Recommended Settings with BLT. +This plugin works with acquia/blt plugin. -- Remove BLT plugin using below command +- Update BLT plugin to latest release. ``` -composer remove acquia/blt +composer update acquia/blt -W ``` - Remove BLT reference from settings.php file located at -``/docroot/sites/default/settings.php``. + ``/docroot/sites/default/settings.php``. ```php require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php"; /** @@ -44,7 +45,7 @@ require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php"; ``` composer require acquia/drupal-recommended-settings ``` - + - Update `default.local.settings.php` and `local.settings.php` to use the Environment Detector provided by this plugin instead of BLT: ```diff - use Acquia\Blt\Robo\Common\EnvironmentDetector; @@ -55,6 +56,12 @@ composer require acquia/drupal-recommended-settings Copyright (C) 2023 Acquia, Inc. -This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License version 2 as published by the +Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/composer.json b/composer.json index 0173976..701c719 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,6 @@ "ergebnis/composer-normalize": "~2.21.0", "phpro/grumphp-shim": "^1.5" }, - "conflict": { - "acquia/blt": "*" - }, "minimum-stability": "dev", "prefer-stable": true, "autoload": { diff --git a/settings/acquia-recommended.settings.php b/settings/acquia-recommended.settings.php index 8c5cbbf..9c57e04 100644 --- a/settings/acquia-recommended.settings.php +++ b/settings/acquia-recommended.settings.php @@ -2,7 +2,9 @@ /** * @file - * Setup Acquia Drupal Recommended Settings utility variables, include required files. + * Setup Acquia Drupal Recommended Settings utility variables. + * + * Includes required settings files. */ use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException; diff --git a/settings/global/default.global.settings.php b/settings/global/default.global.settings.php index d55bba2..78e8dd1 100644 --- a/settings/global/default.global.settings.php +++ b/settings/global/default.global.settings.php @@ -2,7 +2,9 @@ /** * @file - * Generated by Acquia Drupal Recommended Settings. Serves as an example of global includes. + * Generated by Acquia Drupal Recommended Settings. + * + * Serves as an example of global includes. */ /** @@ -14,7 +16,8 @@ /** * Include settings files in docroot/sites/settings. * - * If instead you want to add settings to a specific site, see Acquia Drupal Recommended Settings includes + * If instead you want to add settings to a specific site, see + * Acquia Drupal Recommended Settings includes * file in docroot/sites/{site-name}/settings/default.includes.settings.php. */ $additionalSettingsFiles = [ diff --git a/src/Helpers/EnvironmentDetector.php b/src/Helpers/EnvironmentDetector.php index 7185935..32b221b 100644 --- a/src/Helpers/EnvironmentDetector.php +++ b/src/Helpers/EnvironmentDetector.php @@ -263,7 +263,9 @@ public static function getRepoRoot(): string { // This is a web or Drush request. return dirname(DRUPAL_ROOT); } + // phpcs:ignore global $repo_root; + // phpcs:enable return $repo_root; } diff --git a/src/Settings.php b/src/Settings.php index 78315ba..5f13a68 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -136,7 +136,6 @@ public function generate(array $overrideData = []): void { // The config directory for given site must exists, otherwise Drupal will // add database credentials to settings.php. - // @todo Using hardcoded sync directory path. Need to better optimise it. $this->fileSystem->ensureDirectoryExists($this->drupalRoot . "/../config/$site"); }