code: private function replace(string $pattern, string $replacement, string $targetFile)
      {
          $this->filesystem->put(
              $targetFile,
              preg_replace(
                  $pattern,
                  $replacement,
                  $this->filesystem->get($targetFile)
              )
          );
      }
docs: Replace string in the given file.
  
  @param string $pattern
  @param string $replacement
  @param string $targetFile
  
  @return void