Timber - Version 1.7.0

Version Description

Fixes and improvements - Fixed some issues with animated gif resizing when Imagick isn't available #1653 - Fixed incorrect reporting of depth level in some comments #1648 - Fixed issues with preview permissions #1607 - Fixed issue with image resize in some WPML setups #1625 - Fixes compatability issues with Twig 2.4 (and later) #1641

Download this release

Release Info

Developer jarednova
Plugin Icon 128x128 Timber
Version 1.7.0
Comparing to
See all releases

Code changes from version 1.6.0 to 1.7.0

Files changed (55) hide show
  1. lib/Comment.php +1 -1
  2. lib/Helper.php +11 -5
  3. lib/Image/Operation/Resize.php +12 -10
  4. lib/Loader.php +5 -4
  5. lib/Post.php +3 -3
  6. lib/Twig_Function.php +17 -8
  7. lib/URLHelper.php +1 -1
  8. readme.txt +11 -2
  9. timber-starter-theme/author.php +5 -4
  10. timber-starter-theme/search.php +3 -3
  11. timber.php +1 -1
  12. vendor/autoload.php +1 -1
  13. vendor/composer/autoload_classmap.php +0 -1
  14. vendor/composer/autoload_real.php +3 -3
  15. vendor/composer/installed.json +7 -7
  16. vendor/twig/twig/.travis.yml +1 -2
  17. vendor/twig/twig/CHANGELOG +2 -9
  18. vendor/twig/twig/composer.json +1 -1
  19. vendor/twig/twig/doc/templates.rst +1 -2
  20. vendor/twig/twig/ext/twig/php_twig.h +1 -1
  21. vendor/twig/twig/lib/Twig/Environment.php +5 -25
  22. vendor/twig/twig/lib/Twig/Profiler/Profile.php +0 -6
  23. vendor/twig/twig/lib/Twig/TokenParser/Use.php +0 -2
  24. vendor/twig/twig/phpunit.xml.dist +1 -1
  25. vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php +0 -19
  26. vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php +1 -1
  27. vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php +1 -1
  28. vendor/twig/twig/test/Twig/Tests/CompilerTest.php +1 -1
  29. vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php +1 -1
  30. vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php +1 -1
  31. vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +1 -28
  32. vendor/twig/twig/test/Twig/Tests/ErrorTest.php +1 -1
  33. vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +1 -1
  34. vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +3 -3
  35. vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +1 -1
  36. vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php +1 -1
  37. vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +1 -1
  38. vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php +1 -1
  39. vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test +0 -24
  40. vendor/twig/twig/test/Twig/Tests/LexerTest.php +1 -1
  41. vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +1 -1
  42. vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +1 -1
  43. vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +1 -1
  44. vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +1 -1
  45. vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +1 -1
  46. vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +1 -1
  47. vendor/twig/twig/test/Twig/Tests/ParserTest.php +1 -1
  48. vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php +1 -1
  49. vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php +1 -11
  50. vendor/twig/twig/test/Twig/Tests/TemplateTest.php +1 -1
  51. vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php +1 -1
  52. vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +1 -1
  53. vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php +1 -1
  54. vendor/twig/twig/test/Twig/Tests/escapingTest.php +1 -1
  55. vendor/twig/twig/test/bootstrap.php +21 -0
lib/Comment.php CHANGED
@@ -330,7 +330,7 @@ class Comment extends Core implements CoreInterface {
330
  'add_below' => 'comment',
331
  'respond_id' => 'respond',
332
  'reply_text' => $reply_text,
333
- 'depth' => 1,
334
  'max_depth' => $max_depth,
335
  );
336
 
330
  'add_below' => 'comment',
331
  'respond_id' => 'respond',
332
  'reply_text' => $reply_text,
333
+ 'depth' => $this->depth() + 1,
334
  'max_depth' => $max_depth,
335
  );
336
 
