Conditions | 5 |
Paths | 8 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 2 | Features | 1 |
1 | <?php |
||
49 | public function fetch() |
||
50 | { |
||
51 | $value = $this->getAsString($this->value); |
||
52 | $strvalues = []; |
||
53 | if (is_array($this->values)) { |
||
54 | foreach ($this->values as $v) { |
||
55 | $strvalues[] = $this->getAsString($v); |
||
56 | } |
||
57 | } else { |
||
58 | $strvalues[] = $this->getAsString($this->values); |
||
59 | } |
||
60 | |||
61 | $values = implode(', ', $strvalues); |
||
62 | |||
63 | if (!$this->valuesareillegal) { |
||
64 | $output = sprintf('%s MUST BE one of [%s]', $value, $values); |
||
65 | } else { |
||
66 | $output = sprintf('%s CANNOT BE one of [%s]', $value, $values); |
||
67 | } |
||
68 | |||
69 | if ($this->note) { |
||
70 | $output .= ' ('.$this->note.')'; |
||
71 | } |
||
72 | |||
73 | return $output; |
||
74 | } |
||
75 | } |
||
76 |