This commit is contained in:
Roman Syroeshko 2014-03-23 10:32:08 +04:00
parent 7e23484619
commit ddb6277764
137 changed files with 626 additions and 889 deletions

View File

@ -103,7 +103,7 @@ $section->addText('Hello world! I am formatted by a user defined style',
'myOwnStyle'); 'myOwnStyle');
// You can also put the appended element to local object like this: // You can also put the appended element to local object like this:
$fontStyle = new PhpOffice\PhpWord\Style\Font(); $fontStyle = new \PhpOffice\PhpWord\Style\Font();
$fontStyle->setBold(true); $fontStyle->setBold(true);
$fontStyle->setName('Verdana'); $fontStyle->setName('Verdana');
$fontStyle->setSize(22); $fontStyle->setSize(22);
@ -111,7 +111,7 @@ $myTextElement = $section->addText('Hello World!');
$myTextElement->setFontStyle($fontStyle); $myTextElement->setFontStyle($fontStyle);
// Finally, write the document: // Finally, write the document:
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$xmlWriter->save('helloWorld.docx'); $xmlWriter->save('helloWorld.docx');
``` ```
@ -125,15 +125,15 @@ You can use PhpWord helper functions to convert inches, centimeters, or points t
```php ```php
// Paragraph with 6 points space after // Paragraph with 6 points space after
$phpWord->addParagraphStyle('My Style', array( $phpWord->addParagraphStyle('My Style', array(
'spaceAfter' => PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6)) 'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6))
); );
$section = $phpWord->createSection(); $section = $phpWord->createSection();
$sectionStyle = $section->getSettings(); $sectionStyle = $section->getSettings();
// half inch left margin // half inch left margin
$sectionStyle->setMarginLeft(PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5)); $sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
// 2 cm right margin // 2 cm right margin
$sectionStyle->setMarginRight(PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2)); $sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
``` ```
<a name="sections"></a> <a name="sections"></a>

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests;
use PhpOffice\PhpWord\DocumentProperties; use PhpOffice\PhpWord\DocumentProperties;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\DocumentProperties
* @coversDefaultClass PhpOffice\PhpWord\DocumentProperties
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class DocumentPropertiesTest extends \PHPUnit_Framework_TestCase class DocumentPropertiesTest extends \PHPUnit_Framework_TestCase

View File

@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\Exception;
class ExceptionTest extends \PHPUnit_Framework_TestCase class ExceptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @covers PhpOffice\PhpWord\Exceptions\Exception * @covers \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function testThrowException() public function testThrowException()
{ {

View File

@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\InvalidImageException;
class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidImageException * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException
* @covers PhpOffice\PhpWord\Exceptions\InvalidImageException * @covers \PhpOffice\PhpWord\Exceptions\InvalidImageException
*/ */
public function testThrowException() public function testThrowException()
{ {

View File

@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\InvalidStyleException;
class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidStyleException * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException
* @covers PhpOffice\PhpWord\Exceptions\InvalidStyleException * @covers \PhpOffice\PhpWord\Exceptions\InvalidStyleException
*/ */
public function testThrowException() public function testThrowException()
{ {

View File

@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException;
class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException * @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
* @covers PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException * @covers \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
*/ */
public function testThrowException() public function testThrowException()
{ {

View File

@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\IOFactory; use PhpOffice\PhpWord\IOFactory;
/** /**
* @@coversDefaultClass PhpOffice\PhpWord\IOFactory * @coversDefaultClass \PhpOffice\PhpWord\IOFactory
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
final class IOFactoryTest extends \PHPUnit_Framework_TestCase final class IOFactoryTest extends \PHPUnit_Framework_TestCase
@ -24,7 +23,7 @@ final class IOFactoryTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::createWriter * @covers ::createWriter
* @expectedException PhpOffice\PhpWord\Exceptions\Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage Could not instantiate "Word2006" class. * @expectedExceptionMessage Could not instantiate "Word2006" class.
*/ */
final public function testNonexistentWriterCanNotBeCreated() final public function testNonexistentWriterCanNotBeCreated()
@ -45,7 +44,7 @@ final class IOFactoryTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::createReader * @covers ::createReader
* @expectedException PhpOffice\PhpWord\Exceptions\Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage Could not instantiate "Word2006" class. * @expectedExceptionMessage Could not instantiate "Word2006" class.
*/ */
final public function testNonexistentReaderCanNotBeCreated() final public function testNonexistentReaderCanNotBeCreated()

View File

@ -37,7 +37,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase
/** /**
* Todo: add memory image to this test * Todo: add memory image to this test
* *
* @covers PhpOffice\PhpWord\Media::addSectionMediaElement * @covers \PhpOffice\PhpWord\Media::addSectionMediaElement
*/ */
public function testAddSectionMediaElement() public function testAddSectionMediaElement()
{ {

View File

@ -4,14 +4,8 @@ namespace PhpWord\Tests\Reader;
use PhpOffice\PhpWord\Reader\Word2007; use PhpOffice\PhpWord\Reader\Word2007;
use PhpOffice\PhpWord\IOFactory; use PhpOffice\PhpWord\IOFactory;
/**
* @package PhpWord\Tests
*/
class Word2007Test extends \PHPUnit_Framework_TestCase class Word2007Test extends \PHPUnit_Framework_TestCase
{ {
/** @var Test file directory */
private $dir;
/** /**
* Init * Init
*/ */
@ -25,27 +19,25 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
public function testCanRead() public function testCanRead()
{ {
$dir = join( $dir = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
); );
$object = new Word2007; $object = new Word2007;
$file = $dir . DIRECTORY_SEPARATOR . 'reader.docx'; $file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
$this->assertTrue($object->canRead($file)); $this->assertTrue($object->canRead($file));
} }
/** /**
* Test canRead() failure * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
*
* @expectedException Exception
*/ */
public function testCanReadFailed() public function testCanReadFailed()
{ {
$dir = join( $dir = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
); );
$object = new Word2007; $object = new Word2007;
$file = $dir . DIRECTORY_SEPARATOR . 'foo.docx'; $file = $dir . \DIRECTORY_SEPARATOR . 'foo.docx';
$this->assertFalse($object->canRead($file)); $this->assertFalse($object->canRead($file));
$object = IOFactory::load($file); $object = IOFactory::load($file);
} }
@ -56,10 +48,10 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
public function testLoad() public function testLoad()
{ {
$dir = join( $dir = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
); );
$file = $dir . DIRECTORY_SEPARATOR . 'reader.docx'; $file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
$object = IOFactory::load($file); $object = IOFactory::load($file);
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object); $this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
} }

View File

@ -4,7 +4,7 @@ namespace PhpWord\Tests\Section;
use PhpOffice\PhpWord\Section\Image; use PhpOffice\PhpWord\Section\Image;
/** /**
* @coversDefaultClass PhpOffice\PhpWord\Section\Image * @coversDefaultClass \PhpOffice\PhpWord\Section\Image
*/ */
class ImageTest extends \PHPUnit_Framework_TestCase class ImageTest extends \PHPUnit_Framework_TestCase
{ {
@ -32,7 +32,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
$oImage = new Image( $oImage = new Image(
$src, $src,
array('width' => 210, 'height' => 210, 'align' => 'center', array('width' => 210, 'height' => 210, 'align' => 'center',
'wrappingStyle' => PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_BEHIND) 'wrappingStyle' => \PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_BEHIND)
); );
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Image', $oImage->getStyle()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Image', $oImage->getStyle());
@ -52,7 +52,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidImageException * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException
* @covers ::__construct * @covers ::__construct
*/ */
public function testImageNotFound() public function testImageNotFound()
@ -61,7 +61,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException * @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
* @covers ::__construct * @covers ::__construct
*/ */
public function testInvalidImageTypes() public function testInvalidImageTypes()

View File

@ -18,7 +18,7 @@ class ListItemTest extends \PHPUnit_Framework_TestCase
'text', 'text',
1, 1,
null, null,
array('listType' => PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER) array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER)
); );
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\ListItem', $oListItem->getStyle()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\ListItem', $oListItem->getStyle());

View File

@ -6,8 +6,7 @@ use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Style\Paragraph; use PhpOffice\PhpWord\Style\Paragraph;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Section\TextBreak
* @coversDefaultClass PhpOffice\PhpWord\Section\TextBreak
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TextBreakTest extends \PHPUnit_Framework_TestCase class TextBreakTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests;
use PhpOffice\PhpWord\Section; use PhpOffice\PhpWord\Section;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Section
* @coversDefaultClass PhpOffice\PhpWord\Section
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class SectionTest extends \PHPUnit_Framework_TestCase class SectionTest extends \PHPUnit_Framework_TestCase
@ -75,11 +74,11 @@ class SectionTest extends \PHPUnit_Framework_TestCase
public function testAddElements() public function testAddElements()
{ {
$objectSource = join( $objectSource = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls')
); );
$imageSource = join( $imageSource = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'PhpWord.png') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'PhpWord.png')
); );
$imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif'; $imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif';

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests;
use PhpOffice\PhpWord\Settings; use PhpOffice\PhpWord\Settings;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Settings
* @coversDefaultClass PhpOffice\PhpWord\Settings
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class SettingsTest extends \PHPUnit_Framework_TestCase class SettingsTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Shared;
use PhpOffice\PhpWord\Shared\Drawing; use PhpOffice\PhpWord\Shared\Drawing;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class DrawingTest extends \PHPUnit_Framework_TestCase class DrawingTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests\Shared;
use PhpOffice\PhpWord\Shared\File; use PhpOffice\PhpWord\Shared\File;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Shared\File
* @coversDefaultClass PhpOffice\PhpWord\Shared\File
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class FileTest extends \PHPUnit_Framework_TestCase class FileTest extends \PHPUnit_Framework_TestCase
@ -15,7 +14,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
*/ */
public function testFileExists() public function testFileExists()
{ {
$dir = join(DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates')); $dir = join(\DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates'));
chdir($dir); chdir($dir);
$this->assertTrue(File::file_exists('blank.docx')); $this->assertTrue(File::file_exists('blank.docx'));
} }
@ -24,7 +23,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
*/ */
public function testNoFileExists() public function testNoFileExists()
{ {
$dir = join(DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates')); $dir = join(\DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates'));
chdir($dir); chdir($dir);
$this->assertFalse(File::file_exists('404.docx')); $this->assertFalse(File::file_exists('404.docx'));
} }
@ -34,10 +33,10 @@ class FileTest extends \PHPUnit_Framework_TestCase
*/ */
public function testRealpath() public function testRealpath()
{ {
$dir = join(DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates')); $dir = join(\DIRECTORY_SEPARATOR, array(\PHPWORD_TESTS_BASE_DIR, '_files', 'templates'));
chdir($dir); chdir($dir);
$file = 'blank.docx'; $file = 'blank.docx';
$expected = $dir . DIRECTORY_SEPARATOR . $file; $expected = $dir . \DIRECTORY_SEPARATOR . $file;
$this->assertEquals($expected, File::realpath($file)); $this->assertEquals($expected, File::realpath($file));
} }
} }

