TypedAbstract   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
ccs 0
cts 12
cp 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setTypes() 0 5 1
A setType() 0 4 1
A getTypes() 0 5 1
A getType() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of phpDocumentor.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author    Mike van Riel <[email protected]>
11
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
12
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
13
 * @link      http://phpdoc.org
14
 */
15
16
namespace phpDocumentor\Descriptor\Tag\BaseTypes;
17
18
use phpDocumentor\Descriptor\TagDescriptor;
19
use phpDocumentor\Reflection\Type;
20
21
/**
22
 * Base descriptor for tags that have a type associated with them.
23
 */
24
abstract class TypedAbstract extends TagDescriptor
25
{
26
    /** @var Type $types */
27
    protected $types;
28
29
    /**
30
     * Sets a list of types associated with this tag.
31
     */
32
    public function setTypes(Type $types = null)
33
    {
34
        trigger_error('Use setType, because type is an object', E_USER_DEPRECATED);
35
        $this->types = $types;
36
    }
37
38
    /**
39
     * Sets a list of types associated with this tag.
40
     */
41
    public function setType(Type $types = null)
42
    {
43
        $this->types = $types;
44
    }
45
46
47
    /**
48
     * Returns the list of types associated with this tag.
49
     */
50
    public function getTypes(): array
51
    {
52
        trigger_error('Use getType, because type is an object', E_USER_DEPRECATED);
53
        return array_filter([$this->types]);
54
    }
55
56
    public function getType()
57
    {
58
        return $this->types;
59
    }
60
}
61