From 2fcb11ebad29f83efa05d21c4345a4557268b563 Mon Sep 17 00:00:00 2001 From: Vishal Khode Date: Mon, 26 Jun 2023 22:08:24 +0530 Subject: [PATCH] ACMS-1866: Supports PHP 8.2. --- src/Config/SettingsConfig.php | 9 ++++++++- src/Plugin.php | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Config/SettingsConfig.php b/src/Config/SettingsConfig.php index 2ac1e91..97c0629 100644 --- a/src/Config/SettingsConfig.php +++ b/src/Config/SettingsConfig.php @@ -11,6 +11,13 @@ */ class SettingsConfig extends Config { + /** + * Holds the YamlExpander class object. + * + * @var \Grasmash\YamlExpander\YamlExpander + */ + protected $expander; + /** * Config Constructor. * @@ -29,7 +36,7 @@ public function __construct(array $data = []) { * @param string $filename * The file in which placeholders should be expanded. */ - public function expandFileProperties($filename) { + public function expandFileProperties(string $filename) { $expanded_contents = $this->expander->expandArrayProperties(file($filename), $this->export()); file_put_contents($filename, implode("", $expanded_contents)); } diff --git a/src/Plugin.php b/src/Plugin.php index 0da1dea..1d9da7a 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -49,6 +49,13 @@ class Plugin implements PluginInterface, EventSubscriberInterface { */ protected $drsIncluded; + /** + * Stores this plugin package object. + * + * @var mixed|null + */ + protected $settingsPackage; + /** * {@inheritdoc} */ @@ -104,7 +111,7 @@ public function onPostPackageEvent(PackageEvent $event) { */ public function onPostCmdEvent() { // Only install the template files if acquia/drupal-recommended-settings was installed. - if (isset($this->settingsPackage)) { + if ($this->settingsPackage) { $settings = new Settings($this->composer, $this->io, $this->settingsPackage); $settings->hashSalt(); $settings->generateSettings();