diff --git a/src/PhpWord/Element/Section.php b/src/PhpWord/Element/Section.php index f8db87d7..97130186 100644 --- a/src/PhpWord/Element/Section.php +++ b/src/PhpWord/Element/Section.php @@ -17,12 +17,8 @@ namespace PhpOffice\PhpWord\Element; -use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Style\Section as SectionStyle; -/** - * Section - */ class Section extends AbstractContainer { /** @@ -91,8 +87,12 @@ class Section extends AbstractContainer /** * Add header * + * @since 0.10.0 + * * @param string $type + * * @return Header + * * @since 0.10.0 */ public function addHeader($type = Header::AUTO) @@ -103,8 +103,12 @@ class Section extends AbstractContainer /** * Add footer * + * @since 0.10.0 + * * @param string $type + * * @return Footer + * * @since 0.10.0 */ public function addFooter($type = Header::AUTO) @@ -160,7 +164,7 @@ class Section extends AbstractContainer * * @return Header|Footer * - * @throws \PhpOffice\PhpWord\Exception\Exception + * @throws \Exception */ private function addHeaderFooter($type = Header::AUTO, $header = true) { @@ -178,7 +182,7 @@ class Section extends AbstractContainer $collection[$index] = $container; return $container; } else { - throw new Exception('Invalid header/footer type.'); + throw new \Exception('Invalid header/footer type.'); } } diff --git a/tests/PhpWord/Element/SectionTest.php b/tests/PhpWord/Element/SectionTest.php index 98931578..dce6c1eb 100644 --- a/tests/PhpWord/Element/SectionTest.php +++ b/tests/PhpWord/Element/SectionTest.php @@ -150,15 +150,15 @@ class SectionTest extends \PHPUnit_Framework_TestCase } /** - * Create header footer + * Add header footer */ - public function testCreateHeaderFooter() + public function testAddHeaderFooter() { $object = new Section(0); $elements = array('Header', 'Footer'); foreach ($elements as $element) { - $method = "create{$element}"; + $method = "add{$element}"; $this->assertInstanceOf("PhpOffice\\PhpWord\\Element\\{$element}", $object->$method()); } $this->assertFalse($object->hasDifferentFirstPage()); @@ -179,7 +179,7 @@ class SectionTest extends \PHPUnit_Framework_TestCase * Add header exception * * @expectedException Exception - * @expectedExceptionMesssage Invalid header/footer type. + * @expectedExceptionMessage Invalid header/footer type. */ public function testAddHeaderException() {