| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public static function create($writerType) |
||
| 27 | { |
||
| 28 | $writer = null; |
||
| 29 | |||
| 30 | switch ($writerType) { |
||
| 31 | case Type::CSV: |
||
| 32 | $writer = new CSV\Writer(); |
||
| 33 | break; |
||
| 34 | case Type::XLSX: |
||
| 35 | $writer = new XLSX\Writer(); |
||
| 36 | break; |
||
| 37 | case Type::ODS: |
||
| 38 | $writer = new ODS\Writer(); |
||
| 39 | break; |
||
| 40 | default: |
||
| 41 | throw new UnsupportedTypeException('No writers supporting the given type: ' . $writerType); |
||
| 42 | } |
||
| 43 | |||
| 44 | $writer->setGlobalFunctionsHelper(new GlobalFunctionsHelper()); |
||
| 45 | |||
| 46 | return $writer; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |