vendor/bundles/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationAnnotation.php
author cavaliet
Fri, 24 Jan 2014 17:50:24 +0100
changeset 106 c1477ecf55e3
parent 0 7f95f8617b0b
permissions -rwxr-xr-x
too much copy paste

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