Skip to content

Commit 1121a6a

Browse files
committed
More code cleanup
1 parent 86ce862 commit 1121a6a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/PhpWord/TemplateProcessor.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,20 +523,20 @@ public function insertImage($name, $srcFilename, $width = null, $height = null,
523523

524524
foreach ($this->tempDocumentHeaders as $index => $header) {
525525
$tempHeaderRelationships = array_key_exists($index, $this->tempDocumentHeadersRelationships) ? $this->tempDocumentHeadersRelationships[$index] : null;
526-
$imageInsertResult = $this->insertImageForPart($header, $tempHeaderRelationships, $name, $mediaPath, $width, $height, $filename, $this->getHeaderRelsName($index));
526+
$imageInsertResult = $this->insertImageForPart($header, $tempHeaderRelationships, $name, $mediaPath, $width, $height, $filename);
527527
if ($imageInsertResult) {
528528
list($this->tempDocumentHeaders[$index], $this->tempDocumentHeadersRelationships[$index]) = $imageInsertResult;
529529
}
530530
}
531531

532-
$imageInsertResult = $this->insertImageForPart($this->tempDocumentMainPart, $this->tempDocumentRelationships, $name, $mediaPath, $width, $height, $filename, 'word/_rels/document.xml.rels');
532+
$imageInsertResult = $this->insertImageForPart($this->tempDocumentMainPart, $this->tempDocumentRelationships, $name, $mediaPath, $width, $height, $filename);
533533
if ($imageInsertResult) {
534534
list($this->tempDocumentMainPart, $this->tempDocumentRelationships) = $imageInsertResult;
535535
}
536536

537537
foreach ($this->tempDocumentFooters as $index => $footer) {
538538
$tempFooterRelationships = array_key_exists($index, $this->tempDocumentFootersRelationships) ? $this->tempDocumentFootersRelationships[$index] : null;
539-
$imageInsertResult = $this->insertImageForPart($footer, $tempFooterRelationships, $name, $mediaPath, $width, $height, $filename, $this->getFooterRelsName($index));
539+
$imageInsertResult = $this->insertImageForPart($footer, $tempFooterRelationships, $name, $mediaPath, $width, $height, $filename);
540540
if ($imageInsertResult) {
541541
list($this->tempDocumentFooters[$index], $this->tempDocumentFootersRelationships[$index]) = $imageInsertResult;
542542
}
@@ -951,11 +951,10 @@ protected function getPartRelationshipId($tempPartRelationships, $mediaFileName)
951951
* @param number $height Height of image in EMU
952952
* @param string $filename Name of file as it should be inserted
953953
* in document
954-
* @param string $relsFilePath Path to relationships file for part
955954
*
956955
* @return string[]|false
957956
*/
958-
protected function insertImageForPart($tempDocumentPart, $tempPartRelationships, $name, $mediaFileName, $width, $height, $filename, $relsFilePath)
957+
protected function insertImageForPart($tempDocumentPart, $tempPartRelationships, $name, $mediaFileName, $width, $height, $filename)
959958
{
960959
$relId = $this->getPartRelationshipId($tempPartRelationships, $mediaFileName);
961960
// hacks for no class scope in callback function in PHP5.3

0 commit comments

Comments
 (0)