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