From 7bbe1ed620de8b9835171818953c5b04342ddd36 Mon Sep 17 00:00:00 2001 From: Roman Syroeshko Date: Fri, 4 Jul 2014 16:49:01 +0400 Subject: [PATCH] [FIXED] Wrong use of passing by reference. --- src/PhpWord/Reader/Word2007/AbstractPart.php | 4 ++-- src/PhpWord/Writer/AbstractWriter.php | 4 ++-- src/PhpWord/Writer/HTML.php | 3 +-- src/PhpWord/Writer/RTF.php | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index e7155c0b..8a409379 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -248,11 +248,11 @@ abstract class AbstractPart * * @param \PhpOffice\PhpWord\Shared\XMLReader $xmlReader * @param \DOMElement $domNode - * @param mixed &$parent + * @param mixed $parent * @param string $docPart * @return void */ - protected function readTable(XMLReader $xmlReader, \DOMElement $domNode, &$parent, $docPart = 'document') + protected function readTable(XMLReader $xmlReader, \DOMElement $domNode, $parent, $docPart = 'document') { // Table style $tblStyle = null; diff --git a/src/PhpWord/Writer/AbstractWriter.php b/src/PhpWord/Writer/AbstractWriter.php index 58ec89b0..52a2098f 100644 --- a/src/PhpWord/Writer/AbstractWriter.php +++ b/src/PhpWord/Writer/AbstractWriter.php @@ -321,11 +321,11 @@ abstract class AbstractWriter implements WriterInterface * * @since 0.11.0 * - * @param resource &$fileHandle + * @param resource $fileHandle * @param string $content * @return void */ - protected function writeFile(&$fileHandle, $content) + protected function writeFile($fileHandle, $content) { fwrite($fileHandle, $content); fclose($fileHandle); diff --git a/src/PhpWord/Writer/HTML.php b/src/PhpWord/Writer/HTML.php index 502c50e9..5c58acfc 100644 --- a/src/PhpWord/Writer/HTML.php +++ b/src/PhpWord/Writer/HTML.php @@ -69,8 +69,7 @@ class HTML extends AbstractWriter implements WriterInterface */ public function save($filename = null) { - $fileHandle = $this->openFile($filename); - $this->writeFile($fileHandle, $this->getContent()); + $this->writeFile($this->openFile($filename), $this->getContent()); } /** diff --git a/src/PhpWord/Writer/RTF.php b/src/PhpWord/Writer/RTF.php index a5a58475..58210c99 100644 --- a/src/PhpWord/Writer/RTF.php +++ b/src/PhpWord/Writer/RTF.php @@ -63,8 +63,7 @@ class RTF extends AbstractWriter implements WriterInterface */ public function save($filename = null) { - $fileHandle = $this->openFile($filename); - $this->writeFile($fileHandle, $this->getContent()); + $this->writeFile($this->openFile($filename), $this->getContent()); } /**