Merge branch 'develop' into nonstatic

This commit is contained in:
Ivan Lanin 2014-05-04 22:12:23 +07:00
commit 3d19256c9c
244 changed files with 1437 additions and 642 deletions

View File

@ -14,13 +14,20 @@ matrix:
- php: 5.6 - php: 5.6
- php: hhvm - php: hhvm
env:
global:
- secure: "Sq+6bVtnPsu0mWX8DWQ+9bGAjxMcGorksUiHc4YIXEJsuDfVmVlH8tTD547IeCjDAx9MxXerZ2Z4HSjxTB70VEnJPvZMHI/EZn4Ny31YLHEthdZbV5Gd1h0TGp8VOzPKGShvGrtGBX6MvMfgpK4zuieVWbSfdKeecm8ZNLMpUd4="
before_script: before_script:
## Packages
- sudo apt-get -qq update > /dev/null
- sudo apt-get -qq install graphviz > /dev/null
## Composer ## Composer
# - curl -s http://getcomposer.org/installer | php # - curl -s http://getcomposer.org/installer | php
# - php composer.phar install --prefer-source # - php composer.phar install --prefer-source
- composer self-update - composer self-update
- composer require dompdf/dompdf:0.6.* - composer require dompdf/dompdf:0.6.*
- composer install --prefer-source - composer install --prefer-source --dev
## PHP_CodeSniffer ## PHP_CodeSniffer
- pyrus install pear/PHP_CodeSniffer - pyrus install pear/PHP_CodeSniffer
- phpenv rehash - phpenv rehash
@ -35,6 +42,9 @@ before_script:
- phpenv rehash - phpenv rehash
## PHPLOC ## PHPLOC
#- curl -o phploc.phar https://phar.phpunit.de/phploc.phar #- curl -o phploc.phar https://phar.phpunit.de/phploc.phar
## PHPDocumentor
- mkdir -p build/docs
- mkdir -p build/coverage
script: script:
## PHP_CodeSniffer ## PHP_CodeSniffer
@ -46,4 +56,10 @@ script:
## PHPLOC ## PHPLOC
#- php phploc.phar src/ #- php phploc.phar src/
## PHPUnit ## PHPUnit
- phpunit -c ./ --coverage-text - phpunit -c ./ --coverage-text --coverage-html ./build/coverage
## PHPDocumentor
- vendor/bin/phpdoc.php -d ./src -t ./build/docs
after_script:
## PHPDocumentor
- bash .travis_shell_after_success.sh

View File

