Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * Copyright (c) 2016 (original work) Open Assessment Technologies SA;
19 *
20 */
21
22namespace oat\taoQtiItem\model\portableElement\parser;
23
24use oat\taoQtiItem\model\portableElement\exception\PortableElementParserException;
25
26interface PortableElementParser
27{
28    /**
29     * Validate the $source as path
30     *
31     * @param string $source Zip package location to validate
32     * @return bool Always true or PortableElementParserException
33     * @throws PortableElementParserException
34     */
35    public function validate($source);
36
37    /**
38     * Handle the $source to fetch information
39     * Return a path of directory representing portable element
40     *
41     * @param string $source
42     * @return string
43     */
44    public function extract($source);
45
46    /**
47     * Check if $source contains a valid portable element
48     *
49     * @param string $source
50     * @return bool
51     */
52    public function hasValidPortableElement($source);
53
54    /**
55     * Get the manifest of portable element package
56     *
57     * @param string $source
58     * @return mixed
59     */
60    public function getManifestContent($source);
61}