Completed
Pull Request — develop (#565)
by
unknown
07:15
created

PptMedia   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 12 3
1
<?php
2
3
namespace PhpOffice\PhpPresentation\Writer\PowerPoint2007;
4
5
use PhpOffice\PhpPresentation\Shape\Drawing\AbstractDrawingAdapter;
6
7
class PptMedia extends AbstractDecoratorWriter
8
{
9
    /**
10
     * @return \PhpOffice\Common\Adapter\Zip\ZipInterface
11
     * @throws \Exception
12
     */
13 112
    public function render()
14
    {
15 112
        for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
16 43
            $shape = $this->getDrawingHashTable()->getByIndex($i);
17 43
            if (!$shape instanceof AbstractDrawingAdapter) {
18 34
                continue;
19
            }
20 9
            $this->getZip()->addFromString('ppt/media/' . $shape->getIndexedFilename(), $shape->getContents());
21
        }
22
23 112
        return $this->getZip();
24
    }
25
}
26