Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Driver/DefaultDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class DefaultDriver implements DriverInterface
*/
private $wrapped;

public function __construct(DriverInterface $wrapped = null)
public function __construct(?DriverInterface $wrapped = null)
{
$this->wrapped = $wrapped ?: new Fpdi2Driver;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/TcpdiDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class TcpdiDriver implements DriverInterface
*/
private $tcpdi;

public function __construct(\TCPDI $tcpdi = null)
public function __construct(?\TCPDI $tcpdi = null)
{
$this->tcpdi = $tcpdi ?: new \TCPDI;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Merger.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ final class Merger
*/
private $driver;

public function __construct(DriverInterface $driver = null)
public function __construct(?DriverInterface $driver = null)
{
$this->driver = $driver ?: new DefaultDriver;
}

/**
* Add raw PDF from string
*/
public function addRaw(string $content, PagesInterface $pages = null): void
public function addRaw(string $content, ?PagesInterface $pages = null): void
{
$this->sources[] = new RawSource($content, $pages);
}

/**
* Add PDF from file
*/
public function addFile(string $filename, PagesInterface $pages = null): void
public function addFile(string $filename, ?PagesInterface $pages = null): void
{
$this->sources[] = new FileSource($filename, $pages);
}
Expand All @@ -54,7 +54,7 @@ public function addFile(string $filename, PagesInterface $pages = null): void
* @param iterable<string> $iterator Set of filenames to add
* @param PagesInterface $pages Optional pages constraint used for every added pdf
*/
public function addIterator(iterable $iterator, PagesInterface $pages = null): void
public function addIterator(iterable $iterator, ?PagesInterface $pages = null): void
{
foreach ($iterator as $filename) {
$this->addFile($filename, $pages);
Expand Down
2 changes: 1 addition & 1 deletion src/Source/FileSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class FileSource implements SourceInterface
*/
private $pages;

public function __construct(string $filename, PagesInterface $pages = null)
public function __construct(string $filename, ?PagesInterface $pages = null)
{
if (!is_file($filename) || !is_readable($filename)) {
throw new Exception("Invalid file '$filename'");
Expand Down
2 changes: 1 addition & 1 deletion src/Source/RawSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class RawSource implements SourceInterface
*/
private $pages;

public function __construct(string $contents, PagesInterface $pages = null)
public function __construct(string $contents, ?PagesInterface $pages = null)
{
$this->contents = $contents;
$this->pages = $pages ?: new Pages;
Expand Down