Skip to content

Commit

Permalink
为PHPWord的MPDF插件添加config参数,使其可以正常被使用。
Browse files Browse the repository at this point in the history
  • Loading branch information
boshi_no_1 committed May 24, 2024
1 parent 20b2c1a commit a379098
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/PhpWord/IOFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ abstract class IOFactory
*
* @param string $name
* @param array $config
*
* @return WriterInterface
*/
public static function createWriter(PhpWord $phpWord, $name = 'Word2007', $config = []) : WriterInterface
public static function createWriter(PhpWord $phpWord, $name = 'Word2007', $config = []): WriterInterface
{
if ($name !== 'WriterInterface' && !in_array($name, ['ODText', 'RTF', 'Word2007', 'HTML', 'PDF'], true)) {
throw new Exception("\"{$name}\" is not a valid writer.");
Expand Down
1 change: 0 additions & 1 deletion src/PhpWord/Writer/AbstractWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ abstract class AbstractWriter implements WriterInterface
/**
* construct method.
*
* @param PhpWord|null $phpWord
* @param array $config
*/
public function __construct(?PhpWord $phpWord = null, $config = [])
Expand Down
1 change: 0 additions & 1 deletion src/PhpWord/Writer/PDF/AbstractRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ abstract class AbstractRenderer extends HTML
/**
* Create new instance.
*
* @param PhpWord $phpWord
* @param array $config
*/
public function __construct(PhpWord $phpWord, $config = [])
Expand Down
2 changes: 1 addition & 1 deletion src/PhpWord/Writer/Word2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct(?PhpWord $phpWord = null, $config = [])
foreach (array_keys($this->parts) as $partName) {
$partClass = static::class . '\\Part\\' . $partName;
if (class_exists($partClass)) {
/** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $part Type hint */
/** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $part */
$part = new $partClass();
$part->setParentWriter($this);
$this->writerParts[strtolower($partName)] = $part;
Expand Down

0 comments on commit a379098

Please sign in to comment.