Completed
Pull Request — master (#41)
by Sullivan
05:13
created

Activity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A validatedBy() 0 4 1
1
<?php
2
3
namespace Nexy\PayboxDirect\Constraints;
4
5
use Symfony\Component\Validator\Constraints\Choice;
6
use Symfony\Component\Validator\Constraints\ChoiceValidator;
7
8
/**
9
 * @Annotation
10
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
11
 *
12
 * @author Sullivan Senechal <[email protected]>
13
 */
14
final class Activity extends Choice
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function __construct($options)
20
    {
21
        parent::__construct($options);
22
23
        $this->choices = \Nexy\PayboxDirect\Enum\Activity::getConstants();
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function validatedBy()
30
    {
31
        return ChoiceValidator::class;
32
    }
33
}
34