Completed
Push — feature/other-validation ( 582c96...3c7e86 )
by Narcotic
109:38 queued 43:32
created

SchemaType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTypes() 0 4 1
A setTypes() 0 4 1
1
<?php
2
/**
3
 * Graviton SchemaType Document
4
 */
5
6
namespace Graviton\SchemaBundle\Document;
7
8
/**
9
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
10
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
11
 * @link     http://swisscom.ch
12
 */
13
class SchemaType
14
{
15
    /**
16
     * @var array
17
     */
18
    protected $types;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param array $types types
24
     */
25
    public function __construct(array $types)
26
    {
27
        $this->setTypes($types);
28
    }
29
30
    /**
31
     * gets properties
32
     *
33
     * @return Schema|boolean properties
0 ignored issues
show
Documentation introduced by
Should the return type not be array? Also, consider making the array more specific, something like array<String>, or String[].

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
34
     */
35
    public function getTypes()
36
    {
37
        return $this->types;
38
    }
39
40
    /**
41
     * sets types
42
     *
43
     * @param array $types types
44
     *
45
     * @return void
46
     */
47
    public function setTypes(array $types)
48
    {
49
        $this->types = $types;
50
    }
51
}
52