Skip to content

Commit 68dd3fd

Browse files
committed
rename attribute to match generated XML node name
1 parent 11c711b commit 68dd3fd

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/PhpWord/Element/AbstractElement.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ abstract class AbstractElement
119119
*
120120
* @var Comment
121121
*/
122-
protected $commentStart;
122+
protected $commentRangeStart;
123123

124124
/**
125125
* The end position for the linked comment
126126
*
127127
* @var Comment
128128
*/
129-
protected $commentEnd;
129+
protected $commentRangeEnd;
130130

131131
/**
132132
* Get PhpWord
@@ -284,33 +284,33 @@ public function getNestedLevel()
284284
*
285285
* @return Comment
286286
*/
287-
public function getCommentStart()
287+
public function getCommentRangeStart()
288288
{
289-
return $this->commentStart;
289+
return $this->commentRangeStart;
290290
}
291291

292292
/**
293293
* Set comment start
294294
*
295295
* @param Comment $value
296296
*/
297-
public function setCommentStart(Comment $value)
297+
public function setCommentRangeStart(Comment $value)
298298
{
299299
if ($this instanceof Comment) {
300300
throw new \InvalidArgumentException("Cannot set a Comment on a Comment");
301301
}
302-
$this->commentStart = $value;
303-
$this->commentStart->setStartElement($this);
302+
$this->commentRangeStart= $value;
303+
$this->commentRangeStart->setStartElement($this);
304304
}
305305

306306
/**
307307
* Get comment end
308308
*
309309
* @return Comment
310310
*/
311-
public function getCommentEnd()
311+
public function getCommentRangeEnd()
312312
{
313-
return $this->commentEnd;
313+
return $this->commentRangeEnd;
314314
}
315315

316316
/**
@@ -319,13 +319,13 @@ public function getCommentEnd()
319319
* @param Comment $value
320320
* @return void
321321
*/
322-
public function setCommentEnd(Comment $value)
322+
public function setCommentRangeEnd(Comment $value)
323323
{
324324
if ($this instanceof Comment) {
325325
throw new \InvalidArgumentException("Cannot set a Comment on a Comment");
326326
}
327-
$this->commentEnd = $value;
328-
$this->commentEnd->setEndElement($this);
327+
$this->commentRangeEnd= $value;
328+
$this->commentRangeEnd->setEndElement($this);
329329
}
330330

331331
/**

src/PhpWord/Element/Comment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function getInitials()
8282
public function setStartElement(AbstractElement $value)
8383
{
8484
$this->startElement = $value;
85-
if ($value->getCommentStart() == null) {
86-
$value->setCommentStart($this);
85+
if ($value->getCommentRangeStart() == null) {
86+
$value->setCommentRangeStart($this);
8787
}
8888
}
8989

@@ -105,8 +105,8 @@ public function getStartElement()
105105
public function setEndElement(AbstractElement $value)
106106
{
107107
$this->endElement = $value;
108-
if ($value->getCommentEnd() == null) {
109-
$value->setCommentEnd($this);
108+
if ($value->getCommentRangeEnd() == null) {
109+
$value->setCommentRangeEnd($this);
110110
}
111111
}
112112

src/PhpWord/Writer/Word2007/Element/AbstractElement.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ protected function endElementP()
126126
*/
127127
protected function writeCommentRangeStart()
128128
{
129-
if ($this->element->getCommentStart() != null) {
130-
$comment = $this->element->getCommentStart();
129+
if ($this->element->getCommentRangeStart() != null) {
130+
$comment = $this->element->getCommentRangeStart();
131131
//only set the ID if it is not yet set, otherwise it will overwrite it
132132
if ($comment->getElementId() == null) {
133133
$comment->setElementId();
@@ -145,8 +145,8 @@ protected function writeCommentRangeStart()
145145
*/
146146
protected function writeCommentRangeEnd()
147147
{
148-
if ($this->element->getCommentEnd() != null) {
149-
$comment = $this->element->getCommentEnd();
148+
if ($this->element->getCommentRangeEnd() != null) {
149+
$comment = $this->element->getCommentRangeEnd();
150150
//only set the ID if it is not yet set, otherwise it will overwrite it
151151
if ($comment->getElementId() == null) {
152152
$comment->setElementId();
@@ -156,8 +156,8 @@ protected function writeCommentRangeEnd()
156156
$this->xmlWriter->startElement('w:r');
157157
$this->xmlWriter->writeElementBlock('w:commentReference', array('w:id' => $comment->getElementId()));
158158
$this->xmlWriter->endElement();
159-
} elseif ($this->element->getCommentStart() != null && $this->element->getCommentStart()->getEndElement() == null) {
160-
$comment = $this->element->getCommentStart();
159+
} elseif ($this->element->getCommentRangeStart() != null && $this->element->getCommentRangeStart()->getEndElement() == null) {
160+
$comment = $this->element->getCommentRangeStart();
161161
//only set the ID if it is not yet set, otherwise it will overwrite it
162162
if ($comment->getElementId() == null) {
163163
$comment->setElementId();

0 commit comments

Comments
 (0)