Completed
Push — 8.x-1.x ( 082f3b...0421f5 )
by
unknown
28:58 queued 09:33
created

ConfigurationAnnotation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 13
ccs 5
cts 6
cp 0.8333
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
1
<?php
2
3
namespace Drupal\controller_annotations\Configuration;
4
5
/**
6
 * Base configuration annotation.
7
 *
8
 * @author Johannes M. Schmitt <[email protected]>
9
 */
10
abstract class ConfigurationAnnotation implements ConfigurationInterface
11
{
12 15
    public function __construct(array $values)
13
    {
14 15
        foreach ($values as $k => $v) {
15 14
            if (!method_exists($this, $name = 'set'.$k)) {
16
                throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, get_class($this)));
17
            }
18
19 14
            $this->$name($v);
20
        }
21 15
    }
22
}
23