lib/Helper.php CHANGED
@@ -426,16 +426,22 @@ class Helper {
426
  *
427
  * @since 1.5.3
428
  * @ticket #1594
429
- * @param array $array to filter.
430
  * @param string|array $filter to search for.
431
  * @param string $operator to use (AND, NOT, OR).
432
  * @return array
433
  */
434
- public static function filter_array( $array, $filter, $operator = 'AND' ) {
435
- if ( ! is_array($filter) ) {
436
- $filter = array( 'slug' => $filter );
437
  }
438
- return wp_list_filter($array, $filter, $operator);
 
 
 
 
 
 
439
  }
440
 
441
  /* Links, Forms, Etc. Utilities
426
  *
427
  * @since 1.5.3
428
  * @ticket #1594
429
+ * @param array $list to filter.
430
  * @param string|array $filter to search for.
431
  * @param string $operator to use (AND, NOT, OR).
432
  * @return array
433
  */
434
+ public static function filter_array( $list, $args, $operator = 'AND' ) {
435
+ if ( ! is_array($args) ) {
436
+ $args = array( 'slug' => $args );
437
  }
438
+
439
+ if ( ! is_array( $list ) && ! is_a( $list, 'Traversable' ) ) {
440
+ return array();
441
+ }
442
+
443
+ $util = new \WP_List_Util( $list );
444
+ return $util->filter( $args, $operator );
445
  }
446
 
447
  /* Links, Forms, Etc. Utilities
lib/Image/Operation/Resize.php CHANGED
@@ -51,25 +51,29 @@ class Resize extends ImageOperation {
51
  }
52
  $result = $src_filename.'-'.$w.'x'.$h.'-c-'.($this->crop ? $this->crop : 'f'); // Crop will be either user named or f (false)
53
  if ( $src_extension ) {
54
- $result .= '.'.$src_extension;
55
  }
56
  return $result;
57
  }
58
 
59
  /**
60
- * @param string $load_filename
61
- * @param string $save_filename
62
- * @param \WP_Image_Editor $editor
 
 
 
63
  */
64
  protected function run_animated_gif( $load_filename, $save_filename, \WP_Image_Editor $editor ) {
65
  $w = $this->w;
66
  $h = $this->h;
67
- if ( !class_exists('Imagick') ) {
68
- Helper::error_log( 'Can not resize GIF, Imagick is not installed' );
 
69
  }
70
  $image = new \Imagick($load_filename);
71
  $image = $image->coalesceImages();
72
- $crop = self::get_target_sizes($editor);
73
  foreach ( $image as $frame ) {
74
  $frame->cropImage($crop['src_w'], $crop['src_h'], $crop['x'], $crop['y']);
75
  $frame->thumbnailImage($w, $h);
@@ -172,9 +176,7 @@ class Resize extends ImageOperation {
172
  if ( !is_wp_error($image) ) {
173
  //should be resized by gif resizer
174
  if ( ImageHelper::is_animated_gif($load_filename) ) {
175
- //attempt to resize
176
- //return if successful
177
- //proceed if not
178
  $gif = self::run_animated_gif($load_filename, $save_filename, $image);
179
  if ( $gif ) {
180
  return true;
51
  }
52
  $result = $src_filename.'-'.$w.'x'.$h.'-c-'.($this->crop ? $this->crop : 'f'); // Crop will be either user named or f (false)
53
  if ( $src_extension ) {
54
+ $result .= '.' . $src_extension;
55
  }
56
  return $result;
57
  }
58
 
59
  /**
60
+ * Run a resize as animated GIF (if the server supports it)
61
+ *
62
+ * @param string $load_filename the name of the file to resize.
63
+ * @param string $save_filename the desired name of the file to save.
64
+ * @param \WP_Image_Editor $editor the image editor we're using.
65
+ * @return bool
66
  */
67
  protected function run_animated_gif( $load_filename, $save_filename, \WP_Image_Editor $editor ) {
68
  $w = $this->w;
69
  $h = $this->h;
70
+ if ( ! class_exists('Imagick') || ( defined('TEST_NO_IMAGICK') && TEST_NO_IMAGICK ) ) {
71
+ Helper::warn('Cannot resize GIF, Imagick is not installed');
72
+ return false;
73
  }
74
  $image = new \Imagick($load_filename);
75
  $image = $image->coalesceImages();
76
+ $crop = self::get_target_sizes($editor);
77
  foreach ( $image as $frame ) {
78
  $frame->cropImage($crop['src_w'], $crop['src_h'], $crop['x'], $crop['y']);
79
  $frame->thumbnailImage($w, $h);
176
  if ( !is_wp_error($image) ) {
177
  //should be resized by gif resizer
178
  if ( ImageHelper::is_animated_gif($load_filename) ) {
179
+ //attempt to resize, return if successful proceed if not
 
 
180
  $gif = self::run_animated_gif($load_filename, $save_filename, $image);
181
  if ( $gif ) {
182
  return true;
lib/Loader.php CHANGED
@@ -93,14 +93,14 @@ class Loader {
93
  * @return string|bool Name of chosen template, otherwise false.
94
  */
95
  public function choose_template( $templates ) {
96
- // Change $templates into array, if needed
97
  if ( !is_array($templates) ) {
98
  $templates = (array) $templates;
99
  }
100
-
101
  // Get Twig loader
102
  $loader = $this->get_loader();
103
-
104
  // Run through template array
105
  foreach ( $templates as $template ) {
106
  // Use the Twig loader to test for existance
@@ -253,7 +253,8 @@ class Loader {
253
 
254
  $key_generator = new \Timber\Cache\KeyGenerator();
255
  $cache_provider = new \Timber\Cache\WPObjectCacheAdapter($this);
256
- $cache_strategy = new \Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy($cache_provider, $key_generator);
 
257
  $cache_extension = new \Asm89\Twig\CacheExtension\Extension($cache_strategy);
258
 
259
  return $cache_extension;
93
  * @return string|bool Name of chosen template, otherwise false.
94
  */
95
  public function choose_template( $templates ) {
96
+ // Change $templates into array, if needed
97
  if ( !is_array($templates) ) {
98
  $templates = (array) $templates;
99
  }
100
+
101
  // Get Twig loader
102
  $loader = $this->get_loader();
103
+
104
  // Run through template array
105
  foreach ( $templates as $template ) {
106
  // Use the Twig loader to test for existance
253
 
254
  $key_generator = new \Timber\Cache\KeyGenerator();
255
  $cache_provider = new \Timber\Cache\WPObjectCacheAdapter($this);
256
+ $cache_lifetime = apply_filters('timber/cache/extension/lifetime', 0);
257
+ $cache_strategy = new \Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy($cache_provider, $key_generator, $cache_lifetime);
258
  $cache_extension = new \Asm89\Twig\CacheExtension\Extension($cache_strategy);
259
 
260
  return $cache_extension;
lib/Post.php CHANGED
@@ -264,17 +264,17 @@ class Post extends Core implements CoreInterface {
264
 
265
  protected function get_post_preview_id( $query ) {
266
  $can = array(
267
- 'edit_'.$query->queried_object->post_type.'s',
268
  );
269
 
270
  if ( $query->queried_object->author_id !== get_current_user_id() ) {
271
- $can[] = 'edit_others_'.$query->queried_object->post_type.'s';
272
  }
273
 
274
  $can_preview = array();
275
 
276
  foreach ( $can as $type ) {
277
- if ( current_user_can($type) ) {
278
  $can_preview[] = true;
279
  }
280
  }
264
 
265
  protected function get_post_preview_id( $query ) {
266
  $can = array(
267
+ get_post_type_object($query->queried_object->post_type)->cap->edit_post,
268
  );
269
 
270
  if ( $query->queried_object->author_id !== get_current_user_id() ) {
271
+ $can[] = get_post_type_object($query->queried_object->post_type)->cap->edit_others_posts;
272
  }
273
 
274
  $can_preview = array();
275
 
276
  foreach ( $can as $type ) {
277
+ if ( current_user_can($type, $query->queried_object_id) ) {
278
  $can_preview[] = true;
279
  }
280
  }
lib/Twig_Function.php CHANGED
@@ -3,15 +3,24 @@
3
  namespace Timber;
4
 
5
  /**
6
- * Temporary fix for conflicts between Twig_Function and Twig_SimpleFunction
7
- * in different versions of Twig (1.* and 2.*)
8
- */
9
- if ( version_compare(\Twig_Environment::VERSION, '2.0.0', '>=') ) {
 
 
 
10
 
11
- class Twig_Function extends \Twig_Function { }
 
 
 
 
 
 
12
 
13
  } else {
14
 
15
- class Twig_Function extends \Twig_SimpleFunction { }
16
-
17
- }
3
  namespace Timber;
4
 
5
  /**
6
+ * Handle TwigFunction among Twig versions
7
+ *
8
+ * From Twig 2.4.0, extending Twig_Function is deprecated, will be final in 3.0
9
+ * @ticket #1641
10
+ * Temporary fix for conflicts between Twig_Function and Twig_SimpleFunction
11
+ * in different versions of Twig (1.* and 2.*)
12
+ */
13
 
14
+ if ( version_compare(\Twig_Environment::VERSION, '2.4.0', '>=') ) {
15
+
16
+ class_alias('\Twig\TwigFunction', '\Timber\Twig_Function');
17
+
18
+ } elseif ( version_compare(\Twig_Environment::VERSION, '2.0.0', '>=') ) {
19
+
20
+ class Twig_Function extends \Twig_Function { }
21
 
22
  } else {
23
 
24
+ class Twig_Function extends \Twig_SimpleFunction { }
25
+
26
+ }
lib/URLHelper.php CHANGED
@@ -168,7 +168,7 @@ class URLHelper {
168
  */
169
  public static function file_system_to_url( $fs ) {
170
  $relative_path = self::get_rel_path($fs);
171
- $home = home_url('/'.$relative_path);
172
  $home = apply_filters('timber/URLHelper/file_system_to_url', $home);
173
  return $home;
174
  }
168
  */
169
  public static function file_system_to_url( $fs ) {
170
  $relative_path = self::get_rel_path($fs);
171
+ $home = site_url('/'.$relative_path);
172
  $home = apply_filters('timber/URLHelper/file_system_to_url', $home);
173
  return $home;
174
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Timber ===
2
  Contributors: jarednova, connorjburton, lggorman
3
  Tags: template engine, templates, twig
4
- Requires at least: 3.7
5
- Stable tag: 1.6.0
6
  Tested up to: 4.9.1
 
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -36,6 +36,15 @@ _Twig is the template language powering Timber; if you need a little background
36
  **Changes for Theme Developers**
37
  - Please add any usage changes here so theme developers are informed of changes.
38
 
 
 
 
 
 
 
 
 
 
39
  = 1.6.0 =
40
  **Changes for Theme Developers**
41
  - You can now easily access all of a MenuItem's master object properties through `{{ item.master_object }}` What's a master object? It's when a Menu Item has been created directly from a Post or Term in the WP Admin #1577 #1572
1
  === Timber ===
2
  Contributors: jarednova, connorjburton, lggorman
3
  Tags: template engine, templates, twig
4
+ Requires at least: 4.7.9
 
5
  Tested up to: 4.9.1
6
+ Stable tag: 1.7.0
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
36
  **Changes for Theme Developers**
37
  - Please add any usage changes here so theme developers are informed of changes.
38
 
39
+ = 1.7.0 =
40
+ **Fixes and improvements**
41
+ - Fixed some issues with animated gif resizing when Imagick isn't available #1653
42
+ - Fixed incorrect reporting of depth level in some comments #1648
43
+ - Fixed issues with preview permissions #1607
44
+ - Fixed issue with image resize in some WPML setups #1625
45
+ - Fixes compatability issues with Twig 2.4 (and later) #1641
46
+
47
+
48
  = 1.6.0 =
49
  **Changes for Theme Developers**
50
  - You can now easily access all of a MenuItem's master object properties through `{{ item.master_object }}` What's a master object? It's when a Menu Item has been created directly from a Post or Term in the WP Admin #1577 #1572
timber-starter-theme/author.php CHANGED
@@ -8,13 +8,14 @@
8
  * @subpackage Timber
9
  * @since Timber 0.1
10
  */
 
11
  global $wp_query;
12
 
13
- $context = Timber::get_context();
14
- $context['posts'] = Timber::get_posts();
15
  if ( isset( $wp_query->query_vars['author'] ) ) {
16
- $author = new TimberUser( $wp_query->query_vars['author'] );
17
  $context['author'] = $author;
18
- $context['title'] = 'Author Archives: ' . $author->name();
19
  }
20
  Timber::render( array( 'author.twig', 'archive.twig' ), $context );
8
  * @subpackage Timber
9
  * @since Timber 0.1
10
  */
11
+
12
  global $wp_query;
13
 
14
+ $context = Timber::get_context();
15
+ $context['posts'] = new Timber\PostQuery();
16
  if ( isset( $wp_query->query_vars['author'] ) ) {
17
+ $author = new Timber\User( $wp_query->query_vars['author'] );
18
  $context['author'] = $author;
19
+ $context['title'] = 'Author Archives: ' . $author->name();
20
  }
21
  Timber::render( array( 'author.twig', 'archive.twig' ), $context );
timber-starter-theme/search.php CHANGED
@@ -10,9 +10,9 @@
10
  */
11
 
12
  $templates = array( 'search.twig', 'archive.twig', 'index.twig' );
13
- $context = Timber::get_context();
14
 
15
- $context['title'] = 'Search results for '. get_search_query();
16
- $context['posts'] = Timber::get_posts();
 
17
 
18
  Timber::render( $templates, $context );
10
  */
11
 
12
  $templates = array( 'search.twig', 'archive.twig', 'index.twig' );
 
13
 
14
+ $context = Timber::get_context();
15
+ $context['title'] = 'Search results for ' . get_search_query();
16
+ $context['posts'] = new Timber\PostQuery();
17
 
18
  Timber::render( $templates, $context );
timber.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Timber
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: http://timber.upstatement.com
6
  Author: Jared Novack + Upstatement
7
- Version: 1.6.0
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: http://timber.upstatement.com
6
  Author: Jared Novack + Upstatement
7
+ Version: 1.7.0
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitf91e73dd1d6a11b3b8b379524fdab64c::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInite2f66f93b9f4fefc2ad5216aefbb2791::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -183,7 +183,6 @@ return array(
183
  'Twig\\Extension\\InitRuntimeInterface' => $vendorDir . '/twig/twig/src/Extension/InitRuntimeInterface.php',
184
  'Twig\\Extension\\OptimizerExtension' => $vendorDir . '/twig/twig/src/Extension/OptimizerExtension.php',
185
  'Twig\\Extension\\ProfilerExtension' => $vendorDir . '/twig/twig/src/Extension/ProfilerExtension.php',
186
- 'Twig\\Extension\\RuntimeExtensionInterface' => $vendorDir . '/twig/twig/src/Extension/RuntimeExtensionInterface.php',
187
  'Twig\\Extension\\SandboxExtension' => $vendorDir . '/twig/twig/src/Extension/SandboxExtension.php',
188
  'Twig\\Extension\\StagingExtension' => $vendorDir . '/twig/twig/src/Extension/StagingExtension.php',
189
  'Twig\\Extension\\StringLoaderExtension' => $vendorDir . '/twig/twig/src/Extension/StringLoaderExtension.php',
183
  'Twig\\Extension\\InitRuntimeInterface' => $vendorDir . '/twig/twig/src/Extension/InitRuntimeInterface.php',
184
  'Twig\\Extension\\OptimizerExtension' => $vendorDir . '/twig/twig/src/Extension/OptimizerExtension.php',
185
  'Twig\\Extension\\ProfilerExtension' => $vendorDir . '/twig/twig/src/Extension/ProfilerExtension.php',
 
186
  'Twig\\Extension\\SandboxExtension' => $vendorDir . '/twig/twig/src/Extension/SandboxExtension.php',
187
  'Twig\\Extension\\StagingExtension' => $vendorDir . '/twig/twig/src/Extension/StagingExtension.php',
188
  'Twig\\Extension\\StringLoaderExtension' => $vendorDir . '/twig/twig/src/Extension/StringLoaderExtension.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitf91e73dd1d6a11b3b8b379524fdab64c
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitf91e73dd1d6a11b3b8b379524fdab64c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitf91e73dd1d6a11b3b8b379524fdab64c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitf91e73dd1d6a11b3b8b379524fdab64c', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInite2f66f93b9f4fefc2ad5216aefbb2791
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInite2f66f93b9f4fefc2ad5216aefbb2791', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite2f66f93b9f4fefc2ad5216aefbb2791', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
vendor/composer/installed.json CHANGED
@@ -123,17 +123,17 @@
123
  },
124
  {
125
  "name": "twig/twig",
126
- "version": "v1.35.0",
127
- "version_normalized": "1.35.0.0",
128
  "source": {
129
  "type": "git",
130
  "url": "https://github.com/twigphp/Twig.git",
131
- "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f"
132
  },
133
  "dist": {
134
  "type": "zip",
135
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f",
136
- "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f",
137
  "shasum": ""
138
  },
139
  "require": {
@@ -144,11 +144,11 @@
144
  "symfony/debug": "~2.7",
145
  "symfony/phpunit-bridge": "~3.3@dev"
146
  },
147
- "time": "2017-09-27 18:06:46",
148
  "type": "library",
149
  "extra": {
150
  "branch-alias": {
151
- "dev-master": "1.35-dev"
152
  }
153
  },
154
  "installation-source": "dist",
123
  },
124
  {
125
  "name": "twig/twig",
126
+ "version": "v1.34.4",
127
+ "version_normalized": "1.34.4.0",
128
  "source": {
129
  "type": "git",
130
  "url": "https://github.com/twigphp/Twig.git",
131
+ "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee"
132
  },
133
  "dist": {
134
  "type": "zip",
135
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/f878bab48edb66ad9c6ed626bf817f60c6c096ee",
136
+ "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee",
137
  "shasum": ""
138
  },
139
  "require": {
144
  "symfony/debug": "~2.7",
145
  "symfony/phpunit-bridge": "~3.3@dev"
146
  },
147
+ "time": "2017-07-04 13:19:31",
148
  "type": "library",
149
  "extra": {
150
  "branch-alias": {
151
+ "dev-master": "1.34-dev"
152
  }
153
  },
154
  "installation-source": "dist",
vendor/twig/twig/.travis.yml CHANGED
@@ -21,8 +21,7 @@ env:
21
  - TWIG_EXT=yes
22
 
23
  before_install:
24
- # turn off XDebug
25
- - phpenv config-rm xdebug.ini || return 0
26
 
27
  install:
28
  - travis_retry composer install
21
  - TWIG_EXT=yes
22
 
23
  before_install:
24
+ - phpenv config-rm xdebug.ini
 
25
 
26
  install:
27
  - travis_retry composer install
vendor/twig/twig/CHANGELOG CHANGED
@@ -1,10 +1,3 @@
1
- * 1.35.0 (2017-09-27)
2
-
3
- * added Twig_Profiler_Profile::reset()
4
- * fixed use TokenParser to return an empty Node
5
- * added RuntimeExtensionInterface
6
- * added circular reference detection when loading templates
7
-
8
  * 1.34.4 (2017-07-04)
9
 
10
  * added support for runtime loaders in IntegrationTestCase
@@ -149,7 +142,7 @@
149
 
150
  * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
151
  * fixed support for PHP7 (Throwable support)
152
- * marked the following methods as being internals on Twig_Environment:
153
  getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
154
  getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
155
  getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
@@ -233,7 +226,7 @@
233
  * fixed limited RCEs when in sandbox mode
234
  * deprecated Twig_Template::getEnvironment()
235
  * deprecated the _self variable for usage outside of the from and import tags
236
- * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
237
  between 1.x and 2.x
238
 
239
  * 1.19.0 (2015-07-31)
 
 
 
 
 
 
 
1
  * 1.34.4 (2017-07-04)
2
 
3
  * added support for runtime loaders in IntegrationTestCase
142
 
143
  * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
144
  * fixed support for PHP7 (Throwable support)
145
+ * marked the following methods as being internals on Twig_Environment:
146
  getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
147
  getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
148
  getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
226
  * fixed limited RCEs when in sandbox mode
227
  * deprecated Twig_Template::getEnvironment()
228
  * deprecated the _self variable for usage outside of the from and import tags
229
+ * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
230
  between 1.x and 2.x
231
 
232
  * 1.19.0 (2015-07-31)
vendor/twig/twig/composer.json CHANGED
@@ -44,7 +44,7 @@
44
  },
45
  "extra": {
46
  "branch-alias": {
47
- "dev-master": "1.35-dev"
48
  }
49
  }
50
  }
44
  },
45
  "extra": {
46
  "branch-alias": {
47
+ "dev-master": "1.34-dev"
48
  }
49
  }
50
  }
vendor/twig/twig/doc/templates.rst CHANGED
@@ -611,8 +611,7 @@ exist:
611
  { 2: 'foo', 4: 'bar' }
612
 
613
  {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #}
614
- {% set foo = 'foo' %}
615
- { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' }
616
 
617
  * ``true`` / ``false``: ``true`` represents the true value, ``false``
618
  represents the false value.
611
  { 2: 'foo', 4: 'bar' }
612
 
613
  {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #}
614
+ { (1 + 1): 'foo', (a ~ 'b'): 'bar' }
 
615
 
616
  * ``true`` / ``false``: ``true`` represents the true value, ``false``
617
  represents the false value.
vendor/twig/twig/ext/twig/php_twig.h CHANGED
@@ -15,7 +15,7 @@
15
  #ifndef PHP_TWIG_H
16
  #define PHP_TWIG_H
17
 
18
- #define PHP_TWIG_VERSION "1.35.0"
19
 
20
  #include "php.h"
21
 
15
  #ifndef PHP_TWIG_H
16
  #define PHP_TWIG_H
17
 
18
+ #define PHP_TWIG_VERSION "1.34.4"
19
 
20
  #include "php.h"
21
 
vendor/twig/twig/lib/Twig/Environment.php CHANGED
@@ -16,11 +16,11 @@
16
  */
17
  class Twig_Environment
18
  {
19
- const VERSION = '1.35.0';
20
- const VERSION_ID = 13500;
21
  const MAJOR_VERSION = 1;
22
- const MINOR_VERSION = 35;
23
- const RELEASE_VERSION = 0;
24
  const EXTRA_VERSION = '';
25
 
26
  protected $charset;
@@ -58,7 +58,6 @@ class Twig_Environment
58
  private $runtimeLoaders = array();
59
  private $runtimes = array();
60
  private $optionsHash;
61
- private $loading = array();
62
 
63
  /**
64
  * Constructor.
@@ -383,10 +382,6 @@ class Twig_Environment
383
  *
384
  * @param string|Twig_TemplateWrapper|Twig_Template $name The template name
385
  *
386
- * @throws Twig_Error_Loader When the template cannot be found
387
- * @throws Twig_Error_Runtime When a previously generated cache is corrupted
388
- * @throws Twig_Error_Syntax When an error occurred during compilation
389
- *
390
  * @return Twig_TemplateWrapper
391
  */
392
  public function load($name)
@@ -477,22 +472,7 @@ class Twig_Environment
477
  $this->initRuntime();
478
  }
479
 
480
- if (isset($this->loading[$cls])) {
481
- throw new Twig_Error_Runtime(sprintf('Circular reference detected for Twig template "%s", path: %s.', $name, implode(' -> ', array_merge($this->loading, array($name)))));
482
- }
483
-
484
- $this->loading[$cls] = $name;
485
-
486
- try {
487
- $this->loadedTemplates[$cls] = new $cls($this);
488
- unset($this->loading[$cls]);
489
- } catch (\Exception $e) {
490
- unset($this->loading[$cls]);
491
-
492
- throw $e;
493
- }
494
-
495
- return $this->loadedTemplates[$cls];
496
  }
497
 
498
  /**
16
  */
17
  class Twig_Environment
18
  {
19
+ const VERSION = '1.34.4';
20
+ const VERSION_ID = 13404;
21
  const MAJOR_VERSION = 1;
22
+ const MINOR_VERSION = 34;
23
+ const RELEASE_VERSION = 4;
24
  const EXTRA_VERSION = '';
25
 
26
  protected $charset;
58
  private $runtimeLoaders = array();
59
  private $runtimes = array();
60
  private $optionsHash;
 
61
 
62
  /**
63
  * Constructor.
382
  *
383
  * @param string|Twig_TemplateWrapper|Twig_Template $name The template name
384
  *
 
 
 
 
385
  * @return Twig_TemplateWrapper
386
  */
387
  public function load($name)
472
  $this->initRuntime();
473
  }
474
 
475
+ return $this->loadedTemplates[$cls] = new $cls($this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  }
477
 
478
  /**
vendor/twig/twig/lib/Twig/Profiler/Profile.php CHANGED
@@ -145,12 +145,6 @@ class Twig_Profiler_Profile implements IteratorAggregate, Serializable
145
  );
146
  }
147
 
148
- public function reset()
149
- {
150
- $this->starts = $this->ends = $this->profiles = array();
151
- $this->enter();
152
- }
153
-
154
  public function getIterator()
155
  {
156
  return new ArrayIterator($this->profiles);
145
  );
146
  }
147
 
 
 
 
 
 
 
148
  public function getIterator()
149
  {
150
  return new ArrayIterator($this->profiles);
vendor/twig/twig/lib/Twig/TokenParser/Use.php CHANGED
@@ -57,8 +57,6 @@ class Twig_TokenParser_Use extends Twig_TokenParser
57
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
58
 
59
  $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
60
-
61
- return new Twig_Node();
62
  }
63
 
64
  public function getTag()
57
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
58
 
59
  $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
 
 
60
  }
61
 
62
  public function getTag()
vendor/twig/twig/phpunit.xml.dist CHANGED
@@ -9,7 +9,7 @@
9
  processIsolation="false"
10
  stopOnFailure="false"
11
  syntaxCheck="false"
12
- bootstrap="vendor/autoload.php"
13
  >
14
  <testsuites>
15
  <testsuite name="Twig Test Suite">
9
  processIsolation="false"
10
  stopOnFailure="false"
11
  syntaxCheck="false"
12
+ bootstrap="test/bootstrap.php"
13
  >
14
  <testsuites>
15
  <testsuite name="Twig Test Suite">
vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Extension;
13
-
14
- /**
15
- * @author Grégoire Pineau <lyrixx@lyrixx.info>
16
- */
17
- interface RuntimeExtensionInterface
18
- {
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_AutoloaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_AutoloaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(dirname(__FILE__)).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_Cache_FilesystemTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $classname;
17
  private $directory;
11
 
12
  require_once dirname(dirname(__FILE__)).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_Cache_FilesystemTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $classname;
17
  private $directory;
vendor/twig/twig/test/Twig/Tests/CompilerTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_CompilerTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testReprNumericValueWithLocale()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testReprNumericValueWithLocale()
15
  {
vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ContainerRuntimeLoaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ContainerRuntimeLoaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class CustomExtensionTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class CustomExtensionTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $deprecations = array();
17
 
@@ -480,33 +480,6 @@ EOF
480
  $this->assertEquals('foo', $twig->render('func_string_named_args'));
481
  }
482
 
483
- /**
484
- * @expectedException Twig_Error_Runtime
485
- * @expectedExceptionMessage Circular reference detected for Twig template "base.html.twig", path: base.html.twig -> base.html.twig in "base.html.twig" at line 1
486
- */
487
- public function testFailLoadTemplateOnCircularReference()
488
- {
489
- $twig = new Twig_Environment(new Twig_Loader_Array(array(
490
- 'base.html.twig' => '{% extends "base.html.twig" %}',
491
- )));
492
-
493
- $twig->loadTemplate('base.html.twig');
494
- }
495
-
496
- /**
497
- * @expectedException Twig_Error_Runtime
498
- * @expectedExceptionMessage Circular reference detected for Twig template "base1.html.twig", path: base1.html.twig -> base2.html.twig -> base1.html.twig in "base1.html.twig" at line 1
499
- */
500
- public function testFailLoadTemplateOnComplexCircularReference()
501
- {
502
- $twig = new Twig_Environment(new Twig_Loader_Array(array(
503
- 'base1.html.twig' => '{% extends "base2.html.twig" %}',
504
- 'base2.html.twig' => '{% extends "base1.html.twig" %}',
505
- )));
506
-
507
- $twig->loadTemplate('base1.html.twig');
508
- }
509
-
510
  protected function getMockLoader($templateName, $templateContent)
511
  {
512
  // to be removed in 2.0
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $deprecations = array();
17
 
480
  $this->assertEquals('foo', $twig->render('func_string_named_args'));
481
  }
482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  protected function getMockLoader($templateName, $templateContent)
484
  {
485
  // to be removed in 2.0
vendor/twig/twig/test/Twig/Tests/ErrorTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ErrorTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testErrorWithObjectFilename()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testErrorWithObjectFilename()
15
  {
vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ExpressionParserTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @expectedException Twig_Error_Syntax
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @expectedException Twig_Error_Syntax
vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @dataProvider getRandomFunctionTestData
@@ -264,7 +264,7 @@ class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase
264
  array(array(), new CoreTestIterator($i, $keys, true), count($keys) + 10),
265
  array('de', 'abcdef', 3, 2),
266
  array(array(), new SimpleXMLElement('<items><item>1</item><item>2</item></items>'), 3),
267
- array(array(), new ArrayIterator(array(1, 2)), 3),
268
  );
269
  }
270
  }
@@ -344,7 +344,7 @@ final class CoreTestIterator implements Iterator
344
  {
345
  ++$this->position;
346
  if ($this->position === $this->maxPosition) {
347
- throw new LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition));
348
  }
349
  }
350
 
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @dataProvider getRandomFunctionTestData
264
  array(array(), new CoreTestIterator($i, $keys, true), count($keys) + 10),
265
  array('de', 'abcdef', 3, 2),
266
  array(array(), new SimpleXMLElement('<items><item>1</item><item>2</item></items>'), 3),
267
+ array(array(), new ArrayIterator(array(1, 2)), 3)
268
  );
269
  }
270
  }
344
  {
345
  ++$this->position;
346
  if ($this->position === $this->maxPosition) {
347
+ throw new LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition));
348
  }
349
  }
350
 
vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected static $params;
15
  protected static $templates;
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Extension_SandboxTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected static $params;
15
  protected static $templates;
vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testLoad()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_FactoryRuntimeLoaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testLoad()
15
  {
vendor/twig/twig/test/Twig/Tests/FileCachingTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_FileCachingTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $env;
17
  private $tmpDir;
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $env;
17
  private $tmpDir;
vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_FileExtensionEscapingStrategyTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @dataProvider getGuessData
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_FileExtensionEscapingStrategyTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @dataProvider getGuessData
vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test DELETED
@@ -1,24 +0,0 @@
1
- --TEST--
2
- "use" tag with a parent block
3
- --TEMPLATE--
4
- {% extends "parent.twig" %}
5
-
6
- {% use 'blocks.twig' %}
7
-
8
- {% block body %}
9
- {{ parent() -}}
10
- CHILD
11
- {{ block('content') }}
12
- {% endblock %}
13
- --TEMPLATE(parent.twig)--
14
- {% block body %}
15
- PARENT
16
- {% endblock %}
17
- --TEMPLATE(blocks.twig)--
18
- {% block content 'BLOCK' %}
19
- --DATA--
20
- return array()
21
- --EXPECT--
22
- PARENT
23
- CHILD
24
- BLOCK
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/LexerTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_LexerTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @group legacy
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_ArrayTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_ArrayTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_ChainTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_FilesystemTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testGetSourceContext()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testGetSourceContext()
15
  {
vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_NativeExtensionTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testGetArguments()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testGetArguments()
15
  {
vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_NodeVisitor_OptimizerTest extends \PHPUnit\Framework\TestCase
12
  {
13
  public function testRenderBlockOptimizer()
14
  {
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase
12
  {
13
  public function testRenderBlockOptimizer()
14
  {
vendor/twig/twig/test/Twig/Tests/ParserTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_ParserTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @expectedException Twig_Error_Syntax
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @expectedException Twig_Error_Syntax
vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- abstract class Twig_Tests_Profiler_Dumper_AbstractTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected function getProfile()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ abstract class Twig_Tests_Profiler_Dumper_AbstractTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected function getProfile()
15
  {
vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Profiler_ProfileTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testConstructor()
15
  {
@@ -97,14 +97,4 @@ class Twig_Tests_Profiler_ProfileTest extends \PHPUnit\Framework\TestCase
97
  $this->assertEquals($profile1->getType(), $profile3->getType());
98
  $this->assertEquals($profile1->getName(), $profile3->getName());
99
  }
100
-
101
- public function testReset()
102
- {
103
- $profile = new Twig_Profiler_Profile();
104
- usleep(1);
105
- $profile->leave();
106
- $profile->reset();
107
-
108
- $this->assertEquals(0, $profile->getDuration());
109
- }
110
  }
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Profiler_ProfileTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testConstructor()
15
  {
97
  $this->assertEquals($profile1->getType(), $profile3->getType());
98
  $this->assertEquals($profile1->getName(), $profile3->getName());
99
  }
 
 
 
 
 
 
 
 
 
 
100
  }
vendor/twig/twig/test/Twig/Tests/TemplateTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_TemplateTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @expectedException LogicException
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @expectedException LogicException
vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_TemplateWrapperTest extends \PHPUnit\Framework\TestCase
12
  {
13
  public function testHasGetBlocks()
14
  {
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_TemplateWrapperTest extends PHPUnit_Framework_TestCase
12
  {
13
  public function testHasGetBlocks()
14
  {
vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_TokenStreamTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected static $tokens;
15
 
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_TokenStreamTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected static $tokens;
15
 
vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Util_DeprecationCollectorTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Util_DeprecationCollectorTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/escapingTest.php CHANGED
@@ -6,7 +6,7 @@
6
  * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7
  * @license http://framework.zend.com/license/new-bsd New BSD License
8
  */
9
- class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
10
  {
11
  /**
12
  * All character encodings supported by htmlspecialchars().
6
  * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7
  * @license http://framework.zend.com/license/new-bsd New BSD License
8
  */
9
+ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
10
  {
11
  /**
12
  * All character encodings supported by htmlspecialchars().
vendor/twig/twig/test/bootstrap.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Twig.
5
+ *
6
+ * (c) Fabien Potencier
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ if (PHP_VERSION_ID < 50300) {
13
+ require_once dirname(__FILE__).'/../lib/Twig/Autoloader.php';
14
+ Twig_Autoloader::register(true);
15
+ } else {
16
+ require __DIR__.'/../vendor/autoload.php';
17
+
18
+ if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
19
+ class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
20
+ }
21
+ }