diff --git a/core/composer.json b/core/composer.json
index d217767db942830798b1adf0fde2c4c0a8a9434d..75b45b96fbc0a06a7d0969cb14a741281b5f6e82 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -18,7 +18,7 @@
     "symfony/validator": "2.7.*",
     "symfony/process": "2.7.*",
     "symfony/yaml": "2.7.*",
-    "twig/twig": "1.20.*",
+    "twig/twig": "~1.20",
     "doctrine/common": "2.5.*",
     "doctrine/annotations": "1.2.*",
     "guzzlehttp/guzzle": "dev-master#1879fbe853b0c64d109e369c7aeff09849e62d1e",
diff --git a/core/composer.lock b/core/composer.lock
index 15e8685435fb923733cdb48202baf8001d9091fc..4e155f1c7769738a5697ef10d35ab0d0caa99461 100644
--- a/core/composer.lock
+++ b/core/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "32a7f1295f8f5ccdf8b5759f9eb6e626",
+    "hash": "d39a311bc4d6e7db527d6a43a8ac34d4",
     "packages": [
         {
             "name": "behat/mink",
@@ -3106,25 +3106,29 @@
         },
         {
             "name": "twig/twig",
-            "version": "v1.20.0",
+            "version": "v1.21.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/twigphp/Twig.git",
-                "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844"
+                "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/twigphp/Twig/zipball/1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
-                "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
+                "url": "https://api.github.com/repos/twigphp/Twig/zipball/ca8d3aa90b6a01c82e07909fe815d6b443e75a23",
+                "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23",
                 "shasum": ""
             },
             "require": {
                 "php": ">=5.2.7"
             },
+            "require-dev": {
+                "symfony/debug": "~2.7",
+                "symfony/phpunit-bridge": "~2.7"
+            },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.20-dev"
+                    "dev-master": "1.21-dev"
                 }
             },
             "autoload": {
@@ -3159,7 +3163,7 @@
             "keywords": [
                 "templating"
             ],
-            "time": "2015-08-12 15:56:39"
+            "time": "2015-08-26 08:58:31"
         },
         {
             "name": "zendframework/zend-diactoros",
diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json
index 4e1447f598569adf0b30a1af3c7009b4b77bc1ff..e7c44d1224e12cb639068449ef4a52aa96ce3377 100644
--- a/core/vendor/composer/installed.json
+++ b/core/vendor/composer/installed.json
@@ -1415,65 +1415,6 @@
             "validator"
         ]
     },
-    {
-        "name": "twig/twig",
-        "version": "v1.20.0",
-        "version_normalized": "1.20.0.0",
-        "source": {
-            "type": "git",
-            "url": "https://github.com/twigphp/Twig.git",
-            "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844"
-        },
-        "dist": {
-            "type": "zip",
-            "url": "https://api.github.com/repos/twigphp/Twig/zipball/1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
-            "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
-            "shasum": ""
-        },
-        "require": {
-            "php": ">=5.2.7"
-        },
-        "time": "2015-08-12 15:56:39",
-        "type": "library",
-        "extra": {
-            "branch-alias": {
-                "dev-master": "1.20-dev"
-            }
-        },
-        "installation-source": "dist",
-        "autoload": {
-            "psr-0": {
-                "Twig_": "lib/"
-            }
-        },
-        "notification-url": "https://packagist.org/downloads/",
-        "license": [
-            "BSD-3-Clause"
-        ],
-        "authors": [
-            {
-                "name": "Fabien Potencier",
-                "email": "fabien@symfony.com",
-                "homepage": "http://fabien.potencier.org",
-                "role": "Lead Developer"
-            },
-            {
-                "name": "Armin Ronacher",
-                "email": "armin.ronacher@active-4.com",
-                "role": "Project Founder"
-            },
-            {
-                "name": "Twig Team",
-                "homepage": "http://twig.sensiolabs.org/contributors",
-                "role": "Contributors"
-            }
-        ],
-        "description": "Twig, the flexible, fast, and secure template language for PHP",
-        "homepage": "http://twig.sensiolabs.org",
-        "keywords": [
-            "templating"
-        ]
-    },
     {
         "name": "symfony/class-loader",
         "version": "v2.7.3",
@@ -3482,5 +3423,68 @@
             "psr",
             "psr-7"
         ]
+    },
+    {
+        "name": "twig/twig",
+        "version": "v1.21.1",
+        "version_normalized": "1.21.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/twigphp/Twig.git",
+            "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/twigphp/Twig/zipball/ca8d3aa90b6a01c82e07909fe815d6b443e75a23",
+            "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.2.7"
+        },
+        "require-dev": {
+            "symfony/debug": "~2.7",
+            "symfony/phpunit-bridge": "~2.7"
+        },
+        "time": "2015-08-26 08:58:31",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.21-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "Twig_": "lib/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Fabien Potencier",
+                "email": "fabien@symfony.com",
+                "homepage": "http://fabien.potencier.org",
+                "role": "Lead Developer"
+            },
+            {
+                "name": "Armin Ronacher",
+                "email": "armin.ronacher@active-4.com",
+                "role": "Project Founder"
+            },
+            {
+                "name": "Twig Team",
+                "homepage": "http://twig.sensiolabs.org/contributors",
+                "role": "Contributors"
+            }
+        ],
+        "description": "Twig, the flexible, fast, and secure template language for PHP",
+        "homepage": "http://twig.sensiolabs.org",
+        "keywords": [
+            "templating"
+        ]
     }
 ]
diff --git a/core/vendor/twig/twig/.travis.yml b/core/vendor/twig/twig/.travis.yml
index 223a3be1caae712508594b762598594da0aa9925..37262da2f76fe7c7b00c5a6b5d7e5c024c46ac4a 100644
--- a/core/vendor/twig/twig/.travis.yml
+++ b/core/vendor/twig/twig/.travis.yml
@@ -1,28 +1,39 @@
 language: php
 
-php:
-  - 5.2
-  - 5.3
-  - 5.4
-  - 5.5
-  - 5.6
-  - hhvm
-  - nightly
+sudo: false
+
+cache:
+    directories:
+        - vendor
+        - $HOME/.composer/cache
 
-allow_failures:
-    - php: nightly
+php:
+    - 5.2
+    - 5.3
+    - 5.4
+    - 5.5
+    - 5.6
+    - 7.0
+    - hhvm
 
 env:
-  - TWIG_EXT=no
-  - TWIG_EXT=yes
+    - TWIG_EXT=no
+    - TWIG_EXT=yes
+
+install:
+    # Composer is not available on PHP 5.2
+    - if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
 
 before_script:
-  - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && sudo make install"; fi
-  - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
+    - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
+    - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
+    - if [ ${TRAVIS_PHP_VERSION:0:3} == "5.2" ]; then sed -i.bak "s|vendor/autoload.php|test/bootstrap.php|" phpunit.xml.dist; fi
 
 matrix:
-  exclude:
-    - php: hhvm
-      env: TWIG_EXT=yes
-    - php: nightly
-      env: TWIG_EXT=yes
+    fast_finish: true
+    exclude:
+        - php: hhvm
+          env: TWIG_EXT=yes
+    allow_failures:
+        - php: 7.0
+          env: TWIG_EXT=yes
diff --git a/core/vendor/twig/twig/CHANGELOG b/core/vendor/twig/twig/CHANGELOG
index d4d951ba6356c99c3d186387030f1b0fb61e26de..6e574d4d51d59d0dfdd7a7d3c627f4859fccbab5 100644
--- a/core/vendor/twig/twig/CHANGELOG
+++ b/core/vendor/twig/twig/CHANGELOG
@@ -1,3 +1,12 @@
+* 1.21.1 (2015-08-26)
+
+ * fixed regression when using the deprecated Twig_Test_* classes
+
+* 1.21.0 (2015-08-24)
+
+ * added deprecation notices for deprecated features
+ * added a deprecation "framework" for filters/functions/tests and test fixtures
+
 * 1.20.0 (2015-08-12)
 
  * forbid access to the Twig environment from templates and internal parts of Twig_Template
diff --git a/core/vendor/twig/twig/composer.json b/core/vendor/twig/twig/composer.json
index 14f59c38a65985506c192c502a44f799d16f9647..2d3438ec29d7213e19fa02910cc78726ddbe7b15 100644
--- a/core/vendor/twig/twig/composer.json
+++ b/core/vendor/twig/twig/composer.json
@@ -29,6 +29,10 @@
     "require": {
         "php": ">=5.2.7"
     },
+    "require-dev": {
+        "symfony/phpunit-bridge": "~2.7",
+        "symfony/debug": "~2.7"
+    },
     "autoload": {
         "psr-0" : {
             "Twig_" : "lib/"
@@ -36,7 +40,7 @@
     },
     "extra": {
         "branch-alias": {
-            "dev-master": "1.20-dev"
+            "dev-master": "1.21-dev"
         }
     }
 }
diff --git a/core/vendor/twig/twig/doc/advanced.rst b/core/vendor/twig/twig/doc/advanced.rst
index 6953f551bb49da66ec384cc297a9e80d544f995f..a20eab0348b1874a97d8b3e022794956bbc65479 100644
--- a/core/vendor/twig/twig/doc/advanced.rst
+++ b/core/vendor/twig/twig/doc/advanced.rst
@@ -267,6 +267,23 @@ arguments, but after the environment and the context. For instance, a call to
 ``'foo'|a_path_b()`` will result in the following arguments to be passed to
 the filter: ``('a', 'b', 'foo')``.
 
+Deprecated Filters
+~~~~~~~~~~~~~~~~~~
+
+.. versionadded:: 1.21
+    Support for deprecated filters was added in Twig 1.21.
+
+You can mark a filter as being deprecated by setting the ``deprecated`` option
+to ``true``. You can also give an alternative filter that replaces the
+deprecated one when that makes sense::
+
+    $filter = new Twig_SimpleFilter('obsolete', function () {
+        // ...
+    }, array('deprecated' => true, 'alternative' => 'new_one'));
+
+When a filter is deprecated, Twig emits a deprecation notice when compiling a
+template using it. See :ref:`deprecation-notices` for more information.
+
 Functions
 ---------
 
diff --git a/core/vendor/twig/twig/doc/deprecated.rst b/core/vendor/twig/twig/doc/deprecated.rst
index 9afc2410429a863bace5ec68095d5ebfe33548e1..1489174a61e20ba8d1be60bd1f8f48b7fea38735 100644
--- a/core/vendor/twig/twig/doc/deprecated.rst
+++ b/core/vendor/twig/twig/doc/deprecated.rst
@@ -5,6 +5,12 @@ This document lists all deprecated features in Twig. Deprecated features are
 kept for backward compatibility and removed in the next major release (a
 feature that was deprecated in Twig 1.x is removed in Twig 2.0).
 
+Deprecation Notices
+-------------------
+
+As of Twig 1.21, Twig generates deprecation notices when a template uses
+deprecated features. See :ref:`deprecation-notices` for more information.
+
 Token Parsers
 -------------
 
@@ -80,6 +86,12 @@ Tests
 * The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
   as`` and ``divisible by`` respectively.
 
+Tags
+----
+
+* As of Twig 1.x, the ``raw`` tag is deprecated. You should use ``verbatim``
+  instead.
+
 Nodes
 -----
 
diff --git a/core/vendor/twig/twig/doc/recipes.rst b/core/vendor/twig/twig/doc/recipes.rst
index 86cede630263ccaf771058ea50c8d8d5729a2f29..b863e103c7dc4a75519e4aef75a255b6e691c995 100644
--- a/core/vendor/twig/twig/doc/recipes.rst
+++ b/core/vendor/twig/twig/doc/recipes.rst
@@ -1,6 +1,64 @@
 Recipes
 =======
 
+.. _deprecation-notices:
+
+Displaying Deprecation Notices
+------------------------------
+
+.. versionadded:: 1.21
+    This works as of Twig 1.21.
+
+Deprecated features generate deprecation notices (via a call to the
+``trigger_error()`` PHP function). By default, they are silenced and never
+displayed nor logged.
+
+To easily remove all deprecated feature usages from your templates, write and
+run a script along the lines of the following::
+
+    require_once __DIR__.'/vendor/autoload.php';
+
+    $twig = create_your_twig_env();
+
+    $deprecations = new Twig_Util_DeprecationCollector($twig);
+
+    print_r($deprecations->collectDir(__DIR__.'/templates'));
+
+The ``collectDir()`` method compiles all templates found in a directory,
+catches deprecation notices, and return them.
+
+.. tip::
+
+    If your templates are not stored on the filesystem, use the ``collect()``
+    method instead which takes an ``Iterator``; the iterator must return
+    template names as keys and template contents as values (as done by
+    ``Twig_Util_TemplateDirIterator``).
+
+However, this code won't find all deprecations (like using deprecated some Twig
+classes). To catch all notices, register a custom error handler like the one
+below::
+
+    $deprecations = array();
+    set_error_handler(function ($type, $msg) use (&$deprecations) {
+        if (E_USER_DEPRECATED === $type) {
+            $deprecations[] = $msg;
+        }
+    });
+
+    // run your application
+
+    print_r($deprecations);
+
+Note that most deprecation notices are triggered during **compilation**, so
+they won't be generated when templates are already cached.
+
+.. tip::
+
+    If you want to manage the deprecation notices from your PHPUnit tests, have
+    a look at the `symfony/phpunit-bridge
+    <https://github.com/symfony/phpunit-bridge>`_ package, which eases the
+    process a lot.
+
 Making a Layout conditional
 ---------------------------
 
@@ -274,13 +332,14 @@ If you iterate over a set of files, you can pass the filename to the
     is enforced during template rendering (as Twig needs the context for some
     checks like allowed methods on objects).
 
-Refreshing modified Templates when APC is enabled and apc.stat = 0
-------------------------------------------------------------------
+Refreshing modified Templates when OPcache or APC is enabled
+------------------------------------------------------------
 
-When using APC with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing
-the template cache won't update the APC cache. To get around this, one can
-extend ``Twig_Environment`` and force the update of the APC cache when Twig
-rewrites the cache::
+When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC
+with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template
+cache won't update the cache. To get around this, one can extend
+``Twig_Environment`` and force the update of the cache when Twig rewrites the
+cache::
 
     class Twig_Environment_APC extends Twig_Environment
     {
@@ -289,7 +348,11 @@ rewrites the cache::
             parent::writeCacheFile($file, $content);
 
             // Compile cached file into bytecode cache
-            apc_compile_file($file);
+            if (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) {
+                opcache_compile_file($file);
+            } elseif (extension_loaded('apc') && ini_get('apc.enabled')) {
+                apc_compile_file($file);
+            }
         }
     }
 
diff --git a/core/vendor/twig/twig/doc/templates.rst b/core/vendor/twig/twig/doc/templates.rst
index ebdea9e7e2b90f5a58430e22f30e3e9cbeeecccc..2d59b1a12f576985e1b603fac4dc9a1975905ca3 100644
--- a/core/vendor/twig/twig/doc/templates.rst
+++ b/core/vendor/twig/twig/doc/templates.rst
@@ -60,6 +60,9 @@ Many IDEs support syntax highlighting and auto-completion for Twig:
 * *Emacs* via `web-mode.el`_
 * *Atom* via the `PHP-twig for atom`_
 
+Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates
+from a browser; it supports all versions of Twig.
+
 Variables
 ---------
 
