From 3f0ee072e290ead1587150d0b1b6f63722db5412 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:32:17 +0200 Subject: [PATCH] Cleaner io call in Drupal root null check Co-authored-by: Alex Skrypnyk --- scripts/composer/ScriptHandler.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index 7a473f1b7..9abe6d70b 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -22,12 +22,8 @@ public static function createRequiredFiles(Event $event) { $drupalFinder = new DrupalFinderComposerRuntime(); $drupalRoot = $drupalFinder->getDrupalRoot(); - // If Drupal root was not found, exit. if (is_null($drupalRoot)) { - $io = $event->getIO(); - $io->writeError( - 'Drupal root could not be detected.', - ); + $event->getIO()->writeError('Drupal root could not be detected.'); exit(1); }