File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 17
17
18
18
namespace PhpOffice \PhpWord \Element ;
19
19
20
- use PhpOffice \PhpWord \Exception \Exception ;
21
20
use PhpOffice \PhpWord \Style \Section as SectionStyle ;
22
21
23
- /**
24
- * Section
25
- */
26
22
class Section extends AbstractContainer
27
23
{
28
24
/**
@@ -91,8 +87,12 @@ public function getStyle()
91
87
/**
92
88
* Add header
93
89
*
90
+ * @since 0.10.0
91
+ *
94
92
* @param string $type
93
+ *
95
94
* @return Header
95
+ *
96
96
* @since 0.10.0
97
97
*/
98
98
public function addHeader ($ type = Header::AUTO )
@@ -103,8 +103,12 @@ public function addHeader($type = Header::AUTO)
103
103
/**
104
104
* Add footer
105
105
*
106
+ * @since 0.10.0
107
+ *
106
108
* @param string $type
109
+ *
107
110
* @return Footer
111
+ *
108
112
* @since 0.10.0
109
113
*/
110
114
public function addFooter ($ type = Header::AUTO )
@@ -160,7 +164,7 @@ public function hasDifferentFirstPage()
160
164
*
161
165
* @return Header|Footer
162
166
*
163
- * @throws \PhpOffice\PhpWord\Exception\ Exception
167
+ * @throws \Exception
164
168
*/
165
169
private function addHeaderFooter ($ type = Header::AUTO , $ header = true )
166
170
{
@@ -178,7 +182,7 @@ private function addHeaderFooter($type = Header::AUTO, $header = true)
178
182
$ collection [$ index ] = $ container ;
179
183
return $ container ;
180
184
} else {
181
- throw new Exception ('Invalid header/footer type. ' );
185
+ throw new \ Exception ('Invalid header/footer type. ' );
182
186
}
183
187
184
188
}
Original file line number Diff line number Diff line change @@ -150,15 +150,15 @@ public function testAddTitleWithStyle()
150
150
}
151
151
152
152
/**
153
- * Create header footer
153
+ * Add header footer
154
154
*/
155
- public function testCreateHeaderFooter ()
155
+ public function testAddHeaderFooter ()
156
156
{
157
157
$ object = new Section (0 );
158
158
$ elements = array ('Header ' , 'Footer ' );
159
159
160
160
foreach ($ elements as $ element ) {
161
- $ method = "create {$ element }" ;
161
+ $ method = "add {$ element }" ;
162
162
$ this ->assertInstanceOf ("PhpOffice \\PhpWord \\Element \\{$ element }" , $ object ->$ method ());
163
163
}
164
164
$ this ->assertFalse ($ object ->hasDifferentFirstPage ());
@@ -179,7 +179,7 @@ public function testHasDifferentFirstPage()
179
179
* Add header exception
180
180
*
181
181
* @expectedException Exception
182
- * @expectedExceptionMesssage Invalid header/footer type.
182
+ * @expectedExceptionMessage Invalid header/footer type.
183
183
*/
184
184
public function testAddHeaderException ()
185
185
{
You can’t perform that action at this time.
0 commit comments