Skip to content

Commit a57b28d

Browse files
committed
Some adjustments for the new Line element #253
1 parent 748e164 commit a57b28d

File tree

15 files changed

+212
-501
lines changed

15 files changed

+212
-501
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
44

55
## 0.11.0 - Not yet released
66

7-
This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Three new elements were added: TextBox, ListItemRun, Line and Field. Relative and absolute positioning for images and textboxes were added. Writer classes were refactored into parts, elements, and styles. ODT and RTF features were enhanced. Ability to add elements to PHPWord object via HTML were implemeted. RTF reader were initiated.
7+
This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Four new elements were added: TextBox, ListItemRun, Field, and Line. Relative and absolute positioning for images and textboxes were added. Writer classes were refactored into parts, elements, and styles. ODT and RTF features were enhanced. Ability to add elements to PHPWord object via HTML were implemeted. RTF reader were initiated.
88

99
### Features
1010

@@ -30,8 +30,8 @@ This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Three
3030
- RTF Writer: Ability to write document properties - @ivanlanin
3131
- RTF Writer: Ability to write image - @ivanlanin
3232
- Element: New `Field` element - @basjan GH-251
33-
- Element: New `Line` element - @basjan
34-
- RTF Reader: Basic RTF reader - @ivanlanin GH-72
33+
- RTF Reader: Basic RTF reader - @ivanlanin GH-72 GH-252
34+
- Element: New `Line` element - @basjan GH-253
3535

3636
### Bugfixes
3737

CHANGELOG.md~

Lines changed: 0 additions & 268 deletions
This file was deleted.

docs/elements.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ column shows the containers while the rows lists the elements.
4545
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
4646
| 18 | Field | v | v | v | v | v | v |
4747
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
48+
| 19 | Line | v | v | v | v | v | v |
49+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
4850

4951
Legend:
5052

@@ -487,3 +489,8 @@ Fields
487489
------
488490

489491
To be completed
492+
493+
Line
494+
------
495+
496+
To be completed

docs/src/documentation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Don't forget to change `code::` directive to `code-block::` in the resulting rst
3535
- [Checkboxes](#checkboxes)
3636
- [Textboxes](#textboxes)
3737
- [Fields](#fields)
38+
- [Lines](#lines)
3839
- [Templates](#templates)
3940
- [Writers & readers](#writers-readers)
4041
- [OOXML](#ooxml)
@@ -463,6 +464,7 @@ Below are the matrix of element availability in each container. The column shows
463464
| 16 | CheckBox | v | v | v | v | - | - |
464465
| 17 | TextBox | v | v | v | v | - | - |
465466
| 18 | Field | v | v | v | v | v | v |
467+
| 19 | Line | v | v | v | v | v | v |
466468

467469
Legend:
468470

@@ -844,6 +846,10 @@ To be completed.
844846

845847
To be completed.
846848

849+
## Lines
850+
851+
To be completed.
852+
847853
# Templates
848854

849855
You can create a docx template with included search-patterns that can be replaced by any value you wish. Only single-line values can be replaced. To load a template file, use the `loadTemplate` method. After loading the docx template, you can use the `setValue` method to change the value of a search pattern. The search-pattern model is: `${search-pattern}`. It is not possible to add new PHPWord elements to a loaded template file.
File renamed without changes.

src/PhpWord/Element/AbstractContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ public function addTextRun($paragraphStyle = null)
149149
* @param string $type
150150
* @param array $properties
151151
* @param array $options
152+
* @return \PhpOffice\PhpWord\Element\Field
152153
*/
153154
public function addField($type = null, $properties = array(), $options = array())
154155
{
155156
return $this->addElement('Field', $type, $properties, $options);
156-
157157
}
158158

159159
/**

src/PhpWord/Element/Field.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public function __construct($type = null, $properties = array(), $options = arra
9595
*
9696
* @param string $type
9797
* @return string
98+
* @throws \InvalidArgumentException
9899
*/
99100
public function setType($type = null)
100101
{
@@ -123,6 +124,7 @@ public function getType()
123124
*
124125
* @param array $properties
125126
* @return self
127+
* @throws \InvalidArgumentException
126128
*/
127129
public function setProperties($properties = array())
128130
{
@@ -152,6 +154,7 @@ public function getProperties()
152154
*
153155
* @param array $options
154156
* @return self
157+
* @throws \InvalidArgumentException
155158
*/
156159
public function setOptions($options = array())
157160
{

src/PhpWord/Element/Line.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,24 @@ class Line extends AbstractElement
2727
/**
2828
* Line style
2929
*
30-
* @var LineStyle
30+
* @var \PhpOffice\PhpWord\Style\Line
3131
*/
3232
private $style;
33-
33+
3434
/**
3535
* Create new line element
3636
*
37-
* @param string $source
3837
* @param mixed $style
3938
*/
4039
public function __construct($style = null)
4140
{
4241
$this->style = $this->setStyle(new LineStyle(), $style);
4342
}
44-
43+
4544
/**
46-
* Get Image style
45+
* Get line style
4746
*
48-
* @return ImageStyle
47+
* @return \PhpOffice\PhpWord\Style\Line
4948
*/
5049
public function getStyle()
5150
{

0 commit comments

Comments
 (0)