Completed
Push — feature/other-validation ( 1442c4...18a759 )
by Narcotic
64:54
created

SchemaEnum   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 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValues() 0 4 1
A setValues() 0 4 1
1
<?php
2
/**
3
 * Graviton SchemaEnum 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 SchemaEnum
14
{
15
    /**
16
     * @var array
17
     */
18
    protected $values;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param array $values enum values
24
     */
25
    public function __construct(array $values)
26
    {
27
        $this->setValues($values);
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 getValues()
36
    {
37
        return $this->values;
38
    }
39
40
    /**
41
     * sets properties
42
     *
43
     * @param array $values enum values
44
     *
45
     * @return void
46
     */
47
    public function setValues(array $values)
48
    {
49
        $this->values = $values;
50
    }
51
}
52