diff --git a/CHANGELOG.md b/CHANGELOG.md index c785dbf4..63c295f0 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers - Documentation: Simplify page level docblock - @ivanlanin GH-179 - Writer: Refactor writer classes and make a new Writer abstract class - @ivanlanin GH-160 - Reader: Rename AbstractReader > Reader - @ivanlanin +- General: Refactor folders: Element, Container, and Exception - @ivanlanin ## 0.9.1 - 27 Mar 2014 diff --git a/src/PhpWord/Section/Footer.php b/src/PhpWord/Container/Footer.php similarity index 87% rename from src/PhpWord/Section/Footer.php rename to src/PhpWord/Container/Footer.php index 58c439d2..c1e6034e 100755 --- a/src/PhpWord/Section/Footer.php +++ b/src/PhpWord/Container/Footer.php @@ -7,12 +7,17 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Container; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; +use PhpOffice\PhpWord\Exception\InvalidImageException; use PhpOffice\PhpWord\Media; -use PhpOffice\PhpWord\Section\Footer\PreserveText; use PhpOffice\PhpWord\Shared\String; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Image; /** * Footer element @@ -56,7 +61,7 @@ class Footer * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text, $styleFont = null, $styleParagraph = null) { @@ -86,7 +91,7 @@ class Footer * Create a new TextRun * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\TextRun + * @return \PhpOffice\PhpWord\Element\TextRun */ public function createTextRun($styleParagraph = null) { @@ -99,7 +104,7 @@ class Footer * Add a Table Element * * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Table + * @return \PhpOffice\PhpWord\Element\Table */ public function addTable($style = null) { @@ -113,7 +118,7 @@ class Footer * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addImage($src, $style = null) { @@ -146,7 +151,7 @@ class Footer * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Footer\PreserveText + * @return \PhpOffice\PhpWord\Element\PreserveText */ public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { diff --git a/src/PhpWord/Section/Header.php b/src/PhpWord/Container/Header.php similarity index 90% rename from src/PhpWord/Section/Header.php rename to src/PhpWord/Container/Header.php index 5a89c266..5b6fce42 100755 --- a/src/PhpWord/Section/Header.php +++ b/src/PhpWord/Container/Header.php @@ -7,12 +7,17 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Container; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; +use PhpOffice\PhpWord\Exception\InvalidImageException; use PhpOffice\PhpWord\Media; -use PhpOffice\PhpWord\Section\Footer\PreserveText; use PhpOffice\PhpWord\Shared\String; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Image; /** * Header element @@ -85,7 +90,7 @@ class Header * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text, $styleFont = null, $styleParagraph = null) { @@ -115,7 +120,7 @@ class Header * Create a new TextRun * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\TextRun + * @return \PhpOffice\PhpWord\Element\TextRun */ public function createTextRun($styleParagraph = null) { @@ -128,7 +133,7 @@ class Header * Add a Table Element * * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Table + * @return \PhpOffice\PhpWord\Element\Table */ public function addTable($style = null) { @@ -142,7 +147,7 @@ class Header * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addImage($src, $style = null) { @@ -175,7 +180,7 @@ class Header * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Footer\PreserveText + * @return \PhpOffice\PhpWord\Element\PreserveText */ public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { @@ -192,7 +197,7 @@ class Header * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addWatermark($src, $style = null) { diff --git a/src/PhpWord/Section.php b/src/PhpWord/Container/Section.php similarity index 83% rename from src/PhpWord/Section.php rename to src/PhpWord/Container/Section.php index 090ca236..a3002cb3 100644 --- a/src/PhpWord/Section.php +++ b/src/PhpWord/Container/Section.php @@ -7,22 +7,27 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord; +namespace PhpOffice\PhpWord\Container; -use PhpOffice\PhpWord\Exceptions\InvalidObjectException; -use PhpOffice\PhpWord\Section\Footer; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Header; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\PageBreak; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Title; -use PhpOffice\PhpWord\Section\CheckBox; +use PhpOffice\PhpWord\Exception\InvalidImageException; +use PhpOffice\PhpWord\Exception\InvalidObjectException; +use PhpOffice\PhpWord\Footnote; +use PhpOffice\PhpWord\Media; +use PhpOffice\PhpWord\Style; +use PhpOffice\PhpWord\TOC; +use PhpOffice\PhpWord\Container\Footer; +use PhpOffice\PhpWord\Container\Header; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\Title; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\PageBreak; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\CheckBox; use PhpOffice\PhpWord\Shared\String; /** @@ -40,7 +45,7 @@ class Section /** * Section settings * - * @var \PhpOffice\PhpWord\Section\Settings + * @var \PhpOffice\PhpWord\Container\Settings */ private $_settings; @@ -61,7 +66,7 @@ class Section /** * Section Footer * - * @var \PhpOffice\PhpWord\Section\Footer + * @var \PhpOffice\PhpWord\Container\Footer */ private $_footer = null; @@ -75,7 +80,7 @@ class Section public function __construct($sectionCount, $settings = null) { $this->_sectionCount = $sectionCount; - $this->_settings = new \PhpOffice\PhpWord\Section\Settings(); + $this->_settings = new \PhpOffice\PhpWord\Container\Settings(); $this->setSettings($settings); } @@ -99,7 +104,7 @@ class Section /** * Get Section Settings * - * @return \PhpOffice\PhpWord\Section\Settings + * @return \PhpOffice\PhpWord\Container\Settings */ public function getSettings() { @@ -112,7 +117,7 @@ class Section * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text, $styleFont = null, $styleParagraph = null) { @@ -131,7 +136,7 @@ class Section * @param string $linkName * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Link + * @return \PhpOffice\PhpWord\Element\Link */ public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null) { @@ -178,7 +183,7 @@ class Section * Add a Table Element * * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Table + * @return \PhpOffice\PhpWord\Element\Table */ public function addTable($style = null) { @@ -195,7 +200,7 @@ class Section * @param mixed $styleFont * @param mixed $styleList * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\ListItem + * @return \PhpOffice\PhpWord\Element\ListItem */ public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) { @@ -210,11 +215,11 @@ class Section /** * Add a OLE-Object Element * - * All exceptions should be handled by PhpOffice\PhpWord\Section\Object + * All exceptions should be handled by PhpOffice\PhpWord\Element\Object * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Object + * @return \PhpOffice\PhpWord\Element\Object */ public function addObject($src, $style = null) { @@ -225,7 +230,7 @@ class Section if (strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') { $ext = substr($ext, 0, -1); } - $icon = __DIR__ . "/_staticDocParts/_{$ext}.png"; + $icon = __DIR__ . "/../_staticDocParts/_{$ext}.png"; $rIDimg = Media::addSectionMediaElement($icon, 'image', new Image($icon)); $data = Media::addSectionMediaElement($src, 'oleObject'); $rID = $data[0]; @@ -243,11 +248,11 @@ class Section /** * Add image element * - * All exceptions should be handled by PhpOffice\PhpWord\Section\Image + * All exceptions should be handled by PhpOffice\PhpWord\Element\Image * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addImage($src, $style = null) { @@ -290,7 +295,7 @@ class Section * * @param string $text * @param int $depth - * @return \PhpOffice\PhpWord\Section\Title + * @return \PhpOffice\PhpWord\Element\Title */ public function addTitle($text, $depth = 1) { @@ -321,7 +326,7 @@ class Section * Create a new TextRun * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\TextRun + * @return \PhpOffice\PhpWord\Element\TextRun */ public function createTextRun($styleParagraph = null) { @@ -343,7 +348,7 @@ class Section /** * Create a new Header * - * @return \PhpOffice\PhpWord\Section\Header + * @return \PhpOffice\PhpWord\Container\Header */ public function createHeader() { @@ -381,7 +386,7 @@ class Section /** * Create a new Footer * - * @return \PhpOffice\PhpWord\Section\Footer + * @return \PhpOffice\PhpWord\Container\Footer */ public function createFooter() { @@ -393,7 +398,7 @@ class Section /** * Get footer element * - * @return \PhpOffice\PhpWord\Section\Footer + * @return \PhpOffice\PhpWord\Container\Footer */ public function getFooter() { @@ -404,11 +409,11 @@ class Section * Create a new Footnote Element * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Footnote + * @return \PhpOffice\PhpWord\Element\Footnote */ public function createFootnote($styleParagraph = null) { - $footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph); + $footnote = new \PhpOffice\PhpWord\Element\Footnote($styleParagraph); $refID = Footnote::addFootnoteElement($footnote); $footnote->setReferenceId($refID); $this->_elementCollection[] = $footnote; @@ -422,7 +427,7 @@ class Section * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\CheckBox + * @return \PhpOffice\PhpWord\Element\CheckBox */ public function addCheckBox($name, $text, $styleFont = null, $styleParagraph = null) { diff --git a/src/PhpWord/Section/Settings.php b/src/PhpWord/Container/Settings.php similarity index 99% rename from src/PhpWord/Section/Settings.php rename to src/PhpWord/Container/Settings.php index 2dbfe2d8..daf5d13b 100644 --- a/src/PhpWord/Section/Settings.php +++ b/src/PhpWord/Container/Settings.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Container; /** * Section settings diff --git a/src/PhpWord/Section/CheckBox.php b/src/PhpWord/Element/CheckBox.php similarity index 98% rename from src/PhpWord/Section/CheckBox.php rename to src/PhpWord/Element/CheckBox.php index 5e101d9f..9a3fcc79 100644 --- a/src/PhpWord/Section/CheckBox.php +++ b/src/PhpWord/Element/CheckBox.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Section/Footnote.php b/src/PhpWord/Element/Footnote.php similarity index 96% rename from src/PhpWord/Section/Footnote.php rename to src/PhpWord/Element/Footnote.php index c86d8e44..d1cb61cf 100644 --- a/src/PhpWord/Section/Footnote.php +++ b/src/PhpWord/Element/Footnote.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Paragraph; @@ -67,7 +67,7 @@ class Footnote * * @param string $text * @param mixed $styleFont - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text = null, $styleFont = null) { @@ -97,7 +97,7 @@ class Footnote * @param string $linkSrc * @param string $linkName * @param mixed $styleFont - * @return \PhpOffice\PhpWord\Section\Link + * @return \PhpOffice\PhpWord\Element\Link */ public function addLink($linkSrc, $linkName = null, $styleFont = null) { diff --git a/src/PhpWord/Section/Image.php b/src/PhpWord/Element/Image.php similarity index 95% rename from src/PhpWord/Section/Image.php rename to src/PhpWord/Element/Image.php index 9f5a7838..89ee6f37 100755 --- a/src/PhpWord/Section/Image.php +++ b/src/PhpWord/Element/Image.php @@ -7,10 +7,10 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; -use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException; +use PhpOffice\PhpWord\Exception\InvalidImageException; +use PhpOffice\PhpWord\Exception\UnsupportedImageTypeException; /** * Image element @@ -86,8 +86,8 @@ class Image * @param string $source * @param mixed $style * @param bool $isWatermark - * @throws \PhpOffice\PhpWord\Exceptions\InvalidImageException - * @throws \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException + * @throws \PhpOffice\PhpWord\Exception\InvalidImageException + * @throws \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException */ public function __construct($source, $style = null, $isWatermark = false) { diff --git a/src/PhpWord/Section/Link.php b/src/PhpWord/Element/Link.php similarity index 98% rename from src/PhpWord/Section/Link.php rename to src/PhpWord/Element/Link.php index 240d0445..1b6cf22a 100644 --- a/src/PhpWord/Section/Link.php +++ b/src/PhpWord/Element/Link.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Section/ListItem.php b/src/PhpWord/Element/ListItem.php similarity index 95% rename from src/PhpWord/Section/ListItem.php rename to src/PhpWord/Element/ListItem.php index 3981814e..e920d4b8 100644 --- a/src/PhpWord/Section/ListItem.php +++ b/src/PhpWord/Element/ListItem.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; /** * List item element @@ -24,7 +24,7 @@ class ListItem /** * Textrun * - * @var \PhpOffice\PhpWord\Section\Text + * @var \PhpOffice\PhpWord\Element\Text */ private $_textObject; diff --git a/src/PhpWord/Section/Object.php b/src/PhpWord/Element/Object.php similarity index 98% rename from src/PhpWord/Section/Object.php rename to src/PhpWord/Element/Object.php index 9b6cc328..61bf6f8e 100644 --- a/src/PhpWord/Section/Object.php +++ b/src/PhpWord/Element/Object.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; /** * Object element diff --git a/src/PhpWord/Section/PageBreak.php b/src/PhpWord/Element/PageBreak.php similarity index 89% rename from src/PhpWord/Section/PageBreak.php rename to src/PhpWord/Element/PageBreak.php index e12c3e3d..4e49582d 100644 --- a/src/PhpWord/Section/PageBreak.php +++ b/src/PhpWord/Element/PageBreak.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; /** * Page break element diff --git a/src/PhpWord/Section/Footer/PreserveText.php b/src/PhpWord/Element/PreserveText.php similarity index 98% rename from src/PhpWord/Section/Footer/PreserveText.php rename to src/PhpWord/Element/PreserveText.php index 6fbd7bba..453e9b84 100644 --- a/src/PhpWord/Section/Footer/PreserveText.php +++ b/src/PhpWord/Element/PreserveText.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section\Footer; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Section/Table.php b/src/PhpWord/Element/Table.php similarity index 95% rename from src/PhpWord/Section/Table.php rename to src/PhpWord/Element/Table.php index aff9a23a..fc168349 100644 --- a/src/PhpWord/Section/Table.php +++ b/src/PhpWord/Element/Table.php @@ -7,9 +7,9 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; -use PhpOffice\PhpWord\Section\Table\Row; +use PhpOffice\PhpWord\Element\Table\Row; /** * Table element @@ -98,7 +98,7 @@ class Table * * @param int $width * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Table\Cell + * @return \PhpOffice\PhpWord\Element\Table\Cell */ public function addCell($width = null, $style = null) { diff --git a/src/PhpWord/Section/Table/Cell.php b/src/PhpWord/Element/Table/Cell.php similarity index 89% rename from src/PhpWord/Section/Table/Cell.php rename to src/PhpWord/Element/Table/Cell.php index e0004350..0e0d688e 100755 --- a/src/PhpWord/Section/Table/Cell.php +++ b/src/PhpWord/Element/Table/Cell.php @@ -7,21 +7,21 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section\Table; +namespace PhpOffice\PhpWord\Element\Table; -use PhpOffice\PhpWord\Exceptions\Exception; -use PhpOffice\PhpWord\Exceptions\InvalidObjectException; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; +use PhpOffice\PhpWord\Exception\Exception; +use PhpOffice\PhpWord\Exception\InvalidObjectException; +use PhpOffice\PhpWord\Exception\InvalidImageException; use PhpOffice\PhpWord\Media; -use PhpOffice\PhpWord\Section\Footer\PreserveText; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\CheckBox; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\CheckBox; use PhpOffice\PhpWord\Shared\String; /** @@ -100,7 +100,7 @@ class Cell * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text, $styleFont = null, $styleParagraph = null) { @@ -118,7 +118,7 @@ class Cell * @param string $linkSrc * @param string $linkName * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Link + * @return \PhpOffice\PhpWord\Element\Link */ public function addLink($linkSrc, $linkName = null, $style = null) { @@ -165,7 +165,7 @@ class Cell * @param int $depth * @param mixed $styleText * @param mixed $styleList - * @return \PhpOffice\PhpWord\Section\ListItem + * @return \PhpOffice\PhpWord\Element\ListItem */ public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) { @@ -182,7 +182,7 @@ class Cell * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addImage($src, $style = null) { @@ -220,7 +220,7 @@ class Cell * * @param string $src * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Object + * @return \PhpOffice\PhpWord\Element\Object */ public function addObject($src, $style = null) { @@ -262,7 +262,7 @@ class Cell * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Footer\PreserveText + * @return \PhpOffice\PhpWord\Element\PreserveText */ public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { @@ -282,7 +282,7 @@ class Cell * Create a new TextRun * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\TextRun + * @return \PhpOffice\PhpWord\Element\TextRun */ public function createTextRun($styleParagraph = null) { @@ -298,7 +298,7 @@ class Cell * @param string $text * @param mixed $styleFont * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\CheckBox + * @return \PhpOffice\PhpWord\Element\CheckBox */ public function addCheckBox($name, $text, $styleFont = null, $styleParagraph = null) { diff --git a/src/PhpWord/Section/Table/Row.php b/src/PhpWord/Element/Table/Row.php similarity index 95% rename from src/PhpWord/Section/Table/Row.php rename to src/PhpWord/Element/Table/Row.php index 8410f571..c027d373 100644 --- a/src/PhpWord/Section/Table/Row.php +++ b/src/PhpWord/Element/Table/Row.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section\Table; +namespace PhpOffice\PhpWord\Element\Table; /** * Table row element @@ -83,7 +83,7 @@ class Row * * @param int $width * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Table\Cell + * @return \PhpOffice\PhpWord\Element\Table\Cell */ public function addCell($width = null, $style = null) { diff --git a/src/PhpWord/Section/Text.php b/src/PhpWord/Element/Text.php similarity index 98% rename from src/PhpWord/Section/Text.php rename to src/PhpWord/Element/Text.php index 4e228cda..75e1727e 100644 --- a/src/PhpWord/Section/Text.php +++ b/src/PhpWord/Element/Text.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Section/TextBreak.php b/src/PhpWord/Element/TextBreak.php similarity index 98% rename from src/PhpWord/Section/TextBreak.php rename to src/PhpWord/Element/TextBreak.php index 4df4c780..39f3ac16 100755 --- a/src/PhpWord/Section/TextBreak.php +++ b/src/PhpWord/Element/TextBreak.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Section/TextRun.php b/src/PhpWord/Element/TextRun.php similarity index 91% rename from src/PhpWord/Section/TextRun.php rename to src/PhpWord/Element/TextRun.php index bcb5173a..a890bb04 100755 --- a/src/PhpWord/Section/TextRun.php +++ b/src/PhpWord/Element/TextRun.php @@ -7,9 +7,9 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; +use PhpOffice\PhpWord\Exception\InvalidImageException; use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Style\Font; @@ -65,7 +65,7 @@ class TextRun * * @param string $text * @param mixed $styleFont - * @return \PhpOffice\PhpWord\Section\Text + * @return \PhpOffice\PhpWord\Element\Text */ public function addText($text = null, $styleFont = null) { @@ -83,7 +83,7 @@ class TextRun * @param string $linkSrc * @param string $linkName * @param mixed $styleFont - * @return \PhpOffice\PhpWord\Section\Link + * @return \PhpOffice\PhpWord\Element\Link */ public function addLink($linkSrc, $linkName = null, $styleFont = null) { @@ -105,7 +105,7 @@ class TextRun * * @param string $imageSrc * @param mixed $style - * @return \PhpOffice\PhpWord\Section\Image + * @return \PhpOffice\PhpWord\Element\Image */ public function addImage($imageSrc, $style = null) { @@ -138,11 +138,11 @@ class TextRun * Create a new Footnote Element * * @param mixed $styleParagraph - * @return \PhpOffice\PhpWord\Section\Footnote + * @return \PhpOffice\PhpWord\Element\Footnote */ public function createFootnote($styleParagraph = null) { - $footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph); + $footnote = new \PhpOffice\PhpWord\Element\Footnote($styleParagraph); $refID = \PhpOffice\PhpWord\Footnote::addFootnoteElement($footnote); $footnote->setReferenceId($refID); $this->_elementCollection[] = $footnote; diff --git a/src/PhpWord/Section/Title.php b/src/PhpWord/Element/Title.php similarity index 98% rename from src/PhpWord/Section/Title.php rename to src/PhpWord/Element/Title.php index c93f6687..3921d66c 100644 --- a/src/PhpWord/Section/Title.php +++ b/src/PhpWord/Element/Title.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Section; +namespace PhpOffice\PhpWord\Element; /** * Title element diff --git a/src/PhpWord/Exceptions/Exception.php b/src/PhpWord/Exception/Exception.php similarity index 86% rename from src/PhpWord/Exceptions/Exception.php rename to src/PhpWord/Exception/Exception.php index 44323baa..470698a8 100755 --- a/src/PhpWord/Exceptions/Exception.php +++ b/src/PhpWord/Exception/Exception.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Exceptions; +namespace PhpOffice\PhpWord\Exception; /** * General exception diff --git a/src/PhpWord/Exceptions/InvalidImageException.php b/src/PhpWord/Exception/InvalidImageException.php similarity index 88% rename from src/PhpWord/Exceptions/InvalidImageException.php rename to src/PhpWord/Exception/InvalidImageException.php index 319a6203..c8d2143c 100644 --- a/src/PhpWord/Exceptions/InvalidImageException.php +++ b/src/PhpWord/Exception/InvalidImageException.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Exceptions; +namespace PhpOffice\PhpWord\Exception; /** * Exception used for when an image is not found diff --git a/src/PhpWord/Exceptions/InvalidObjectException.php b/src/PhpWord/Exception/InvalidObjectException.php similarity index 88% rename from src/PhpWord/Exceptions/InvalidObjectException.php rename to src/PhpWord/Exception/InvalidObjectException.php index c6a89ac7..b27de805 100644 --- a/src/PhpWord/Exceptions/InvalidObjectException.php +++ b/src/PhpWord/Exception/InvalidObjectException.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Exceptions; +namespace PhpOffice\PhpWord\Exception; /** * Exception used for when an image is not found diff --git a/src/PhpWord/Exceptions/InvalidStyleException.php b/src/PhpWord/Exception/InvalidStyleException.php similarity index 89% rename from src/PhpWord/Exceptions/InvalidStyleException.php rename to src/PhpWord/Exception/InvalidStyleException.php index 9b22e0ae..37290e63 100644 --- a/src/PhpWord/Exceptions/InvalidStyleException.php +++ b/src/PhpWord/Exception/InvalidStyleException.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Exceptions; +namespace PhpOffice\PhpWord\Exception; use InvalidArgumentException; diff --git a/src/PhpWord/Exceptions/UnsupportedImageTypeException.php b/src/PhpWord/Exception/UnsupportedImageTypeException.php similarity index 88% rename from src/PhpWord/Exceptions/UnsupportedImageTypeException.php rename to src/PhpWord/Exception/UnsupportedImageTypeException.php index a2ea1ee9..2b1a25ce 100644 --- a/src/PhpWord/Exceptions/UnsupportedImageTypeException.php +++ b/src/PhpWord/Exception/UnsupportedImageTypeException.php @@ -7,7 +7,7 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Exceptions; +namespace PhpOffice\PhpWord\Exception; /** * Exception used for when an image type is unsupported diff --git a/src/PhpWord/Footnote.php b/src/PhpWord/Footnote.php index 69228ee8..af104bc8 100644 --- a/src/PhpWord/Footnote.php +++ b/src/PhpWord/Footnote.php @@ -33,7 +33,7 @@ class Footnote * * @return int Reference ID */ - public static function addFootnoteElement(\PhpOffice\PhpWord\Section\Footnote $footnote) + public static function addFootnoteElement(\PhpOffice\PhpWord\Element\Footnote $footnote) { $refID = self::countFootnoteElements() + 2; diff --git a/src/PhpWord/HashTable.php b/src/PhpWord/HashTable.php index 97e9be45..93bcb689 100644 --- a/src/PhpWord/HashTable.php +++ b/src/PhpWord/HashTable.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; /** * Hash table @@ -48,7 +48,7 @@ class HashTable * Add HashTable items from source * * @param \PhpOffice\PhpWord\IComparable[] $pSource Source array to create HashTable from - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function addFromSource($pSource = null) { diff --git a/src/PhpWord/IOFactory.php b/src/PhpWord/IOFactory.php index 6965e270..f99f7a00 100644 --- a/src/PhpWord/IOFactory.php +++ b/src/PhpWord/IOFactory.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; /** * IO factory @@ -22,7 +22,7 @@ abstract class IOFactory * @param \PhpOffice\PhpWord\PhpWord $phpWord * @param string $name * @return \PhpOffice\PhpWord\Writer\IWriter - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public static function createWriter(PhpWord $phpWord, $name) { @@ -39,7 +39,7 @@ abstract class IOFactory * * @param string $name * @return \PhpOffice\PhpWord\Reader\IReader - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public static function createReader($name) { diff --git a/src/PhpWord/Media.php b/src/PhpWord/Media.php index a9a9a6af..35800f92 100755 --- a/src/PhpWord/Media.php +++ b/src/PhpWord/Media.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord; -use PhpOffice\PhpWord\Section\Image; +use PhpOffice\PhpWord\Element\Image; /** * Media @@ -53,7 +53,7 @@ class Media * * @param string $src * @param string $type - * @param \PhpOffice\PhpWord\Section\Image $image + * @param \PhpOffice\PhpWord\Element\Image $image * @return mixed */ public static function addSectionMediaElement($src, $type, Image $image = null) @@ -165,7 +165,7 @@ class Media * * @param int $headerCount * @param string $src - * @param \PhpOffice\PhpWord\Section\Image $image + * @param \PhpOffice\PhpWord\Element\Image $image * @return int */ public static function addHeaderMediaElement($headerCount, $src, Image $image = null) @@ -228,7 +228,7 @@ class Media * * @param int $footerCount * @param string $src - * @param \PhpOffice\PhpWord\Section\Image $image + * @param \PhpOffice\PhpWord\Element\Image $image * @return int */ public static function addFooterMediaElement($footerCount, $src, Image $image = null) diff --git a/src/PhpWord/PhpWord.php b/src/PhpWord/PhpWord.php index e0506803..894d7df7 100644 --- a/src/PhpWord/PhpWord.php +++ b/src/PhpWord/PhpWord.php @@ -10,8 +10,8 @@ namespace PhpOffice\PhpWord; use PhpOffice\PhpWord\DocumentProperties; -use PhpOffice\PhpWord\Exceptions\Exception; -use PhpOffice\PhpWord\Section; +use PhpOffice\PhpWord\Exception\Exception; +use PhpOffice\PhpWord\Container\Section; use PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\Template; @@ -94,8 +94,8 @@ class PhpWord /** * Create new section * - * @param \PhpOffice\PhpWord\Section\Settings $settings - * @return \PhpOffice\PhpWord\Section + * @param \PhpOffice\PhpWord\Container\Settings $settings + * @return \PhpOffice\PhpWord\Container\Section */ public function createSection($settings = null) { @@ -216,7 +216,7 @@ class PhpWord /** * Get all sections * - * @return \PhpOffice\PhpWord\Section[] + * @return \PhpOffice\PhpWord\Container\Section[] */ public function getSections() { @@ -228,7 +228,7 @@ class PhpWord * * @param string $filename Fully qualified filename. * @return \PhpOffice\PhpWord\Template - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function loadTemplate($filename) { diff --git a/src/PhpWord/Reader/Reader.php b/src/PhpWord/Reader/Reader.php index 153a4013..e50ca7b5 100644 --- a/src/PhpWord/Reader/Reader.php +++ b/src/PhpWord/Reader/Reader.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Reader; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; /** * Reader abstract class @@ -60,7 +60,7 @@ abstract class Reader implements IReader * * @param string $pFilename * @return resource - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ protected function openFile($pFilename) { diff --git a/src/PhpWord/Reader/Word2007.php b/src/PhpWord/Reader/Word2007.php index 9161d162..12cf4e6b 100644 --- a/src/PhpWord/Reader/Word2007.php +++ b/src/PhpWord/Reader/Word2007.php @@ -12,7 +12,7 @@ namespace PhpOffice\PhpWord\Reader; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\Settings; use PhpOffice\PhpWord\DocumentProperties; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; /** * Reader for Word2007 @@ -24,7 +24,7 @@ class Word2007 extends Reader implements IReader * * @param string $pFilename * @return bool - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function canRead($pFilename) { diff --git a/src/PhpWord/Shared/ZipArchive.php b/src/PhpWord/Shared/ZipArchive.php index ae22357a..f207385c 100644 --- a/src/PhpWord/Shared/ZipArchive.php +++ b/src/PhpWord/Shared/ZipArchive.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Shared; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; // @codeCoverageIgnoreStart if (!defined('PCLZIP_TEMPORARY_DIR')) { diff --git a/src/PhpWord/Shared/ZipStreamWrapper.php b/src/PhpWord/Shared/ZipStreamWrapper.php index 87e17983..23b69d84 100644 --- a/src/PhpWord/Shared/ZipStreamWrapper.php +++ b/src/PhpWord/Shared/ZipStreamWrapper.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Shared; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Settings; /** diff --git a/src/PhpWord/Style/Font.php b/src/PhpWord/Style/Font.php index d1f5353a..cc1f530c 100644 --- a/src/PhpWord/Style/Font.php +++ b/src/PhpWord/Style/Font.php @@ -10,7 +10,7 @@ namespace PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\PhpWord; -use PhpOffice\PhpWord\Exceptions\InvalidStyleException; +use PhpOffice\PhpWord\Exception\InvalidStyleException; /** * Font style @@ -513,7 +513,7 @@ class Font * * @param int|float|string $lineHeight * @return $this - * @throws \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @throws \PhpOffice\PhpWord\Exception\InvalidStyleException */ public function setLineHeight($lineHeight) { diff --git a/src/PhpWord/Style/Paragraph.php b/src/PhpWord/Style/Paragraph.php index 982aee44..dbb04610 100755 --- a/src/PhpWord/Style/Paragraph.php +++ b/src/PhpWord/Style/Paragraph.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Style; -use PhpOffice\PhpWord\Exceptions\InvalidStyleException; +use PhpOffice\PhpWord\Exception\InvalidStyleException; /** * Paragraph style @@ -468,7 +468,7 @@ class Paragraph * * @param int|float|string $lineHeight * @return $this - * @throws \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @throws \PhpOffice\PhpWord\Exception\InvalidStyleException */ public function setLineHeight($lineHeight) { diff --git a/src/PhpWord/Template.php b/src/PhpWord/Template.php index f54d729e..0711ecd5 100644 --- a/src/PhpWord/Template.php +++ b/src/PhpWord/Template.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Settings; use PhpOffice\PhpWord\Shared\String; @@ -44,7 +44,7 @@ class Template * Create a new Template Object * * @param string $strFilename - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function __construct($strFilename) { @@ -71,7 +71,7 @@ class Template * @param \DOMDocument $xslDOMDocument * @param array $xslOptions * @param string $xslOptionsURI - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xslOptionsURI = '') { @@ -147,7 +147,7 @@ class Template * * @param int $offset * @return int - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ private function _findRowStart($offset) { @@ -193,7 +193,7 @@ class Template * * @param string $search * @param int $numberOfClones - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function cloneRow($search, $numberOfClones) { @@ -247,7 +247,7 @@ class Template * Save XML to temporary file * * @return string - * @throws \PhpOffice\PhpWord\Exceptions\Exception + * @throws \PhpOffice\PhpWord\Exception\Exception */ public function save() { diff --git a/src/PhpWord/Writer/ODText.php b/src/PhpWord/Writer/ODText.php index 7ff31bf0..72955ef1 100755 --- a/src/PhpWord/Writer/ODText.php +++ b/src/PhpWord/Writer/ODText.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\HashTable; use PhpOffice\PhpWord\Settings; diff --git a/src/PhpWord/Writer/ODText/Content.php b/src/PhpWord/Writer/ODText/Content.php index 2e9a61e6..ccbdcfce 100644 --- a/src/PhpWord/Writer/ODText/Content.php +++ b/src/PhpWord/Writer/ODText/Content.php @@ -10,17 +10,17 @@ namespace PhpOffice\PhpWord\Writer\ODText; use PhpOffice\PhpWord\PhpWord; -use PhpOffice\PhpWord\Section; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\PageBreak; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Title; +use PhpOffice\PhpWord\Container\Section; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\PageBreak; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\Title; use PhpOffice\PhpWord\Shared\XMLWriter; use PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\Style\Font; diff --git a/src/PhpWord/Writer/ODText/Manifest.php b/src/PhpWord/Writer/ODText/Manifest.php index 31168e3d..69949c73 100755 --- a/src/PhpWord/Writer/ODText/Manifest.php +++ b/src/PhpWord/Writer/ODText/Manifest.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\ODText; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\Shared\XMLWriter; diff --git a/src/PhpWord/Writer/RTF.php b/src/PhpWord/Writer/RTF.php index e37e53b3..b5ce20a7 100755 --- a/src/PhpWord/Writer/RTF.php +++ b/src/PhpWord/Writer/RTF.php @@ -9,19 +9,19 @@ namespace PhpOffice\PhpWord\Writer; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\HashTable; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\PageBreak; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Title; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\PageBreak; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\Title; use PhpOffice\PhpWord\Shared\Drawing; use PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\Style\Font; diff --git a/src/PhpWord/Writer/Word2007.php b/src/PhpWord/Writer/Word2007.php index 687bf8d2..5f247707 100755 --- a/src/PhpWord/Writer/Word2007.php +++ b/src/PhpWord/Writer/Word2007.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\Footnote; use PhpOffice\PhpWord\Media; diff --git a/src/PhpWord/Writer/Word2007/Base.php b/src/PhpWord/Writer/Word2007/Base.php index 3acf6c1d..b6e4c32c 100644 --- a/src/PhpWord/Writer/Word2007/Base.php +++ b/src/PhpWord/Writer/Word2007/Base.php @@ -10,18 +10,18 @@ namespace PhpOffice\PhpWord\Writer\Word2007; use PhpOffice\PhpWord\PhpWord; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\Title; -use PhpOffice\PhpWord\Section\Footer\PreserveText; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\Footnote; -use PhpOffice\PhpWord\Section\CheckBox; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\Title; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\Footnote; +use PhpOffice\PhpWord\Element\CheckBox; use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Shared\XMLWriter; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Writer/Word2007/ContentTypes.php b/src/PhpWord/Writer/Word2007/ContentTypes.php index 65c75384..98121133 100755 --- a/src/PhpWord/Writer/Word2007/ContentTypes.php +++ b/src/PhpWord/Writer/Word2007/ContentTypes.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Shared\XMLWriter; /** diff --git a/src/PhpWord/Writer/Word2007/Document.php b/src/PhpWord/Writer/Word2007/Document.php index 03184bd1..c4f8278f 100644 --- a/src/PhpWord/Writer/Word2007/Document.php +++ b/src/PhpWord/Writer/Word2007/Document.php @@ -10,19 +10,19 @@ namespace PhpOffice\PhpWord\Writer\Word2007; use PhpOffice\PhpWord\PhpWord; -use PhpOffice\PhpWord\Section; -use PhpOffice\PhpWord\Section\Footnote; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\ListItem; -use PhpOffice\PhpWord\Section\Object; -use PhpOffice\PhpWord\Section\PageBreak; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Title; -use PhpOffice\PhpWord\Section\CheckBox; +use PhpOffice\PhpWord\Container\Section; +use PhpOffice\PhpWord\Element\Footnote; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\ListItem; +use PhpOffice\PhpWord\Element\Object; +use PhpOffice\PhpWord\Element\PageBreak; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Element\Title; +use PhpOffice\PhpWord\Element\CheckBox; use PhpOffice\PhpWord\Shared\XMLWriter; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; diff --git a/src/PhpWord/Writer/Word2007/DocumentRels.php b/src/PhpWord/Writer/Word2007/DocumentRels.php index 53a5ded5..648d0864 100755 --- a/src/PhpWord/Writer/Word2007/DocumentRels.php +++ b/src/PhpWord/Writer/Word2007/DocumentRels.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Shared\XMLWriter; /** diff --git a/src/PhpWord/Writer/Word2007/Footer.php b/src/PhpWord/Writer/Word2007/Footer.php index 4a3b97f6..de2bf44d 100644 --- a/src/PhpWord/Writer/Word2007/Footer.php +++ b/src/PhpWord/Writer/Word2007/Footer.php @@ -9,13 +9,13 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Section\Footer\PreserveText; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Footer as FooterElement; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Container\Footer as FooterElement; use PhpOffice\PhpWord\Shared\XMLWriter; /** diff --git a/src/PhpWord/Writer/Word2007/Footnotes.php b/src/PhpWord/Writer/Word2007/Footnotes.php index ce4aba60..d8ba4352 100644 --- a/src/PhpWord/Writer/Word2007/Footnotes.php +++ b/src/PhpWord/Writer/Word2007/Footnotes.php @@ -9,10 +9,10 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Section\Footnote; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\Link; -use PhpOffice\PhpWord\Section\TextBreak; +use PhpOffice\PhpWord\Element\Footnote; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\Link; +use PhpOffice\PhpWord\Element\TextBreak; use PhpOffice\PhpWord\Style\Paragraph; use PhpOffice\PhpWord\Shared\XMLWriter; diff --git a/src/PhpWord/Writer/Word2007/FootnotesRels.php b/src/PhpWord/Writer/Word2007/FootnotesRels.php index d0665de3..405df69f 100644 --- a/src/PhpWord/Writer/Word2007/FootnotesRels.php +++ b/src/PhpWord/Writer/Word2007/FootnotesRels.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Shared\XMLWriter; /** diff --git a/src/PhpWord/Writer/Word2007/Header.php b/src/PhpWord/Writer/Word2007/Header.php index 03757693..07a16ec7 100644 --- a/src/PhpWord/Writer/Word2007/Header.php +++ b/src/PhpWord/Writer/Word2007/Header.php @@ -9,13 +9,13 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Section\Footer\PreserveText; -use PhpOffice\PhpWord\Section\Image; -use PhpOffice\PhpWord\Section\Table; -use PhpOffice\PhpWord\Section\Text; -use PhpOffice\PhpWord\Section\TextBreak; -use PhpOffice\PhpWord\Section\TextRun; -use PhpOffice\PhpWord\Section\Header as HeaderElement; +use PhpOffice\PhpWord\Element\PreserveText; +use PhpOffice\PhpWord\Element\Image; +use PhpOffice\PhpWord\Element\Table; +use PhpOffice\PhpWord\Element\Text; +use PhpOffice\PhpWord\Element\TextBreak; +use PhpOffice\PhpWord\Element\TextRun; +use PhpOffice\PhpWord\Container\Header as HeaderElement; use PhpOffice\PhpWord\Shared\XMLWriter; /** diff --git a/src/PhpWord/Writer/Word2007/Rels.php b/src/PhpWord/Writer/Word2007/Rels.php index 3e41033f..a675057f 100755 --- a/src/PhpWord/Writer/Word2007/Rels.php +++ b/src/PhpWord/Writer/Word2007/Rels.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\Shared\XMLWriter; diff --git a/src/PhpWord/Writer/Word2007/WriterPart.php b/src/PhpWord/Writer/Word2007/WriterPart.php index ead47239..a61662e9 100755 --- a/src/PhpWord/Writer/Word2007/WriterPart.php +++ b/src/PhpWord/Writer/Word2007/WriterPart.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\Writer\IWriter; use PhpOffice\PhpWord\Shared\XMLWriter; diff --git a/src/PhpWord/Writer/Writer.php b/src/PhpWord/Writer/Writer.php index bc749738..e53d215a 100644 --- a/src/PhpWord/Writer/Writer.php +++ b/src/PhpWord/Writer/Writer.php @@ -9,7 +9,7 @@ namespace PhpOffice\PhpWord\Writer; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; use PhpOffice\PhpWord\PhpWord; /** diff --git a/tests/PhpWord/Tests/AutoloaderTest.php b/tests/PhpWord/Tests/AutoloaderTest.php index 549f05a8..ac2f4a78 100644 --- a/tests/PhpWord/Tests/AutoloaderTest.php +++ b/tests/PhpWord/Tests/AutoloaderTest.php @@ -45,11 +45,11 @@ class AutoloaderTest extends \PHPUnit_Framework_TestCase 'classes outside of the PhpOffice\\PhpWord namespace' ); // TODO change this class to the main PhpWord class when it is namespaced - Autoloader::autoload('PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException'); + Autoloader::autoload('PhpOffice\\PhpWord\\Exception\\InvalidStyleException'); $this->assertTrue( - \in_array('PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException', \get_declared_classes()), + \in_array('PhpOffice\\PhpWord\\Exception\\InvalidStyleException', \get_declared_classes()), 'PhpOffice\\PhpWord\\Autoloader::autoload() failed to autoload the ' . - 'PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException class' + 'PhpOffice\\PhpWord\\Exception\\InvalidStyleException class' ); } } diff --git a/tests/PhpWord/Tests/Section/FooterTest.php b/tests/PhpWord/Tests/Container/FooterTest.php similarity index 81% rename from tests/PhpWord/Tests/Section/FooterTest.php rename to tests/PhpWord/Tests/Container/FooterTest.php index d14f125c..d9988ac5 100644 --- a/tests/PhpWord/Tests/Section/FooterTest.php +++ b/tests/PhpWord/Tests/Container/FooterTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Container; -use PhpOffice\PhpWord\Section\Footer; +use PhpOffice\PhpWord\Container\Footer; /** - * Test class for PhpOffice\PhpWord\Section\Footer + * Test class for PhpOffice\PhpWord\Container\Footer * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $iVal = rand(1, 1000); $oFooter = new Footer($iVal); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer', $oFooter); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Container\\Footer', $oFooter); $this->assertEquals($oFooter->getFooterCount(), $iVal); } @@ -39,7 +39,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->addText('text'); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); } /** @@ -51,7 +51,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->addText(utf8_decode('ééé')); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertEquals($element->getText(), 'ééé'); } @@ -76,7 +76,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->createTextRun(); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $element); } /** @@ -88,7 +88,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->addTable(); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $element); } /** @@ -102,7 +102,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element2 = $oFooter->addMemoryImage($src); // @deprecated $this->assertCount(2, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element1); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element1); } /** @@ -116,7 +116,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase ); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -128,7 +128,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->addPreserveText('text'); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); } /** @@ -140,7 +140,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase $element = $oFooter->addPreserveText(utf8_decode('ééé')); $this->assertCount(1, $oFooter->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); $this->assertEquals($element->getText(), array('ééé')); } diff --git a/tests/PhpWord/Tests/Section/HeaderTest.php b/tests/PhpWord/Tests/Container/HeaderTest.php similarity index 85% rename from tests/PhpWord/Tests/Section/HeaderTest.php rename to tests/PhpWord/Tests/Container/HeaderTest.php index edc5d2c6..df1435de 100644 --- a/tests/PhpWord/Tests/Section/HeaderTest.php +++ b/tests/PhpWord/Tests/Container/HeaderTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Container; -use PhpOffice\PhpWord\Section\Header; +use PhpOffice\PhpWord\Container\Header; /** - * Test class for PhpOffice\PhpWord\Section\Header + * Test class for PhpOffice\PhpWord\Container\Header * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $iVal = rand(1, 1000); $oHeader = new Header($iVal); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Header', $oHeader); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Container\\Header', $oHeader); $this->assertEquals($oHeader->getHeaderCount(), $iVal); $this->assertEquals($oHeader->getType(), Header::AUTO); } @@ -39,7 +39,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $oHeader = new Header(1); $element = $oHeader->addText('text'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertCount(1, $oHeader->getElements()); $this->assertEquals($element->getText(), 'text'); } @@ -52,7 +52,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $oHeader = new Header(1); $element = $oHeader->addText(utf8_decode('ééé')); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertCount(1, $oHeader->getElements()); $this->assertEquals($element->getText(), 'ééé'); } @@ -85,7 +85,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase { $oHeader = new Header(1); $element = $oHeader->createTextRun(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $element); $this->assertCount(1, $oHeader->getElements()); } @@ -96,7 +96,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase { $oHeader = new Header(1); $element = $oHeader->addTable(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $element); $this->assertCount(1, $oHeader->getElements()); } @@ -111,7 +111,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $element2 = $oHeader->addMemoryImage($src); // @deprecated $this->assertCount(2, $oHeader->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element1); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element1); } /** @@ -125,7 +125,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase ); $this->assertCount(1, $oHeader->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -137,7 +137,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $element = $oHeader->addPreserveText('text'); $this->assertCount(1, $oHeader->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); } /** @@ -149,7 +149,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $element = $oHeader->addPreserveText(utf8_decode('ééé')); $this->assertCount(1, $oHeader->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); $this->assertEquals($element->getText(), array('ééé')); } @@ -163,7 +163,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $element = $oHeader->addWatermark($src); $this->assertCount(1, $oHeader->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** diff --git a/tests/PhpWord/Tests/SectionTest.php b/tests/PhpWord/Tests/Container/SectionTest.php similarity index 86% rename from tests/PhpWord/Tests/SectionTest.php rename to tests/PhpWord/Tests/Container/SectionTest.php index 48b5bb73..a61498ea 100644 --- a/tests/PhpWord/Tests/SectionTest.php +++ b/tests/PhpWord/Tests/Container/SectionTest.php @@ -7,13 +7,13 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests; +namespace PhpOffice\PhpWord\Tests\Container; -use PhpOffice\PhpWord\Section; +use PhpOffice\PhpWord\Container\Section; use PhpOffice\PhpWord\Style; /** - * Test class for PhpOffice\PhpWord\Section + * Test class for PhpOffice\PhpWord\Container\Section * * @runTestsInSeparateProcesses */ @@ -71,8 +71,8 @@ class SectionTest extends \PHPUnit_Framework_TestCase */ public function testAddElements() { - $objectSource = __DIR__ . "/_files/documents/reader.docx"; - $imageSource = __DIR__ . "/_files/images/PhpWord.png"; + $objectSource = __DIR__ . "/../_files/documents/reader.docx"; + $imageSource = __DIR__ . "/../_files/images/PhpWord.png"; $imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif'; $section = new Section(0); @@ -97,7 +97,7 @@ class SectionTest extends \PHPUnit_Framework_TestCase 'Title', 'TextRun', 'Footnote', 'CheckBox'); $i = 0; foreach ($elementTypes as $elementType) { - $this->assertInstanceOf("PhpOffice\\PhpWord\\Section\\{$elementType}", $elementCollection[$i]); + $this->assertInstanceOf("PhpOffice\\PhpWord\\Element\\{$elementType}", $elementCollection[$i]); $i++; } $this->assertInstanceOf("PhpOffice\\PhpWord\\TOC", $elementCollection[$i]); @@ -106,7 +106,7 @@ class SectionTest extends \PHPUnit_Framework_TestCase /** * Test add object exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidObjectException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidObjectException */ public function testAddObjectException() { @@ -125,7 +125,7 @@ class SectionTest extends \PHPUnit_Framework_TestCase $section->addTitle('Test', 1); $elementCollection = $section->getElements(); - $this->assertInstanceOf("PhpOffice\\PhpWord\\Section\\Title", $elementCollection[0]); + $this->assertInstanceOf("PhpOffice\\PhpWord\\Element\\Title", $elementCollection[0]); } /** @@ -138,7 +138,7 @@ class SectionTest extends \PHPUnit_Framework_TestCase foreach ($elements as $element) { $method = "create{$element}"; - $this->assertInstanceOf("PhpOffice\\PhpWord\\Section\\{$element}", $object->$method()); + $this->assertInstanceOf("PhpOffice\\PhpWord\\Container\\{$element}", $object->$method()); } $this->assertFalse($object->hasDifferentFirstPage()); } diff --git a/tests/PhpWord/Tests/Section/SettingsTest.php b/tests/PhpWord/Tests/Container/SettingsTest.php similarity index 95% rename from tests/PhpWord/Tests/Section/SettingsTest.php rename to tests/PhpWord/Tests/Container/SettingsTest.php index 8fb62f1c..3d5ae43a 100644 --- a/tests/PhpWord/Tests/Section/SettingsTest.php +++ b/tests/PhpWord/Tests/Container/SettingsTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Container; -use PhpOffice\PhpWord\Section\Settings; +use PhpOffice\PhpWord\Container\Settings; /** - * Test class for PhpOffice\PhpWord\Section\Settings + * Test class for PhpOffice\PhpWord\Container\Settings * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Settings + * @coversDefaultClass \PhpOffice\PhpWord\Container\Settings * @runTestsInSeparateProcesses */ class SettingsTest extends \PHPUnit_Framework_TestCase @@ -255,10 +255,10 @@ class SettingsTest extends \PHPUnit_Framework_TestCase $this->assertEquals(720, $oSettings->getColsSpace()); $iVal = rand(1, 1000); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Settings', $oSettings->setColsSpace($iVal)); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Container\\Settings', $oSettings->setColsSpace($iVal)); $this->assertEquals($iVal, $oSettings->getColsSpace()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Settings', $oSettings->setColsSpace()); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Container\\Settings', $oSettings->setColsSpace()); $this->assertEquals(720, $oSettings->getColsSpace()); } diff --git a/tests/PhpWord/Tests/Section/CheckBoxTest.php b/tests/PhpWord/Tests/Element/CheckBoxTest.php similarity index 91% rename from tests/PhpWord/Tests/Section/CheckBoxTest.php rename to tests/PhpWord/Tests/Element/CheckBoxTest.php index d07a0b69..e4611618 100644 --- a/tests/PhpWord/Tests/Section/CheckBoxTest.php +++ b/tests/PhpWord/Tests/Element/CheckBoxTest.php @@ -7,13 +7,13 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\CheckBox; +use PhpOffice\PhpWord\Element\CheckBox; use PhpOffice\PhpWord\Style\Font; /** - * Test class for PhpOffice\PhpWord\Section\CheckBox + * Test class for PhpOffice\PhpWord\Element\CheckBox * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class CheckBoxTest extends \PHPUnit_Framework_TestCase { $oCheckBox = new CheckBox(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\CheckBox', $oCheckBox); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\CheckBox', $oCheckBox); $this->assertEquals(null, $oCheckBox->getText()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Font', $oCheckBox->getFontStyle()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oCheckBox->getParagraphStyle()); diff --git a/tests/PhpWord/Tests/Section/FootnoteTest.php b/tests/PhpWord/Tests/Element/FootnoteTest.php similarity index 87% rename from tests/PhpWord/Tests/Section/FootnoteTest.php rename to tests/PhpWord/Tests/Element/FootnoteTest.php index fc537ab8..21a18a4f 100644 --- a/tests/PhpWord/Tests/Section/FootnoteTest.php +++ b/tests/PhpWord/Tests/Element/FootnoteTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Footnote; +use PhpOffice\PhpWord\Element\Footnote; /** - * Test class for PhpOffice\PhpWord\Section\Footnote + * Test class for PhpOffice\PhpWord\Element\Footnote * * @runTestsInSeparateProcesses */ @@ -25,7 +25,7 @@ class FootnoteTest extends \PHPUnit_Framework_TestCase { $oFootnote = new Footnote(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footnote', $oFootnote); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Footnote', $oFootnote); $this->assertCount(0, $oFootnote->getElements()); $this->assertEquals($oFootnote->getParagraphStyle(), null); } @@ -62,7 +62,7 @@ class FootnoteTest extends \PHPUnit_Framework_TestCase $element = $oFootnote->addText('text'); $this->assertCount(1, $oFootnote->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); } /** @@ -85,7 +85,7 @@ class FootnoteTest extends \PHPUnit_Framework_TestCase $element = $oFootnote->addLink('http://www.google.fr'); $this->assertCount(1, $oFootnote->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $element); } /** diff --git a/tests/PhpWord/Tests/Section/ImageTest.php b/tests/PhpWord/Tests/Element/ImageTest.php similarity index 89% rename from tests/PhpWord/Tests/Section/ImageTest.php rename to tests/PhpWord/Tests/Element/ImageTest.php index bd4bf394..b0c3d88c 100644 --- a/tests/PhpWord/Tests/Section/ImageTest.php +++ b/tests/PhpWord/Tests/Element/ImageTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Image; +use PhpOffice\PhpWord\Element\Image; /** - * Test class for PhpOffice\PhpWord\Section\Image + * Test class for PhpOffice\PhpWord\Element\Image * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/images/firefox.png"; $oImage = new Image($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getSource(), $src); $this->assertEquals($oImage->getMediaId(), md5($src)); $this->assertEquals($oImage->getIsWatermark(), false); @@ -64,7 +64,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase /** * Image not found * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidImageException */ public function testImageNotFound() { @@ -74,7 +74,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase /** * Invalid image types * - * @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException + * @expectedException \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException */ public function testInvalidImageTypes() { @@ -123,7 +123,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/images/firefox.png"; $oImage = new Image($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getSource(), $src); $this->assertEquals($oImage->getMediaId(), md5($src)); $this->assertEquals($oImage->getImageCreateFunction(), 'imagecreatefrompng'); @@ -140,7 +140,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/images/mario.gif"; $oImage = new Image($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getSource(), $src); $this->assertEquals($oImage->getMediaId(), md5($src)); $this->assertEquals($oImage->getImageCreateFunction(), 'imagecreatefromgif'); @@ -157,7 +157,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/images/earth.jpg"; $oImage = new Image($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getSource(), $src); $this->assertEquals($oImage->getMediaId(), md5($src)); $this->assertEquals($oImage->getImageCreateFunction(), 'imagecreatefromjpeg'); @@ -173,7 +173,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase { $oImage = new Image(__DIR__ . "/../_files/images/duke_nukem.bmp"); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getImageCreateFunction(), null); $this->assertEquals($oImage->getImageFunction(), null); $this->assertEquals($oImage->getImageExtension(), 'bmp'); @@ -187,7 +187,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase { $oImage = new Image(__DIR__ . "/../_files/images/angela_merkel.tif"); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $oImage); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage); $this->assertEquals($oImage->getImageCreateFunction(), null); $this->assertEquals($oImage->getImageFunction(), null); $this->assertEquals($oImage->getImageType(), 'image/tiff'); diff --git a/tests/PhpWord/Tests/Section/LinkTest.php b/tests/PhpWord/Tests/Element/LinkTest.php similarity index 87% rename from tests/PhpWord/Tests/Section/LinkTest.php rename to tests/PhpWord/Tests/Element/LinkTest.php index ae1a3e09..9f89b21c 100644 --- a/tests/PhpWord/Tests/Section/LinkTest.php +++ b/tests/PhpWord/Tests/Element/LinkTest.php @@ -7,15 +7,15 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Link; +use PhpOffice\PhpWord\Element\Link; use PhpOffice\PhpWord\Style\Font; /** - * Test class for PhpOffice\PhpWord\Section\Link + * Test class for PhpOffice\PhpWord\Element\Link * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Link + * @coversDefaultClass \PhpOffice\PhpWord\Element\Link * @runTestsInSeparateProcesses */ class LinkTest extends \PHPUnit_Framework_TestCase @@ -27,7 +27,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase { $oLink = new Link('http://www.google.com'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $oLink); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $oLink); $this->assertEquals($oLink->getLinkSrc(), 'http://www.google.com'); $this->assertEquals($oLink->getLinkName(), null); $this->assertEquals($oLink->getFontStyle(), null); @@ -46,7 +46,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase array('marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600) ); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $oLink); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $oLink); $this->assertEquals($oLink->getLinkSrc(), 'http://www.google.com'); $this->assertEquals($oLink->getLinkName(), 'Search Engine'); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Font', $oLink->getFontStyle()); diff --git a/tests/PhpWord/Tests/Section/ListItemTest.php b/tests/PhpWord/Tests/Element/ListItemTest.php similarity index 81% rename from tests/PhpWord/Tests/Section/ListItemTest.php rename to tests/PhpWord/Tests/Element/ListItemTest.php index 1964cdac..6526f571 100644 --- a/tests/PhpWord/Tests/Section/ListItemTest.php +++ b/tests/PhpWord/Tests/Element/ListItemTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\ListItem; +use PhpOffice\PhpWord\Element\ListItem; /** - * Test class for PhpOffice\PhpWord\Section\ListItem + * Test class for PhpOffice\PhpWord\Element\ListItem * - * @coversDefaultClass \PhpOffice\PhpWord\Section\ListItem + * @coversDefaultClass \PhpOffice\PhpWord\Element\ListItem * @runTestsInSeparateProcesses */ class ListItemTest extends \PHPUnit_Framework_TestCase @@ -26,7 +26,7 @@ class ListItemTest extends \PHPUnit_Framework_TestCase { $oListItem = new ListItem('text'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $oListItem->getTextObject()); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $oListItem->getTextObject()); } /** diff --git a/tests/PhpWord/Tests/Section/ObjectTest.php b/tests/PhpWord/Tests/Element/ObjectTest.php similarity index 86% rename from tests/PhpWord/Tests/Section/ObjectTest.php rename to tests/PhpWord/Tests/Element/ObjectTest.php index d6094de1..22b4787f 100644 --- a/tests/PhpWord/Tests/Section/ObjectTest.php +++ b/tests/PhpWord/Tests/Element/ObjectTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Object; +use PhpOffice\PhpWord\Element\Object; /** - * Test class for PhpOffice\PhpWord\Section\Object + * Test class for PhpOffice\PhpWord\Element\Object * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Object + * @coversDefaultClass \PhpOffice\PhpWord\Element\Object * @runTestsInSeparateProcesses */ class ObjectTest extends \PHPUnit_Framework_TestCase @@ -27,7 +27,7 @@ class ObjectTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/documents/sheet.xls"; $oObject = new Object($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Object', $oObject); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Object', $oObject); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Image', $oObject->getStyle()); $this->assertEquals($oObject->getSource(), $src); } @@ -40,7 +40,7 @@ class ObjectTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/xsl/passthrough.xsl"; $oObject = new Object($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Object', $oObject); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Object', $oObject); $this->assertEquals($oObject->getSource(), null); $this->assertEquals($oObject->getStyle(), null); } @@ -53,7 +53,7 @@ class ObjectTest extends \PHPUnit_Framework_TestCase $src = __DIR__ . "/../_files/documents/sheet.xls"; $oObject = new Object($src, array('width' => '230px')); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Object', $oObject); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Object', $oObject); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Image', $oObject->getStyle()); $this->assertEquals($oObject->getSource(), $src); } diff --git a/tests/PhpWord/Tests/Section/PageBreakTest.php b/tests/PhpWord/Tests/Element/PageBreakTest.php similarity index 65% rename from tests/PhpWord/Tests/Section/PageBreakTest.php rename to tests/PhpWord/Tests/Element/PageBreakTest.php index bf8b03a3..3dbaad87 100644 --- a/tests/PhpWord/Tests/Section/PageBreakTest.php +++ b/tests/PhpWord/Tests/Element/PageBreakTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\PageBreak; +use PhpOffice\PhpWord\Element\PageBreak; /** - * Test class for PhpOffice\PhpWord\Section\PageBreak + * Test class for PhpOffice\PhpWord\Element\PageBreak * - * @coversDefaultClass \PhpOffice\PhpWord\Section\PageBreak + * @coversDefaultClass \PhpOffice\PhpWord\Element\PageBreak * @runTestsInSeparateProcesses */ class PageBreakTest extends \PHPUnit_Framework_TestCase @@ -27,6 +27,6 @@ class PageBreakTest extends \PHPUnit_Framework_TestCase // Section Settings $oPageBreak = new PageBreak(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\PageBreak', $oPageBreak); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PageBreak', $oPageBreak); } } diff --git a/tests/PhpWord/Tests/Section/Footer/PreserveTextTest.php b/tests/PhpWord/Tests/Element/PreserveTextTest.php similarity index 85% rename from tests/PhpWord/Tests/Section/Footer/PreserveTextTest.php rename to tests/PhpWord/Tests/Element/PreserveTextTest.php index 82ded881..16d4361d 100644 --- a/tests/PhpWord/Tests/Section/Footer/PreserveTextTest.php +++ b/tests/PhpWord/Tests/Element/PreserveTextTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section\Footer; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Footer\PreserveText; +use PhpOffice\PhpWord\Element\PreserveText; /** - * Test class for PhpOffice\PhpWord\Section\Footer\PreserveText + * Test class for PhpOffice\PhpWord\Element\PreserveText * * @runTestsInSeparateProcesses */ @@ -25,7 +25,7 @@ class PreserveTextTest extends \PHPUnit_Framework_TestCase { $oPreserveText = new PreserveText(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $oPreserveText); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $oPreserveText); $this->assertEquals($oPreserveText->getText(), null); $this->assertEquals($oPreserveText->getFontStyle(), null); $this->assertEquals($oPreserveText->getParagraphStyle(), null); diff --git a/tests/PhpWord/Tests/Section/Table/CellTest.php b/tests/PhpWord/Tests/Element/Table/CellTest.php similarity index 82% rename from tests/PhpWord/Tests/Section/Table/CellTest.php rename to tests/PhpWord/Tests/Element/Table/CellTest.php index 6f38d986..661120d4 100644 --- a/tests/PhpWord/Tests/Section/Table/CellTest.php +++ b/tests/PhpWord/Tests/Element/Table/CellTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section\Table; +namespace PhpOffice\PhpWord\Tests\Element\Table; -use PhpOffice\PhpWord\Section\Table\Cell; +use PhpOffice\PhpWord\Element\Table\Cell; /** - * Test class for PhpOffice\PhpWord\Section\Table\Cell + * Test class for PhpOffice\PhpWord\Element\Table\Cell * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $iVal = rand(1, 1000); $oCell = new Cell('section', $iVal); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table\\Cell', $oCell); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $oCell); $this->assertEquals($oCell->getWidth(), null); } @@ -62,7 +62,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addText('text'); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); } /** @@ -74,7 +74,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addText(utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertEquals($element->getText(), 'ééé'); } @@ -87,12 +87,12 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addLink(utf8_decode('ééé'), utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $element); } /** * Add link exception - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testAddLinkException() { @@ -120,7 +120,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addListItem('text'); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\ListItem', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItem', $element); $this->assertEquals($element->getTextObject()->getText(), 'text'); } @@ -133,7 +133,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addListItem(utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\ListItem', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItem', $element); $this->assertEquals($element->getTextObject()->getText(), 'ééé'); } @@ -148,7 +148,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element2 = $oCell->addMemoryImage($src); // @deprecated $this->assertCount(2, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element1); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element1); } /** @@ -161,7 +161,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addImage($src); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -174,7 +174,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addImage($src); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -188,7 +188,7 @@ class CellTest extends \PHPUnit_Framework_TestCase ); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -202,7 +202,7 @@ class CellTest extends \PHPUnit_Framework_TestCase ); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -216,7 +216,7 @@ class CellTest extends \PHPUnit_Framework_TestCase ); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); } /** @@ -229,13 +229,13 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addObject($src); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Object', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Object', $element); } /** * Test add object exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidObjectException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidObjectException */ public function testAddObjectException() { @@ -253,7 +253,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addPreserveText('text'); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); } /** @@ -265,14 +265,14 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addPreserveText(utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footer\\PreserveText', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\PreserveText', $element); $this->assertEquals($element->getText(), array('ééé')); } /** * Add preserve text exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testAddPreserveTextException() { @@ -289,7 +289,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->createTextRun(); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $element); } /** @@ -301,7 +301,7 @@ class CellTest extends \PHPUnit_Framework_TestCase $element = $oCell->addCheckBox(utf8_decode('ééé'), utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\CheckBox', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\CheckBox', $element); } /** diff --git a/tests/PhpWord/Tests/Section/Table/RowTest.php b/tests/PhpWord/Tests/Element/Table/RowTest.php similarity index 81% rename from tests/PhpWord/Tests/Section/Table/RowTest.php rename to tests/PhpWord/Tests/Element/Table/RowTest.php index 10d53915..f64c0cb4 100644 --- a/tests/PhpWord/Tests/Section/Table/RowTest.php +++ b/tests/PhpWord/Tests/Element/Table/RowTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section\Table; +namespace PhpOffice\PhpWord\Tests\Element\Table; -use PhpOffice\PhpWord\Section\Table\Row; +use PhpOffice\PhpWord\Element\Table\Row; /** - * Test class for PhpOffice\PhpWord\Section\Table\Row + * Test class for PhpOffice\PhpWord\Element\Table\Row * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Table\Row + * @coversDefaultClass \PhpOffice\PhpWord\Element\Table\Row * @runTestsInSeparateProcesses */ class RowTest extends \PHPUnit_Framework_TestCase @@ -27,7 +27,7 @@ class RowTest extends \PHPUnit_Framework_TestCase $iVal = rand(1, 1000); $oRow = new Row('section', $iVal); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table\\Row', $oRow); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Row', $oRow); $this->assertEquals($oRow->getHeight(), null); $this->assertInternalType('array', $oRow->getCells()); $this->assertCount(0, $oRow->getCells()); @@ -60,7 +60,7 @@ class RowTest extends \PHPUnit_Framework_TestCase $oRow = new Row('section', 1); $element = $oRow->addCell(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table\\Cell', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element); $this->assertCount(1, $oRow->getCells()); } } diff --git a/tests/PhpWord/Tests/Section/TableTest.php b/tests/PhpWord/Tests/Element/TableTest.php similarity index 83% rename from tests/PhpWord/Tests/Section/TableTest.php rename to tests/PhpWord/Tests/Element/TableTest.php index 9808485d..1b337fd6 100644 --- a/tests/PhpWord/Tests/Section/TableTest.php +++ b/tests/PhpWord/Tests/Element/TableTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Table; +use PhpOffice\PhpWord\Element\Table; /** - * Test class for PhpOffice\PhpWord\Section\Table + * Test class for PhpOffice\PhpWord\Element\Table * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Table + * @coversDefaultClass \PhpOffice\PhpWord\Element\Table * @runTestsInSeparateProcesses */ class TableTest extends \PHPUnit_Framework_TestCase @@ -26,7 +26,7 @@ class TableTest extends \PHPUnit_Framework_TestCase { $oTable = new Table('section', 1); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table', $oTable); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $oTable); $this->assertEquals($oTable->getStyle(), null); $this->assertEquals($oTable->getWidth(), null); $this->assertEquals($oTable->getRows(), array()); @@ -75,7 +75,7 @@ class TableTest extends \PHPUnit_Framework_TestCase { $oTable = new Table('section', 1); $element = $oTable->addRow(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table\\Row', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Row', $element); $this->assertCount(1, $oTable->getRows()); } @@ -87,6 +87,6 @@ class TableTest extends \PHPUnit_Framework_TestCase $oTable = new Table('section', 1); $oTable->addRow(); $element = $oTable->addCell(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Table\\Cell', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element); } } diff --git a/tests/PhpWord/Tests/Section/TextBreakTest.php b/tests/PhpWord/Tests/Element/TextBreakTest.php similarity index 89% rename from tests/PhpWord/Tests/Section/TextBreakTest.php rename to tests/PhpWord/Tests/Element/TextBreakTest.php index cf7a58c4..c228215f 100644 --- a/tests/PhpWord/Tests/Section/TextBreakTest.php +++ b/tests/PhpWord/Tests/Element/TextBreakTest.php @@ -7,16 +7,16 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\TextBreak; +use PhpOffice\PhpWord\Element\TextBreak; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Paragraph; /** - * Test class for PhpOffice\PhpWord\Section\TextBreak + * Test class for PhpOffice\PhpWord\Element\TextBreak * - * @coversDefaultClass \PhpOffice\PhpWord\Section\TextBreak + * @coversDefaultClass \PhpOffice\PhpWord\Element\TextBreak * @runTestsInSeparateProcesses */ class TextBreakTest extends \PHPUnit_Framework_TestCase diff --git a/tests/PhpWord/Tests/Section/TextRunTest.php b/tests/PhpWord/Tests/Element/TextRunTest.php similarity index 82% rename from tests/PhpWord/Tests/Section/TextRunTest.php rename to tests/PhpWord/Tests/Element/TextRunTest.php index 32b6d4dc..e71ce108 100644 --- a/tests/PhpWord/Tests/Section/TextRunTest.php +++ b/tests/PhpWord/Tests/Element/TextRunTest.php @@ -7,12 +7,12 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\TextRun; +use PhpOffice\PhpWord\Element\TextRun; /** - * Test class for PhpOffice\PhpWord\Section\TextRun + * Test class for PhpOffice\PhpWord\Element\TextRun * * @runTestsInSeparateProcesses */ @@ -25,7 +25,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase { $oTextRun = new TextRun(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $oTextRun); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $oTextRun); $this->assertCount(0, $oTextRun->getElements()); $this->assertEquals($oTextRun->getParagraphStyle(), null); } @@ -37,7 +37,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase { $oTextRun = new TextRun('pStyle'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $oTextRun); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $oTextRun); $this->assertCount(0, $oTextRun->getElements()); $this->assertEquals($oTextRun->getParagraphStyle(), 'pStyle'); } @@ -49,7 +49,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase { $oTextRun = new TextRun(array('spacing' => 100)); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\TextRun', $oTextRun); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\TextRun', $oTextRun); $this->assertCount(0, $oTextRun->getElements()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oTextRun->getParagraphStyle()); } @@ -62,7 +62,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->addText('text'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertCount(1, $oTextRun->getElements()); $this->assertEquals($element->getText(), 'text'); } @@ -75,7 +75,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->addText(utf8_decode('ééé')); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertCount(1, $oTextRun->getElements()); $this->assertEquals($element->getText(), 'ééé'); } @@ -88,7 +88,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->addLink('http://www.google.fr'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $element); $this->assertCount(1, $oTextRun->getElements()); $this->assertEquals($element->getLinkSrc(), 'http://www.google.fr'); } @@ -101,7 +101,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->addLink('http://www.google.fr', utf8_decode('ééé')); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Link', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Link', $element); $this->assertCount(1, $oTextRun->getElements()); $this->assertEquals($element->getLinkSrc(), 'http://www.google.fr'); $this->assertEquals($element->getLinkName(), 'ééé'); @@ -128,7 +128,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->addImage($src); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Image', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $element); $this->assertCount(1, $oTextRun->getElements()); } @@ -140,7 +140,7 @@ class TextRunTest extends \PHPUnit_Framework_TestCase $oTextRun = new TextRun(); $element = $oTextRun->createFootnote(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Footnote', $element); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Footnote', $element); $this->assertCount(1, $oTextRun->getElements()); } } diff --git a/tests/PhpWord/Tests/Section/TextTest.php b/tests/PhpWord/Tests/Element/TextTest.php similarity index 90% rename from tests/PhpWord/Tests/Section/TextTest.php rename to tests/PhpWord/Tests/Element/TextTest.php index 5811c735..953dfc8f 100644 --- a/tests/PhpWord/Tests/Section/TextTest.php +++ b/tests/PhpWord/Tests/Element/TextTest.php @@ -7,13 +7,13 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Text; +use PhpOffice\PhpWord\Element\Text; use PhpOffice\PhpWord\Style\Font; /** - * Test class for PhpOffice\PhpWord\Section\Text + * Test class for PhpOffice\PhpWord\Element\Text * * @runTestsInSeparateProcesses */ @@ -26,7 +26,7 @@ class TextTest extends \PHPUnit_Framework_TestCase { $oText = new Text(); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $oText); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $oText); $this->assertEquals(null, $oText->getText()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Font', $oText->getFontStyle()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oText->getParagraphStyle()); diff --git a/tests/PhpWord/Tests/Section/TitleTest.php b/tests/PhpWord/Tests/Element/TitleTest.php similarity index 84% rename from tests/PhpWord/Tests/Section/TitleTest.php rename to tests/PhpWord/Tests/Element/TitleTest.php index a63d184c..6c472b0d 100644 --- a/tests/PhpWord/Tests/Section/TitleTest.php +++ b/tests/PhpWord/Tests/Element/TitleTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Section; +namespace PhpOffice\PhpWord\Tests\Element; -use PhpOffice\PhpWord\Section\Title; +use PhpOffice\PhpWord\Element\Title; /** - * Test class for PhpOffice\PhpWord\Section\Title + * Test class for PhpOffice\PhpWord\Element\Title * - * @coversDefaultClass \PhpOffice\PhpWord\Section\Title + * @coversDefaultClass \PhpOffice\PhpWord\Element\Title * @runTestsInSeparateProcesses */ class TitleTest extends \PHPUnit_Framework_TestCase @@ -26,7 +26,7 @@ class TitleTest extends \PHPUnit_Framework_TestCase { $oTitle = new Title('text'); - $this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Title', $oTitle); + $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Title', $oTitle); $this->assertEquals($oTitle->getText(), 'text'); } diff --git a/tests/PhpWord/Tests/Exceptions/ExceptionTest.php b/tests/PhpWord/Tests/Exception/ExceptionTest.php similarity index 55% rename from tests/PhpWord/Tests/Exceptions/ExceptionTest.php rename to tests/PhpWord/Tests/Exception/ExceptionTest.php index 81732c97..04eb03e0 100644 --- a/tests/PhpWord/Tests/Exceptions/ExceptionTest.php +++ b/tests/PhpWord/Tests/Exception/ExceptionTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Exceptions; +namespace PhpOffice\PhpWord\Tests\Exception; -use PhpOffice\PhpWord\Exceptions\Exception; +use PhpOffice\PhpWord\Exception\Exception; /** - * Test class for PhpOffice\PhpWord\Exceptions\Exception + * Test class for PhpOffice\PhpWord\Exception\Exception * - * @coversDefaultClass \PhpOffice\PhpWord\Exceptions\Exception + * @coversDefaultClass \PhpOffice\PhpWord\Exception\Exception * @runTestsInSeparateProcesses */ class ExceptionTest extends \PHPUnit_Framework_TestCase @@ -22,8 +22,8 @@ class ExceptionTest extends \PHPUnit_Framework_TestCase /** * Throw new exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception - * @covers \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception + * @covers \PhpOffice\PhpWord\Exception\Exception */ public function testThrowException() { diff --git a/tests/PhpWord/Tests/Exceptions/InvalidImageExceptionTest.php b/tests/PhpWord/Tests/Exception/InvalidImageExceptionTest.php similarity index 52% rename from tests/PhpWord/Tests/Exceptions/InvalidImageExceptionTest.php rename to tests/PhpWord/Tests/Exception/InvalidImageExceptionTest.php index 7db70993..c0dfedda 100644 --- a/tests/PhpWord/Tests/Exceptions/InvalidImageExceptionTest.php +++ b/tests/PhpWord/Tests/Exception/InvalidImageExceptionTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Exceptions; +namespace PhpOffice\PhpWord\Tests\Exception; -use PhpOffice\PhpWord\Exceptions\InvalidImageException; +use PhpOffice\PhpWord\Exception\InvalidImageException; /** - * Test class for PhpOffice\PhpWord\Exceptions\InvalidImageException + * Test class for PhpOffice\PhpWord\Exception\InvalidImageException * - * @coversDefaultClass \PhpOffice\PhpWord\Exceptions\InvalidImageException + * @coversDefaultClass \PhpOffice\PhpWord\Exception\InvalidImageException * @runTestsInSeparateProcesses */ class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase @@ -22,8 +22,8 @@ class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase /** * Throw new exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException - * @covers \PhpOffice\PhpWord\Exceptions\InvalidImageException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidImageException + * @covers \PhpOffice\PhpWord\Exception\InvalidImageException */ public function testThrowException() { diff --git a/tests/PhpWord/Tests/Exceptions/InvalidStyleExceptionTest.php b/tests/PhpWord/Tests/Exception/InvalidStyleExceptionTest.php similarity index 52% rename from tests/PhpWord/Tests/Exceptions/InvalidStyleExceptionTest.php rename to tests/PhpWord/Tests/Exception/InvalidStyleExceptionTest.php index 174e07ac..1cc29a72 100644 --- a/tests/PhpWord/Tests/Exceptions/InvalidStyleExceptionTest.php +++ b/tests/PhpWord/Tests/Exception/InvalidStyleExceptionTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Exceptions; +namespace PhpOffice\PhpWord\Tests\Exception; -use PhpOffice\PhpWord\Exceptions\InvalidStyleException; +use PhpOffice\PhpWord\Exception\InvalidStyleException; /** - * Test class for PhpOffice\PhpWord\Exceptions\InvalidStyleException + * Test class for PhpOffice\PhpWord\Exception\InvalidStyleException * - * @coversDefaultClass \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @coversDefaultClass \PhpOffice\PhpWord\Exception\InvalidStyleException * @runTestsInSeparateProcesses */ class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase @@ -22,8 +22,8 @@ class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase /** * Throw new exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException - * @covers \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidStyleException + * @covers \PhpOffice\PhpWord\Exception\InvalidStyleException */ public function testThrowException() { diff --git a/tests/PhpWord/Tests/Exceptions/UnsupportedImageTypeExceptionTest.php b/tests/PhpWord/Tests/Exception/UnsupportedImageTypeExceptionTest.php similarity index 50% rename from tests/PhpWord/Tests/Exceptions/UnsupportedImageTypeExceptionTest.php rename to tests/PhpWord/Tests/Exception/UnsupportedImageTypeExceptionTest.php index 027ec3a9..a73db599 100644 --- a/tests/PhpWord/Tests/Exceptions/UnsupportedImageTypeExceptionTest.php +++ b/tests/PhpWord/Tests/Exception/UnsupportedImageTypeExceptionTest.php @@ -7,14 +7,14 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL */ -namespace PhpOffice\PhpWord\Tests\Exceptions; +namespace PhpOffice\PhpWord\Tests\Exception; -use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException; +use PhpOffice\PhpWord\Exception\UnsupportedImageTypeException; /** - * Test class for PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeExceptionTest + * Test class for PhpOffice\PhpWord\Exception\UnsupportedImageTypeExceptionTest * - * @coversDefaultClass \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeExceptionTest + * @coversDefaultClass \PhpOffice\PhpWord\Exception\UnsupportedImageTypeExceptionTest * @runTestsInSeparateProcesses */ class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase @@ -22,8 +22,8 @@ class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase /** * Throw new exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException - * @covers \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException + * @expectedException \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException + * @covers \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException */ public function testThrowException() { diff --git a/tests/PhpWord/Tests/FootnoteTest.php b/tests/PhpWord/Tests/FootnoteTest.php index 79bb75ad..5ea7ed80 100644 --- a/tests/PhpWord/Tests/FootnoteTest.php +++ b/tests/PhpWord/Tests/FootnoteTest.php @@ -23,7 +23,7 @@ class FootnoteTest extends \PHPUnit_Framework_TestCase */ public function testFootnote() { - $footnoteElement = new \PhpOffice\PhpWord\Section\Footnote(); + $footnoteElement = new \PhpOffice\PhpWord\Element\Footnote(); $rIdFootnote = Footnote::addFootnoteElement($footnoteElement); $rIdLink = Footnote::addFootnoteLinkElement('http://test.com'); diff --git a/tests/PhpWord/Tests/IOFactoryTest.php b/tests/PhpWord/Tests/IOFactoryTest.php index bb2a6530..405eabe0 100644 --- a/tests/PhpWord/Tests/IOFactoryTest.php +++ b/tests/PhpWord/Tests/IOFactoryTest.php @@ -33,7 +33,7 @@ class IOFactoryTest extends \PHPUnit_Framework_TestCase /** * Create non-existing writer * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testNonexistentWriterCanNotBeCreated() { @@ -54,7 +54,7 @@ class IOFactoryTest extends \PHPUnit_Framework_TestCase /** * Create non-existing reader * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testNonexistentReaderCanNotBeCreated() { diff --git a/tests/PhpWord/Tests/MediaTest.php b/tests/PhpWord/Tests/MediaTest.php index 62ce56a9..852cedb7 100644 --- a/tests/PhpWord/Tests/MediaTest.php +++ b/tests/PhpWord/Tests/MediaTest.php @@ -10,8 +10,8 @@ namespace PhpOffice\PhpWord\Tests; use PhpOffice\PhpWord\Media; -use PhpOffice\PhpWord\Section; -use PhpOffice\PhpWord\Section\Image; +use PhpOffice\PhpWord\Container\Section; +use PhpOffice\PhpWord\Element\Image; /** * Test class for PhpOffice\PhpWord\Media diff --git a/tests/PhpWord/Tests/PhpWordTest.php b/tests/PhpWord/Tests/PhpWordTest.php index 500d46c8..2cf5ae62 100644 --- a/tests/PhpWord/Tests/PhpWordTest.php +++ b/tests/PhpWord/Tests/PhpWordTest.php @@ -11,7 +11,7 @@ namespace PhpOffice\PhpWord\Tests; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\DocumentProperties; -use PhpOffice\PhpWord\Section; +use PhpOffice\PhpWord\Container\Section; use PhpOffice\PhpWord\Style; /** @@ -140,7 +140,7 @@ class PhpWordTest extends \PHPUnit_Framework_TestCase /** * Test load template exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testLoadTemplateException() { diff --git a/tests/PhpWord/Tests/Reader/Word2007Test.php b/tests/PhpWord/Tests/Reader/Word2007Test.php index 5aee8144..3a572f4d 100644 --- a/tests/PhpWord/Tests/Reader/Word2007Test.php +++ b/tests/PhpWord/Tests/Reader/Word2007Test.php @@ -43,7 +43,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase /** * Can read exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testCanReadFailed() { diff --git a/tests/PhpWord/Tests/Style/FontTest.php b/tests/PhpWord/Tests/Style/FontTest.php index ed4d61db..47ed57f4 100644 --- a/tests/PhpWord/Tests/Style/FontTest.php +++ b/tests/PhpWord/Tests/Style/FontTest.php @@ -144,7 +144,7 @@ class FontTest extends \PHPUnit_Framework_TestCase /** * Test line height exception by using nonnumeric value * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidStyleException */ public function testLineHeightException() { diff --git a/tests/PhpWord/Tests/Style/ParagraphTest.php b/tests/PhpWord/Tests/Style/ParagraphTest.php index 619d5497..4c424a93 100644 --- a/tests/PhpWord/Tests/Style/ParagraphTest.php +++ b/tests/PhpWord/Tests/Style/ParagraphTest.php @@ -146,7 +146,7 @@ class ParagraphTest extends \PHPUnit_Framework_TestCase /** * Test line height exception by using nonnumeric value * - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException + * @expectedException \PhpOffice\PhpWord\Exception\InvalidStyleException */ public function testLineHeightException() { diff --git a/tests/PhpWord/Tests/TemplateTest.php b/tests/PhpWord/Tests/TemplateTest.php index 669ae946..eb766772 100644 --- a/tests/PhpWord/Tests/TemplateTest.php +++ b/tests/PhpWord/Tests/TemplateTest.php @@ -95,7 +95,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase * XSL stylesheet cannot be applied on failure in setting parameter value * * @covers ::applyXslStyleSheet - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage Could not set values for the given XSL style sheet parameters. * @test */ @@ -117,7 +117,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase * XSL stylesheet can be applied on failure of loading XML from template * * @covers ::applyXslStyleSheet - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage Could not load XML from the given template. * @test */ diff --git a/tests/PhpWord/Tests/Writer/ODTextTest.php b/tests/PhpWord/Tests/Writer/ODTextTest.php index 8c345f55..9ee31432 100644 --- a/tests/PhpWord/Tests/Writer/ODTextTest.php +++ b/tests/PhpWord/Tests/Writer/ODTextTest.php @@ -44,7 +44,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase /** * Construct with null * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage No PhpWord assigned. */ public function testConstructWithNull() @@ -105,7 +105,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase /** * Save with no PhpWord object assigned * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage PhpWord object unassigned. */ public function testSaveException() @@ -137,7 +137,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase /** * Use disk caching exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testSetUseDiskCachingException() { diff --git a/tests/PhpWord/Tests/Writer/RTFTest.php b/tests/PhpWord/Tests/Writer/RTFTest.php index 7b546438..4016cb85 100644 --- a/tests/PhpWord/Tests/Writer/RTFTest.php +++ b/tests/PhpWord/Tests/Writer/RTFTest.php @@ -32,7 +32,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase /** * Construct with null * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage No PhpWord assigned. */ public function testConstructWithNull() @@ -94,7 +94,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase /** * Save with no PhpWord object assigned * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage PhpWord object unassigned. */ public function testSaveException() diff --git a/tests/PhpWord/Tests/Writer/Word2007/FooterTest.php b/tests/PhpWord/Tests/Writer/Word2007/FooterTest.php index 6d303a0a..c0f94de6 100644 --- a/tests/PhpWord/Tests/Writer/Word2007/FooterTest.php +++ b/tests/PhpWord/Tests/Writer/Word2007/FooterTest.php @@ -28,7 +28,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase public function testWriteFooter() { $imageSrc = __DIR__ . "/../../_files/images/PhpWord.png"; - $container = new \PhpOffice\PhpWord\Section\Footer(1); + $container = new \PhpOffice\PhpWord\Container\Footer(1); $container->addText(''); $container->addPreserveText(''); $container->addTextBreak(); diff --git a/tests/PhpWord/Tests/Writer/Word2007/HeaderTest.php b/tests/PhpWord/Tests/Writer/Word2007/HeaderTest.php index de3ac010..253f663e 100644 --- a/tests/PhpWord/Tests/Writer/Word2007/HeaderTest.php +++ b/tests/PhpWord/Tests/Writer/Word2007/HeaderTest.php @@ -26,7 +26,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase { $imageSrc = __DIR__ . "/../../_files/images/PhpWord.png"; - $container = new \PhpOffice\PhpWord\Section\Header(1); + $container = new \PhpOffice\PhpWord\Container\Header(1); $container->addText('Test'); $container->addPreserveText(''); $container->addTextBreak(); diff --git a/tests/PhpWord/Tests/Writer/Word2007Test.php b/tests/PhpWord/Tests/Writer/Word2007Test.php index fa4e301c..f486d18d 100644 --- a/tests/PhpWord/Tests/Writer/Word2007Test.php +++ b/tests/PhpWord/Tests/Writer/Word2007Test.php @@ -115,7 +115,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase /** * Save with no PhpWord object assigned * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception * @expectedExceptionMessage PhpWord object unassigned. */ public function testSaveException() @@ -181,7 +181,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase /** * Use disk caching exception * - * @expectedException \PhpOffice\PhpWord\Exceptions\Exception + * @expectedException \PhpOffice\PhpWord\Exception\Exception */ public function testSetUseDiskCachingException() {