소스 검색

remove the method encodeToFile from encoders

Olivier Massot 3 년 전
부모
커밋
563bdf8c30
3개의 변경된 파일6개의 추가작업 그리고 21개의 파일을 삭제
  1. 0 2
      src/Service/Export/Encoder/EncoderInterface.php
  2. 0 19
      src/Service/Export/Encoder/PdfEncoder.php
  3. 6 0
      tests/Service/Export/Encoder/PdfEncoderTest.php

+ 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
+{
+
+}