Skip to content

Commit a379098

Browse files
author
boshi_no_1
committed
为PHPWord的MPDF插件添加config参数,使其可以正常被使用。
1 parent 20b2c1a commit a379098

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

src/PhpWord/IOFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ abstract class IOFactory
3131
*
3232
* @param string $name
3333
* @param array $config
34-
*
35-
* @return WriterInterface
3634
*/
37-
public static function createWriter(PhpWord $phpWord, $name = 'Word2007', $config = []) : WriterInterface
35+
public static function createWriter(PhpWord $phpWord, $name = 'Word2007', $config = []): WriterInterface
3836
{
3937
if ($name !== 'WriterInterface' && !in_array($name, ['ODText', 'RTF', 'Word2007', 'HTML', 'PDF'], true)) {
4038
throw new Exception("\"{$name}\" is not a valid writer.");

src/PhpWord/Writer/AbstractWriter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ abstract class AbstractWriter implements WriterInterface
103103
/**
104104
* construct method.
105105
*
106-
* @param PhpWord|null $phpWord
107106
* @param array $config
108107
*/
109108
public function __construct(?PhpWord $phpWord = null, $config = [])

src/PhpWord/Writer/PDF/AbstractRenderer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ abstract class AbstractRenderer extends HTML
7676
/**
7777
* Create new instance.
7878
*
79-
* @param PhpWord $phpWord
8079
* @param array $config
8180
*/
8281
public function __construct(PhpWord $phpWord, $config = [])

src/PhpWord/Writer/Word2007.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function __construct(?PhpWord $phpWord = null, $config = [])
7979
foreach (array_keys($this->parts) as $partName) {
8080
$partClass = static::class . '\\Part\\' . $partName;
8181
if (class_exists($partClass)) {
82-
/** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $part Type hint */
82+
/** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $part */
8383
$part = new $partClass();
8484
$part->setParentWriter($this);
8585
$this->writerParts[strtolower($partName)] = $part;

0 commit comments

Comments
 (0)