Browse Source

Merge remote branch 'mvrhov/variousFixes'

Fabien Potencier 14 years ago
parent
commit
6ace6af537

+ 1 - 1
src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php

@@ -47,7 +47,7 @@ class DumpCommand extends Command
         $am = $this->container->get('assetic.asset_manager');
 
         // notify an event so custom stream wrappers can be registered lazily
-        $event = new WriteEvent($basePath);
+        $writeEvent = new WriteEvent($basePath);
         $this->container->get('event_dispatcher')->dispatch(Events::onAsseticWrite, $writeEvent);
 
         if ($input->getOption('watch')) {

+ 22 - 14
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

@@ -327,21 +327,29 @@ class DoctrineExtension extends AbstractDoctrineExtension
      */
     protected function getEntityManagerCacheDefinition(array $entityManager, $cacheDriver, ContainerBuilder $container)
     {
-        if ('memcache' === $cacheDriver['type']) {
-            $memcacheClass = !empty ($cacheDriver['class']) ? $cacheDriver['class'] : '%doctrine.orm.cache.memcache_class%';
-            $memcacheInstanceClass = !empty ($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%doctrine.orm.cache.memcache_instance_class%';
-            $memcacheHost = !empty ($cacheDriver['host']) ? $cacheDriver['host'] : '%doctrine.orm.cache.memcache_host%';
-            $memcachePort = !empty ($cacheDriver['port']) ? $cacheDriver['port'] : '%doctrine.orm.cache.memcache_port%';
-            $cacheDef = new Definition($memcacheClass);
-            $memcacheInstance = new Definition($memcacheInstanceClass);
-            $memcacheInstance->addMethodCall('connect', array(
-                $memcacheHost, $memcachePort
-            ));
-            $container->setDefinition(sprintf('doctrine.orm.%s_memcache_instance', $entityManager['name']), $memcacheInstance);
-            $cacheDef->addMethodCall('setMemcache', array(new Reference(sprintf('doctrine.orm.%s_memcache_instance', $entityManager['name']))));
-        } else if (in_array($cacheDriver['type'], array('apc', 'array', 'xcache'))) {
-            $cacheDef = new Definition('%'.sprintf('doctrine.orm.cache.%s_class', $cacheDriver['type']).'%');
+        switch ($cacheDriver['type']) {
+            case 'memcache':
+                $memcacheClass = !empty ($cacheDriver['class']) ? $cacheDriver['class'] : '%doctrine.orm.cache.memcache_class%';
+                $memcacheInstanceClass = !empty ($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%doctrine.orm.cache.memcache_instance_class%';
+                $memcacheHost = !empty ($cacheDriver['host']) ? $cacheDriver['host'] : '%doctrine.orm.cache.memcache_host%';
+                $memcachePort = !empty ($cacheDriver['port']) ? $cacheDriver['port'] : '%doctrine.orm.cache.memcache_port%';
+                $cacheDef = new Definition($memcacheClass);
+                $memcacheInstance = new Definition($memcacheInstanceClass);
+                $memcacheInstance->addMethodCall('connect', array(
+                    $memcacheHost, $memcachePort
+                ));
+                $container->setDefinition(sprintf('doctrine.orm.%s_memcache_instance', $entityManager['name']), $memcacheInstance);
+                $cacheDef->addMethodCall('setMemcache', array(new Reference(sprintf('doctrine.orm.%s_memcache_instance', $entityManager['name']))));
+                break;
+            case 'apc':
+            case 'array':
+            case 'xcache':
+                $cacheDef = new Definition('%'.sprintf('doctrine.orm.cache.%s_class', $cacheDriver['type']).'%');
+                break;
+            default:
+                throw new \InvalidArgumentException(sprintf('%s is unrecognized cache driver.', $cacheDriver['type']));
         }
+
         $cacheDef->setPublic(false);
         $cacheDef->addMethodCall('setNamespace', array('sf2orm_'.$entityManager['name']));
         return $cacheDef;

+ 2 - 3
src/Symfony/Bundle/DoctrineMongoDBBundle/Command/InfoDoctrineODMCommand.php

@@ -11,7 +11,6 @@
 
 namespace Symfony\Bundle\DoctrineMongoDBBundle\Command;
 
-use Doctrine\ODM\MongoDB\Mapping\MappingException;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
@@ -59,7 +58,7 @@ EOT
                                           ->getMetadataDriverImpl()
                                           ->getAllClassNames();
 
-        if (!$entityClassNames) {
+        if (!$documentClassNames) {
             throw new \Exception(
                 'You do not have any mapped Doctrine MongoDB ODM documents for any of your bundles. '.
                 'Create a class inside the Document namespace of any of your bundles and provide '.
@@ -75,7 +74,7 @@ EOT
             try {
                 $cm = $documentManager->getClassMetadata($documentClassName);
                 $output->write("<info>[OK]</info>   " . $documentClassName, true);
-            } catch(MappingException $e) {
+            } catch(\Exception $e) {
                 $output->write("<error>[FAIL]</error> " . $documentClassName, true);
                 $output->write("<comment>" . $e->getMessage()."</comment>", true);
                 $output->write("", true);

+ 1 - 1
src/Symfony/Bundle/DoctrineMongoDBBundle/Command/LoadDataFixturesDoctrineODMCommand.php

@@ -68,7 +68,7 @@ EOT
             throw new InvalidArgumentException(
                 sprintf(
                     'Could not find a document manager configured with the name "%s". Check your '.
-                    'application configuration to configure your Doctrine document managers.', $emName
+                    'application configuration to configure your Doctrine document managers.', $dmName
                 )
             );
         }

+ 0 - 2
src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php

@@ -13,8 +13,6 @@ namespace Symfony\Bundle\TwigBundle\Extension;
 
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Bundle\TwigBundle\TokenParser\IncludeTokenParser;
-use Symfony\Bundle\TwigBundle\TokenParser\UrlTokenParser;
-use Symfony\Bundle\TwigBundle\TokenParser\PathTokenParser;
 use Symfony\Bundle\TwigBundle\TokenParser\RenderTokenParser;
 use Symfony\Component\Yaml\Dumper as YamlDumper;
 

+ 0 - 2
src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php

@@ -46,8 +46,6 @@ class WebProfilerExtension extends Extension
      */
     protected function doConfigLoad(array $config, ContainerBuilder $container)
     {
-        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
-
         if (isset($config['toolbar'])) {
             if ($config['toolbar']) {
                 if (!$container->hasDefinition('debug.toolbar')) {

+ 1 - 0
src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php

@@ -10,6 +10,7 @@
  */
 
 namespace Symfony\Component\Config\Definition\Builder;
+use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
 
 /**
  * This class builds an if expression.

+ 4 - 5
src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

@@ -14,7 +14,6 @@ namespace Symfony\Component\Config\Definition;
 use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
 use Symfony\Component\Config\Definition\Exception\DuplicateKeyException;
 use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
-use Symfony\Component\DependencyInjection\Extension\Extension;
 use Symfony\Component\Config\Definition\Builder\NodeDefinition;
 
 /**
@@ -118,7 +117,7 @@ class PrototypedArrayNode extends ArrayNode
     /**
      * Sets the node prototype.
      *
-     * @param PrototypeNodeInterface $node 
+     * @param PrototypeNodeInterface $node
      */
     public function setPrototype(PrototypeNodeInterface $node)
     {
@@ -139,7 +138,7 @@ class PrototypedArrayNode extends ArrayNode
     /**
      * Finalizes the value of this node.
      *
-     * @param mixed $value 
+     * @param mixed $value
      * @return mixed The finalised value
      * @throws UnsetKeyException
      * @throws InvalidConfigurationException if the node doesn't have enough children
@@ -182,7 +181,7 @@ class PrototypedArrayNode extends ArrayNode
 
         $value = $this->remapXml($value);
 
-        $normalized = array();         
+        $normalized = array();
         foreach ($value as $k => $v) {
             if (null !== $this->keyAttribute && is_array($v)) {
                 if (!isset($v[$this->keyAttribute]) && is_int($k)) {
@@ -257,7 +256,7 @@ class PrototypedArrayNode extends ArrayNode
             }
 
             $this->prototype->setName($k);
-            $leftSide[$k] = $this->prototype->merge($leftSide[$k], $v);            
+            $leftSide[$k] = $this->prototype->merge($leftSide[$k], $v);
         }
 
         return $leftSide;

+ 0 - 1
src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php

@@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
 class CheckCircularReferencesPass implements CompilerPassInterface
 {
     private $currentId;
-    private $currentNode;
     private $currentPath;
 
     /**

+ 3 - 3
src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

@@ -813,7 +813,7 @@ EOF;
     /**
      * Exports parameters.
      *
-     * @param string $parameters
+     * @param array $parameters
      * @param integer $indent
      * @return string
      */
@@ -910,7 +910,7 @@ EOF;
      * Returns the inline definition
      *
      * @param Definition $definition
-     * @return string
+     * @return array
      */
     private function getInlinedDefinitions(Definition $definition)
     {
@@ -980,7 +980,7 @@ EOF;
     /**
      * Dumps values.
      *
-     * @param string $value
+     * @param array $value
      * @param boolean $interpolate
      * @return string
      */

+ 1 - 1
src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php

@@ -245,7 +245,7 @@ class XmlDumper extends Dumper
     /**
      * Converts parameters.
      *
-     * @param string $parameters
+     * @param array $parameters
      * @param string $type
      * @param DOMElement $parent
      * @return void

+ 1 - 1
src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php

@@ -245,7 +245,7 @@ class YamlDumper extends Dumper
     /**
      * Prepares parameters
      *
-     * @param string $parameters
+     * @param array $parameters
      * @return array
      */
     private function prepareParameters($parameters)

+ 0 - 2
src/Symfony/Component/Finder/Comparator/DateComparator.php

@@ -18,8 +18,6 @@ namespace Symfony\Component\Finder\Comparator;
  */
 class DateComparator extends Comparator
 {
-    private $target;
-    private $comparison;
 
     /**
      * Constructor.

+ 2 - 2
src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php

@@ -23,9 +23,9 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
     public function __construct($path, $flags)
     {
         if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
-            throw new RuntimeException('This iterator only support returning current as fileinfo.');
+            throw new \RuntimeException('This iterator only support returning current as fileinfo.');
         }
-        
+
         parent::__construct($path, $flags);
     }
 

+ 2 - 2
src/Symfony/Component/Security/Core/User/User.php

@@ -22,9 +22,9 @@ final class User implements AdvancedUserInterface
 {
     private $username;
     private $password;
-    private $userNonExpired;
+    private $accountNonExpired;
     private $credentialsNonExpired;
-    private $userNonLocked;
+    private $accountNonLocked;
     private $roles;
 
     public function __construct($username, $password, array $roles = array(), $enabled = true, $userNonExpired = true, $credentialsNonExpired = true, $userNonLocked = true)

+ 0 - 2
src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php

@@ -3,9 +3,7 @@
 namespace Symfony\Component\Security\Http\Authorization;
 
 use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Event\ExceptionEvent;
 use Symfony\Component\Security\Core\Exception\AccessDeniedException;
-use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
 
 /**
  * This is used by the ExceptionListener to translate an AccessDeniedException