Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
PresentationParser
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 parsePresentation
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2/**
3 * Jingga
4 *
5 * PHP Version 8.1
6 *
7 * @package   phpOMS\Utils\Parser\Presentation
8 * @copyright Dennis Eichhorn
9 * @license   OMS License 2.0
10 * @version   1.0.0
11 * @link      https://jingga.app
12 */
13declare(strict_types=1);
14
15namespace phpOMS\Utils\Parser\Presentation;
16
17use PhpOffice\PhpPresentation\IOFactory;
18
19/**
20 * Presentation parser class.
21 *
22 * @package phpOMS\Utils\Parser\Presentation
23 * @license OMS License 2.0
24 * @link    https://jingga.app
25 * @since   1.0.0
26 */
27class PresentationParser
28{
29    /**
30     * Presentation to string
31     *
32     * @param string $path Path
33     *
34     * @return string
35     *
36     * @since 1.0.0
37     */
38    public static function parsePresentation(string $path, string $output = 'html') : string
39    {
40        if ($output === 'html') {
41            // $pptReader = IOFactory::createReader('PowerPoint2007');
42            // $pptReader->load(...);
43            $presentation = IOFactory::load($path);
44
45            $oTree = new PresentationWriter($presentation);
46
47            return $oTree->renderHtml();
48        }
49
50        return '';
51    }
52}