Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
NavigationContextAwareTrait
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 setNavigationContext
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getDirection
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getScope
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRef
100.00% covered (success)
100.00%
1 / 1
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) 2021 (original work) Open Assessment Technologies SA;
19 *
20 * @author Ricardo Quintanilha <ricardo.quintanilha@taotesting.com>
21 */
22
23declare(strict_types=1);
24
25namespace oat\taoQtiTest\model\Service;
26
27trait NavigationContextAwareTrait
28{
29    /** @var string */
30    private $direction = '';
31
32    /** @var string */
33    private $scope = '';
34
35    /** @var string|null*/
36    private $ref = null;
37
38    public function setNavigationContext(?string $direction, ?string $scope, ?string $ref): void
39    {
40        $this->direction = $direction ?? '';
41        $this->scope = $scope ?? '';
42        $this->ref = $ref;
43    }
44
45    public function getDirection(): string
46    {
47        return $this->direction;
48    }
49
50    public function getScope(): string
51    {
52        return $this->scope;
53    }
54
55    public function getRef(): ?string
56    {
57        return $this->ref;
58    }
59}