Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
PackedAsset
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
6 / 6
6
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 getType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLink
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getMediaAsset
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getReplacedBy
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setReplacedBy
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
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) 2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
19 *
20 */
21
22declare(strict_types=1);
23
24namespace oat\taoQtiItem\model\pack\QtiAssetPacker;
25
26use oat\tao\model\media\MediaAsset;
27
28class PackedAsset
29{
30    /** @var string */
31    private $type;
32
33    /** @var MediaAsset */
34    private $mediaAsset;
35
36    /** @var string */
37    private $link;
38
39    /** @var string */
40    private $replacedBy;
41
42    public function __construct(string $type, MediaAsset $mediaAsset, string $link, string $replacedBy = null)
43    {
44        $this->type = $type;
45        $this->link = $link;
46        $this->replacedBy = $replacedBy;
47        $this->mediaAsset = $mediaAsset;
48    }
49
50    public function getType(): string
51    {
52        return $this->type;
53    }
54
55    public function getLink(): ?string
56    {
57        return $this->link;
58    }
59
60    public function getMediaAsset(): MediaAsset
61    {
62        return $this->mediaAsset;
63    }
64
65    public function getReplacedBy(): ?string
66    {
67        return $this->replacedBy;
68    }
69
70    public function setReplacedBy(string $replacedBy): self
71    {
72        $this->replacedBy = $replacedBy;
73
74        return $this;
75    }
76}