Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template engine deprecation #7

Open
wants to merge 3 commits into
base: symfony4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"sort-packages": true
},
"require": {
"php": "^7.1",
"php": "^7.1|^8",
"doctrine/annotations": "^1.0",
"psliwa/php-pdf": "^1.1.5",
"psliwa/php-pdf": "^1.1.5|^2",
"sensio/framework-extra-bundle": "^2|^3|^4|^5",
"symfony/config": "^3.4|^4.0",
"symfony/dependency-injection": "^3.4|^4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/EventListener/PdfListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\Templating\EngineInterface;
use Twig\Environment as Engine;

/**
* This listener will replace reponse content by pdf document's content if Pdf annotations is found.
Expand All @@ -33,7 +33,7 @@ class PdfListener
private $templatingEngine;
private $cache;

public function __construct(FacadeBuilder $pdfFacadeBuilder, Reader $annotationReader, Factory $reflectionFactory, EngineInterface $templatingEngine, Cache $cache)
public function __construct(FacadeBuilder $pdfFacadeBuilder, Reader $annotationReader, Factory $reflectionFactory, Engine $templatingEngine, Cache $cache)
{
$this->pdfFacadeBuilder = $pdfFacadeBuilder;
$this->annotationReader = $annotationReader;
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/pdf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<argument id="ps_pdf.facade_builder" type="service" />
<argument id="annotation_reader" type="service" />
<argument id="ps_pdf.reflection_factory" type="service" />
<argument id="templating" type="service" />
<argument id="twig" type="service" />
<argument id="ps_pdf.cache" type="service" />
</service>

Expand All @@ -86,4 +86,4 @@
<argument>%ps_pdf.cache.options%</argument>
</service>
</services>
</container>
</container>
5 changes: 3 additions & 2 deletions tests/EventListener/PdfListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\Templating\EngineInterface;
use Twig\Environment as Engine;

class PdfListenerTest extends TestCase
{
Expand All @@ -43,7 +43,8 @@ protected function setUp(): void
->setMethods(['render'])
->getMock();

$this->templatingEngine = $this->getMockBuilder(EngineInterface::class)
$this->templatingEngine = $this->getMockBuilder(Engine::class)
->disableOriginalConstructor()
->setMethods(['render', 'supports', 'exists'])
->getMock();

Expand Down