https://github.com/PHPOffice/PHPWord/issues/58 - More fixes.
This commit is contained in:
parent
7e23484619
commit
ddb6277764
10
README.md
10
README.md
|
|
@ -103,7 +103,7 @@ $section->addText('Hello world! I am formatted by a user defined style',
|
|||
'myOwnStyle');
|
||||
|
||||
// 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->setName('Verdana');
|
||||
$fontStyle->setSize(22);
|
||||
|
|
@ -111,7 +111,7 @@ $myTextElement = $section->addText('Hello World!');
|
|||
$myTextElement->setFontStyle($fontStyle);
|
||||
|
||||
// Finally, write the document:
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
|
||||
$xmlWriter->save('helloWorld.docx');
|
||||
```
|
||||
|
||||
|
|
@ -125,15 +125,15 @@ You can use PhpWord helper functions to convert inches, centimeters, or points t
|
|||
```php
|
||||
// Paragraph with 6 points space after
|
||||
$phpWord->addParagraphStyle('My Style', array(
|
||||
'spaceAfter' => PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6))
|
||||
'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6))
|
||||
);
|
||||
|
||||
$section = $phpWord->createSection();
|
||||
$sectionStyle = $section->getSettings();
|
||||
// half inch left margin
|
||||
$sectionStyle->setMarginLeft(PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
|
||||
$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
|
||||
// 2 cm right margin
|
||||
$sectionStyle->setMarginRight(PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
|
||||
$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
|
||||
```
|
||||
|
||||
<a name="sections"></a>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests;
|
|||
use PhpOffice\PhpWord\DocumentProperties;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\DocumentProperties
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\DocumentProperties
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class DocumentPropertiesTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\Exception;
|
|||
class ExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @covers PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @covers \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function testThrowException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\InvalidImageException;
|
|||
class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @covers PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @covers \PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
*/
|
||||
public function testThrowException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\InvalidStyleException;
|
|||
class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidStyleException
|
||||
* @covers PhpOffice\PhpWord\Exceptions\InvalidStyleException
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException
|
||||
* @covers \PhpOffice\PhpWord\Exceptions\InvalidStyleException
|
||||
*/
|
||||
public function testThrowException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException;
|
|||
class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
|
||||
* @covers PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
|
||||
* @covers \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
|
||||
*/
|
||||
public function testThrowException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpOffice\PhpWord\IOFactory;
|
||||
|
||||
/**
|
||||
* @@coversDefaultClass PhpOffice\PhpWord\IOFactory
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\IOFactory
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
final class IOFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -24,7 +23,7 @@ final class IOFactoryTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::createWriter
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage Could not instantiate "Word2006" class.
|
||||
*/
|
||||
final public function testNonexistentWriterCanNotBeCreated()
|
||||
|
|
@ -45,7 +44,7 @@ final class IOFactoryTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::createReader
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage Could not instantiate "Word2006" class.
|
||||
*/
|
||||
final public function testNonexistentReaderCanNotBeCreated()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase
|
|||
/**
|
||||
* Todo: add memory image to this test
|
||||
*
|
||||
* @covers PhpOffice\PhpWord\Media::addSectionMediaElement
|
||||
* @covers \PhpOffice\PhpWord\Media::addSectionMediaElement
|
||||
*/
|
||||
public function testAddSectionMediaElement()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,14 +4,8 @@ namespace PhpWord\Tests\Reader;
|
|||
use PhpOffice\PhpWord\Reader\Word2007;
|
||||
use PhpOffice\PhpWord\IOFactory;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
*/
|
||||
class Word2007Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var Test file directory */
|
||||
private $dir;
|
||||
|
||||
/**
|
||||
* Init
|
||||
*/
|
||||
|
|
@ -25,27 +19,25 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
|||
public function testCanRead()
|
||||
{
|
||||
$dir = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
|
||||
);
|
||||
$object = new Word2007;
|
||||
$file = $dir . DIRECTORY_SEPARATOR . 'reader.docx';
|
||||
$file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
|
||||
$this->assertTrue($object->canRead($file));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test canRead() failure
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function testCanReadFailed()
|
||||
{
|
||||
$dir = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
|
||||
);
|
||||
$object = new Word2007;
|
||||
$file = $dir . DIRECTORY_SEPARATOR . 'foo.docx';
|
||||
$file = $dir . \DIRECTORY_SEPARATOR . 'foo.docx';
|
||||
$this->assertFalse($object->canRead($file));
|
||||
$object = IOFactory::load($file);
|
||||
}
|
||||
|
|
@ -56,10 +48,10 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
|||
public function testLoad()
|
||||
{
|
||||
$dir = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents')
|
||||
);
|
||||
$file = $dir . DIRECTORY_SEPARATOR . 'reader.docx';
|
||||
$file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
|
||||
$object = IOFactory::load($file);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace PhpWord\Tests\Section;
|
|||
use PhpOffice\PhpWord\Section\Image;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Section\Image
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
class ImageTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
|
|||
$oImage = new Image(
|
||||
$src,
|
||||
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());
|
||||
|
|
@ -52,7 +52,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @covers ::__construct
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public function testInvalidImageTypes()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class ListItemTest extends \PHPUnit_Framework_TestCase
|
|||
'text',
|
||||
1,
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ use PhpOffice\PhpWord\Style\Font;
|
|||
use PhpOffice\PhpWord\Style\Paragraph;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Section\TextBreak
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Section\TextBreak
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TextBreakTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests;
|
|||
use PhpOffice\PhpWord\Section;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Section
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Section
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class SectionTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -75,11 +74,11 @@ class SectionTest extends \PHPUnit_Framework_TestCase
|
|||
public function testAddElements()
|
||||
{
|
||||
$objectSource = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls')
|
||||
);
|
||||
$imageSource = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'PhpWord.png')
|
||||
);
|
||||
$imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif';
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests;
|
|||
use PhpOffice\PhpWord\Settings;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Settings
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Settings
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class SettingsTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Shared;
|
|||
use PhpOffice\PhpWord\Shared\Drawing;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class DrawingTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests\Shared;
|
|||
use PhpOffice\PhpWord\Shared\File;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Shared\File
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Shared\File
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class FileTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -15,7 +14,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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);
|
||||
$this->assertTrue(File::file_exists('blank.docx'));
|
||||
}
|
||||
|
|
@ -24,7 +23,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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);
|
||||
$this->assertFalse(File::file_exists('404.docx'));
|
||||
}
|
||||
|
|
@ -34,10 +33,10 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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);
|
||||
$file = 'blank.docx';
|
||||
$expected = $dir . DIRECTORY_SEPARATOR . $file;
|
||||
$expected = $dir . \DIRECTORY_SEPARATOR . $file;
|
||||
$this->assertEquals($expected, File::realpath($file));
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpOffice\PhpWord\Shared\Font;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class FontTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests\Shared;
|
|||
use PhpOffice\PhpWord\Shared\String;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Shared\String
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Shared\String
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class StringTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\Cell;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class CellTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use PhpOffice\PhpWord\Style\Font;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class FontTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\Image;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class ImageTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -56,7 +55,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
|
|||
/**
|
||||
* Test setWrappingStyle exception
|
||||
*
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testSetWrappingStyleException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\ListItem;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class ListItemTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use PhpOffice\PhpWord\Style\Tab;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class ParagraphTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\Row;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class RowTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\TOC;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Style\TOC
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Style\TOC
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TOCTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -18,9 +17,9 @@ class TOCTest extends \PHPUnit_Framework_TestCase
|
|||
$object = new TOC();
|
||||
|
||||
$properties = array(
|
||||
'tabPos' => 9062,
|
||||
'tabPos' => 9062,
|
||||
'tabLeader' => TOC::TABLEADER_DOT,
|
||||
'indent' => 200,
|
||||
'indent' => 200,
|
||||
);
|
||||
foreach ($properties as $key => $value) {
|
||||
// set/get
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\TableFull;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TableFullTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace PhpWord\Tests\Style;
|
|||
use PhpOffice\PhpWord\Style\Table;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TableTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use PhpOffice\PhpWord\Style\Tab;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TabsTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests;
|
|||
use PhpOffice\PhpWord\Style;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Style
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Style
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class StyleTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ namespace PhpWord\Tests;
|
|||
use PhpOffice\PhpWord\TOC;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\TOC
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\TOC
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TOCTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -18,14 +17,11 @@ class TOCTest extends \PHPUnit_Framework_TestCase
|
|||
public function testConstruct()
|
||||
{
|
||||
$expected = array(
|
||||
'tabPos' => 9062,
|
||||
'tabLeader' => PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
|
||||
'indent' => 200,
|
||||
);
|
||||
$object = new TOC(
|
||||
array('size' => 11),
|
||||
array('tabPos' => $expected['tabPos'])
|
||||
'tabPos' => 9062,
|
||||
'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
|
||||
'indent' => 200,
|
||||
);
|
||||
$object = new TOC(array('size' => 11), array('tabPos' => $expected['tabPos']));
|
||||
$tocStyle = $object->getStyleTOC();
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpOffice\PhpWord\Template;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Template
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Template
|
||||
*/
|
||||
final class TemplateTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
|
@ -87,7 +87,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::applyXslStyleSheet
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage Could not set values for the given XSL style sheet parameters.
|
||||
* @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.
|
||||
*/
|
||||
@$template->applyXslStyleSheet($xslDOMDocument, array(1 => 'somevalue'));
|
||||
|
|
@ -117,7 +117,7 @@ final class TemplateTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::applyXslStyleSheet
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage Could not load XML from the given template.
|
||||
* @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.
|
||||
*/
|
||||
@$template->applyXslStyleSheet($xslDOMDocument);
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Writer\ODText\Content
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Writer\ODText\Content
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class ContentTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpOffice\PhpWord\Writer\ODText;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Writer\ODText
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Writer\ODText
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class ODTextTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -36,7 +35,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::getPhpWord
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage No PhpWord assigned.
|
||||
*/
|
||||
public function testConstructWithNull()
|
||||
|
|
@ -104,7 +103,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::save
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage PhpWord object unassigned.
|
||||
*/
|
||||
public function testSaveException()
|
||||
|
|
@ -136,7 +135,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::setUseDiskCaching
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function testSetUseDiskCachingException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpOffice\PhpWord\Writer\RTF;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Writer\RTF
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Writer\RTF
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class RTFTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -24,7 +23,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* covers ::__construct
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage No PhpWord assigned.
|
||||
*/
|
||||
public function testConstructWithNull()
|
||||
|
|
@ -48,7 +47,7 @@ class RTFTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::save
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedExceptionMessage PhpWord object unassigned.
|
||||
*/
|
||||
public function testSaveException()
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Writer\Word2007\Base
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Writer\Word2007\Base
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -48,7 +47,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
|||
$pStyle = 'pStyle';
|
||||
$aStyle = array('align' => 'justify', 'spaceBefore' => 120, 'spaceAfter' => 120);
|
||||
$imageSrc = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg')
|
||||
);
|
||||
|
||||
|
|
@ -321,7 +320,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
|||
public function testWriteWatermark()
|
||||
{
|
||||
$imageSrc = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'images', 'earth.jpg')
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class DocumentTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -40,7 +39,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
|
|||
public function testElements()
|
||||
{
|
||||
$objectSrc = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
array(\PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'sheet.xls')
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class FootnotesTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ use PhpOffice\PhpWord\PhpWord;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class StylesTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ use PhpOffice\PhpWord\Writer\Word2007;
|
|||
use PhpWord\Tests\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord\Writer\Word2007
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Writer\Word2007
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class Word2007Test extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -118,7 +117,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::setUseDiskCaching
|
||||
* @expectedException Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function testSetUseDiskCachingException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ use PhpOffice\PhpWord\Section;
|
|||
use PhpOffice\PhpWord\Style;
|
||||
|
||||
/**
|
||||
* @package PhpWord\Tests
|
||||
* @coversDefaultClass PhpOffice\PhpWord
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\PhpWord
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class PhpWordTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -144,7 +143,7 @@ class PhpWordTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
/**
|
||||
* @covers ::loadTemplate
|
||||
* @expectedException PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function testLoadTemplateException()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ class TestHelperDOCX
|
|||
static protected $file;
|
||||
|
||||
/**
|
||||
* @param PhpOffice\PhpWord $phpWord
|
||||
* @return PhpWord\Tests\XmlDocument
|
||||
* @param \PhpOffice\PhpWord\PhpWord $phpWord
|
||||
* @return \PhpWord\Tests\XmlDocument
|
||||
*/
|
||||
public static function getDocument(PhpWord $phpWord, $writerName = 'Word2007')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
namespace PhpWord\Tests;
|
||||
|
||||
use DOMDocument;
|
||||
|
||||
class XmlDocument
|
||||
{
|
||||
/** @var string $path */
|
||||
|
|
@ -39,7 +37,7 @@ class XmlDocument
|
|||
$this->file = $file;
|
||||
|
||||
$file = $this->path . '/' . $file;
|
||||
$this->dom = new DOMDocument();
|
||||
$this->dom = new \DOMDocument();
|
||||
$this->dom->load($file);
|
||||
return $this->dom;
|
||||
}
|
||||
|
|
@ -112,4 +110,4 @@ class XmlDocument
|
|||
$nodeList = $this->getNodeList($path, $file);
|
||||
return !($nodeList->length == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ if (!\defined('PHPWORD_TESTS_BASE_DIR')) {
|
|||
|
||||
// loading classes with PSR-4 autoloader
|
||||
require_once __DIR__ . '/../src/Autoloader.php';
|
||||
PhpOffice\PhpWord\Autoloader::register();
|
||||
\PhpOffice\PhpWord\Autoloader::register();
|
||||
|
||||
require_once __DIR__ . '/_inc/TestHelperDOCX.php';
|
||||
require_once __DIR__ . '/_inc/XmlDocument.php';
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
$phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16));
|
||||
$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100));
|
||||
$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');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
@ -1,29 +1,29 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Ads styles
|
||||
$phpWord->addParagraphStyle('multipleTab', array(
|
||||
'tabs' => array(
|
||||
new PhpOffice\PhpWord\Style\Tab('left', 1550),
|
||||
new PhpOffice\PhpWord\Style\Tab('center', 3200),
|
||||
new PhpOffice\PhpWord\Style\Tab('right', 5300)
|
||||
new \PhpOffice\PhpWord\Style\Tab('left', 1550),
|
||||
new \PhpOffice\PhpWord\Style\Tab('center', 3200),
|
||||
new \PhpOffice\PhpWord\Style\Tab('right', 5300)
|
||||
)
|
||||
));
|
||||
$phpWord->addParagraphStyle('rightTab', array(
|
||||
'tabs' => array(
|
||||
new PhpOffice\PhpWord\Style\Tab('right', 9090)
|
||||
new \PhpOffice\PhpWord\Style\Tab('right', 9090)
|
||||
)
|
||||
));
|
||||
$phpWord->addParagraphStyle('centerTab', 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');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// New portrait section
|
||||
$section = $phpWord->createSection(array('borderColor' => '00FF00', 'borderSize' => 12));
|
||||
|
|
@ -32,12 +32,12 @@ $section->createFooter()->addText('Footer');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Ads styles
|
||||
$phpWord->addParagraphStyle('pStyle', array('spacing'=>100));
|
||||
$phpWord->addFontStyle('BoldText', array('bold'=>true));
|
||||
$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
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -38,12 +38,12 @@ $textrun->addText(' Here is some more text. ');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
$filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' .
|
||||
'Nulla fermentum, tortor id adipiscing adipiscing, tortor turpis commodo. ' .
|
||||
'Donec vulputate iaculis metus, vel luctus dolor hendrerit ac. ' .
|
||||
|
|
@ -42,12 +42,12 @@ $section->addText('Normal paragraph again.');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// New portrait section
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -15,7 +15,7 @@ $section = $phpWord->createSection();
|
|||
$phpWord->addParagraphStyle('pStyle', array('spacing'=>100));
|
||||
$phpWord->addFontStyle('BoldText', array('bold'=>true));
|
||||
$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
|
||||
$textrun = $section->createTextRun('pStyle');
|
||||
|
|
@ -40,12 +40,12 @@ $footnote->addText('The reference for this is wrapped in its own line');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
$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');
|
||||
|
||||
$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);
|
||||
rename($name, "results/{$name}");
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
$phpWord->setDefaultParagraphStyle(array(
|
||||
'align' => 'both',
|
||||
'spaceAfter' => PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(12),
|
||||
'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(12),
|
||||
'spacing' => 120,
|
||||
));
|
||||
|
||||
|
|
@ -52,12 +52,12 @@ $section->addText('Paragraph with pageBreakBefore = true (default: false). ' .
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
$section = $phpWord->createSection();
|
||||
$header = array('size' => 16, 'bold' => true);
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ $section->addText("Fancy table", $header);
|
|||
$styleTable = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80);
|
||||
$styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF');
|
||||
$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');
|
||||
$phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow);
|
||||
$table = $section->addTable('Fancy Table');
|
||||
|
|
@ -80,12 +80,12 @@ $table->addCell(null, $cellRowContinue);
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word Document
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , ' Create new PhpWord object' , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
$section = $phpWord->createSection();
|
||||
$header = array('size' => 16, 'bold' => true);
|
||||
//1.Use EastAisa FontStyle
|
||||
|
|
@ -16,12 +16,12 @@ $section->addText('中文楷体样式测试',array('name' => '楷体', 'size' =>
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// Read contents
|
||||
$name = basename(__FILE__, '.php');
|
||||
$source = "resources/{$name}.docx";
|
||||
echo date('H:i:s'), " Reading contents from `{$source}`", EOL;
|
||||
$phpWord = PhpOffice\PhpWord\IOFactory::load($source);
|
||||
echo date('H:i:s'), " Reading contents from `{$source}`", \EOL;
|
||||
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source);
|
||||
|
||||
// (Re)write contents
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s') , " Create new PhpWord object" , EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s') , " Create new PhpWord object" , \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// New portrait section
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -63,12 +63,12 @@ $section2->addText('Some text...');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -31,12 +31,12 @@ $section->addMemoryImage($source);
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -31,7 +31,7 @@ $section->addListItem('List Item 1.3.2', 2);
|
|||
$section->addTextBreak(2);
|
||||
|
||||
// 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 2', 0, null, $listStyle);
|
||||
$section->addListItem('List Item 3', 0, null, $listStyle);
|
||||
|
|
@ -40,7 +40,7 @@ $section->addTextBreak(2);
|
|||
// Add listitem elements
|
||||
$phpWord->addFontStyle('myOwnStyle', array('color'=>'FF0000'));
|
||||
$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 2', 0, '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');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$section = $phpWord->createSection();
|
||||
|
||||
// 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);
|
||||
|
||||
$phpWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000'));
|
||||
|
|
@ -29,12 +29,12 @@ $section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -24,12 +24,12 @@ $section->addObject('resources/_sheet.xls');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$section = $phpWord->createSection();
|
||||
|
|
@ -49,19 +49,19 @@ $section->addTextBreak(2);
|
|||
$section->addTitle('I am a Subtitle of Title 3', 2);
|
||||
$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
|
||||
|
||||
// Save file
|
||||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
|
||||
|
|
@ -25,12 +25,12 @@ $section->addText('The header reference to the current section includes a waterm
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
// Init
|
||||
error_reporting(E_ALL);
|
||||
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
error_reporting(\E_ALL);
|
||||
define('EOL', (\PHP_SAPI == 'cli') ? \PHP_EOL : '<br />');
|
||||
require_once '../src/PhpWord.php';
|
||||
|
||||
// New Word document
|
||||
echo date('H:i:s'), " Create new PhpWord object", EOL;
|
||||
$phpWord = new PhpOffice\PhpWord\PhpWord();
|
||||
echo date('H:i:s'), " Create new PhpWord object", \EOL;
|
||||
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// Begin code
|
||||
$fontStyle = array('size' => 24);
|
||||
|
|
@ -38,12 +38,12 @@ $section->addText('Done.');
|
|||
$name = basename(__FILE__, '.php');
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
|
||||
foreach ($writers as $writer => $extension) {
|
||||
echo date('H:i:s'), " Write to {$writer} format", EOL;
|
||||
$xmlWriter = PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
echo date('H:i:s'), " Write to {$writer} format", \EOL;
|
||||
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
|
||||
$xmlWriter->save("{$name}.{$extension}");
|
||||
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
|
||||
}
|
||||
|
||||
// Done
|
||||
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'), " Done writing file(s)", \EOL;
|
||||
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", \EOL;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -152,8 +150,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Creator
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param string $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCreator($pValue = '')
|
||||
{
|
||||
|
|
@ -174,8 +172,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Last Modified By
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param string $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setLastModifiedBy($pValue = '')
|
||||
{
|
||||
|
|
@ -196,8 +194,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Created
|
||||
*
|
||||
* @param datetime $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param datetime $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCreated($pValue = null)
|
||||
{
|
||||
|
|
@ -221,8 +219,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Modified
|
||||
*
|
||||
* @param datetime $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param datetime $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setModified($pValue = null)
|
||||
{
|
||||
|
|
@ -246,8 +244,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Title
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param string $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setTitle($pValue = '')
|
||||
{
|
||||
|
|
@ -268,8 +266,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Description
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param string $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setDescription($pValue = '')
|
||||
{
|
||||
|
|
@ -290,8 +288,8 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Subject
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @param string $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setSubject($pValue = '')
|
||||
{
|
||||
|
|
@ -313,7 +311,7 @@ class DocumentProperties
|
|||
* Set Keywords
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setKeywords($pValue = '')
|
||||
{
|
||||
|
|
@ -335,7 +333,7 @@ class DocumentProperties
|
|||
* Set Category
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCategory($pValue = '')
|
||||
{
|
||||
|
|
@ -357,7 +355,7 @@ class DocumentProperties
|
|||
* Set Company
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCompany($pValue = '')
|
||||
{
|
||||
|
|
@ -379,7 +377,7 @@ class DocumentProperties
|
|||
* Set Manager
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setManager($pValue = '')
|
||||
{
|
||||
|
|
@ -447,7 +445,7 @@ class DocumentProperties
|
|||
* 's': String
|
||||
* 'd': Date/Time
|
||||
* 'b': Boolean
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
namespace PhpOffice\PhpWord\Exceptions;
|
||||
|
||||
/**
|
||||
* InvalidImageException
|
||||
*
|
||||
* Exception used for when an image is not found
|
||||
*
|
||||
* @package PhpWord
|
||||
*/
|
||||
class InvalidImageException extends Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,11 +4,7 @@ namespace PhpOffice\PhpWord\Exceptions;
|
|||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* InvalidStyleException
|
||||
*
|
||||
* Exception used for when a style value is invalid
|
||||
*
|
||||
* @package PhpWord
|
||||
*/
|
||||
class InvalidStyleException extends InvalidArgumentException
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
namespace PhpOffice\PhpWord\Exceptions;
|
||||
|
||||
/**
|
||||
* UnsupportedImageTypeException
|
||||
*
|
||||
* Exception used for when an image type is unsupported
|
||||
*
|
||||
* @package PhpWord
|
||||
*/
|
||||
class UnsupportedImageTypeException extends Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -51,7 +49,7 @@ class Footnote
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function addFootnoteElement(PhpOffice\PhpWord\Section\Footnote $footnote)
|
||||
public static function addFootnoteElement(\PhpOffice\PhpWord\Section\Footnote $footnote)
|
||||
{
|
||||
$refID = self::countFootnoteElements() + 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,6 +25,8 @@
|
|||
|
||||
namespace PhpOffice\PhpWord;
|
||||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore Legacy from PHPExcel
|
||||
*/
|
||||
|
|
@ -47,8 +47,7 @@ class HashTable
|
|||
public $_keyMap = array();
|
||||
|
||||
/**
|
||||
* @param PhpOffice\PhpWord\IComparable[] $pSource Optional source array to create HashTable from
|
||||
* @throws Exception
|
||||
* @param \PhpOffice\PhpWord\IComparable[] $pSource Optional source array to create HashTable from
|
||||
*/
|
||||
public function __construct($pSource = null)
|
||||
{
|
||||
|
|
@ -60,8 +59,8 @@ class HashTable
|
|||
/**
|
||||
* Add HashTable items from source
|
||||
*
|
||||
* @param PhpOffice\PhpWord\IComparable[] $pSource Source array to create HashTable from
|
||||
* @throws Exception
|
||||
* @param \PhpOffice\PhpWord\IComparable[] $pSource Source array to create HashTable from
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function addFromSource($pSource = null)
|
||||
{
|
||||
|
|
@ -80,8 +79,7 @@ class HashTable
|
|||
/**
|
||||
* Add HashTable item
|
||||
*
|
||||
* @param PhpOffice\PhpWord\IComparable $pSource Item to add
|
||||
* @throws Exception
|
||||
* @param \PhpOffice\PhpWord\IComparable $pSource Item to add
|
||||
*/
|
||||
public function add(IComparable $pSource = null)
|
||||
{
|
||||
|
|
@ -110,8 +108,7 @@ class HashTable
|
|||
/**
|
||||
* Remove HashTable item
|
||||
*
|
||||
* @param PhpOffice\PhpWord\IComparable $pSource Item to remove
|
||||
* @throws Exception
|
||||
* @param \PhpOffice\PhpWord\IComparable $pSource Item to remove
|
||||
*/
|
||||
public function remove(IComparable $pSource = null)
|
||||
{
|
||||
|
|
@ -161,7 +158,7 @@ class HashTable
|
|||
|
||||
/**
|
||||
* @param int $pIndex
|
||||
* @return PhpOffice\PhpWord\IComparable
|
||||
* @return \PhpOffice\PhpWord\IComparable
|
||||
*/
|
||||
public function getByIndex($pIndex = 0)
|
||||
{
|
||||
|
|
@ -174,7 +171,7 @@ class HashTable
|
|||
|
||||
/**
|
||||
* @param string $pHashCode
|
||||
* @return PhpOffice\PhpWord\IComparable
|
||||
* @return \PhpOffice\PhpWord\IComparable
|
||||
*
|
||||
*/
|
||||
public function getByHashCode($pHashCode = '')
|
||||
|
|
@ -187,7 +184,7 @@ class HashTable
|
|||
}
|
||||
|
||||
/**
|
||||
* @return PhpOffice\PhpWord\IComparable[]
|
||||
* @return \PhpOffice\PhpWord\IComparable[]
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,16 +25,15 @@
|
|||
|
||||
namespace PhpOffice\PhpWord;
|
||||
|
||||
use PhpOffice\PhpWord\PhpWord;
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
|
||||
abstract class IOFactory
|
||||
{
|
||||
/**
|
||||
* @param PhpOffice\PhpWord $phpWord
|
||||
* @param \PhpOffice\PhpWord\PhpWord $phpWord
|
||||
* @param string $name
|
||||
* @return PhpOffice\PhpWord\Writer\IWriter
|
||||
* @throws PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @return \PhpOffice\PhpWord\Writer\IWriter
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public static function createWriter(PhpWord $phpWord, $name)
|
||||
{
|
||||
|
|
@ -51,8 +48,8 @@ abstract class IOFactory
|
|||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return PhpOffice\PhpWord\Reader\IReader
|
||||
* @throws PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @return \PhpOffice\PhpWord\Reader\IReader
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public static function createReader($name)
|
||||
{
|
||||
|
|
@ -70,7 +67,7 @@ abstract class IOFactory
|
|||
*
|
||||
* @param string $filename The name of the file
|
||||
* @param string $readerName
|
||||
* @return PhpOffice\PhpWord
|
||||
* @return \PhpOffice\PhpWord
|
||||
*/
|
||||
public static function load($filename, $readerName = 'Word2007')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -37,9 +35,9 @@ class Media
|
|||
* @var array
|
||||
*/
|
||||
private static $_sectionMedia = array(
|
||||
'images' => array(),
|
||||
'images' => array(),
|
||||
'embeddings' => array(),
|
||||
'links' => array()
|
||||
'links' => array()
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -66,9 +64,9 @@ class Media
|
|||
/**
|
||||
* Add new Section Media Element
|
||||
*
|
||||
* @param string $src
|
||||
* @param string $type
|
||||
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @param string $src
|
||||
* @param string $type
|
||||
* @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @return mixed
|
||||
*/
|
||||
public static function addSectionMediaElement($src, $type, MemoryImage $memoryImage = null)
|
||||
|
|
@ -93,7 +91,7 @@ class Media
|
|||
$isMemImage = true;
|
||||
}
|
||||
if (!$isMemImage) {
|
||||
$isMemImage = (filter_var($src, FILTER_VALIDATE_URL) !== false);
|
||||
$isMemImage = (filter_var($src, \FILTER_VALIDATE_URL) !== false);
|
||||
}
|
||||
$extension = '';
|
||||
if ($isMemImage) {
|
||||
|
|
@ -103,15 +101,15 @@ class Media
|
|||
$media['imagefunction'] = $memoryImage->getImageFunction();
|
||||
} else {
|
||||
$imageType = exif_imagetype($src);
|
||||
if ($imageType === IMAGETYPE_JPEG) {
|
||||
if ($imageType === \IMAGETYPE_JPEG) {
|
||||
$extension = 'jpg';
|
||||
} elseif ($imageType === IMAGETYPE_GIF) {
|
||||
} elseif ($imageType === \IMAGETYPE_GIF) {
|
||||
$extension = 'gif';
|
||||
} elseif ($imageType === IMAGETYPE_PNG) {
|
||||
} elseif ($imageType === \IMAGETYPE_PNG) {
|
||||
$extension = 'png';
|
||||
} elseif ($imageType === IMAGETYPE_BMP) {
|
||||
} elseif ($imageType === \IMAGETYPE_BMP) {
|
||||
$extension = 'bmp';
|
||||
} elseif ($imageType === IMAGETYPE_TIFF_II || $imageType === IMAGETYPE_TIFF_MM) {
|
||||
} elseif ($imageType === \IMAGETYPE_TIFF_II || $imageType === \IMAGETYPE_TIFF_MM) {
|
||||
$extension = 'tif';
|
||||
}
|
||||
}
|
||||
|
|
@ -204,9 +202,9 @@ class Media
|
|||
/**
|
||||
* Add new Header Media Element
|
||||
*
|
||||
* @param int $headerCount
|
||||
* @param string $src
|
||||
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @param int $headerCount
|
||||
* @param string $src
|
||||
* @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @return int
|
||||
*/
|
||||
public static function addHeaderMediaElement($headerCount, $src, MemoryImage $memoryImage = null)
|
||||
|
|
@ -276,9 +274,9 @@ class Media
|
|||
/**
|
||||
* Add new Footer Media Element
|
||||
*
|
||||
* @param int $footerCount
|
||||
* @param string $src
|
||||
* @param PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @param int $footerCount
|
||||
* @param string $src
|
||||
* @param \PhpOffice\PhpWord\Section\MemoryImage|null $memoryImage
|
||||
* @return int
|
||||
*/
|
||||
public static function addFooterMediaElement($footerCount, $src, MemoryImage $memoryImage = null)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -37,7 +35,7 @@ use PhpOffice\PhpWord\Template;
|
|||
if (!defined('PHPWORD_BASE_DIR')) {
|
||||
define('PHPWORD_BASE_DIR', \realpath(__DIR__) . \DIRECTORY_SEPARATOR);
|
||||
require \PHPWORD_BASE_DIR . 'Autoloader.php';
|
||||
Autoloader::register();
|
||||
\PhpOffice\PhpWord\Autoloader::register();
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
|
|
@ -55,7 +53,7 @@ class PhpWord
|
|||
const DEFAULT_FONT_SIZE = 10;
|
||||
|
||||
/**
|
||||
* @var PhpOffice\PhpWord\DocumentProperties
|
||||
* @var \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
private $_documentProperties;
|
||||
|
||||
|
|
@ -70,7 +68,7 @@ class PhpWord
|
|||
private $_defaultFontSize;
|
||||
|
||||
/**
|
||||
* @var PhpOffice\PhpWord\Section[]
|
||||
* @var \PhpOffice\PhpWord\Section[]
|
||||
*/
|
||||
private $_sections = array();
|
||||
|
||||
|
|
@ -82,7 +80,7 @@ class PhpWord
|
|||
}
|
||||
|
||||
/**
|
||||
* @return PhpOffice\PhpWord\DocumentProperties
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function getDocumentProperties()
|
||||
{
|
||||
|
|
@ -90,8 +88,8 @@ class PhpWord
|
|||
}
|
||||
|
||||
/**
|
||||
* @param PhpOffice\PhpWord\DocumentProperties $documentProperties
|
||||
* @return PhpOffice\PhpWord
|
||||
* @param \PhpOffice\PhpWord\DocumentProperties $documentProperties
|
||||
* @return \PhpOffice\PhpWord\PhpWord
|
||||
*/
|
||||
public function setDocumentProperties(DocumentProperties $documentProperties)
|
||||
{
|
||||
|
|
@ -101,8 +99,8 @@ class PhpWord
|
|||
}
|
||||
|
||||
/**
|
||||
* @param PhpOffice\PhpWord\Section\Settings $settings
|
||||
* @return PhpOffice\PhpWord\Section
|
||||
* @param \PhpOffice\PhpWord\Section\Settings $settings
|
||||
* @return \PhpOffice\PhpWord\Section
|
||||
*/
|
||||
public function createSection($settings = null)
|
||||
{
|
||||
|
|
@ -210,7 +208,7 @@ class PhpWord
|
|||
}
|
||||
|
||||
/**
|
||||
* @return PhpOffice\PhpWord\Section[]
|
||||
* @return \PhpOffice\PhpWord\Section[]
|
||||
*/
|
||||
public function getSections()
|
||||
{
|
||||
|
|
@ -219,8 +217,8 @@ class PhpWord
|
|||
|
||||
/**
|
||||
* @param string $filename Fully qualified filename.
|
||||
* @return PhpOffice\PhpWord\Template
|
||||
* @throws PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @return \PhpOffice\PhpWord\Template
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function loadTemplate($filename)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -61,7 +59,7 @@ abstract class AbstractReader implements IReader
|
|||
* Set read data only
|
||||
*
|
||||
* @param bool $pValue
|
||||
* @return PhpOffice\PhpWord\Reader\IReader
|
||||
* @return \PhpOffice\PhpWord\Reader\IReader
|
||||
*/
|
||||
public function setReadDataOnly($pValue = true)
|
||||
{
|
||||
|
|
@ -74,7 +72,7 @@ abstract class AbstractReader implements IReader
|
|||
*
|
||||
* @param string $pFilename
|
||||
* @return resource
|
||||
* @throws Exception
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
protected function openFile($pFilename)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -32,8 +30,8 @@ interface IReader
|
|||
/**
|
||||
* Can the current IReader read the file?
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @return boolean
|
||||
* @param string $pFilename
|
||||
* @return boolean
|
||||
*/
|
||||
public function canRead($pFilename);
|
||||
|
||||
|
|
@ -43,4 +41,4 @@ interface IReader
|
|||
* @param string $pFilename
|
||||
*/
|
||||
public function load($pFilename);
|
||||
}
|
||||
}
|
||||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -44,7 +42,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
*
|
||||
* @param string $pFilename
|
||||
* @return bool
|
||||
* @throws PhpOffice\PhpWord\Exceptions\Exception
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function canRead($pFilename)
|
||||
{
|
||||
|
|
@ -78,7 +76,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ZipArchive $archive
|
||||
* @param \ZipArchive $archive
|
||||
* @param string $fileName
|
||||
* @param bool $removeNamespace
|
||||
* @return mixed
|
||||
|
|
@ -109,7 +107,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
* Loads PhpWord from file
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @return PhpOffice\PhpWord|null
|
||||
* @return \PhpOffice\PhpWord\PhpWord|null
|
||||
*/
|
||||
public function load($pFilename)
|
||||
{
|
||||
|
|
@ -271,7 +269,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
/**
|
||||
* Load section settings from SimpleXMLElement
|
||||
*
|
||||
* @param SimpleXMLElement $elm
|
||||
* @param \SimpleXMLElement $elm
|
||||
* @return array|string|null
|
||||
*
|
||||
* @todo Implement gutter
|
||||
|
|
@ -333,7 +331,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
/**
|
||||
* Load paragraph style from SimpleXMLElement
|
||||
*
|
||||
* @param SimpleXMLElement $elm
|
||||
* @param \SimpleXMLElement $elm
|
||||
* @return array|string|null
|
||||
*/
|
||||
private function loadParagraphStyle($elm)
|
||||
|
|
@ -394,7 +392,7 @@ class Word2007 extends AbstractReader implements IReader
|
|||
/**
|
||||
* Load font style from SimpleXMLElement
|
||||
*
|
||||
* @param SimpleXMLElement $elm
|
||||
* @param \SimpleXMLElement $elm
|
||||
* @return array|string|null
|
||||
*/
|
||||
private function loadFontStyle($elm)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -29,8 +27,8 @@ namespace PhpOffice\PhpWord;
|
|||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
use PhpOffice\PhpWord\Section\Footer;
|
||||
use PhpOffice\PhpWord\Section\Footnote;
|
||||
use PhpOffice\PhpWord\Section\Image;
|
||||
use PhpOffice\PhpWord\Section\Header;
|
||||
use PhpOffice\PhpWord\Section\Link;
|
||||
use PhpOffice\PhpWord\Section\ListItem;
|
||||
use PhpOffice\PhpWord\Section\MemoryImage;
|
||||
|
|
@ -56,7 +54,7 @@ class Section
|
|||
/**
|
||||
* Section settings
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Section\Settings
|
||||
* @var \PhpOffice\PhpWord\Section\Settings
|
||||
*/
|
||||
private $_settings;
|
||||
|
||||
|
|
@ -77,7 +75,7 @@ class Section
|
|||
/**
|
||||
* Section Footer
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Section\Footer
|
||||
* @var \PhpOffice\PhpWord\Section\Footer
|
||||
*/
|
||||
private $_footer = null;
|
||||
|
||||
|
|
@ -115,7 +113,7 @@ class Section
|
|||
/**
|
||||
* Get Section Settings
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\Settings
|
||||
* @return \PhpOffice\PhpWord\Section\Settings
|
||||
*/
|
||||
public function getSettings()
|
||||
{
|
||||
|
|
@ -128,7 +126,7 @@ class Section
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -147,7 +145,7 @@ class Section
|
|||
* @param string $linkName
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Link
|
||||
* @return \PhpOffice\PhpWord\Section\Link
|
||||
*/
|
||||
public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -172,8 +170,8 @@ class Section
|
|||
* Add a TextBreak Element
|
||||
*
|
||||
* @param int $count
|
||||
* @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\Font $fontStyle
|
||||
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -194,7 +192,7 @@ class Section
|
|||
* Add a Table Element
|
||||
*
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Table
|
||||
* @return \PhpOffice\PhpWord\Section\Table
|
||||
*/
|
||||
public function addTable($style = null)
|
||||
{
|
||||
|
|
@ -211,7 +209,7 @@ class Section
|
|||
* @param mixed $styleFont
|
||||
* @param mixed $styleList
|
||||
* @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)
|
||||
{
|
||||
|
|
@ -228,8 +226,8 @@ class Section
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Object
|
||||
* @throws Exception
|
||||
* @return \PhpOffice\PhpWord\Section\Object
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function addObject($src, $style = null)
|
||||
{
|
||||
|
|
@ -269,8 +267,8 @@ class Section
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Image
|
||||
* @throws Exception
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
|
|
@ -291,8 +289,8 @@ class Section
|
|||
*
|
||||
* @param string $link
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\MemoryImage
|
||||
* @throws Exception
|
||||
* @return \PhpOffice\PhpWord\Section\MemoryImage
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\Exception
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
|
|
@ -312,7 +310,7 @@ class Section
|
|||
*
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleTOC
|
||||
* @return PhpOffice\PhpWord\TOC
|
||||
* @return \PhpOffice\PhpWord\TOC
|
||||
*/
|
||||
public function addTOC($styleFont = null, $styleTOC = null)
|
||||
{
|
||||
|
|
@ -326,7 +324,7 @@ class Section
|
|||
*
|
||||
* @param string $text
|
||||
* @param int $depth
|
||||
* @return PhpOffice\PhpWord\Section\Title
|
||||
* @return \PhpOffice\PhpWord\Section\Title
|
||||
*/
|
||||
public function addTitle($text, $depth = 1)
|
||||
{
|
||||
|
|
@ -357,7 +355,7 @@ class Section
|
|||
* Create a new TextRun
|
||||
*
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\TextRun
|
||||
* @return \PhpOffice\PhpWord\Section\TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
|
|
@ -379,7 +377,7 @@ class Section
|
|||
/**
|
||||
* Create a new Header
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\Header
|
||||
* @return \PhpOffice\PhpWord\Section\Header
|
||||
*/
|
||||
public function createHeader()
|
||||
{
|
||||
|
|
@ -417,7 +415,7 @@ class Section
|
|||
/**
|
||||
* Create a new Footer
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\Footer
|
||||
* @return \PhpOffice\PhpWord\Section\Footer
|
||||
*/
|
||||
public function createFooter()
|
||||
{
|
||||
|
|
@ -427,9 +425,7 @@ class Section
|
|||
}
|
||||
|
||||
/**
|
||||
* Get Footer
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\Footer
|
||||
* @return \PhpOffice\PhpWord\Section\Footer
|
||||
*/
|
||||
public function getFooter()
|
||||
{
|
||||
|
|
@ -440,11 +436,11 @@ class Section
|
|||
* Create a new Footnote Element
|
||||
*
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Footnote
|
||||
* @return \PhpOffice\PhpWord\Section\Footnote
|
||||
*/
|
||||
public function createFootnote($styleParagraph = null)
|
||||
{
|
||||
$footnote = new Footnote($styleParagraph);
|
||||
$footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph);
|
||||
$refID = Footnote::addFootnoteElement($footnote);
|
||||
$footnote->setReferenceId($refID);
|
||||
$this->_elementCollection[] = $footnote;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,6 +25,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Section;
|
||||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
use PhpOffice\PhpWord\Media;
|
||||
use PhpOffice\PhpWord\Section\Footer\PreserveText;
|
||||
use PhpOffice\PhpWord\Shared\String;
|
||||
|
|
@ -68,7 +67,7 @@ class Footer
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -84,8 +83,8 @@ class Footer
|
|||
* Add TextBreak
|
||||
*
|
||||
* @param int $count
|
||||
* @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\Font $fontStyle
|
||||
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -97,7 +96,7 @@ class Footer
|
|||
/**
|
||||
* Create a new TextRun
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\TextRun
|
||||
* @return \PhpOffice\PhpWord\Section\TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
|
|
@ -110,7 +109,7 @@ class Footer
|
|||
* Add a Table Element
|
||||
*
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Table
|
||||
* @return \PhpOffice\PhpWord\Section\Table
|
||||
*/
|
||||
public function addTable($style = null)
|
||||
{
|
||||
|
|
@ -124,7 +123,7 @@ class Footer
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return Image
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
|
|
@ -146,7 +145,7 @@ class Footer
|
|||
*
|
||||
* @param string $link
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\MemoryImage
|
||||
* @return \PhpOffice\PhpWord\Section\MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
|
|
@ -168,7 +167,7 @@ class Footer
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
* @return \PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
*/
|
||||
public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -42,14 +40,14 @@ class PreserveText
|
|||
/**
|
||||
* Text style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Font
|
||||
* @var \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
private $_styleFont;
|
||||
|
||||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Paragraph
|
||||
* @var \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
private $_styleParagraph;
|
||||
|
||||
|
|
@ -90,7 +88,7 @@ class PreserveText
|
|||
$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])) {
|
||||
$this->_text = $matches[0];
|
||||
}
|
||||
|
|
@ -101,7 +99,7 @@ class PreserveText
|
|||
/**
|
||||
* Get Text style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function getFontStyle()
|
||||
{
|
||||
|
|
@ -111,7 +109,7 @@ class PreserveText
|
|||
/**
|
||||
* Get Paragraph style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Paragraph
|
||||
* @return \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -34,7 +32,7 @@ class Footnote
|
|||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Paragraph
|
||||
* @var \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
private $_styleParagraph;
|
||||
|
||||
|
|
@ -80,7 +78,7 @@ class Footnote
|
|||
*
|
||||
* @var string $text
|
||||
* @var mixed $styleFont
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text = null, $styleFont = null)
|
||||
{
|
||||
|
|
@ -96,13 +94,13 @@ class Footnote
|
|||
* @param string $linkSrc
|
||||
* @param string $linkName
|
||||
* @param mixed $styleFont
|
||||
* @return PhpOffice\PhpWord\Section\Link
|
||||
* @return \PhpOffice\PhpWord\Section\Link
|
||||
*/
|
||||
public function addLink($linkSrc, $linkName = null, $styleFont = null)
|
||||
{
|
||||
|
||||
$link = new Link($linkSrc, $linkName, $styleFont);
|
||||
$rID = PhpOffice\PhpWord\Footnote::addFootnoteLinkElement($linkSrc);
|
||||
$rID = \PhpOffice\PhpWord\Footnote::addFootnoteLinkElement($linkSrc);
|
||||
$link->setRelationId($rID);
|
||||
|
||||
$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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,6 +25,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Section;
|
||||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
use PhpOffice\PhpWord\Media;
|
||||
use PhpOffice\PhpWord\Section\Footer\PreserveText;
|
||||
use PhpOffice\PhpWord\Shared\String;
|
||||
|
|
@ -97,7 +96,7 @@ class Header
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -113,8 +112,8 @@ class Header
|
|||
* Add TextBreak
|
||||
*
|
||||
* @param int $count
|
||||
* @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\Font $fontStyle
|
||||
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -126,7 +125,7 @@ class Header
|
|||
/**
|
||||
* Create a new TextRun
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\TextRun
|
||||
* @return \PhpOffice\PhpWord\Section\TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
|
|
@ -139,7 +138,7 @@ class Header
|
|||
* Add a Table Element
|
||||
*
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Table
|
||||
* @return \PhpOffice\PhpWord\Section\Table
|
||||
*/
|
||||
public function addTable($style = null)
|
||||
{
|
||||
|
|
@ -153,7 +152,7 @@ class Header
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Image
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
|
|
@ -175,7 +174,7 @@ class Header
|
|||
*
|
||||
* @param string $link
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\MemoryImage
|
||||
* @return \PhpOffice\PhpWord\Section\MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
|
|
@ -197,7 +196,7 @@ class Header
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
* @return \PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
*/
|
||||
public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -214,7 +213,7 @@ class Header
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Image
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
public function addWatermark($src, $style = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -42,7 +40,7 @@ class Image
|
|||
/**
|
||||
* Image Style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Image
|
||||
* @var \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -67,11 +65,12 @@ class Image
|
|||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @param bool $isWatermark
|
||||
* @throws InvalidImageException|UnsupportedImageTypeException
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\InvalidImageException
|
||||
* @throws \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
|
||||
*/
|
||||
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)) {
|
||||
throw new InvalidImageException;
|
||||
|
|
@ -83,7 +82,7 @@ class Image
|
|||
|
||||
$this->_src = $src;
|
||||
$this->_isWatermark = $isWatermark;
|
||||
$this->_style = new PhpOffice\PhpWord\Style\Image();
|
||||
$this->_style = new \PhpOffice\PhpWord\Style\Image();
|
||||
|
||||
if (!is_null($style) && is_array($style)) {
|
||||
foreach ($style as $key => $value) {
|
||||
|
|
@ -108,7 +107,7 @@ class Image
|
|||
/**
|
||||
* Get Image style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Image
|
||||
* @return \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -56,14 +54,14 @@ class Link
|
|||
/**
|
||||
* Link style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Font
|
||||
* @var \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
private $_styleFont;
|
||||
|
||||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Paragraph
|
||||
* @var \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
private $_styleParagraph;
|
||||
|
||||
|
|
@ -155,7 +153,7 @@ class Link
|
|||
/**
|
||||
* Get Text style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function getFontStyle()
|
||||
{
|
||||
|
|
@ -165,7 +163,7 @@ class Link
|
|||
/**
|
||||
* Get Paragraph style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Paragraph
|
||||
* @return \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -32,14 +30,14 @@ class ListItem
|
|||
/**
|
||||
* ListItem Style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\ListItem
|
||||
* @var \PhpOffice\PhpWord\Style\ListItem
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
/**
|
||||
* Textrun
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Section\Text
|
||||
* @var \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
private $_textObject;
|
||||
|
||||
|
|
@ -61,7 +59,7 @@ class ListItem
|
|||
*/
|
||||
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->_depth = $depth;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -41,7 +39,7 @@ class MemoryImage
|
|||
/**
|
||||
* Image Style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Image
|
||||
* @var \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -144,7 +142,7 @@ class MemoryImage
|
|||
/**
|
||||
* Get Image style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Image
|
||||
* @return \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -41,7 +39,7 @@ class Object
|
|||
/**
|
||||
* Image Style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Image
|
||||
* @var \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -100,7 +98,7 @@ class Object
|
|||
/**
|
||||
* Get Image style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Image
|
||||
* @return \PhpOffice\PhpWord\Style\Image
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -29,9 +27,6 @@ namespace PhpOffice\PhpWord\Section;
|
|||
|
||||
class PageBreak
|
||||
{
|
||||
/**
|
||||
* Create a new PageBreak Element
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -34,7 +32,7 @@ class Table
|
|||
/**
|
||||
* Table style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Table
|
||||
* @var \PhpOffice\PhpWord\Style\Table
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -81,7 +79,7 @@ class Table
|
|||
|
||||
if (!is_null($style)) {
|
||||
if (is_array($style)) {
|
||||
$this->_style = new PhpOffice\PhpWord\Style\Table();
|
||||
$this->_style = new \PhpOffice\PhpWord\Style\Table();
|
||||
|
||||
foreach ($style as $key => $value) {
|
||||
if (substr($key, 0, 1) != '_') {
|
||||
|
|
@ -112,7 +110,7 @@ class Table
|
|||
*
|
||||
* @param int $width
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Table\Cell
|
||||
* @return \PhpOffice\PhpWord\Section\Table\Cell
|
||||
*/
|
||||
public function addCell($width = null, $style = null)
|
||||
{
|
||||
|
|
@ -134,7 +132,7 @@ class Table
|
|||
/**
|
||||
* Get table style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Table
|
||||
* @return \PhpOffice\PhpWord\Style\Table
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,6 +25,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Section\Table;
|
||||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
use PhpOffice\PhpWord\Media;
|
||||
use PhpOffice\PhpWord\Section\Footer\PreserveText;
|
||||
use PhpOffice\PhpWord\Section\Image;
|
||||
|
|
@ -51,7 +50,7 @@ class Cell
|
|||
/**
|
||||
* Cell Style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Cell
|
||||
* @var \PhpOffice\PhpWord\Style\Cell
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -90,7 +89,7 @@ class Cell
|
|||
$this->_insideOf = $insideOf;
|
||||
$this->_pCount = $pCount;
|
||||
$this->_width = $width;
|
||||
$this->_style = new PhpOffice\PhpWord\Style\Cell();
|
||||
$this->_style = new \PhpOffice\PhpWord\Style\Cell();
|
||||
|
||||
if (!is_null($style)) {
|
||||
if (is_array($style)) {
|
||||
|
|
@ -111,7 +110,7 @@ class Cell
|
|||
*
|
||||
* @param string $text
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -129,7 +128,7 @@ class Cell
|
|||
* @param string $linkSrc
|
||||
* @param string $linkName
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Link
|
||||
* @return \PhpOffice\PhpWord\Section\Link
|
||||
*/
|
||||
public function addLink($linkSrc, $linkName = null, $style = null)
|
||||
{
|
||||
|
|
@ -159,8 +158,8 @@ class Cell
|
|||
* Add TextBreak
|
||||
*
|
||||
* @param int $count
|
||||
* @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\Font $fontStyle
|
||||
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -176,7 +175,7 @@ class Cell
|
|||
* @param int $depth
|
||||
* @param mixed $styleText
|
||||
* @param mixed $styleList
|
||||
* @return PhpOffice\PhpWord\Section\ListItem
|
||||
* @return \PhpOffice\PhpWord\Section\ListItem
|
||||
*/
|
||||
public function addListItem($text, $depth = 0, $styleText = null, $styleList = null)
|
||||
{
|
||||
|
|
@ -193,7 +192,7 @@ class Cell
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Image
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
|
|
@ -221,7 +220,7 @@ class Cell
|
|||
*
|
||||
* @param string $link
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\MemoryImage
|
||||
* @return \PhpOffice\PhpWord\Section\MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
|
|
@ -248,7 +247,7 @@ class Cell
|
|||
*
|
||||
* @param string $src
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Object
|
||||
* @return \PhpOffice\PhpWord\Section\Object
|
||||
*/
|
||||
public function addObject($src, $style = null)
|
||||
{
|
||||
|
|
@ -290,7 +289,7 @@ class Cell
|
|||
* @param string $text
|
||||
* @param mixed $styleFont
|
||||
* @param mixed $styleParagraph
|
||||
* @return PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
* @return \PhpOffice\PhpWord\Section\Footer\PreserveText
|
||||
*/
|
||||
public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
|
||||
{
|
||||
|
|
@ -309,7 +308,7 @@ class Cell
|
|||
/**
|
||||
* Create a new TextRun
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Section\TextRun
|
||||
* @return \PhpOffice\PhpWord\Section\TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
|
|
@ -331,7 +330,7 @@ class Cell
|
|||
/**
|
||||
* Get Cell Style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Cell
|
||||
* @return \PhpOffice\PhpWord\Style\Cell
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2013 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -39,7 +37,7 @@ class Row
|
|||
/**
|
||||
* Row style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Row
|
||||
* @var \PhpOffice\PhpWord\Style\Row
|
||||
*/
|
||||
private $_style;
|
||||
|
||||
|
|
@ -78,7 +76,7 @@ class Row
|
|||
$this->_insideOf = $insideOf;
|
||||
$this->_pCount = $pCount;
|
||||
$this->_height = $height;
|
||||
$this->_style = new PhpOffice\PhpWord\Style\Row();
|
||||
$this->_style = new \PhpOffice\PhpWord\Style\Row();
|
||||
|
||||
if (!is_null($style)) {
|
||||
if (is_array($style)) {
|
||||
|
|
@ -98,7 +96,7 @@ class Row
|
|||
*
|
||||
* @param int $width
|
||||
* @param mixed $style
|
||||
* @return PhpOffice\PhpWord\Section\Table\Cell
|
||||
* @return \PhpOffice\PhpWord\Section\Table\Cell
|
||||
*/
|
||||
public function addCell($width = null, $style = null)
|
||||
{
|
||||
|
|
@ -120,7 +118,7 @@ class Row
|
|||
/**
|
||||
* Get row style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Row
|
||||
* @return \PhpOffice\PhpWord\Style\Row
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -42,14 +40,14 @@ class Text
|
|||
/**
|
||||
* Text style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Font
|
||||
* @var \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
private $fontStyle;
|
||||
|
||||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Paragraph
|
||||
* @var \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
private $paragraphStyle;
|
||||
|
||||
|
|
@ -57,8 +55,8 @@ class Text
|
|||
* Create a new Text Element
|
||||
*
|
||||
* @param string $text
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Font $fontStyle
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Font $fontStyle
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function __construct($text = null, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -70,9 +68,9 @@ class Text
|
|||
/**
|
||||
* Set Text style
|
||||
*
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Font $style
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Font $style
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function setFontStyle($style = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -94,7 +92,7 @@ class Text
|
|||
/**
|
||||
* Get Text style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function getFontStyle()
|
||||
{
|
||||
|
|
@ -104,8 +102,8 @@ class Text
|
|||
/**
|
||||
* Set Paragraph style
|
||||
*
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $style
|
||||
* @return null|PhpOffice\PhpWord\Style\Paragraph
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
|
||||
* @return null|\PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function setParagraphStyle($style = null)
|
||||
{
|
||||
|
|
@ -125,7 +123,7 @@ class Text
|
|||
/**
|
||||
* Get Paragraph style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Paragraph
|
||||
* @return \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -35,14 +33,14 @@ class TextBreak
|
|||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Pagaraph
|
||||
* @var \PhpOffice\PhpWord\Style\Pagaraph
|
||||
*/
|
||||
private $paragraphStyle = null;
|
||||
|
||||
/**
|
||||
* Text style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Font
|
||||
* @var \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
private $fontStyle = null;
|
||||
|
||||
|
|
@ -62,9 +60,9 @@ class TextBreak
|
|||
/**
|
||||
* Set Text style
|
||||
*
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Font $style
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Font $style
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function setFontStyle($style = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -84,7 +82,7 @@ class TextBreak
|
|||
/**
|
||||
* Get Text style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Font
|
||||
* @return \PhpOffice\PhpWord\Style\Font
|
||||
*/
|
||||
public function getFontStyle()
|
||||
{
|
||||
|
|
@ -94,8 +92,8 @@ class TextBreak
|
|||
/**
|
||||
* Set Paragraph style
|
||||
*
|
||||
* @param null|array|PhpOffice\PhpWord\Style\Paragraph $style
|
||||
* @return null|PhpOffice\PhpWord\Style\Paragraph
|
||||
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
|
||||
* @return null|\PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function setParagraphStyle($style = null)
|
||||
{
|
||||
|
|
@ -113,7 +111,7 @@ class TextBreak
|
|||
/**
|
||||
* Get Paragraph style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Paragraph
|
||||
* @return \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -27,6 +25,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Section;
|
||||
|
||||
use PhpOffice\PhpWord\Exceptions\Exception;
|
||||
use PhpOffice\PhpWord\Media;
|
||||
use PhpOffice\PhpWord\Shared\String;
|
||||
use PhpOffice\PhpWord\Style\Paragraph;
|
||||
|
|
@ -36,7 +35,7 @@ class TextRun
|
|||
/**
|
||||
* Paragraph style
|
||||
*
|
||||
* @var PhpOffice\PhpWord\Style\Paragraph
|
||||
* @var \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
private $_styleParagraph;
|
||||
|
||||
|
|
@ -76,7 +75,7 @@ class TextRun
|
|||
*
|
||||
* @var string $text
|
||||
* @var mixed $styleFont
|
||||
* @return PhpOffice\PhpWord\Section\Text
|
||||
* @return \PhpOffice\PhpWord\Section\Text
|
||||
*/
|
||||
public function addText($text = null, $styleFont = null)
|
||||
{
|
||||
|
|
@ -94,7 +93,7 @@ class TextRun
|
|||
* @param string $linkSrc
|
||||
* @param string $linkName
|
||||
* @param mixed $styleFont
|
||||
* @return PhpOffice\PhpWord\Section\Link
|
||||
* @return \PhpOffice\PhpWord\Section\Link
|
||||
*/
|
||||
public function addLink($linkSrc, $linkName = null, $styleFont = null)
|
||||
{
|
||||
|
|
@ -116,7 +115,7 @@ class TextRun
|
|||
*
|
||||
* @param string $imageSrc
|
||||
* @param mixed $styleFont
|
||||
* @return PhpOffice\PhpWord\Section\Image
|
||||
* @return \PhpOffice\PhpWord\Section\Image
|
||||
*/
|
||||
public function addImage($imageSrc, $style = null)
|
||||
{
|
||||
|
|
@ -137,8 +136,8 @@ class TextRun
|
|||
* Add TextBreak
|
||||
*
|
||||
* @param int $count
|
||||
* @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\Font $fontStyle
|
||||
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
|
||||
*/
|
||||
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
|
||||
{
|
||||
|
|
@ -151,12 +150,12 @@ class TextRun
|
|||
* Create a new Footnote Element
|
||||
*
|
||||
* @param string $text
|
||||
* @return PhpOffice\PhpWord\Section\Footnote
|
||||
* @return \PhpOffice\PhpWord\Section\Footnote
|
||||
*/
|
||||
public function createFootnote($styleParagraph = null)
|
||||
{
|
||||
$footnote = new PhpOffice\PhpWord\Section\Footnote($styleParagraph);
|
||||
$refID = PhpOffice\PhpWord\Footnote::addFootnoteElement($footnote);
|
||||
$footnote = new \PhpOffice\PhpWord\Section\Footnote($styleParagraph);
|
||||
$refID = \PhpOffice\PhpWord\Footnote::addFootnoteElement($footnote);
|
||||
$footnote->setReferenceId($refID);
|
||||
$this->_elementCollection[] = $footnote;
|
||||
return $footnote;
|
||||
|
|
@ -175,7 +174,7 @@ class TextRun
|
|||
/**
|
||||
* Get Paragraph style
|
||||
*
|
||||
* @return PhpOffice\PhpWord\Style\Paragraph
|
||||
* @return \PhpOffice\PhpWord\Style\Paragraph
|
||||
*/
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -32,7 +30,7 @@ class File
|
|||
/**
|
||||
* Verify if a file exists
|
||||
*
|
||||
* @param string $pFilename Filename
|
||||
* @param string $pFilename Filename
|
||||
* @return bool
|
||||
*/
|
||||
public static function file_exists($pFilename)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PhpWord
|
||||
* @package PhpWord
|
||||
* @copyright Copyright (c) 2014 PhpWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.8.0
|
||||
|
|
@ -47,7 +45,7 @@ class XMLWriter
|
|||
/**
|
||||
* Internal XMLWriter
|
||||
*
|
||||
* @var XMLWriter
|
||||
* @var \XMLWriter
|
||||
*/
|
||||
private $_xmlWriter;
|
||||
|
||||
|
|
@ -59,15 +57,13 @@ class XMLWriter
|
|||
private $_tempFileName = '';
|
||||
|
||||
/**
|
||||
* Create a new XMLWriter instance
|
||||
*
|
||||
* @param int $pTemporaryStorage Temporary storage location
|
||||
* @param string $pTemporaryStorageFolder Temporary storage folder
|
||||
*/
|
||||
public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './')
|
||||
{
|
||||
// Create internal XMLWriter
|
||||
$this->_xmlWriter = new XMLWriter();
|
||||
$this->_xmlWriter = new \XMLWriter();
|
||||
|
||||
// Open temporary storage
|
||||
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
|
||||
|
|
@ -133,7 +129,7 @@ class XMLWriter
|
|||
{
|
||||
try {
|
||||
@call_user_func_array(array($this->_xmlWriter, $function), $args);
|
||||
} catch (Exception $ex) {
|
||||
} catch (\Exception $ex) {
|
||||
// Do nothing!
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue