ソースを参照

Updating vendor libs

Julio Montoya 12 年 前
コミット
348ff96bca
44 ファイル変更355 行追加64 行削除
  1. 2 2
      vendor/doctrine/common/.travis.yml
  2. 22 15
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php
  3. 3 5
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php
  4. 26 11
      vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown
  5. 2 1
      vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
  6. 29 2
      vendor/silex/silex/src/Silex/Provider/SwiftmailerServiceProvider.php
  7. 2 0
      vendor/silex/silex/tests/Silex/Tests/Provider/SpoolStub.php
  8. 2 0
      vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php
  9. 4 5
      vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php
  10. 2 0
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php
  11. 6 0
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
  12. 2 0
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php
  13. 5 1
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
  14. 4 0
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php
  15. 4 1
      vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php
  16. 4 4
      vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php
  17. 3 0
      vendor/symfony/config/Symfony/Component/Config/FileLocator.php
  18. 0 1
      vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php
  19. 4 0
      vendor/symfony/config/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php
  20. 3 1
      vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php
  21. 4 0
      vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php
  22. 1 1
      vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php
  23. 1 1
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php
  24. 3 3
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php
  25. 3 3
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php
  26. 2 2
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php
  27. 1 1
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php
  28. 5 1
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php
  29. 1 0
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
  30. 2 0
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php
  31. 2 0
      vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
  32. 2 0
      vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md
  33. 2 0
      vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php
  34. 2 0
      vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php
  35. 1 1
      vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php
  36. 2 0
      vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml
  37. 97 0
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Extension/CodeExtension.php
  38. 73 0
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Extension/RoutingExtension.php
  39. 2 0
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php
  40. 2 0
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php
  41. 2 0
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Translation/TwigExtractor.php
  42. 15 1
      vendor/symfony/twig-bridge/Symfony/Bridge/Twig/phpunit.xml.dist
  43. 1 1
      vendor/twig/twig/lib/Twig/Error.php
  44. 0 0
      vendor/twig/twig/lib/Twig/Extension.php

+ 2 - 2
vendor/doctrine/common/.travis.yml

@@ -120,7 +120,7 @@ class ArrayCollection implements Collection, Selectable
      */
     public function remove($key)
     {
-        if (array_key_exists($key, $this->_elements)) {
+        if (isset($this->_elements[$key]) || array_key_exists($key, $this->_elements)) {
             $removed = $this->_elements[$key];
             unset($this->_elements[$key]);
 
@@ -214,7 +214,7 @@ class ArrayCollection implements Collection, Selectable
      */
     public function containsKey($key)
     {
-        return array_key_exists($key, $this->_elements);
+        return isset($this->_elements[$key]) || array_key_exists($key, $this->_elements);
     }
 
     /**

+ 22 - 15
vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php

@@ -946,29 +946,36 @@ class QueryBuilder
         $query = 'SELECT ' . implode(', ', $this->sqlParts['select']) . ' FROM ';
 
         $fromClauses = array();
-
+        $joinsPending = true;
+        $joinAliases = array();
+        
         // Loop through all FROM clauses
         foreach ($this->sqlParts['from'] as $from) {
             $fromClause = $from['table'] . ' ' . $from['alias'];
 
-            if (isset($this->sqlParts['join'][$from['alias']])) {
-                foreach ($this->sqlParts['join'][$from['alias']] as $join) {
-                    $fromClause .= ' ' . strtoupper($join['joinType'])
-                                 . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']
-                                 . ' ON ' . ((string) $join['joinCondition']);
-                }
-            }
-
+            if ($joinsPending && isset($this->sqlParts['join'][$from['alias']])) {
+                foreach ($this->sqlParts['join'] as $joins) {
+                    foreach ($joins as $join) {
+                        $fromClause .= ' ' . strtoupper($join['joinType'])
+                                     . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']
+                                     . ' ON ' . ((string) $join['joinCondition']);
+                        $joinAliases[$join['joinAlias']] = true;
+                    }
+                }
+                $joinsPending = false;
+            }
+            
             $fromClauses[$from['alias']] = $fromClause;
         }
 
         // loop through all JOIN clauses for validation purpose
-        foreach ($this->sqlParts['join'] as $fromAlias => $joins) {
-            if ( ! isset($fromClauses[$fromAlias]) ) {
-                throw QueryException::unknownFromAlias($fromAlias, array_keys($fromClauses));
-            }
-        }
-
+        $knownAliases = array_merge($fromClauses,$joinAliases);
+        foreach ($this->sqlParts['join'] as $fromAlias => $joins) {
+            if ( ! isset($knownAliases[$fromAlias]) ) {
+                throw QueryException::unknownAlias($fromAlias, array_keys($knownAliases));
+            }
+        }
+        
         $query .= implode(', ', $fromClauses)
                 . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '')
                 . ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '')

+ 3 - 5
vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php

@@ -29,12 +29,10 @@ use Doctrine\DBAL\DBALException;
  */
 class QueryException extends DBALException
 {
-    static public function unknownFromAlias($alias, $registeredAliases)
+    static public function unknownAlias($alias, $registeredAliases)
     {
         return new self("The given alias '" . $alias . "' is not part of " .
-            "any FROM clause table. The currently registered FROM-clause " .
-            "aliases are: " . implode(", ", $registeredAliases) . ". Join clauses " .
-            "are bound to from clauses to provide support for mixing of multiple " .
-            "from and join clauses.");
+            "any FROM or JOIN clause table. The currently registered " .
+            "aliases are: " . implode(", ", $registeredAliases) . ".");
     }
 }

+ 26 - 11
vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown

@@ -556,17 +556,32 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
     {
         $qb = new QueryBuilder($this->conn);
 
-        $qb->select("l.id", "mdsh.xcode", "mdso.xcode")
-                ->from("location_tree", "l")
-                ->join("l", "location_tree_pos", "p", "l.id = p.tree_id")
-                ->rightJoin("l", "hotel", "h", "h.location_id = l.id")
-                ->leftJoin("l", "offer_location", "ol", "l.id=ol.location_id")
-                ->leftJoin("ol", "mds_offer", "mdso", "ol.offer_id = mdso.offer_id")
-                ->leftJoin("h", "mds_hotel", "mdsh", "h.id = mdsh.hotel_id")
-                ->where("p.parent_id IN (:ids)")
-                ->andWhere("(mdso.xcode IS NOT NULL OR mdsh.xcode IS NOT NULL)");
-
-        $this->setExpectedException('Doctrine\DBAL\Query\QueryException', "The given alias 'ol' is not part of any FROM clause table. The currently registered FROM-clause aliases are: l");
+        $qb->select('COUNT(DISTINCT news.id)')
+            ->from('cb_newspages', 'news')
+            ->innerJoin('news', 'nodeversion', 'nv', 'nv.refId = news.id AND nv.refEntityname=\'News\'')
+            ->innerJoin('invalid', 'nodetranslation', 'nt', 'nv.nodetranslation = nt.id')
+            ->innerJoin('nt', 'node', 'n', 'nt.node = n.id')
+            ->where('nt.lang = :lang AND n.deleted != 1');
+
+        $this->setExpectedException('Doctrine\DBAL\Query\QueryException', "The given alias 'invalid' is not part of any FROM or JOIN clause table. The currently registered aliases are: news, nv, nt, n.");
         $this->assertEquals('', $qb->getSQL());
     }
+
+    /**
+     * @group DBAL-172
+     */
+    public function testSelectFromMasterWithWhereOnJoinedTables()
+    {
+        $qb = new QueryBuilder($this->conn);
+
+        $qb->select('COUNT(DISTINCT news.id)')
+            ->from('newspages', 'news')
+            ->innerJoin('news', 'nodeversion', 'nv', "nv.refId = news.id AND nv.refEntityname='Entity\\News'")
+            ->innerJoin('nv', 'nodetranslation', 'nt', 'nv.nodetranslation = nt.id')
+            ->innerJoin('nt', 'node', 'n', 'nt.node = n.id')
+            ->where('nt.lang = ?')
+            ->andWhere('n.deleted = 0');
+
+        $this->assertEquals("SELECT COUNT(DISTINCT news.id) FROM newspages news INNER JOIN nodeversion nv ON nv.refId = news.id AND nv.refEntityname='Entity\\News' INNER JOIN nodetranslation nt ON nv.nodetranslation = nt.id INNER JOIN node n ON nt.node = n.id WHERE (nt.lang = ?) AND (n.deleted = 0)", $qb->getSQL());
+    }
 }

+ 2 - 1
vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php

@@ -103,7 +103,8 @@ class SessionServiceProvider implements ServiceProviderInterface
             return;
         }
 
-        if ($session = $event->getRequest()->getSession()) {
+        $session = $event->getRequest()->getSession();
+        if ($session && $session->isStarted()) {
             $session->save();
 
             $params = session_get_cookie_params();

+ 29 - 2
vendor/silex/silex/src/Silex/Provider/SwiftmailerServiceProvider.php

@@ -14,8 +14,7 @@ namespace Silex\Tests\Provider;
 use Silex\Application;
 use Silex\WebTestCase;
 use Silex\Provider\SessionServiceProvider;
-
-use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Client;
 
 /**
  * SessionProvider test cases.
@@ -77,4 +76,32 @@ class SessionServiceProviderTest extends WebTestCase
 
         return $app;
     }
+
+    public function testWithRoutesThatDoesNotUseSession()
+    {
+        $app = new Application();
+
+        $app->register(new SessionServiceProvider(), array(
+            'session.test' => true,
+        ));
+
+        $app->get('/', function () {
+            return 'A welcome page.';
+        });
+
+        $app->get('/robots.txt', function () {
+            return 'Informations for robots.';
+        });
+
+        $app['debug'] = true;
+        $app['exception_handler']->disable();
+
+        $client = new Client($app);
+
+        $client->request('get', '/');
+        $this->assertEquals('A welcome page.', $client->getResponse()->getContent());
+
+        $client->request('get', '/robots.txt');
+        $this->assertEquals('Informations for robots.', $client->getResponse()->getContent());
+    }
 }

+ 2 - 0
vendor/silex/silex/tests/Silex/Tests/Provider/SpoolStub.php

@@ -291,6 +291,8 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
      * @param mixed $value The value to normalize
      *
      * @return mixed The normalized value
+     *
+     * @throws InvalidConfigurationException
      */
     protected function normalizeValue($value)
     {

+ 2 - 0
vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php

@@ -286,6 +286,8 @@ abstract class BaseNode implements NodeInterface
      * @param mixed $value The value to finalize
      *
      * @return mixed The finalized value
+     *
+     * @throws InvalidConfigurationException
      */
     final public function finalize($value)
     {

+ 4 - 5
vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php

@@ -11,7 +11,6 @@
 
 namespace Symfony\Component\Config\Definition\Builder;
 
-use Symfony\Component\Config\Definition\NodeInterface;
 use Symfony\Component\Config\Definition\ArrayNode;
 use Symfony\Component\Config\Definition\PrototypedArrayNode;
 use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
@@ -406,9 +405,9 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
     /**
      * Validate the configuration of a concrete node.
      *
-     * @param NodeInterface $node The related node
+     * @param ArrayNode $node The related node
      *
-     * @throws InvalidDefinitionException When an error is detected in the configuration
+     * @throws InvalidDefinitionException
      */
     protected function validateConcreteNode(ArrayNode $node)
     {
@@ -442,9 +441,9 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
     /**
      * Validate the configuration of a prototype node.
      *
-     * @param NodeInterface $node The related node
+     * @param PrototypedArrayNode $node The related node
      *
-     * @throws InvalidDefinitionException When an error is detected in the configuration
+     * @throws InvalidDefinitionException
      */
     protected function validatePrototypeNode(PrototypedArrayNode $node)
     {

+ 2 - 0
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php

@@ -31,6 +31,8 @@ class EnumNodeDefinition extends ScalarNodeDefinition
      * Instantiate a Node
      *
      * @return EnumNode The node
+     *
+     * @throws \RuntimeException
      */
     protected function instantiateNode()
     {

+ 6 - 0
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php

@@ -170,6 +170,8 @@ class ExprBuilder
      * @param string $message
      *
      * @return ExprBuilder
+     *
+     * @throws \InvalidArgumentException
      */
     public function thenInvalid($message)
     {
@@ -182,6 +184,8 @@ class ExprBuilder
      * Sets a closure unsetting this key of the array at validation time.
      *
      * @return ExprBuilder
+     *
+     * @throws UnsetKeyException
      */
     public function thenUnset()
     {
@@ -194,6 +198,8 @@ class ExprBuilder
      * Returns the related node
      *
      * @return NodeDefinition
+     *
+     * @throws \RuntimeException
      */
     public function end()
     {

+ 2 - 0
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php

@@ -181,6 +181,8 @@ class NodeBuilder implements NodeParentInterface
      *         ->end()
      *     ;
      *
+     * @param NodeDefinition $node
+     *
      * @return NodeBuilder This node builder
      */
     public function append(NodeDefinition $node)

+ 5 - 1
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php

@@ -12,6 +12,7 @@
 namespace Symfony\Component\Config\Definition\Builder;
 
 use Symfony\Component\Config\Definition\NodeInterface;
+use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
 
 /**
  * This class provides a fluent interface for defining a node.
@@ -31,6 +32,9 @@ abstract class NodeDefinition implements NodeParentInterface
     protected $nullEquivalent;
     protected $trueEquivalent;
     protected $falseEquivalent;
+    /**
+     * @var NodeParentInterface|NodeInterface
+     */
     protected $parent;
     protected $attributes = array();
 
@@ -336,7 +340,7 @@ abstract class NodeDefinition implements NodeParentInterface
      *
      * @return NodeInterface $node The node instance
      *
-     * @throws Symfony\Component\Config\Definition\Exception\InvalidDefinitionException When the definition is invalid
+     * @throws InvalidDefinitionException When the definition is invalid
      */
     abstract protected function createNode();
 

+ 4 - 0
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php

@@ -11,6 +11,8 @@
 
 namespace Symfony\Component\Config\Definition\Builder;
 
+use Symfony\Component\Config\Definition\NodeInterface;
+
 /**
  * This is the entry class for building a config tree.
  *
@@ -44,6 +46,8 @@ class TreeBuilder implements NodeParentInterface
      * Builds the tree.
      *
      * @return NodeInterface
+     *
+     * @throws \RuntimeException
      */
     public function buildTree()
     {

+ 4 - 1
vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php

@@ -183,7 +183,7 @@ class PrototypedArrayNode extends ArrayNode
      *
      * @param NodeInterface $node The child node to add
      *
-     * @throws \RuntimeException Prototyped array nodes can't have concrete children.
+     * @throws Exception
      */
     public function addChild(NodeInterface $node)
     {
@@ -233,6 +233,9 @@ class PrototypedArrayNode extends ArrayNode
      * @param mixed $value The value to normalize
      *
      * @return mixed The normalized value
+     *
+     * @throws InvalidConfigurationException
+     * @throws DuplicateKeyException
      */
     protected function normalizeValue($value)
     {

+ 4 - 4
vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php

@@ -19,10 +19,10 @@ namespace Symfony\Component\Config\Exception;
 class FileLoaderLoadException extends \Exception
 {
     /**
-     * @param string    $resource       The resource that could not be imported
-     * @param string    $sourceResource The original resource importing the new resource
-     * @param integer   $code           The error code
-     * @param Exception $previous       A previous exception
+     * @param string     $resource       The resource that could not be imported
+     * @param string     $sourceResource The original resource importing the new resource
+     * @param integer    $code           The error code
+     * @param \Exception $previous       A previous exception
      */
     public function __construct($resource, $sourceResource = null, $code = null, $previous = null)
     {

+ 3 - 0
vendor/symfony/config/Symfony/Component/Config/FileLocator.php

@@ -57,6 +57,9 @@ abstract class FileLoader extends Loader
      * @param string  $sourceResource The original resource importing the new resource
      *
      * @return mixed
+     *
+     * @throws FileLoaderLoadException
+     * @throws FileLoaderImportCircularReferenceException
      */
     public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
     {

+ 0 - 1
vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php

@@ -12,7 +12,6 @@
 namespace Symfony\Component\Config\Tests\Definition;
 
 use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
 
 class ArrayNodeTest extends \PHPUnit_Framework_TestCase
 {

+ 4 - 0
vendor/symfony/config/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php

@@ -202,6 +202,8 @@ class Command
      *
      * @return integer The command exit code
      *
+     * @throws \Exception
+     *
      * @see setCode()
      * @see execute()
      *
@@ -251,6 +253,8 @@ class Command
      *
      * @return Command The current instance
      *
+     * @throws \InvalidArgumentException
+     *
      * @see execute()
      *
      * @api

+ 3 - 1
vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php

@@ -31,10 +31,12 @@ class DialogHelper extends Helper
      * @param string|array    $question     The question to ask
      * @param array           $choices      List of choices to pick from
      * @param Boolean         $default      The default answer if the user enters nothing
-     * @param integer|false   $attempts     Max number of times to ask before giving up (false by default, which means infinite)
+     * @param Boolean|integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
      * @param string          $errorMessage Message which will be shown if invalid value from choice list would be picked
      *
      * @return integer|string The selected value (the key of the choices array)
+     *
+     * @throws \InvalidArgumentException
      */
     public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid')
     {

+ 4 - 0
vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php

@@ -218,6 +218,8 @@ class ProgressHelper extends Helper
      *
      * @param integer $step   Number of steps to advance
      * @param Boolean $redraw Whether to redraw or not
+     *
+     * @throws \LogicException
      */
     public function advance($step = 1, $redraw = false)
     {
@@ -238,6 +240,8 @@ class ProgressHelper extends Helper
      * Outputs the current progress string.
      *
      * @param Boolean $finish Forces the end result
+     *
+     * @throws \LogicException
      */
     public function display($finish = false)
     {

+ 1 - 1
vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php

@@ -74,7 +74,7 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
      *
      * @return array
      *
-     * @throws \RuntimeException When the config is invalid
+     * @throws RuntimeException When the config is invalid
      */
     private function processArguments(array $arguments, $inMethodCall = false)
     {

+ 1 - 1
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php

@@ -26,7 +26,7 @@ class ResolveParameterPlaceHoldersPass implements CompilerPassInterface
      *
      * @param ContainerBuilder $container
      *
-     * @throws ParameterNotFoundException When an invalid parameter is referenced
+     * @throws ParameterNotFoundException
      */
     public function process(ContainerBuilder $container)
     {

+ 3 - 3
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php

@@ -184,8 +184,8 @@ class Container implements IntrospectableContainerInterface
      * @param object $service The service instance
      * @param string $scope   The scope of the service
      *
-     * @throws \RuntimeException When trying to set a service in an inactive scope
-     * @throws \InvalidArgumentException When trying to set a service in the prototype scope
+     * @throws RuntimeException When trying to set a service in an inactive scope
+     * @throws InvalidArgumentException When trying to set a service in the prototype scope
      *
      * @api
      */
@@ -401,7 +401,7 @@ class Container implements IntrospectableContainerInterface
      *
      * @param ScopeInterface $scope
      *
-     * @throws \InvalidArgumentException When the scope is invalid
+     * @throws InvalidArgumentException
      *
      * @api
      */

+ 3 - 3
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php

@@ -86,7 +86,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
      *
      * @return ExtensionInterface An extension instance
      *
-     * @throws \LogicException if the extension is not registered
+     * @throws LogicException if the extension is not registered
      *
      * @api
      */
@@ -556,8 +556,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
      * @param string        $alias The alias to create
      * @param string|Alias  $id    The service to alias
      *
-     * @throws \InvalidArgumentException if the id is not a string or an Alias
-     * @throws \InvalidArgumentException if the alias is for itself
+     * @throws InvalidArgumentException if the id is not a string or an Alias
+     * @throws InvalidArgumentException if the alias is for itself
      *
      * @api
      */

+ 2 - 2
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php

@@ -241,7 +241,7 @@ class Definition
      *
      * @return Definition The current instance
      *
-     * @throws \OutOfBoundsException When the replaced argument does not exist
+     * @throws OutOfBoundsException When the replaced argument does not exist
      *
      * @api
      */
@@ -275,7 +275,7 @@ class Definition
      *
      * @return mixed The argument value
      *
-     * @throws \OutOfBoundsException When the argument does not exist
+     * @throws OutOfBoundsException When the argument does not exist
      *
      * @api
      */

+ 1 - 1
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php

@@ -159,7 +159,7 @@ class DefinitionDecorator extends Definition
      *
      * @return mixed The argument value
      *
-     * @throws \OutOfBoundsException When the argument does not exist
+     * @throws OutOfBoundsException When the argument does not exist
      *
      * @api
      */

+ 5 - 1
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php

@@ -187,7 +187,7 @@ class PhpDumper extends Dumper
      *
      * @return string
      *
-     * @throws \RuntimeException When the factory definition is incomplete
+     * @throws RuntimeException When the factory definition is incomplete
      * @throws ServiceCircularReferenceException When a circular reference is detected
      */
     private function addServiceInlinedDefinitions($id, $definition)
@@ -816,6 +816,8 @@ EOF;
      * @param integer $indent
      *
      * @return string
+     *
+     * @throws InvalidArgumentException
      */
     private function exportParameters($parameters, $path = '', $indent = 12)
     {
@@ -987,6 +989,8 @@ EOF;
      * @param Boolean $interpolate
      *
      * @return string
+     *
+     * @throws RuntimeException
      */
     private function dumpValue($value, $interpolate = true)
     {

+ 1 - 0
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php

@@ -12,6 +12,7 @@
 namespace Symfony\Component\DependencyInjection\Extension;
 
 use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
 
 /**
  * ConfigurationExtensionInterface is the interface implemented by container extension classes.

+ 2 - 0
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php

@@ -275,6 +275,8 @@ class XmlFileLoader extends FileLoader
      *
      * @param \DOMDocument $dom
      *
+     * @return Boolean
+     *
      * @throws RuntimeException When extension references a non-existent XSD file
      */
     public function validateSchema(\DOMDocument $dom)

+ 2 - 0
vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

@@ -31,6 +31,8 @@ class Route
      * Constructor.
      *
      * @param array $data An array of key/value parameters.
+     *
+     * @throws \BadMethodCallException
      */
     public function __construct(array $data)
     {

+ 2 - 0
vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md

@@ -32,6 +32,8 @@ class AnnotationFileLoader extends FileLoader
      * @param FileLocatorInterface  $locator A FileLocator instance
      * @param AnnotationClassLoader $loader  An AnnotationClassLoader instance
      * @param string|array          $paths   A path or an array of paths where to look for resources
+     *
+     * @throws \RuntimeException
      */
     public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader, $paths = array())
     {

+ 2 - 0
vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php

@@ -49,6 +49,8 @@ class DumperPrefixCollection extends DumperCollection
      * @param DumperRoute $route The route
      *
      * @return DumperPrefixCollection The node the route was added to
+     *
+     * @throws \LogicException
      */
     public function addPrefixRoute(DumperRoute $route)
     {

+ 2 - 0
vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php

@@ -188,6 +188,8 @@ EOF;
      * @param string|null $parentPrefix         The prefix of the parent collection used to optimize the code
      *
      * @return string PHP code
+     *
+     * @throws \LogicException
      */
     private function compileRoute(Route $route, $name, $supportsRedirections, $parentPrefix = null)
     {

+ 1 - 1
vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php

@@ -5,4 +5,4 @@
     xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
 
     <route id="myroute"></route>
-</routes>
+</routes>

+ 2 - 0
vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/namespaceprefix.xml

@@ -4,6 +4,8 @@ CHANGELOG
 2.2.0
 -----
 
+ * [BC BREAK] restricted the `render` tag to only accept URIs as reference (the signature changed)
+ * added a render function to render a request
  * The `app` global variable is now injected even when using the twig service directly.
 
 2.1.0

+ 97 - 0
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Extension/CodeExtension.php

@@ -0,0 +1,97 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bridge\Twig\Extension;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Provides integration with the HttpKernel component.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class HttpKernelExtension extends \Twig_Extension implements EventSubscriberInterface
+{
+    private $kernel;
+    private $request;
+
+    /**
+     * Constructor.
+     *
+     * @param HttpKernelInterface $kernel A HttpKernelInterface install
+     */
+    public function __construct(HttpKernelInterface $kernel)
+    {
+        $this->kernel = $kernel;
+    }
+
+    public function getFunctions()
+    {
+        return array(
+            'render' => new \Twig_Function_Method($this, 'render', array('needs_environment' => true, 'is_safe' => array('html'))),
+        );
+    }
+
+    /**
+     * Renders a URI.
+     *
+     * @param \Twig_Environment $twig A \Twig_Environment instance
+     * @param string            $uri  The URI to render
+     *
+     * @return string The Response content
+     *
+     * @throws \RuntimeException
+     */
+    public function render(\Twig_Environment $twig, $uri)
+    {
+        if (null !== $this->request) {
+            $cookies = $this->request->cookies->all();
+            $server = $this->request->server->all();
+        } else {
+            $cookies = array();
+            $server = array();
+        }
+
+        $subRequest = Request::create($uri, 'get', array(), $cookies, array(), $server);
+        if (null !== $this->request && $this->request->getSession()) {
+            $subRequest->setSession($this->request->getSession());
+        }
+
+        $response = $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false);
+
+        if (!$response->isSuccessful()) {
+            throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
+        }
+
+        return $response->getContent();
+    }
+
+    public function onKernelRequest(GetResponseEvent $event)
+    {
+        $this->request = $event->getRequest();
+    }
+
+    public static function getSubscribedEvents()
+    {
+        return array(
+            KernelEvents::REQUEST => array('onKernelRequest'),
+        );
+    }
+
+    public function getName()
+    {
+        return 'http_kernel';
+    }
+}

+ 73 - 0
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Extension/RoutingExtension.php

@@ -0,0 +1,73 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bridge\Twig\Tests\Extension;
+
+use Symfony\Bridge\Twig\Extension\HttpKernelExtension;
+use Symfony\Bridge\Twig\Tests\TestCase;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+
+class HttpKernelExtensionTest extends TestCase
+{
+    protected function setUp()
+    {
+        if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) {
+            $this->markTestSkipped('The "HttpKernel" component is not available');
+        }
+
+        if (!class_exists('Twig_Environment')) {
+            $this->markTestSkipped('Twig is not available.');
+        }
+    }
+
+    public function testRenderWithoutMasterRequest()
+    {
+        $kernel = $this->getKernel($this->returnValue(new Response('foo')));
+
+        $this->assertEquals('foo', $this->renderTemplate($kernel));
+    }
+
+    /**
+     * @expectedException \Twig_Error_Runtime
+     */
+    public function testRenderWithError()
+    {
+        $kernel = $this->getKernel($this->throwException(new \Exception('foo')));
+
+        $loader = new \Twig_Loader_Array(array('index' => '{{ render("foo") }}'));
+        $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
+        $twig->addExtension(new HttpKernelExtension($kernel));
+
+        $this->renderTemplate($kernel);
+    }
+
+    protected function getKernel($return)
+    {
+        $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
+        $kernel
+            ->expects($this->once())
+            ->method('handle')
+            ->will($return)
+        ;
+
+        return $kernel;
+    }
+
+    protected function renderTemplate(HttpKernelInterface $kernel, $template = '{{ render("foo") }}')
+    {
+        $loader = new \Twig_Loader_Array(array('index' => $template));
+        $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
+        $twig->addExtension(new HttpKernelExtension($kernel));
+
+        return $twig->render('index');
+    }
+}

+ 2 - 0
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

@@ -26,6 +26,8 @@ class TransChoiceTokenParser extends TransTokenParser
      * @param \Twig_Token $token A Twig_Token instance
      *
      * @return \Twig_NodeInterface A Twig_NodeInterface instance
+     *
+     * @throws \Twig_Error_Syntax
      */
     public function parse(\Twig_Token $token)
     {

+ 2 - 0
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php

@@ -26,6 +26,8 @@ class TransTokenParser extends \Twig_TokenParser
      * @param \Twig_Token $token A Twig_Token instance
      *
      * @return \Twig_NodeInterface A Twig_NodeInterface instance
+     *
+     * @throws \Twig_Error_Syntax
      */
     public function parse(\Twig_Token $token)
     {

+ 2 - 0
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Translation/TwigExtractor.php

@@ -21,6 +21,7 @@
     },
     "require-dev": {
         "symfony/form": "2.2.*",
+        "symfony/http-kernel": "2.2.*",
         "symfony/routing": "2.2.*",
         "symfony/templating": "2.2.*",
         "symfony/translation": "2.2.*",
@@ -29,6 +30,7 @@
     },
     "suggest": {
         "symfony/form": "2.2.*",
+        "symfony/http-kernel": "2.2.*",
         "symfony/routing": "2.2.*",
         "symfony/templating": "2.2.*",
         "symfony/translation": "2.2.*",

+ 15 - 1
vendor/symfony/twig-bridge/Symfony/Bridge/Twig/phpunit.xml.dist

@@ -761,6 +761,11 @@ class Twig_Environment
             throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter');
         }
 
+        if ($name instanceof Twig_SimpleFilter) {
+            $filter = $name;
+            $name = $filter->getName();
+        }
+
         $this->staging->addFilter($name, $filter);
     }
 
@@ -845,6 +850,11 @@ class Twig_Environment
             throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest');
         }
 
+        if ($name instanceof Twig_SimpleTest) {
+            $test = $name;
+            $name = $test->getName();
+        }
+
         $this->staging->addTest($name, $test);
     }
 
@@ -878,6 +888,11 @@ class Twig_Environment
             throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction');
         }
 
+        if ($name instanceof Twig_SimpleFunction) {
+            $function = $name;
+            $name = $function->getName();
+        }
+
         $this->staging->addFunction($name, $function);
     }
 
@@ -1045,7 +1060,6 @@ class Twig_Environment
 
         $this->extensionInitialized = true;
         $this->parsers = new Twig_TokenParserBroker();
-
         $this->filters = array();
         $this->functions = array();
         $this->tests = array();

+ 1 - 1
vendor/twig/twig/lib/Twig/Error.php

@@ -537,7 +537,7 @@ class Twig_ExpressionParser
     protected function getFunctionNodeClass($name, $line)
     {
         $env = $this->parser->getEnvironment();
-        //var_dump($function = $env->getFunction($name),$name);exit;
+
         if (false === $function = $env->getFunction($name)) {
             $message = sprintf('The function "%s" does not exist', $name);
             if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFunctions()))) {

+ 0 - 0
vendor/twig/twig/lib/Twig/Extension.php