View File

@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Shared\Font; use PhpOffice\PhpWord\Shared\Font;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class FontTest extends \PHPUnit_Framework_TestCase class FontTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests\Shared;
use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Shared\String;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Shared\String
* @coversDefaultClass PhpOffice\PhpWord\Shared\String
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class StringTest extends \PHPUnit_Framework_TestCase class StringTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\Cell; use PhpOffice\PhpWord\Style\Cell;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class CellTest extends \PHPUnit_Framework_TestCase class CellTest extends \PHPUnit_Framework_TestCase

View File

@ -6,7 +6,6 @@ use PhpOffice\PhpWord\Style\Font;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class FontTest extends \PHPUnit_Framework_TestCase class FontTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\Image; use PhpOffice\PhpWord\Style\Image;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class ImageTest extends \PHPUnit_Framework_TestCase class ImageTest extends \PHPUnit_Framework_TestCase
@ -56,7 +55,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
/** /**
* Test setWrappingStyle exception * Test setWrappingStyle exception
* *
* @expectedException InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testSetWrappingStyleException() public function testSetWrappingStyleException()
{ {

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\ListItem; use PhpOffice\PhpWord\Style\ListItem;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class ListItemTest extends \PHPUnit_Framework_TestCase class ListItemTest extends \PHPUnit_Framework_TestCase

View File

@ -7,7 +7,6 @@ use PhpOffice\PhpWord\Style\Tab;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class ParagraphTest extends \PHPUnit_Framework_TestCase class ParagraphTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\Row; use PhpOffice\PhpWord\Style\Row;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class RowTest extends \PHPUnit_Framework_TestCase class RowTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\TOC; use PhpOffice\PhpWord\Style\TOC;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Style\TOC
* @coversDefaultClass PhpOffice\PhpWord\Style\TOC
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TOCTest extends \PHPUnit_Framework_TestCase class TOCTest extends \PHPUnit_Framework_TestCase
@ -18,9 +17,9 @@ class TOCTest extends \PHPUnit_Framework_TestCase
$object = new TOC(); $object = new TOC();
$properties = array( $properties = array(
'tabPos' => 9062, 'tabPos' => 9062,
'tabLeader' => TOC::TABLEADER_DOT, 'tabLeader' => TOC::TABLEADER_DOT,
'indent' => 200, 'indent' => 200,
); );
foreach ($properties as $key => $value) { foreach ($properties as $key => $value) {
// set/get // set/get

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\TableFull; use PhpOffice\PhpWord\Style\TableFull;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TableFullTest extends \PHPUnit_Framework_TestCase class TableFullTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
use PhpOffice\PhpWord\Style\Table; use PhpOffice\PhpWord\Style\Table;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TableTest extends \PHPUnit_Framework_TestCase class TableTest extends \PHPUnit_Framework_TestCase

View File

@ -6,7 +6,6 @@ use PhpOffice\PhpWord\Style\Tab;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TabsTest extends \PHPUnit_Framework_TestCase class TabsTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests;
use PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\Style;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Style
* @coversDefaultClass PhpOffice\PhpWord\Style
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class StyleTest extends \PHPUnit_Framework_TestCase class StyleTest extends \PHPUnit_Framework_TestCase

View File

@ -4,8 +4,7 @@ namespace PhpWord\Tests;
use PhpOffice\PhpWord\TOC; use PhpOffice\PhpWord\TOC;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\TOC
* @coversDefaultClass PhpOffice\PhpWord\TOC
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class TOCTest extends \PHPUnit_Framework_TestCase class TOCTest extends \PHPUnit_Framework_TestCase
@ -18,14 +17,11 @@ class TOCTest extends \PHPUnit_Framework_TestCase
public function testConstruct() public function testConstruct()
{ {
$expected = array( $expected = array(
'tabPos' => 9062, 'tabPos' => 9062,
'tabLeader' => PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT, 'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
'indent' => 200, 'indent' => 200,
);
$object = new TOC(
array('size' => 11),
array('tabPos' => $expected['tabPos'])
); );
$object = new TOC(array('size' => 11), array('tabPos' => $expected['tabPos']));
$tocStyle = $object->getStyleTOC(); $tocStyle = $object->getStyleTOC();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle);

View File

@ -5,7 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Template; use PhpOffice\PhpWord\Template;
/** /**
* @coversDefaultClass PhpOffice\PhpWord\Template * @coversDefaultClass \PhpOffice\PhpWord\Template
*/ */
final class TemplateTest extends \PHPUnit_Framework_TestCase final class TemplateTest extends \PHPUnit_Framework_TestCase
{ {
@ -87,7 +87,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::applyXslStyleSheet * @covers ::applyXslStyleSheet
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage Could not set values for the given XSL style sheet parameters. * @expectedExceptionMessage Could not set values for the given XSL style sheet parameters.
* @test * @test
*/ */
@ -109,7 +109,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
); );
/* /*
* We have to use error control below, because XSLTProcessor::setParameter omits warning on failure. * We have to use error control below, because \XSLTProcessor::setParameter omits warning on failure.
* This warning fails the test. * This warning fails the test.
*/ */
@$template->applyXslStyleSheet($xslDOMDocument, array(1 => 'somevalue')); @$template->applyXslStyleSheet($xslDOMDocument, array(1 => 'somevalue'));
@ -117,7 +117,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::applyXslStyleSheet * @covers ::applyXslStyleSheet
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage Could not load XML from the given template. * @expectedExceptionMessage Could not load XML from the given template.
* @test * @test
*/ */
@ -139,7 +139,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
); );
/* /*
* We have to use error control below, because DOMDocument::loadXML omits warning on failure. * We have to use error control below, because \DOMDocument::loadXML omits warning on failure.
* This warning fails the test. * This warning fails the test.
*/ */
@$template->applyXslStyleSheet($xslDOMDocument); @$template->applyXslStyleSheet($xslDOMDocument);

View File

@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Writer\ODText\Content
* @coversDefaultClass PhpOffice\PhpWord\Writer\ODText\Content
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class ContentTest extends \PHPUnit_Framework_TestCase class ContentTest extends \PHPUnit_Framework_TestCase

View File

