Skip to content

Commit

Permalink
Release v8.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
finwe committed May 3, 2023
2 parents c264ce2 + 465e6a8 commit 146c7c1
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 198 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ New features
* More verbose helper methods for `Output`: `OutputBinaryData`, `OutputHttpInline`, `OutputHttpDownload`, `OutputFile` (since v8.1.2)
* Set font-size to `auto` in textarea and input in active forms to resize the font-size (@ChrisB9, #1721)
* PHP 8.2 support in mPDF 8.1.3
* Added support for `psr/log` v3 without dropping v2. (@markdorison, @apotek, @greg-1-anderson, #1857)

Bugfixes
--------
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"ext-gd": "*",
"ext-mbstring": "*",
"mpdf/psr-log-aware-trait": "^2.0 || ^3.0",
"myclabs/deep-copy": "^1.7",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php-http/message-factory": "^1.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0 || ^2.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"setasign/fpdi": "^2.1"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<testsuites>
<testsuite name="Tests">
<directory suffix=".php">./tests</directory>
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

Expand Down
10 changes: 3 additions & 7 deletions src/AssetFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
use Mpdf\Http\ClientInterface;
use Mpdf\Http\Request;
use Mpdf\Log\Context as LogContext;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Psr\Log\LoggerInterface;

class AssetFetcher implements \Psr\Log\LoggerAwareInterface
{

use PsrLogAwareTrait;

private $mpdf;

private $contentLoader;

private $http;

private $logger;

public function __construct(Mpdf $mpdf, LocalContentLoaderInterface $contentLoader, ClientInterface $http, LoggerInterface $logger)
{
$this->mpdf = $mpdf;
Expand Down Expand Up @@ -116,9 +117,4 @@ public function isPathLocal($path)
return strpos($path, '://') === false; // @todo More robust implementation
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

}
9 changes: 2 additions & 7 deletions src/Http/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

use Mpdf\Log\Context as LogContext;
use Mpdf\Mpdf;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerInterface;

class CurlHttpClient implements \Mpdf\Http\ClientInterface, \Psr\Log\LoggerAwareInterface
{
use PsrLogAwareTrait;

private $mpdf;

private $logger;

public function __construct(Mpdf $mpdf, LoggerInterface $logger)
{
$this->mpdf = $mpdf;
Expand Down Expand Up @@ -116,9 +116,4 @@ static function ($curl, $header) use (&$response) {
->withBody(Stream::create($data));
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

}
8 changes: 2 additions & 6 deletions src/Http/SocketHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Mpdf\Http;

use Mpdf\Log\Context as LogContext;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerInterface;

class SocketHttpClient implements \Mpdf\Http\ClientInterface, \Psr\Log\LoggerAwareInterface
{

private $logger;
use PsrLogAwareTrait;

public function __construct(LoggerInterface $logger)
{
Expand Down Expand Up @@ -104,9 +105,4 @@ public function sendRequest(RequestInterface $request)
->withBody($stream);
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

}
20 changes: 3 additions & 17 deletions src/Image/ImageProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
use Mpdf\Log\Context as LogContext;
use Mpdf\Mpdf;
use Mpdf\Otl;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Mpdf\SizeConverter;
use Psr\Log\LoggerInterface;

class ImageProcessor implements \Psr\Log\LoggerAwareInterface
{

use PsrLogAwareTrait;

/**
* @var \Mpdf\Mpdf
*/
Expand Down Expand Up @@ -89,11 +92,6 @@ class ImageProcessor implements \Psr\Log\LoggerAwareInterface
*/
private $assetFetcher;

/**
* @var \Psr\Log\LoggerInterface
*/
public $logger;

public function __construct(
Mpdf $mpdf,
Otl $otl,
Expand Down Expand Up @@ -126,18 +124,6 @@ public function __construct(
$this->failedImages = [];
}

/**
* @param \Psr\Log\LoggerInterface
*
* @return self
*/
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;

return $this;
}

public function getImage(&$file, $firstTime = true, $allowvector = true, $orig_srcpath = false, $interpolation = false)
{
// mPDF 6
Expand Down
28 changes: 3 additions & 25 deletions src/Mpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
use Mpdf\Log\Context as LogContext;
use Mpdf\Fonts\MetricsGenerator;
use Mpdf\Output\Destination;
use Mpdf\PsrLogAwareTrait\MpdfPsrLogAwareTrait;
use Mpdf\QrCode;
use Mpdf\Utils\Arrays;
use Mpdf\Utils\NumericString;
use Mpdf\Utils\UtfString;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

/**
Expand All @@ -30,8 +30,9 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface

use Strict;
use FpdiTrait;
use MpdfPsrLogAwareTrait;

const VERSION = '8.1.5';
const VERSION = '8.1.6';

const SCALE = 72 / 25.4;

Expand Down Expand Up @@ -966,11 +967,6 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
*/
private $scriptToLanguage;

/**
* @var \Psr\Log\LoggerInterface
*/
private $logger;

/**
* @var \Mpdf\Writer\BaseWriter
*/
Expand Down Expand Up @@ -1579,24 +1575,6 @@ public function cleanup()
$this->createdReaders = [];
}

/**
* @param \Psr\Log\LoggerInterface
*
* @return \Mpdf\Mpdf
*/
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;

foreach ($this->services as $name) {
if ($this->$name && $this->$name instanceof \Psr\Log\LoggerAwareInterface) {
$this->$name->setLogger($logger);
}
}

return $this;
}

private function initConfig(array $config)
{
$configObject = new ConfigVariables();
Expand Down
13 changes: 3 additions & 10 deletions src/SizeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

use Psr\Log\LoggerInterface;
use Mpdf\Log\Context as LogContext;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;

class SizeConverter implements \Psr\Log\LoggerAwareInterface
{

use PsrLogAwareTrait;

private $dpi;

private $defaultFontSize;
Expand All @@ -17,11 +20,6 @@ class SizeConverter implements \Psr\Log\LoggerAwareInterface
*/
private $mpdf;

/**
* @var \Psr\Log\LoggerInterface
*/
private $logger;

public function __construct($dpi, $defaultFontSize, Mpdf $mpdf, LoggerInterface $logger)
{
$this->dpi = $dpi;
Expand All @@ -30,11 +28,6 @@ public function __construct($dpi, $defaultFontSize, Mpdf $mpdf, LoggerInterface
$this->logger = $logger;
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
* Depends of maxsize value to make % work properly. Usually maxsize == pagewidth
* For text $maxsize = $fontsize
Expand Down
12 changes: 2 additions & 10 deletions src/Writer/MetadataWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Mpdf\Form;
use Mpdf\Mpdf;
use Mpdf\Pdf\Protection;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Mpdf\Utils\PdfDate;

use Psr\Log\LoggerInterface;
Expand All @@ -14,6 +15,7 @@ class MetadataWriter implements \Psr\Log\LoggerAwareInterface
{

use Strict;
use PsrLogAwareTrait;

/**
* @var \Mpdf\Mpdf
Expand All @@ -35,11 +37,6 @@ class MetadataWriter implements \Psr\Log\LoggerAwareInterface
*/
private $protection;

/**
* @var \Psr\Log\LoggerInterface
*/
private $logger;

public function __construct(Mpdf $mpdf, BaseWriter $writer, Form $form, Protection $protection, LoggerInterface $logger)
{
$this->mpdf = $mpdf;
Expand Down Expand Up @@ -808,11 +805,6 @@ public function writeTrailer() // _puttrailer
}
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

private function getVersionString()
{
$return = Mpdf::VERSION;
Expand Down
17 changes: 2 additions & 15 deletions src/Writer/ResourceWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use Mpdf\Strict;
use Mpdf\Mpdf;
use Mpdf\PsrLogAwareTrait\PsrLogAwareTrait;
use Psr\Log\LoggerInterface;

final class ResourceWriter implements \Psr\Log\LoggerAwareInterface
{

use Strict;
use PsrLogAwareTrait;

/**
* @var \Mpdf\Mpdf
Expand Down Expand Up @@ -66,11 +68,6 @@ final class ResourceWriter implements \Psr\Log\LoggerAwareInterface
*/
private $javaScriptWriter;

/**
* @var \Psr\Log\LoggerInterface
*/
private $logger;

public function __construct(
Mpdf $mpdf,
BaseWriter $writer,
Expand Down Expand Up @@ -243,14 +240,4 @@ public function writeResources() // _putresources
$this->writer->write('endobj');
}
}

/**
* @param \Psr\Log\LoggerInterface $logger
*
* @return void
*/
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}
}
Loading

0 comments on commit 146c7c1

Please sign in to comment.