diff --git a/src/ComposerStager/ProcessFactory.php b/src/ComposerStager/ProcessFactory.php
index fec8b8d48a15dfcbeb95705ab5cb8e5f3614b104..b190f570874a63c39d52b76163a3ea3c88a8ba55 100644
--- a/src/ComposerStager/ProcessFactory.php
+++ b/src/ComposerStager/ProcessFactory.php
@@ -2,9 +2,8 @@
 
 namespace Drupal\automatic_updates\ComposerStager;
 
-use PhpTuf\ComposerStager\Exception\LogicException;
+use PhpTuf\ComposerStager\Infrastructure\Process\ProcessFactory as StagerProcessFactory;
 use PhpTuf\ComposerStager\Infrastructure\Process\ProcessFactoryInterface;
-use Symfony\Component\Process\Exception\ExceptionInterface;
 use Symfony\Component\Process\Process;
 
 /**
@@ -14,27 +13,49 @@ use Symfony\Component\Process\Process;
  */
 final class ProcessFactory implements ProcessFactoryInterface {
 
+  /**
+   * The decorated process factory.
+   *
+   * @var \PhpTuf\ComposerStager\Infrastructure\Process\ProcessFactoryInterface
+   */
+  private $decorated;
+
+  /**
+   * Constructs a ProcessFactory object.
+   */
+  public function __construct() {
+    $this->decorated = new StagerProcessFactory();
+  }
+
+  /**
+   * Returns the value of an environment variable.
+   *
+   * @param string $variable
+   *   The name of the variable.
+   *
+   * @return mixed
+   *   The value of the variable.
+   */
+  private function getEnv(string $variable) {
+    if (function_exists('apache_getenv')) {
+      return apache_getenv($variable);
+    }
+    return getenv($variable);
+  }
+
   /**
    * {@inheritdoc}
    */
   public function create(array $command): Process {
-    try {
-      if ($this->isComposerCommand($command)) {
-        $process = new Process($command, NULL, ['COMPOSER_HOME' => $this->getComposerHomePath()]);
-        $path = function_exists('apache_getenv') ? apache_getenv('PATH') : getenv('PATH');
-        $path .= ':' . dirname(PHP_BINARY);
-        $env = $process->getEnv();
-        $env['PATH'] = $path;
-        $process->setEnv($env);
-        return $process;
-      }
-      return new Process($command);
-      // @codeCoverageIgnore
-    }
-    catch (ExceptionInterface $e) {
-      // @codeCoverageIgnore
-      throw new LogicException($e->getMessage(), (int) $e->getCode(), $e);
+    $process = $this->decorated->create($command);
+
+    $env = $process->getEnv();
+    if ($this->isComposerCommand($command)) {
+      $env['COMPOSER_HOME'] = $this->getComposerHomePath();
     }
+    // Ensure that the running PHP binary is in the PATH.
+    $env['PATH'] = $this->getEnv('PATH') . ':' . dirname(PHP_BINARY);
+    return $process->setEnv($env);
   }
 
   /**
diff --git a/src/Updater.php b/src/Updater.php
index c19b10ccb6332b958b24f5a6df68c3bf1d390906..6e4b9f55c254b6fa7b73048d432b10e7581127b3 100644
--- a/src/Updater.php
+++ b/src/Updater.php
@@ -262,39 +262,6 @@ class Updater {
     $this->stager->stage($command, $this->getStageDirectory());
   }
 
-  /**
-   * Returns the value of an environment variable.
-   *
-   * @param string $variable
-   *   The name of the variable.
-   *
-   * @return mixed
-   *   The value of the variable.
-   */
-  private function getEnv(string $variable) {
-    if (function_exists('apache_getenv')) {
-      return apache_getenv($variable);
-    }
-    return getenv($variable);
-  }
-
-  /**
-   * Sets the value of an environment variable.
-   *
-   * @param string $variable
-   *   The name of the variable.
-   * @param mixed $value
-   *   The value to set.
-   */
-  private function setEnv(string $variable, $value): void {
-    if (function_exists('apache_setenv')) {
-      apache_setenv($variable, $value);
-    }
-    else {
-      putenv("$variable=$value");
-    }
-  }
-
   /**
    * Initializes an active update and returns its ID.
    *