vendor/bundles/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php
author ymh <ymh.work@gmail.com>
Thu, 17 Nov 2011 11:30:00 +0100
changeset 32 f166042d4421
parent 0 7f95f8617b0b
permissions -rwxr-xr-x
add event on tag changed

<?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);
        }
    }
}