From c8c3590331fb889e023fbbb5bb520587b0e562b0 Mon Sep 17 00:00:00 2001
From: git <git@3644742.no-reply.drupal.org>
Date: Fri, 26 Jun 2020 16:39:20 -0400
Subject: [PATCH] Issue #3147525 by Project Update Bot: Automated Drupal 9
 compatibility fixes

---
 src/Plugin/PdfBackend/LocalServerPdfBackend.php | 10 ++++++----
 xfdf.inc                                        |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/Plugin/PdfBackend/LocalServerPdfBackend.php b/src/Plugin/PdfBackend/LocalServerPdfBackend.php
index 8b4cc6f..3e5be2e 100644
--- a/src/Plugin/PdfBackend/LocalServerPdfBackend.php
+++ b/src/Plugin/PdfBackend/LocalServerPdfBackend.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\fillpdf\Plugin\PdfBackend;
 
+use function GuzzleHttp\json_encode;
+use function GuzzleHttp\json_decode;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\file\FileInterface;
 use Drupal\file\Entity\File;
@@ -85,7 +87,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
       'pdf' => base64_encode($pdf_content),
     ];
 
-    $json = \GuzzleHttp\json_encode($request);
+    $json = json_encode($request);
 
     $fields = [];
 
@@ -107,7 +109,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
       }
     }
 
-    $fields = \GuzzleHttp\json_decode((string) $fields_response->getBody(), TRUE);
+    $fields = json_decode((string) $fields_response->getBody(), TRUE);
 
     return $fields;
   }
@@ -158,7 +160,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
       'fields' => $api_fields,
     ];
 
-    $json = \GuzzleHttp\json_encode($request);
+    $json = json_encode($request);
 
     try {
       $response = $this->httpClient->post($this->configuration['local_service_endpoint'] . '/api/v1/merge', [
@@ -166,7 +168,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
         'headers' => ['Content-Type' => 'application/json'],
       ]);
 
-      $decoded = \GuzzleHttp\json_decode((string) $response->getBody(), TRUE);
+      $decoded = json_decode((string) $response->getBody(), TRUE);
       return base64_decode($decoded['pdf']);
     }
     catch (RequestException $e) {
diff --git a/xfdf.inc b/xfdf.inc
index aa40513..e861ac6 100644
--- a/xfdf.inc
+++ b/xfdf.inc
@@ -40,7 +40,7 @@ function create_xfdf($file, array $info, $enc = 'UTF-8') {
   if ($file) {
     $ids_ele->setAttribute('original', md5($file));
   }
-  $ids_ele->setAttribute('modified', REQUEST_TIME);
+  $ids_ele->setAttribute('modified', \Drupal::time()->getRequestTime());
 
   if ($file) {
     $f_ele = $xfdf_ele->appendChild($doc->createElement('f'));
-- 
GitLab