Skip to content

Commit 99c0c9a

Browse files
committed
Fix TravisCI errors
1 parent 7f482f2 commit 99c0c9a

File tree

6 files changed

+16
-21
lines changed

6 files changed

+16
-21
lines changed

src/PhpPowerpoint/Writer/ODPresentation.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public function __construct(PHPPowerPoint $pPHPPowerPoint = null)
9595
$this->writerParts['mimetype'] = new Mimetype();
9696
$this->writerParts['styles'] = new Styles();
9797
$this->writerParts['charts'] = new ObjectsChart();
98-
9998
$this->writerParts['drawing'] = new Drawing();
10099

101100
// Assign parent WriterInterface
@@ -148,7 +147,7 @@ public function save($pFilename)
148147

149148
// Add mimetype to ZIP file
150149
//@todo Not in ZIPARCHIVE::CM_STORE mode
151-
$objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->writePart($this->presentation));
150+
$objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->writePart());
152151

153152
// Add content.xml to ZIP file
154153
$objZip->addFromString('content.xml', $this->getWriterPart('content')->writePart($this->presentation));
@@ -160,13 +159,13 @@ public function save($pFilename)
160159
$objZip->addFromString('styles.xml', $this->getWriterPart('styles')->writePart($this->presentation));
161160

162161
// Add META-INF/manifest.xml
163-
$objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('manifest')->writePart($this->presentation));
162+
$objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('manifest')->writePart());
164163

165164
// Add charts
166165
foreach ($this->chartArray as $keyChart => $shapeChart) {
167-
$arrayFile = $this->getWriterPart('charts')->writePart($this->presentation, $shapeChart);
166+
$arrayFile = $this->getWriterPart('charts')->writePart(shapeChart);
168167
foreach ($arrayFile as $file => $content) {
169-
if(!empty($content)){
168+
if (!empty($content)) {
170169
$objZip->addFromString('Object '.$keyChart.'/' . $file, $content);
171170
}
172171
}

src/PhpPowerpoint/Writer/ODPresentation/Drawing.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
*/
2727
class Drawing extends AbstractPart
2828
{
29-
public function writePart(PhpPowerpoint $pPHPPowerPoint)
30-
{
31-
return null;
32-
}
33-
3429
/**
3530
* Get an array of all drawings
3631
*

src/PhpPowerpoint/Writer/ODPresentation/Manifest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Manifest extends AbstractPart
3434
* @return string XML Output
3535
* @throws \Exception
3636
*/
37-
public function writePart(PhpPowerpoint $pPHPPowerPoint)
37+
public function writePart()
3838
{
3939
$parentWriter = $this->getParentWriter();
4040
if (!$parentWriter instanceof ODPresentation) {

src/PhpPowerpoint/Writer/ODPresentation/Mimetype.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Mimetype extends AbstractPart
3030
* @return string Text Output
3131
* @throws \Exception
3232
*/
33-
public function writePart(PhpPowerpoint $pPHPPowerPoint)
33+
public function writePart()
3434
{
3535
return 'application/vnd.oasis.opendocument.presentation';
3636
}

src/PhpPowerpoint/Writer/ODPresentation/ObjectsChart.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ObjectsChart extends AbstractPart
6666
*/
6767
private $rangeCol;
6868

69-
public function writePart(PhpPowerpoint $pPHPPowerPoint, Chart $chart)
69+
public function writePart(Chart $chart)
7070
{
7171
$this->xmlContent = $this->getXMLWriter();
7272
$this->xmlMeta = $this->getXMLWriter();
@@ -88,7 +88,7 @@ private function writeContentPart(Chart $chart)
8888
{
8989
$chartType = $chart->getPlotArea()->getType();
9090
if (!($chartType instanceof Bar3D || $chartType instanceof Line || $chartType instanceof Pie3D|| $chartType instanceof Scatter)) {
91-
throw new \Exception('The chart type provided could not be rendered.');
91+
throw new \Exception('The chart type provided could not be rendered.');
9292
}
9393

9494
// Data
@@ -218,7 +218,7 @@ private function writeContentPart(Chart $chart)
218218
$this->writePlotArea($chart);
219219

220220
//**** Table ****
221-
$this->writeTable($chart);
221+
$this->writeTable();
222222

223223
// > chart:chart
224224
$this->xmlContent->endElement();
@@ -484,7 +484,8 @@ private function writeSeries(Chart $chart, Chart\Series $series)
484484
}
485485
$this->xmlContent->writeAttribute('chart:style-name', 'styleSeries'.$this->numSeries);
486486
if ($chartType instanceof Bar3D || $chartType instanceof Line || $chartType instanceof Scatter) {
487-
if (empty($series->getDataPointFills())) {
487+
$dataPointFills = $series->getDataPointFills();
488+
if (empty($dataPointFills)) {
488489
$incRepeat = $numRange;
489490
} else {
490491
$inc = 0;
@@ -507,7 +508,7 @@ private function writeSeries(Chart $chart, Chart\Series $series)
507508
}
508509
$inc++;
509510
$incRepeat++;
510-
} while($inc < $numRange);
511+
} while ($inc < $numRange);
511512
$incRepeat--;
512513
}
513514
// chart:data-point
@@ -516,14 +517,14 @@ private function writeSeries(Chart $chart, Chart\Series $series)
516517
// > chart:data-point
517518
$this->xmlContent->endElement();
518519
} elseif ($chartType instanceof Pie3D) {
520+
$count = $series->getDataPointFills();
519521
$inc = 0;
520-
foreach ($series->getDataPointFills() as $dataPointFill) {
522+
for ($inc = 0 ; $inc < $count ; $inc++) {
521523
// chart:data-point
522524
$this->xmlContent->startElement('chart:data-point');
523525
$this->xmlContent->writeAttribute('chart:style-name', 'styleSeries'.$this->numSeries.'_'.$inc);
524526
// > chart:data-point
525527
$this->xmlContent->endElement();
526-
$inc++;
527528
}
528529
}
529530

@@ -601,7 +602,7 @@ private function writeSeriesStyle(Chart $chart, Chart\Series $series)
601602
/**
602603
* @param Chart $chart
603604
*/
604-
private function writeTable(Chart $chart)
605+
private function writeTable()
605606
{
606607
// table:table
607608
$this->xmlContent->startElement('table:table');

src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ private function writeShapeText(XMLWriter $objWriter, RichText $shape, $shapeId)
419419

420420
// a:bodyPr
421421
$objWriter->startElement('a:bodyPr');
422-
$objWriter->writeAttribute('anchor', $shape->getActiveParagraph()->getAlignment()->getVertical());
422+
$objWriter->writeAttribute('anchor', $shape->getActiveParagraph()->getAlignment()->getVertical());
423423
$objWriter->writeAttribute('wrap', $shape->getWrap());
424424
$objWriter->writeAttribute('rtlCol', '0');
425425

0 commit comments

Comments
 (0)