コード例 #1
0
 public function validateConfiguration(Extension $extension, $configuration)
 {
     if (!$configuration) {
         throw new \LogicException(sprintf('The extension with alias "%s" does not have its getConfiguration() method setup', $extension->getAlias()));
     }
     if (!$configuration instanceof ConfigurationInterface) {
         throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration)));
     }
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getAlias()
 {
     try {
         return parent::getAlias();
     } catch (BadMethodCallException $e) {
         $className = get_class($this);
         if (substr($className, -16) != '\\BundleExtension') {
             throw $e;
         }
         $aliasBaseName = str_replace(array('FancyGuy', '\\Bundle\\', '\\BundleExtension'), array('Fancyguy', '', ''), $className);
         return Container::underscore($aliasBaseName);
     }
 }