@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Writer\ODText; use PhpOffice\PhpWord\Writer\ODText;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Writer\ODText
* @coversDefaultClass PhpOffice\PhpWord\Writer\ODText
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class ODTextTest extends \PHPUnit_Framework_TestCase class ODTextTest extends \PHPUnit_Framework_TestCase
@ -36,7 +35,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::getPhpWord * @covers ::getPhpWord
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage No PhpWord assigned. * @expectedExceptionMessage No PhpWord assigned.
*/ */
public function testConstructWithNull() public function testConstructWithNull()
@ -104,7 +103,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::save * @covers ::save
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage PhpWord object unassigned. * @expectedExceptionMessage PhpWord object unassigned.
*/ */
public function testSaveException() public function testSaveException()
@ -136,7 +135,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::setUseDiskCaching * @covers ::setUseDiskCaching
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function testSetUseDiskCachingException() public function testSetUseDiskCachingException()
{ {

View File

@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Writer\RTF; use PhpOffice\PhpWord\Writer\RTF;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Writer\RTF
* @coversDefaultClass PhpOffice\PhpWord\Writer\RTF
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class RTFTest extends \PHPUnit_Framework_TestCase class RTFTest extends \PHPUnit_Framework_TestCase
@ -24,7 +23,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase
/** /**
* covers ::__construct * covers ::__construct
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage No PhpWord assigned. * @expectedExceptionMessage No PhpWord assigned.
*/ */
public function testConstructWithNull() public function testConstructWithNull()
@ -48,7 +47,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::save * @covers ::save
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
* @expectedExceptionMessage PhpWord object unassigned. * @expectedExceptionMessage PhpWord object unassigned.
*/ */
public function testSaveException() public function testSaveException()

View File

@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Writer\Word2007\Base
* @coversDefaultClass PhpOffice\PhpWord\Writer\Word2007\Base
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class BaseTest extends \PHPUnit_Framework_TestCase class BaseTest extends \PHPUnit_Framework_TestCase
@ -48,7 +47,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
$pStyle = 'pStyle'; $pStyle = 'pStyle';
$aStyle = array('align' => 'justify', 'spaceBefore' => 120, 'spaceAfter' => 120); $aStyle = array('align' => 'justify', 'spaceBefore' => 120, 'spaceAfter' => 120);
$imageSrc = join( $imageSrc = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg')
); );
@ -321,7 +320,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
public function testWriteWatermark() public function testWriteWatermark()
{ {
$imageSrc = join( $imageSrc = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg')
); );

View File

@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class DocumentTest extends \PHPUnit_Framework_TestCase class DocumentTest extends \PHPUnit_Framework_TestCase
@ -40,7 +39,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
public function testElements() public function testElements()
{ {
$objectSrc = join( $objectSrc = join(
DIRECTORY_SEPARATOR, \DIRECTORY_SEPARATOR,
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls') array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls')
); );

View File

@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class FootnotesTest extends \PHPUnit_Framework_TestCase class FootnotesTest extends \PHPUnit_Framework_TestCase

View File

@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class StylesTest extends \PHPUnit_Framework_TestCase class StylesTest extends \PHPUnit_Framework_TestCase

View File

@ -6,8 +6,7 @@ use PhpOffice\PhpWord\Writer\Word2007;
use PhpWord\Tests\TestHelperDOCX; use PhpWord\Tests\TestHelperDOCX;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\Writer\Word2007
* @coversDefaultClass PhpOffice\PhpWord\Writer\Word2007
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class Word2007Test extends \PHPUnit_Framework_TestCase class Word2007Test extends \PHPUnit_Framework_TestCase
@ -118,7 +117,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::setUseDiskCaching * @covers ::setUseDiskCaching
* @expectedException Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function testSetUseDiskCachingException() public function testSetUseDiskCachingException()
{ {

View File

@ -7,8 +7,7 @@ use PhpOffice\PhpWord\Section;
use PhpOffice\PhpWord\Style; use PhpOffice\PhpWord\Style;
/** /**
* @package PhpWord\Tests * @coversDefaultClass \PhpOffice\PhpWord\PhpWord
* @coversDefaultClass PhpOffice\PhpWord
* @runTestsInSeparateProcesses * @runTestsInSeparateProcesses
*/ */
class PhpWordTest extends \PHPUnit_Framework_TestCase class PhpWordTest extends \PHPUnit_Framework_TestCase
@ -144,7 +143,7 @@ class PhpWordTest extends \PHPUnit_Framework_TestCase
/** /**
* @covers ::loadTemplate * @covers ::loadTemplate
* @expectedException PhpOffice\PhpWord\Exceptions\Exception * @expectedException \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function testLoadTemplateException() public function testLoadTemplateException()
{ {

View File

@ -10,8 +10,8 @@ class TestHelperDOCX
static protected $file; static protected $file;
/** /**
* @param PhpOffice\PhpWord $phpWord * @param \PhpOffice\PhpWord\PhpWord $phpWord
* @return PhpWord\Tests\XmlDocument * @return \PhpWord\Tests\XmlDocument
*/ */
public static function getDocument(PhpWord $phpWord, $writerName = 'Word2007') public static function getDocument(PhpWord $phpWord, $writerName = 'Word2007')
{ {

View File

@ -1,8 +1,6 @@
<?php <?php
namespace PhpWord\Tests; namespace PhpWord\Tests;
use DOMDocument;
class XmlDocument class XmlDocument
{ {
/** @var string $path */ /** @var string $path */
@ -39,7 +37,7 @@ class XmlDocument
$this->file = $file; $this->file = $file;
$file = $this->path . '/' . $file; $file = $this->path . '/' . $file;
$this->dom = new DOMDocument(); $this->dom = new \DOMDocument();
$this->dom->load($file); $this->dom->load($file);
return $this->dom; return $this->dom;
} }
@ -112,4 +110,4 @@ class XmlDocument
$nodeList = $this->getNodeList($path, $file); $nodeList = $this->getNodeList($path, $file);
return !($nodeList->length == 0); return !($nodeList->length == 0);
} }
} }

View File

@ -8,7 +8,7 @@ if (!\defined('PHPWORD_TESTS_BASE_DIR')) {
// loading classes with PSR-4 autoloader // loading classes with PSR-4 autoloader
require_once __DIR__ . '/../src/Autoloader.php'; require_once __DIR__ . '/../src/Autoloader.php';
PhpOffice\PhpWord\Autoloader::register(); \PhpOffice\PhpWord\Autoloader::register();
require_once __DIR__ . '/_inc/TestHelperDOCX.php'; require_once __DIR__ . '/_inc/TestHelperDOCX.php';
require_once __DIR__ . '/_inc/XmlDocument.php'; require_once __DIR__ . '/_inc/XmlDocument.php';

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16)); $phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16));
$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100)); $phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100));
$phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240)); $phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240));
@ -51,12 +51,12 @@ $section->addImage('resources/_earth.jpg', array('width'=>18, 'height'=>18));
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,29 +1,29 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Ads styles // Ads styles
$phpWord->addParagraphStyle('multipleTab', array( $phpWord->addParagraphStyle('multipleTab', array(
'tabs' => array( 'tabs' => array(
new PhpOffice\PhpWord\Style\Tab('left', 1550), new \PhpOffice\PhpWord\Style\Tab('left', 1550),
new PhpOffice\PhpWord\Style\Tab('center', 3200), new \PhpOffice\PhpWord\Style\Tab('center', 3200),
new PhpOffice\PhpWord\Style\Tab('right', 5300) new \PhpOffice\PhpWord\Style\Tab('right', 5300)
) )
)); ));
$phpWord->addParagraphStyle('rightTab', array( $phpWord->addParagraphStyle('rightTab', array(
'tabs' => array( 'tabs' => array(
new PhpOffice\PhpWord\Style\Tab('right', 9090) new \PhpOffice\PhpWord\Style\Tab('right', 9090)
) )
)); ));
$phpWord->addParagraphStyle('centerTab', array( $phpWord->addParagraphStyle('centerTab', array(
'tabs' => array( 'tabs' => array(
new PhpOffice\PhpWord\Style\Tab('center', 4680) new \PhpOffice\PhpWord\Style\Tab('center', 4680)
) )
)); ));
@ -39,12 +39,12 @@ $section->addText("\tCenter Aligned", NULL, 'centerTab');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// New portrait section // New portrait section
$section = $phpWord->createSection(array('borderColor' => '00FF00', 'borderSize' => 12)); $section = $phpWord->createSection(array('borderColor' => '00FF00', 'borderSize' => 12));
@ -32,12 +32,12 @@ $section->createFooter()->addText('Footer');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,18 +1,18 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Ads styles // Ads styles
$phpWord->addParagraphStyle('pStyle', array('spacing'=>100)); $phpWord->addParagraphStyle('pStyle', array('spacing'=>100));
$phpWord->addFontStyle('BoldText', array('bold'=>true)); $phpWord->addFontStyle('BoldText', array('bold'=>true));
$phpWord->addFontStyle('ColoredText', array('color'=>'FF8080')); $phpWord->addFontStyle('ColoredText', array('color'=>'FF8080'));
$phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); $phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
// New portrait section // New portrait section
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -38,12 +38,12 @@ $textrun->addText(' Here is some more text. ');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' . $filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' .
'Nulla fermentum, tortor id adipiscing adipiscing, tortor turpis commodo. ' . 'Nulla fermentum, tortor id adipiscing adipiscing, tortor turpis commodo. ' .
'Donec vulputate iaculis metus, vel luctus dolor hendrerit ac. ' . 'Donec vulputate iaculis metus, vel luctus dolor hendrerit ac. ' .
@ -42,12 +42,12 @@ $section->addText('Normal paragraph again.');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// New portrait section // New portrait section
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -15,7 +15,7 @@ $section = $phpWord->createSection();
$phpWord->addParagraphStyle('pStyle', array('spacing'=>100)); $phpWord->addParagraphStyle('pStyle', array('spacing'=>100));
$phpWord->addFontStyle('BoldText', array('bold'=>true)); $phpWord->addFontStyle('BoldText', array('bold'=>true));
$phpWord->addFontStyle('ColoredText', array('color'=>'FF8080')); $phpWord->addFontStyle('ColoredText', array('color'=>'FF8080'));
$phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); $phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
// Add text elements // Add text elements
$textrun = $section->createTextRun('pStyle'); $textrun = $section->createTextRun('pStyle');
@ -40,12 +40,12 @@ $footnote->addText('The reference for this is wrapped in its own line');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$document = $phpWord->loadTemplate('resources/Sample_07_TemplateCloneRow.docx'); $document = $phpWord->loadTemplate('resources/Sample_07_TemplateCloneRow.docx');
@ -57,10 +57,10 @@ $document->setValue('userName#3', 'Ray');
$document->setValue('userPhone#3', '+1 428 889 775'); $document->setValue('userPhone#3', '+1 428 889 775');
$name = 'Sample_07_TemplateCloneRow_result.docx'; $name = 'Sample_07_TemplateCloneRow_result.docx';
echo date('H:i:s'), " Write to Word2007 format", EOL; echo date('H:i:s'), " Write to Word2007 format", \EOL;
$document->saveAs($name); $document->saveAs($name);
rename($name, "results/{$name}"); rename($name, "results/{$name}");
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,15 +1,15 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->setDefaultParagraphStyle(array( $phpWord->setDefaultParagraphStyle(array(
'align' => 'both', 'align' => 'both',
'spaceAfter' => PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(12), 'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(12),
'spacing' => 120, 'spacing' => 120,
)); ));
@ -52,12 +52,12 @@ $section->addText('Paragraph with pageBreakBefore = true (default: false). ' .
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->createSection(); $section = $phpWord->createSection();
$header = array('size' => 16, 'bold' => true); $header = array('size' => 16, 'bold' => true);
@ -32,7 +32,7 @@ $section->addText("Fancy table", $header);
$styleTable = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80); $styleTable = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80);
$styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF'); $styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF');
$styleCell = array('valign' => 'center'); $styleCell = array('valign' => 'center');
$styleCellBTLR = array('valign' => 'center', 'textDirection' => PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR); $styleCellBTLR = array('valign' => 'center', 'textDirection' => \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR);
$fontStyle = array('bold' => true, 'align' => 'center'); $fontStyle = array('bold' => true, 'align' => 'center');
$phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow); $phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow);
$table = $section->addTable('Fancy Table'); $table = $section->addTable('Fancy Table');
@ -80,12 +80,12 @@ $table->addCell(null, $cellRowContinue);
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word Document // New Word Document
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->createSection(); $section = $phpWord->createSection();
$header = array('size' => 16, 'bold' => true); $header = array('size' => 16, 'bold' => true);
//1.Use EastAisa FontStyle //1.Use EastAisa FontStyle
@ -16,12 +16,12 @@ $section->addText('中文楷体样式测试',array('name' => '楷体', 'size' =>
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,24 +1,24 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// Read contents // Read contents
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$source = "resources/{$name}.docx"; $source = "resources/{$name}.docx";
echo date('H:i:s'), " Reading contents from `{$source}`", EOL; echo date('H:i:s'), " Reading contents from `{$source}`", \EOL;
$phpWord = PhpOffice\PhpWord\IOFactory::load($source); $phpWord = \PhpOffice\PhpWord\IOFactory::load($source);
// (Re)write contents // (Re)write contents
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -1,12 +1,12 @@
<?php <?php
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// New portrait section // New portrait section
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -63,12 +63,12 @@ $section2->addText('Some text...');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -31,12 +31,12 @@ $section->addMemoryImage($source);
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -31,7 +31,7 @@ $section->addListItem('List Item 1.3.2', 2);
$section->addTextBreak(2); $section->addTextBreak(2);
// Add listitem elements // Add listitem elements
$listStyle = array('listType' => PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER); $listStyle = array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER);
$section->addListItem('List Item 1', 0, null, $listStyle); $section->addListItem('List Item 1', 0, null, $listStyle);
$section->addListItem('List Item 2', 0, null, $listStyle); $section->addListItem('List Item 2', 0, null, $listStyle);
$section->addListItem('List Item 3', 0, null, $listStyle); $section->addListItem('List Item 3', 0, null, $listStyle);
@ -40,7 +40,7 @@ $section->addTextBreak(2);
// Add listitem elements // Add listitem elements
$phpWord->addFontStyle('myOwnStyle', array('color'=>'FF0000')); $phpWord->addFontStyle('myOwnStyle', array('color'=>'FF0000'));
$phpWord->addParagraphStyle('P-Style', array('spaceAfter'=>95)); $phpWord->addParagraphStyle('P-Style', array('spaceAfter'=>95));
$listStyle = array('listType' => PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER_NESTED); $listStyle = array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER_NESTED);
$section->addListItem('List Item 1', 0, 'myOwnStyle', $listStyle, 'P-Style'); $section->addListItem('List Item 1', 0, 'myOwnStyle', $listStyle, 'P-Style');
$section->addListItem('List Item 2', 0, 'myOwnStyle', $listStyle, 'P-Style'); $section->addListItem('List Item 2', 0, 'myOwnStyle', $listStyle, 'P-Style');
$section->addListItem('List Item 3', 1, 'myOwnStyle', $listStyle, 'P-Style'); $section->addListItem('List Item 3', 1, 'myOwnStyle', $listStyle, 'P-Style');
@ -55,12 +55,12 @@ $section->addListItem('List Item 7', 0, 'myOwnStyle', $listStyle, 'P-Style');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,19 +4,19 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$section = $phpWord->createSection(); $section = $phpWord->createSection();
// Add hyperlink elements // Add hyperlink elements
$section->addLink('http://www.google.com', 'Best search engine', array('color'=>'0000FF', 'underline' => PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); $section->addLink('http://www.google.com', 'Best search engine', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
$section->addTextBreak(2); $section->addTextBreak(2);
$phpWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000')); $phpWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000'));
@ -29,12 +29,12 @@ $section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -24,12 +24,12 @@ $section->addObject('resources/_sheet.xls');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$section = $phpWord->createSection(); $section = $phpWord->createSection();
@ -49,19 +49,19 @@ $section->addTextBreak(2);
$section->addTitle('I am a Subtitle of Title 3', 2); $section->addTitle('I am a Subtitle of Title 3', 2);
$section->addText('Again and again, more text...'); $section->addText('Again and again, more text...');
echo date('H:i:s'), " Note: Please refresh TOC manually.", EOL; echo date('H:i:s'), " Note: Please refresh TOC manually.", \EOL;
// End code // End code
// Save file // Save file
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
@ -25,12 +25,12 @@ $section->addText('The header reference to the current section includes a waterm
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -4,13 +4,13 @@
*/ */
// Init // Init
error_reporting(E_ALL); error_reporting(\E_ALL);
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
require_once '../src/PhpWord.php'; require_once '../src/PhpWord.php';
// New Word document // New Word document
echo date('H:i:s'), " Create new PhpWord object", EOL; echo date('H:i:s'), " Create new PhpWord object", \EOL;
$phpWord = new PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code // Begin code
$fontStyle = array('size' => 24); $fontStyle = array('size' => 24);
@ -38,12 +38,12 @@ $section->addText('Done.');
$name = basename(__FILE__, '.php'); $name = basename(__FILE__, '.php');
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
foreach ($writers as $writer => $extension) { foreach ($writers as $writer => $extension) {
echo date('H:i:s'), " Write to {$writer} format", EOL; echo date('H:i:s'), " Write to {$writer} format", \EOL;
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
$xmlWriter->save("{$name}.{$extension}"); $xmlWriter->save("{$name}.{$extension}");
rename("{$name}.{$extension}", "results/{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}");
} }
// Done // Done
echo date('H:i:s'), " Done writing file(s)", EOL; echo date('H:i:s'), " Done writing file(s)", \EOL;
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -152,8 +150,8 @@ class DocumentProperties
/** /**
* Set Creator * Set Creator
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setCreator($pValue = '') public function setCreator($pValue = '')
{ {
@ -174,8 +172,8 @@ class DocumentProperties
/** /**
* Set Last Modified By * Set Last Modified By
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setLastModifiedBy($pValue = '') public function setLastModifiedBy($pValue = '')
{ {
@ -196,8 +194,8 @@ class DocumentProperties
/** /**
* Set Created * Set Created
* *
* @param datetime $pValue * @param datetime $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setCreated($pValue = null) public function setCreated($pValue = null)
{ {
@ -221,8 +219,8 @@ class DocumentProperties
/** /**
* Set Modified * Set Modified
* *
* @param datetime $pValue * @param datetime $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setModified($pValue = null) public function setModified($pValue = null)
{ {
@ -246,8 +244,8 @@ class DocumentProperties
/** /**
* Set Title * Set Title
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setTitle($pValue = '') public function setTitle($pValue = '')
{ {
@ -268,8 +266,8 @@ class DocumentProperties
/** /**
* Set Description * Set Description
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setDescription($pValue = '') public function setDescription($pValue = '')
{ {
@ -290,8 +288,8 @@ class DocumentProperties
/** /**
* Set Subject * Set Subject
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setSubject($pValue = '') public function setSubject($pValue = '')
{ {
@ -313,7 +311,7 @@ class DocumentProperties
* Set Keywords * Set Keywords
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setKeywords($pValue = '') public function setKeywords($pValue = '')
{ {
@ -335,7 +333,7 @@ class DocumentProperties
* Set Category * Set Category
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setCategory($pValue = '') public function setCategory($pValue = '')
{ {
@ -357,7 +355,7 @@ class DocumentProperties
* Set Company * Set Company
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setCompany($pValue = '') public function setCompany($pValue = '')
{ {
@ -379,7 +377,7 @@ class DocumentProperties
* Set Manager * Set Manager
* *
* @param string $pValue * @param string $pValue
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setManager($pValue = '') public function setManager($pValue = '')
{ {
@ -447,7 +445,7 @@ class DocumentProperties
* 's': String * 's': String
* 'd': Date/Time * 'd': Date/Time
* 'b': Boolean * 'b': Boolean
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null) public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
{ {

View File

@ -2,11 +2,7 @@
namespace PhpOffice\PhpWord\Exceptions; namespace PhpOffice\PhpWord\Exceptions;
/** /**
* InvalidImageException
*
* Exception used for when an image is not found * Exception used for when an image is not found
*
* @package PhpWord
*/ */
class InvalidImageException extends Exception class InvalidImageException extends Exception
{ {

View File

@ -4,11 +4,7 @@ namespace PhpOffice\PhpWord\Exceptions;
use InvalidArgumentException; use InvalidArgumentException;
/** /**
* InvalidStyleException
*
* Exception used for when a style value is invalid * Exception used for when a style value is invalid
*
* @package PhpWord
*/ */
class InvalidStyleException extends InvalidArgumentException class InvalidStyleException extends InvalidArgumentException
{ {

View File

@ -2,11 +2,7 @@
namespace PhpOffice\PhpWord\Exceptions; namespace PhpOffice\PhpWord\Exceptions;
/** /**
* UnsupportedImageTypeException
*
* Exception used for when an image type is unsupported * Exception used for when an image type is unsupported
*
* @package PhpWord
*/ */
class UnsupportedImageTypeException extends Exception class UnsupportedImageTypeException extends Exception
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -51,7 +49,7 @@ class Footnote
* *
* @return mixed * @return mixed
*/ */
public static function addFootnoteElement(PhpOffice\PhpWord\Section\Footnote $footnote) public static function addFootnoteElement(\PhpOffice\PhpWord\Section\Footnote $footnote)
{ {
$refID = self::countFootnoteElements() + 2; $refID = self::countFootnoteElements() + 2;

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,6 +25,8 @@
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;
use PhpOffice\PhpWord\Exceptions\Exception;
/** /**
* @codeCoverageIgnore Legacy from PHPExcel * @codeCoverageIgnore Legacy from PHPExcel
*/ */
@ -47,8 +47,7 @@ class HashTable
public $_keyMap = array(); public $_keyMap = array();
/** /**
* @param PhpOffice\PhpWord\IComparable[] $pSource Optional source array to create HashTable from * @param \PhpOffice\PhpWord\IComparable[] $pSource Optional source array to create HashTable from
* @throws Exception
*/ */
public function __construct($pSource = null) public function __construct($pSource = null)
{ {
@ -60,8 +59,8 @@ class HashTable
/** /**
* Add HashTable items from source * Add HashTable items from source
* *
* @param PhpOffice\PhpWord\IComparable[] $pSource Source array to create HashTable from * @param \PhpOffice\PhpWord\IComparable[] $pSource Source array to create HashTable from
* @throws Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function addFromSource($pSource = null) public function addFromSource($pSource = null)
{ {
@ -80,8 +79,7 @@ class HashTable
/** /**
* Add HashTable item * Add HashTable item
* *
* @param PhpOffice\PhpWord\IComparable $pSource Item to add * @param \PhpOffice\PhpWord\IComparable $pSource Item to add
* @throws Exception
*/ */
public function add(IComparable $pSource = null) public function add(IComparable $pSource = null)
{ {
@ -110,8 +108,7 @@ class HashTable
/** /**
* Remove HashTable item * Remove HashTable item
* *
* @param PhpOffice\PhpWord\IComparable $pSource Item to remove * @param \PhpOffice\PhpWord\IComparable $pSource Item to remove
* @throws Exception
*/ */
public function remove(IComparable $pSource = null) public function remove(IComparable $pSource = null)
{ {
@ -161,7 +158,7 @@ class HashTable
/** /**
* @param int $pIndex * @param int $pIndex
* @return PhpOffice\PhpWord\IComparable * @return \PhpOffice\PhpWord\IComparable
*/ */
public function getByIndex($pIndex = 0) public function getByIndex($pIndex = 0)
{ {
@ -174,7 +171,7 @@ class HashTable
/** /**
* @param string $pHashCode * @param string $pHashCode
* @return PhpOffice\PhpWord\IComparable * @return \PhpOffice\PhpWord\IComparable
* *
*/ */
public function getByHashCode($pHashCode = '') public function getByHashCode($pHashCode = '')
@ -187,7 +184,7 @@ class HashTable
} }
/** /**
* @return PhpOffice\PhpWord\IComparable[] * @return \PhpOffice\PhpWord\IComparable[]
*/ */
public function toArray() public function toArray()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,16 +25,15 @@
namespace PhpOffice\PhpWord; namespace PhpOffice\PhpWord;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Exceptions\Exception; use PhpOffice\PhpWord\Exceptions\Exception;
abstract class IOFactory abstract class IOFactory
{ {
/** /**
* @param PhpOffice\PhpWord $phpWord * @param \PhpOffice\PhpWord\PhpWord $phpWord
* @param string $name * @param string $name
* @return PhpOffice\PhpWord\Writer\IWriter * @return \PhpOffice\PhpWord\Writer\IWriter
* @throws PhpOffice\PhpWord\Exceptions\Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public static function createWriter(PhpWord $phpWord, $name) public static function createWriter(PhpWord $phpWord, $name)
{ {
@ -51,8 +48,8 @@ abstract class IOFactory
/** /**
* @param string $name * @param string $name
* @return PhpOffice\PhpWord\Reader\IReader * @return \PhpOffice\PhpWord\Reader\IReader
* @throws PhpOffice\PhpWord\Exceptions\Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public static function createReader($name) public static function createReader($name)
{ {
@ -70,7 +67,7 @@ abstract class IOFactory
* *
* @param string $filename The name of the file * @param string $filename The name of the file
* @param string $readerName * @param string $readerName
* @return PhpOffice\PhpWord * @return \PhpOffice\PhpWord
*/ */
public static function load($filename, $readerName = 'Word2007') public static function load($filename, $readerName = 'Word2007')
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -37,9 +35,9 @@ class Media
* @var array * @var array
*/ */
private static $_sectionMedia = array( private static $_sectionMedia = array(
'images' => array(), 'images' => array(),
'embeddings' => array(), 'embeddings' => array(),
'links' => array() 'links' => array()
); );
/** /**
@ -66,9 +64,9 @@ class Media
/** /**
* Add new Section Media Element * Add new Section Media Element
* *
* @param string $src * @param string $src
* @param string $type * @param string $type
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage * @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
* @return mixed * @return mixed
*/ */
public static function addSectionMediaElement($src, $type, MemoryImage $memoryImage = null) public static function addSectionMediaElement($src, $type, MemoryImage $memoryImage = null)
@ -93,7 +91,7 @@ class Media
$isMemImage = true; $isMemImage = true;
} }
if (!$isMemImage) { if (!$isMemImage) {
$isMemImage = (filter_var($src, FILTER_VALIDATE_URL) !== false); $isMemImage = (filter_var($src, \FILTER_VALIDATE_URL) !== false);
} }
$extension = ''; $extension = '';
if ($isMemImage) { if ($isMemImage) {
@ -103,15 +101,15 @@ class Media
$media['imagefunction'] = $memoryImage->getImageFunction(); $media['imagefunction'] = $memoryImage->getImageFunction();
} else { } else {
$imageType = exif_imagetype($src); $imageType = exif_imagetype($src);
if ($imageType === IMAGETYPE_JPEG) { if ($imageType === \IMAGETYPE_JPEG) {
$extension = 'jpg'; $extension = 'jpg';
} elseif ($imageType === IMAGETYPE_GIF) { } elseif ($imageType === \IMAGETYPE_GIF) {
$extension = 'gif'; $extension = 'gif';
} elseif ($imageType === IMAGETYPE_PNG) { } elseif ($imageType === \IMAGETYPE_PNG) {
$extension = 'png'; $extension = 'png';
} elseif ($imageType === IMAGETYPE_BMP) { } elseif ($imageType === \IMAGETYPE_BMP) {
$extension = 'bmp'; $extension = 'bmp';
} elseif ($imageType === IMAGETYPE_TIFF_II || $imageType === IMAGETYPE_TIFF_MM) { } elseif ($imageType === \IMAGETYPE_TIFF_II || $imageType === \IMAGETYPE_TIFF_MM) {
$extension = 'tif'; $extension = 'tif';
} }
} }
@ -204,9 +202,9 @@ class Media
/** /**
* Add new Header Media Element * Add new Header Media Element
* *
* @param int $headerCount * @param int $headerCount
* @param string $src * @param string $src
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage * @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
* @return int * @return int
*/ */
public static function addHeaderMediaElement($headerCount, $src, MemoryImage $memoryImage = null) public static function addHeaderMediaElement($headerCount, $src, MemoryImage $memoryImage = null)
@ -276,9 +274,9 @@ class Media
/** /**
* Add new Footer Media Element * Add new Footer Media Element
* *
* @param int $footerCount * @param int $footerCount
* @param string $src * @param string $src
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage * @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
* @return int * @return int
*/ */
public static function addFooterMediaElement($footerCount, $src, MemoryImage $memoryImage = null) public static function addFooterMediaElement($footerCount, $src, MemoryImage $memoryImage = null)

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -37,7 +35,7 @@ use PhpOffice\PhpWord\Template;
if (!defined('PHPWORD_BASE_DIR')) { if (!defined('PHPWORD_BASE_DIR')) {
define('PHPWORD_BASE_DIR', \realpath(__DIR__) . \DIRECTORY_SEPARATOR); define('PHPWORD_BASE_DIR', \realpath(__DIR__) . \DIRECTORY_SEPARATOR);
require \PHPWORD_BASE_DIR . 'Autoloader.php'; require \PHPWORD_BASE_DIR . 'Autoloader.php';
Autoloader::register(); \PhpOffice\PhpWord\Autoloader::register();
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
@ -55,7 +53,7 @@ class PhpWord
const DEFAULT_FONT_SIZE = 10; const DEFAULT_FONT_SIZE = 10;
/** /**
* @var PhpOffice\PhpWord\DocumentProperties * @var \PhpOffice\PhpWord\DocumentProperties
*/ */
private $_documentProperties; private $_documentProperties;
@ -70,7 +68,7 @@ class PhpWord
private $_defaultFontSize; private $_defaultFontSize;
/** /**
* @var PhpOffice\PhpWord\Section[] * @var \PhpOffice\PhpWord\Section[]
*/ */
private $_sections = array(); private $_sections = array();
@ -82,7 +80,7 @@ class PhpWord
} }
/** /**
* @return PhpOffice\PhpWord\DocumentProperties * @return \PhpOffice\PhpWord\DocumentProperties
*/ */
public function getDocumentProperties() public function getDocumentProperties()
{ {
@ -90,8 +88,8 @@ class PhpWord
} }
/** /**
* @param PhpOffice\PhpWord\DocumentProperties $documentProperties * @param \PhpOffice\PhpWord\DocumentProperties $documentProperties
* @return PhpOffice\PhpWord * @return \PhpOffice\PhpWord\PhpWord
*/ */
public function setDocumentProperties(DocumentProperties $documentProperties) public function setDocumentProperties(DocumentProperties $documentProperties)
{ {
@ -101,8 +99,8 @@ class PhpWord
} }
/** /**
* @param PhpOffice\PhpWord\Section\Settings $settings * @param \PhpOffice\PhpWord\Section\Settings $settings
* @return PhpOffice\PhpWord\Section * @return \PhpOffice\PhpWord\Section
*/ */
public function createSection($settings = null) public function createSection($settings = null)
{ {
@ -210,7 +208,7 @@ class PhpWord
} }
/** /**
* @return PhpOffice\PhpWord\Section[] * @return \PhpOffice\PhpWord\Section[]
*/ */
public function getSections() public function getSections()
{ {
@ -219,8 +217,8 @@ class PhpWord
/** /**
* @param string $filename Fully qualified filename. * @param string $filename Fully qualified filename.
* @return PhpOffice\PhpWord\Template * @return \PhpOffice\PhpWord\Template
* @throws PhpOffice\PhpWord\Exceptions\Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function loadTemplate($filename) public function loadTemplate($filename)
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -61,7 +59,7 @@ abstract class AbstractReader implements IReader
* Set read data only * Set read data only
* *
* @param bool $pValue * @param bool $pValue
* @return PhpOffice\PhpWord\Reader\IReader * @return \PhpOffice\PhpWord\Reader\IReader
*/ */
public function setReadDataOnly($pValue = true) public function setReadDataOnly($pValue = true)
{ {
@ -74,7 +72,7 @@ abstract class AbstractReader implements IReader
* *
* @param string $pFilename * @param string $pFilename
* @return resource * @return resource
* @throws Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
protected function openFile($pFilename) protected function openFile($pFilename)
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -32,8 +30,8 @@ interface IReader
/** /**
* Can the current IReader read the file? * Can the current IReader read the file?
* *
* @param string $pFilename * @param string $pFilename
* @return boolean * @return boolean
*/ */
public function canRead($pFilename); public function canRead($pFilename);
@ -43,4 +41,4 @@ interface IReader
* @param string $pFilename * @param string $pFilename
*/ */
public function load($pFilename); public function load($pFilename);
} }

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -44,7 +42,7 @@ class Word2007 extends AbstractReader implements IReader
* *
* @param string $pFilename * @param string $pFilename
* @return bool * @return bool
* @throws PhpOffice\PhpWord\Exceptions\Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function canRead($pFilename) public function canRead($pFilename)
{ {
@ -78,7 +76,7 @@ class Word2007 extends AbstractReader implements IReader
} }
/** /**
* @param ZipArchive $archive * @param \ZipArchive $archive
* @param string $fileName * @param string $fileName
* @param bool $removeNamespace * @param bool $removeNamespace
* @return mixed * @return mixed
@ -109,7 +107,7 @@ class Word2007 extends AbstractReader implements IReader
* Loads PhpWord from file * Loads PhpWord from file
* *
* @param string $pFilename * @param string $pFilename
* @return PhpOffice\PhpWord|null * @return \PhpOffice\PhpWord\PhpWord|null
*/ */
public function load($pFilename) public function load($pFilename)
{ {
@ -271,7 +269,7 @@ class Word2007 extends AbstractReader implements IReader
/** /**
* Load section settings from SimpleXMLElement * Load section settings from SimpleXMLElement
* *
* @param SimpleXMLElement $elm * @param \SimpleXMLElement $elm
* @return array|string|null * @return array|string|null
* *
* @todo Implement gutter * @todo Implement gutter
@ -333,7 +331,7 @@ class Word2007 extends AbstractReader implements IReader
/** /**
* Load paragraph style from SimpleXMLElement * Load paragraph style from SimpleXMLElement
* *
* @param SimpleXMLElement $elm * @param \SimpleXMLElement $elm
* @return array|string|null * @return array|string|null
*/ */
private function loadParagraphStyle($elm) private function loadParagraphStyle($elm)
@ -394,7 +392,7 @@ class Word2007 extends AbstractReader implements IReader
/** /**
* Load font style from SimpleXMLElement * Load font style from SimpleXMLElement
* *
* @param SimpleXMLElement $elm * @param \SimpleXMLElement $elm
* @return array|string|null * @return array|string|null
*/ */
private function loadFontStyle($elm) private function loadFontStyle($elm)

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -29,8 +27,8 @@ namespace PhpOffice\PhpWord;
use PhpOffice\PhpWord\Exceptions\Exception; use PhpOffice\PhpWord\Exceptions\Exception;
use PhpOffice\PhpWord\Section\Footer; use PhpOffice\PhpWord\Section\Footer;
use PhpOffice\PhpWord\Section\Footnote;
use PhpOffice\PhpWord\Section\Image; use PhpOffice\PhpWord\Section\Image;
use PhpOffice\PhpWord\Section\Header;
use PhpOffice\PhpWord\Section\Link; use PhpOffice\PhpWord\Section\Link;
use PhpOffice\PhpWord\Section\ListItem; use PhpOffice\PhpWord\Section\ListItem;
use PhpOffice\PhpWord\Section\MemoryImage; use PhpOffice\PhpWord\Section\MemoryImage;
@ -56,7 +54,7 @@ class Section
/** /**
* Section settings * Section settings
* *
* @var PhpOffice\PhpWord\Section\Settings * @var \PhpOffice\PhpWord\Section\Settings
*/ */
private $_settings; private $_settings;
@ -77,7 +75,7 @@ class Section
/** /**
* Section Footer * Section Footer
* *
* @var PhpOffice\PhpWord\Section\Footer * @var \PhpOffice\PhpWord\Section\Footer
*/ */
private $_footer = null; private $_footer = null;
@ -115,7 +113,7 @@ class Section
/** /**
* Get Section Settings * Get Section Settings
* *
* @return PhpOffice\PhpWord\Section\Settings * @return \PhpOffice\PhpWord\Section\Settings
*/ */
public function getSettings() public function getSettings()
{ {
@ -128,7 +126,7 @@ class Section
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) public function addText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -147,7 +145,7 @@ class Section
* @param string $linkName * @param string $linkName
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Link * @return \PhpOffice\PhpWord\Section\Link
*/ */
public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null) public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null)
{ {
@ -172,8 +170,8 @@ class Section
* Add a TextBreak Element * Add a TextBreak Element
* *
* @param int $count * @param int $count
* @param null|string|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null) public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{ {
@ -194,7 +192,7 @@ class Section
* Add a Table Element * Add a Table Element
* *
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Table * @return \PhpOffice\PhpWord\Section\Table
*/ */
public function addTable($style = null) public function addTable($style = null)
{ {
@ -211,7 +209,7 @@ class Section
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleList * @param mixed $styleList
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\ListItem * @return \PhpOffice\PhpWord\Section\ListItem
*/ */
public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null)
{ {
@ -228,8 +226,8 @@ class Section
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Object * @return \PhpOffice\PhpWord\Section\Object
* @throws Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function addObject($src, $style = null) public function addObject($src, $style = null)
{ {
@ -269,8 +267,8 @@ class Section
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Image * @return \PhpOffice\PhpWord\Section\Image
* @throws Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function addImage($src, $style = null) public function addImage($src, $style = null)
{ {
@ -291,8 +289,8 @@ class Section
* *
* @param string $link * @param string $link
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\MemoryImage * @return \PhpOffice\PhpWord\Section\MemoryImage
* @throws Exception * @throws \PhpOffice\PhpWord\Exceptions\Exception
*/ */
public function addMemoryImage($link, $style = null) public function addMemoryImage($link, $style = null)
{ {
@ -312,7 +310,7 @@ class Section
* *
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleTOC * @param mixed $styleTOC
* @return PhpOffice\PhpWord\TOC * @return \PhpOffice\PhpWord\TOC
*/ */
public function addTOC($styleFont = null, $styleTOC = null) public function addTOC($styleFont = null, $styleTOC = null)
{ {
@ -326,7 +324,7 @@ class Section
* *
* @param string $text * @param string $text
* @param int $depth * @param int $depth
* @return PhpOffice\PhpWord\Section\Title * @return \PhpOffice\PhpWord\Section\Title
*/ */
public function addTitle($text, $depth = 1) public function addTitle($text, $depth = 1)
{ {
@ -357,7 +355,7 @@ class Section
* Create a new TextRun * Create a new TextRun
* *
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\TextRun * @return \PhpOffice\PhpWord\Section\TextRun
*/ */
public function createTextRun($styleParagraph = null) public function createTextRun($styleParagraph = null)
{ {
@ -379,7 +377,7 @@ class Section
/** /**
* Create a new Header * Create a new Header
* *
* @return PhpOffice\PhpWord\Section\Header * @return \PhpOffice\PhpWord\Section\Header
*/ */
public function createHeader() public function createHeader()
{ {
@ -417,7 +415,7 @@ class Section
/** /**
* Create a new Footer * Create a new Footer
* *
* @return PhpOffice\PhpWord\Section\Footer * @return \PhpOffice\PhpWord\Section\Footer
*/ */
public function createFooter() public function createFooter()
{ {
@ -427,9 +425,7 @@ class Section
} }
/** /**
* Get Footer * @return \PhpOffice\PhpWord\Section\Footer
*
* @return PhpOffice\PhpWord\Section\Footer
*/ */
public function getFooter() public function getFooter()
{ {
@ -440,11 +436,11 @@ class Section
* Create a new Footnote Element * Create a new Footnote Element
* *
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Footnote * @return \PhpOffice\PhpWord\Section\Footnote
*/ */
public function createFootnote($styleParagraph = null) public function createFootnote($styleParagraph = null)
{ {
$footnote = new Footnote($styleParagraph); $footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph);
$refID = Footnote::addFootnoteElement($footnote); $refID = Footnote::addFootnoteElement($footnote);
$footnote->setReferenceId($refID); $footnote->setReferenceId($refID);
$this->_elementCollection[] = $footnote; $this->_elementCollection[] = $footnote;

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,6 +25,7 @@
namespace PhpOffice\PhpWord\Section; namespace PhpOffice\PhpWord\Section;
use PhpOffice\PhpWord\Exceptions\Exception;
use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Section\Footer\PreserveText; use PhpOffice\PhpWord\Section\Footer\PreserveText;
use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Shared\String;
@ -68,7 +67,7 @@ class Footer
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) public function addText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -84,8 +83,8 @@ class Footer
* Add TextBreak * Add TextBreak
* *
* @param int $count * @param int $count
* @param null|string|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null) public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{ {
@ -97,7 +96,7 @@ class Footer
/** /**
* Create a new TextRun * Create a new TextRun
* *
* @return PhpOffice\PhpWord\Section\TextRun * @return \PhpOffice\PhpWord\Section\TextRun
*/ */
public function createTextRun($styleParagraph = null) public function createTextRun($styleParagraph = null)
{ {
@ -110,7 +109,7 @@ class Footer
* Add a Table Element * Add a Table Element
* *
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Table * @return \PhpOffice\PhpWord\Section\Table
*/ */
public function addTable($style = null) public function addTable($style = null)
{ {
@ -124,7 +123,7 @@ class Footer
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return Image * @return \PhpOffice\PhpWord\Section\Image
*/ */
public function addImage($src, $style = null) public function addImage($src, $style = null)
{ {
@ -146,7 +145,7 @@ class Footer
* *
* @param string $link * @param string $link
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\MemoryImage * @return \PhpOffice\PhpWord\Section\MemoryImage
*/ */
public function addMemoryImage($link, $style = null) public function addMemoryImage($link, $style = null)
{ {
@ -168,7 +167,7 @@ class Footer
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Footer\PreserveText * @return \PhpOffice\PhpWord\Section\Footer\PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -42,14 +40,14 @@ class PreserveText
/** /**
* Text style * Text style
* *
* @var PhpOffice\PhpWord\Style\Font * @var \PhpOffice\PhpWord\Style\Font
*/ */
private $_styleFont; private $_styleFont;
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Paragraph * @var \PhpOffice\PhpWord\Style\Paragraph
*/ */
private $_styleParagraph; private $_styleParagraph;
@ -90,7 +88,7 @@ class PreserveText
$this->_styleParagraph = $styleParagraph; $this->_styleParagraph = $styleParagraph;
} }
$matches = preg_split('/({.*?})/', $text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); $matches = preg_split('/({.*?})/', $text, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
if (isset($matches[0])) { if (isset($matches[0])) {
$this->_text = $matches[0]; $this->_text = $matches[0];
} }
@ -101,7 +99,7 @@ class PreserveText
/** /**
* Get Text style * Get Text style
* *
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function getFontStyle() public function getFontStyle()
{ {
@ -111,7 +109,7 @@ class PreserveText
/** /**
* Get Paragraph style * Get Paragraph style
* *
* @return PhpOffice\PhpWord\Style\Paragraph * @return \PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -34,7 +32,7 @@ class Footnote
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Paragraph * @var \PhpOffice\PhpWord\Style\Paragraph
*/ */
private $_styleParagraph; private $_styleParagraph;
@ -80,7 +78,7 @@ class Footnote
* *
* @var string $text * @var string $text
* @var mixed $styleFont * @var mixed $styleFont
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text = null, $styleFont = null) public function addText($text = null, $styleFont = null)
{ {
@ -96,13 +94,13 @@ class Footnote
* @param string $linkSrc * @param string $linkSrc
* @param string $linkName * @param string $linkName
* @param mixed $styleFont * @param mixed $styleFont
* @return PhpOffice\PhpWord\Section\Link * @return \PhpOffice\PhpWord\Section\Link
*/ */
public function addLink($linkSrc, $linkName = null, $styleFont = null) public function addLink($linkSrc, $linkName = null, $styleFont = null)
{ {
$link = new Link($linkSrc, $linkName, $styleFont); $link = new Link($linkSrc, $linkName, $styleFont);
$rID = PhpOffice\PhpWord\Footnote::addFootnoteLinkElement($linkSrc); $rID = \PhpOffice\PhpWord\Footnote::addFootnoteLinkElement($linkSrc);
$link->setRelationId($rID); $link->setRelationId($rID);
$this->_elementCollection[] = $link; $this->_elementCollection[] = $link;
@ -120,9 +118,7 @@ class Footnote
} }
/** /**
* Get Paragraph style * @return \PhpOffice\PhpWord\Style\Paragraph
*
* @return PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,6 +25,7 @@
namespace PhpOffice\PhpWord\Section; namespace PhpOffice\PhpWord\Section;
use PhpOffice\PhpWord\Exceptions\Exception;
use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Section\Footer\PreserveText; use PhpOffice\PhpWord\Section\Footer\PreserveText;
use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Shared\String;
@ -97,7 +96,7 @@ class Header
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) public function addText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -113,8 +112,8 @@ class Header
* Add TextBreak * Add TextBreak
* *
* @param int $count * @param int $count
* @param null|string|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null) public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{ {
@ -126,7 +125,7 @@ class Header
/** /**
* Create a new TextRun * Create a new TextRun
* *
* @return PhpOffice\PhpWord\Section\TextRun * @return \PhpOffice\PhpWord\Section\TextRun
*/ */
public function createTextRun($styleParagraph = null) public function createTextRun($styleParagraph = null)
{ {
@ -139,7 +138,7 @@ class Header
* Add a Table Element * Add a Table Element
* *
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Table * @return \PhpOffice\PhpWord\Section\Table
*/ */
public function addTable($style = null) public function addTable($style = null)
{ {
@ -153,7 +152,7 @@ class Header
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Image * @return \PhpOffice\PhpWord\Section\Image
*/ */
public function addImage($src, $style = null) public function addImage($src, $style = null)
{ {
@ -175,7 +174,7 @@ class Header
* *
* @param string $link * @param string $link
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\MemoryImage * @return \PhpOffice\PhpWord\Section\MemoryImage
*/ */
public function addMemoryImage($link, $style = null) public function addMemoryImage($link, $style = null)
{ {
@ -197,7 +196,7 @@ class Header
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Footer\PreserveText * @return \PhpOffice\PhpWord\Section\Footer\PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -214,7 +213,7 @@ class Header
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Image * @return \PhpOffice\PhpWord\Section\Image
*/ */
public function addWatermark($src, $style = null) public function addWatermark($src, $style = null)
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -42,7 +40,7 @@ class Image
/** /**
* Image Style * Image Style
* *
* @var PhpOffice\PhpWord\Style\Image * @var \PhpOffice\PhpWord\Style\Image
*/ */
private $_style; private $_style;
@ -67,11 +65,12 @@ class Image
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @param bool $isWatermark * @param bool $isWatermark
* @throws InvalidImageException|UnsupportedImageTypeException * @throws \PhpOffice\PhpWord\Exceptions\InvalidImageException
* @throws \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
*/ */
public function __construct($src, $style = null, $isWatermark = false) public function __construct($src, $style = null, $isWatermark = false)
{ {
$supportedImageTypes = array(IMAGETYPE_JPEG, IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM); $supportedImageTypes = array(\IMAGETYPE_JPEG, \IMAGETYPE_GIF, \IMAGETYPE_PNG, \IMAGETYPE_BMP, \IMAGETYPE_TIFF_II, \IMAGETYPE_TIFF_MM);
if (!file_exists($src)) { if (!file_exists($src)) {
throw new InvalidImageException; throw new InvalidImageException;
@ -83,7 +82,7 @@ class Image
$this->_src = $src; $this->_src = $src;
$this->_isWatermark = $isWatermark; $this->_isWatermark = $isWatermark;
$this->_style = new PhpOffice\PhpWord\Style\Image(); $this->_style = new \PhpOffice\PhpWord\Style\Image();
if (!is_null($style) && is_array($style)) { if (!is_null($style) && is_array($style)) {
foreach ($style as $key => $value) { foreach ($style as $key => $value) {
@ -108,7 +107,7 @@ class Image
/** /**
* Get Image style * Get Image style
* *
* @return PhpOffice\PhpWord\Style\Image * @return \PhpOffice\PhpWord\Style\Image
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -56,14 +54,14 @@ class Link
/** /**
* Link style * Link style
* *
* @var PhpOffice\PhpWord\Style\Font * @var \PhpOffice\PhpWord\Style\Font
*/ */
private $_styleFont; private $_styleFont;
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Paragraph * @var \PhpOffice\PhpWord\Style\Paragraph
*/ */
private $_styleParagraph; private $_styleParagraph;
@ -155,7 +153,7 @@ class Link
/** /**
* Get Text style * Get Text style
* *
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function getFontStyle() public function getFontStyle()
{ {
@ -165,7 +163,7 @@ class Link
/** /**
* Get Paragraph style * Get Paragraph style
* *
* @return PhpOffice\PhpWord\Style\Paragraph * @return \PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -32,14 +30,14 @@ class ListItem
/** /**
* ListItem Style * ListItem Style
* *
* @var PhpOffice\PhpWord\Style\ListItem * @var \PhpOffice\PhpWord\Style\ListItem
*/ */
private $_style; private $_style;
/** /**
* Textrun * Textrun
* *
* @var PhpOffice\PhpWord\Section\Text * @var \PhpOffice\PhpWord\Section\Text
*/ */
private $_textObject; private $_textObject;
@ -61,7 +59,7 @@ class ListItem
*/ */
public function __construct($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) public function __construct($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null)
{ {
$this->_style = new PhpOffice\PhpWord\Style\ListItem(); $this->_style = new \PhpOffice\PhpWord\Style\ListItem();
$this->_textObject = new Text($text, $styleFont, $styleParagraph); $this->_textObject = new Text($text, $styleFont, $styleParagraph);
$this->_depth = $depth; $this->_depth = $depth;

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -41,7 +39,7 @@ class MemoryImage
/** /**
* Image Style * Image Style
* *
* @var PhpOffice\PhpWord\Style\Image * @var \PhpOffice\PhpWord\Style\Image
*/ */
private $_style; private $_style;
@ -144,7 +142,7 @@ class MemoryImage
/** /**
* Get Image style * Get Image style
* *
* @return PhpOffice\PhpWord\Style\Image * @return \PhpOffice\PhpWord\Style\Image
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -41,7 +39,7 @@ class Object
/** /**
* Image Style * Image Style
* *
* @var PhpOffice\PhpWord\Style\Image * @var \PhpOffice\PhpWord\Style\Image
*/ */
private $_style; private $_style;
@ -100,7 +98,7 @@ class Object
/** /**
* Get Image style * Get Image style
* *
* @return PhpOffice\PhpWord\Style\Image * @return \PhpOffice\PhpWord\Style\Image
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -29,9 +27,6 @@ namespace PhpOffice\PhpWord\Section;
class PageBreak class PageBreak
{ {
/**
* Create a new PageBreak Element
*/
public function __construct() public function __construct()
{ {
} }

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -34,7 +32,7 @@ class Table
/** /**
* Table style * Table style
* *
* @var PhpOffice\PhpWord\Style\Table * @var \PhpOffice\PhpWord\Style\Table
*/ */
private $_style; private $_style;
@ -81,7 +79,7 @@ class Table
if (!is_null($style)) { if (!is_null($style)) {
if (is_array($style)) { if (is_array($style)) {
$this->_style = new PhpOffice\PhpWord\Style\Table(); $this->_style = new \PhpOffice\PhpWord\Style\Table();
foreach ($style as $key => $value) { foreach ($style as $key => $value) {
if (substr($key, 0, 1) != '_') { if (substr($key, 0, 1) != '_') {
@ -112,7 +110,7 @@ class Table
* *
* @param int $width * @param int $width
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Table\Cell * @return \PhpOffice\PhpWord\Section\Table\Cell
*/ */
public function addCell($width = null, $style = null) public function addCell($width = null, $style = null)
{ {
@ -134,7 +132,7 @@ class Table
/** /**
* Get table style * Get table style
* *
* @return PhpOffice\PhpWord\Style\Table * @return \PhpOffice\PhpWord\Style\Table
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,6 +25,7 @@
namespace PhpOffice\PhpWord\Section\Table; namespace PhpOffice\PhpWord\Section\Table;
use PhpOffice\PhpWord\Exceptions\Exception;
use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Section\Footer\PreserveText; use PhpOffice\PhpWord\Section\Footer\PreserveText;
use PhpOffice\PhpWord\Section\Image; use PhpOffice\PhpWord\Section\Image;
@ -51,7 +50,7 @@ class Cell
/** /**
* Cell Style * Cell Style
* *
* @var PhpOffice\PhpWord\Style\Cell * @var \PhpOffice\PhpWord\Style\Cell
*/ */
private $_style; private $_style;
@ -90,7 +89,7 @@ class Cell
$this->_insideOf = $insideOf; $this->_insideOf = $insideOf;
$this->_pCount = $pCount; $this->_pCount = $pCount;
$this->_width = $width; $this->_width = $width;
$this->_style = new PhpOffice\PhpWord\Style\Cell(); $this->_style = new \PhpOffice\PhpWord\Style\Cell();
if (!is_null($style)) { if (!is_null($style)) {
if (is_array($style)) { if (is_array($style)) {
@ -111,7 +110,7 @@ class Cell
* *
* @param string $text * @param string $text
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) public function addText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -129,7 +128,7 @@ class Cell
* @param string $linkSrc * @param string $linkSrc
* @param string $linkName * @param string $linkName
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Link * @return \PhpOffice\PhpWord\Section\Link
*/ */
public function addLink($linkSrc, $linkName = null, $style = null) public function addLink($linkSrc, $linkName = null, $style = null)
{ {
@ -159,8 +158,8 @@ class Cell
* Add TextBreak * Add TextBreak
* *
* @param int $count * @param int $count
* @param null|string|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null) public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{ {
@ -176,7 +175,7 @@ class Cell
* @param int $depth * @param int $depth
* @param mixed $styleText * @param mixed $styleText
* @param mixed $styleList * @param mixed $styleList
* @return PhpOffice\PhpWord\Section\ListItem * @return \PhpOffice\PhpWord\Section\ListItem
*/ */
public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) public function addListItem($text, $depth = 0, $styleText = null, $styleList = null)
{ {
@ -193,7 +192,7 @@ class Cell
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Image * @return \PhpOffice\PhpWord\Section\Image
*/ */
public function addImage($src, $style = null) public function addImage($src, $style = null)
{ {
@ -221,7 +220,7 @@ class Cell
* *
* @param string $link * @param string $link
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\MemoryImage * @return \PhpOffice\PhpWord\Section\MemoryImage
*/ */
public function addMemoryImage($link, $style = null) public function addMemoryImage($link, $style = null)
{ {
@ -248,7 +247,7 @@ class Cell
* *
* @param string $src * @param string $src
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Object * @return \PhpOffice\PhpWord\Section\Object
*/ */
public function addObject($src, $style = null) public function addObject($src, $style = null)
{ {
@ -290,7 +289,7 @@ class Cell
* @param string $text * @param string $text
* @param mixed $styleFont * @param mixed $styleFont
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PhpOffice\PhpWord\Section\Footer\PreserveText * @return \PhpOffice\PhpWord\Section\Footer\PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{ {
@ -309,7 +308,7 @@ class Cell
/** /**
* Create a new TextRun * Create a new TextRun
* *
* @return PhpOffice\PhpWord\Section\TextRun * @return \PhpOffice\PhpWord\Section\TextRun
*/ */
public function createTextRun($styleParagraph = null) public function createTextRun($styleParagraph = null)
{ {
@ -331,7 +330,7 @@ class Cell
/** /**
* Get Cell Style * Get Cell Style
* *
* @return PhpOffice\PhpWord\Style\Cell * @return \PhpOffice\PhpWord\Style\Cell
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2013 PhpWord * @copyright Copyright (c) 2013 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -39,7 +37,7 @@ class Row
/** /**
* Row style * Row style
* *
* @var PhpOffice\PhpWord\Style\Row * @var \PhpOffice\PhpWord\Style\Row
*/ */
private $_style; private $_style;
@ -78,7 +76,7 @@ class Row
$this->_insideOf = $insideOf; $this->_insideOf = $insideOf;
$this->_pCount = $pCount; $this->_pCount = $pCount;
$this->_height = $height; $this->_height = $height;
$this->_style = new PhpOffice\PhpWord\Style\Row(); $this->_style = new \PhpOffice\PhpWord\Style\Row();
if (!is_null($style)) { if (!is_null($style)) {
if (is_array($style)) { if (is_array($style)) {
@ -98,7 +96,7 @@ class Row
* *
* @param int $width * @param int $width
* @param mixed $style * @param mixed $style
* @return PhpOffice\PhpWord\Section\Table\Cell * @return \PhpOffice\PhpWord\Section\Table\Cell
*/ */
public function addCell($width = null, $style = null) public function addCell($width = null, $style = null)
{ {
@ -120,7 +118,7 @@ class Row
/** /**
* Get row style * Get row style
* *
* @return PhpOffice\PhpWord\Style\Row * @return \PhpOffice\PhpWord\Style\Row
*/ */
public function getStyle() public function getStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -42,14 +40,14 @@ class Text
/** /**
* Text style * Text style
* *
* @var PhpOffice\PhpWord\Style\Font * @var \PhpOffice\PhpWord\Style\Font
*/ */
private $fontStyle; private $fontStyle;
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Paragraph * @var \PhpOffice\PhpWord\Style\Paragraph
*/ */
private $paragraphStyle; private $paragraphStyle;
@ -57,8 +55,8 @@ class Text
* Create a new Text Element * Create a new Text Element
* *
* @param string $text * @param string $text
* @param null|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function __construct($text = null, $fontStyle = null, $paragraphStyle = null) public function __construct($text = null, $fontStyle = null, $paragraphStyle = null)
{ {
@ -70,9 +68,9 @@ class Text
/** /**
* Set Text style * Set Text style
* *
* @param null|array|PhpOffice\PhpWord\Style\Font $style * @param null|array|\PhpOffice\PhpWord\Style\Font $style
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function setFontStyle($style = null, $paragraphStyle = null) public function setFontStyle($style = null, $paragraphStyle = null)
{ {
@ -94,7 +92,7 @@ class Text
/** /**
* Get Text style * Get Text style
* *
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function getFontStyle() public function getFontStyle()
{ {
@ -104,8 +102,8 @@ class Text
/** /**
* Set Paragraph style * Set Paragraph style
* *
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $style * @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
* @return null|PhpOffice\PhpWord\Style\Paragraph * @return null|\PhpOffice\PhpWord\Style\Paragraph
*/ */
public function setParagraphStyle($style = null) public function setParagraphStyle($style = null)
{ {
@ -125,7 +123,7 @@ class Text
/** /**
* Get Paragraph style * Get Paragraph style
* *
* @return PhpOffice\PhpWord\Style\Paragraph * @return \PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -35,14 +33,14 @@ class TextBreak
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Pagaraph * @var \PhpOffice\PhpWord\Style\Pagaraph
*/ */
private $paragraphStyle = null; private $paragraphStyle = null;
/** /**
* Text style * Text style
* *
* @var PhpOffice\PhpWord\Style\Font * @var \PhpOffice\PhpWord\Style\Font
*/ */
private $fontStyle = null; private $fontStyle = null;
@ -62,9 +60,9 @@ class TextBreak
/** /**
* Set Text style * Set Text style
* *
* @param null|array|PhpOffice\PhpWord\Style\Font $style * @param null|array|\PhpOffice\PhpWord\Style\Font $style
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function setFontStyle($style = null, $paragraphStyle = null) public function setFontStyle($style = null, $paragraphStyle = null)
{ {
@ -84,7 +82,7 @@ class TextBreak
/** /**
* Get Text style * Get Text style
* *
* @return PhpOffice\PhpWord\Style\Font * @return \PhpOffice\PhpWord\Style\Font
*/ */
public function getFontStyle() public function getFontStyle()
{ {
@ -94,8 +92,8 @@ class TextBreak
/** /**
* Set Paragraph style * Set Paragraph style
* *
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $style * @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
* @return null|PhpOffice\PhpWord\Style\Paragraph * @return null|\PhpOffice\PhpWord\Style\Paragraph
*/ */
public function setParagraphStyle($style = null) public function setParagraphStyle($style = null)
{ {
@ -113,7 +111,7 @@ class TextBreak
/** /**
* Get Paragraph style * Get Paragraph style
* *
* @return PhpOffice\PhpWord\Style\Paragraph * @return \PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -27,6 +25,7 @@
namespace PhpOffice\PhpWord\Section; namespace PhpOffice\PhpWord\Section;
use PhpOffice\PhpWord\Exceptions\Exception;
use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Shared\String; use PhpOffice\PhpWord\Shared\String;
use PhpOffice\PhpWord\Style\Paragraph; use PhpOffice\PhpWord\Style\Paragraph;
@ -36,7 +35,7 @@ class TextRun
/** /**
* Paragraph style * Paragraph style
* *
* @var PhpOffice\PhpWord\Style\Paragraph * @var \PhpOffice\PhpWord\Style\Paragraph
*/ */
private $_styleParagraph; private $_styleParagraph;
@ -76,7 +75,7 @@ class TextRun
* *
* @var string $text * @var string $text
* @var mixed $styleFont * @var mixed $styleFont
* @return PhpOffice\PhpWord\Section\Text * @return \PhpOffice\PhpWord\Section\Text
*/ */
public function addText($text = null, $styleFont = null) public function addText($text = null, $styleFont = null)
{ {
@ -94,7 +93,7 @@ class TextRun
* @param string $linkSrc * @param string $linkSrc
* @param string $linkName * @param string $linkName
* @param mixed $styleFont * @param mixed $styleFont
* @return PhpOffice\PhpWord\Section\Link * @return \PhpOffice\PhpWord\Section\Link
*/ */
public function addLink($linkSrc, $linkName = null, $styleFont = null) public function addLink($linkSrc, $linkName = null, $styleFont = null)
{ {
@ -116,7 +115,7 @@ class TextRun
* *
* @param string $imageSrc * @param string $imageSrc
* @param mixed $styleFont * @param mixed $styleFont
* @return PhpOffice\PhpWord\Section\Image * @return \PhpOffice\PhpWord\Section\Image
*/ */
public function addImage($imageSrc, $style = null) public function addImage($imageSrc, $style = null)
{ {
@ -137,8 +136,8 @@ class TextRun
* Add TextBreak * Add TextBreak
* *
* @param int $count * @param int $count
* @param null|string|array|PhpOffice\PhpWord\Style\Font $fontStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle * @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
*/ */
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null) public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{ {
@ -151,12 +150,12 @@ class TextRun
* Create a new Footnote Element * Create a new Footnote Element
* *
* @param string $text * @param string $text
* @return PhpOffice\PhpWord\Section\Footnote * @return \PhpOffice\PhpWord\Section\Footnote
*/ */
public function createFootnote($styleParagraph = null) public function createFootnote($styleParagraph = null)
{ {
$footnote = new PhpOffice\PhpWord\Section\Footnote($styleParagraph); $footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph);
$refID = PhpOffice\PhpWord\Footnote::addFootnoteElement($footnote); $refID = \PhpOffice\PhpWord\Footnote::addFootnoteElement($footnote);
$footnote->setReferenceId($refID); $footnote->setReferenceId($refID);
$this->_elementCollection[] = $footnote; $this->_elementCollection[] = $footnote;
return $footnote; return $footnote;
@ -175,7 +174,7 @@ class TextRun
/** /**
* Get Paragraph style * Get Paragraph style
* *
* @return PhpOffice\PhpWord\Style\Paragraph * @return \PhpOffice\PhpWord\Style\Paragraph
*/ */
public function getParagraphStyle() public function getParagraphStyle()
{ {

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -32,7 +30,7 @@ class File
/** /**
* Verify if a file exists * Verify if a file exists
* *
* @param string $pFilename Filename * @param string $pFilename Filename
* @return bool * @return bool
*/ */
public static function file_exists($pFilename) public static function file_exists($pFilename)

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0

View File

@ -18,8 +18,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PhpWord
* @package PhpWord
* @copyright Copyright (c) 2014 PhpWord * @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0 * @version 0.8.0
@ -47,7 +45,7 @@ class XMLWriter
/** /**
* Internal XMLWriter * Internal XMLWriter
* *
* @var XMLWriter * @var \XMLWriter
*/ */
private $_xmlWriter; private $_xmlWriter;
@ -59,15 +57,13 @@ class XMLWriter
private $_tempFileName = ''; private $_tempFileName = '';
/** /**
* Create a new XMLWriter instance
*
* @param int $pTemporaryStorage Temporary storage location * @param int $pTemporaryStorage Temporary storage location
* @param string $pTemporaryStorageFolder Temporary storage folder * @param string $pTemporaryStorageFolder Temporary storage folder
*/ */
public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './') public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './')
{ {
// Create internal XMLWriter // Create internal XMLWriter
$this->_xmlWriter = new XMLWriter(); $this->_xmlWriter = new \XMLWriter();
// Open temporary storage // Open temporary storage
if ($pTemporaryStorage == self::STORAGE_MEMORY) { if ($pTemporaryStorage == self::STORAGE_MEMORY) {
@ -133,7 +129,7 @@ class XMLWriter
{ {
try { try {
@call_user_func_array(array($this->_xmlWriter, $function), $args); @call_user_func_array(array($this->_xmlWriter, $function), $args);
} catch (Exception $ex) { } catch (\Exception $ex) {
// Do nothing! // Do nothing!
} }
} }

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