Pārlūkot izejas kodu

remove the method encodeToFile from encoders

Olivier Massot 3 gadi atpakaļ
vecāks
revīzija
563bdf8c30

+ 0 - 2
src/Service/Export/Encoder/EncoderInterface.php

@@ -9,6 +9,4 @@ interface EncoderInterface
     public function support(string $format): bool;
 
     public function encode(string $html, array $options = []);
-
-    public function encodeToFile(string $html, string $path, array $options = []);
 }

+ 0 - 19
src/Service/Export/Encoder/PdfEncoder.php

@@ -56,23 +56,4 @@ class PdfEncoder implements EncoderInterface
 
         return $this->knpSnappy->getOutputFromHtml($html, $options);
     }
-
-    /**
-     * Encode the given HTML content into PDF,
-     * write it into a file at the given location,
-     * and returns the file path
-     *
-     * @param string $html
-     * @param string $path
-     * @param array $options
-     * @return string
-     */
-    public function encodeToFile(string $html, string $path, array $options = []): string
-    {
-        $options = array_merge($this->defaultOptions, $options);
-
-        $this->knpSnappy->generateFromHtml($html, $path, $options);
-
-        return $path;
-    }
 }

+ 6 - 0
tests/Service/Export/Encoder/PdfEncoderTest.php

@@ -0,0 +1,6 @@
+<?php
+
+class PdfEncoderTest
+{
+
+}