Completed
Pull Request — develop (#207)
by Franck
06:53
created

PptMedia   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

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;
6
7
class PptMedia extends AbstractDecoratorWriter
8
{
9
    /**
10
     * @return \PhpOffice\Common\Adapter\Zip\ZipInterface
11
     */
12 94
    public function render()
13
    {
14 94
        for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
15 32
            $shape = $this->getDrawingHashTable()->getByIndex($i);
16 32
            if (!$shape instanceof Drawing\AbstractDrawingAdapter) {
17 24
                continue;
18
            }
19 8
            $this->getZip()->addFromString('ppt/media/' . $shape->getIndexedFilename(), $shape->getContents());
20
        }
21
22 94
        return $this->getZip();
23
    }
24
}
25