Test Failed
Push — master ( 3b4c09...efb6fb )
by Richard
02:50
created

Qualifier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A which() 0 3 1
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 *
5
 * Copyright (c) 2016, 2015 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received
8
 * a copy of the license along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Definition\AST;
12
13
/**
14
 * A qualifier is either must, cannot or only X can.
15
 */
16
class Qualifier extends Node {
17
    const MUST = "MUST";
18
    const CANNOT = "CANNOT";
19
    const ONLY_X_CAN = "ONLY_X_CAN";
20
21
    /**
22
     * @var string
23
     */
24
    protected $which;
25
26
    public function __construct($which) {
27
        assert('in_array($which, ["MUST", "CANNOT", "ONLY_X_CAN"])');
28
        $this->which = $which;
29
    }
30
31
    /**
32
     * @return  string
33
     */
34
    public function which() {
35
        return $this->which;
36
    }
37
}
38