| Conditions | 5 |
| Paths | 9 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 62 | public function render() |
|
| 17 | { |
||
| 18 | 62 | $arrMedia = array(); |
|
| 19 | 62 | for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { |
|
| 20 | 32 | $shape = $this->getDrawingHashTable()->getByIndex($i); |
|
| 21 | 32 | if (!($shape instanceof Drawing\AbstractDrawingAdapter)) { |
|
| 22 | 24 | continue; |
|
| 23 | } |
||
| 24 | 9 | $arrMedia[] = $shape->getIndexedFilename(); |
|
| 25 | 9 | $this->getZip()->addFromString('Pictures/' . $shape->getIndexedFilename(), $shape->getContents()); |
|
| 26 | } |
||
| 27 | |||
| 28 | 62 | foreach ($this->getPresentation()->getAllSlides() as $keySlide => $oSlide) { |
|
| 29 | // Add background image slide |
||
| 30 | 62 | $oBkgImage = $oSlide->getBackground(); |
|
| 31 | 62 | if ($oBkgImage instanceof Image) { |
|
| 32 | 62 | $this->getZip()->addFromString('Pictures/'.$oBkgImage->getIndexedFilename($keySlide), file_get_contents($oBkgImage->getPath())); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 62 | return $this->getZip(); |
|
| 37 | } |
||
| 38 | } |
||
| 39 |