@ -0,0 +1,39 @@
#!/bin/bash
echo "--DEBUG--"
echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG"
echo "TRAVIS_PHP_VERSION: $TRAVIS_PHP_VERSION"
echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPWord" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then
echo -e "Publishing PHPDoc...\n"
cp -R build/docs $HOME/docs-latest
cp -R build/coverage $HOME/coverage-latest
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/PHPOffice/PHPWord gh-pages > /dev/null
cd gh-pages
echo "--DEBUG : Suppression"
git rm -rf ./docs/$TRAVIS_BRANCH
echo "--DEBUG : Dossier"
mkdir -p docs/$TRAVIS_BRANCH
mkdir -p coverage/$TRAVIS_BRANCH
echo "--DEBUG : Copie"
cp -Rf $HOME/docs-latest/* ./docs/$TRAVIS_BRANCH/
cp -Rf $HOME/coverage-latest/* ./coverage/$TRAVIS_BRANCH/
echo "--DEBUG : Git"
git add -f .
git commit -m "PHPDocumentor (Travis Build : $TRAVIS_BUILD_NUMBER - Branch : $TRAVIS_BRANCH)"
git push -fq origin gh-pages > /dev/null
echo -e "Published PHPDoc to gh-pages.\n"
fi

View File

@ -2,7 +2,31 @@
This is the changelog between releases of PHPWord. Releases are listed in reverse chronological order with the latest version listed on top, while additions/changes in each release are listed in chronological order. Changes in each release are divided into three parts: added or change features, bugfixes, and miscellaneous improvements. Each line contains short information about the change made, the person who made it, and the related issue number(s) in GitHub. This is the changelog between releases of PHPWord. Releases are listed in reverse chronological order with the latest version listed on top, while additions/changes in each release are listed in chronological order. Changes in each release are divided into three parts: added or change features, bugfixes, and miscellaneous improvements. Each line contains short information about the change made, the person who made it, and the related issue number(s) in GitHub.
## 0.10.0 - Not yet released ## 0.11.0 - Not yet released
PHPWord license is changed from LGPL 2.1 to LGPL 3 in this release.
### Features
- Image: Ability to define relative and absolute positioning - @basjan GH-217
### Bugfixes
- ...
### Deprecated
- Static classes `Footnotes`, `Endnotes`, and `TOC`
### Miscellaneous
- License: Change the project license from LGPL 2.1 into LGPL 3.0 - GH-211
- Word2007 Writer: New `Style\Image` class - @ivanlanin
- Refactor: Replace static classes `Footnotes`, `Endnotes`, and `TOC` with `Collections` - @ivanlanin GH-206
- QA: Reactivate `phpcpd` and `phpmd` on Travis - @ivanlanin
- Refactor: PHPMD recommendation: Change all `get...` method that returns `boolean` into `is...` or `has...` - @ivanlanin
## 0.10.0 - 4 May 2014
This release marked heavy refactorings on internal code structure with the creation of some abstract classes to reduce code duplication. `Element` subnamespace is introduced in this release to replace `Section`. Word2007 reader capability is greatly enhanced. Endnote is introduced. List numbering is now customizable. Basic HTML and PDF writing support is enabled. Basic ODText reader is introduced. This release marked heavy refactorings on internal code structure with the creation of some abstract classes to reduce code duplication. `Element` subnamespace is introduced in this release to replace `Section`. Word2007 reader capability is greatly enhanced. Endnote is introduced. List numbering is now customizable. Basic HTML and PDF writing support is enabled. Basic ODText reader is introduced.
@ -66,7 +90,6 @@ This release marked heavy refactorings on internal code structure with the creat
- `Element\Link::getLinkSrc` replaced by `Element\Link::getTarget` - `Element\Link::getLinkSrc` replaced by `Element\Link::getTarget`
- `Element\Link::getLinkName` replaced by `Element\Link::getText` - `Element\Link::getLinkName` replaced by `Element\Link::getText`
- `Style\Cell::getDefaultBorderColor` - `Style\Cell::getDefaultBorderColor`
- Static classes `Footnotes`, `Endnotes`, and `TOC`
### Miscellaneous ### Miscellaneous
@ -88,9 +111,6 @@ This release marked heavy refactorings on internal code structure with the creat
- Refactor: Apply composite pattern for writers - @ivanlanin - Refactor: Apply composite pattern for writers - @ivanlanin
- Refactor: Split `AbstractContainer` from `AbstractElement` - @ivanlanin - Refactor: Split `AbstractContainer` from `AbstractElement` - @ivanlanin
- Refactor: Apply composite pattern for Word2007 reader - @ivanlanin - Refactor: Apply composite pattern for Word2007 reader - @ivanlanin
- Refactor: Replace static classes `Footnotes`, `Endnotes`, and `TOC` with `Collections` - @ivanlanin GH-206
- QA: Reactivate `phpcpd` and `phpmd` on Travis - @ivanlanin
- Refactor: PHPMD recommendation: Change all `get...` method that returns `boolean` into `is...` or `has...` - @ivanlanin
## 0.9.1 - 27 Mar 2014 ## 0.9.1 - 27 Mar 2014

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
], ],
"homepage": "http://phpoffice.github.io", "homepage": "http://phpoffice.github.io",
"type": "library", "type": "library",
"license": "LGPL-2.1+", "license": "LGPL",
"authors": [ "authors": [
{ {
"name": "Mark Baker" "name": "Mark Baker"
@ -37,7 +37,8 @@
"ext-zip": "*" "ext-zip": "*"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "3.7.*" "phpunit/phpunit": "3.7.*",
"phpdocumentor/phpdocumentor":"2.*"
}, },
"suggest": { "suggest": {
"ext-gd2": "Required to add images", "ext-gd2": "Required to add images",

View File

@ -26,7 +26,7 @@ $wrappingStyles = array('inline', 'behind', 'infront', 'square', 'tight');
foreach ($wrappingStyles as $wrappingStyle) { foreach ($wrappingStyles as $wrappingStyle) {
$section->addTextBreak(5); $section->addTextBreak(5);
$section->addText('Wrapping style ' . $wrappingStyle); $section->addText('Wrapping style ' . $wrappingStyle);
$section->addImage('resources/_earth.jpg', array('marginTop' => -1, 'marginLeft' => 1, $section->addImage('resources/_earth.jpg', array('positioning' => 'relative', 'marginTop' => -1, 'marginLeft' => 1,
'width' => 80, 'height' => 80, 'wrappingStyle' => $wrappingStyle)); 'width' => 80, 'height' => 80, 'wrappingStyle' => $wrappingStyle));
$section->addText($text); $section->addText($text);
} }

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Exception; namespace PhpOffice\PhpWord\Exception;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Exception; namespace PhpOffice\PhpWord\Exception;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Exception; namespace PhpOffice\PhpWord\Exception;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Exception; namespace PhpOffice\PhpWord\Exception;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Exception; namespace PhpOffice\PhpWord\Exception;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader; namespace PhpOffice\PhpWord\Reader;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader; namespace PhpOffice\PhpWord\Reader;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\ODText; namespace PhpOffice\PhpWord\Reader\ODText;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\ODText; namespace PhpOffice\PhpWord\Reader\ODText;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader; namespace PhpOffice\PhpWord\Reader;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader; namespace PhpOffice\PhpWord\Reader;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Reader\Word2007; namespace PhpOffice\PhpWord\Reader\Word2007;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Shared; namespace PhpOffice\PhpWord\Shared;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -1,12 +1,12 @@
<?php <?php
/** /**
* PHPWord * PHPWord
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;
/** /**
@ -14,12 +14,62 @@ namespace PhpOffice\PhpWord\Style;
*/ */
class Image extends AbstractStyle class Image extends AbstractStyle
{ {
/**
* Wrapping styles
*
* @const string
*/
const WRAPPING_STYLE_INLINE = 'inline'; const WRAPPING_STYLE_INLINE = 'inline';
const WRAPPING_STYLE_SQUARE = 'square'; const WRAPPING_STYLE_SQUARE = 'square';
const WRAPPING_STYLE_TIGHT = 'tight'; const WRAPPING_STYLE_TIGHT = 'tight';
const WRAPPING_STYLE_BEHIND = 'behind'; const WRAPPING_STYLE_BEHIND = 'behind';
const WRAPPING_STYLE_INFRONT = 'infront'; const WRAPPING_STYLE_INFRONT = 'infront';
/**
* Horizontal alignment
*
* @const string
*/
const POSITION_HORIZONTAL_LEFT = 'left';
const POSITION_HORIZONTAL_CENTER = 'centered';
const POSITION_HORIZONTAL_RIGHT = 'right';
/**
* Vertical alignment
*
* @const string
*/
const POSITION_VERTICAL_TOP = 'top';
const POSITION_VERTICAL_CENTER = 'center';
const POSITION_VERTICAL_BOTTOM = 'bottom';
const POSITION_VERTICAL_INSIDE = 'inside';
const POSITION_VERTICAL_OUTSIDE = 'outside';
/**
* Position relative to
*
* @const string
*/
const POSITION_RELATIVE_TO_MARGIN = 'margin';
const POSITION_RELATIVE_TO_PAGE = 'page';
const POSITION_RELATIVE_TO_COLUMN = 'column'; // horizontal only
const POSITION_RELATIVE_TO_CHAR = 'char'; // horizontal only
const POSITION_RELATIVE_TO_LINE = 'line'; // vertical only
const POSITION_RELATIVE_TO_LMARGIN = 'left-margin-area'; // horizontal only
const POSITION_RELATIVE_TO_RMARGIN = 'right-margin-area'; // horizontal only
const POSITION_RELATIVE_TO_TMARGIN = 'top-margin-area'; // vertical only
const POSITION_RELATIVE_TO_BMARGIN = 'bottom-margin-area'; // vertical only
const POSITION_RELATIVE_TO_IMARGIN = 'inner-margin-area';
const POSITION_RELATIVE_TO_OMARGIN = 'outer-margin-area';
/**
* Position type, relative/absolute
*
* @const string
*/
const POSITION_ABSOLUTE = 'absolute';
const POSITION_RELATIVE = 'relative';
/** /**
* Image width * Image width
* *
@ -62,17 +112,51 @@ class Image extends AbstractStyle
*/ */
private $wrappingStyle; private $wrappingStyle;
/**
* Positioning type (relative or absolute)
*
* @var string
*/
private $positioning;
/**
* Horizontal alignment
*
* @var string
*/
private $posHorizontal;
/**
* Horizontal Relation
*
* @var string
*/
private $posHorizontalRel;
/**
* Vertical alignment
*
* @var string
*/
private $posVertical;
/**
* Vertical Relation
*
* @var string
*/
private $posVerticalRel;
/** /**
* Create new image style * Create new image style
*/ */
public function __construct() public function __construct()
{ {
$this->width = null;
$this->height = null;
$this->align = null;
$this->marginTop = null;
$this->marginLeft = null;
$this->setWrappingStyle(self::WRAPPING_STYLE_INLINE); $this->setWrappingStyle(self::WRAPPING_STYLE_INLINE);
$this->setPosHorizontal(self::POSITION_HORIZONTAL_LEFT);
$this->setPosHorizontalRel(self::POSITION_RELATIVE_TO_CHAR);
$this->setPosVertical(self::POSITION_VERTICAL_TOP);
$this->setPosVerticalRel(self::POSITION_RELATIVE_TO_LINE);
} }
/** /**
@ -86,11 +170,11 @@ class Image extends AbstractStyle
/** /**
* Set width * Set width
* *
* @param int $pValue * @param int $value
*/ */
public function setWidth($pValue = null) public function setWidth($value = null)
{ {
$this->width = $pValue; $this->width = $value;
} }
/** /**
@ -104,11 +188,11 @@ class Image extends AbstractStyle
/** /**
* Set height * Set height
* *
* @param int $pValue * @param int $value
*/ */
public function setHeight($pValue = null) public function setHeight($value = null)
{ {
$this->height = $pValue; $this->height = $value;
} }
/** /**
@ -122,11 +206,11 @@ class Image extends AbstractStyle
/** /**
* Set alignment * Set alignment
* *
* @param string $pValue * @param string $value
*/ */
public function setAlign($pValue = null) public function setAlign($value = null)
{ {
$this->align = $pValue; $this->align = $value;
} }
/** /**
@ -142,12 +226,12 @@ class Image extends AbstractStyle
/** /**
* Set Margin Top * Set Margin Top
* *
* @param int $pValue * @param int $value
* @return $this * @return self
*/ */
public function setMarginTop($pValue = null) public function setMarginTop($value = null)
{ {
$this->marginTop = $pValue; $this->marginTop = $value;
return $this; return $this;
} }
@ -164,35 +248,12 @@ class Image extends AbstractStyle
/** /**
* Set Margin Left * Set Margin Left
* *
* @param int $pValue * @param int $value
* @return $this * @return self
*/ */
public function setMarginLeft($pValue = null) public function setMarginLeft($value = null)
{ {
$this->marginLeft = $pValue; $this->marginLeft = $value;
return $this;
}
/**
* Set wrapping style
*
* @param string $wrappingStyle
* @throws \InvalidArgumentException
* @return $this
*/
public function setWrappingStyle($wrappingStyle)
{
switch ($wrappingStyle) {
case self::WRAPPING_STYLE_BEHIND:
case self::WRAPPING_STYLE_INFRONT:
case self::WRAPPING_STYLE_INLINE:
case self::WRAPPING_STYLE_SQUARE:
case self::WRAPPING_STYLE_TIGHT:
$this->wrappingStyle = $wrappingStyle;
break;
default:
throw new \InvalidArgumentException('Wrapping style does not exists');
}
return $this; return $this;
} }
@ -205,4 +266,183 @@ class Image extends AbstractStyle
{ {
return $this->wrappingStyle; return $this->wrappingStyle;
} }
/**
* Set wrapping style
*
* @param string $wrappingStyle
* @throws \InvalidArgumentException
* @return self
*/
public function setWrappingStyle($wrappingStyle)
{
$enum = array(self::WRAPPING_STYLE_INLINE, self::WRAPPING_STYLE_INFRONT, self::WRAPPING_STYLE_BEHIND,
self::WRAPPING_STYLE_SQUARE, self::WRAPPING_STYLE_TIGHT);
if (in_array($wrappingStyle, $enum)) {
$this->wrappingStyle = $wrappingStyle;
} else {
throw new \InvalidArgumentException('Invalid wrapping style.');
}
return $this;
}
/**
* Get positioning type
*
* @return string
*/
public function getPositioning()
{
return $this->positioning;
}
/**
* Set positioning type
*
* @param string $positioning
* @throws \InvalidArgumentException
* @return self
*/
public function setPositioning($positioning)
{
$enum = array(self::POSITION_RELATIVE, self::POSITION_ABSOLUTE);
if (in_array($positioning, $enum)) {
$this->positioning = $positioning;
} else {
throw new \InvalidArgumentException('Invalid positioning.');
}
return $this;
}
/**
* Get horizontal alignment
*
* @return string
*/
public function getPosHorizontal()
{
return $this->posHorizontal;
}
/**
* Set horizontal alignment
*
* @param string $alignment
* @throws \InvalidArgumentException
* @return self
*/
public function setPosHorizontal($alignment)
{
$enum = array(self::POSITION_HORIZONTAL_LEFT, self::POSITION_HORIZONTAL_CENTER,
self::POSITION_HORIZONTAL_RIGHT);
if (in_array($alignment, $enum)) {
$this->posHorizontal = $alignment;
} else {
throw new \InvalidArgumentException('Invalid horizontal alignment.');
}
return $this;
}
/**
* Get vertical alignment
*
* @return string
*/
public function getPosVertical()
{
return $this->posVertical;
}
/**
* Set vertical alignment
*
* @param string $alignment
* @throws \InvalidArgumentException
* @return self
*/
public function setPosVertical($alignment)
{
$enum = array(self::POSITION_VERTICAL_TOP, self::POSITION_VERTICAL_CENTER,
self::POSITION_VERTICAL_BOTTOM, self::POSITION_VERTICAL_INSIDE, self::POSITION_VERTICAL_OUTSIDE);
if (in_array($alignment, $enum)) {
$this->posVertical = $alignment;
} else {
throw new \InvalidArgumentException('Invalid vertical alignment.');
}
return $this;
}
/**
* Get horizontal relation
*
* @return string
*/
public function getPosHorizontalRel()
{
return $this->posHorizontalRel;
}
/**
* Set horizontal relation
*
* @param string $relto
* @throws \InvalidArgumentException
* @return self
*/
public function setPosHorizontalRel($relto)
{
$enum = array(self::POSITION_RELATIVE_TO_MARGIN, self::POSITION_RELATIVE_TO_PAGE,
self::POSITION_RELATIVE_TO_COLUMN, self::POSITION_RELATIVE_TO_CHAR,
self::POSITION_RELATIVE_TO_LMARGIN, self::POSITION_RELATIVE_TO_RMARGIN,
self::POSITION_RELATIVE_TO_IMARGIN, self::POSITION_RELATIVE_TO_OMARGIN);
if (in_array($relto, $enum)) {
$this->posHorizontalRel = $relto;
} else {
throw new \InvalidArgumentException('Invalid relative horizontal alignment.');
}
return $this;
}
/**
* Get vertical relation
*
* @return string
*/
public function getPosVerticalRel()
{
return $this->posVerticalRel;
}
/**
* Set vertical relation
*
* @param string $relto
* @throws \InvalidArgumentException
* @return self
*/
public function setPosVerticalRel($relto)
{
$enum = array(self::POSITION_RELATIVE_TO_MARGIN, self::POSITION_RELATIVE_TO_PAGE,
self::POSITION_RELATIVE_TO_LINE,
self::POSITION_RELATIVE_TO_TMARGIN, self::POSITION_RELATIVE_TO_BMARGIN,
self::POSITION_RELATIVE_TO_IMARGIN, self::POSITION_RELATIVE_TO_OMARGIN);
if (in_array($relto, $enum)) {
$this->posVerticalRel = $relto;
} else {
throw new \InvalidArgumentException('Invalid relative vertical alignment.');
}
return $this;
}
} }

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Style; namespace PhpOffice\PhpWord\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer; namespace PhpOffice\PhpWord\Writer;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer; namespace PhpOffice\PhpWord\Writer;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Element; namespace PhpOffice\PhpWord\Writer\HTML\Element;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Style; namespace PhpOffice\PhpWord\Writer\HTML\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Style; namespace PhpOffice\PhpWord\Writer\HTML\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Style; namespace PhpOffice\PhpWord\Writer\HTML\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Style; namespace PhpOffice\PhpWord\Writer\HTML\Style;

View File

@ -4,7 +4,7 @@
* *
* @link https://github.com/PHPOffice/PHPWord * @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord * @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/ */
namespace PhpOffice\PhpWord\Writer\HTML\Style; namespace PhpOffice\PhpWord\Writer\HTML\Style;

Some files were not shown because too many files have changed in this diff Show More