Skip to content

Commit 93f8cef

Browse files
committed
PowerPoint2007 Writer : Move to Design Pattern Decorator (PHPCS)
1 parent c359880 commit 93f8cef

27 files changed

+34
-36
lines changed

src/PhpPresentation/Writer/PowerPoint2007.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ public function save($pFilename)
122122
}
123123
}
124124

125-
$oDir = new DirectoryIterator(dirname(__FILE__).'\PowerPoint2007');
125+
$oDir = new DirectoryIterator(dirname(__FILE__).DIRECTORY_SEPARATOR.'PowerPoint2007');
126126
foreach ($oDir as $oFile) {
127127
if (!$oFile->isFile()) {
128128
continue;
129129
}
130130
$class = __NAMESPACE__.'\\PowerPoint2007\\'.$oFile->getBasename('.php');
131131
$o = new \ReflectionClass($class);
132132

133-
if ($o->isAbstract() || !$o->isSubclassOf('PhpOffice\PhpPresentation\Writer\PowerPoint2007\AbstractDecoratorWriter')){
133+
if ($o->isAbstract() || !$o->isSubclassOf('PhpOffice\PhpPresentation\Writer\PowerPoint2007\AbstractDecoratorWriter')) {
134134
continue;
135135
}
136136
$oService = $o->newInstance();

src/PhpPresentation/Writer/PowerPoint2007/AbstractDecoratorWriter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use PhpOffice\PhpPresentation\Style\Fill;
1111
use \ZipArchive;
1212

13-
abstract class AbstractDecoratorWriter {
13+
abstract class AbstractDecoratorWriter
14+
{
1415
/**
1516
* @return \ZipArchive
1617
*/
@@ -334,4 +335,4 @@ protected function absoluteZipPath($path)
334335

335336
return implode('/', $absolutes);
336337
}
337-
}
338+
}

src/PhpPresentation/Writer/PowerPoint2007/DocPropsApp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ public function render()
9999
// Return
100100
return $this->oZip;
101101
}
102-
}
102+
}

src/PhpPresentation/Writer/PowerPoint2007/DocPropsCore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ public function render()
7070
// Return
7171
return $this->oZip;
7272
}
73-
}
73+
}

src/PhpPresentation/Writer/PowerPoint2007/DocPropsCustom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ public function render()
4444
// Return
4545
return $this->oZip;
4646
}
47-
}
47+
}

src/PhpPresentation/Writer/PowerPoint2007/DocPropsThumbnail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public function render()
2828
// Return
2929
return $this->getZip();
3030
}
31-
}
31+
}

src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2250,4 +2250,4 @@ public function writeChartRelationships(Chart $pChart)
22502250
// Return
22512251
return $objWriter->getData();
22522252
}
2253-
}
2253+
}

src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ public function render()
2828
} else {
2929
$imageContents = file_get_contents($imagePath);
3030
}
31-
$this->oZip->addFromString('ppt/media/' . str_replace(' ', '_', $shape->getIndexedFilename()), $imageContents);
31+
$this->getZip()->addFromString('ppt/media/' . str_replace(' ', '_', $shape->getIndexedFilename()), $imageContents);
3232
} elseif ($shape instanceof MemoryDrawing) {
3333
ob_start();
3434
call_user_func($shape->getRenderingFunction(), $shape->getImageResource());
3535
$imageContents = ob_get_contents();
3636
ob_end_clean();
3737

38-
$this->oZip->addFromString('ppt/media/' . str_replace(' ', '_', $shape->getIndexedFilename()), $imageContents);
38+
$this->getZip()->addFromString('ppt/media/' . str_replace(' ', '_', $shape->getIndexedFilename()), $imageContents);
3939
}
4040
}
4141

42-
return $this->oZip;
42+
return $this->getZip();
4343
}
44-
}
44+
}

src/PhpPresentation/Writer/PowerPoint2007/PptPresProps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ public function render()
6565

6666
return $this->getZip();
6767
}
68-
}
68+
}

src/PhpPresentation/Writer/PowerPoint2007/PptPresentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ public function render()
8282
// Return
8383
return $this->oZip;
8484
}
85-
}
85+
}

0 commit comments

Comments
 (0)