Skip to content

Commit

Permalink
Move twig extension to bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Feb 9, 2018
1 parent 09b694f commit f9a2b9c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 71 deletions.
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"myclabs/php-enum": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^5.7|^6.0",
"twig/twig": "^1.34.2|^2.4.4",
"symfony/phpunit-bridge": "^3.0|^4.0",
"symfony/routing": "^3.0|^4.0"
"phpunit/phpunit": "^5.7|^6.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 0 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<testsuites>
<testsuite>
<directory suffix="Test.php">tests</directory>
Expand Down
36 changes: 0 additions & 36 deletions src/Twig/Extension/QrCodeExtension.php

This file was deleted.

19 changes: 14 additions & 5 deletions src/WriterRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,24 @@ public function loadDefaultWriters(): void
return;
}

$this->addWriter(new BinaryWriter());
$this->addWriter(new DebugWriter());
$this->addWriter(new EpsWriter());
$this->addWriter(new PngWriter());
$this->addWriter(new SvgWriter());
$this->addWriters([
new BinaryWriter(),
new DebugWriter(),
new EpsWriter(),
new PngWriter(),
new SvgWriter()
]);

$this->setDefaultWriter('png');
}

public function addWriters(iterable $writers): void
{
foreach ($writers as $writer) {
$this->addWriter($writer);
}
}

public function addWriter(WriterInterface $writer): void
{
$this->writers[$writer->getName()] = $writer;
Expand Down
2 changes: 2 additions & 0 deletions src/WriterRegistryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

interface WriterRegistryInterface
{
public function addWriters(iterable $writers): void;

public function addWriter(WriterInterface $writer): void;

public function getWriter(string $name): WriterInterface;
Expand Down
23 changes: 0 additions & 23 deletions tests/Twig/Extension/QrCodeExtensionTest.php

This file was deleted.

0 comments on commit f9a2b9c

Please sign in to comment.