@@ -882,3 +885,4 @@ Extension<creating_extensions>` chapter.
 .. _`web-mode.el`:                http://web-mode.org/
 .. _`regular expressions`:        http://php.net/manual/en/pcre.pattern.php
 .. _`PHP-twig for atom`:          https://github.com/reesef/php-twig
+.. _`TwigFiddle`:                 http://twigfiddle.com/
diff --git a/core/vendor/twig/twig/ext/twig/php_twig.h b/core/vendor/twig/twig/ext/twig/php_twig.h
index 11d7be5cd03a396b48589eb39841293e1b266bc3..0423b1d9c8fb2d637ac7013ec64e549ae4a2b2f4 100644
--- a/core/vendor/twig/twig/ext/twig/php_twig.h
+++ b/core/vendor/twig/twig/ext/twig/php_twig.h
@@ -15,7 +15,7 @@
 #ifndef PHP_TWIG_H
 #define PHP_TWIG_H
 
-#define PHP_TWIG_VERSION "1.20.0"
+#define PHP_TWIG_VERSION "1.21.1"
 
 #include "php.h"
 
diff --git a/core/vendor/twig/twig/lib/Twig/Autoloader.php b/core/vendor/twig/twig/lib/Twig/Autoloader.php
index 87f74153874ee1149944f05d27c980dfb0442129..d47583fbf4c0173dd8bb9f7ab1eea1a637bbf5e6 100644
--- a/core/vendor/twig/twig/lib/Twig/Autoloader.php
+++ b/core/vendor/twig/twig/lib/Twig/Autoloader.php
@@ -9,10 +9,14 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Autoloader class is deprecated and will be removed in 2.0. Use Composer instead.', E_USER_DEPRECATED);
+
 /**
  * Autoloads Twig classes.
  *
  * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @deprecated Use Composer instead. Will be removed in Twig 2.0.
  */
 class Twig_Autoloader
 {
@@ -23,6 +27,8 @@ class Twig_Autoloader
      */
     public static function register($prepend = false)
     {
+        @trigger_error('Using Twig_Autoloader is deprecated. Use Composer instead.', E_USER_DEPRECATED);
+
         if (PHP_VERSION_ID < 50300) {
             spl_autoload_register(array(__CLASS__, 'autoload'));
         } else {
diff --git a/core/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php b/core/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php
index bb865d6f9c952871220b75163388c4f2e8708aaa..3c6ef6626f61edc83a7a46318ce736ed6e413970 100644
--- a/core/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php
+++ b/core/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php
@@ -43,8 +43,8 @@ final public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
     /**
      * Called before child nodes are visited.
      *
-     * @param Twig_Node         $node The node to visit
-     * @param Twig_Environment  $env  The Twig environment instance
+     * @param Twig_Node        $node The node to visit
+     * @param Twig_Environment $env  The Twig environment instance
      *
      * @return Twig_Node The modified node
      */
diff --git a/core/vendor/twig/twig/lib/Twig/Compiler.php b/core/vendor/twig/twig/lib/Twig/Compiler.php
index 2514c31e8a2c227eac2d508920ab0cb5caf34451..abea3aafe83cfed70de27e51a18ec86b3ea6f3bf 100644
--- a/core/vendor/twig/twig/lib/Twig/Compiler.php
+++ b/core/vendor/twig/twig/lib/Twig/Compiler.php
@@ -21,7 +21,7 @@ class Twig_Compiler implements Twig_CompilerInterface
     protected $source;
     protected $indentation;
     protected $env;
-    protected $debugInfo;
+    protected $debugInfo = array();
     protected $sourceOffset;
     protected $sourceLine;
     protected $filename;
@@ -34,7 +34,6 @@ class Twig_Compiler implements Twig_CompilerInterface
     public function __construct(Twig_Environment $env)
     {
         $this->env = $env;
-        $this->debugInfo = array();
     }
 
     public function getFilename()
diff --git a/core/vendor/twig/twig/lib/Twig/Environment.php b/core/vendor/twig/twig/lib/Twig/Environment.php
index 3ac9124262e3365ad79fefd26e4d1ff6c89c8961..7687d5b7958dc53e31db3984d89f498482f438e8 100644
--- a/core/vendor/twig/twig/lib/Twig/Environment.php
+++ b/core/vendor/twig/twig/lib/Twig/Environment.php
@@ -16,7 +16,7 @@
  */
 class Twig_Environment
 {
-    const VERSION = '1.20.0';
+    const VERSION = '1.21.1';
 
     protected $charset;
     protected $loader;
@@ -34,15 +34,15 @@ class Twig_Environment
     protected $tests;
     protected $functions;
     protected $globals;
-    protected $runtimeInitialized;
-    protected $extensionInitialized;
+    protected $runtimeInitialized = false;
+    protected $extensionInitialized = false;
     protected $loadedTemplates;
     protected $strictVariables;
     protected $unaryOperators;
     protected $binaryOperators;
     protected $templateClassPrefix = '__TwigTemplate_';
-    protected $functionCallbacks;
-    protected $filterCallbacks;
+    protected $functionCallbacks = array();
+    protected $filterCallbacks = array();
     protected $staging;
 
     /**
@@ -86,6 +86,8 @@ public function __construct(Twig_LoaderInterface $loader = null, $options = arra
     {
         if (null !== $loader) {
             $this->setLoader($loader);
+        } else {
+            @trigger_error('Not passing a Twig_LoaderInterface as the first constructor argument of Twig_Environment is deprecated.', E_USER_DEPRECATED);
         }
 
         $options = array_merge(array(
@@ -104,15 +106,11 @@ public function __construct(Twig_LoaderInterface $loader = null, $options = arra
         $this->baseTemplateClass = $options['base_template_class'];
         $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
         $this->strictVariables = (bool) $options['strict_variables'];
-        $this->runtimeInitialized = false;
         $this->setCache($options['cache']);
-        $this->functionCallbacks = array();
-        $this->filterCallbacks = array();
 
         $this->addExtension(new Twig_Extension_Core());
         $this->addExtension(new Twig_Extension_Escaper($options['autoescape']));
         $this->addExtension(new Twig_Extension_Optimizer($options['optimizations']));
-        $this->extensionInitialized = false;
         $this->staging = new Twig_Extension_Staging();
     }
 
@@ -448,6 +446,8 @@ public function resolveTemplate($names)
      */
     public function clearTemplateCache()
     {
+        @trigger_error(sprintf('The %s method is deprecated and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
+
         $this->loadedTemplates = array();
     }
 
@@ -711,6 +711,8 @@ public function addExtension(Twig_ExtensionInterface $extension)
      */
     public function removeExtension($name)
     {
+        @trigger_error(sprintf('The %s method is deprecated and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
+
         if ($this->extensionInitialized) {
             throw new LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name));
         }
@@ -830,6 +832,8 @@ public function addFilter($name, $filter = null)
         if ($name instanceof Twig_SimpleFilter) {
             $filter = $name;
             $name = $filter->getName();
+        } else {
+            @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), E_USER_DEPRECATED);
         }
 
         if ($this->extensionInitialized) {
@@ -919,6 +923,8 @@ public function addTest($name, $test = null)
         if ($name instanceof Twig_SimpleTest) {
             $test = $name;
             $name = $test->getName();
+        } else {
+            @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), E_USER_DEPRECATED);
         }
 
         if ($this->extensionInitialized) {
@@ -977,6 +983,8 @@ public function addFunction($name, $function = null)
         if ($name instanceof Twig_SimpleFunction) {
             $function = $name;
             $name = $function->getName();
+        } else {
+            @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), E_USER_DEPRECATED);
         }
 
         if ($this->extensionInitialized) {
@@ -1067,11 +1075,11 @@ public function addGlobal($name, $value)
                 $this->globals = $this->initGlobals();
             }
 
-            /* This condition must be uncommented in Twig 2.0
             if (!array_key_exists($name, $this->globals)) {
-                throw new LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
+                // The deprecation notice must be turned into the following exception in Twig 2.0
+                @trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated.', $name), E_USER_DEPRECATED);
+                //throw new LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
             }
-            */
         }
 
         if ($this->extensionInitialized || $this->runtimeInitialized) {
@@ -1186,7 +1194,7 @@ protected function initExtensions()
         }
 
         $this->extensionInitialized = true;
-        $this->parsers = new Twig_TokenParserBroker();
+        $this->parsers = new Twig_TokenParserBroker(array(), array(), false);
         $this->filters = array();
         $this->functions = array();
         $this->tests = array();
@@ -1204,11 +1212,10 @@ protected function initExtension(Twig_ExtensionInterface $extension)
     {
         // filters
         foreach ($extension->getFilters() as $name => $filter) {
-            if ($name instanceof Twig_SimpleFilter) {
-                $filter = $name;
-                $name = $filter->getName();
-            } elseif ($filter instanceof Twig_SimpleFilter) {
+            if ($filter instanceof Twig_SimpleFilter) {
                 $name = $filter->getName();
+            } else {
+                @trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated. Use Twig_SimpleFilter instead.', get_class($filter), $name), E_USER_DEPRECATED);
             }
 
             $this->filters[$name] = $filter;
@@ -1216,11 +1223,10 @@ protected function initExtension(Twig_ExtensionInterface $extension)
 
         // functions
         foreach ($extension->getFunctions() as $name => $function) {
-            if ($name instanceof Twig_SimpleFunction) {
-                $function = $name;
-                $name = $function->getName();
-            } elseif ($function instanceof Twig_SimpleFunction) {
+            if ($function instanceof Twig_SimpleFunction) {
                 $name = $function->getName();
+            } else {
+                @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated. Use Twig_SimpleFunction instead.', get_class($function), $name), E_USER_DEPRECATED);
             }
 
             $this->functions[$name] = $function;
@@ -1228,11 +1234,10 @@ protected function initExtension(Twig_ExtensionInterface $extension)
 
         // tests
         foreach ($extension->getTests() as $name => $test) {
-            if ($name instanceof Twig_SimpleTest) {
-                $test = $name;
-                $name = $test->getName();
-            } elseif ($test instanceof Twig_SimpleTest) {
+            if ($test instanceof Twig_SimpleTest) {
                 $name = $test->getName();
+            } else {
+                @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated. Use Twig_SimpleTest instead.', get_class($test), $name), E_USER_DEPRECATED);
             }
 
             $this->tests[$name] = $test;
@@ -1243,6 +1248,8 @@ protected function initExtension(Twig_ExtensionInterface $extension)
             if ($parser instanceof Twig_TokenParserInterface) {
                 $this->parsers->addTokenParser($parser);
             } elseif ($parser instanceof Twig_TokenParserBrokerInterface) {
+                @trigger_error('Registering a Twig_TokenParserBrokerInterface instance is deprecated.', E_USER_DEPRECATED);
+
                 $this->parsers->addTokenParserBroker($parser);
             } else {
                 throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances');
diff --git a/core/vendor/twig/twig/lib/Twig/ExpressionParser.php b/core/vendor/twig/twig/lib/Twig/ExpressionParser.php
index 135958a35accb925d87b4e5385e94d8de8cdf3be..085588c272486aa689b25322c2326ce35b92bf12 100644
--- a/core/vendor/twig/twig/lib/Twig/ExpressionParser.php
+++ b/core/vendor/twig/twig/lib/Twig/ExpressionParser.php
@@ -578,6 +578,16 @@ protected function getFunctionNodeClass($name, $line)
             throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
         }
 
+        if ($function instanceof Twig_SimpleFunction && $function->isDeprecated()) {
+            $message = sprintf('Twig Function "%s" is deprecated', $function->getName());
+            if ($test->getAlternative()) {
+                $message .= sprintf('. Use "%s" instead', $function->getAlternative());
+            }
+            $message .= sprintf(' in %s at line %d.', $this->parser->getFilename(), $line);
+
+            @trigger_error($message, E_USER_DEPRECATED);
+        }
+
         if ($function instanceof Twig_SimpleFunction) {
             return $function->getNodeClass();
         }
@@ -598,6 +608,16 @@ protected function getFilterNodeClass($name, $line)
             throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
         }
 
+        if ($filter instanceof Twig_SimpleFilter && $filter->isDeprecated()) {
+            $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName());
+            if ($test->getAlternative()) {
+                $message .= sprintf('. Use "%s" instead', $filter->getAlternative());
+            }
+            $message .= sprintf(' in %s at line %d.', $this->parser->getFilename(), $line);
+
+            @trigger_error($message, E_USER_DEPRECATED);
+        }
+
         if ($filter instanceof Twig_SimpleFilter) {
             return $filter->getNodeClass();
         }
diff --git a/core/vendor/twig/twig/lib/Twig/Extension/Core.php b/core/vendor/twig/twig/lib/Twig/Extension/Core.php
index dd69a05dada200fe9b7a85e1ae1e012895c85e94..cfffa8031155015c84527b7ee10af344a6ca0d4e 100644
--- a/core/vendor/twig/twig/lib/Twig/Extension/Core.php
+++ b/core/vendor/twig/twig/lib/Twig/Extension/Core.php
@@ -233,11 +233,11 @@ public function getTests()
             new Twig_SimpleTest('even', null, array('node_class' => 'Twig_Node_Expression_Test_Even')),
             new Twig_SimpleTest('odd', null, array('node_class' => 'Twig_Node_Expression_Test_Odd')),
             new Twig_SimpleTest('defined', null, array('node_class' => 'Twig_Node_Expression_Test_Defined')),
-            new Twig_SimpleTest('sameas', null, array('node_class' => 'Twig_Node_Expression_Test_Sameas')),
+            new Twig_SimpleTest('sameas', null, array('node_class' => 'Twig_Node_Expression_Test_Sameas', 'deprecated' => true, 'alternative' => 'same as')),
             new Twig_SimpleTest('same as', null, array('node_class' => 'Twig_Node_Expression_Test_Sameas')),
             new Twig_SimpleTest('none', null, array('node_class' => 'Twig_Node_Expression_Test_Null')),
             new Twig_SimpleTest('null', null, array('node_class' => 'Twig_Node_Expression_Test_Null')),
-            new Twig_SimpleTest('divisibleby', null, array('node_class' => 'Twig_Node_Expression_Test_Divisibleby')),
+            new Twig_SimpleTest('divisibleby', null, array('node_class' => 'Twig_Node_Expression_Test_Divisibleby', 'deprecated' => true, 'alternative' => 'divisible by')),
             new Twig_SimpleTest('divisible by', null, array('node_class' => 'Twig_Node_Expression_Test_Divisibleby')),
             new Twig_SimpleTest('constant', null, array('node_class' => 'Twig_Node_Expression_Test_Constant')),
             new Twig_SimpleTest('empty', 'twig_test_empty'),
@@ -298,8 +298,19 @@ public function parseNotTestExpression(Twig_Parser $parser, Twig_NodeInterface $
     public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $node)
     {
         $stream = $parser->getStream();
-        $name = $this->getTestName($parser, $node->getLine());
-        $class = $this->getTestNodeClass($parser, $name);
+        list($name, $test) = $this->getTest($parser, $node->getLine());
+
+        if ($test instanceof Twig_SimpleTest && $test->isDeprecated()) {
+            $message = sprintf('Twig Test "%s" is deprecated', $name);
+            if ($test->getAlternative()) {
+                $message .= sprintf('. Use "%s" instead', $test->getAlternative());
+            }
+            $message .= sprintf(' in %s at line %d.', $stream->getFilename(), $stream->getCurrent()->getLine());
+
+            @trigger_error($message, E_USER_DEPRECATED);
+        }
+
+        $class = $this->getTestNodeClass($parser, $test);
         $arguments = null;
         if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
             $arguments = $parser->getExpressionParser()->parseArguments(true);
@@ -308,46 +319,42 @@ public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $nod
         return new $class($node, $name, $arguments, $parser->getCurrentToken()->getLine());
     }
 
-    protected function getTestName(Twig_Parser $parser, $line)
+    protected function getTest(Twig_Parser $parser, $line)
     {
         $stream = $parser->getStream();
         $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
         $env = $parser->getEnvironment();
-        $testMap = $env->getTests();
 
-        if (isset($testMap[$name])) {
-            return $name;
+        if ($test = $env->getTest($name)) {
+            return array($name, $test);
         }
 
         if ($stream->test(Twig_Token::NAME_TYPE)) {
             // try 2-words tests
             $name = $name.' '.$parser->getCurrentToken()->getValue();
 
-            if (isset($testMap[$name])) {
+            if ($test = $env->getTest($name)) {
                 $parser->getStream()->next();
 
-                return $name;
+                return array($name, $test);
             }
         }
 
         $message = sprintf('The test "%s" does not exist', $name);
-        if ($alternatives = $env->computeAlternatives($name, array_keys($testMap))) {
+        if ($alternatives = $env->computeAlternatives($name, array_keys($env->getTests()))) {
             $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
         }
 
         throw new Twig_Error_Syntax($message, $line, $parser->getFilename());
     }
 
-    protected function getTestNodeClass(Twig_Parser $parser, $name)
+    protected function getTestNodeClass(Twig_Parser $parser, $test)
     {
-        $env = $parser->getEnvironment();
-        $testMap = $env->getTests();
-
-        if ($testMap[$name] instanceof Twig_SimpleTest) {
-            return $testMap[$name]->getNodeClass();
+        if ($test instanceof Twig_SimpleTest) {
+            return $test->getNodeClass();
         }
 
-        return $testMap[$name] instanceof Twig_Test_Node ? $testMap[$name]->getClass() : 'Twig_Node_Expression_Test';
+        return $test instanceof Twig_Test_Node ? $test->getClass() : 'Twig_Node_Expression_Test';
     }
 
     /**
@@ -384,8 +391,8 @@ function twig_cycle($values, $position)
  * - a random character from a string
  * - a random integer between 0 and the integer parameter.
  *
- * @param Twig_Environment                 $env    A Twig_Environment instance
- * @param Traversable|array|int|string     $values The values to pick a random item from
+ * @param Twig_Environment             $env    A Twig_Environment instance
+ * @param Traversable|array|int|string $values The values to pick a random item from
  *
  * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is).
  *
@@ -472,9 +479,9 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $
  *   {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
  * </pre>
  *
- * @param Twig_Environment  $env      A Twig_Environment instance
- * @param DateTime|string   $date     A date
- * @param string            $modifier A modifier string
+ * @param Twig_Environment $env      A Twig_Environment instance
+ * @param DateTime|string  $date     A date
+ * @param string           $modifier A modifier string
  *
  * @return DateTime A new date object
  */
@@ -545,11 +552,11 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu
 /**
  * Rounds a number.
  *
- * @param int|float     $value     The value to round
- * @param int|float     $precision The rounding precision
- * @param string        $method    The method to use for rounding
+ * @param int|float $value     The value to round
+ * @param int|float $precision The rounding precision
+ * @param string    $method    The method to use for rounding
  *
- * @return int|float     The rounded number
+ * @return int|float The rounded number
  */
 function twig_round($value, $precision = 0, $method = 'common')
 {
@@ -571,11 +578,11 @@ function twig_round($value, $precision = 0, $method = 'common')
  * be used.  Supplying any of the parameters will override the defaults set in the
  * environment object.
  *
- * @param Twig_Environment    $env          A Twig_Environment instance
- * @param mixed               $number       A float/int/string of the number to format
- * @param int                 $decimal      The number of decimal points to display.
- * @param string              $decimalPoint The character(s) to use for the decimal point.
- * @param string              $thousandSep  The character(s) to use for the thousands separator.
+ * @param Twig_Environment $env          A Twig_Environment instance
+ * @param mixed            $number       A float/int/string of the number to format
+ * @param int              $decimal      The number of decimal points to display.
+ * @param string           $decimalPoint The character(s) to use for the decimal point.
+ * @param string           $thousandSep  The character(s) to use for the thousands separator.
  *
  * @return string The formatted number
  */
@@ -805,9 +812,9 @@ function twig_join_filter($value, $glue = '')
  *  {# returns [aa, bb, cc] #}
  * </pre>
  *
- * @param string  $value     A string
- * @param string  $delimiter The delimiter
- * @param int     $limit     The limit
+ * @param string $value     A string
+ * @param string $delimiter The delimiter
+ * @param int    $limit     The limit
  *
  * @return array The split string as an array
  */
@@ -1369,7 +1376,7 @@ function twig_ensure_traversable($seq)
  *
  * @param mixed $value A variable
  *
- * @return bool    true if the value is empty, false otherwise
+ * @return bool true if the value is empty, false otherwise
  */
 function twig_test_empty($value)
 {
@@ -1392,7 +1399,7 @@ function twig_test_empty($value)
  *
  * @param mixed $value A variable
  *
- * @return bool    true if the value is traversable
+ * @return bool true if the value is traversable
  */
 function twig_test_iterable($value)
 {
@@ -1486,9 +1493,9 @@ function twig_constant($constant, $object = null)
 /**
  * Batches item.
  *
- * @param array   $items An array of items
- * @param int     $size  The size of the batch
- * @param mixed   $fill  A value used to fill missing items
+ * @param array $items An array of items
+ * @param int   $size  The size of the batch
+ * @param mixed $fill  A value used to fill missing items
  *
  * @return array
  */
diff --git a/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php b/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php
index cf2020eecc6df8085a64a8c8f878c903d2501a93..053a895c27a2763f34c69410243a90ae778a1d80 100644
--- a/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php
+++ b/core/vendor/twig/twig/lib/Twig/Extension/Escaper.php
@@ -12,6 +12,13 @@ class Twig_Extension_Escaper extends Twig_Extension
 {
     protected $defaultStrategy;
 
+    /**
+     * Constructor.
+     *
+     * @param string|false|callable $defaultStrategy An escaping strategy
+     *
+     * @see setDefaultStrategy()
+     */
     public function __construct($defaultStrategy = 'html')
     {
         $this->setDefaultStrategy($defaultStrategy);
@@ -55,12 +62,14 @@ public function getFilters()
      * The strategy can be a valid PHP callback that takes the template
      * "filename" as an argument and returns the strategy to use.
      *
-     * @param mixed $defaultStrategy An escaping strategy
+     * @param string|false|callable $defaultStrategy An escaping strategy
      */
     public function setDefaultStrategy($defaultStrategy)
     {
         // for BC
         if (true === $defaultStrategy) {
+            @trigger_error('Using "true" as the default strategy is deprecated. Use "html" instead.', E_USER_DEPRECATED);
+
             $defaultStrategy = 'html';
         }
 
@@ -76,13 +85,13 @@ public function setDefaultStrategy($defaultStrategy)
      *
      * @param string $filename The template "filename"
      *
-     * @return string The default strategy to use for the template
+     * @return string|false The default strategy to use for the template
      */
     public function getDefaultStrategy($filename)
     {
         // disable string callables to avoid calling a function named html or js,
         // or any other upcoming escaping strategy
-        if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) {
+        if (!is_string($this->defaultStrategy) && false !== $this->defaultStrategy) {
             return call_user_func($this->defaultStrategy, $filename);
         }
 
diff --git a/core/vendor/twig/twig/lib/Twig/Extension/Profiler.php b/core/vendor/twig/twig/lib/Twig/Extension/Profiler.php
index 35e04a01300173f9496489e2cd10d258a6357984..e21fdb6e2e575ff8fa7bd9211858235005f8a2f2 100644
--- a/core/vendor/twig/twig/lib/Twig/Extension/Profiler.php
+++ b/core/vendor/twig/twig/lib/Twig/Extension/Profiler.php
@@ -11,11 +11,11 @@
 
 class Twig_Extension_Profiler extends Twig_Extension
 {
-    private $actives;
+    private $actives = array();
 
     public function __construct(Twig_Profiler_Profile $profile)
     {
-        $this->actives = array($profile);
+        $this->actives[] = $profile;
     }
 
     public function enter(Twig_Profiler_Profile $profile)
diff --git a/core/vendor/twig/twig/lib/Twig/Filter.php b/core/vendor/twig/twig/lib/Twig/Filter.php
index a6e923d30053f3f3897ad7446694b6b262476c49..101d2e793b0a74362030b0d0c4f4ad96540e849c 100644
--- a/core/vendor/twig/twig/lib/Twig/Filter.php
+++ b/core/vendor/twig/twig/lib/Twig/Filter.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a template filter.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Filter/Function.php b/core/vendor/twig/twig/lib/Twig/Filter/Function.php
index 45c14c764fe1d41382447de378107cf3c9390232..d679cab2f8c4f92fa592244c89a94d01bcc5765a 100644
--- a/core/vendor/twig/twig/lib/Twig/Filter/Function.php
+++ b/core/vendor/twig/twig/lib/Twig/Filter/Function.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a function template filter.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Filter/Method.php b/core/vendor/twig/twig/lib/Twig/Filter/Method.php
index f32435ffd7b8466b9388c58e538fd4ec314b78ec..655aab4059bd526699c55b7d69c964ba3de72f62 100644
--- a/core/vendor/twig/twig/lib/Twig/Filter/Method.php
+++ b/core/vendor/twig/twig/lib/Twig/Filter/Method.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a method template filter.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Filter/Node.php b/core/vendor/twig/twig/lib/Twig/Filter/Node.php
index efbcc29d94b0cba93de1c7eb324eecd9af1ef553..a922f503781e4199c024f504acab57693f6dafd7 100644
--- a/core/vendor/twig/twig/lib/Twig/Filter/Node.php
+++ b/core/vendor/twig/twig/lib/Twig/Filter/Node.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a template filter as a node.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Function.php b/core/vendor/twig/twig/lib/Twig/Function.php
index 0f6ac97e61a7ff45628e267c3d76222eb8397c10..9fc76a8b7a764e5cfe612d20dd81c624807feb76 100644
--- a/core/vendor/twig/twig/lib/Twig/Function.php
+++ b/core/vendor/twig/twig/lib/Twig/Function.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a template function.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Function/Function.php b/core/vendor/twig/twig/lib/Twig/Function/Function.php
index e7f3845a52b413bed4a787a94558a4d159059987..ae83e153c9f7b042d2c3dbe9cd651637896f48e7 100644
--- a/core/vendor/twig/twig/lib/Twig/Function/Function.php
+++ b/core/vendor/twig/twig/lib/Twig/Function/Function.php
@@ -10,6 +10,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a function template function.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Function/Method.php b/core/vendor/twig/twig/lib/Twig/Function/Method.php
index 17a7bd8702d54ed65bcebf72765c00568f5bcecf..ba9945ed512fabfd6410cf84ce8e5b0b97b3f6a9 100644
--- a/core/vendor/twig/twig/lib/Twig/Function/Method.php
+++ b/core/vendor/twig/twig/lib/Twig/Function/Method.php
@@ -10,6 +10,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a method template function.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Function/Node.php b/core/vendor/twig/twig/lib/Twig/Function/Node.php
index 550a379c5ddb19925d4063725537fcf64f08d9aa..118b0bab76bf4585a1da173bec4b1103b30dbac3 100644
--- a/core/vendor/twig/twig/lib/Twig/Function/Node.php
+++ b/core/vendor/twig/twig/lib/Twig/Function/Node.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a template function as a node.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Lexer.php b/core/vendor/twig/twig/lib/Twig/Lexer.php
index d03a1bf025ca391c0e6ba71d100e3144a5caeb83..75f763fb9cdc6f85c9564f8d94e1b94154869a4e 100644
--- a/core/vendor/twig/twig/lib/Twig/Lexer.php
+++ b/core/vendor/twig/twig/lib/Twig/Lexer.php
@@ -287,6 +287,10 @@ protected function lexExpression()
 
     protected function lexRawData($tag)
     {
+        if ('raw' === $tag) {
+            @trigger_error(sprintf('Twig Tag "raw" is deprecated. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED);
+        }
+
         if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
             throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block', $tag), $this->lineno, $this->filename);
         }
diff --git a/core/vendor/twig/twig/lib/Twig/Loader/Array.php b/core/vendor/twig/twig/lib/Twig/Loader/Array.php
index 436edd816a07a0c956e90feb702bf7234d2b9ec9..90221d5db210fe65cc704bbe7f48d98fdc71a915 100644
--- a/core/vendor/twig/twig/lib/Twig/Loader/Array.php
+++ b/core/vendor/twig/twig/lib/Twig/Loader/Array.php
@@ -29,8 +29,6 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
      * Constructor.
      *
      * @param array $templates An array of templates (keys are the names, and values are the source code)
-     *
-     * @see Twig_Loader
      */
     public function __construct(array $templates)
     {
diff --git a/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php b/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php
index 818a461c58f15299afeb95c6cb0a1d6021ad0eb2..a68876cee310c3a2889bb45507b36f0689926773 100644
--- a/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php
+++ b/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php
@@ -21,6 +21,7 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
 
     protected $paths = array();
     protected $cache = array();
+    protected $errorCache = array();
 
     /**
      * Constructor.
@@ -87,7 +88,7 @@ public function setPaths($paths, $namespace = self::MAIN_NAMESPACE)
     public function addPath($path, $namespace = self::MAIN_NAMESPACE)
     {
         // invalidate the cache
-        $this->cache = array();
+        $this->cache = $this->errorCache = array();
 
         if (!is_dir($path)) {
             throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
@@ -107,7 +108,7 @@ public function addPath($path, $namespace = self::MAIN_NAMESPACE)
     public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
     {
         // invalidate the cache
-        $this->cache = array();
+        $this->cache = $this->errorCache = array();
 
         if (!is_dir($path)) {
             throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
@@ -150,9 +151,7 @@ public function exists($name)
         }
 
         try {
-            $this->findTemplate($name);
-
-            return true;
+            return false !== $this->findTemplate($name, false);
         } catch (Twig_Error_Loader $exception) {
             return false;
         }
@@ -168,18 +167,33 @@ public function isFresh($name, $time)
 
     protected function findTemplate($name)
     {
+        $throw = func_num_args() > 1 ? func_get_arg(1) : true;
         $name = $this->normalizeName($name);
 
         if (isset($this->cache[$name])) {
             return $this->cache[$name];
         }
 
+        if (isset($this->errorCache[$name])) {
+            if (!$throw) {
+                return false;
+            }
+
+            throw new Twig_Error_Loader($this->errorCache[$name]);
+        }
+
         $this->validateName($name);
 
         list($namespace, $shortname) = $this->parseName($name);
 
         if (!isset($this->paths[$namespace])) {
-            throw new Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace));
+            $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace);
+
+            if (!$throw) {
+                return false;
+            }
+
+            throw new Twig_Error_Loader($this->errorCache[$name]);
         }
 
         foreach ($this->paths[$namespace] as $path) {
@@ -192,7 +206,13 @@ protected function findTemplate($name)
             }
         }
 
-        throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])));
+        $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]));
+
+        if (!$throw) {
+            return false;
+        }
+
+        throw new Twig_Error_Loader($this->errorCache[$name]);
     }
 
     protected function parseName($name, $default = self::MAIN_NAMESPACE)
diff --git a/core/vendor/twig/twig/lib/Twig/Loader/String.php b/core/vendor/twig/twig/lib/Twig/Loader/String.php
index 63d6890a30ef1cc9020ef9f7a1edcdd47ea3e4a4..e7fff3e816daacd89b37acebcbfe65755a71687d 100644
--- a/core/vendor/twig/twig/lib/Twig/Loader/String.php
+++ b/core/vendor/twig/twig/lib/Twig/Loader/String.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead.', E_USER_DEPRECATED);
+
 /**
  * Loads a template from a string.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Node.php b/core/vendor/twig/twig/lib/Twig/Node.php
index 1c78e7b27c15b21d95c1db24f12c9ee93ae3b6c8..40d67fe591dec72346ddf00b3c5843d280867972 100644
--- a/core/vendor/twig/twig/lib/Twig/Node.php
+++ b/core/vendor/twig/twig/lib/Twig/Node.php
@@ -74,6 +74,8 @@ public function __toString()
      */
     public function toXml($asDom = false)
     {
+        @trigger_error(sprintf('%s is deprecated.', __METHOD__), E_USER_DEPRECATED);
+
         $dom = new DOMDocument('1.0', 'UTF-8');
         $dom->formatOutput = true;
         $dom->appendChild($xml = $dom->createElement('twig'));
diff --git a/core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php b/core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php
index a6e0ff4202e373917318816b3d518a5331e75b36..c062a213fb4790a9a56d777f5211263594329f38 100644
--- a/core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php
+++ b/core/vendor/twig/twig/lib/Twig/Node/Expression/Name.php
@@ -30,11 +30,19 @@ public function compile(Twig_Compiler $compiler)
 
         if ($this->getAttribute('is_defined_test')) {
             if ($this->isSpecial()) {
+                if ('_self' === $name) {
+                    @trigger_error(sprintf('Global variable "_self" is deprecated in %s at line %d', '?', $this->getLine()), E_USER_DEPRECATED);
+                }
+
                 $compiler->repr(true);
             } else {
                 $compiler->raw('array_key_exists(')->repr($name)->raw(', $context)');
             }
         } elseif ($this->isSpecial()) {
+            if ('_self' === $name) {
+                @trigger_error(sprintf('Global variable "_self" is deprecated in %s at line %d', '?', $this->getLine()), E_USER_DEPRECATED);
+            }
+
             $compiler->raw($this->specialVars[$name]);
         } elseif ($this->getAttribute('always_defined')) {
             $compiler
diff --git a/core/vendor/twig/twig/lib/Twig/Node/Module.php b/core/vendor/twig/twig/lib/Twig/Node/Module.php
index 327b5e6d60a997a9b0e4c3c2cd81530c69e9df3d..1bc4fea6df710167903bad75904a739b30350d8e 100644
--- a/core/vendor/twig/twig/lib/Twig/Node/Module.php
+++ b/core/vendor/twig/twig/lib/Twig/Node/Module.php
@@ -402,22 +402,7 @@ protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var)
                 ->raw(");\n")
             ;
         } else {
-            $compiler
-                ->write(sprintf('%s = ', $var))
-                ->subcompile($node)
-                ->raw(";\n")
-                ->write(sprintf('if (!%s', $var))
-                ->raw(" instanceof Twig_Template) {\n")
-                ->indent()
-                ->write(sprintf('%s = $this->loadTemplate(%s')
-                ->raw(', ')
-                ->repr($compiler->getFilename())
-                ->raw(', ')
-                ->repr($node->getLine())
-                ->raw(");\n", $var, $var))
-                ->outdent()
-                ->write("}\n")
-            ;
+            throw new LogicException('Trait templates can only be constant nodes');
         }
     }
 }
diff --git a/core/vendor/twig/twig/lib/Twig/NodeTraverser.php b/core/vendor/twig/twig/lib/Twig/NodeTraverser.php
index 6024e65d021783192499ab4e86ad3409c97d0c05..00f7b54b6d8e8c01cf916cc473419254130ffc70 100644
--- a/core/vendor/twig/twig/lib/Twig/NodeTraverser.php
+++ b/core/vendor/twig/twig/lib/Twig/NodeTraverser.php
@@ -19,7 +19,7 @@
 class Twig_NodeTraverser
 {
     protected $env;
-    protected $visitors;
+    protected $visitors = array();
 
     /**
      * Constructor.
@@ -30,7 +30,6 @@ class Twig_NodeTraverser
     public function __construct(Twig_Environment $env, array $visitors = array())
     {
         $this->env = $env;
-        $this->visitors = array();
         foreach ($visitors as $visitor) {
             $this->addVisitor($visitor);
         }
diff --git a/core/vendor/twig/twig/lib/Twig/Parser.php b/core/vendor/twig/twig/lib/Twig/Parser.php
index dd9c1fc331db1beb708e7645eb39d6d527b4c302..6f24ee65916492d102d23167247b4edd88ba4e07 100644
--- a/core/vendor/twig/twig/lib/Twig/Parser.php
+++ b/core/vendor/twig/twig/lib/Twig/Parser.php
@@ -64,7 +64,7 @@ public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = fals
     {
         // push all variables into the stack to keep the current state of the parser
         $vars = get_object_vars($this);
-        unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser']);
+        unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']);
         $this->stack[] = $vars;
 
         // tag handlers
diff --git a/core/vendor/twig/twig/lib/Twig/SimpleFilter.php b/core/vendor/twig/twig/lib/Twig/SimpleFilter.php
index 5d6d27bf2b60bfaa4560dfcac31663db925561a6..cefc4f587fdece6ead33d0516cd5e4246328dde2 100644
--- a/core/vendor/twig/twig/lib/Twig/SimpleFilter.php
+++ b/core/vendor/twig/twig/lib/Twig/SimpleFilter.php
@@ -34,6 +34,8 @@ public function __construct($name, $callable, array $options = array())
             'pre_escape' => null,
             'preserves_safety' => null,
             'node_class' => 'Twig_Node_Expression_Filter',
+            'deprecated' => false,
+            'alternative' => null,
         ), $options);
     }
 
@@ -97,4 +99,14 @@ public function isVariadic()
     {
         return $this->options['is_variadic'];
     }
+
+    public function isDeprecated()
+    {
+        return $this->options['deprecated'];
+    }
+
+    public function getAlternative()
+    {
+        return $this->options['alternative'];
+    }
 }
diff --git a/core/vendor/twig/twig/lib/Twig/SimpleFunction.php b/core/vendor/twig/twig/lib/Twig/SimpleFunction.php
index 8085f5788d2529d54595c08a02576e4f5ef47708..79735405cb2f089069a3c2b818380276856939ba 100644
--- a/core/vendor/twig/twig/lib/Twig/SimpleFunction.php
+++ b/core/vendor/twig/twig/lib/Twig/SimpleFunction.php
@@ -32,6 +32,8 @@ public function __construct($name, $callable, array $options = array())
             'is_safe' => null,
             'is_safe_callback' => null,
             'node_class' => 'Twig_Node_Expression_Function',
+            'deprecated' => false,
+            'alternative' => null,
         ), $options);
     }
 
@@ -87,4 +89,14 @@ public function isVariadic()
     {
         return $this->options['is_variadic'];
     }
+
+    public function isDeprecated()
+    {
+        return $this->options['deprecated'];
+    }
+
+    public function getAlternative()
+    {
+        return $this->options['alternative'];
+    }
 }
diff --git a/core/vendor/twig/twig/lib/Twig/SimpleTest.php b/core/vendor/twig/twig/lib/Twig/SimpleTest.php
index 87b093548dad5cd4f11b0f9a8396eed6c13dd02a..8ba2192b27f027ed317cb4f68e14659d11f89daa 100644
--- a/core/vendor/twig/twig/lib/Twig/SimpleTest.php
+++ b/core/vendor/twig/twig/lib/Twig/SimpleTest.php
@@ -27,6 +27,8 @@ public function __construct($name, $callable, array $options = array())
         $this->options = array_merge(array(
             'is_variadic' => false,
             'node_class' => 'Twig_Node_Expression_Test',
+            'deprecated' => false,
+            'alternative' => null,
         ), $options);
     }
 
@@ -49,4 +51,14 @@ public function isVariadic()
     {
         return $this->options['is_variadic'];
     }
+
+    public function isDeprecated()
+    {
+        return $this->options['deprecated'];
+    }
+
+    public function getAlternative()
+    {
+        return $this->options['alternative'];
+    }
 }
diff --git a/core/vendor/twig/twig/lib/Twig/Template.php b/core/vendor/twig/twig/lib/Twig/Template.php
index 73150bb59c978a09f5961408be1dd36a169845cd..e2ab05a249fad006baeb104144ff5620a5ee2fd9 100644
--- a/core/vendor/twig/twig/lib/Twig/Template.php
+++ b/core/vendor/twig/twig/lib/Twig/Template.php
@@ -22,8 +22,8 @@ abstract class Twig_Template implements Twig_TemplateInterface
     protected $parent;
     protected $parents = array();
     protected $env;
-    protected $blocks;
-    protected $traits;
+    protected $blocks = array();
+    protected $traits = array();
 
     /**
      * Constructor.
@@ -33,8 +33,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
     public function __construct(Twig_Environment $env)
     {
         $this->env = $env;
-        $this->blocks = array();
-        $this->traits = array();
     }
 
     /**
@@ -155,8 +153,8 @@ public function displayBlock($name, array $context, array $blocks = array(), $us
 
         if (null !== $template) {
             // avoid RCEs when sandbox is enabled
-            if (!$template instanceof Twig_Template) {
-                throw new \LogicException('A block must be a method on a Twig_Template instance.');
+            if (!$template instanceof self) {
+                throw new LogicException('A block must be a method on a Twig_Template instance.');
             }
 
             try {
diff --git a/core/vendor/twig/twig/lib/Twig/Test.php b/core/vendor/twig/twig/lib/Twig/Test.php
index c53c3cc1a720b6d082c69816b85155c17064dcff..3c2d8590b1739730d814fe02312b333f70635391 100644
--- a/core/vendor/twig/twig/lib/Twig/Test.php
+++ b/core/vendor/twig/twig/lib/Twig/Test.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a template test.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Test/Function.php b/core/vendor/twig/twig/lib/Twig/Test/Function.php
index 30e1c6230ad2182c267d7c842f321f5c4d2fb0e1..5e76c711b9750fd3848b49418f4e46a2d4752668 100644
--- a/core/vendor/twig/twig/lib/Twig/Test/Function.php
+++ b/core/vendor/twig/twig/lib/Twig/Test/Function.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a function template test.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php b/core/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php
index 261acd41cb713576d96bdf61dc00a01b575920e4..96892a42238bf29da91990cb953386560ad93559 100644
--- a/core/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php
+++ b/core/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php
@@ -28,7 +28,16 @@ public function testIntegration($file, $message, $condition, $templates, $except
         $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs);
     }
 
-    public function getTests()
+    /**
+     * @dataProvider getLegacyTests
+     * @group legacy
+     */
+    public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs)
+    {
+        $this->testIntegration($file, $message, $condition, $templates, $exception, $outputs);
+    }
+
+    public function getTests($name, $legacyTests = false)
     {
         $fixturesDir = realpath($this->getFixturesDir());
         $tests = array();
@@ -38,10 +47,13 @@ public function getTests()
                 continue;
             }
 
+            if ($legacyTests xor false !== strpos($file->getRealpath(), '.legacy.test')) {
+                continue;
+            }
+
             $test = file_get_contents($file->getRealpath());
 
-            if (preg_match('/
-                    --TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) {
+            if (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) {
                 $message = $match[1];
                 $condition = $match[2];
                 $templates = $this->parseTemplates($match[3]);
@@ -60,9 +72,19 @@ public function getTests()
             $tests[] = array(str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs);
         }
 
+        if (!$tests) {
+            // add a dummy test to avoid a PHPUnit message
+            return array(array('not', '-', '', array(), '', array()));
+        }
+
         return $tests;
     }
 
+    public function getLegacyTests()
+    {
+        return $this->getTests('testLegacyIntegration', true);
+    }
+
     protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs)
     {
         if ($condition) {
diff --git a/core/vendor/twig/twig/lib/Twig/Test/Method.php b/core/vendor/twig/twig/lib/Twig/Test/Method.php
index 7fc250baa1e95bf19cf7db89a76e7765618b33e6..277998649ffaa76d060c0db6e6c928ecda2cd128 100644
--- a/core/vendor/twig/twig/lib/Twig/Test/Method.php
+++ b/core/vendor/twig/twig/lib/Twig/Test/Method.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
+
 /**
  * Represents a method template test.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Test/Node.php b/core/vendor/twig/twig/lib/Twig/Test/Node.php
index cdf0b24ac2dbae9d9f8b9a798cb9a9d5cf8cd877..baef49cce89b717b66b55dfb7c21b073287713e9 100644
--- a/core/vendor/twig/twig/lib/Twig/Test/Node.php
+++ b/core/vendor/twig/twig/lib/Twig/Test/Node.php
@@ -9,6 +9,8 @@
  * file that was distributed with this source code.
  */
 
+@trigger_error('The Twig_Test_Node class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
+
 /**
  * Represents a template test as a Node.
  *
diff --git a/core/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php b/core/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
index bf865211bbfb8893565dfdbb07c894191df4d1ad..908ef619616d7a92cafbb0da2afd3b2884b6a30f 100644
--- a/core/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
+++ b/core/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
@@ -35,7 +35,7 @@ protected function getCompiler(Twig_Environment $environment = null)
 
     protected function getEnvironment()
     {
-        return new Twig_Environment();
+        return new Twig_Environment(new Twig_Loader_Array(array()));
     }
 
     protected function getVariableGetter($name, $line = false)
diff --git a/core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php b/core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php
index 27560288391dc218e3e70c37ab8da34dd7878bd2..a8a3d7aa161d245cde41e7515774558f1acc4e7d 100644
--- a/core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php
+++ b/core/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php
@@ -57,6 +57,8 @@ public function parse(Twig_Token $token)
             }
 
             if ($compat && $stream->test(Twig_Token::NAME_TYPE)) {
+                @trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated.', E_USER_DEPRECATED);
+
                 if (false === $value) {
                     throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename());
                 }
diff --git a/core/vendor/twig/twig/lib/Twig/TokenParserBroker.php b/core/vendor/twig/twig/lib/Twig/TokenParserBroker.php
index 4a9cb5c6991c0df5a3b653f6a79f2da3d29820dc..6ca73fb38a1a7a7ba6b94ce12f99d834f494d5d2 100644
--- a/core/vendor/twig/twig/lib/Twig/TokenParserBroker.php
+++ b/core/vendor/twig/twig/lib/Twig/TokenParserBroker.php
@@ -29,8 +29,12 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
      * @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances
      * @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances
      */
-    public function __construct($parsers = array(), $brokers = array())
+    public function __construct($parsers = array(), $brokers = array(), $triggerDeprecationError = true)
     {
+        if ($triggerDeprecationError) {
+            @trigger_error('The '.__CLASS__.' class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
+        }
+
         foreach ($parsers as $parser) {
             if (!$parser instanceof Twig_TokenParserInterface) {
                 throw new LogicException('$parsers must a an array of Twig_TokenParserInterface');
diff --git a/core/vendor/twig/twig/lib/Twig/TokenStream.php b/core/vendor/twig/twig/lib/Twig/TokenStream.php
index 89d2575a8c388713c335c4bf73db43b42f16be9d..8d2e220fe3863e5e0b5705b36784e6d6237e818f 100644
--- a/core/vendor/twig/twig/lib/Twig/TokenStream.php
+++ b/core/vendor/twig/twig/lib/Twig/TokenStream.php
@@ -18,7 +18,7 @@
 class Twig_TokenStream
 {
     protected $tokens;
-    protected $current;
+    protected $current = 0;
     protected $filename;
 
     /**
@@ -30,7 +30,6 @@ class Twig_TokenStream
     public function __construct(array $tokens, $filename = null)
     {
         $this->tokens = $tokens;
-        $this->current = 0;
         $this->filename = $filename;
     }
 
diff --git a/core/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php b/core/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php
new file mode 100644
index 0000000000000000000000000000000000000000..e406f0aa71f871e5003f582876a7bc038ac43f8a
--- /dev/null
+++ b/core/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php
@@ -0,0 +1,82 @@
+<?php
+
+/*
+ * This file is part of Twig.
+ *
+ * (c) Fabien Potencier
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class Twig_Util_DeprecationCollector
+{
+    private $twig;
+    private $deprecations;
+
+    public function __construct(Twig_Environment $twig)
+    {
+        $this->twig = $twig;
+    }
+
+    /**
+     * Returns deprecations for templates contained in a directory.
+     *
+     * @param string $dir A directory where templates are stored
+     * @param string $ext Limit the loaded templates by extension
+     *
+     * @return array() An array of deprecations
+     */
+    public function collectDir($dir, $ext = '.twig')
+    {
+        $iterator = new RegexIterator(
+            new RecursiveIteratorIterator(
+                new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY
+            ), '{'.preg_quote($ext).'$}'
+        );
+
+        return $this->collect(new Twig_Util_TemplateDirIterator($iterator));
+    }
+
+    /**
+     * Returns deprecations for passed templates.
+     *
+     * @param Iterator $iterator An iterator of templates (where keys are template names and values the contents of the template)
+     *
+     * @return array() An array of deprecations
+     */
+    public function collect(Iterator $iterator)
+    {
+        $this->deprecations = array();
+
+        set_error_handler(array($this, 'errorHandler'));
+
+        foreach ($iterator as $name => $contents) {
+            try {
+                $this->twig->parse($this->twig->tokenize($contents, $name));
+            } catch (Twig_Error_Syntax $e) {
+                // ignore templates containing syntax errors
+            }
+        }
+
+        restore_error_handler();
+
+        $deprecations = $this->deprecations;
+        $this->deprecations = array();
+
+        return $deprecations;
+    }
+
+    /**
+     * @internal
+     */
+    public function errorHandler($type, $msg)
+    {
+        if (E_USER_DEPRECATED === $type) {
+            $this->deprecations[] = $msg;
+        }
+    }
+}
diff --git a/core/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php b/core/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php
new file mode 100644
index 0000000000000000000000000000000000000000..3fb8932780df68cfca80c2d3de7a67714e441916
--- /dev/null
+++ b/core/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php
@@ -0,0 +1,26 @@
+<?php
+
+/*
+ * This file is part of Twig.
+ *
+ * (c) Fabien Potencier
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class Twig_Util_TemplateDirIterator extends IteratorIterator
+{
+    public function current()
+    {
+        return file_get_contents(parent::current());
+    }
+
+    public function key()
+    {
+        return (string) parent::key();
+    }
+}
diff --git a/core/vendor/twig/twig/phpunit.xml.dist b/core/vendor/twig/twig/phpunit.xml.dist
index 6c5046f11e5bdcc68bf5229a60ea22064186a8b0..6f6d1d25a5fa64692c52b775c3e3fbcc56823aa4 100644
--- a/core/vendor/twig/twig/phpunit.xml.dist
+++ b/core/vendor/twig/twig/phpunit.xml.dist
@@ -9,7 +9,7 @@
          processIsolation="false"
          stopOnFailure="false"
          syntaxCheck="false"
-         bootstrap="test/bootstrap.php"
+         bootstrap="vendor/autoload.php"
 >
   <testsuites>
     <testsuite name="Twig Test Suite">
diff --git a/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php b/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php
index c8b7999aafff166a6976bea33cc2b27e27294239..52107c0c174cc155056cd6d3d1d5121abf0459cb 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php
@@ -11,6 +11,9 @@
 
 class Twig_Tests_AutoloaderTest extends PHPUnit_Framework_TestCase
 {
+    /**
+     * @group legacy
+     */
     public function testAutoload()
     {
         $this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig');
diff --git a/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php
index 2c8b445339184d8f6da9c97e3cd78265fad42dff..bc25f117b0754b294e977c5278023a0ed39c5c8c 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/CompilerTest.php
@@ -13,7 +13,7 @@ class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase
 {
     public function testReprNumericValueWithLocale()
     {
-        $compiler = new Twig_Compiler(new Twig_Environment());
+        $compiler = new Twig_Compiler(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
 
         $locale = setlocale(LC_NUMERIC, 0);
         if (false === $locale) {
diff --git a/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php
index f8389eaf448b24275caa7010e7b16b5a40159313..e4bef74f705af96aec8d0b9904af3491f7539a3f 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php
@@ -14,6 +14,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
     /**
      * @expectedException        LogicException
      * @expectedExceptionMessage You must set a loader first.
+     * @group legacy
      */
     public function testRenderNoLoader()
     {
@@ -182,6 +183,9 @@ public function testAddExtension()
         $this->assertEquals('Twig_Tests_EnvironmentTest_NodeVisitor', get_class($visitors[2]));
     }
 
+    /**
+     * @group legacy
+     */
     public function testRemoveExtension()
     {
         $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php
index 8e9b764e5d0de5c0d212bb0372394ea30275ab1a..a4692c267545caced19ba3726ab6d20ea91d9676 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php
@@ -16,7 +16,7 @@ class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase
      */
     public function testRandomFunction($value, $expectedInArray)
     {
-        $env = new Twig_Environment();
+        $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
 
         for ($i = 0; $i < 100; ++$i) {
             $this->assertTrue(in_array(twig_random($env, $value), $expectedInArray, true)); // assertContains() would not consider the type
@@ -62,18 +62,18 @@ public function testRandomFunctionWithoutParameter()
         $max = mt_getrandmax();
 
         for ($i = 0; $i < 100; ++$i) {
-            $val = twig_random(new Twig_Environment());
+            $val = twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
             $this->assertTrue(is_int($val) && $val >= 0 && $val <= $max);
         }
     }
 
     public function testRandomFunctionReturnsAsIs()
     {
-        $this->assertSame('', twig_random(new Twig_Environment(), ''));
-        $this->assertSame('', twig_random(new Twig_Environment(null, array('charset' => null)), ''));
+        $this->assertSame('', twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), ''));
+        $this->assertSame('', twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('charset' => null)), ''));
 
         $instance = new stdClass();
-        $this->assertSame($instance, twig_random(new Twig_Environment(), $instance));
+        $this->assertSame($instance, twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $instance));
     }
 
     /**
@@ -81,7 +81,7 @@ public function testRandomFunctionReturnsAsIs()
      */
     public function testRandomFunctionOfEmptyArrayThrowsException()
     {
-        twig_random(new Twig_Environment(), array());
+        twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), array());
     }
 
     public function testRandomFunctionOnNonUTF8String()
@@ -90,7 +90,7 @@ public function testRandomFunctionOnNonUTF8String()
             $this->markTestSkipped('needs iconv or mbstring');
         }
 
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $twig->setCharset('ISO-8859-1');
 
         $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8');
@@ -106,7 +106,7 @@ public function testReverseFilterOnNonUTF8String()
             $this->markTestSkipped('needs iconv or mbstring');
         }
 
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $twig->setCharset('ISO-8859-1');
 
         $input = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8');
@@ -117,7 +117,7 @@ public function testReverseFilterOnNonUTF8String()
 
     public function testCustomEscaper()
     {
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $twig->getExtension('core')->setEscaper('foo', 'foo_escaper_for_test');
 
         $this->assertEquals('fooUTF-8', twig_escape_filter($twig, 'foo', 'foo'));
@@ -128,12 +128,12 @@ public function testCustomEscaper()
      */
     public function testUnknownCustomEscaper()
     {
-        twig_escape_filter(new Twig_Environment(), 'foo', 'bar');
+        twig_escape_filter(new Twig_Environment($this->getMock('Twig_LoaderInterface')), 'foo', 'bar');
     }
 
     public function testTwigFirst()
     {
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $this->assertEquals('a', twig_first($twig, 'abc'));
         $this->assertEquals(1, twig_first($twig, array(1, 2, 3)));
         $this->assertSame('', twig_first($twig, null));
@@ -142,7 +142,7 @@ public function testTwigFirst()
 
     public function testTwigLast()
     {
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $this->assertEquals('c', twig_last($twig, 'abc'));
         $this->assertEquals(3, twig_last($twig, array(1, 2, 3)));
         $this->assertSame('', twig_last($twig, null));
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php
index 3f62736630b81c20826cbbc5f60a891a5219217e..d21fb231bf1c53f4db068a723e44f538a8abedd8 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php
@@ -163,7 +163,7 @@ public function testSandboxLocallySetForAnInclude()
 
     public function testMacrosInASandbox()
     {
-        $twig = $this->getEnvironment(true, array('autoescape' => true), array('index' => <<<EOF
+        $twig = $this->getEnvironment(true, array('autoescape' => 'html'), array('index' => <<<EOF
 {%- import _self as macros %}
 
 {%- macro test(text) %}<p>{{ text }}</p>{% endmacro %}
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test
new file mode 100644
index 0000000000000000000000000000000000000000..bbf1356e731cd7bcb86453d14e36a32d88ae95c1
--- /dev/null
+++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test
@@ -0,0 +1,11 @@
+--TEST--
+"autoescape" tag accepts an escaping strategy
+--TEMPLATE--
+{% autoescape true js %}{{ var }}{% endautoescape %}
+
+{% autoescape true html %}{{ var }}{% endautoescape %}
+--DATA--
+return array('var' => '<br />"')
+--EXPECT--
+\x3Cbr\x20\x2F\x3E\x22
+&lt;br /&gt;&quot;
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test
index cf8cceef32b1667cc2aaaa444d39d2460d0e0bdb..e496f60818ec6ef40af21d8a3c86a2d95f3f11d6 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test
+++ b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test
@@ -1,10 +1,6 @@
 --TEST--
 "autoescape" tag accepts an escaping strategy
 --TEMPLATE--
-{% autoescape true js %}{{ var }}{% endautoescape %}
-
-{% autoescape true html %}{{ var }}{% endautoescape %}
-
 {% autoescape 'js' %}{{ var }}{% endautoescape %}
 
 {% autoescape 'html' %}{{ var }}{% endautoescape %}
@@ -13,5 +9,3 @@ return array('var' => '<br />"')
 --EXPECT--
 \x3Cbr\x20\x2F\x3E\x22
 &lt;br /&gt;&quot;
-\x3Cbr\x20\x2F\x3E\x22
-&lt;br /&gt;&quot;
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test
similarity index 100%
rename from core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test
rename to core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test
similarity index 100%
rename from core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.test
rename to core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test b/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test
similarity index 100%
rename from core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test
rename to core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test
diff --git a/core/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test b/core/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test
new file mode 100644
index 0000000000000000000000000000000000000000..d9c1d5085169e2b59b9db1716341b1434b58acea
--- /dev/null
+++ b/core/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test
@@ -0,0 +1,8 @@
+--TEST--
+Old test classes usage
+--TEMPLATE--
+{{ 'foo' is multi word ? 'yes' : 'no' }}
+--DATA--
+return array()
+--EXPECT--
+no
diff --git a/core/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php b/core/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..02ec3cb29eb47cc2df1d32640126316447fdc0d7
--- /dev/null
+++ b/core/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php
@@ -0,0 +1,45 @@
+<?php
+
+/*
+ * This file is part of Twig.
+ *
+ * (c) Fabien Potencier
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+class Twig_Tests_LegacyIntegrationTest extends Twig_Test_IntegrationTestCase
+{
+    public function getExtensions()
+    {
+        return array(
+            new LegacyTwigTestExtension(),
+        );
+    }
+
+    public function getFixturesDir()
+    {
+        return dirname(__FILE__).'/LegacyFixtures/';
+    }
+}
+
+class LegacyTwigTestExtension extends Twig_Extension
+{
+    public function getTests()
+    {
+        return array(
+            'multi word' => new Twig_Test_Method($this, 'is_multi_word'),
+        );
+    }
+
+    public function is_multi_word($value)
+    {
+        return false !== strpos($value, ' ');
+    }
+
+    public function getName()
+    {
+        return 'legacy_integration_test';
+    }
+}
diff --git a/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php
index bf602eb07f81e731f2fae62b62f9278084208160..4945d224709553696dbaafffe8f2b445950848db 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php
@@ -14,7 +14,7 @@ public function testNameLabelForTag()
     {
         $template = '{% § %}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
 
         $stream->expect(Twig_Token::BLOCK_START_TYPE);
@@ -25,7 +25,7 @@ public function testNameLabelForFunction()
     {
         $template = '{{ §() }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
 
         $stream->expect(Twig_Token::VAR_START_TYPE);
@@ -42,7 +42,7 @@ public function testBracketsNesting()
 
     protected function countToken($template, $type, $value = null)
     {
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
 
         $count = 0;
@@ -67,7 +67,7 @@ public function testLineDirective()
             ."baz\n"
             ."}}\n";
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
 
         // foo\nbar\n
@@ -87,7 +87,7 @@ public function testLineDirectiveInline()
             ."baz\n"
             ."}}\n";
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
 
         // foo\nbar
@@ -102,17 +102,17 @@ public function testLongComments()
     {
         $template = '{# '.str_repeat('*', 100000).' #}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
 
         // should not throw an exception
     }
 
-    public function testLongRaw()
+    public function testLongVerbatim()
     {
-        $template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}';
+        $template = '{% verbatim %}'.str_repeat('*', 100000).'{% endverbatim %}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
 
         // should not throw an exception
@@ -122,7 +122,7 @@ public function testLongVar()
     {
         $template = '{{ '.str_repeat('x', 100000).' }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
 
         // should not throw an exception
@@ -132,7 +132,7 @@ public function testLongBlock()
     {
         $template = '{% '.str_repeat('x', 100000).' %}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
 
         // should not throw an exception
@@ -142,7 +142,7 @@ public function testBigNumbers()
     {
         $template = '{{ 922337203685477580700 }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->next();
         $node = $stream->next();
@@ -155,7 +155,7 @@ public function testStringWithEscapedDelimiter()
             "{{ 'foo \' bar' }}" => 'foo \' bar',
             '{{ "foo \" bar" }}' => 'foo " bar',
         );
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         foreach ($tests as $template => $expected) {
             $stream = $lexer->tokenize($template);
             $stream->expect(Twig_Token::VAR_START_TYPE);
@@ -167,7 +167,7 @@ public function testStringWithInterpolation()
     {
         $template = 'foo {{ "bar #{ baz + 1 }" }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::TEXT_TYPE, 'foo ');
         $stream->expect(Twig_Token::VAR_START_TYPE);
@@ -184,7 +184,7 @@ public function testStringWithEscapedInterpolation()
     {
         $template = '{{ "bar \#{baz+1}" }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::VAR_START_TYPE);
         $stream->expect(Twig_Token::STRING_TYPE, 'bar #{baz+1}');
@@ -195,7 +195,7 @@ public function testStringWithHash()
     {
         $template = '{{ "bar # baz" }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::VAR_START_TYPE);
         $stream->expect(Twig_Token::STRING_TYPE, 'bar # baz');
@@ -210,7 +210,7 @@ public function testStringWithUnterminatedInterpolation()
     {
         $template = '{{ "bar #{x" }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
     }
 
@@ -218,7 +218,7 @@ public function testStringWithNestedInterpolations()
     {
         $template = '{{ "bar #{ "foo#{bar}" }" }}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::VAR_START_TYPE);
         $stream->expect(Twig_Token::STRING_TYPE, 'bar ');
@@ -235,7 +235,7 @@ public function testStringWithNestedInterpolationsInBlock()
     {
         $template = '{% foo "bar #{ "foo#{bar}" }" %}';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::BLOCK_START_TYPE);
         $stream->expect(Twig_Token::NAME_TYPE, 'foo');
@@ -253,7 +253,7 @@ public function testOperatorEndingWithALetterAtTheEndOfALine()
     {
         $template = "{{ 1 and\n0}}";
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $stream = $lexer->tokenize($template);
         $stream->expect(Twig_Token::VAR_START_TYPE);
         $stream->expect(Twig_Token::NUMBER_TYPE, 1);
@@ -275,7 +275,7 @@ public function testUnterminatedVariable()
 
 ';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
     }
 
@@ -294,7 +294,7 @@ public function testUnterminatedBlock()
 
 ';
 
-        $lexer = new Twig_Lexer(new Twig_Environment());
+        $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $lexer->tokenize($template);
     }
 }
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php
index e822e2fac022cae3b401746ed29be60684916b1b..d5ffb244d7766369a9361813f16f5c60006ef7a7 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php
@@ -25,7 +25,7 @@ public function testConstructor()
 
     public function getTests()
     {
-        $environment = new Twig_Environment();
+        $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $environment->addFilter(new Twig_SimpleFilter('bar', 'bar', array('needs_environment' => true)));
         $environment->addFilter(new Twig_SimpleFilter('barbar', 'twig_tests_filter_barbar', array('needs_context' => true, 'is_variadic' => true)));
 
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php
index 35edfe13bd59ccb516df58197a3987b9c273a0e8..de2e0f8eec68f4cc88384f39a714ca41c7dab6a3 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php
@@ -23,7 +23,7 @@ public function testConstructor()
 
     public function getTests()
     {
-        $environment = new Twig_Environment();
+        $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $environment->addFunction(new Twig_SimpleFunction('foo', 'foo', array()));
         $environment->addFunction(new Twig_SimpleFunction('bar', 'bar', array('needs_environment' => true)));
         $environment->addFunction(new Twig_SimpleFunction('foofoo', 'foofoo', array('needs_context' => true)));
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php
index 905d8ee9b1853a192b0fcefe36410f5cfa4a5f04..8cbb2f764b838b2e7610a960cf30a665191a9954 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php
@@ -21,16 +21,14 @@ public function testConstructor()
     public function getTests()
     {
         $node = new Twig_Node_Expression_Name('foo', 1);
-        $self = new Twig_Node_Expression_Name('_self', 1);
         $context = new Twig_Node_Expression_Name('_context', 1);
 
-        $env = new Twig_Environment(null, array('strict_variables' => true));
-        $env1 = new Twig_Environment(null, array('strict_variables' => false));
+        $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true));
+        $env1 = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => false));
 
         return array(
             array($node, "// line 1\n".(PHP_VERSION_ID >= 50400 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env),
             array($node, $this->getVariableGetter('foo', 1), $env1),
-            array($self, "// line 1\n\$this"),
             array($context, "// line 1\n\$context"),
         );
     }
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php
index 15e3aa960a6129a5b13990f7636566e916a18b0e..b5394bcf42656b8085447bab6efc641d65a0ca47 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php
@@ -1,6 +1,6 @@
 <?php
 
-$env = new Twig_Environment();
+$env = new Twig_Environment(new Twig_Loader_Array(array()));
 $env->addFilter(new Twig_SimpleFilter('anonymous', function () {}));
 
 return $env;
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php
index d2170ed2e3e82dee60ccdc79014731160504ec42..e8f68c7288c32607e219df0a48f193e8c3dacd09 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php
@@ -1,6 +1,6 @@
 <?php
 
-$env = new Twig_Environment();
+$env = new Twig_Environment(new Twig_Loader_Array(array()));
 $env->addFunction(new Twig_SimpleFunction('anonymous', function () {}));
 
 return $env;
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php
index 636628649f392127dba0d19678b8607479cfeb46..9f818bc411aa619e457d000e5565d58f1eef5fd0 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php
@@ -1,6 +1,6 @@
 <?php
 
-$env = new Twig_Environment();
+$env = new Twig_Environment(new Twig_Loader_Array(array()));
 $env->addTest(new Twig_SimpleTest('anonymous', function () {}));
 
 return $env;
diff --git a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php
index 47a6889ac74ba11a2c4e3ea38052f1d20332dc9c..55d3fcbf6dab628bc26e097d50e3c6e505fa5569 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php
@@ -25,7 +25,7 @@ public function testConstructor()
 
     public function getTests()
     {
-        $environment = new Twig_Environment();
+        $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $environment->addTest(new Twig_SimpleTest('barbar', 'twig_tests_test_barbar', array('is_variadic' => true, 'need_context' => true)));
 
         $tests = array();
diff --git a/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php
index a451aae17bdce7818e187ddb19812c94c95ca312..b29dac3115c7b0ce9144d8d253cf1cd9e61e8529 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/ParserTest.php
@@ -31,7 +31,7 @@ public function testUnknownTag()
             new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
             new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
         ));
-        $parser = new Twig_Parser(new Twig_Environment());
+        $parser = new Twig_Parser(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $parser->parse($stream);
     }
 
@@ -94,7 +94,7 @@ public function testFilterBodyNodesWithBOM()
 
     public function testParseIsReentrant()
     {
-        $twig = new Twig_Environment(null, array(
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array(
             'autoescape' => false,
             'optimizations' => 0,
         ));
@@ -120,7 +120,7 @@ public function testParseIsReentrant()
     // see https://github.com/symfony/symfony/issues/4218
     public function testGetVarName()
     {
-        $twig = new Twig_Environment(null, array(
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array(
             'autoescape' => false,
             'optimizations' => 0,
         ));
@@ -137,7 +137,7 @@ public function testGetVarName()
 
     protected function getParser()
     {
-        $parser = new TestParser(new Twig_Environment());
+        $parser = new TestParser(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
         $parser->setParent(new Twig_Node());
         $parser->stream = $this->getMockBuilder('Twig_TokenStream')->disableOriginalConstructor()->getMock();
 
diff --git a/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
index 64b77f5dcafa18810e3229d693ab52a2d8aa95c9..31a844bd70d67ec2084811432b10ac7dd1df5fc9 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
@@ -89,7 +89,7 @@ public function getAttributeExceptions()
      */
     public function testGetAttributeWithSandbox($object, $item, $allowed, $useExt)
     {
-        $twig = new Twig_Environment();
+        $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
         $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(/*method*/), array(/*prop*/), array());
         $twig->addExtension(new Twig_Extension_Sandbox($policy, !$allowed));
         $template = new Twig_TemplateTest($twig, $useExt);
@@ -133,8 +133,8 @@ public function getGetAttributeWithSandbox()
      */
     public function testGetAttributeWithTemplateAsObject($useExt)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(), $useExt);
-        $template1 = new Twig_TemplateTest(new Twig_Environment(), false);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
+        $template1 = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), false);
 
         $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string'));
         $this->assertEquals('some_string', $template->getAttribute($template1, 'string'));
@@ -173,7 +173,7 @@ public function getGetAttributeWithTemplateAsObject()
     public function testGetAttributeOnArrayWithConfusableKey($useExt = false)
     {
         $template = new Twig_TemplateTest(
-            new Twig_Environment(),
+            new Twig_Environment($this->getMock('Twig_LoaderInterface')),
             $useExt
         );
 
@@ -212,7 +212,7 @@ public function getTestsDependingOnExtensionAvailability()
      */
     public function testGetAttribute($defined, $value, $object, $item, $arguments, $type, $useExt = false)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(), $useExt);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
 
         $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type));
     }
@@ -222,7 +222,7 @@ public function testGetAttribute($defined, $value, $object, $item, $arguments, $
      */
     public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(null, array('strict_variables' => true)), $useExt);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt);
 
         if ($defined) {
             $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type));
@@ -244,7 +244,7 @@ public function testGetAttributeStrict($defined, $value, $object, $item, $argume
      */
     public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type, $useExt = false)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(), $useExt);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
 
         $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true));
     }
@@ -254,7 +254,7 @@ public function testGetAttributeDefined($defined, $value, $object, $item, $argum
      */
     public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(null, array('strict_variables' => true)), $useExt);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt);
 
         $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true));
     }
@@ -264,7 +264,7 @@ public function testGetAttributeDefinedStrict($defined, $value, $object, $item,
      */
     public function testGetAttributeCallExceptions($useExt = false)
     {
-        $template = new Twig_TemplateTest(new Twig_Environment(), $useExt);
+        $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
 
         $object = new Twig_TemplateMagicMethodExceptionObject();
 
diff --git a/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php
index 98422a59311cc35a9b52a4465b55dffeb4164d62..7b765caee96645f93a7a054a717f8b69ccb339e4 100644
--- a/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php
+++ b/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php
@@ -146,7 +146,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
 
     public function setUp()
     {
-        $this->env = new Twig_Environment();
+        $this->env = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
     }
 
     public function testHtmlEscapingConvertsSpecialChars()