From e2e0edaa8efe4f05e1ea54be43f20f9bf6a80c7f Mon Sep 17 00:00:00 2001 From: marjune Date: Wed, 11 Oct 2017 00:55:51 +0800 Subject: [PATCH 01/26] refactoring and reducing cyclomatic complexity --- src/PhpPresentation/HashTable.php | 5 ++--- src/PhpPresentation/PhpPresentation.php | 11 ++++------- .../Shape/RichText/Paragraph.php | 6 ++---- src/PhpPresentation/Shape/Table/Cell.php | 19 +++++++------------ src/PhpPresentation/Shape/Table/Row.php | 4 +--- .../Writer/ODPresentation/Content.php | 4 ---- 6 files changed, 16 insertions(+), 33 deletions(-) diff --git a/src/PhpPresentation/HashTable.php b/src/PhpPresentation/HashTable.php index 4e8378ee6..54eec914d 100644 --- a/src/PhpPresentation/HashTable.php +++ b/src/PhpPresentation/HashTable.php @@ -79,13 +79,12 @@ public function add(ComparableInterface $pSource) { // Determine hashcode $hashIndex = $pSource->getHashIndex(); - + $hashCode = $pSource->getHashCode(); + if (is_null($hashIndex)) { $hashCode = $pSource->getHashCode(); } elseif (isset($this->keyMap[$hashIndex])) { $hashCode = $this->keyMap[$hashIndex]; - } else { - $hashCode = $pSource->getHashCode(); } // Add value diff --git a/src/PhpPresentation/PhpPresentation.php b/src/PhpPresentation/PhpPresentation.php index 580334289..3eefac7ba 100644 --- a/src/PhpPresentation/PhpPresentation.php +++ b/src/PhpPresentation/PhpPresentation.php @@ -223,9 +223,8 @@ public function removeSlideByIndex($index = 0) { if ($index > count($this->slideCollection) - 1) { throw new \Exception("Slide index is out of bounds."); - } else { - array_splice($this->slideCollection, $index, 1); - } + } + array_splice($this->slideCollection, $index, 1); return $this; } @@ -241,9 +240,8 @@ public function getSlide($index = 0) { if ($index > count($this->slideCollection) - 1) { throw new \Exception("Slide index is out of bounds."); - } else { - return $this->slideCollection[$index]; } + return $this->slideCollection[$index]; } /** @@ -306,9 +304,8 @@ public function setActiveSlideIndex($index = 0) { if ($index > count($this->slideCollection) - 1) { throw new \Exception("Active slide index is out of bounds."); - } else { - $this->activeSlideIndex = $index; } + $this->activeSlideIndex = $index; return $this->getActiveSlide(); } diff --git a/src/PhpPresentation/Shape/RichText/Paragraph.php b/src/PhpPresentation/Shape/RichText/Paragraph.php index aa2bf79d8..ab64b706a 100644 --- a/src/PhpPresentation/Shape/RichText/Paragraph.php +++ b/src/PhpPresentation/Shape/RichText/Paragraph.php @@ -259,12 +259,10 @@ public function getRichTextElements() */ public function setRichTextElements($pElements = null) { - if (is_array($pElements)) { - $this->richTextElements = $pElements; - } else { + if (!is_array($pElements)) { throw new \Exception("Invalid \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] array passed."); } - + $this->richTextElements = $pElements; return $this; } diff --git a/src/PhpPresentation/Shape/Table/Cell.php b/src/PhpPresentation/Shape/Table/Cell.php index 2307d0690..1317888ec 100644 --- a/src/PhpPresentation/Shape/Table/Cell.php +++ b/src/PhpPresentation/Shape/Table/Cell.php @@ -164,21 +164,18 @@ public function getParagraph($index = 0) public function createParagraph() { $this->richTextParagraphs[] = new Paragraph(); + $totalRichTextParagraphs = count($this->richTextParagraphs); + $this->activeParagraph = $totalRichTextParagraphs - 1; - if (count($this->richTextParagraphs) > 1) { + if ($totalRichTextParagraphs > 1) { $alignment = clone $this->getActiveParagraph()->getAlignment(); $font = clone $this->getActiveParagraph()->getFont(); $bulletStyle = clone $this->getActiveParagraph()->getBulletStyle(); - $this->activeParagraph = count($this->richTextParagraphs) - 1; - $this->getActiveParagraph()->setAlignment($alignment); $this->getActiveParagraph()->setFont($font); $this->getActiveParagraph()->setBulletStyle($bulletStyle); - } else { - $this->activeParagraph = count($this->richTextParagraphs) - 1; - } - + } return $this->getActiveParagraph(); } @@ -279,13 +276,11 @@ public function getParagraphs() */ public function setParagraphs($paragraphs = null) { - if (is_array($paragraphs)) { - $this->richTextParagraphs = $paragraphs; - $this->activeParagraph = count($this->richTextParagraphs) - 1; - } else { + if (!is_array($paragraphs)) { throw new \Exception("Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed."); } - + $this->richTextParagraphs = $paragraphs; + $this->activeParagraph = count($this->richTextParagraphs) - 1; return $this; } diff --git a/src/PhpPresentation/Shape/Table/Row.php b/src/PhpPresentation/Shape/Table/Row.php index 4f427f02d..fb95d8df8 100644 --- a/src/PhpPresentation/Shape/Table/Row.php +++ b/src/PhpPresentation/Shape/Table/Row.php @@ -118,11 +118,9 @@ public function nextCell() $this->activeCellIndex++; if (isset($this->cells[$this->activeCellIndex])) { $this->cells[$this->activeCellIndex]->setFill(clone $this->getFill()); - return $this->cells[$this->activeCellIndex]; - } else { - throw new \Exception("Cell count out of bounds."); } + throw new \Exception("Cell count out of bounds."); } /** diff --git a/src/PhpPresentation/Writer/ODPresentation/Content.php b/src/PhpPresentation/Writer/ODPresentation/Content.php index ca0051de5..ad88a8b9e 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Content.php +++ b/src/PhpPresentation/Writer/ODPresentation/Content.php @@ -484,8 +484,6 @@ public function writeShapeTxt(XMLWriter $objWriter, RichText $shape) $objWriter->startElement('text:line-break'); $objWriter->endElement(); $objWriter->endElement(); - } else { - //echo '
'.print_r($richtext, true).'
'; } } $objWriter->endElement(); @@ -549,8 +547,6 @@ public function writeShapeTxt(XMLWriter $objWriter, RichText $shape) $objWriter->startElement('text:line-break'); $objWriter->endElement(); $objWriter->endElement(); - } else { - //echo '
'.print_r($richtext, true).'
'; } } $objWriter->endElement(); From 9e078d5bcfe9c17fad611e3847ac6d1c5159656b Mon Sep 17 00:00:00 2001 From: marjune Date: Mon, 16 Oct 2017 22:49:15 +0800 Subject: [PATCH 02/26] remove extra space --- src/PhpPresentation/PhpPresentation.php | 4 ++-- src/PhpPresentation/Shape/Table/Cell.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PhpPresentation/PhpPresentation.php b/src/PhpPresentation/PhpPresentation.php index 3eefac7ba..a002da3bc 100644 --- a/src/PhpPresentation/PhpPresentation.php +++ b/src/PhpPresentation/PhpPresentation.php @@ -223,7 +223,7 @@ public function removeSlideByIndex($index = 0) { if ($index > count($this->slideCollection) - 1) { throw new \Exception("Slide index is out of bounds."); - } + } array_splice($this->slideCollection, $index, 1); return $this; @@ -441,4 +441,4 @@ public function setAllMasterSlides($slideMasters = array()) } return $this; } -} +} \ No newline at end of file diff --git a/src/PhpPresentation/Shape/Table/Cell.php b/src/PhpPresentation/Shape/Table/Cell.php index 1317888ec..d06915da2 100644 --- a/src/PhpPresentation/Shape/Table/Cell.php +++ b/src/PhpPresentation/Shape/Table/Cell.php @@ -175,7 +175,7 @@ public function createParagraph() $this->getActiveParagraph()->setAlignment($alignment); $this->getActiveParagraph()->setFont($font); $this->getActiveParagraph()->setBulletStyle($bulletStyle); - } + } return $this->getActiveParagraph(); } From ec76b80dd8e3508e113026e0a6388b985729d409 Mon Sep 17 00:00:00 2001 From: marjune Date: Mon, 16 Oct 2017 23:40:38 +0800 Subject: [PATCH 03/26] adding new line at the end of the file --- src/PhpPresentation/PhpPresentation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpPresentation/PhpPresentation.php b/src/PhpPresentation/PhpPresentation.php index a002da3bc..241e0b8bf 100644 --- a/src/PhpPresentation/PhpPresentation.php +++ b/src/PhpPresentation/PhpPresentation.php @@ -441,4 +441,4 @@ public function setAllMasterSlides($slideMasters = array()) } return $this; } -} \ No newline at end of file +} From 23038f02608b88ffe07ee3bb03e1df3b1296b3db Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sat, 4 Nov 2017 15:55:04 -0200 Subject: [PATCH 04/26] Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase --- README.md | 6 ++-- composer.json | 2 +- .../Tests/AbstractShapeTest.php | 3 +- .../PhpPresentation/Tests/AutoloaderTest.php | 3 +- .../Tests/DocumentLayoutTest.php | 3 +- .../Tests/DocumentPropertiesTest.php | 3 +- tests/PhpPresentation/Tests/HashTableTest.php | 3 +- tests/PhpPresentation/Tests/IOFactoryTest.php | 3 +- .../Tests/PhpPresentationTest.php | 3 +- .../Tests/PresentationPropertiesTest.php | 3 +- .../Tests/Reader/ODPresentationTest.php | 27 +++++++------- .../Tests/Reader/PowerPoint2007Test.php | 25 ++++++------- .../Tests/Reader/PowerPoint97Test.php | 35 ++++++++++--------- .../Tests/Reader/SerializedTest.php | 13 +++---- .../Tests/Shape/AbstractGraphicTest.php | 3 +- .../Tests/Shape/Chart/AxisTest.php | 3 +- .../Tests/Shape/Chart/GridlinesTest.php | 3 +- .../Tests/Shape/Chart/LegendTest.php | 3 +- .../Tests/Shape/Chart/MarkerTest.php | 3 +- .../Tests/Shape/Chart/PlotAreaTest.php | 3 +- .../Tests/Shape/Chart/SeriesTest.php | 15 ++++---- .../Tests/Shape/Chart/TitleTest.php | 3 +- .../Tests/Shape/Chart/Type/AbstractTest.php | 3 +- .../Tests/Shape/Chart/Type/AreaTest.php | 3 +- .../Tests/Shape/Chart/Type/Bar3DTest.php | 5 +-- .../Tests/Shape/Chart/Type/BarTest.php | 5 +-- .../Tests/Shape/Chart/Type/DoughnutTest.php | 3 +- .../Tests/Shape/Chart/Type/LineTest.php | 3 +- .../Tests/Shape/Chart/Type/Pie3DTest.php | 5 +-- .../Tests/Shape/Chart/Type/PieTest.php | 3 +- .../Tests/Shape/Chart/Type/ScatterTest.php | 3 +- .../Tests/Shape/Chart/View3DTest.php | 3 +- .../PhpPresentation/Tests/Shape/ChartTest.php | 9 ++--- .../Tests/Shape/Comment/AuthorTest.php | 3 +- .../Tests/Shape/CommentTest.php | 3 +- .../Tests/Shape/Drawing/Base64Test.php | 3 +- .../Tests/Shape/Drawing/FileTest.php | 3 +- .../Tests/Shape/Drawing/ZipFileTest.php | 3 +- .../PhpPresentation/Tests/Shape/GroupTest.php | 29 +++++++-------- .../Tests/Shape/HyperlinkTest.php | 3 +- .../PhpPresentation/Tests/Shape/LineTest.php | 3 +- .../PhpPresentation/Tests/Shape/MediaTest.php | 3 +- .../Tests/Shape/PlaceholderTest.php | 3 +- .../Tests/Shape/RichText/BreakElementTest.php | 5 +-- .../Tests/Shape/RichText/ParagraphTest.php | 3 +- .../Tests/Shape/RichText/RunTest.php | 3 +- .../Tests/Shape/RichText/TextElementTest.php | 3 +- .../Tests/Shape/RichTextTest.php | 21 +++++------ .../Tests/Shape/Table/CellTest.php | 3 +- .../Tests/Shape/Table/RowTest.php | 3 +- .../PhpPresentation/Tests/Shape/TableTest.php | 3 +- .../Tests/Slide/AbstractSlideTest.php | 3 +- .../Tests/Slide/AnimationTest.php | 3 +- .../Tests/Slide/Background/ColorTest.php | 3 +- .../Tests/Slide/Background/ImageTest.php | 3 +- .../Slide/Background/SchemeColorTest.php | 3 +- .../Tests/Slide/IteratorTest.php | 3 +- .../PhpPresentation/Tests/Slide/NoteTest.php | 15 ++++---- .../Tests/Slide/SlideLayoutTest.php | 5 +-- .../Tests/Slide/SlideMasterTest.php | 3 +- .../Tests/Slide/TransitionTest.php | 3 +- tests/PhpPresentation/Tests/SlideTest.php | 17 ++++----- .../Tests/Style/AlignmentTest.php | 3 +- .../Tests/Style/BorderTest.php | 3 +- .../Tests/Style/BordersTest.php | 3 +- .../Tests/Style/BulletTest.php | 3 +- .../Tests/Style/ColorMapTest.php | 3 +- .../PhpPresentation/Tests/Style/ColorTest.php | 3 +- .../PhpPresentation/Tests/Style/FillTest.php | 3 +- .../PhpPresentation/Tests/Style/FontTest.php | 3 +- .../Tests/Style/OutlineTest.php | 3 +- .../Tests/Style/ShadowTest.php | 3 +- .../Tests/Style/TextStyleTest.php | 3 +- .../Tests/Writer/AbstractWriterTest.php | 3 +- .../LayoutPack/TemplateBasedTest.php | 3 +- .../PowerPoint2007/PptSlideMastersTest.php | 3 +- .../Tests/Writer/SerializedTest.php | 27 +++++++------- .../_includes/PhpPresentationTestCase.php | 3 +- 78 files changed, 261 insertions(+), 185 deletions(-) diff --git a/README.md b/README.md index 47b633fb1..feddca3aa 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Branch Master : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=master)](http://phppresentation.readthedocs.io/en/latest/?badge=master) Branch Develop : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=develop)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=develop)](http://phppresentation.readthedocs.io/en/latest/?badge=develop) -PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). +PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). PHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPPresentation) and [unit testing](http://phpoffice.github.io/PHPPresentation/coverage/develop/). You can learn more about PHPPresentation by reading the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/develop/). @@ -76,7 +76,7 @@ require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; ``` You will also need to download the latest PHPOffice/Common release from its [releases page](https://github.com/PHPOffice/Common/releases). -And you will also have to register its autoloader, too. +And you will also have to register its autoloader, too. ```php require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; @@ -130,7 +130,7 @@ $textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); - + $oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); $oWriterPPTX->save(__DIR__ . "/sample.pptx"); $oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); diff --git a/composer.json b/composer.json index ce4852a68..c8fa0c7b5 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "phpoffice/common": "0.2.*" }, "require-dev": { - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "~4.8.36", "phpdocumentor/phpdocumentor":"2.*", "phpmd/phpmd": "2.*", "sebastian/phpcpd": "2.*", diff --git a/tests/PhpPresentation/Tests/AbstractShapeTest.php b/tests/PhpPresentation/Tests/AbstractShapeTest.php index 4b06e6b13..3a13efb61 100644 --- a/tests/PhpPresentation/Tests/AbstractShapeTest.php +++ b/tests/PhpPresentation/Tests/AbstractShapeTest.php @@ -24,11 +24,12 @@ use PhpOffice\PhpPresentation\Style\Border; use PhpOffice\PhpPresentation\Style\Fill; use PhpOffice\PhpPresentation\Style\Shadow; +use PHPUnit\Framework\TestCase; /** * Test class for Autoloader */ -class AbstractShapeTest extends \PHPUnit_Framework_TestCase +class AbstractShapeTest extends TestCase { /** * Register diff --git a/tests/PhpPresentation/Tests/AutoloaderTest.php b/tests/PhpPresentation/Tests/AutoloaderTest.php index 31fd2c99e..9351f77e6 100644 --- a/tests/PhpPresentation/Tests/AutoloaderTest.php +++ b/tests/PhpPresentation/Tests/AutoloaderTest.php @@ -18,11 +18,12 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\Autoloader; +use PHPUnit\Framework\TestCase; /** * Test class for Autoloader */ -class AutoloaderTest extends \PHPUnit_Framework_TestCase +class AutoloaderTest extends TestCase { /** * Register diff --git a/tests/PhpPresentation/Tests/DocumentLayoutTest.php b/tests/PhpPresentation/Tests/DocumentLayoutTest.php index bbbc6e86e..34f5cca58 100644 --- a/tests/PhpPresentation/Tests/DocumentLayoutTest.php +++ b/tests/PhpPresentation/Tests/DocumentLayoutTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\DocumentLayout; +use PHPUnit\Framework\TestCase; /** * Test class for DocumentLayout * * @coversDefaultClass PhpOffice\PhpPresentation\DocumentLayout */ -class DocumentLayoutTest extends \PHPUnit_Framework_TestCase +class DocumentLayoutTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/DocumentPropertiesTest.php b/tests/PhpPresentation/Tests/DocumentPropertiesTest.php index 34a2db853..9ad93aa14 100644 --- a/tests/PhpPresentation/Tests/DocumentPropertiesTest.php +++ b/tests/PhpPresentation/Tests/DocumentPropertiesTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\DocumentProperties; +use PHPUnit\Framework\TestCase; /** * Test class for DocumentProperties * * @coversDefaultClass PhpOffice\PhpPresentation\DocumentProperties */ -class DocumentPropertiesTest extends \PHPUnit_Framework_TestCase +class DocumentPropertiesTest extends TestCase { /** * Test get set value diff --git a/tests/PhpPresentation/Tests/HashTableTest.php b/tests/PhpPresentation/Tests/HashTableTest.php index 572f1dd6e..9b96fdde8 100644 --- a/tests/PhpPresentation/Tests/HashTableTest.php +++ b/tests/PhpPresentation/Tests/HashTableTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\HashTable; use PhpOffice\PhpPresentation\Slide; +use PHPUnit\Framework\TestCase; /** * Test class for HashTable * * @coversDefaultClass PhpOffice\PhpPresentation\HashTable */ -class HashTableTest extends \PHPUnit_Framework_TestCase +class HashTableTest extends TestCase { /** */ diff --git a/tests/PhpPresentation/Tests/IOFactoryTest.php b/tests/PhpPresentation/Tests/IOFactoryTest.php index c03089983..bbddb0e49 100644 --- a/tests/PhpPresentation/Tests/IOFactoryTest.php +++ b/tests/PhpPresentation/Tests/IOFactoryTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\IOFactory; use PhpOffice\PhpPresentation\PhpPresentation; +use PHPUnit\Framework\TestCase; /** * Test class for IOFactory * * @coversDefaultClass PhpOffice\PhpPresentation\IOFactory */ -class IOFactoryTest extends \PHPUnit_Framework_TestCase +class IOFactoryTest extends TestCase { /** * Test create writer diff --git a/tests/PhpPresentation/Tests/PhpPresentationTest.php b/tests/PhpPresentation/Tests/PhpPresentationTest.php index c5321e2c6..06594269b 100644 --- a/tests/PhpPresentation/Tests/PhpPresentationTest.php +++ b/tests/PhpPresentation/Tests/PhpPresentationTest.php @@ -21,13 +21,14 @@ use PhpOffice\PhpPresentation\DocumentProperties; use PhpOffice\PhpPresentation\PhpPresentation; use PhpOffice\PhpPresentation\PresentationProperties; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class PhpPresentationTest extends \PHPUnit_Framework_TestCase +class PhpPresentationTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/PresentationPropertiesTest.php b/tests/PhpPresentation/Tests/PresentationPropertiesTest.php index 5350b6595..c3a05ef6a 100644 --- a/tests/PhpPresentation/Tests/PresentationPropertiesTest.php +++ b/tests/PhpPresentation/Tests/PresentationPropertiesTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\PresentationProperties; +use PHPUnit\Framework\TestCase; /** * Test class for DocumentProperties * * @coversDefaultClass PhpOffice\PhpPresentation\PresentationProperties */ -class PresentationPropertiesTest extends \PHPUnit_Framework_TestCase +class PresentationPropertiesTest extends TestCase { public function testCommentVisible() { diff --git a/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php b/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php index 5e6bb66f4..7cf144f80 100644 --- a/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php +++ b/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php @@ -20,13 +20,14 @@ use PhpOffice\PhpPresentation\Reader\ODPresentation; use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\Bullet; +use PHPUnit\Framework\TestCase; /** * Test class for ODPresentation reader * * @coversDefaultClass PhpOffice\PhpPresentation\Reader\ODPresentation */ -class ODPresentationTest extends \PHPUnit_Framework_TestCase +class ODPresentationTest extends TestCase { /** * Test can read @@ -34,20 +35,20 @@ class ODPresentationTest extends \PHPUnit_Framework_TestCase public function testCanRead() { $object = new ODPresentation(); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; $this->assertFalse($object->canRead($file)); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; $this->assertFalse($object->canRead($file)); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; $this->assertFalse($object->canRead($file)); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.odp'; $this->assertTrue($object->canRead($file)); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -57,7 +58,7 @@ public function testLoadFileNotExists() $object = new ODPresentation(); $object->load(''); } - + /** * @expectedException \Exception * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\ODPresentation: @@ -68,7 +69,7 @@ public function testLoadFileBadFormat() $object = new ODPresentation(); $object->load($file); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -78,7 +79,7 @@ public function testFileSupportsNotExists() $object = new ODPresentation(); $object->fileSupportsUnserializePhpPresentation(''); } - + public function testLoadFile01() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.odp'; @@ -94,7 +95,7 @@ public function testLoadFile01() $this->assertEquals('office 2007 openxml libreoffice odt php', $oPhpPresentation->getDocumentProperties()->getKeywords()); // $this->assertCount(4, $oPhpPresentation->getAllSlides()); - + // Slide 1 $oSlide1 = $oPhpPresentation->getSlide(0); $arrayShape = $oSlide1->getShapeCollection(); @@ -140,7 +141,7 @@ public function testLoadFile01() $this->assertTrue($oRichText->getFont()->isBold()); $this->assertEquals(60, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 2 $oSlide2 = $oPhpPresentation->getSlide(1); $arrayShape = $oSlide2->getShapeCollection(); @@ -237,7 +238,7 @@ public function testLoadFile01() $this->assertEquals('Supports writing to different file formats', $oRichText->getText()); $this->assertEquals(36, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 3 $oSlide2 = $oPhpPresentation->getSlide(2); $arrayShape = $oSlide2->getShapeCollection(); @@ -394,7 +395,7 @@ public function testLoadFile01() $this->assertEquals('... (more to come) ...', $oRichText->getText()); $this->assertEquals(36, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 4 $oSlide3 = $oPhpPresentation->getSlide(3); $arrayShape = $oSlide3->getShapeCollection(); diff --git a/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php index 2a2c5f4f9..d8be52030 100644 --- a/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php +++ b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php @@ -21,13 +21,14 @@ use PhpOffice\PhpPresentation\Reader\PowerPoint2007; use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\Bullet; +use PHPUnit\Framework\TestCase; /** * Test class for PowerPoint2007 reader * * @coversDefaultClass PhpOffice\PhpPresentation\Reader\PowerPoint2007 */ -class PowerPoint2007Test extends \PHPUnit_Framework_TestCase +class PowerPoint2007Test extends TestCase { /** * Test can read @@ -35,17 +36,17 @@ class PowerPoint2007Test extends \PHPUnit_Framework_TestCase public function testCanRead() { $object = new PowerPoint2007(); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; $this->assertFalse($object->canRead($file)); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; $this->assertFalse($object->canRead($file)); - + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; $this->assertTrue($object->canRead($file)); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -55,7 +56,7 @@ public function testLoadFileNotExists() $object = new PowerPoint2007(); $object->load(''); } - + /** * @expectedException \Exception * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint2007: @@ -66,7 +67,7 @@ public function testLoadFileBadFormat() $object = new PowerPoint2007(); $object->load($file); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -76,7 +77,7 @@ public function testFileSupportsNotExists() $object = new PowerPoint2007(); $object->fileSupportsUnserializePhpPresentation(''); } - + public function testLoadFile01() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; @@ -98,7 +99,7 @@ public function testLoadFile01() // Slides $this->assertCount(4, $oPhpPresentation->getAllSlides()); - + // Slide 1 $oSlide1 = $oPhpPresentation->getSlide(0); $arrayShape = $oSlide1->getShapeCollection(); @@ -144,7 +145,7 @@ public function testLoadFile01() $this->assertTrue($oRichText->getFont()->isBold()); $this->assertEquals(60, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 2 $oSlide2 = $oPhpPresentation->getSlide(1); $arrayShape = $oSlide2->getShapeCollection(); @@ -241,7 +242,7 @@ public function testLoadFile01() $this->assertEquals('Supports writing to different file formats', $oRichText->getText()); $this->assertEquals(36, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 3 $oSlide2 = $oPhpPresentation->getSlide(2); $arrayShape = $oSlide2->getShapeCollection(); @@ -398,7 +399,7 @@ public function testLoadFile01() $this->assertEquals('... (more to come) ...', $oRichText->getText()); $this->assertEquals(36, $oRichText->getFont()->getSize()); $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); - + // Slide 4 $oSlide3 = $oPhpPresentation->getSlide(3); $arrayShape = $oSlide3->getShapeCollection(); diff --git a/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php b/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php index 12aa1a6c1..fafc54b8e 100644 --- a/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php +++ b/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Reader; use PhpOffice\PhpPresentation\Reader\PowerPoint97; +use PHPUnit\Framework\TestCase; /** * Test class for PowerPoint97 reader * * @coversDefaultClass PhpOffice\PhpPresentation\Reader\PowerPoint97 */ -class PowerPoint97Test extends \PHPUnit_Framework_TestCase +class PowerPoint97Test extends TestCase { /** * Test can read @@ -36,7 +37,7 @@ public function testCanRead() $this->assertTrue($object->canRead($file)); } - + /** * Test cant read @@ -45,10 +46,10 @@ public function testCantRead() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; $object = new PowerPoint97(); - + $this->assertFalse($object->canRead($file)); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -58,7 +59,7 @@ public function testLoadFileNotExists() $object = new PowerPoint97(); $object->load(''); } - + /** * @expectedException \Exception * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint97: @@ -69,7 +70,7 @@ public function testLoadFileBadFormat() $object = new PowerPoint97(); $object->load($file); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -79,7 +80,7 @@ public function testFileSupportsNotExists() $object = new PowerPoint97(); $object->fileSupportsUnserializePhpPresentation(''); } - + public function testLoadFile01() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; @@ -87,11 +88,11 @@ public function testLoadFile01() $oPhpPresentation = $object->load($file); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); $this->assertEquals(1, $oPhpPresentation->getSlideCount()); - + $oSlide = $oPhpPresentation->getSlide(0); $this->assertCount(2, $oSlide->getShapeCollection()); } - + public function testLoadFile02() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_02.ppt'; @@ -99,20 +100,20 @@ public function testLoadFile02() $oPhpPresentation = $object->load($file); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); $this->assertEquals(4, $oPhpPresentation->getSlideCount()); - + $oSlide = $oPhpPresentation->getSlide(0); $this->assertCount(2, $oSlide->getShapeCollection()); - + $oSlide = $oPhpPresentation->getSlide(1); $this->assertCount(3, $oSlide->getShapeCollection()); - + $oSlide = $oPhpPresentation->getSlide(2); $this->assertCount(3, $oSlide->getShapeCollection()); - + $oSlide = $oPhpPresentation->getSlide(3); $this->assertCount(3, $oSlide->getShapeCollection()); } - + public function testLoadFile03() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_03.ppt'; @@ -120,11 +121,11 @@ public function testLoadFile03() $oPhpPresentation = $object->load($file); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); $this->assertEquals(1, $oPhpPresentation->getSlideCount()); - + $oSlide = $oPhpPresentation->getSlide(0); $this->assertCount(1, $oSlide->getShapeCollection()); } - + public function testLoadFile04() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_04.ppt'; @@ -132,7 +133,7 @@ public function testLoadFile04() $oPhpPresentation = $object->load($file); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); $this->assertEquals(1, $oPhpPresentation->getSlideCount()); - + $oSlide = $oPhpPresentation->getSlide(0); $this->assertCount(4, $oSlide->getShapeCollection()); } diff --git a/tests/PhpPresentation/Tests/Reader/SerializedTest.php b/tests/PhpPresentation/Tests/Reader/SerializedTest.php index 6f7bbfddd..bcc309750 100644 --- a/tests/PhpPresentation/Tests/Reader/SerializedTest.php +++ b/tests/PhpPresentation/Tests/Reader/SerializedTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Reader; use PhpOffice\PhpPresentation\Reader\Serialized; +use PHPUnit\Framework\TestCase; /** * Test class for serialized reader * * @coversDefaultClass PhpOffice\PhpPresentation\Reader\Serialized */ -class SerializedTest extends \PHPUnit_Framework_TestCase +class SerializedTest extends TestCase { /** * Test can read @@ -36,7 +37,7 @@ public function testCanRead() $this->assertTrue($object->canRead($file)); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -46,7 +47,7 @@ public function testLoadFileNotExists() $object = new Serialized(); $object->load(''); } - + /** * @expectedException \Exception * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\Serialized: @@ -57,7 +58,7 @@ public function testLoadFileBadFormat() $object = new Serialized(); $object->load($file); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. @@ -67,7 +68,7 @@ public function testFileSupportsNotExists() $object = new Serialized(); $object->fileSupportsUnserializePhpPresentation(''); } - + public function testLoadSerializedFileNotExists() { $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); @@ -75,7 +76,7 @@ public function testLoadSerializedFileNotExists() $oArchive->open($file, \ZipArchive::CREATE); $oArchive->addFromString('PhpPresentation.xml', ''); $oArchive->close(); - + $object = new Serialized(); $this->assertNull($object->load($file)); } diff --git a/tests/PhpPresentation/Tests/Shape/AbstractGraphicTest.php b/tests/PhpPresentation/Tests/Shape/AbstractGraphicTest.php index 2f6b2cb76..797aa4601 100644 --- a/tests/PhpPresentation/Tests/Shape/AbstractGraphicTest.php +++ b/tests/PhpPresentation/Tests/Shape/AbstractGraphicTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\AbstractGraphic; +use PHPUnit\Framework\TestCase; /** * Test class for Table element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\AbstractGraphic */ -class AbstractGraphicTest extends \PHPUnit_Framework_TestCase +class AbstractGraphicTest extends TestCase { public function testWidthAndHeight() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php index f29046416..a245ccfbe 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Axis; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for Axis element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Axis */ -class AxisTest extends \PHPUnit_Framework_TestCase +class AxisTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/GridlinesTest.php b/tests/PhpPresentation/Tests/Shape/Chart/GridlinesTest.php index 6a4fd4ea0..4aeff224b 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/GridlinesTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/GridlinesTest.php @@ -3,8 +3,9 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Chart; use PhpOffice\PhpPresentation\Shape\Chart\Gridlines; +use PHPUnit\Framework\TestCase; -class GridlinesTest extends \PHPUnit_Framework_TestCase +class GridlinesTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php b/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php index b9be6f5d8..9df161465 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php @@ -22,13 +22,14 @@ use PhpOffice\PhpPresentation\Style\Border; use PhpOffice\PhpPresentation\Style\Fill; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for Legend element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Legend */ -class LegendTest extends \PHPUnit_Framework_TestCase +class LegendTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/MarkerTest.php b/tests/PhpPresentation/Tests/Shape/Chart/MarkerTest.php index d351d9460..ae915aa0d 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/MarkerTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/MarkerTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Chart; use PhpOffice\PhpPresentation\Shape\Chart\Marker; +use PHPUnit\Framework\TestCase; /** * Test class for Legend element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Marker */ -class MarkerTest extends \PHPUnit_Framework_TestCase +class MarkerTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php b/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php index 7a0c2fd2d..e34a56b20 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php @@ -21,13 +21,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Axis; use PhpOffice\PhpPresentation\Shape\Chart\PlotArea; use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D; +use PHPUnit\Framework\TestCase; /** * Test class for PlotArea element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\PlotArea */ -class PlotAreaTest extends \PHPUnit_Framework_TestCase +class PlotAreaTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php index 5e3db19c9..943d810d1 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php @@ -22,13 +22,14 @@ use PhpOffice\PhpPresentation\Style\Fill; use PhpOffice\PhpPresentation\Style\Font; use PhpOffice\PhpPresentation\Style\Outline; +use PHPUnit\Framework\TestCase; /** * Test class for Series element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Series */ -class SeriesTest extends \PHPUnit_Framework_TestCase +class SeriesTest extends TestCase { public function testConstruct() { @@ -45,21 +46,21 @@ public function testConstruct() $this->assertNull($object->getOutline()); $this->assertFalse($object->hasShowLegendKey()); } - + public function testDataLabelNumFormat() { $object = new Series(); - + $this->assertEmpty($object->getDlblNumFormat()); $this->assertFalse($object->hasDlblNumFormat()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setDlblNumFormat('#%')); - + $this->assertEquals('#%', $object->getDlblNumFormat()); $this->assertTrue($object->hasDlblNumFormat()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setDlblNumFormat()); - + $this->assertEmpty($object->getDlblNumFormat()); $this->assertFalse($object->hasDlblNumFormat()); } diff --git a/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php index a2ba66f9e..ecf5580f6 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php @@ -20,13 +20,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Title; use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for Title element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Title */ -class TitleTest extends \PHPUnit_Framework_TestCase +class TitleTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php index bb57012bf..44ef9f6f1 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Series; use PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter; +use PHPUnit\Framework\TestCase; /** * Test class for Scatter element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter */ -class AbstractTest extends \PHPUnit_Framework_TestCase +class AbstractTest extends TestCase { public function testAxis() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php index 321d8a0e5..2235473de 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Area; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Bar3D element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D */ -class AreaTest extends \PHPUnit_Framework_TestCase +class AreaTest extends TestCase { public function testData() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php index 1fdbc092f..d7aff69bd 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Bar3D element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D */ -class Bar3DTest extends \PHPUnit_Framework_TestCase +class Bar3DTest extends TestCase { public function testData() { @@ -52,7 +53,7 @@ public function testSeries() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->addSeries(new Series())); $this->assertCount(1, $object->getSeries()); } - + public function testBarDirection() { $object = new Bar3D(); diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php index 382684ead..75b64f052 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Bar element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Bar */ -class BarTest extends \PHPUnit_Framework_TestCase +class BarTest extends TestCase { public function testData() { @@ -52,7 +53,7 @@ public function testSeries() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->addSeries(new Series())); $this->assertCount(1, $object->getSeries()); } - + public function testBarDirection() { $object = new Bar(); diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/DoughnutTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/DoughnutTest.php index c04cfa837..a1a3155cb 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/DoughnutTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/DoughnutTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Doughnut; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Doughnut element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Doughnut */ -class DoughnutTest extends \PHPUnit_Framework_TestCase +class DoughnutTest extends TestCase { public function testData() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php index f8d0006a9..4cbb03c78 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Line; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Line element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Line */ -class LineTest extends \PHPUnit_Framework_TestCase +class LineTest extends TestCase { public function testData() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php index ebdf555cf..32888a900 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Pie3D element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D */ -class Pie3DTest extends \PHPUnit_Framework_TestCase +class Pie3DTest extends TestCase { public function testData() { @@ -56,7 +57,7 @@ public function testSeries() public function testExplosion() { $value = rand(0, 100); - + $object = new Pie3D(); $this->assertEquals(0, $object->getExplosion()); diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php index a0d77e8cd..f32b3a32e 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Pie element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Pie */ -class PieTest extends \PHPUnit_Framework_TestCase +class PieTest extends TestCase { public function testData() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php index f74c92091..a574601e3 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter; use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PHPUnit\Framework\TestCase; /** * Test class for Scatter element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter */ -class ScatterTest extends \PHPUnit_Framework_TestCase +class ScatterTest extends TestCase { public function testData() { diff --git a/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php index 720376be8..c2fb4dd02 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Chart; use PhpOffice\PhpPresentation\Shape\Chart\View3D; +use PHPUnit\Framework\TestCase; /** * Test class for View3D element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart\View3D */ -class View3DTest extends \PHPUnit_Framework_TestCase +class View3DTest extends TestCase { public function testDepthPercent() { diff --git a/tests/PhpPresentation/Tests/Shape/ChartTest.php b/tests/PhpPresentation/Tests/Shape/ChartTest.php index 4ff2ff232..bf7a3226f 100644 --- a/tests/PhpPresentation/Tests/Shape/ChartTest.php +++ b/tests/PhpPresentation/Tests/Shape/ChartTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Chart; +use PHPUnit\Framework\TestCase; /** * Test class for Chart element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Chart */ -class ChartTest extends \PHPUnit_Framework_TestCase +class ChartTest extends TestCase { public function testConstruct() { @@ -35,14 +36,14 @@ public function testConstruct() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->getPlotArea()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->getView3D()); } - + public function testClone() { $object = new Chart(); - + $oClone = clone $object; - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $oClone); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $oClone->getTitle()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $oClone->getLegend()); diff --git a/tests/PhpPresentation/Tests/Shape/Comment/AuthorTest.php b/tests/PhpPresentation/Tests/Shape/Comment/AuthorTest.php index cc4afc082..f88dc2a81 100644 --- a/tests/PhpPresentation/Tests/Shape/Comment/AuthorTest.php +++ b/tests/PhpPresentation/Tests/Shape/Comment/AuthorTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Comment; use PhpOffice\PhpPresentation\Shape\Comment\Author; +use PHPUnit\Framework\TestCase; /** * Test class for Author element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Comment\Author */ -class AuthorTest extends \PHPUnit_Framework_TestCase +class AuthorTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/CommentTest.php b/tests/PhpPresentation/Tests/Shape/CommentTest.php index 84391c163..c545f1496 100644 --- a/tests/PhpPresentation/Tests/Shape/CommentTest.php +++ b/tests/PhpPresentation/Tests/Shape/CommentTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Comment; +use PHPUnit\Framework\TestCase; /** * Test class for Chart element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Comment */ -class CommentTest extends \PHPUnit_Framework_TestCase +class CommentTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Drawing/Base64Test.php b/tests/PhpPresentation/Tests/Shape/Drawing/Base64Test.php index c47b0149b..9bb1c2f8c 100644 --- a/tests/PhpPresentation/Tests/Shape/Drawing/Base64Test.php +++ b/tests/PhpPresentation/Tests/Shape/Drawing/Base64Test.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Drawing; use PhpOffice\PhpPresentation\Shape\Drawing\Base64; +use PHPUnit\Framework\TestCase; /** * Test class for Drawing element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Drawing */ -class Base64Test extends \PHPUnit_Framework_TestCase +class Base64Test extends TestCase { public function setUp() { diff --git a/tests/PhpPresentation/Tests/Shape/Drawing/FileTest.php b/tests/PhpPresentation/Tests/Shape/Drawing/FileTest.php index 75cdeda96..2321df5c1 100644 --- a/tests/PhpPresentation/Tests/Shape/Drawing/FileTest.php +++ b/tests/PhpPresentation/Tests/Shape/Drawing/FileTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Drawing; use PhpOffice\PhpPresentation\Shape\Drawing\File; +use PHPUnit\Framework\TestCase; /** * Test class for Drawing element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Drawing */ -class FileTest extends \PHPUnit_Framework_TestCase +class FileTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/Drawing/ZipFileTest.php b/tests/PhpPresentation/Tests/Shape/Drawing/ZipFileTest.php index a62bd1dbe..d06354ab9 100644 --- a/tests/PhpPresentation/Tests/Shape/Drawing/ZipFileTest.php +++ b/tests/PhpPresentation/Tests/Shape/Drawing/ZipFileTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\Drawing; use PhpOffice\PhpPresentation\Shape\Drawing\ZipFile; +use PHPUnit\Framework\TestCase; /** * Test class for Drawing element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Drawing */ -class ZipFileTest extends \PHPUnit_Framework_TestCase +class ZipFileTest extends TestCase { protected $fileOk; protected $fileKoZip; diff --git a/tests/PhpPresentation/Tests/Shape/GroupTest.php b/tests/PhpPresentation/Tests/Shape/GroupTest.php index 959e7ac31..dbfa82dcd 100644 --- a/tests/PhpPresentation/Tests/Shape/GroupTest.php +++ b/tests/PhpPresentation/Tests/Shape/GroupTest.php @@ -19,18 +19,19 @@ use PhpOffice\PhpPresentation\Shape\Group; use PhpOffice\PhpPresentation\Shape\Line; +use PHPUnit\Framework\TestCase; /** * Test class for Group element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Group */ -class GroupTest extends \PHPUnit_Framework_TestCase +class GroupTest extends TestCase { public function testConstruct() { $object = new Group(); - + $this->assertEquals(0, $object->getOffsetX()); $this->assertEquals(0, $object->getOffsetY()); $this->assertEquals(0, $object->getExtentX()); @@ -39,11 +40,11 @@ public function testConstruct() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setWidth(rand(1, 100))); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setHeight(rand(1, 100))); } - + public function testAdd() { $object = new Group(); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->createChartShape()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing\\File', $object->createDrawingShape()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Line', $object->createLineShape(10, 10, 10, 10)); @@ -51,7 +52,7 @@ public function testAdd() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table', $object->createTableShape()); $this->assertEquals(5, $object->getShapeCollection()->count()); } - + public function testExtentX() { $object = new Group(); @@ -60,7 +61,7 @@ public function testExtentX() $this->assertEquals(30, $object->getExtentX()); } - + public function testExtentY() { $object = new Group(); @@ -69,7 +70,7 @@ public function testExtentY() $this->assertEquals(40, $object->getExtentY()); } - + public function testOffsetX() { $object = new Group(); @@ -77,11 +78,11 @@ public function testOffsetX() $object->addShape($line1); $this->assertEquals(10, $object->getOffsetX()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setOffsetX(rand(1, 100))); $this->assertEquals(10, $object->getOffsetX()); } - + public function testOffsetY() { $object = new Group(); @@ -89,11 +90,11 @@ public function testOffsetY() $object->addShape($line1); $this->assertEquals(20, $object->getOffsetY()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setOffsetY(rand(1, 100))); $this->assertEquals(20, $object->getOffsetY()); } - + public function testExtentsAndOffsetsForOneShape() { // We record initial values here because @@ -107,7 +108,7 @@ public function testExtentsAndOffsetsForOneShape() $object = new Group(); $line1 = new Line($offsetX, $offsetY, $extentX, $extentY); $object->addShape($line1); - + $this->assertEquals($offsetX, $object->getOffsetX()); $this->assertEquals($offsetY, $object->getOffsetY()); $this->assertEquals($extentX, $object->getExtentX()); @@ -135,10 +136,10 @@ public function testExtentsAndOffsetsForTwoShapes() ); $object = new Group(); - + $object->addShape($line1); $object->addShape($line2); - + $this->assertEquals($offsetX, $object->getOffsetX()); $this->assertEquals($offsetY, $object->getOffsetY()); $this->assertEquals($extentX+$increase, $object->getExtentX()); diff --git a/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php b/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php index 85e241807..cfeeb6dc4 100644 --- a/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php +++ b/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Hyperlink; +use PHPUnit\Framework\TestCase; /** * Test class for hyperlink element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Hyperlink */ -class HyperlinkTest extends \PHPUnit_Framework_TestCase +class HyperlinkTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/LineTest.php b/tests/PhpPresentation/Tests/Shape/LineTest.php index cac59a992..d452a925e 100644 --- a/tests/PhpPresentation/Tests/Shape/LineTest.php +++ b/tests/PhpPresentation/Tests/Shape/LineTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Line; use PhpOffice\PhpPresentation\Style\Border; +use PHPUnit\Framework\TestCase; /** * Test class for memory drawing element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Line */ -class LineTest extends \PHPUnit_Framework_TestCase +class LineTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/MediaTest.php b/tests/PhpPresentation/Tests/Shape/MediaTest.php index ef634299e..76c9bcb6b 100644 --- a/tests/PhpPresentation/Tests/Shape/MediaTest.php +++ b/tests/PhpPresentation/Tests/Shape/MediaTest.php @@ -3,8 +3,9 @@ namespace PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Media; +use PHPUnit\Framework\TestCase; -class MediaTest extends \PHPUnit_Framework_TestCase +class MediaTest extends TestCase { public function testInheritance() { diff --git a/tests/PhpPresentation/Tests/Shape/PlaceholderTest.php b/tests/PhpPresentation/Tests/Shape/PlaceholderTest.php index 864dddba6..d9dcb1142 100644 --- a/tests/PhpPresentation/Tests/Shape/PlaceholderTest.php +++ b/tests/PhpPresentation/Tests/Shape/PlaceholderTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Placeholder; +use PHPUnit\Framework\TestCase; /** * Test class for Table element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Table */ -class PlaceholderTest extends \PHPUnit_Framework_TestCase +class PlaceholderTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php b/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php index 6a03b335a..bcdeb57a8 100644 --- a/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape\RichText; use PhpOffice\PhpPresentation\Shape\RichText\BreakElement; +use PHPUnit\Framework\TestCase; /** * Test class for BreakElement element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\RichText\BreakElement */ -class BreakElementTest extends \PHPUnit_Framework_TestCase +class BreakElementTest extends TestCase { /** * Test can read @@ -52,7 +53,7 @@ public function testLanguage() $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->setLanguage('en-US')); $this->assertNull($object->getLanguage()); } - + /** * Test get/set hash index */ diff --git a/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php index 4ab5ca6cf..36f5650ef 100644 --- a/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php @@ -22,13 +22,14 @@ use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\Bullet; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for Paragraph element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\RichText\Paragraph */ -class ParagraphTest extends \PHPUnit_Framework_TestCase +class ParagraphTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php b/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php index 8dda48d65..eeb695a67 100644 --- a/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\RichText\Run; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for Run element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\RichText\Run */ -class RunTest extends \PHPUnit_Framework_TestCase +class RunTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php b/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php index 4a9034cf8..4174721cf 100644 --- a/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Hyperlink; use PhpOffice\PhpPresentation\Shape\RichText\TextElement; +use PHPUnit\Framework\TestCase; /** * Test class for TextElement element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\RichText\TextElement */ -class TextElementTest extends \PHPUnit_Framework_TestCase +class TextElementTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/RichTextTest.php b/tests/PhpPresentation/Tests/Shape/RichTextTest.php index 07cac16fc..0c903c405 100644 --- a/tests/PhpPresentation/Tests/Shape/RichTextTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichTextTest.php @@ -20,13 +20,14 @@ use PhpOffice\PhpPresentation\Shape\RichText; use PhpOffice\PhpPresentation\Shape\RichText\TextElement; use PhpOffice\PhpPresentation\Shape\RichText\Paragraph; +use PHPUnit\Framework\TestCase; /** * Test class for RichText element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\RichText */ -class RichTextTest extends \PHPUnit_Framework_TestCase +class RichTextTest extends TestCase { public function testConstruct() { @@ -149,36 +150,36 @@ public function testGetSetAutoFit() public function testGetSetHAutoShrink() { $object = new RichText(); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal()); $this->assertNull($object->hasAutoShrinkHorizontal()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(2)); $this->assertNull($object->hasAutoShrinkHorizontal()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(true)); $this->assertTrue($object->hasAutoShrinkHorizontal()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(false)); $this->assertFalse($object->hasAutoShrinkHorizontal()); } public function testGetSetVAutoShrink() { $object = new RichText(); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical()); $this->assertNull($object->hasAutoShrinkVertical()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(2)); $this->assertNull($object->hasAutoShrinkVertical()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(true)); $this->assertTrue($object->hasAutoShrinkVertical()); - + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(false)); $this->assertFalse($object->hasAutoShrinkVertical()); } - + public function testGetSetHOverflow() { $object = new RichText(); diff --git a/tests/PhpPresentation/Tests/Shape/Table/CellTest.php b/tests/PhpPresentation/Tests/Shape/Table/CellTest.php index 94d6b2420..6d9e9040d 100644 --- a/tests/PhpPresentation/Tests/Shape/Table/CellTest.php +++ b/tests/PhpPresentation/Tests/Shape/Table/CellTest.php @@ -22,13 +22,14 @@ use PhpOffice\PhpPresentation\Shape\RichText\TextElement; use PhpOffice\PhpPresentation\Style\Borders; use PhpOffice\PhpPresentation\Style\Fill; +use PHPUnit\Framework\TestCase; /** * Test class for Cell element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Cell */ -class CellTest extends \PHPUnit_Framework_TestCase +class CellTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/Table/RowTest.php b/tests/PhpPresentation/Tests/Shape/Table/RowTest.php index 8df703e23..afea5df52 100644 --- a/tests/PhpPresentation/Tests/Shape/Table/RowTest.php +++ b/tests/PhpPresentation/Tests/Shape/Table/RowTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\Table\Row; use PhpOffice\PhpPresentation\Style\Fill; +use PHPUnit\Framework\TestCase; /** * Test class for Row element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Row */ -class RowTest extends \PHPUnit_Framework_TestCase +class RowTest extends TestCase { /** * Test can read diff --git a/tests/PhpPresentation/Tests/Shape/TableTest.php b/tests/PhpPresentation/Tests/Shape/TableTest.php index b3bab6e34..983e72baa 100644 --- a/tests/PhpPresentation/Tests/Shape/TableTest.php +++ b/tests/PhpPresentation/Tests/Shape/TableTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Shape; use PhpOffice\PhpPresentation\Shape\Table; +use PHPUnit\Framework\TestCase; /** * Test class for Table element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Table */ -class TableTest extends \PHPUnit_Framework_TestCase +class TableTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Slide/AbstractSlideTest.php b/tests/PhpPresentation/Tests/Slide/AbstractSlideTest.php index e84939eb3..534ca8419 100644 --- a/tests/PhpPresentation/Tests/Slide/AbstractSlideTest.php +++ b/tests/PhpPresentation/Tests/Slide/AbstractSlideTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Shape\RichText; use PhpOffice\PhpPresentation\Slide\AbstractSlide; +use PHPUnit\Framework\TestCase; /** * Test class for Table element * * @coversDefaultClass PhpOffice\PhpPresentation\Shape\AbstractGraphic */ -class AbstractSlideTest extends \PHPUnit_Framework_TestCase +class AbstractSlideTest extends TestCase { public function testCollection() { diff --git a/tests/PhpPresentation/Tests/Slide/AnimationTest.php b/tests/PhpPresentation/Tests/Slide/AnimationTest.php index 0a1a065e3..51b4ab6d4 100644 --- a/tests/PhpPresentation/Tests/Slide/AnimationTest.php +++ b/tests/PhpPresentation/Tests/Slide/AnimationTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\Slide\Animation; +use PHPUnit\Framework\TestCase; /** * Test class for Animation * * @coversDefaultClass PhpOffice\PhpPresentation\Slide\Animation */ -class AnimationTest extends \PHPUnit_Framework_TestCase +class AnimationTest extends TestCase { public function testShape() { diff --git a/tests/PhpPresentation/Tests/Slide/Background/ColorTest.php b/tests/PhpPresentation/Tests/Slide/Background/ColorTest.php index 7221cf81a..5dd7839a6 100644 --- a/tests/PhpPresentation/Tests/Slide/Background/ColorTest.php +++ b/tests/PhpPresentation/Tests/Slide/Background/ColorTest.php @@ -4,8 +4,9 @@ use PhpOffice\PhpPresentation\Slide\Background\Color; use PhpOffice\PhpPresentation\Style\Color as StyleColor; +use PHPUnit\Framework\TestCase; -class ColorTest extends \PHPUnit_Framework_TestCase +class ColorTest extends TestCase { public function testColor() { diff --git a/tests/PhpPresentation/Tests/Slide/Background/ImageTest.php b/tests/PhpPresentation/Tests/Slide/Background/ImageTest.php index af449da21..6f5c9fd62 100644 --- a/tests/PhpPresentation/Tests/Slide/Background/ImageTest.php +++ b/tests/PhpPresentation/Tests/Slide/Background/ImageTest.php @@ -3,8 +3,9 @@ namespace PhpOffice\PhpPresentation\Tests\Slide\Background; use PhpOffice\PhpPresentation\Slide\Background\Image; +use PHPUnit\Framework\TestCase; -class ImageTest extends \PHPUnit_Framework_TestCase +class ImageTest extends TestCase { public function testColor() { diff --git a/tests/PhpPresentation/Tests/Slide/Background/SchemeColorTest.php b/tests/PhpPresentation/Tests/Slide/Background/SchemeColorTest.php index 680e773a6..0689c2faa 100644 --- a/tests/PhpPresentation/Tests/Slide/Background/SchemeColorTest.php +++ b/tests/PhpPresentation/Tests/Slide/Background/SchemeColorTest.php @@ -4,8 +4,9 @@ use PhpOffice\PhpPresentation\Slide\Background\SchemeColor; use PhpOffice\PhpPresentation\Style\SchemeColor as StyleSchemeColor; +use PHPUnit\Framework\TestCase; -class SchemeColorTest extends \PHPUnit_Framework_TestCase +class SchemeColorTest extends TestCase { public function testBasic() { diff --git a/tests/PhpPresentation/Tests/Slide/IteratorTest.php b/tests/PhpPresentation/Tests/Slide/IteratorTest.php index 053ea829a..7ed6f53dc 100644 --- a/tests/PhpPresentation/Tests/Slide/IteratorTest.php +++ b/tests/PhpPresentation/Tests/Slide/IteratorTest.php @@ -20,13 +20,14 @@ use PhpOffice\PhpPresentation\PhpPresentation; use PhpOffice\PhpPresentation\Slide; use PhpOffice\PhpPresentation\Slide\Iterator; +use PHPUnit\Framework\TestCase; /** * Test class for IOFactory * * @coversDefaultClass PhpOffice\PhpPresentation\IOFactory */ -class IteratorTest extends \PHPUnit_Framework_TestCase +class IteratorTest extends TestCase { /** */ diff --git a/tests/PhpPresentation/Tests/Slide/NoteTest.php b/tests/PhpPresentation/Tests/Slide/NoteTest.php index b57499fa2..48f93e3d6 100644 --- a/tests/PhpPresentation/Tests/Slide/NoteTest.php +++ b/tests/PhpPresentation/Tests/Slide/NoteTest.php @@ -20,25 +20,26 @@ use PhpOffice\PhpPresentation\PhpPresentation; use PhpOffice\PhpPresentation\Shape\RichText; use PhpOffice\PhpPresentation\Slide\Note; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class NoteTest extends \PHPUnit_Framework_TestCase +class NoteTest extends TestCase { public function testParent() { $object = new Note(); $this->assertNull($object->getParent()); - + $oPhpPresentation = new PhpPresentation(); $oSlide = $oPhpPresentation->createSlide(); $oSlide->setNote($object); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->getParent()); } - + public function testExtent() { $object = new Note(); @@ -47,13 +48,13 @@ public function testExtent() $object = new Note(); $this->assertNotNull($object->getExtentY()); } - + public function testHashCode() { $object = new Note(); $this->assertInternalType('string', $object->getHashCode()); } - + public function testOffset() { $object = new Note(); @@ -62,14 +63,14 @@ public function testOffset() $object = new Note(); $this->assertNotNull($object->getOffsetY()); } - + public function testShape() { $object = new Note(); $this->assertEquals(0, $object->getShapeCollection()->count()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->createRichTextShape()); $this->assertEquals(1, $object->getShapeCollection()->count()); - + $oRichText = new RichText(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->addShape($oRichText)); $this->assertEquals(2, $object->getShapeCollection()->count()); diff --git a/tests/PhpPresentation/Tests/Slide/SlideLayoutTest.php b/tests/PhpPresentation/Tests/Slide/SlideLayoutTest.php index aa01d46ff..368d5ee33 100644 --- a/tests/PhpPresentation/Tests/Slide/SlideLayoutTest.php +++ b/tests/PhpPresentation/Tests/Slide/SlideLayoutTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\Slide\SlideLayout; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\Slide\SlideLayout */ -class SlideLayoutTest extends \PHPUnit_Framework_TestCase +class SlideLayoutTest extends TestCase { public function testBase() { @@ -35,7 +36,7 @@ public function testBase() $this->assertInstanceOf('\\ArrayObject', $object->getShapeCollection()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\ColorMap', $object->colorMap); } - + public function testLayoutName() { // Mocks diff --git a/tests/PhpPresentation/Tests/Slide/SlideMasterTest.php b/tests/PhpPresentation/Tests/Slide/SlideMasterTest.php index ae44d2afa..04633cdc0 100644 --- a/tests/PhpPresentation/Tests/Slide/SlideMasterTest.php +++ b/tests/PhpPresentation/Tests/Slide/SlideMasterTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\Slide\SlideMaster; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\Slide\SlideMaster */ -class SlideMasterTest extends \PHPUnit_Framework_TestCase +class SlideMasterTest extends TestCase { public function testBase() { diff --git a/tests/PhpPresentation/Tests/Slide/TransitionTest.php b/tests/PhpPresentation/Tests/Slide/TransitionTest.php index 31dace8b2..3390b11c4 100644 --- a/tests/PhpPresentation/Tests/Slide/TransitionTest.php +++ b/tests/PhpPresentation/Tests/Slide/TransitionTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests; use PhpOffice\PhpPresentation\Slide\Transition; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\Slide\Transition */ -class TransitionTest extends \PHPUnit_Framework_TestCase +class TransitionTest extends TestCase { public function testSpeed() { diff --git a/tests/PhpPresentation/Tests/SlideTest.php b/tests/PhpPresentation/Tests/SlideTest.php index 3d967e740..3c1881faa 100644 --- a/tests/PhpPresentation/Tests/SlideTest.php +++ b/tests/PhpPresentation/Tests/SlideTest.php @@ -20,46 +20,47 @@ use PhpOffice\PhpPresentation\Slide; use PhpOffice\PhpPresentation\Slide\Transition; use PhpOffice\PhpPresentation\PhpPresentation; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class SlideTest extends \PHPUnit_Framework_TestCase +class SlideTest extends TestCase { public function testExtents() { $object = new Slide(); $this->assertNotNull($object->getExtentX()); - + $object = new Slide(); $this->assertNotNull($object->getExtentY()); } - + public function testOffset() { $object = new Slide(); $this->assertNotNull($object->getOffsetX()); - + $object = new Slide(); $this->assertNotNull($object->getOffsetY()); } - + public function testParent() { $object = new Slide(); $this->assertNull($object->getParent()); - + $oPhpPresentation = new PhpPresentation(); $object = new Slide($oPhpPresentation); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getParent()); } - + public function testSlideMasterId() { $value = rand(1, 100); - + $object = new Slide(); $this->assertEquals(1, $object->getSlideMasterId()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setSlideMasterId()); diff --git a/tests/PhpPresentation/Tests/Style/AlignmentTest.php b/tests/PhpPresentation/Tests/Style/AlignmentTest.php index 7a0d05fe1..f9b3fc265 100644 --- a/tests/PhpPresentation/Tests/Style/AlignmentTest.php +++ b/tests/PhpPresentation/Tests/Style/AlignmentTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Style; use PhpOffice\PhpPresentation\Style\Alignment; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class AlignmentTest extends \PHPUnit_Framework_TestCase +class AlignmentTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/BorderTest.php b/tests/PhpPresentation/Tests/Style/BorderTest.php index fb851dcd8..04689e28f 100644 --- a/tests/PhpPresentation/Tests/Style/BorderTest.php +++ b/tests/PhpPresentation/Tests/Style/BorderTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Border; use PhpOffice\PhpPresentation\Style\Color; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class BorderTest extends \PHPUnit_Framework_TestCase +class BorderTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/BordersTest.php b/tests/PhpPresentation/Tests/Style/BordersTest.php index 2b4152c1a..ffc95e61c 100644 --- a/tests/PhpPresentation/Tests/Style/BordersTest.php +++ b/tests/PhpPresentation/Tests/Style/BordersTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Border; use PhpOffice\PhpPresentation\Style\Borders; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class BordersTest extends \PHPUnit_Framework_TestCase +class BordersTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/BulletTest.php b/tests/PhpPresentation/Tests/Style/BulletTest.php index 468c23273..464a2def8 100644 --- a/tests/PhpPresentation/Tests/Style/BulletTest.php +++ b/tests/PhpPresentation/Tests/Style/BulletTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Bullet; use PhpOffice\PhpPresentation\Style\Color; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class BulletTest extends \PHPUnit_Framework_TestCase +class BulletTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/ColorMapTest.php b/tests/PhpPresentation/Tests/Style/ColorMapTest.php index 8a17bb59a..2fdcade35 100644 --- a/tests/PhpPresentation/Tests/Style/ColorMapTest.php +++ b/tests/PhpPresentation/Tests/Style/ColorMapTest.php @@ -18,8 +18,9 @@ namespace PhpOffice\PhpPresentation\Tests\Style; use PhpOffice\PhpPresentation\Style\ColorMap; +use PHPUnit\Framework\TestCase; -class ColorMapTest extends \PHPUnit_Framework_TestCase +class ColorMapTest extends TestCase { public function testConstruct() { diff --git a/tests/PhpPresentation/Tests/Style/ColorTest.php b/tests/PhpPresentation/Tests/Style/ColorTest.php index e62388f2c..73ef362c9 100644 --- a/tests/PhpPresentation/Tests/Style/ColorTest.php +++ b/tests/PhpPresentation/Tests/Style/ColorTest.php @@ -18,13 +18,14 @@ namespace PhpOffice\PhpPresentation\Tests\Style; use PhpOffice\PhpPresentation\Style\Color; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class ColorTest extends \PHPUnit_Framework_TestCase +class ColorTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/FillTest.php b/tests/PhpPresentation/Tests/Style/FillTest.php index bf2976aec..667c69b49 100644 --- a/tests/PhpPresentation/Tests/Style/FillTest.php +++ b/tests/PhpPresentation/Tests/Style/FillTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Color; use PhpOffice\PhpPresentation\Style\Fill; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class FillTest extends \PHPUnit_Framework_TestCase +class FillTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/FontTest.php b/tests/PhpPresentation/Tests/Style/FontTest.php index 844401b37..18b5ccfb8 100644 --- a/tests/PhpPresentation/Tests/Style/FontTest.php +++ b/tests/PhpPresentation/Tests/Style/FontTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Color; use PhpOffice\PhpPresentation\Style\Font; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class FontTest extends \PHPUnit_Framework_TestCase +class FontTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/OutlineTest.php b/tests/PhpPresentation/Tests/Style/OutlineTest.php index e7cdc8900..898ab2822 100644 --- a/tests/PhpPresentation/Tests/Style/OutlineTest.php +++ b/tests/PhpPresentation/Tests/Style/OutlineTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Fill; use PhpOffice\PhpPresentation\Style\Outline; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\Style\Outline */ -class OutlineTest extends \PHPUnit_Framework_TestCase +class OutlineTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/ShadowTest.php b/tests/PhpPresentation/Tests/Style/ShadowTest.php index 78bfae9b1..93364e8f4 100644 --- a/tests/PhpPresentation/Tests/Style/ShadowTest.php +++ b/tests/PhpPresentation/Tests/Style/ShadowTest.php @@ -19,13 +19,14 @@ use PhpOffice\PhpPresentation\Style\Color; use PhpOffice\PhpPresentation\Style\Shadow; +use PHPUnit\Framework\TestCase; /** * Test class for PhpPresentation * * @coversDefaultClass PhpOffice\PhpPresentation\PhpPresentation */ -class ShadowTest extends \PHPUnit_Framework_TestCase +class ShadowTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Style/TextStyleTest.php b/tests/PhpPresentation/Tests/Style/TextStyleTest.php index 1e3a3c115..67a719d2c 100644 --- a/tests/PhpPresentation/Tests/Style/TextStyleTest.php +++ b/tests/PhpPresentation/Tests/Style/TextStyleTest.php @@ -20,8 +20,9 @@ use PhpOffice\PhpPresentation\Shape\RichText\Paragraph; use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\TextStyle; +use PHPUnit\Framework\TestCase; -class TextStyleTest extends \PHPUnit_Framework_TestCase +class TextStyleTest extends TestCase { public function testConstructDefaultTrue() { diff --git a/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php b/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php index 2606d41b8..24df13079 100644 --- a/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php +++ b/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php @@ -18,6 +18,7 @@ namespace PhpOffice\PhpPresentation\Tests\Writer; use PhpOffice\PhpPresentation\PhpPresentation; +use PHPUnit\Framework\TestCase; require 'AbstractWriter.php'; @@ -26,7 +27,7 @@ * * @coversDefaultClass AbstractWriter */ -class AbstractWriterTest extends \PHPUnit_Framework_TestCase +class AbstractWriterTest extends TestCase { /** * Test create new instance diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php index 24002cd6b..0c4baeac6 100644 --- a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php @@ -19,6 +19,7 @@ use PhpOffice\PhpPresentation\Writer\PowerPoint2007\LayoutPack\PackDefault; use PhpOffice\PhpPresentation\Writer\PowerPoint2007\LayoutPack\TemplateBased; +use PHPUnit\Framework\TestCase; /** * Test class for TemplateBased @@ -26,7 +27,7 @@ * @deprecated 0.7 * @coversDefaultClass TemplateBased */ -class TemplateBasedTest extends \PHPUnit_Framework_TestCase +class TemplateBasedTest extends TestCase { public function testFindLayout() { diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlideMastersTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlideMastersTest.php index d19136d7c..2f0b08d7f 100644 --- a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlideMastersTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlideMastersTest.php @@ -5,13 +5,14 @@ use PhpOffice\PhpPresentation\Writer\PowerPoint2007\PptSlideMasters; use PhpOffice\PhpPresentation\Slide\SlideLayout; use PhpOffice\PhpPresentation\Shape\Drawing\File as ShapeDrawingFile; +use PHPUnit\Framework\TestCase; /** * Test class for PowerPoint2007 * * @coversDefaultClass PowerPoint2007 */ -class PptSlideMastersTest extends \PHPUnit_Framework_TestCase +class PptSlideMastersTest extends TestCase { public function testWriteSlideMasterRelationships() { diff --git a/tests/PhpPresentation/Tests/Writer/SerializedTest.php b/tests/PhpPresentation/Tests/Writer/SerializedTest.php index 3e3d084c4..d55fc35d1 100644 --- a/tests/PhpPresentation/Tests/Writer/SerializedTest.php +++ b/tests/PhpPresentation/Tests/Writer/SerializedTest.php @@ -19,20 +19,21 @@ use PhpOffice\PhpPresentation\Writer\Serialized; use PhpOffice\PhpPresentation\PhpPresentation; +use PHPUnit\Framework\TestCase; /** * Test class for serialized reader * * @coversDefaultClass PhpOffice\PhpPresentation\Reader\Serialized */ -class SerializedTest extends \PHPUnit_Framework_TestCase +class SerializedTest extends TestCase { public function testConstruct() { $object = new Serialized(new PhpPresentation()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getPhpPresentation()); } - + /** * @expectedException \Exception * @expectedExceptionMessage No PhpPresentation assigned. @@ -42,7 +43,7 @@ public function testEmptyConstruct() $object = new Serialized(); $object->getPhpPresentation(); } - + /** * @expectedException \Exception * @expectedExceptionMessage Filename is empty. @@ -52,7 +53,7 @@ public function testSaveEmpty() $object = new Serialized(new PhpPresentation()); $object->save(''); } - + /** * @expectedException \Exception * @expectedExceptionMessage No PhpPresentation assigned. @@ -62,7 +63,7 @@ public function testSaveNoObject() $object = new Serialized(); $object->save('file.phpppt'); } - + public function testSave() { $oPhpPresentation = new PhpPresentation(); @@ -70,12 +71,12 @@ public function testSave() $oImage = $oSlide->createDrawingShape(); $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); $object = new Serialized($oPhpPresentation); - + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); - + $this->assertFileExists($file, $object->save($file)); } - + /** * @expectedException \Exception * @expectedExceptionMessage Could not open @@ -87,12 +88,12 @@ public function testSaveNotExistingDir() $oImage = $oSlide->createDrawingShape(); $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); $object = new Serialized($oPhpPresentation); - + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); - + $this->assertFileExists($file, $object->save($file.DIRECTORY_SEPARATOR.'test'.DIRECTORY_SEPARATOR.'test')); } - + public function testSaveOverwriting() { $oPhpPresentation = new PhpPresentation(); @@ -100,10 +101,10 @@ public function testSaveOverwriting() $oImage = $oSlide->createDrawingShape(); $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); $object = new Serialized($oPhpPresentation); - + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); file_put_contents($file, rand(1, 100)); - + $this->assertFileExists($file, $object->save($file)); } } diff --git a/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php b/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php index 2d5d97a12..996f0d2c3 100644 --- a/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php +++ b/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php @@ -4,8 +4,9 @@ use PhpOffice\PhpPresentation\IOFactory; use PhpOffice\PhpPresentation\PhpPresentation; +use PHPUnit\Framework\TestCase; -class PhpPresentationTestCase extends \PHPUnit_Framework_TestCase +class PhpPresentationTestCase extends TestCase { /** * @var PhpPresentation From a3b983ec691c1bfe8ddd37240331db50ece3873a Mon Sep 17 00:00:00 2001 From: pgee70 Date: Sat, 16 Dec 2017 17:48:24 +1100 Subject: [PATCH 05/26] problems accessing files the casing didn't match the case of the folder names. the vendor autoload is in a different folder... --- samples/Sample_Header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index 0a237b1b6..84e611d1b 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -23,10 +23,10 @@ define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php')); define('IS_INDEX', SCRIPT_FILENAME == 'index'); -require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; +require_once __DIR__ . '/../src/phppresentation/Autoloader.php'; Autoloader::register(); -require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../../../../vendor/autoload.php'; // Set writers $writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp'); @@ -490,4 +490,4 @@ protected function getConstantName($class, $search, $startWith = '') { - \ No newline at end of file + From d008ebb5c534bbf4bf2115496ff59460877237e3 Mon Sep 17 00:00:00 2001 From: pgee70 Date: Sat, 16 Dec 2017 20:22:57 +1100 Subject: [PATCH 06/26] Update Sample_Header.php --- samples/Sample_Header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index 84e611d1b..c3c34fc69 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -23,7 +23,7 @@ define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php')); define('IS_INDEX', SCRIPT_FILENAME == 'index'); -require_once __DIR__ . '/../src/phppresentation/Autoloader.php'; +require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; Autoloader::register(); require_once __DIR__ . '/../../../../vendor/autoload.php'; From d250c1a1b1f0c7370628fae09e4fd3fe1314b0a0 Mon Sep 17 00:00:00 2001 From: pgee70 Date: Sat, 16 Dec 2017 20:38:16 +1100 Subject: [PATCH 07/26] Update Sample_Header.php --- samples/Sample_Header.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index c3c34fc69..ee485afb8 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -26,7 +26,10 @@ require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; Autoloader::register(); -require_once __DIR__ . '/../../../../vendor/autoload.php'; +if (is_file('/../../../../vendor/autoload.php')) +{ + require_once __DIR__ . '/../../../../vendor/autoload.php'; +} // Set writers $writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp'); @@ -490,4 +493,4 @@ protected function getConstantName($class, $search, $startWith = '') { - + Date: Sat, 16 Dec 2017 20:47:16 +1100 Subject: [PATCH 08/26] Update Sample_Header.php --- samples/Sample_Header.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index ee485afb8..975e88b28 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -26,10 +26,14 @@ require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; Autoloader::register(); -if (is_file('/../../../../vendor/autoload.php')) +if (is_file(__DIR__. '/../../../../vendor/autoload.php')) { require_once __DIR__ . '/../../../../vendor/autoload.php'; } +else +{ + throw new Exception ('Can not find the vendor folder!'); +} // Set writers $writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp'); From bbf4f83b87f56f194b530c42234220bf76a78e14 Mon Sep 17 00:00:00 2001 From: pgee70 Date: Sat, 16 Dec 2017 20:57:17 +1100 Subject: [PATCH 09/26] Update Sample_Header.php added some checks to make sure that the sample outputs are set up correctly. --- samples/Sample_Header.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index 975e88b28..4285eb1d3 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -34,6 +34,15 @@ { throw new Exception ('Can not find the vendor folder!'); } +// do some checks to make sure the outputs are set correctly. +if (is_dir(__DIR__.DIRECTORY_SEPARATOR.'results') === FALSE) +{ + throw new Exception ('The results folder is not present!'); +} +if (is_writable(__DIR__.DIRECTORY_SEPARATOR.'results'.DIRECTORY_SEPARATOR) === FALSE) +{ + throw new Exception ('The results folder is not writable!'); +} // Set writers $writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp'); From 47ec19e36a1914d26aa06dd60eca2f83ce33259a Mon Sep 17 00:00:00 2001 From: pgee70 Date: Sat, 16 Dec 2017 20:59:48 +1100 Subject: [PATCH 10/26] Update Sample_Header.php more checks to make sure the sample code can run --- samples/Sample_Header.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index 4285eb1d3..aa0e4ef93 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -43,6 +43,10 @@ { throw new Exception ('The results folder is not writable!'); } +if (is_writable(__DIR__.DIRECTORY_SEPARATOR) === FALSE) +{ + throw new Exception ('The samples folder is not writable!'); +} // Set writers $writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp'); From ad87a6da7593ad1c80cbd4afe445f0b0b2d99a90 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 29 Dec 2017 22:31:01 +0100 Subject: [PATCH 11/26] Fixes some CS --- samples/Sample_Header.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index aa0e4ef93..6cf01f8e0 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -26,26 +26,20 @@ require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; Autoloader::register(); -if (is_file(__DIR__. '/../../../../vendor/autoload.php')) -{ - require_once __DIR__ . '/../../../../vendor/autoload.php'; -} -else -{ +if (is_file(__DIR__. '/../../../../vendor/autoload.php')) { + require_once __DIR__ . '/../../../../vendor/autoload.php'; +} else { throw new Exception ('Can not find the vendor folder!'); } // do some checks to make sure the outputs are set correctly. -if (is_dir(__DIR__.DIRECTORY_SEPARATOR.'results') === FALSE) -{ - throw new Exception ('The results folder is not present!'); +if (is_dir(__DIR__.DIRECTORY_SEPARATOR.'results') === FALSE) { + throw new Exception ('The results folder is not present!'); } -if (is_writable(__DIR__.DIRECTORY_SEPARATOR.'results'.DIRECTORY_SEPARATOR) === FALSE) -{ - throw new Exception ('The results folder is not writable!'); +if (is_writable(__DIR__.DIRECTORY_SEPARATOR.'results'.DIRECTORY_SEPARATOR) === FALSE) { + throw new Exception ('The results folder is not writable!'); } -if (is_writable(__DIR__.DIRECTORY_SEPARATOR) === FALSE) -{ - throw new Exception ('The samples folder is not writable!'); +if (is_writable(__DIR__.DIRECTORY_SEPARATOR) === FALSE) { + throw new Exception ('The samples folder is not writable!'); } // Set writers From ec564485e37ab67be4ca48c350ec0baf3f507387 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Fri, 29 Dec 2017 20:23:02 -0200 Subject: [PATCH 12/26] Refactoring tests --- tests/PhpPresentation/Tests/PhpPresentationTest.php | 2 +- .../Tests/Shape/RichText/ParagraphTest.php | 12 ++++++------ .../Tests/Writer/AbstractWriterTest.php | 2 +- .../Tests/_includes/PhpPresentationTestCase.php | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/PhpPresentation/Tests/PhpPresentationTest.php b/tests/PhpPresentation/Tests/PhpPresentationTest.php index 06594269b..554fc3eed 100644 --- a/tests/PhpPresentation/Tests/PhpPresentationTest.php +++ b/tests/PhpPresentation/Tests/PhpPresentationTest.php @@ -41,7 +41,7 @@ public function testConstruct() $this->assertEquals(new DocumentProperties(), $object->getDocumentProperties()); $this->assertEquals(new DocumentLayout(), $object->getLayout()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->getSlide()); - $this->assertEquals(1, count($object->getAllSlides())); + $this->assertCount(1, $object->getAllSlides()); $this->assertEquals(0, $object->getIndex($slide)); $this->assertEquals(1, $object->getSlideCount()); $this->assertEquals(0, $object->getActiveSlideIndex()); diff --git a/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php index 36f5650ef..608389899 100644 --- a/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php @@ -147,17 +147,17 @@ public function testText() { $object = new Paragraph(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->addText(new TextElement())); - $this->assertcount(1, $object->getRichTextElements()); + $this->assertCount(1, $object->getRichTextElements()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText()); - $this->assertcount(2, $object->getRichTextElements()); + $this->assertCount(2, $object->getRichTextElements()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText('AAA')); - $this->assertcount(3, $object->getRichTextElements()); + $this->assertCount(3, $object->getRichTextElements()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->createBreak()); - $this->assertcount(4, $object->getRichTextElements()); + $this->assertCount(4, $object->getRichTextElements()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun()); - $this->assertcount(5, $object->getRichTextElements()); + $this->assertCount(5, $object->getRichTextElements()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun('BBB')); - $this->assertcount(6, $object->getRichTextElements()); + $this->assertCount(6, $object->getRichTextElements()); $this->assertEquals('AAA'."\r\n".'BBB', $object->getPlainText()); $this->assertEquals('AAA'."\r\n".'BBB', (string) $object); } diff --git a/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php b/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php index 24df13079..98ea647b8 100644 --- a/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php +++ b/tests/PhpPresentation/Tests/Writer/AbstractWriterTest.php @@ -60,6 +60,6 @@ public function testAllDrawingsIncludesMasterSlides() $writer->setPhpPresentation($presentation); $drawings = $writer->allDrawings(); - $this->assertEquals(2, count($drawings), 'Number of drawings should equal two: one from normal slide and one from master slide'); + $this->assertCount(2, $drawings, 'Number of drawings should equal two: one from normal slide and one from master slide'); } } diff --git a/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php b/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php index 996f0d2c3..b7b0779a8 100644 --- a/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php +++ b/tests/PhpPresentation/Tests/_includes/PhpPresentationTestCase.php @@ -175,7 +175,7 @@ protected function resetPresentationFile() public function assertZipFileExists($filePath) { $this->writePresentationFile($this->oPresentation, $this->writerName); - self::assertThat(is_file($this->workDirectory . $filePath), self::isTrue()); + self::assertTrue(is_file($this->workDirectory . $filePath)); } /** @@ -184,7 +184,7 @@ public function assertZipFileExists($filePath) public function assertZipFileNotExists($filePath) { $this->writePresentationFile($this->oPresentation, $this->writerName); - self::assertThat(is_file($this->workDirectory . $filePath), self::isFalse()); + self::assertFalse(is_file($this->workDirectory . $filePath)); } /** @@ -195,7 +195,7 @@ public function assertZipXmlElementExists($filePath, $xPath) { $this->writePresentationFile($this->oPresentation, $this->writerName); $nodeList = $this->getXmlNodeList($filePath, $xPath); - self::assertThat(!($nodeList->length == 0), self::isTrue()); + self::assertNotEquals(0, $nodeList->length); } /** @@ -206,7 +206,7 @@ public function assertZipXmlElementNotExists($filePath, $xPath) { $this->writePresentationFile($this->oPresentation, $this->writerName); $nodeList = $this->getXmlNodeList($filePath, $xPath); - self::assertThat(!($nodeList->length == 0), self::isFalse()); + self::assertEquals(0, $nodeList->length); } /** From 3d8b447f5d6c012bbc12a4f0bd00546fc2030728 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 31 Dec 2017 09:56:22 -0200 Subject: [PATCH 13/26] Trailing whitespaces Signed-off-by: Gabriel Caruso --- CHANGELOG.md | 20 +-- README.md | 300 +++++++++++++++++++++--------------------- docs/index.rst | 2 +- docs/intro.rst | 10 +- docs/references.rst | 4 +- docs/shapes_chart.rst | 2 +- docs/shapes_table.rst | 4 +- 7 files changed, 171 insertions(+), 171 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c94c2eec9..3373210c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### Changes - PHP 7.1 is now supported - @Progi1984 GH-355 -- PhpOffice\PhpPresentation\Style\Color : Define only the transparency - @Progi1984 GH-370 +- PhpOffice\PhpPresentation\Style\Color : Define only the transparency - @Progi1984 GH-370 - PowerPoint2007 Reader : Background Color based on SchemeColor - @Progi1984 GH-397 ### Features @@ -29,7 +29,7 @@ ### Features - PowerPoint2007 Writer : Implemented XSD validation test case according to the ECMA/ISO standard - @k42b3 GH-307 -- PowerPoint2007 Writer : Implement visibility for axis - @kw-pr @Progi1984 GH-356 +- PowerPoint2007 Writer : Implement visibility for axis - @kw-pr @Progi1984 GH-356 - PowerPoint2007 Writer : Implement gap width in Bar(3D) Charts - @Progi1984 GH-358 ## 0.8.0 - 2017-04-03 @@ -90,16 +90,16 @@ - ODPresentation & PowerPoint2007 Writer : Add Font Support For Chart Axis - @jrking4 GH-186 - ODPresentation & PowerPoint2007 Writer : Support for video - @Progi1984 GH-123 - ODPresentation & PowerPoint2007 Writer : Support for Visibility for slides - @Progi1984 -- PowerPoint2007 Reader : Layout Management - @vincentKool @Progi1984 GH-161 -- PowerPoint2007 Reader : Slide size - @loverslcn @Progi1984 GH-246 -- PowerPoint2007 Reader : Bullet Color - @Progi1984 GH-257 -- PowerPoint2007 Reader : Line Spacing - @Progi1984 GH-257 +- PowerPoint2007 Reader : Layout Management - @vincentKool @Progi1984 GH-161 +- PowerPoint2007 Reader : Slide size - @loverslcn @Progi1984 GH-246 +- PowerPoint2007 Reader : Bullet Color - @Progi1984 GH-257 +- PowerPoint2007 Reader : Line Spacing - @Progi1984 GH-257 - PowerPoint2007 Writer : Presentation with predefined View Type - @Progi1984 GH-120 - PowerPoint2007 Writer : Implement alpha channel to Fills - @Dayjo GH-203 / @Progi1984 GH-215 - PowerPoint2007 Writer : Implement Animations - @JewrassicPark GH-214 / @Progi1984 GH-217 - PowerPoint2007 Writer : Layout Management - @vincentKool @Progi1984 GH-161 -- PowerPoint2007 Writer : Bullet Color - @piotrbelina GH-249 -- PowerPoint2007 Writer : Line Spacing - @piotrbelina GH-249 +- PowerPoint2007 Writer : Bullet Color - @piotrbelina GH-249 +- PowerPoint2007 Writer : Line Spacing - @piotrbelina GH-249 ## 0.6.0 - 2016-01-24 @@ -175,7 +175,7 @@ - PowerPoint2007 Writer : Hyperlink in table doesn't work - @Progi1984 GH-70 - PowerPoint2007 Writer : AutoFitNormal works with options (fontScale & lineSpacingReduction) - @Progi1984 @desigennaro GH-71 - PowerPoint2007 Writer : Shadow don't work for RichTextShapes - @Progi1984 GH-81 -- PowerPoint2007 Writer : Visibility of the Title doesn't work - @Progi1984 GH-107 +- PowerPoint2007 Writer : Visibility of the Title doesn't work - @Progi1984 GH-107 - Refactor findLayoutIndex to findLayoutId where it assumes the slideLayout order was sorted. IMPROVED: unit tests - @kenliau GH-95 ### Miscellaneous @@ -257,7 +257,7 @@ - QA: Prepare `.travis.yml` and `phpcs.xml` for Travis build passing - @Progi1984 @ivanlanin - QA: Initiate unit tests - @Progi1984 @ivanlanin - QA: Cleanup source code for PSR dan PHPDoc compatibility - @ivanlanin -- QA: Unit Tests - @Progi1984 & @ivanlanin +- QA: Unit Tests - @Progi1984 & @ivanlanin - Doc: Initiate documentation - @ivanlanin - Doc: Move to [Read The Docs](http://phppowerpoint.readthedocs.org) - @Progi1984 - Refactor: Change PHPPowerPoint_Shape_Shadow to PHPPowerPoint_Style_Shadow because it's a style, not a shape - @ivanlanin diff --git a/README.md b/README.md index feddca3aa..0c3edc281 100644 --- a/README.md +++ b/README.md @@ -1,150 +1,150 @@ -# ![PHPPresentation](https://raw.githubusercontent.com/mvargasmoran/PHPPresentation/develop/docs/images/PHPPresentationLogo.png "PHPPresentation") - -[![Latest Stable Version](https://poser.pugx.org/phpoffice/phppresentation/v/stable.png)](https://packagist.org/packages/phpoffice/phppresentation) -[![Code Climate](https://codeclimate.com/github/PHPOffice/PHPPresentation/badges/gpa.svg)](https://codeclimate.com/github/PHPOffice/PHPPresentation) -[![Test Coverage](https://codeclimate.com/github/PHPOffice/PHPPresentation/badges/coverage.svg)](https://codeclimate.com/github/PHPOffice/PHPPresentation/coverage) -[![Total Downloads](https://poser.pugx.org/phpoffice/phppresentation/downloads.png)](https://packagist.org/packages/phpoffice/phppresentation) -[![License](https://poser.pugx.org/phpoffice/phppresentation/license.png)](https://packagist.org/packages/phpoffice/phppresentation) -[![BountySource](https://img.shields.io/bountysource/team/phpoffice/activity.svg)](https://www.bountysource.com/teams/phpoffice) -[![Join the chat at https://gitter.im/PHPOffice/PHPPresentation](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPPresentation) - -Branch Master : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=master)](http://phppresentation.readthedocs.io/en/latest/?badge=master) -Branch Develop : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=develop)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=develop)](http://phppresentation.readthedocs.io/en/latest/?badge=develop) - -PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). - -PHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPPresentation) and [unit testing](http://phpoffice.github.io/PHPPresentation/coverage/develop/). You can learn more about PHPPresentation by reading the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/develop/). - -Read more about PHPPresentation: - -- [Features](#features) -- [Requirements](#requirements) -- [Installation](#installation) -- [Getting started](#getting-started) -- [Contributing](#contributing) -- [Developers' Documentation](http://phppresentation.readthedocs.org/) -- [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) - -### Features - -- Create an in-memory presentation representation -- Set presentation meta data (author, title, description, etc) -- Add slides from scratch or from existing one -- Supports different fonts and font styles -- Supports different formatting, styles, fills, gradients -- Supports hyperlinks and rich-text strings -- Add images with different styles (positioning, rotation, shadow) -- Set printing options (header, footer, page margins, paper size, orientation) -- Set transitions between slides -- Output to different file formats: PowerPoint 2007 (.pptx), OpenDocument Presentation (.odp), Serialized Presentation) -- ... and lots of other things! - -### Requirements - -PHPPresentation requires the following: - -- PHP 5.3+ -- [Zip extension](http://php.net/manual/en/book.zip.php) -- [XML Parser extension](http://www.php.net/manual/en/xml.installation.php) -- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT) -- [GD](http://php.net/manual/en/book.image.php) - -### Installation - -#### Composer method - -It is recommended that you install the PHPPresentation library [through composer](http://getcomposer.org/). To do so, add -the following lines to your ``composer.json``. - -```json -{ - "require": { - "phpoffice/phppresentation": "dev-master" - } -} -``` - -#### Manual download method - -Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPPresentation/releases). -In this case, you will have to register the autoloader. -(Register autoloading is required only if you do not use composer in your project.) - -```php -require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; -\PhpOffice\PhpPresentation\Autoloader::register(); -``` - -You will also need to download the latest PHPOffice/Common release from its [releases page](https://github.com/PHPOffice/Common/releases). -And you will also have to register its autoloader, too. - -```php -require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; -\PhpOffice\Common\Autoloader::register(); -``` - -## Getting started - -The following is a basic usage example of the PHPPresentation library. - -```php -// with your own install -require_once 'src/PhpPresentation/Autoloader.php'; -\PhpOffice\PhpPresentation\Autoloader::register(); -require_once 'src/Common/Autoloader.php'; -\PhpOffice\Common\Autoloader::register(); - -// with Composer -require_once 'vendor/autoload.php'; - -use PhpOffice\PhpPresentation\PhpPresentation; -use PhpOffice\PhpPresentation\IOFactory; -use PhpOffice\PhpPresentation\Style\Color; -use PhpOffice\PhpPresentation\Style\Alignment; - -$objPHPPowerPoint = new PhpPresentation(); - -// Create slide -$currentSlide = $objPHPPowerPoint->getActiveSlide(); - -// Create a shape (drawing) -$shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPresentation logo') - ->setDescription('PHPPresentation logo') - ->setPath('./resources/phppowerpoint_logo.gif') - ->setHeight(36) - ->setOffsetX(10) - ->setOffsetY(10); -$shape->getShadow()->setVisible(true) - ->setDirection(45) - ->setDistance(10); - -// Create a shape (text) -$shape = $currentSlide->createRichTextShape() - ->setHeight(300) - ->setWidth(600) - ->setOffsetX(170) - ->setOffsetY(180); -$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); -$textRun->getFont()->setBold(true) - ->setSize(60) - ->setColor( new Color( 'FFE06B20' ) ); - -$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); -$oWriterPPTX->save(__DIR__ . "/sample.pptx"); -$oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); -$oWriterODP->save(__DIR__ . "/sample.odp"); -``` - -More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) for more detail. - - -## Contributing - -We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute: - -- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md) -- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch -- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub -- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter +# ![PHPPresentation](https://raw.githubusercontent.com/mvargasmoran/PHPPresentation/develop/docs/images/PHPPresentationLogo.png "PHPPresentation") + +[![Latest Stable Version](https://poser.pugx.org/phpoffice/phppresentation/v/stable.png)](https://packagist.org/packages/phpoffice/phppresentation) +[![Code Climate](https://codeclimate.com/github/PHPOffice/PHPPresentation/badges/gpa.svg)](https://codeclimate.com/github/PHPOffice/PHPPresentation) +[![Test Coverage](https://codeclimate.com/github/PHPOffice/PHPPresentation/badges/coverage.svg)](https://codeclimate.com/github/PHPOffice/PHPPresentation/coverage) +[![Total Downloads](https://poser.pugx.org/phpoffice/phppresentation/downloads.png)](https://packagist.org/packages/phpoffice/phppresentation) +[![License](https://poser.pugx.org/phpoffice/phppresentation/license.png)](https://packagist.org/packages/phpoffice/phppresentation) +[![BountySource](https://img.shields.io/bountysource/team/phpoffice/activity.svg)](https://www.bountysource.com/teams/phpoffice) +[![Join the chat at https://gitter.im/PHPOffice/PHPPresentation](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPPresentation) + +Branch Master : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=master)](http://phppresentation.readthedocs.io/en/latest/?badge=master) +Branch Develop : [![Build Status](https://travis-ci.org/PHPOffice/PHPPresentation.svg?branch=develop)](https://travis-ci.org/PHPOffice/PHPPresentation) [![Documentation Status](https://readthedocs.org/projects/phppresentation/badge/?version=develop)](http://phppresentation.readthedocs.io/en/latest/?badge=develop) + +PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). + +PHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPPresentation) and [unit testing](http://phpoffice.github.io/PHPPresentation/coverage/develop/). You can learn more about PHPPresentation by reading the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/develop/). + +Read more about PHPPresentation: + +- [Features](#features) +- [Requirements](#requirements) +- [Installation](#installation) +- [Getting started](#getting-started) +- [Contributing](#contributing) +- [Developers' Documentation](http://phppresentation.readthedocs.org/) +- [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) + +### Features + +- Create an in-memory presentation representation +- Set presentation meta data (author, title, description, etc) +- Add slides from scratch or from existing one +- Supports different fonts and font styles +- Supports different formatting, styles, fills, gradients +- Supports hyperlinks and rich-text strings +- Add images with different styles (positioning, rotation, shadow) +- Set printing options (header, footer, page margins, paper size, orientation) +- Set transitions between slides +- Output to different file formats: PowerPoint 2007 (.pptx), OpenDocument Presentation (.odp), Serialized Presentation) +- ... and lots of other things! + +### Requirements + +PHPPresentation requires the following: + +- PHP 5.3+ +- [Zip extension](http://php.net/manual/en/book.zip.php) +- [XML Parser extension](http://www.php.net/manual/en/xml.installation.php) +- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT) +- [GD](http://php.net/manual/en/book.image.php) + +### Installation + +#### Composer method + +It is recommended that you install the PHPPresentation library [through composer](http://getcomposer.org/). To do so, add +the following lines to your ``composer.json``. + +```json +{ + "require": { + "phpoffice/phppresentation": "dev-master" + } +} +``` + +#### Manual download method + +Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPPresentation/releases). +In this case, you will have to register the autoloader. +(Register autoloading is required only if you do not use composer in your project.) + +```php +require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; +\PhpOffice\PhpPresentation\Autoloader::register(); +``` + +You will also need to download the latest PHPOffice/Common release from its [releases page](https://github.com/PHPOffice/Common/releases). +And you will also have to register its autoloader, too. + +```php +require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; +\PhpOffice\Common\Autoloader::register(); +``` + +## Getting started + +The following is a basic usage example of the PHPPresentation library. + +```php +// with your own install +require_once 'src/PhpPresentation/Autoloader.php'; +\PhpOffice\PhpPresentation\Autoloader::register(); +require_once 'src/Common/Autoloader.php'; +\PhpOffice\Common\Autoloader::register(); + +// with Composer +require_once 'vendor/autoload.php'; + +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\IOFactory; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Alignment; + +$objPHPPowerPoint = new PhpPresentation(); + +// Create slide +$currentSlide = $objPHPPowerPoint->getActiveSlide(); + +// Create a shape (drawing) +$shape = $currentSlide->createDrawingShape(); +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') + ->setPath('./resources/phppowerpoint_logo.gif') + ->setHeight(36) + ->setOffsetX(10) + ->setOffsetY(10); +$shape->getShadow()->setVisible(true) + ->setDirection(45) + ->setDistance(10); + +// Create a shape (text) +$shape = $currentSlide->createRichTextShape() + ->setHeight(300) + ->setWidth(600) + ->setOffsetX(170) + ->setOffsetY(180); +$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); +$textRun->getFont()->setBold(true) + ->setSize(60) + ->setColor( new Color( 'FFE06B20' ) ); + +$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); +$oWriterPPTX->save(__DIR__ . "/sample.pptx"); +$oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); +$oWriterODP->save(__DIR__ . "/sample.odp"); +``` + +More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) for more detail. + + +## Contributing + +We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute: + +- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md) +- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch +- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub +- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter diff --git a/docs/index.rst b/docs/index.rst index d88c933c4..b9be7e30e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -39,7 +39,7 @@ PHPPresentation is a library written in pure PHP that provides a set of classes .. toctree:: :maxdepth: 2 :caption: Shapes - + shapes_chart shapes_comment shapes_drawing diff --git a/docs/intro.rst b/docs/intro.rst index 74b5bca5b..cd386f067 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -3,11 +3,11 @@ Introduction ============ -PHPPresentation is a library written in pure PHP that provides a set of -classes to write to different presentation file formats, i.e. Microsoft -`Office Open XML ` -(.pptx) and OASIS `Open Document Format for Office Applications -`__ (.odp). +PHPPresentation is a library written in pure PHP that provides a set of +classes to write to different presentation file formats, i.e. Microsoft +`Office Open XML ` +(.pptx) and OASIS `Open Document Format for Office Applications +`__ (.odp). PHPPresentation is an open source project licensed under the terms of `LGPL version 3 `__. diff --git a/docs/references.rst b/docs/references.rst index bea9c0cc4..02cbb36b9 100644 --- a/docs/references.rst +++ b/docs/references.rst @@ -8,7 +8,7 @@ OpenXML Known as "ISO/IEC 29500, Third edition, 2012-09-01" -ISO : +ISO : - `Part 1: Fundamentals and Markup Language Reference `__ @@ -32,7 +32,7 @@ OpenDocument - `Oasis OpenDocument Standard Version 1.2 `__ - + PowerPoint 97 --------------- diff --git a/docs/shapes_chart.rst b/docs/shapes_chart.rst index f5994bd3d..040dd467d 100644 --- a/docs/shapes_chart.rst +++ b/docs/shapes_chart.rst @@ -100,7 +100,7 @@ You can define visibility for each axis (X & Y). Title ^^^^^ -By default, the title of a chart is displayed. +By default, the title of a chart is displayed. For hiding it, you define its visibility to false. .. code-block:: php diff --git a/docs/shapes_table.rst b/docs/shapes_table.rst index 32be173f4..5d5782f44 100644 --- a/docs/shapes_table.rst +++ b/docs/shapes_table.rst @@ -20,7 +20,7 @@ A row is a child of a table. For creating a row, use `createRow` method of a Tab $tableShape = $slide->createTableShape($columns); $row = $tableShape->createRow(); - + Cells ------- A cell is a child of a row. @@ -35,7 +35,7 @@ You can access cell objects with `nextCell` method of a Row object. $cellA1 = $row->nextCell(); // Get the second cell $cellA2 = $row->nextCell(); - + You can access cell object directly. .. code-block:: php From 4ef5ce743baf9c43b2a2f62f295ee20d2dcc493e Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 31 Dec 2017 09:56:53 -0200 Subject: [PATCH 14/26] Remove extra lines Signed-off-by: Gabriel Caruso --- CHANGELOG.md | 1 - README.md | 1 - docs/general.rst | 1 - docs/references.rst | 1 - docs/shapes_chart.rst | 1 - docs/shapes_comment.rst | 1 - docs/shapes_drawing.rst | 1 - docs/shapes_media.rst | 1 - docs/shapes_richtext.rst | 3 --- docs/shapes_table.rst | 3 --- docs/writers.rst | 1 - 11 files changed, 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3373210c4..b3c8b58d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -249,7 +249,6 @@ - PowerPoint2007 Writer: Scatter chart with numerical X values not working well - @Progi1984 GH-3 - Shape RichText: Support of Vertical Alignment in PowerPoint2007 - @Progi1984 GH-35 - ### Miscellaneous - Rename PHPPowerpoint.php to PHPPowerPoint.php - @maartenba CP-1165 diff --git a/README.md b/README.md index 0c3edc281..3a31475ba 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,6 @@ $oWriterODP->save(__DIR__ . "/sample.odp"); More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phppresentation.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) for more detail. - ## Contributing We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute: diff --git a/docs/general.rst b/docs/general.rst index d24c884e7..7bf047331 100644 --- a/docs/general.rst +++ b/docs/general.rst @@ -69,7 +69,6 @@ name. Use the following functions : $properties->setSubject('My subject'); $properties->setKeywords('my, key, word'); - Presentation Properties ----------------------- diff --git a/docs/references.rst b/docs/references.rst index 02cbb36b9..b07b35644 100644 --- a/docs/references.rst +++ b/docs/references.rst @@ -32,7 +32,6 @@ OpenDocument - `Oasis OpenDocument Standard Version 1.2 `__ - PowerPoint 97 --------------- diff --git a/docs/shapes_chart.rst b/docs/shapes_chart.rst index 040dd467d..144798877 100644 --- a/docs/shapes_chart.rst +++ b/docs/shapes_chart.rst @@ -229,7 +229,6 @@ You can stack multiples series in a same chart. After adding multiples series, y :width: 120px :alt: Bar::GROUPING_PERCENTSTACKED - Line ^^^^ diff --git a/docs/shapes_comment.rst b/docs/shapes_comment.rst index 6ad217b47..ec2f310ae 100644 --- a/docs/shapes_comment.rst +++ b/docs/shapes_comment.rst @@ -27,7 +27,6 @@ Example: $oComment->setDate(time()); $oSlide->addShape($oComment); - Author ------ diff --git a/docs/shapes_drawing.rst b/docs/shapes_drawing.rst index 7777951f7..4a1762d4e 100644 --- a/docs/shapes_drawing.rst +++ b/docs/shapes_drawing.rst @@ -46,7 +46,6 @@ GD ->setMimeType(Drawing\Gd::MIMETYPE_DEFAULT); $oSlide->addShape($oShape); - Base64 ------ diff --git a/docs/shapes_media.rst b/docs/shapes_media.rst index ba3fddec1..efc5fc854 100644 --- a/docs/shapes_media.rst +++ b/docs/shapes_media.rst @@ -28,7 +28,6 @@ Example: $oMedia->setName('Name of the Media'); $oSlide->addShape($oMedia); - Quirks ------ diff --git a/docs/shapes_richtext.rst b/docs/shapes_richtext.rst index e8987cb64..15528c8f0 100644 --- a/docs/shapes_richtext.rst +++ b/docs/shapes_richtext.rst @@ -30,7 +30,6 @@ Properties that can be set for each paragraphs are as follow. - ``lineSpacing`` see *[LineSpacing](#linespacing)* - ``font`` see *[Font](#font)* - Bullet ------ @@ -59,7 +58,6 @@ With the bullet style, you can define the char, the font, the color and the type $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); $oParagraph->getBulletStyle()->setBulletColor(new Color(Color::COLOR_RED)); - LineSpacing ----------- @@ -75,7 +73,6 @@ Example: $oParagraph->setLineSpacing(200); $iLineSpacing = $oParagraph->getLineSpacing(); - Run --- diff --git a/docs/shapes_table.rst b/docs/shapes_table.rst index 5d5782f44..cf8d6a3c8 100644 --- a/docs/shapes_table.rst +++ b/docs/shapes_table.rst @@ -47,7 +47,6 @@ You can access cell object directly. // Get the second cell $cellA2 = $row->getCell(1); - Define margins of a cell ~~~~~~~~~~~~~~~~~~~~~~~~ Margins of cells are defined by margins of the first paragraph of cell. @@ -66,7 +65,6 @@ For defining margins of cell, you can use the `setMargin*` method of a Alignment ->setMarginRight(60) ->setMarginTop(80); - Define the text direction of a cell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For defining the text direction of cell, you can use the `setTextDirection` method of the `getAlignment` method of a Cell object. @@ -79,7 +77,6 @@ The width is in pixels. $cellA1 = $row->nextCell(); $cellA1->getAlignment()->setTextDirection(\PhpOffice\PhpPresentation\Style\Alignment::TEXT_DIRECTION_VERTICAL_270); - Define the width of a cell ~~~~~~~~~~~~~~~~~~~~~~~~~~ The width of cells are defined by the width of cell of the first row. diff --git a/docs/writers.rst b/docs/writers.rst index e1105290e..09333a3fd 100644 --- a/docs/writers.rst +++ b/docs/writers.rst @@ -3,7 +3,6 @@ Writers ======= - ODPresentation -------------- From 3b710b39247fdaa06c8e8ef23b93f645e168bfde Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Tue, 16 Jan 2018 20:44:55 -0200 Subject: [PATCH 15/26] Simplify return --- src/PhpPresentation/Shape/Chart/Series.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpPresentation/Shape/Chart/Series.php b/src/PhpPresentation/Shape/Chart/Series.php index 63010293d..d3f6ca537 100644 --- a/src/PhpPresentation/Shape/Chart/Series.php +++ b/src/PhpPresentation/Shape/Chart/Series.php @@ -416,7 +416,7 @@ public function setShowPercentage($value) */ public function hasShowSeparator() { - return is_null($this->separator) ? false : true; + return !is_null($this->separator); } /** From 9a82da2870ec05730443d7035b16b62b59f6c520 Mon Sep 17 00:00:00 2001 From: Jason Kelly Date: Mon, 5 Feb 2018 12:29:22 +1300 Subject: [PATCH 16/26] Change group shape extents to reflect content width/height. Previously the group extents where calculated based on the extents of the containing shapes using the slide/container of the group as the point of reference. This would result in the group being larger than needed; especially noticable for a large X or Y offest. --- src/PhpPresentation/Shape/Group.php | 8 ++--- .../PhpPresentation/Tests/Shape/GroupTest.php | 36 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/PhpPresentation/Shape/Group.php b/src/PhpPresentation/Shape/Group.php index 8b13dd79b..ba3207a29 100644 --- a/src/PhpPresentation/Shape/Group.php +++ b/src/PhpPresentation/Shape/Group.php @@ -145,8 +145,8 @@ public function getExtentX() { if ($this->extentX === null) { $extents = GeometryCalculator::calculateExtents($this); - $this->extentX = $extents[GeometryCalculator::X]; - $this->extentY = $extents[GeometryCalculator::Y]; + $this->extentX = $extents[GeometryCalculator::X] - $this->getOffsetX(); + $this->extentY = $extents[GeometryCalculator::Y] - $this->getOffsetY(); } return $this->extentX; @@ -161,8 +161,8 @@ public function getExtentY() { if ($this->extentY === null) { $extents = GeometryCalculator::calculateExtents($this); - $this->extentX = $extents[GeometryCalculator::X]; - $this->extentY = $extents[GeometryCalculator::Y]; + $this->extentX = $extents[GeometryCalculator::X] - $this->getOffsetX(); + $this->extentY = $extents[GeometryCalculator::Y] - $this->getOffsetY(); } return $this->extentY; diff --git a/tests/PhpPresentation/Tests/Shape/GroupTest.php b/tests/PhpPresentation/Tests/Shape/GroupTest.php index dbfa82dcd..9be88952e 100644 --- a/tests/PhpPresentation/Tests/Shape/GroupTest.php +++ b/tests/PhpPresentation/Tests/Shape/GroupTest.php @@ -56,25 +56,25 @@ public function testAdd() public function testExtentX() { $object = new Group(); - $line1 = new Line(10, 20, 30, 40); + $line1 = new Line(10, 20, 30, 50); $object->addShape($line1); - $this->assertEquals(30, $object->getExtentX()); + $this->assertEquals(20, $object->getExtentX()); } public function testExtentY() { $object = new Group(); - $line1 = new Line(10, 20, 30, 40); + $line1 = new Line(10, 20, 30, 50); $object->addShape($line1); - $this->assertEquals(40, $object->getExtentY()); + $this->assertEquals(30, $object->getExtentY()); } public function testOffsetX() { $object = new Group(); - $line1 = new Line(10, 20, 30, 40); + $line1 = new Line(10, 20, 30, 50); $object->addShape($line1); $this->assertEquals(10, $object->getOffsetX()); @@ -86,7 +86,7 @@ public function testOffsetX() public function testOffsetY() { $object = new Group(); - $line1 = new Line(10, 20, 30, 40); + $line1 = new Line(10, 20, 30, 50); $object->addShape($line1); $this->assertEquals(20, $object->getOffsetY()); @@ -102,11 +102,13 @@ public function testExtentsAndOffsetsForOneShape() // from the extents to produce a raw width and height. $offsetX = 100; $offsetY = 100; - $extentX = 1000; - $extentY = 450; + $endX = 1000; + $endY = 450; + $extentX = $endX - $offsetX; + $extentY = $endY - $offsetY; $object = new Group(); - $line1 = new Line($offsetX, $offsetY, $extentX, $extentY); + $line1 = new Line($offsetX, $offsetY, $endX, $endY); $object->addShape($line1); $this->assertEquals($offsetX, $object->getOffsetX()); @@ -123,16 +125,18 @@ public function testExtentsAndOffsetsForTwoShapes() // combined with the above. $offsetX = 100; $offsetY = 100; - $extentX = 1000; - $extentY = 450; + $endX = 1000; + $endY = 450; $increase = 50; + $extentX = ($endX - $offsetX) + $increase; + $extentY = ($endY - $offsetY) + $increase; - $line1 = new Line($offsetX, $offsetY, $extentX, $extentY); + $line1 = new Line($offsetX, $offsetY, $endX, $endY); $line2 = new Line( $offsetX+$increase, $offsetY+$increase, - $extentX+$increase, - $extentY+$increase + $endX+$increase, + $endY+$increase ); $object = new Group(); @@ -142,7 +146,7 @@ public function testExtentsAndOffsetsForTwoShapes() $this->assertEquals($offsetX, $object->getOffsetX()); $this->assertEquals($offsetY, $object->getOffsetY()); - $this->assertEquals($extentX+$increase, $object->getExtentX()); - $this->assertEquals($extentY+$increase, $object->getExtentY()); + $this->assertEquals($extentX, $object->getExtentX()); + $this->assertEquals($extentY, $object->getExtentY()); } } From 02aa18fe645bb42a1776d5e9407dbbc6a520de0a Mon Sep 17 00:00:00 2001 From: Burak Kanber Date: Thu, 8 Feb 2018 10:52:31 -0500 Subject: [PATCH 17/26] Remove % signs from PptCharts to fix chart generation. Fixes #452 --- src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php | 4 ++-- .../Tests/Writer/PowerPoint2007/PptChartsTest.php | 2 +- tests/resources/schema/ooxml/dml-chart.xsd | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php index 1628cb3e9..bfedd4727 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php @@ -105,7 +105,7 @@ public function writeChart(Chart $chart) // c:hPercent $hPercent = $chart->getView3D()->getHeightPercent(); - $objWriter->writeElementIf($hPercent != null, 'c:hPercent', 'val', $hPercent . '%'); + $objWriter->writeElementIf($hPercent != null, 'c:hPercent', 'val', $hPercent); // c:rotY $objWriter->startElement('c:rotY'); @@ -2322,7 +2322,7 @@ protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, $typeAxis, // c:lblOffset $objWriter->startElement('c:lblOffset'); - $objWriter->writeAttribute('val', '100%'); + $objWriter->writeAttribute('val', '100'); $objWriter->endElement(); } diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptChartsTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptChartsTest.php index 38ac1e113..47d3ef57d 100644 --- a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptChartsTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptChartsTest.php @@ -988,7 +988,7 @@ public function testView3D() $element = '/c:chartSpace/c:chart/c:view3D/c:hPercent'; $this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element); - $this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'val', '100%'); + $this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'val', '100'); $oShape->getView3D()->setHeightPercent(null); $this->resetPresentationFile(); diff --git a/tests/resources/schema/ooxml/dml-chart.xsd b/tests/resources/schema/ooxml/dml-chart.xsd index 91559f2ce..5f82ced4b 100644 --- a/tests/resources/schema/ooxml/dml-chart.xsd +++ b/tests/resources/schema/ooxml/dml-chart.xsd @@ -194,7 +194,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -1164,7 +1164,7 @@ - + @@ -1172,7 +1172,7 @@ - + From 4015666a7d69edf57909d5b051e27c19c0475ee4 Mon Sep 17 00:00:00 2001 From: karlos Date: Mon, 12 Feb 2018 10:03:41 +0100 Subject: [PATCH 18/26] Solve Problems with png transparencies --- src/PhpPresentation/Shape/Drawing/Gd.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PhpPresentation/Shape/Drawing/Gd.php b/src/PhpPresentation/Shape/Drawing/Gd.php index f69b345ea..d4509d922 100644 --- a/src/PhpPresentation/Shape/Drawing/Gd.php +++ b/src/PhpPresentation/Shape/Drawing/Gd.php @@ -132,6 +132,10 @@ public function setMimeType($value = self::MIMETYPE_DEFAULT) public function getContents() { ob_start(); + if ($this->getMimeType() === self::MIMETYPE_DEFAULT) { + imagealphablending($this->getImageResource(), false); + imagesavealpha($this->getImageResource(), true); + } call_user_func($this->getRenderingFunction(), $this->getImageResource()); $imageContents = ob_get_contents(); ob_end_clean(); From fd711d4d6aac95d14a33be9100d7368bf9aea299 Mon Sep 17 00:00:00 2001 From: Andrey Bolonin Date: Wed, 21 Feb 2018 15:39:43 +0200 Subject: [PATCH 19/26] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 55a0b0a80..a74cf0feb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 - hhvm matrix: From 3dea055a6326e9205c1591882d9287e9bc9c9535 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 12 Mar 2018 16:35:24 +0900 Subject: [PATCH 20/26] Use proper name for `ext-gd` `ext-gd2` is not recognized by composer and should instead be `ext-gd`. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c8fa0c7b5..6b0bbcdfa 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "codeclimate/php-test-reporter": "dev-master" }, "suggest": { - "ext-gd2": "Required to add images" + "ext-gd": "Required to add images" }, "autoload": { "psr-4": { From 97da2d90b803867f362d201e63378221d315c2ea Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Thu, 18 Oct 2018 09:57:14 +0200 Subject: [PATCH 21/26] Create auto_assign.yml --- .github/auto_assign.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/auto_assign.yml diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 000000000..ae99d1af8 --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,17 @@ +# Set to true to add reviewers to pull requests +addReviewers: true + +# Set to true to add assignees to pull requests +addAssignees: true + +# A list of reviewers to be added to pull requests (GitHub user name) +reviewers: + - Progi1984 + +# A list of keywords to be skipped the process that add reviewers if pull requests include it +skipKeywords: + - WIP + +# A number of reviewers added to the pull request +# Set 0 to add all the reviewers (default: 0) +numberOfReviewers: 0 From d07784c877c2557a04389c04e72e74678e7bc667 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Noblot Date: Tue, 23 Oct 2018 14:32:36 +0200 Subject: [PATCH 22/26] Fix PHP Docs --- src/PhpPresentation/AbstractShape.php | 3 +- src/PhpPresentation/IOFactory.php | 7 +- src/PhpPresentation/PhpPresentation.php | 9 ++- .../PresentationProperties.php | 6 +- src/PhpPresentation/Reader/ODPresentation.php | 23 +++++-- src/PhpPresentation/Reader/PowerPoint2007.php | 14 +++- src/PhpPresentation/Reader/PowerPoint97.php | 47 ++++++++++++- src/PhpPresentation/Shape/Chart/Axis.php | 2 +- src/PhpPresentation/Shape/Chart/Legend.php | 11 ++-- src/PhpPresentation/Shape/Chart/PlotArea.php | 9 +-- src/PhpPresentation/Shape/Chart/Series.php | 4 +- src/PhpPresentation/Shape/Chart/Title.php | 3 +- .../Shape/Chart/Type/AbstractType.php | 4 +- .../Shape/Chart/Type/AbstractTypeBar.php | 4 +- src/PhpPresentation/Shape/Chart/View3D.php | 1 + src/PhpPresentation/Shape/Drawing/Base64.php | 1 + src/PhpPresentation/Shape/Drawing/File.php | 2 +- src/PhpPresentation/Shape/Drawing/ZipFile.php | 4 +- src/PhpPresentation/Shape/Group.php | 66 ++++++++++--------- src/PhpPresentation/Shape/RichText.php | 5 +- .../Shape/RichText/TextElement.php | 3 +- src/PhpPresentation/Shape/Table/Cell.php | 15 +++-- src/PhpPresentation/Shape/Table/Row.php | 2 +- src/PhpPresentation/Slide/AbstractSlide.php | 15 ++++- .../Slide/Background/Image.php | 3 +- src/PhpPresentation/Slide/Iterator.php | 1 + src/PhpPresentation/Slide/Note.php | 2 + src/PhpPresentation/Slide/SlideMaster.php | 2 + src/PhpPresentation/Style/Outline.php | 3 +- src/PhpPresentation/Style/TextStyle.php | 1 + src/PhpPresentation/Writer/AbstractWriter.php | 2 +- src/PhpPresentation/Writer/ODPresentation.php | 1 + .../Writer/ODPresentation/Content.php | 8 ++- .../Writer/ODPresentation/Meta.php | 3 +- .../Writer/ODPresentation/MetaInfManifest.php | 1 + .../Writer/ODPresentation/Mimetype.php | 3 +- .../Writer/ODPresentation/ObjectsChart.php | 7 ++ .../Writer/ODPresentation/Pictures.php | 1 + .../Writer/ODPresentation/Styles.php | 4 +- .../ODPresentation/ThumbnailsThumbnail.php | 3 +- src/PhpPresentation/Writer/PowerPoint2007.php | 1 + .../AbstractDecoratorWriter.php | 1 + .../Writer/PowerPoint2007/AbstractSlide.php | 4 ++ .../Writer/PowerPoint2007/CommentAuthors.php | 1 + .../Writer/PowerPoint2007/DocPropsApp.php | 1 + .../Writer/PowerPoint2007/DocPropsCore.php | 1 + .../Writer/PowerPoint2007/DocPropsCustom.php | 1 + .../PowerPoint2007/DocPropsThumbnail.php | 1 + .../Writer/PowerPoint2007/PptCharts.php | 2 + .../Writer/PowerPoint2007/PptComments.php | 1 + .../Writer/PowerPoint2007/PptMedia.php | 1 + .../Writer/PowerPoint2007/PptPresProps.php | 1 + .../Writer/PowerPoint2007/PptPresentation.php | 1 + .../Writer/PowerPoint2007/PptSlideLayouts.php | 1 + .../Writer/PowerPoint2007/PptSlideMasters.php | 1 + .../Writer/PowerPoint2007/PptSlides.php | 1 + .../Writer/PowerPoint2007/PptTableProps.php | 1 + .../Writer/PowerPoint2007/PptViewProps.php | 1 + .../Writer/PowerPoint2007/Relationships.php | 1 + src/PhpPresentation/Writer/Serialized.php | 1 + 60 files changed, 243 insertions(+), 86 deletions(-) diff --git a/src/PhpPresentation/AbstractShape.php b/src/PhpPresentation/AbstractShape.php index 4cece57b1..d27b79878 100644 --- a/src/PhpPresentation/AbstractShape.php +++ b/src/PhpPresentation/AbstractShape.php @@ -143,7 +143,7 @@ public function __clone() /** * Get Container, Slide or Group * - * @return \PhpOffice\PhpPresentation\Container + * @return \PhpOffice\PhpPresentation\ShapeContainerInterface */ public function getContainer() { @@ -385,6 +385,7 @@ public function hasHyperlink() * Get Hyperlink * * @return \PhpOffice\PhpPresentation\Shape\Hyperlink + * @throws \Exception */ public function getHyperlink() { diff --git a/src/PhpPresentation/IOFactory.php b/src/PhpPresentation/IOFactory.php index 5f94f157a..84cb3756e 100644 --- a/src/PhpPresentation/IOFactory.php +++ b/src/PhpPresentation/IOFactory.php @@ -35,6 +35,7 @@ class IOFactory * @param PhpPresentation $phpPresentation * @param string $name * @return \PhpOffice\PhpPresentation\Writer\WriterInterface + * @throws \Exception */ public static function createWriter(PhpPresentation $phpPresentation, $name = 'PowerPoint2007') { @@ -47,6 +48,7 @@ public static function createWriter(PhpPresentation $phpPresentation, $name = 'P * * @param string $name * @return \PhpOffice\PhpPresentation\Reader\ReaderInterface + * @throws \Exception */ public static function createReader($name = '') { @@ -81,8 +83,8 @@ public static function load($pFilename) * @param string $name * @param string $type * @param \PhpOffice\PhpPresentation\PhpPresentation $phpPresentation - * @throws \Exception - * @return + * @return mixed + * @throws \ReflectionException */ private static function loadClass($class, $name, $type, PhpPresentation $phpPresentation = null) { @@ -102,6 +104,7 @@ private static function loadClass($class, $name, $type, PhpPresentation $phpPres * * @param string $class * @return bool + * @throws \ReflectionException */ private static function isConcreteClass($class) { diff --git a/src/PhpPresentation/PhpPresentation.php b/src/PhpPresentation/PhpPresentation.php index 241e0b8bf..df64568f1 100644 --- a/src/PhpPresentation/PhpPresentation.php +++ b/src/PhpPresentation/PhpPresentation.php @@ -190,6 +190,7 @@ public function getActiveSlide() * Create slide and add it to this presentation * * @return \PhpOffice\PhpPresentation\Slide + * @throws \Exception */ public function createSlide() { @@ -340,6 +341,7 @@ public function getSlideIterator() * Create a masterslide and add it to this presentation * * @return \PhpOffice\PhpPresentation\Slide\SlideMaster + * @throws \Exception */ public function createMasterSlide() { @@ -366,6 +368,7 @@ public function addMasterSlide(SlideMaster $slide = null) * Copy presentation (!= clone!) * * @return PhpPresentation + * @throws \Exception */ public function copy() { @@ -383,7 +386,7 @@ public function copy() /** * Mark a document as final * @param bool $state - * @return PhpPresentation + * @return PresentationProperties * @deprecated for getPresentationProperties()->markAsFinal() */ public function markAsFinal($state = true) @@ -403,8 +406,8 @@ public function isMarkedAsFinal() /** * Set the zoom of the document (in percentage) - * @param float $zoom - * @return PhpPresentation + * @param int $zoom + * @return PresentationProperties * @deprecated for getPresentationProperties()->setZoom() */ public function setZoom($zoom = 1) diff --git a/src/PhpPresentation/PresentationProperties.php b/src/PhpPresentation/PresentationProperties.php index 2e69f858c..8d5df960d 100644 --- a/src/PhpPresentation/PresentationProperties.php +++ b/src/PhpPresentation/PresentationProperties.php @@ -118,7 +118,7 @@ public function setThumbnailPath($path = '') /** * Mark a document as final * @param bool $state - * @return PhpPresentation + * @return PresentationProperties */ public function markAsFinal($state = true) { @@ -139,8 +139,8 @@ public function isMarkedAsFinal() /** * Set the zoom of the document (in percentage) - * @param float $zoom - * @return PhpPresentation + * @param int $zoom + * @return PresentationProperties */ public function setZoom($zoom = 1) { diff --git a/src/PhpPresentation/Reader/ODPresentation.php b/src/PhpPresentation/Reader/ODPresentation.php index bf659c851..d65832229 100644 --- a/src/PhpPresentation/Reader/ODPresentation.php +++ b/src/PhpPresentation/Reader/ODPresentation.php @@ -118,8 +118,9 @@ public function load($pFilename) /** * Load PhpPresentation Serialized file * - * @param string $pFilename + * @param string $pFilename * @return \PhpOffice\PhpPresentation\PhpPresentation + * @throws \Exception */ protected function loadFile($pFilename) { @@ -191,10 +192,12 @@ protected function loadSlides() } } } - + /** * Extract style * @param \DOMElement $nodeStyle + * @return bool + * @throws \Exception */ protected function loadStyle(\DOMElement $nodeStyle) { @@ -350,6 +353,8 @@ protected function loadStyle(\DOMElement $nodeStyle) * Read Slide * * @param \DOMElement $nodeSlide + * @return bool + * @throws \Exception */ protected function loadSlide(\DOMElement $nodeSlide) { @@ -377,11 +382,12 @@ protected function loadSlide(\DOMElement $nodeSlide) } return true; } - + /** * Read Shape Drawing * * @param \DOMElement $oNodeFrame + * @throws \Exception */ protected function loadShapeDrawing(\DOMElement $oNodeFrame) { @@ -428,6 +434,7 @@ protected function loadShapeDrawing(\DOMElement $oNodeFrame) * Read Shape RichText * * @param \DOMElement $oNodeFrame + * @throws \Exception */ protected function loadShapeRichText(\DOMElement $oNodeFrame) { @@ -456,11 +463,12 @@ protected function loadShapeRichText(\DOMElement $oNodeFrame) } protected $levelParagraph = 0; - + /** * Read Paragraph * @param RichText $oShape * @param \DOMElement $oNodeParent + * @throws \Exception */ protected function readParagraph(RichText $oShape, \DOMElement $oNodeParent) { @@ -477,11 +485,12 @@ protected function readParagraph(RichText $oShape, \DOMElement $oNodeParent) $this->readParagraphItem($oParagraph, $oNodeRichTextElement); } } - + /** * Read Paragraph Item * @param Paragraph $oParagraph * @param \DOMElement $oNodeParent + * @throws \Exception */ protected function readParagraphItem(Paragraph $oParagraph, \DOMElement $oNodeParent) { @@ -512,6 +521,7 @@ protected function readParagraphItem(Paragraph $oParagraph, \DOMElement $oNodePa * * @param RichText $oShape * @param \DOMElement $oNodeParent + * @throws \Exception */ protected function readList(RichText $oShape, \DOMElement $oNodeParent) { @@ -526,12 +536,13 @@ protected function readList(RichText $oShape, \DOMElement $oNodeParent) } } } - + /** * Read List Item * @param RichText $oShape * @param \DOMElement $oNodeParent * @param \DOMElement $oNodeParagraph + * @throws \Exception */ protected function readListItem(RichText $oShape, \DOMElement $oNodeParent, \DOMElement $oNodeParagraph) { diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index 1083f9e52..2548b377f 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -131,6 +131,7 @@ public function load($pFilename) * * @param string $pFilename * @return \PhpOffice\PhpPresentation\PhpPresentation + * @throws \Exception */ protected function loadFile($pFilename) { @@ -265,6 +266,8 @@ protected function loadViewProperties($sPart) /** * Extract all slides + * @param $sPart + * @throws \Exception */ protected function loadSlides($sPart) { @@ -302,6 +305,7 @@ protected function loadSlides($sPart) * Extract all MasterSlides * @param XMLReader $xmlReader * @param string $fileRels + * @throws \Exception */ protected function loadMasterSlides(XMLReader $xmlReader, $fileRels) { @@ -328,6 +332,7 @@ protected function loadMasterSlides(XMLReader $xmlReader, $fileRels) * Extract data from slide * @param string $sPart * @param string $baseFile + * @throws \Exception */ protected function loadSlide($sPart, $baseFile) { @@ -416,6 +421,7 @@ protected function loadSlide($sPart, $baseFile) /** * @param string $sPart * @param string $baseFile + * @throws \Exception */ protected function loadMasterSlide($sPart, $baseFile) { @@ -559,6 +565,7 @@ protected function loadMasterSlide($sPart, $baseFile) * @param string $baseFile * @param SlideMaster $oSlideMaster * @return SlideLayout|null + * @throws \Exception */ protected function loadLayoutSlide($sPart, $baseFile, SlideMaster $oSlideMaster) { @@ -632,6 +639,7 @@ protected function loadTheme($sPart, SlideMaster $oSlideMaster) * @param XMLReader $xmlReader * @param \DOMElement $oElement * @param AbstractSlide $oSlide + * @throws \Exception */ protected function loadSlideBackground(XMLReader $xmlReader, \DOMElement $oElement, AbstractSlide $oSlide) { @@ -692,6 +700,7 @@ protected function loadSlideBackground(XMLReader $xmlReader, \DOMElement $oEleme /** * @param string $baseFile * @param Slide $oSlide + * @throws \Exception */ protected function loadSlideNote($baseFile, Slide $oSlide) { @@ -711,6 +720,7 @@ protected function loadSlideNote($baseFile, Slide $oSlide) * @param XMLReader $document * @param \DOMElement $node * @param AbstractSlide $oSlide + * @throws \Exception */ protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, AbstractSlide $oSlide) { @@ -1150,6 +1160,7 @@ protected function loadParagraph(XMLReader $document, \DOMElement $oElement, $oS * @param XMLReader $xmlReader * @param \DOMElement $oElement * @param Border $oBorder + * @throws \Exception */ protected function loadStyleBorder(XMLReader $xmlReader, \DOMElement $oElement, Border $oBorder) { @@ -1197,6 +1208,7 @@ protected function loadStyleColor(XMLReader $xmlReader, \DOMElement $oElement) * @param XMLReader $xmlReader * @param \DOMElement $oElement * @return null|Fill + * @throws \Exception */ protected function loadStyleFill(XMLReader $xmlReader, \DOMElement $oElement) { @@ -1240,7 +1252,6 @@ protected function loadStyleFill(XMLReader $xmlReader, \DOMElement $oElement) /** * @param string $fileRels - * @return string */ protected function loadRels($fileRels) { @@ -1265,6 +1276,7 @@ protected function loadRels($fileRels) * @param $oSlide * @param \DOMNodeList $oElements * @param XMLReader $xmlReader + * @throws \Exception * @internal param $baseFile */ protected function loadSlideShapes($oSlide, $oElements, $xmlReader) diff --git a/src/PhpPresentation/Reader/PowerPoint97.php b/src/PhpPresentation/Reader/PowerPoint97.php index 98755ab8d..c120d36ef 100644 --- a/src/PhpPresentation/Reader/PowerPoint97.php +++ b/src/PhpPresentation/Reader/PowerPoint97.php @@ -421,8 +421,9 @@ public function load($pFilename) /** * Load PhpPresentation Serialized file * - * @param string $pFilename + * @param string $pFilename * @return \PhpOffice\PhpPresentation\PhpPresentation + * @throws \Exception */ private function loadFile($pFilename) { @@ -444,6 +445,7 @@ private function loadFile($pFilename) /** * Read OLE Part * @param string $pFilename + * @throws \Exception */ private function loadOLE($pFilename) { @@ -699,6 +701,8 @@ public static function getInt4d($data, $pos) * A container record that specifies the animation and sound information for a shape. * @param string $stream * @param integer $pos + * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd772900(v=office.12).aspx */ private function readRecordAnimationInfoContainer($stream, $pos) @@ -723,6 +727,7 @@ private function readRecordAnimationInfoContainer($stream, $pos) * A container record that specifies information about the document. * @param string $stream * @param integer $pos + * @throws \Exception * @link http://msdn.microsoft.com/en-us/library/dd947357(v=office.12).aspx */ private function readRecordDocumentContainer($stream, $pos) @@ -1009,6 +1014,7 @@ private function readRecordDocumentContainer($stream, $pos) * @param string $stream * @param integer $pos * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx */ private function readRecordDrawingContainer($stream, $pos) @@ -1313,6 +1319,7 @@ private function readRecordOfficeArtClientAnchor($stream, $pos) * @param string $stream * @param integer $pos * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd910958(v=office.12).aspx */ private function readRecordOfficeArtClientTextbox($stream, $pos) @@ -1460,6 +1467,7 @@ private function readRecordOfficeArtClientTextbox($stream, $pos) * @param string $stream * @param integer $pos * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd943794(v=office.12).aspx */ private function readRecordOfficeArtSpContainer($stream, $pos) @@ -1722,6 +1730,7 @@ private function readRecordOfficeArtSpContainer($stream, $pos) * @param integer $pos * @param boolean $bInGroup * @return array + * @throws \Exception * @link : https://msdn.microsoft.com/en-us/library/dd910416(v=office.12).aspx */ private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = false) @@ -1794,6 +1803,7 @@ private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = fal * @param string $stream * @param integer $pos * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd950206(v=office.12).aspx */ private function readRecordOfficeArtTertiaryFOPT($stream, $pos) @@ -1858,6 +1868,7 @@ private function readRecordOfficeArtTertiaryFOPT($stream, $pos) * @param string $stream * @param integer $pos * @return array + * @throws \Exception * @link : https://msdn.microsoft.com/en-us/library/dd924455(v=office.12).aspx */ private function readRecordOfficeArtDgContainer($stream, $pos) @@ -2312,6 +2323,8 @@ private function readRecordOfficeArtSecondaryFOPT($stream, $pos) * A container record that specifies information about a shape. * @param string $stream * @param integer $pos + * @return array + * @throws \Exception * @link : https://msdn.microsoft.com/en-us/library/dd950927(v=office.12).aspx */ private function readRecordOfficeArtClientData($stream, $pos) @@ -2427,6 +2440,8 @@ private function readRecordPersistDirectoryAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd904856(v=office.12).aspx + * @return array + * @return array */ private function readRecordPerSlideHeadersFootersContainer($stream, $pos) { @@ -2450,6 +2465,8 @@ private function readRecordPerSlideHeadersFootersContainer($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd923930(v=office.12).aspx + * @return array + * @return array */ private function readRecordPlaceholderAtom($stream, $pos) { @@ -2473,6 +2490,8 @@ private function readRecordPlaceholderAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd904899(v=office.12).aspx + * @return array + * @return array */ private function readRecordRecolorInfoAtom($stream, $pos) { @@ -2496,6 +2515,8 @@ private function readRecordRecolorInfoAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd910800(v=office.12).aspx + * @return array + * @return array */ private function readRecordRoundTripHFPlaceholder12Atom($stream, $pos) { @@ -2519,6 +2540,8 @@ private function readRecordRoundTripHFPlaceholder12Atom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd772926(v=office.12).aspx + * @return array + * @return array */ private function readRecordRoundTripShapeId12Atom($stream, $pos) { @@ -2542,6 +2565,8 @@ private function readRecordRoundTripShapeId12Atom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx + * @return array + * @return array */ private function readRecordRoundTripSlideSyncInfo12Container($stream, $pos) { @@ -2565,6 +2590,8 @@ private function readRecordRoundTripSlideSyncInfo12Container($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd908949(v=office.12).aspx + * @return array + * @return array */ private function readRecordShapeFlags10Atom($stream, $pos) { @@ -2588,6 +2615,7 @@ private function readRecordShapeFlags10Atom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd925824(v=office.12).aspx + * @return array */ private function readRecordShapeFlagsAtom($stream, $pos) { @@ -2611,6 +2639,7 @@ private function readRecordShapeFlagsAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd911033(v=office.12).aspx + * @return array */ private function readRecordShapeProgBinaryTagContainer($stream, $pos) { @@ -2633,6 +2662,8 @@ private function readRecordShapeProgBinaryTagContainer($stream, $pos) * A container record that specifies programmable tags with additional shape data. * @param string $stream * @param integer $pos + * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd911266(v=office.12).aspx */ private function readRecordShapeProgTagsContainer($stream, $pos) @@ -2709,6 +2740,7 @@ private function readRecordSlideAtom($stream, $pos) * A container record that specifies a presentation slide or title master slide. * @param string $stream * @param int $pos + * @throws \Exception * @link http://msdn.microsoft.com/en-us/library/dd946323(v=office.12).aspx */ private function readRecordSlideContainer($stream, $pos) @@ -2763,6 +2795,7 @@ private function readRecordSlideContainer($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd906297(v=office.12).aspx + * @return array */ private function readRecordSlideNameAtom($stream, $pos) { @@ -2792,6 +2825,7 @@ private function readRecordSlideNameAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd945703(v=office.12).aspx + * @return array */ private function readRecordSlideNumberMCAtom($stream, $pos) { @@ -2815,6 +2849,7 @@ private function readRecordSlideNumberMCAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd951946(v=office.12).aspx + * @return array */ private function readRecordSlideProgTagsContainer($stream, $pos) { @@ -2838,6 +2873,7 @@ private function readRecordSlideProgTagsContainer($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd949420(v=office.12).aspx + * @return array */ private function readRecordSlideSchemeColorSchemeAtom($stream, $pos) { @@ -2869,6 +2905,7 @@ private function readRecordSlideSchemeColorSchemeAtom($stream, $pos) * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd943408(v=office.12).aspx + * @return array */ private function readRecordSlideShowSlideInfoAtom($stream, $pos) { @@ -2947,6 +2984,8 @@ private function readRecordUserEditAtom($stream, $pos) * @param string $stream * @param int $pos * @param int $strLenRT + * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd945870(v=office.12).aspx */ private function readStructureTextCFRun($stream, $pos, $strLenRT) @@ -3061,6 +3100,9 @@ private function readStructureTextCFRun($stream, $pos, $strLenRT) * A structure that specifies the paragraph-level formatting of a run of text. * @param string $stream * @param integer $pos + * @param $strLenRT + * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd923535(v=office.12).aspx */ private function readStructureTextPFRun($stream, $pos, $strLenRT) @@ -3227,6 +3269,7 @@ private function readStructureTextPFRun($stream, $pos, $strLenRT) * @param integer $pos * @param string $strLenRT * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd909603(v=office.12).aspx */ private function readStructureTextSIRun($stream, $pos, $strLenRT) @@ -3286,6 +3329,8 @@ private function readStructureTextSIRun($stream, $pos, $strLenRT) * A structure that specifies tabbing, margins, and indentation for text. * @param string $stream * @param integer $pos + * @return array + * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd922749(v=office.12).aspx */ private function readStructureTextRuler($stream, $pos) diff --git a/src/PhpPresentation/Shape/Chart/Axis.php b/src/PhpPresentation/Shape/Chart/Axis.php index b2559bd2d..eeff28fea 100644 --- a/src/PhpPresentation/Shape/Chart/Axis.php +++ b/src/PhpPresentation/Shape/Chart/Axis.php @@ -155,7 +155,7 @@ public function getFont() * * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Axis */ public function setFont(Font $pFont = null) { diff --git a/src/PhpPresentation/Shape/Chart/Legend.php b/src/PhpPresentation/Shape/Chart/Legend.php index b169d69e3..989d93257 100644 --- a/src/PhpPresentation/Shape/Chart/Legend.php +++ b/src/PhpPresentation/Shape/Chart/Legend.php @@ -152,7 +152,7 @@ public function getPosition() * Set Position * * @param string $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Title + * @return \PhpOffice\PhpPresentation\Shape\Chart\Legend */ public function setPosition($value = self::POSITION_RIGHT) { @@ -263,7 +263,7 @@ public function getFont() * * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Legend */ public function setFont(Font $pFont = null) { @@ -285,7 +285,7 @@ public function getBorder() * Set Border * * @param \PhpOffice\PhpPresentation\Style\Border $border - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Legend */ public function setBorder(Border $border) { @@ -307,7 +307,7 @@ public function getFill() * Set Fill * * @param \PhpOffice\PhpPresentation\Style\Fill $fill - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Legend */ public function setFill(Fill $fill) { @@ -329,7 +329,7 @@ public function getAlignment() * Set alignment * * @param \PhpOffice\PhpPresentation\Style\Alignment $alignment - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Legend */ public function setAlignment(Alignment $alignment) { @@ -374,6 +374,7 @@ public function getHashIndex() * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index + * @return Legend */ public function setHashIndex($value) { diff --git a/src/PhpPresentation/Shape/Chart/PlotArea.php b/src/PhpPresentation/Shape/Chart/PlotArea.php index cdabff69f..a46a3b283 100644 --- a/src/PhpPresentation/Shape/Chart/PlotArea.php +++ b/src/PhpPresentation/Shape/Chart/PlotArea.php @@ -152,7 +152,7 @@ public function getOffsetX() * Set OffsetX (as a fraction of the chart) * * @param float|int $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Title + * @return \PhpOffice\PhpPresentation\Shape\Chart\PlotArea */ public function setOffsetX($value = 0) { @@ -175,7 +175,7 @@ public function getOffsetY() * Set OffsetY (as a fraction of the chart) * * @param float|int $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Title + * @return \PhpOffice\PhpPresentation\Shape\Chart\PlotArea */ public function setOffsetY($value = 0) { @@ -198,7 +198,7 @@ public function getWidth() * Set Width (as a fraction of the chart) * * @param float|int $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Title + * @return \PhpOffice\PhpPresentation\Shape\Chart\PlotArea */ public function setWidth($value = 0) { @@ -221,7 +221,7 @@ public function getHeight() * Set Height (as a fraction of the chart) * * @param float|int $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Title + * @return \PhpOffice\PhpPresentation\Shape\Chart\PlotArea */ public function setHeight($value = 0) { @@ -267,6 +267,7 @@ public function getHashIndex() * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index + * @return PlotArea */ public function setHashIndex($value) { diff --git a/src/PhpPresentation/Shape/Chart/Series.php b/src/PhpPresentation/Shape/Chart/Series.php index d3f6ca537..73cd03d4f 100644 --- a/src/PhpPresentation/Shape/Chart/Series.php +++ b/src/PhpPresentation/Shape/Chart/Series.php @@ -477,7 +477,7 @@ public function getFont() * * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Series */ public function setFont(Font $pFont = null) { @@ -583,8 +583,8 @@ public function setHashIndex($value) return $this; } + /** - * @return mixed * @link http://php.net/manual/en/language.oop5.cloning.php */ public function __clone() diff --git a/src/PhpPresentation/Shape/Chart/Title.php b/src/PhpPresentation/Shape/Chart/Title.php index ef5fe783a..5643a6d20 100644 --- a/src/PhpPresentation/Shape/Chart/Title.php +++ b/src/PhpPresentation/Shape/Chart/Title.php @@ -253,7 +253,7 @@ public function getFont() * * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\Chart\Title */ public function setFont(Font $pFont = null) { @@ -315,6 +315,7 @@ public function getHashIndex() * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index + * @return Title */ public function setHashIndex($value) { diff --git a/src/PhpPresentation/Shape/Chart/Type/AbstractType.php b/src/PhpPresentation/Shape/Chart/Type/AbstractType.php index 9e91520b1..e3eb3802c 100644 --- a/src/PhpPresentation/Shape/Chart/Type/AbstractType.php +++ b/src/PhpPresentation/Shape/Chart/Type/AbstractType.php @@ -93,6 +93,7 @@ public function getHashIndex() * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index + * @return AbstractType */ public function setHashIndex($value) { @@ -148,6 +149,8 @@ public function getData() * Set Data * * @deprecated setSeries + * @param array $value + * @return AbstractType */ public function setData($value = array()) { @@ -155,7 +158,6 @@ public function setData($value = array()) } /** - * @return mixed * @link http://php.net/manual/en/language.oop5.cloning.php */ public function __clone() diff --git a/src/PhpPresentation/Shape/Chart/Type/AbstractTypeBar.php b/src/PhpPresentation/Shape/Chart/Type/AbstractTypeBar.php index 4b2357b69..f0a8c3198 100644 --- a/src/PhpPresentation/Shape/Chart/Type/AbstractTypeBar.php +++ b/src/PhpPresentation/Shape/Chart/Type/AbstractTypeBar.php @@ -60,7 +60,7 @@ class AbstractTypeBar extends AbstractType * Set bar orientation * * @param string $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar + * @return \PhpOffice\PhpPresentation\Shape\Chart\Type\AbstractTypeBar */ public function setBarDirection($value = self::DIRECTION_VERTICAL) { @@ -82,7 +82,7 @@ public function getBarDirection() * Set bar grouping (stack or expanded style bar) * * @param string $value - * @return \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar + * @return \PhpOffice\PhpPresentation\Shape\Chart\Type\AbstractTypeBar */ public function setBarGrouping($value = self::GROUPING_CLUSTERED) { diff --git a/src/PhpPresentation/Shape/Chart/View3D.php b/src/PhpPresentation/Shape/Chart/View3D.php index 541468fce..dc773cc23 100644 --- a/src/PhpPresentation/Shape/Chart/View3D.php +++ b/src/PhpPresentation/Shape/Chart/View3D.php @@ -248,6 +248,7 @@ public function getHashIndex() * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index + * @return View3D */ public function setHashIndex($value) { diff --git a/src/PhpPresentation/Shape/Drawing/Base64.php b/src/PhpPresentation/Shape/Drawing/Base64.php index 15059763b..6f9927692 100644 --- a/src/PhpPresentation/Shape/Drawing/Base64.php +++ b/src/PhpPresentation/Shape/Drawing/Base64.php @@ -77,6 +77,7 @@ public function getExtension() /** * @return string + * @throws \Exception */ public function getIndexedFilename() { diff --git a/src/PhpPresentation/Shape/Drawing/File.php b/src/PhpPresentation/Shape/Drawing/File.php index 1995f561a..541f5925f 100644 --- a/src/PhpPresentation/Shape/Drawing/File.php +++ b/src/PhpPresentation/Shape/Drawing/File.php @@ -25,7 +25,7 @@ public function getPath() * @param string $pValue File path * @param boolean $pVerifyFile Verify file * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\Drawing + * @return \PhpOffice\PhpPresentation\Shape\Drawing\File */ public function setPath($pValue = '', $pVerifyFile = true) { diff --git a/src/PhpPresentation/Shape/Drawing/ZipFile.php b/src/PhpPresentation/Shape/Drawing/ZipFile.php index 3b8e5867b..769f1d9ff 100644 --- a/src/PhpPresentation/Shape/Drawing/ZipFile.php +++ b/src/PhpPresentation/Shape/Drawing/ZipFile.php @@ -25,7 +25,7 @@ public function getPath() * Set Path * * @param string $pValue File path - * @return \PhpOffice\PhpPresentation\Shape\Drawing + * @return \PhpOffice\PhpPresentation\Shape\Drawing\ZipFile */ public function setPath($pValue = '') { @@ -35,6 +35,7 @@ public function setPath($pValue = '') /** * @return string + * @throws \Exception */ public function getContents() { @@ -61,6 +62,7 @@ public function getExtension() /** * @return string + * @throws \Exception */ public function getMimeType() { diff --git a/src/PhpPresentation/Shape/Group.php b/src/PhpPresentation/Shape/Group.php index ba3207a29..e4ebdc4b3 100644 --- a/src/PhpPresentation/Shape/Group.php +++ b/src/PhpPresentation/Shape/Group.php @@ -70,11 +70,12 @@ public function getShapeCollection() } /** - * Add shape to slide - * - * @param \PhpOffice\PhpPresentation\AbstractShape $shape - * @return \PhpOffice\PhpPresentation\AbstractShape - */ + * Add shape to slide + * + * @param \PhpOffice\PhpPresentation\AbstractShape $shape + * @return \PhpOffice\PhpPresentation\AbstractShape + * @throws \Exception + */ public function addShape(AbstractShape $shape) { $shape->setContainer($this); @@ -191,10 +192,11 @@ public function setHeight($pValue = 0) } /** - * Create rich text shape - * - * @return \PhpOffice\PhpPresentation\Shape\RichText - */ + * Create rich text shape + * + * @return \PhpOffice\PhpPresentation\Shape\RichText + * @throws \Exception + */ public function createRichTextShape() { $shape = new RichText(); @@ -204,14 +206,15 @@ public function createRichTextShape() } /** - * Create line shape - * - * @param int $fromX Starting point x offset - * @param int $fromY Starting point y offset - * @param int $toX Ending point x offset - * @param int $toY Ending point y offset - * @return \PhpOffice\PhpPresentation\Shape\Line - */ + * Create line shape + * + * @param int $fromX Starting point x offset + * @param int $fromY Starting point y offset + * @param int $toX Ending point x offset + * @param int $toY Ending point y offset + * @return \PhpOffice\PhpPresentation\Shape\Line + * @throws \Exception + */ public function createLineShape($fromX, $fromY, $toX, $toY) { $shape = new Line($fromX, $fromY, $toX, $toY); @@ -221,10 +224,11 @@ public function createLineShape($fromX, $fromY, $toX, $toY) } /** - * Create chart shape - * - * @return \PhpOffice\PhpPresentation\Shape\Chart - */ + * Create chart shape + * + * @return \PhpOffice\PhpPresentation\Shape\Chart + * @throws \Exception + */ public function createChartShape() { $shape = new Chart(); @@ -234,10 +238,11 @@ public function createChartShape() } /** - * Create drawing shape - * - * @return \PhpOffice\PhpPresentation\Shape\Drawing\File - */ + * Create drawing shape + * + * @return \PhpOffice\PhpPresentation\Shape\Drawing\File + * @throws \Exception + */ public function createDrawingShape() { $shape = new Drawing\File(); @@ -247,11 +252,12 @@ public function createDrawingShape() } /** - * Create table shape - * - * @param int $columns Number of columns - * @return \PhpOffice\PhpPresentation\Shape\Table - */ + * Create table shape + * + * @param int $columns Number of columns + * @return \PhpOffice\PhpPresentation\Shape\Table + * @throws \Exception + */ public function createTableShape($columns = 1) { $shape = new Table($columns); diff --git a/src/PhpPresentation/Shape/RichText.php b/src/PhpPresentation/Shape/RichText.php index 9782aaae8..d7cc34152 100644 --- a/src/PhpPresentation/Shape/RichText.php +++ b/src/PhpPresentation/Shape/RichText.php @@ -229,6 +229,7 @@ public function getParagraph($index = 0) * Create paragraph * * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @throws \Exception */ public function createParagraph() { @@ -651,6 +652,7 @@ public function setInsetTop($value = 4.8) /** * Set horizontal auto shrink * @param bool $value + * @return RichText */ public function setAutoShrinkHorizontal($value = null) { @@ -668,10 +670,11 @@ public function hasAutoShrinkHorizontal() { return $this->autoShrinkHorizontal; } - + /** * Set vertical auto shrink * @param bool $value + * @return RichText */ public function setAutoShrinkVertical($value = null) { diff --git a/src/PhpPresentation/Shape/RichText/TextElement.php b/src/PhpPresentation/Shape/RichText/TextElement.php index 2cdbd499b..e19b9b81c 100644 --- a/src/PhpPresentation/Shape/RichText/TextElement.php +++ b/src/PhpPresentation/Shape/RichText/TextElement.php @@ -101,6 +101,7 @@ public function hasHyperlink() * Get Hyperlink * * @return \PhpOffice\PhpPresentation\Shape\Hyperlink + * @throws \Exception */ public function getHyperlink() { @@ -116,7 +117,7 @@ public function getHyperlink() * * @param \PhpOffice\PhpPresentation\Shape\Hyperlink $pHyperlink * @throws \Exception - * @return \PhpOffice\PhpPresentation\AbstractShape + * @return \PhpOffice\PhpPresentation\Shape\RichText\TextElement */ public function setHyperlink(Hyperlink $pHyperlink = null) { diff --git a/src/PhpPresentation/Shape/Table/Cell.php b/src/PhpPresentation/Shape/Table/Cell.php index d06915da2..0a184d205 100644 --- a/src/PhpPresentation/Shape/Table/Cell.php +++ b/src/PhpPresentation/Shape/Table/Cell.php @@ -160,6 +160,7 @@ public function getParagraph($index = 0) * Create paragraph * * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph + * @throws \Exception */ public function createParagraph() { @@ -184,7 +185,7 @@ public function createParagraph() * * @param \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface $pText Rich text element * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function addText(TextElementInterface $pText = null) { @@ -272,7 +273,7 @@ public function getParagraphs() * * @param \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setParagraphs($paragraphs = null) { @@ -298,7 +299,7 @@ public function getFill() * Set fill * * @param \PhpOffice\PhpPresentation\Style\Fill $fill - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setFill(Fill $fill) { @@ -321,7 +322,7 @@ public function getBorders() * Set borders * * @param \PhpOffice\PhpPresentation\Style\Borders $borders - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setBorders(Borders $borders) { @@ -344,7 +345,7 @@ public function getWidth() * Set width * * @param int $value - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setWidth($value = 0) { @@ -367,7 +368,7 @@ public function getColSpan() * Set colSpan * * @param int $value - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setColSpan($value = 0) { @@ -390,7 +391,7 @@ public function getRowSpan() * Set rowSpan * * @param int $value - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Cell */ public function setRowSpan($value = 0) { diff --git a/src/PhpPresentation/Shape/Table/Row.php b/src/PhpPresentation/Shape/Table/Row.php index fb95d8df8..18d447537 100644 --- a/src/PhpPresentation/Shape/Table/Row.php +++ b/src/PhpPresentation/Shape/Table/Row.php @@ -160,7 +160,7 @@ public function getHeight() * Set height * * @param int $value - * @return \PhpOffice\PhpPresentation\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\Table\Row */ public function setHeight($value = 0) { diff --git a/src/PhpPresentation/Slide/AbstractSlide.php b/src/PhpPresentation/Slide/AbstractSlide.php index fa28559d4..3e1c5c173 100644 --- a/src/PhpPresentation/Slide/AbstractSlide.php +++ b/src/PhpPresentation/Slide/AbstractSlide.php @@ -109,6 +109,7 @@ public function getShapeCollection() /** * Get collection of shapes * + * @param array $shapeCollection * @return AbstractSlide */ public function setShapeCollection($shapeCollection = array()) @@ -122,6 +123,7 @@ public function setShapeCollection($shapeCollection = array()) * * @param \PhpOffice\PhpPresentation\AbstractShape $shape * @return \PhpOffice\PhpPresentation\AbstractShape + * @throws \Exception */ public function addShape(AbstractShape $shape) { @@ -229,6 +231,7 @@ public function setHashIndex($value) * Create rich text shape * * @return \PhpOffice\PhpPresentation\Shape\RichText + * @throws \Exception */ public function createRichTextShape() { @@ -245,6 +248,7 @@ public function createRichTextShape() * @param int $toX Ending point x offset * @param int $toY Ending point y offset * @return \PhpOffice\PhpPresentation\Shape\Line + * @throws \Exception */ public function createLineShape($fromX, $fromY, $toX, $toY) { @@ -257,6 +261,7 @@ public function createLineShape($fromX, $fromY, $toX, $toY) * Create chart shape * * @return \PhpOffice\PhpPresentation\Shape\Chart + * @throws \Exception */ public function createChartShape() { @@ -269,6 +274,7 @@ public function createChartShape() * Create drawing shape * * @return \PhpOffice\PhpPresentation\Shape\Drawing\File + * @throws \Exception */ public function createDrawingShape() { @@ -282,6 +288,7 @@ public function createDrawingShape() * * @param int $columns Number of columns * @return \PhpOffice\PhpPresentation\Shape\Table + * @throws \Exception */ public function createTableShape($columns = 1) { @@ -294,6 +301,7 @@ public function createTableShape($columns = 1) * Creates a group within this slide * * @return \PhpOffice\PhpPresentation\Shape\Group + * @throws \Exception */ public function createGroup() { @@ -316,7 +324,8 @@ public function getParent() * Re-bind parent * * @param \PhpOffice\PhpPresentation\PhpPresentation $parent - * @return \PhpOffice\PhpPresentation\Slide + * @return \PhpOffice\PhpPresentation\Slide\AbstractSlide + * @throws \Exception */ public function rebindParent(PhpPresentation $parent) { @@ -335,7 +344,7 @@ public function getBackground() /** * @param AbstractBackground $background - * @return Slide + * @return \PhpOffice\PhpPresentation\Slide\AbstractSlide */ public function setBackground(AbstractBackground $background = null) { @@ -355,7 +364,7 @@ public function getTransition() /** * * @param \PhpOffice\PhpPresentation\Slide\Transition $transition - * @return \PhpOffice\PhpPresentation\Slide + * @return \PhpOffice\PhpPresentation\Slide\AbstractSlide */ public function setTransition(Transition $transition = null) { diff --git a/src/PhpPresentation/Slide/Background/Image.php b/src/PhpPresentation/Slide/Background/Image.php index 4aaf9b505..12601c943 100644 --- a/src/PhpPresentation/Slide/Background/Image.php +++ b/src/PhpPresentation/Slide/Background/Image.php @@ -44,7 +44,7 @@ public function getPath() * @param string $pValue File path * @param boolean $pVerifyFile Verify file * @throws \Exception - * @return \PhpOffice\PhpPresentation\Shape\Drawing + * @return \PhpOffice\PhpPresentation\Slide\Background\Image */ public function setPath($pValue = '', $pVerifyFile = true) { @@ -87,6 +87,7 @@ public function getExtension() /** * Get indexed filename (using image index) * + * @param $numSlide * @return string */ public function getIndexedFilename($numSlide) diff --git a/src/PhpPresentation/Slide/Iterator.php b/src/PhpPresentation/Slide/Iterator.php index 72043c1d4..66d159d78 100644 --- a/src/PhpPresentation/Slide/Iterator.php +++ b/src/PhpPresentation/Slide/Iterator.php @@ -71,6 +71,7 @@ public function rewind() * Current \PhpOffice\PhpPresentation\Slide * * @return \PhpOffice\PhpPresentation\Slide + * @throws \Exception */ public function current() { diff --git a/src/PhpPresentation/Slide/Note.php b/src/PhpPresentation/Slide/Note.php index 2dd9bb3ab..f4af120e7 100644 --- a/src/PhpPresentation/Slide/Note.php +++ b/src/PhpPresentation/Slide/Note.php @@ -117,6 +117,7 @@ public function getShapeCollection() * * @param \PhpOffice\PhpPresentation\AbstractShape $shape * @return \PhpOffice\PhpPresentation\AbstractShape + * @throws \Exception */ public function addShape(AbstractShape $shape) { @@ -129,6 +130,7 @@ public function addShape(AbstractShape $shape) * Create rich text shape * * @return \PhpOffice\PhpPresentation\Shape\RichText + * @throws \Exception */ public function createRichTextShape() { diff --git a/src/PhpPresentation/Slide/SlideMaster.php b/src/PhpPresentation/Slide/SlideMaster.php index ee5d6bd3b..f06f7402a 100644 --- a/src/PhpPresentation/Slide/SlideMaster.php +++ b/src/PhpPresentation/Slide/SlideMaster.php @@ -72,6 +72,7 @@ class SlideMaster extends AbstractSlide implements ComparableInterface, ShapeCon * Create a new slideMaster * * @param PhpPresentation $pParent + * @throws \Exception */ public function __construct(PhpPresentation $pParent = null) { @@ -101,6 +102,7 @@ public function __construct(PhpPresentation $pParent = null) * Create a slideLayout and add it to this presentation * * @return \PhpOffice\PhpPresentation\Slide\SlideLayout + * @throws \Exception */ public function createSlideLayout() { diff --git a/src/PhpPresentation/Style/Outline.php b/src/PhpPresentation/Style/Outline.php index 90c443eb2..03c7d21d4 100644 --- a/src/PhpPresentation/Style/Outline.php +++ b/src/PhpPresentation/Style/Outline.php @@ -31,8 +31,9 @@ class Outline */ protected $width; + /** - * @return Outline + * Outline constructor. */ public function __construct() { diff --git a/src/PhpPresentation/Style/TextStyle.php b/src/PhpPresentation/Style/TextStyle.php index 2903955cc..2f41c7ae6 100644 --- a/src/PhpPresentation/Style/TextStyle.php +++ b/src/PhpPresentation/Style/TextStyle.php @@ -40,6 +40,7 @@ class TextStyle /** * TextStyle constructor. * @param bool $default + * @throws \Exception */ public function __construct($default = true) { diff --git a/src/PhpPresentation/Writer/AbstractWriter.php b/src/PhpPresentation/Writer/AbstractWriter.php index b3a6b6985..51698c881 100644 --- a/src/PhpPresentation/Writer/AbstractWriter.php +++ b/src/PhpPresentation/Writer/AbstractWriter.php @@ -58,7 +58,7 @@ public function getPhpPresentation() * * @param PhpPresentation $pPhpPresentation PhpPresentation object * @throws \Exception - * @return \PhpOffice\PhpPresentation\Writer\ODPresentation + * @return \PhpOffice\PhpPresentation\Writer\AbstractWriter */ public function setPhpPresentation(PhpPresentation $pPhpPresentation = null) { diff --git a/src/PhpPresentation/Writer/ODPresentation.php b/src/PhpPresentation/Writer/ODPresentation.php index 8408c29de..027afdf64 100644 --- a/src/PhpPresentation/Writer/ODPresentation.php +++ b/src/PhpPresentation/Writer/ODPresentation.php @@ -52,6 +52,7 @@ class ODPresentation extends AbstractWriter implements WriterInterface * Create a new \PhpOffice\PhpPresentation\Writer\ODPresentation * * @param PhpPresentation $pPhpPresentation + * @throws \Exception */ public function __construct(PhpPresentation $pPhpPresentation = null) { diff --git a/src/PhpPresentation/Writer/ODPresentation/Content.php b/src/PhpPresentation/Writer/ODPresentation/Content.php index ad88a8b9e..88fc37ac1 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Content.php +++ b/src/PhpPresentation/Writer/ODPresentation/Content.php @@ -59,6 +59,7 @@ class Content extends AbstractDecoratorWriter /** * @return ZipInterface + * @throws \Exception */ public function render() { @@ -370,7 +371,8 @@ public function writeShapeMedia(XMLWriter $objWriter, Media $shape) * Write picture * * @param \PhpOffice\Common\XMLWriter $objWriter - * @param \PhpOffice\PhpPresentation\Shape\AbstractDrawingAdapter $shape + * @param AbstractDrawingAdapter $shape + * @throws \Exception */ public function writeShapeDrawing(XMLWriter $objWriter, ShapeDrawing\AbstractDrawingAdapter $shape) { @@ -418,6 +420,7 @@ public function writeShapeDrawing(XMLWriter $objWriter, ShapeDrawing\AbstractDra * * @param \PhpOffice\Common\XMLWriter $objWriter * @param \PhpOffice\PhpPresentation\Shape\RichText $shape + * @throws \Exception */ public function writeShapeTxt(XMLWriter $objWriter, RichText $shape) { @@ -616,6 +619,7 @@ public function writeShapeLine(XMLWriter $objWriter, Line $shape) * Write table Shape * @param XMLWriter $objWriter * @param Table $shape + * @throws \Exception */ public function writeShapeTable(XMLWriter $objWriter, Table $shape) { @@ -736,6 +740,7 @@ public function writeShapeChart(XMLWriter $objWriter, Chart $shape) * * @param XMLWriter $objWriter * @param Group $group + * @throws \Exception */ public function writeShapeGroup(XMLWriter $objWriter, Group $group) { @@ -1077,6 +1082,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) * Write the slide note * @param XMLWriter $objWriter * @param \PhpOffice\PhpPresentation\Slide\Note $note + * @throws \Exception */ public function writeSlideNote(XMLWriter $objWriter, Note $note) { diff --git a/src/PhpPresentation/Writer/ODPresentation/Meta.php b/src/PhpPresentation/Writer/ODPresentation/Meta.php index b73dfae21..751a42082 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Meta.php +++ b/src/PhpPresentation/Writer/ODPresentation/Meta.php @@ -7,7 +7,8 @@ class Meta extends AbstractDecoratorWriter { /** - * @return ZipInterface + * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/ODPresentation/MetaInfManifest.php b/src/PhpPresentation/Writer/ODPresentation/MetaInfManifest.php index 1a2710a9b..9a263db66 100644 --- a/src/PhpPresentation/Writer/ODPresentation/MetaInfManifest.php +++ b/src/PhpPresentation/Writer/ODPresentation/MetaInfManifest.php @@ -12,6 +12,7 @@ class MetaInfManifest extends AbstractDecoratorWriter { /** * @return ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/ODPresentation/Mimetype.php b/src/PhpPresentation/Writer/ODPresentation/Mimetype.php index 342da946d..546b6f341 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Mimetype.php +++ b/src/PhpPresentation/Writer/ODPresentation/Mimetype.php @@ -5,7 +5,8 @@ class Mimetype extends AbstractDecoratorWriter { /** - * @return ZipInterface + * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/ODPresentation/ObjectsChart.php b/src/PhpPresentation/Writer/ODPresentation/ObjectsChart.php index c31cc68b3..0aec5562e 100644 --- a/src/PhpPresentation/Writer/ODPresentation/ObjectsChart.php +++ b/src/PhpPresentation/Writer/ODPresentation/ObjectsChart.php @@ -49,6 +49,7 @@ class ObjectsChart extends AbstractDecoratorWriter /** * @return ZipInterface + * @throws \Exception */ public function render() { @@ -216,6 +217,7 @@ protected function writeContentPart(Chart $chart) /** * @param Chart $chart + * @throws \Exception */ private function writeAxis(Chart $chart) { @@ -274,6 +276,7 @@ protected function writeGridline($oGridlines, $styleName, $chartClass) /** * @param Chart $chart + * @throws \Exception * @todo Set function in \PhpPresentation\Shape\Chart\Axis for defining width and color of the axis */ protected function writeAxisStyle(Chart $chart) @@ -496,6 +499,7 @@ private function writeLegendStyle(Chart $chart) /** * @param Chart $chart + * @throws \Exception */ private function writePlotArea(Chart $chart) { @@ -551,6 +555,7 @@ private function writePlotArea(Chart $chart) /** * @param Chart $chart + * @throws \Exception * @link : http://books.evc-cit.info/odbook/ch08.html#chart-plot-area-section */ private function writePlotAreaStyle(Chart $chart) @@ -679,6 +684,7 @@ private function writeSeries(Chart $chart, Chart\Series $series) /** * @param Chart $chart * @param Chart\Series $series + * @throws \Exception */ private function writeSeriesStyle(Chart $chart, Chart\Series $series) { @@ -959,6 +965,7 @@ private function writeWall() /** * @param Chart $chart + * @throws \Exception */ private function writeWallStyle(Chart $chart) { diff --git a/src/PhpPresentation/Writer/ODPresentation/Pictures.php b/src/PhpPresentation/Writer/ODPresentation/Pictures.php index 32ce96819..6ec4e54ee 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Pictures.php +++ b/src/PhpPresentation/Writer/ODPresentation/Pictures.php @@ -10,6 +10,7 @@ class Pictures extends AbstractDecoratorWriter { /** * @return ZipInterface + * @throws \Exception */ public function render() diff --git a/src/PhpPresentation/Writer/ODPresentation/Styles.php b/src/PhpPresentation/Writer/ODPresentation/Styles.php index 7cbd0d4cd..3c7fd72fc 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Styles.php +++ b/src/PhpPresentation/Writer/ODPresentation/Styles.php @@ -28,7 +28,8 @@ class Styles extends AbstractDecoratorWriter protected $arrayStrokeDash = array(); /** - * @return ZipInterface + * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { @@ -311,6 +312,7 @@ protected function writeGradientFill(XMLWriter $objWriter, Fill $oFill) * Write the background image style * @param XMLWriter $objWriter * @param Image $oBkgImage + * @param $numSlide */ protected function writeBackgroundStyle(XMLWriter $objWriter, Image $oBkgImage, $numSlide) { diff --git a/src/PhpPresentation/Writer/ODPresentation/ThumbnailsThumbnail.php b/src/PhpPresentation/Writer/ODPresentation/ThumbnailsThumbnail.php index c211761d7..b481a5672 100644 --- a/src/PhpPresentation/Writer/ODPresentation/ThumbnailsThumbnail.php +++ b/src/PhpPresentation/Writer/ODPresentation/ThumbnailsThumbnail.php @@ -5,7 +5,8 @@ class ThumbnailsThumbnail extends AbstractDecoratorWriter { /** - * @return ZipInterface + * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007.php b/src/PhpPresentation/Writer/PowerPoint2007.php index 65bbb39fd..2b6e2c27d 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007.php +++ b/src/PhpPresentation/Writer/PowerPoint2007.php @@ -54,6 +54,7 @@ class PowerPoint2007 extends AbstractWriter implements WriterInterface * Create a new PowerPoint2007 file * * @param PhpPresentation $pPhpPresentation + * @throws \Exception */ public function __construct(PhpPresentation $pPhpPresentation = null) { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/AbstractDecoratorWriter.php b/src/PhpPresentation/Writer/PowerPoint2007/AbstractDecoratorWriter.php index 2fd94c3ec..b01ebdda4 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/AbstractDecoratorWriter.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/AbstractDecoratorWriter.php @@ -256,6 +256,7 @@ protected function writePatternFill(XMLWriter $objWriter, Fill $pFill) * Write Outline * @param XMLWriter $objWriter * @param Outline $oOutline + * @throws \Exception */ protected function writeOutline(XMLWriter $objWriter, $oOutline) { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/AbstractSlide.php b/src/PhpPresentation/Writer/PowerPoint2007/AbstractSlide.php index b36492484..9c09730f5 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/AbstractSlide.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/AbstractSlide.php @@ -48,6 +48,7 @@ abstract class AbstractSlide extends AbstractDecoratorWriter * @param AbstractSlideAlias $pSlideMaster * @param $objWriter * @param $relId + * @return mixed * @throws \Exception */ protected function writeDrawingRelations(AbstractSlideAlias $pSlideMaster, $objWriter, $relId) @@ -631,6 +632,7 @@ protected function writeParagraphs(XMLWriter $objWriter, $paragraphs, $bIsPlaceh * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer * @param \PhpOffice\PhpPresentation\Shape\Line $shape * @param int $shapeId + * @throws \Exception */ protected function writeShapeLine(XMLWriter $objWriter, Line $shape, $shapeId) { @@ -757,6 +759,7 @@ protected function writeShadow(XMLWriter $objWriter, $oShadow) * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer * @param \PhpOffice\PhpPresentation\AbstractShape|\PhpOffice\PhpPresentation\Shape\RichText\TextElement $shape + * @throws \Exception */ protected function writeHyperlink(XMLWriter $objWriter, $shape) { @@ -1228,6 +1231,7 @@ protected function writeShapePic(XMLWriter $objWriter, AbstractGraphic $shape, $ * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer * @param \PhpOffice\PhpPresentation\Shape\Group $group * @param int $shapeId + * @throws \Exception */ protected function writeShapeGroup(XMLWriter $objWriter, Group $group, &$shapeId) { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/CommentAuthors.php b/src/PhpPresentation/Writer/PowerPoint2007/CommentAuthors.php index b730bd201..07e5d1d31 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/CommentAuthors.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/CommentAuthors.php @@ -11,6 +11,7 @@ class CommentAuthors extends AbstractDecoratorWriter { /** * @return ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsApp.php b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsApp.php index c5a301098..5bb8714ec 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsApp.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsApp.php @@ -8,6 +8,7 @@ class DocPropsApp extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php index dd954246a..591f42be1 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php @@ -8,6 +8,7 @@ class DocPropsCore extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCustom.php b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCustom.php index 7d49a6374..b017654f7 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCustom.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsCustom.php @@ -8,6 +8,7 @@ class DocPropsCustom extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsThumbnail.php b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsThumbnail.php index edd79caa7..64308a41c 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/DocPropsThumbnail.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/DocPropsThumbnail.php @@ -6,6 +6,7 @@ class DocPropsThumbnail extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php index bfedd4727..1f186bbaa 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php @@ -2116,6 +2116,7 @@ protected function writeSeriesMarker(XMLWriter $objWriter, Chart\Marker $oMarker * @param Chart\Axis $oAxis * @param $typeAxis * @param Chart\Type\AbstractType $typeChart + * @throws \Exception */ protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, $typeAxis, Chart\Type\AbstractType $typeChart) { @@ -2359,6 +2360,7 @@ protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, $typeAxis, /** * @param XMLWriter $objWriter * @param Gridlines $oGridlines + * @throws \Exception */ protected function writeAxisGridlines(XMLWriter $objWriter, Gridlines $oGridlines) { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptComments.php b/src/PhpPresentation/Writer/PowerPoint2007/PptComments.php index badf1ac7e..4c1cc19a2 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptComments.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptComments.php @@ -12,6 +12,7 @@ class PptComments extends AbstractDecoratorWriter { /** * @return ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php b/src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php index 0196e391f..58121bec5 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php @@ -8,6 +8,7 @@ class PptMedia extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptPresProps.php b/src/PhpPresentation/Writer/PowerPoint2007/PptPresProps.php index df1234979..d434e0353 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptPresProps.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptPresProps.php @@ -7,6 +7,7 @@ class PptPresProps extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptPresentation.php b/src/PhpPresentation/Writer/PowerPoint2007/PptPresentation.php index 5e9b3305a..a38c016a7 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptPresentation.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptPresentation.php @@ -9,6 +9,7 @@ class PptPresentation extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptSlideLayouts.php b/src/PhpPresentation/Writer/PowerPoint2007/PptSlideLayouts.php index eaf3ac78e..52f917e6f 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptSlideLayouts.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptSlideLayouts.php @@ -12,6 +12,7 @@ class PptSlideLayouts extends AbstractSlide { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptSlideMasters.php b/src/PhpPresentation/Writer/PowerPoint2007/PptSlideMasters.php index b8ce79cab..56379c233 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptSlideMasters.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptSlideMasters.php @@ -17,6 +17,7 @@ class PptSlideMasters extends AbstractSlide { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php b/src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php index 515cadbd9..14e73d8f8 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php @@ -22,6 +22,7 @@ class PptSlides extends AbstractSlide /** * Add slides (drawings, ...) and slide relationships (drawings, ...) * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptTableProps.php b/src/PhpPresentation/Writer/PowerPoint2007/PptTableProps.php index f79a1a15a..e9dd71d24 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptTableProps.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptTableProps.php @@ -7,6 +7,7 @@ class PptTableProps extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptViewProps.php b/src/PhpPresentation/Writer/PowerPoint2007/PptViewProps.php index 2c155d5c9..f014fe7b3 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptViewProps.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptViewProps.php @@ -7,6 +7,7 @@ class PptViewProps extends AbstractDecoratorWriter { /** * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/PowerPoint2007/Relationships.php b/src/PhpPresentation/Writer/PowerPoint2007/Relationships.php index fc0af8095..ccc576859 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/Relationships.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/Relationships.php @@ -11,6 +11,7 @@ class Relationships extends AbstractDecoratorWriter /** * Add relationships to ZIP file * @return \PhpOffice\Common\Adapter\Zip\ZipInterface + * @throws \Exception */ public function render() { diff --git a/src/PhpPresentation/Writer/Serialized.php b/src/PhpPresentation/Writer/Serialized.php index da8aa403f..c7e5bb2cd 100644 --- a/src/PhpPresentation/Writer/Serialized.php +++ b/src/PhpPresentation/Writer/Serialized.php @@ -31,6 +31,7 @@ class Serialized extends AbstractWriter implements WriterInterface * Create a new \PhpOffice\PhpPresentation\Writer\Serialized * * @param \PhpOffice\PhpPresentation\PhpPresentation $pPhpPresentation + * @throws \Exception */ public function __construct(PhpPresentation $pPhpPresentation = null) { From 3253348a312476d8652f886e3219ad347c4b675c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Noblot Date: Tue, 23 Oct 2018 14:38:38 +0200 Subject: [PATCH 23/26] Fix Regression PHP Docs int->float --- src/PhpPresentation/PhpPresentation.php | 4 ++-- src/PhpPresentation/PresentationProperties.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PhpPresentation/PhpPresentation.php b/src/PhpPresentation/PhpPresentation.php index df64568f1..172babe12 100644 --- a/src/PhpPresentation/PhpPresentation.php +++ b/src/PhpPresentation/PhpPresentation.php @@ -406,11 +406,11 @@ public function isMarkedAsFinal() /** * Set the zoom of the document (in percentage) - * @param int $zoom + * @param float $zoom * @return PresentationProperties * @deprecated for getPresentationProperties()->setZoom() */ - public function setZoom($zoom = 1) + public function setZoom($zoom = 1.0) { return $this->getPresentationProperties()->setZoom($zoom); } diff --git a/src/PhpPresentation/PresentationProperties.php b/src/PhpPresentation/PresentationProperties.php index 8d5df960d..05b6dbf82 100644 --- a/src/PhpPresentation/PresentationProperties.php +++ b/src/PhpPresentation/PresentationProperties.php @@ -139,10 +139,10 @@ public function isMarkedAsFinal() /** * Set the zoom of the document (in percentage) - * @param int $zoom + * @param float $zoom * @return PresentationProperties */ - public function setZoom($zoom = 1) + public function setZoom($zoom = 1.0) { if (is_numeric($zoom)) { $this->zoom = (float)$zoom; From 8afafb3906819ae19a5e8e14288b6619dc1461a6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Noblot Date: Tue, 23 Oct 2018 15:09:21 +0200 Subject: [PATCH 24/26] Fix double aray in PHPDocs Fix Typing --- src/PhpPresentation/Reader/PowerPoint97.php | 9 +-------- src/PhpPresentation/Slide/Background/Image.php | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/PhpPresentation/Reader/PowerPoint97.php b/src/PhpPresentation/Reader/PowerPoint97.php index c120d36ef..385638c83 100644 --- a/src/PhpPresentation/Reader/PowerPoint97.php +++ b/src/PhpPresentation/Reader/PowerPoint97.php @@ -2441,7 +2441,6 @@ private function readRecordPersistDirectoryAtom($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd904856(v=office.12).aspx * @return array - * @return array */ private function readRecordPerSlideHeadersFootersContainer($stream, $pos) { @@ -2466,7 +2465,6 @@ private function readRecordPerSlideHeadersFootersContainer($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd923930(v=office.12).aspx * @return array - * @return array */ private function readRecordPlaceholderAtom($stream, $pos) { @@ -2491,7 +2489,6 @@ private function readRecordPlaceholderAtom($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd904899(v=office.12).aspx * @return array - * @return array */ private function readRecordRecolorInfoAtom($stream, $pos) { @@ -2516,7 +2513,6 @@ private function readRecordRecolorInfoAtom($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd910800(v=office.12).aspx * @return array - * @return array */ private function readRecordRoundTripHFPlaceholder12Atom($stream, $pos) { @@ -2541,7 +2537,6 @@ private function readRecordRoundTripHFPlaceholder12Atom($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd772926(v=office.12).aspx * @return array - * @return array */ private function readRecordRoundTripShapeId12Atom($stream, $pos) { @@ -2566,7 +2561,6 @@ private function readRecordRoundTripShapeId12Atom($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx * @return array - * @return array */ private function readRecordRoundTripSlideSyncInfo12Container($stream, $pos) { @@ -2591,7 +2585,6 @@ private function readRecordRoundTripSlideSyncInfo12Container($stream, $pos) * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd908949(v=office.12).aspx * @return array - * @return array */ private function readRecordShapeFlags10Atom($stream, $pos) { @@ -3100,7 +3093,7 @@ private function readStructureTextCFRun($stream, $pos, $strLenRT) * A structure that specifies the paragraph-level formatting of a run of text. * @param string $stream * @param integer $pos - * @param $strLenRT + * @param integer $strLenRT * @return array * @throws \Exception * @link https://msdn.microsoft.com/en-us/library/dd923535(v=office.12).aspx diff --git a/src/PhpPresentation/Slide/Background/Image.php b/src/PhpPresentation/Slide/Background/Image.php index 12601c943..ca6eb542c 100644 --- a/src/PhpPresentation/Slide/Background/Image.php +++ b/src/PhpPresentation/Slide/Background/Image.php @@ -87,7 +87,7 @@ public function getExtension() /** * Get indexed filename (using image index) * - * @param $numSlide + * @param integer $numSlide * @return string */ public function getIndexedFilename($numSlide) From 38d7c129b9147505b7a5692fd5d205bbd79ad020 Mon Sep 17 00:00:00 2001 From: Andrey Bolonin Date: Sat, 27 Oct 2018 11:13:04 +0300 Subject: [PATCH 25/26] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a74cf0feb..d266b1659 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ php: - 7.0 - 7.1 - 7.2 + - 7.3 - hhvm matrix: From 2e83d0f2883e5de9bf4d9e85063496676a036e26 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Sun, 13 Jan 2019 13:58:26 +0100 Subject: [PATCH 26/26] FIXED : Validation of the composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ce4852a68..a2a56b0cb 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["PHP","PowerPoint","LibreOffice","pptx","ppt","odp","presentations"], "homepage": "http://phpoffice.github.io", "type": "library", - "license": "LGPL", + "license": "LGPL-3.0-only", "authors": [ { "name": "Mark Baker"