082a0130c2
Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
23 lines
575 B
PHP
23 lines
575 B
PHP
<?php
|
|
|
|
namespace Sensio\Bundle\FrameworkExtraBundle\Configuration;
|
|
|
|
/**
|
|
* Base configuration annotation.
|
|
*
|
|
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
|
*/
|
|
abstract class ConfigurationAnnotation implements ConfigurationInterface
|
|
{
|
|
public function __construct(array $values)
|
|
{
|
|
foreach ($values as $k => $v) {
|
|
if (!method_exists($this, $name = 'set'.$k)) {
|
|
throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, get_class($this)));
|
|
}
|
|
|
|
$this->$name($v);
|
|
}
|
|
}
|
|
}
|