Skip to content

Commit

Permalink
move to Contributte
Browse files Browse the repository at this point in the history
  • Loading branch information
petrparolek committed Nov 2, 2020
1 parent 8124510 commit 89a6caa
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
18 changes: 9 additions & 9 deletions .docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Joseki\PdfResponse
# Contributte\PdfResponse

## Content

Expand All @@ -25,7 +25,7 @@ public function actionPdf()
$template->someValue = 123;
// Tip: In template to make a new page use <pagebreak>

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);

// optional
$pdf->documentTitle = date("Y-m-d") . " My super title"; // creates filename 2012-06-30-my-super-title.pdf
Expand All @@ -45,7 +45,7 @@ public function actionPdf()
$template = $this->createTemplate();
$template->setFile(__DIR__ . "/path/to/template.latte");

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);

$pdf->save(__DIR__ . "/path/to/directory"); // as a filename $this->documentTitle will be used
$pdf->save(__DIR__ . "/path/to/directory", "filename"); // OR use a custom name
Expand All @@ -60,7 +60,7 @@ public function actionPdf()
$template = $this->createTemplate();
$template->setFile(__DIR__ . "/path/to/template.latte");

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);

$savedFile = $pdf->save(__DIR__ . "/path/to/directory");
$mail = new Nette\Mail\Message;
Expand All @@ -79,7 +79,7 @@ public function actionPdf()
$template = $this->createTemplate();
$template->setFile(__DIR__ . "/path/to/template.latte");

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);
$pdf->setSaveMode(PdfResponse::DOWNLOAD); //default behavior
$this->sendResponse($pdf);
}
Expand All @@ -93,7 +93,7 @@ public function actionPdf()
$template = $this->createTemplate();
$template->setFile(__DIR__ . "/path/to/template.latte");

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);
$pdf->setSaveMode(PdfResponse::INLINE);
$this->sendResponse($pdf);
}
Expand All @@ -104,7 +104,7 @@ public function actionPdf()
```php
public function actionPdf()
{
$pdf = new Joseki\Application\Responses\PdfResponse('');
$pdf = new \Contributte\PdfResponse\PdfResponse('');
$pdf->setBackgroundTemplate(__DIR__ . "/path/to/an/existing/file.pdf");

// to write into an existing document use the following statements
Expand Down Expand Up @@ -136,7 +136,7 @@ public function actionPdf()

$template = $latte->renderToString(__DIR__ . "/path/to/template.latte");

$pdf = new \Joseki\Application\Responses\PdfResponse($template);
$pdf = new \Contributte\PdfResponse\PdfResponse($template);
$this->sendResponse($pdf);
}
```
Expand All @@ -146,7 +146,7 @@ public function actionPdf()
```yml
services:
-
factory: Joseki\Application\Responses\PdfResponse
factory: Contributte\PdfResponse\PdfResponse
setup:
- $mpdfConfig([tempDir: %tempDir%/mpdf])
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"license": "LGPL-3.0",
"autoload": {
"psr-4": {
"Joseki\\Application\\Responses\\": "src/"
"Contributte\\PdfResponse\\": "src/"
}
}
}
2 changes: 1 addition & 1 deletion src/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Joseki\Application\Responses;
namespace Contributte\PdfResponse;

class InvalidArgumentException extends \LogicException
{
Expand Down
2 changes: 1 addition & 1 deletion src/InvalidStateException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Joseki\Application\Responses;
namespace Contributte\PdfResponse;

class InvalidStateException extends \LogicException
{
Expand Down
2 changes: 1 addition & 1 deletion src/MissingServiceException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Joseki\Application\Responses;
namespace Contributte\PdfResponse;

class MissingServiceException extends \LogicException
{
Expand Down
2 changes: 1 addition & 1 deletion src/PdfResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Joseki\Application\Responses;
namespace Contributte\PdfResponse;

use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
Expand Down
2 changes: 1 addition & 1 deletion src/PdfResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Joseki\Application\Responses;
namespace Contributte\PdfResponse;

/**
* @author Petr Parolek <petr.parolek@webnazakazku.cz>
Expand Down
4 changes: 2 additions & 2 deletions tests/PdfResponse/PdfResponse.full.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* Test: Joseki\Application\Responses\PdfResponse.
* Test: Contributte\PdfResponse\PdfResponse.
*/

use Joseki\Application\Responses\PdfResponse;
use Contributte\PdfResponse\PdfResponse;
use Nette\Http;
use Tester\Assert;

Expand Down
6 changes: 3 additions & 3 deletions tests/PdfResponse/PdfResponse.page.format.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* Test: Joseki\Application\Responses\PdfResponse and page format.
* Test: Contributte\PdfResponse\PdfResponse and page format.
* @httpCode -
*/

use Joseki\Application\Responses\PdfResponse;
use Joseki\Application\Responses\InvalidStateException;
use Contributte\PdfResponse\PdfResponse;
use Contributte\PdfResponse\InvalidStateException;
use Nette\Http;
use Tester\Assert;

Expand Down
4 changes: 2 additions & 2 deletions tests/PdfResponse/PdfResponse.save.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* Test: Joseki\Application\Responses\PdfResponse.
* Test: Contributte\PdfResponse\PdfResponse.
*/

use Joseki\Application\Responses\PdfResponse;
use Contributte\PdfResponse\PdfResponse;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';
Expand Down
6 changes: 3 additions & 3 deletions tests/PdfResponse/PdfResponse.setters.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/**
* Test: Joseki\Application\Responses\PdfResponse.
* Test: Contributte\PdfResponse\PdfResponse.
*/

use Joseki\Application\Responses\PdfResponse;
use Joseki\Application\Responses\InvalidArgumentException;
use Contributte\PdfResponse\PdfResponse;
use Contributte\PdfResponse\InvalidArgumentException;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';
Expand Down
4 changes: 2 additions & 2 deletions tests/PdfResponse/PdfResponse.symfony.crawler.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* Test: Joseki\Application\Responses\PdfResponse and Symfony crawler
* Test: Contributte\PdfResponse\PdfResponse and Symfony crawler
*/

use Joseki\Application\Responses\PdfResponse;
use Contributte\PdfResponse\PdfResponse;
use Nette\Http;
use Tester\Assert;

Expand Down
6 changes: 3 additions & 3 deletions tests/PdfResponse/PdfResponseFactory.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ test(
author: $author
services:
- Joseki\Application\Responses\PdfResponseFactory(%mpdfConfig%)
- Contributte\PdfResponse\PdfResponseFactory(%mpdfConfig%)
";

$container = createContainer(new Compiler, $config);

/** @var Joseki\Application\Responses\PdfResponseFactory $instance */
$factoryInstance = $container->getByType(Joseki\Application\Responses\PdfResponseFactory::class);
/** @var Contributte\PdfResponse\PdfResponseFactory $instance */
$factoryInstance = $container->getByType(Contributte\PdfResponse\PdfResponseFactory::class);
Assert::same($author, $factoryInstance->mpdfConfig['author']);
Assert::same($mpdfTmpDir, $factoryInstance->mpdfConfig['tempDir']);
}
Expand Down

0 comments on commit 89a6caa

Please sign in to comment.