Completed
Push — 8.x-1.x ( 0421f5...0df7dc )
by
unknown
25:14
created

ConfigurationAnnotation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

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 21
    public function __construct(array $values)
13
    {
14 21
        foreach ($values as $k => $v) {
15 20
            if (!method_exists($this, $name = 'set'.$k)) {
16 1
                throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, get_class($this)));
17
            }
18
19 19
            $this->$name($v);
20
        }
21 20
    }
22
}
23