Version Description
(2022-08-06) = Changed - YouTube embeds in the lightbox now begin playing automatically, if the browser allows it.
Download this release
Release Info
Developer | Mekku |
Plugin | WP RSS Aggregator |
Version | 4.22 |
Comparing to | |
See all releases |
Code changes from version 4.21.1 to 4.22
- CHANGELOG.md +4 -0
- js/custom.js +10 -7
- readme.txt +8 -3
- src/Twig/Extensions/WpraExtension.php +15 -2
- vendor/composer/autoload_classmap.php +1 -0
- vendor/composer/autoload_real.php +0 -2
- vendor/composer/autoload_static.php +1 -0
- vendor/composer/installed.json +24 -16
- vendor/composer/installed.php +9 -9
- vendor/composer/platform_check.php +0 -26
- vendor/twig/twig/.gitattributes +3 -0
- vendor/twig/twig/.github/workflows/ci.yml +98 -0
- vendor/twig/twig/.github/workflows/documentation.yml +60 -0
- vendor/twig/twig/.gitignore +1 -0
- vendor/twig/twig/{.php_cs.dist → .php-cs-fixer.dist.php} +4 -2
- vendor/twig/twig/LICENSE +20 -24
- vendor/twig/twig/composer.json +9 -5
- vendor/twig/twig/drupal_test.sh +0 -51
- vendor/twig/twig/lib/Twig/Autoloader.php +2 -2
- vendor/twig/twig/lib/Twig/Filter.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Method.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Node.php +1 -1
- vendor/twig/twig/lib/Twig/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Function/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Function/Method.php +1 -1
- vendor/twig/twig/lib/Twig/Function/Node.php +1 -1
- vendor/twig/twig/lib/Twig/Loader/String.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php +1 -1
- vendor/twig/twig/lib/Twig/TemplateInterface.php +3 -3
- vendor/twig/twig/lib/Twig/Test.php +1 -1
- vendor/twig/twig/lib/Twig/Test/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Test/Method.php +6 -1
- vendor/twig/twig/lib/Twig/Test/Node.php +1 -1
- vendor/twig/twig/lib/Twig/TokenParserBroker.php +1 -1
- vendor/twig/twig/src/Cache/FilesystemCache.php +3 -3
- vendor/twig/twig/src/Compiler.php +6 -6
- vendor/twig/twig/src/Environment.php +42 -42
- vendor/twig/twig/src/Error/Error.php +6 -6
- vendor/twig/twig/src/ExpressionParser.php +28 -12
- vendor/twig/twig/src/Extension/AbstractExtension.php +1 -1
- vendor/twig/twig/src/Extension/CoreExtension.php +72 -32
- vendor/twig/twig/src/Extension/EscaperExtension.php +2 -2
- vendor/twig/twig/src/Extension/ProfilerExtension.php +1 -1
- vendor/twig/twig/src/Extension/StagingExtension.php +4 -4
- vendor/twig/twig/src/FileExtensionEscapingStrategy.php +1 -1
- vendor/twig/twig/src/Lexer.php +28 -24
- vendor/twig/twig/src/Loader/ArrayLoader.php +1 -1
- vendor/twig/twig/src/Loader/ChainLoader.php +1 -1
- vendor/twig/twig/src/Loader/FilesystemLoader.php +5 -5
- vendor/twig/twig/src/Markup.php +3 -0
- vendor/twig/twig/src/Node/CheckSecurityCallNode.php +28 -0
- vendor/twig/twig/src/Node/CheckSecurityNode.php +9 -4
- vendor/twig/twig/src/Node/EmbedNode.php +1 -1
- vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php +2 -2
- vendor/twig/twig/src/Node/Expression/CallExpression.php +12 -2
- vendor/twig/twig/src/Node/Expression/GetAttrExpression.php +2 -2
- vendor/twig/twig/src/Node/Expression/NameExpression.php +1 -1
- vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +9 -5
- vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php +1 -1
- vendor/twig/twig/src/Node/Expression/Test/OddTest.php +1 -1
- vendor/twig/twig/src/Node/Expression/TestExpression.php +1 -1
- vendor/twig/twig/src/Node/ForNode.php +1 -1
- vendor/twig/twig/src/Node/IfNode.php +1 -1
- vendor/twig/twig/src/Node/IncludeNode.php +1 -1
- vendor/twig/twig/src/Node/MacroNode.php +1 -1
- vendor/twig/twig/src/Node/ModuleNode.php +2 -2
- vendor/twig/twig/src/Node/Node.php +17 -11
- vendor/twig/twig/src/Node/SandboxNode.php +7 -0
- vendor/twig/twig/src/Node/WithNode.php +1 -1
- vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +5 -5
- vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php +3 -1
- vendor/twig/twig/src/Parser.php +6 -6
- vendor/twig/twig/src/Profiler/Profile.php +9 -9
- vendor/twig/twig/src/Sandbox/SecurityPolicy.php +2 -2
- vendor/twig/twig/src/Template.php +13 -15
- vendor/twig/twig/src/Test/IntegrationTestCase.php +3 -3
- vendor/twig/twig/src/Token.php +14 -14
- vendor/twig/twig/src/TokenParser/ApplyTokenParser.php +1 -1
- vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php +1 -1
- vendor/twig/twig/src/TokenStream.php +3 -3
- vendor/twig/twig/src/TwigTest.php +6 -0
- vendor/twig/twig/src/Util/DeprecationCollector.php +1 -1
- wp-rss-aggregator.php +2 -2
CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
|
|
|
|
|
|
|
|
7 |
## [4.21.1] - 2022-07-20
|
8 |
### Fixed
|
9 |
* An out-of-memory PHP error when importing items.
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
7 |
+
## [4.22] - 2022-08-06
|
8 |
+
### Changed
|
9 |
+
* YouTube embeds in the lightbox now begin playing automatically, if the browser allows it.
|
10 |
+
|
11 |
## [4.21.1] - 2022-07-20
|
12 |
### Fixed
|
13 |
* An out-of-memory PHP error when importing items.
|
js/custom.js
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
-
jQuery(
|
2 |
-
if(
|
3 |
-
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
if ($.fn.colorbox) {
|
3 |
+
const links = $('.colorbox')
|
4 |
+
links.colorbox({
|
5 |
+
iframe: true,
|
6 |
+
width: '80%',
|
7 |
+
height: '80%',
|
8 |
+
})
|
9 |
+
}
|
10 |
+
})
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
=== WP RSS Aggregator
|
2 |
Contributors: RebelCode, jeangalea, markzahra, Mekku
|
3 |
Plugin URI: https://www.wprssaggregator.com
|
4 |
Tags: RSS import, RSS aggregator, autoblog, feed to post, news aggregator, rss to post, content curation, feed import, content syndication, rss feeds, podcast feed, youtube
|
5 |
Requires at least: 4.0 or higher
|
6 |
-
Tested up to: 6.
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 4.
|
9 |
License: GPLv3
|
10 |
|
11 |
The most powerful and reliable RSS aggregator for WordPress. Build a news aggregator, autoblog and more in minutes with unlimited RSS feeds.
|
@@ -255,6 +255,10 @@ Our complete Knowledge Base with FAQs can be found [here](https://kb.wprssaggreg
|
|
255 |
|
256 |
== Changelog ==
|
257 |
|
|
|
|
|
|
|
|
|
258 |
= 4.21.1 (2022-07-20) =
|
259 |
**Fixed**
|
260 |
- An out-of-memory PHP error when importing items.
|
@@ -501,3 +505,4 @@ Our complete Knowledge Base with FAQs can be found [here](https://kb.wprssaggreg
|
|
501 |
- Thumbnails imported by Excerpts & Thumbnails were not shown in templates.
|
502 |
- Some databases would report the following error during logging: "Column 'date' cannot be null".
|
503 |
- Unserializing the options for the system info triggered PHP notices.
|
|
1 |
+
=== WP RSS Aggregator - News Feeds, Autoblogging, Youtube Video Feeds and More ===
|
2 |
Contributors: RebelCode, jeangalea, markzahra, Mekku
|
3 |
Plugin URI: https://www.wprssaggregator.com
|
4 |
Tags: RSS import, RSS aggregator, autoblog, feed to post, news aggregator, rss to post, content curation, feed import, content syndication, rss feeds, podcast feed, youtube
|
5 |
Requires at least: 4.0 or higher
|
6 |
+
Tested up to: 6.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 4.22
|
9 |
License: GPLv3
|
10 |
|
11 |
The most powerful and reliable RSS aggregator for WordPress. Build a news aggregator, autoblog and more in minutes with unlimited RSS feeds.
|
255 |
|
256 |
== Changelog ==
|
257 |
|
258 |
+
= 4.22 (2022-08-06) =
|
259 |
+
**Changed**
|
260 |
+
- YouTube embeds in the lightbox now begin playing automatically, if the browser allows it.
|
261 |
+
|
262 |
= 4.21.1 (2022-07-20) =
|
263 |
**Fixed**
|
264 |
- An out-of-memory PHP error when importing items.
|
505 |
- Thumbnails imported by Excerpts & Thumbnails were not shown in templates.
|
506 |
- Some databases would report the following error during logging: "Column 'date' cannot be null".
|
507 |
- Unserializing the options for the system info triggered PHP notices.
|
508 |
+
|
src/Twig/Extensions/WpraExtension.php
CHANGED
@@ -135,8 +135,21 @@ class WpraExtension extends AbstractExtension
|
|
135 |
return '';
|
136 |
}
|
137 |
|
138 |
-
if ($options['link_to_embed']
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
return $item['url'];
|
135 |
return '';
|
136 |
}
|
137 |
|
138 |
+
if ($options['link_to_embed']) {
|
139 |
+
if ($item['is_yt'] && $item['yt_embed_url']) {
|
140 |
+
$embedUrl = $item['yt_embed_url'];
|
141 |
+
$linkBehavior = isset($options['links_open_behavior']) ? $options['links_open_behavior'] : '';
|
142 |
+
|
143 |
+
if ($linkBehavior === 'lightbox') {
|
144 |
+
$embedUrl .= '?autoplay=1';
|
145 |
+
}
|
146 |
+
|
147 |
+
return $embedUrl;
|
148 |
+
}
|
149 |
+
|
150 |
+
if (!empty($item['embed_url'])) {
|
151 |
+
return $item['embed_url'];
|
152 |
+
}
|
153 |
}
|
154 |
|
155 |
return $item['url'];
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -499,6 +499,7 @@ return array(
|
|
499 |
'Twig\\Node\\BlockNode' => $vendorDir . '/twig/twig/src/Node/BlockNode.php',
|
500 |
'Twig\\Node\\BlockReferenceNode' => $vendorDir . '/twig/twig/src/Node/BlockReferenceNode.php',
|
501 |
'Twig\\Node\\BodyNode' => $vendorDir . '/twig/twig/src/Node/BodyNode.php',
|
|
|
502 |
'Twig\\Node\\CheckSecurityNode' => $vendorDir . '/twig/twig/src/Node/CheckSecurityNode.php',
|
503 |
'Twig\\Node\\CheckToStringNode' => $vendorDir . '/twig/twig/src/Node/CheckToStringNode.php',
|
504 |
'Twig\\Node\\DeprecatedNode' => $vendorDir . '/twig/twig/src/Node/DeprecatedNode.php',
|
499 |
'Twig\\Node\\BlockNode' => $vendorDir . '/twig/twig/src/Node/BlockNode.php',
|
500 |
'Twig\\Node\\BlockReferenceNode' => $vendorDir . '/twig/twig/src/Node/BlockReferenceNode.php',
|
501 |
'Twig\\Node\\BodyNode' => $vendorDir . '/twig/twig/src/Node/BodyNode.php',
|
502 |
+
'Twig\\Node\\CheckSecurityCallNode' => $vendorDir . '/twig/twig/src/Node/CheckSecurityCallNode.php',
|
503 |
'Twig\\Node\\CheckSecurityNode' => $vendorDir . '/twig/twig/src/Node/CheckSecurityNode.php',
|
504 |
'Twig\\Node\\CheckToStringNode' => $vendorDir . '/twig/twig/src/Node/CheckToStringNode.php',
|
505 |
'Twig\\Node\\DeprecatedNode' => $vendorDir . '/twig/twig/src/Node/DeprecatedNode.php',
|
vendor/composer/autoload_real.php
CHANGED
@@ -22,8 +22,6 @@ class ComposerAutoloaderInit46c8b76c439f86ad826af1a4d36b4e60
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
require __DIR__ . '/platform_check.php';
|
26 |
-
|
27 |
spl_autoload_register(array('ComposerAutoloaderInit46c8b76c439f86ad826af1a4d36b4e60', 'loadClassLoader'), true, true);
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
spl_autoload_unregister(array('ComposerAutoloaderInit46c8b76c439f86ad826af1a4d36b4e60', 'loadClassLoader'));
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
|
|
|
|
25 |
spl_autoload_register(array('ComposerAutoloaderInit46c8b76c439f86ad826af1a4d36b4e60', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
spl_autoload_unregister(array('ComposerAutoloaderInit46c8b76c439f86ad826af1a4d36b4e60', 'loadClassLoader'));
|
vendor/composer/autoload_static.php
CHANGED
@@ -682,6 +682,7 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
682 |
'Twig\\Node\\BlockNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockNode.php',
|
683 |
'Twig\\Node\\BlockReferenceNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockReferenceNode.php',
|
684 |
'Twig\\Node\\BodyNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BodyNode.php',
|
|
|
685 |
'Twig\\Node\\CheckSecurityNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckSecurityNode.php',
|
686 |
'Twig\\Node\\CheckToStringNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckToStringNode.php',
|
687 |
'Twig\\Node\\DeprecatedNode' => __DIR__ . '/..' . '/twig/twig/src/Node/DeprecatedNode.php',
|
682 |
'Twig\\Node\\BlockNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockNode.php',
|
683 |
'Twig\\Node\\BlockReferenceNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockReferenceNode.php',
|
684 |
'Twig\\Node\\BodyNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BodyNode.php',
|
685 |
+
'Twig\\Node\\CheckSecurityCallNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckSecurityCallNode.php',
|
686 |
'Twig\\Node\\CheckSecurityNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckSecurityNode.php',
|
687 |
'Twig\\Node\\CheckToStringNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckToStringNode.php',
|
688 |
'Twig\\Node\\DeprecatedNode' => __DIR__ . '/..' . '/twig/twig/src/Node/DeprecatedNode.php',
|
vendor/composer/installed.json
CHANGED
@@ -1802,33 +1802,32 @@
|
|
1802 |
},
|
1803 |
{
|
1804 |
"name": "twig/twig",
|
1805 |
-
"version": "v1.
|
1806 |
-
"version_normalized": "1.
|
1807 |
"source": {
|
1808 |
"type": "git",
|
1809 |
"url": "https://github.com/twigphp/Twig.git",
|
1810 |
-
"reference": "
|
1811 |
},
|
1812 |
"dist": {
|
1813 |
"type": "zip",
|
1814 |
-
"url": "https://api.github.com/repos/twigphp/Twig/zipball/
|
1815 |
-
"reference": "
|
1816 |
"shasum": ""
|
1817 |
},
|
1818 |
"require": {
|
1819 |
-
"php": ">=
|
1820 |
"symfony/polyfill-ctype": "^1.8"
|
1821 |
},
|
1822 |
"require-dev": {
|
1823 |
"psr/container": "^1.0",
|
1824 |
-
"symfony/
|
1825 |
-
"symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0"
|
1826 |
},
|
1827 |
-
"time": "
|
1828 |
"type": "library",
|
1829 |
"extra": {
|
1830 |
"branch-alias": {
|
1831 |
-
"dev-master": "1.
|
1832 |
}
|
1833 |
},
|
1834 |
"installation-source": "dist",
|
@@ -1851,15 +1850,14 @@
|
|
1851 |
"homepage": "http://fabien.potencier.org",
|
1852 |
"role": "Lead Developer"
|
1853 |
},
|
|
|
|
|
|
|
|
|
1854 |
{
|
1855 |
"name": "Armin Ronacher",
|
1856 |
"email": "armin.ronacher@active-4.com",
|
1857 |
"role": "Project Founder"
|
1858 |
-
},
|
1859 |
-
{
|
1860 |
-
"name": "Twig Team",
|
1861 |
-
"homepage": "https://twig.symfony.com/contributors",
|
1862 |
-
"role": "Contributors"
|
1863 |
}
|
1864 |
],
|
1865 |
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
@@ -1869,8 +1867,18 @@
|
|
1869 |
],
|
1870 |
"support": {
|
1871 |
"issues": "https://github.com/twigphp/Twig/issues",
|
1872 |
-
"source": "https://github.com/twigphp/Twig/tree/
|
1873 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1874 |
"install-path": "../twig/twig"
|
1875 |
}
|
1876 |
],
|
1802 |
},
|
1803 |
{
|
1804 |
"name": "twig/twig",
|
1805 |
+
"version": "v1.44.6",
|
1806 |
+
"version_normalized": "1.44.6.0",
|
1807 |
"source": {
|
1808 |
"type": "git",
|
1809 |
"url": "https://github.com/twigphp/Twig.git",
|
1810 |
+
"reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3"
|
1811 |
},
|
1812 |
"dist": {
|
1813 |
"type": "zip",
|
1814 |
+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/ae39480f010ef88adc7938503c9b02d3baf2f3b3",
|
1815 |
+
"reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3",
|
1816 |
"shasum": ""
|
1817 |
},
|
1818 |
"require": {
|
1819 |
+
"php": ">=7.2.5",
|
1820 |
"symfony/polyfill-ctype": "^1.8"
|
1821 |
},
|
1822 |
"require-dev": {
|
1823 |
"psr/container": "^1.0",
|
1824 |
+
"symfony/phpunit-bridge": "^4.4.9|^5.0.9"
|
|
|
1825 |
},
|
1826 |
+
"time": "2021-11-25T13:31:46+00:00",
|
1827 |
"type": "library",
|
1828 |
"extra": {
|
1829 |
"branch-alias": {
|
1830 |
+
"dev-master": "1.44-dev"
|
1831 |
}
|
1832 |
},
|
1833 |
"installation-source": "dist",
|
1850 |
"homepage": "http://fabien.potencier.org",
|
1851 |
"role": "Lead Developer"
|
1852 |
},
|
1853 |
+
{
|
1854 |
+
"name": "Twig Team",
|
1855 |
+
"role": "Contributors"
|
1856 |
+
},
|
1857 |
{
|
1858 |
"name": "Armin Ronacher",
|
1859 |
"email": "armin.ronacher@active-4.com",
|
1860 |
"role": "Project Founder"
|
|
|
|
|
|
|
|
|
|
|
1861 |
}
|
1862 |
],
|
1863 |
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
1867 |
],
|
1868 |
"support": {
|
1869 |
"issues": "https://github.com/twigphp/Twig/issues",
|
1870 |
+
"source": "https://github.com/twigphp/Twig/tree/v1.44.6"
|
1871 |
},
|
1872 |
+
"funding": [
|
1873 |
+
{
|
1874 |
+
"url": "https://github.com/fabpot",
|
1875 |
+
"type": "github"
|
1876 |
+
},
|
1877 |
+
{
|
1878 |
+
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
|
1879 |
+
"type": "tidelift"
|
1880 |
+
}
|
1881 |
+
],
|
1882 |
"install-path": "../twig/twig"
|
1883 |
}
|
1884 |
],
|
vendor/composer/installed.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
-
'pretty_version' => 'dev-
|
4 |
-
'version' => 'dev-
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'wprss/core',
|
10 |
'dev' => false,
|
11 |
),
|
@@ -329,21 +329,21 @@
|
|
329 |
'dev_requirement' => false,
|
330 |
),
|
331 |
'twig/twig' => array(
|
332 |
-
'pretty_version' => 'v1.
|
333 |
-
'version' => '1.
|
334 |
'type' => 'library',
|
335 |
'install_path' => __DIR__ . '/../twig/twig',
|
336 |
'aliases' => array(),
|
337 |
-
'reference' => '
|
338 |
'dev_requirement' => false,
|
339 |
),
|
340 |
'wprss/core' => array(
|
341 |
-
'pretty_version' => 'dev-
|
342 |
-
'version' => 'dev-
|
343 |
'type' => 'wordpress-plugin',
|
344 |
'install_path' => __DIR__ . '/../../',
|
345 |
'aliases' => array(),
|
346 |
-
'reference' => '
|
347 |
'dev_requirement' => false,
|
348 |
),
|
349 |
),
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
+
'pretty_version' => 'dev-master',
|
4 |
+
'version' => 'dev-master',
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => '1c4538d68baab41ddcd694d5332908890cdb282e',
|
9 |
'name' => 'wprss/core',
|
10 |
'dev' => false,
|
11 |
),
|
329 |
'dev_requirement' => false,
|
330 |
),
|
331 |
'twig/twig' => array(
|
332 |
+
'pretty_version' => 'v1.44.6',
|
333 |
+
'version' => '1.44.6.0',
|
334 |
'type' => 'library',
|
335 |
'install_path' => __DIR__ . '/../twig/twig',
|
336 |
'aliases' => array(),
|
337 |
+
'reference' => 'ae39480f010ef88adc7938503c9b02d3baf2f3b3',
|
338 |
'dev_requirement' => false,
|
339 |
),
|
340 |
'wprss/core' => array(
|
341 |
+
'pretty_version' => 'dev-master',
|
342 |
+
'version' => 'dev-master',
|
343 |
'type' => 'wordpress-plugin',
|
344 |
'install_path' => __DIR__ . '/../../',
|
345 |
'aliases' => array(),
|
346 |
+
'reference' => '1c4538d68baab41ddcd694d5332908890cdb282e',
|
347 |
'dev_requirement' => false,
|
348 |
),
|
349 |
),
|
vendor/composer/platform_check.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// platform_check.php @generated by Composer
|
4 |
-
|
5 |
-
$issues = array();
|
6 |
-
|
7 |
-
if (!(PHP_VERSION_ID >= 50400)) {
|
8 |
-
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
|
9 |
-
}
|
10 |
-
|
11 |
-
if ($issues) {
|
12 |
-
if (!headers_sent()) {
|
13 |
-
header('HTTP/1.1 500 Internal Server Error');
|
14 |
-
}
|
15 |
-
if (!ini_get('display_errors')) {
|
16 |
-
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
17 |
-
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
18 |
-
} elseif (!headers_sent()) {
|
19 |
-
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
20 |
-
}
|
21 |
-
}
|
22 |
-
trigger_error(
|
23 |
-
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
24 |
-
E_USER_ERROR
|
25 |
-
);
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/twig/twig/.gitattributes
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/doc/** export-ignore
|
2 |
+
/tests export-ignore
|
3 |
+
/phpunit.xml.dist export-ignore
|
vendor/twig/twig/.github/workflows/ci.yml
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: "CI"
|
2 |
+
|
3 |
+
on:
|
4 |
+
pull_request:
|
5 |
+
push:
|
6 |
+
branches:
|
7 |
+
- '1.x'
|
8 |
+
|
9 |
+
env:
|
10 |
+
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1
|
11 |
+
|
12 |
+
jobs:
|
13 |
+
tests:
|
14 |
+
name: "PHP ${{ matrix.php-version }}"
|
15 |
+
|
16 |
+
runs-on: 'ubuntu-latest'
|
17 |
+
|
18 |
+
continue-on-error: ${{ matrix.experimental }}
|
19 |
+
|
20 |
+
strategy:
|
21 |
+
matrix:
|
22 |
+
php-version:
|
23 |
+
- '7.2.5'
|
24 |
+
- '7.3'
|
25 |
+
- '7.4'
|
26 |
+
- '8.0'
|
27 |
+
composer-options: ['']
|
28 |
+
experimental: [false]
|
29 |
+
include:
|
30 |
+
- { php-version: '8.1', experimental: true, composer-options: '--ignore-platform-req=php' }
|
31 |
+
|
32 |
+
steps:
|
33 |
+
- name: "Checkout code"
|
34 |
+
uses: actions/checkout@v2.3.3
|
35 |
+
|
36 |
+
- name: "Install PHP with extensions"
|
37 |
+
uses: shivammathur/setup-php@2.7.0
|
38 |
+
with:
|
39 |
+
coverage: "none"
|
40 |
+
php-version: ${{ matrix.php-version }}
|
41 |
+
ini-values: memory_limit=-1
|
42 |
+
tools: composer:v2
|
43 |
+
|
44 |
+
- name: "Add PHPUnit matcher"
|
45 |
+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
46 |
+
|
47 |
+
- name: "Set composer cache directory"
|
48 |
+
id: composer-cache
|
49 |
+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
50 |
+
|
51 |
+
- name: "Cache composer"
|
52 |
+
uses: actions/cache@v2.1.2
|
53 |
+
with:
|
54 |
+
path: ${{ steps.composer-cache.outputs.dir }}
|
55 |
+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
|
56 |
+
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
|
57 |
+
|
58 |
+
- run: composer install ${{ matrix.composer-options }}
|
59 |
+
|
60 |
+
- name: "Install PHPUnit"
|
61 |
+
run: vendor/bin/simple-phpunit install
|
62 |
+
|
63 |
+
- name: "PHPUnit version"
|
64 |
+
run: vendor/bin/simple-phpunit --version
|
65 |
+
|
66 |
+
- name: "Run tests"
|
67 |
+
run: vendor/bin/simple-phpunit
|
68 |
+
|
69 |
+
integration-tests:
|
70 |
+
needs:
|
71 |
+
- 'tests'
|
72 |
+
|
73 |
+
name: "Integration tests with PHP ${{ matrix.php-version }}"
|
74 |
+
|
75 |
+
runs-on: 'ubuntu-20.04'
|
76 |
+
|
77 |
+
continue-on-error: true
|
78 |
+
|
79 |
+
strategy:
|
80 |
+
matrix:
|
81 |
+
php-version:
|
82 |
+
- '7.3'
|
83 |
+
|
84 |
+
steps:
|
85 |
+
- name: "Checkout code"
|
86 |
+
uses: actions/checkout@v2.3.3
|
87 |
+
|
88 |
+
- name: "Install PHP with extensions"
|
89 |
+
uses: shivammathur/setup-php@2.7.0
|
90 |
+
with:
|
91 |
+
coverage: "none"
|
92 |
+
extensions: "gd, pdo_sqlite"
|
93 |
+
php-version: ${{ matrix.php-version }}
|
94 |
+
ini-values: memory_limit=-1
|
95 |
+
tools: composer:v2
|
96 |
+
|
97 |
+
- run: bash ./tests/drupal_test.sh
|
98 |
+
shell: "bash"
|
vendor/twig/twig/.github/workflows/documentation.yml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: "Documentation"
|
2 |
+
|
3 |
+
on:
|
4 |
+
pull_request:
|
5 |
+
push:
|
6 |
+
branches:
|
7 |
+
- '1.x'
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
build:
|
11 |
+
name: "Build"
|
12 |
+
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
|
15 |
+
steps:
|
16 |
+
- name: "Checkout code"
|
17 |
+
uses: actions/checkout@v2
|
18 |
+
|
19 |
+
- name: "Set up Python 3.7"
|
20 |
+
uses: actions/setup-python@v1
|
21 |
+
with:
|
22 |
+
python-version: '3.7' # Semantic version range syntax or exact version of a Python version
|
23 |
+
|
24 |
+
- name: "Display Python version"
|
25 |
+
run: python -c "import sys; print(sys.version)"
|
26 |
+
|
27 |
+
- name: "Install Sphinx dependencies"
|
28 |
+
run: sudo apt-get install python-dev build-essential
|
29 |
+
|
30 |
+
- name: "Cache pip"
|
31 |
+
uses: actions/cache@v2
|
32 |
+
with:
|
33 |
+
path: ~/.cache/pip
|
34 |
+
key: ${{ runner.os }}-pip-${{ hashFiles('_build/.requirements.txt') }}
|
35 |
+
restore-keys: |
|
36 |
+
${{ runner.os }}-pip-
|
37 |
+
|
38 |
+
- name: "Install Sphinx + requirements via pip"
|
39 |
+
working-directory: "doc"
|
40 |
+
run: pip install -r _build/.requirements.txt
|
41 |
+
|
42 |
+
- name: "Build documentation"
|
43 |
+
working-directory: "doc"
|
44 |
+
run: make -C _build SPHINXOPTS="-nqW -j auto" html
|
45 |
+
|
46 |
+
doctor-rst:
|
47 |
+
name: "DOCtor-RST"
|
48 |
+
|
49 |
+
runs-on: ubuntu-latest
|
50 |
+
|
51 |
+
steps:
|
52 |
+
- name: "Checkout code"
|
53 |
+
uses: actions/checkout@v2
|
54 |
+
|
55 |
+
- name: "Run DOCtor-RST"
|
56 |
+
uses: docker://oskarstark/doctor-rst
|
57 |
+
with:
|
58 |
+
args: --short
|
59 |
+
env:
|
60 |
+
DOCS_DIR: 'doc/'
|
vendor/twig/twig/.gitignore
CHANGED
@@ -3,3 +3,4 @@
|
|
3 |
/ext/twig/autom4te.cache/
|
4 |
/phpunit.xml
|
5 |
/vendor
|
|
3 |
/ext/twig/autom4te.cache/
|
4 |
/phpunit.xml
|
5 |
/vendor
|
6 |
+
.phpunit.result.cache
|
vendor/twig/twig/{.php_cs.dist → .php-cs-fixer.dist.php}
RENAMED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
return PhpCsFixer\Config
|
4 |
->setRules([
|
5 |
'@Symfony' => true,
|
6 |
'@Symfony:risky' => true,
|
|
|
|
|
7 |
'array_syntax' => ['syntax' => 'short'],
|
8 |
'php_unit_fqcn_annotation' => true,
|
9 |
'no_unreachable_default_argument_value' => false,
|
@@ -14,5 +16,5 @@ return PhpCsFixer\Config::create()
|
|
14 |
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'],
|
15 |
])
|
16 |
->setRiskyAllowed(true)
|
17 |
-
->setFinder(PhpCsFixer\Finder
|
18 |
;
|
1 |
<?php
|
2 |
|
3 |
+
return (new PhpCsFixer\Config())
|
4 |
->setRules([
|
5 |
'@Symfony' => true,
|
6 |
'@Symfony:risky' => true,
|
7 |
+
'@PHPUnit75Migration:risky' => true,
|
8 |
+
'php_unit_dedicate_assert' => ['target' => '5.6'],
|
9 |
'array_syntax' => ['syntax' => 'short'],
|
10 |
'php_unit_fqcn_annotation' => true,
|
11 |
'no_unreachable_default_argument_value' => false,
|
16 |
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'],
|
17 |
])
|
18 |
->setRiskyAllowed(true)
|
19 |
+
->setFinder((new PhpCsFixer\Finder())->in(__DIR__))
|
20 |
;
|
vendor/twig/twig/LICENSE
CHANGED
@@ -1,31 +1,27 @@
|
|
1 |
-
Copyright (c) 2009-
|
2 |
|
3 |
-
|
4 |
|
5 |
-
Redistribution and use in source and binary forms, with or without
|
6 |
-
|
7 |
-
met:
|
8 |
|
9 |
-
* Redistributions of source code must retain the above copyright
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
* The names of the contributors may not be used to endorse or
|
18 |
-
promote products derived from this software without specific
|
19 |
-
prior written permission.
|
20 |
|
21 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22 |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24 |
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
1 |
+
Copyright (c) 2009-2021 by the Twig Team.
|
2 |
|
3 |
+
All rights reserved.
|
4 |
|
5 |
+
Redistribution and use in source and binary forms, with or without modification,
|
6 |
+
are permitted provided that the following conditions are met:
|
|
|
7 |
|
8 |
+
* Redistributions of source code must retain the above copyright notice,
|
9 |
+
this list of conditions and the following disclaimer.
|
10 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
11 |
+
this list of conditions and the following disclaimer in the documentation
|
12 |
+
and/or other materials provided with the distribution.
|
13 |
+
* Neither the name of Twig nor the names of its contributors
|
14 |
+
may be used to endorse or promote products derived from this software
|
15 |
+
without specific prior written permission.
|
|
|
|
|
|
|
16 |
|
17 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
18 |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
19 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
20 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
21 |
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
22 |
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
23 |
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
24 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
25 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
26 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
vendor/twig/twig/composer.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
"keywords": ["templating"],
|
6 |
"homepage": "https://twig.symfony.com",
|
7 |
"license": "BSD-3-Clause",
|
|
|
8 |
"authors": [
|
9 |
{
|
10 |
"name": "Fabien Potencier",
|
@@ -14,7 +15,6 @@
|
|
14 |
},
|
15 |
{
|
16 |
"name": "Twig Team",
|
17 |
-
"homepage": "https://twig.symfony.com/contributors",
|
18 |
"role": "Contributors"
|
19 |
},
|
20 |
{
|
@@ -24,12 +24,11 @@
|
|
24 |
}
|
25 |
],
|
26 |
"require": {
|
27 |
-
"php": ">=
|
28 |
"symfony/polyfill-ctype": "^1.8"
|
29 |
},
|
30 |
"require-dev": {
|
31 |
-
"symfony/phpunit-bridge": "^
|
32 |
-
"symfony/debug": "^2.7",
|
33 |
"psr/container": "^1.0"
|
34 |
},
|
35 |
"autoload": {
|
@@ -40,9 +39,14 @@
|
|
40 |
"Twig\\" : "src/"
|
41 |
}
|
42 |
},
|
|
|
|
|
|
|
|
|
|
|
43 |
"extra": {
|
44 |
"branch-alias": {
|
45 |
-
"dev-master": "1.
|
46 |
}
|
47 |
}
|
48 |
}
|
5 |
"keywords": ["templating"],
|
6 |
"homepage": "https://twig.symfony.com",
|
7 |
"license": "BSD-3-Clause",
|
8 |
+
"minimum-stability": "dev",
|
9 |
"authors": [
|
10 |
{
|
11 |
"name": "Fabien Potencier",
|
15 |
},
|
16 |
{
|
17 |
"name": "Twig Team",
|
|
|
18 |
"role": "Contributors"
|
19 |
},
|
20 |
{
|
24 |
}
|
25 |
],
|
26 |
"require": {
|
27 |
+
"php": ">=7.2.5",
|
28 |
"symfony/polyfill-ctype": "^1.8"
|
29 |
},
|
30 |
"require-dev": {
|
31 |
+
"symfony/phpunit-bridge": "^4.4.9|^5.0.9",
|
|
|
32 |
"psr/container": "^1.0"
|
33 |
},
|
34 |
"autoload": {
|
39 |
"Twig\\" : "src/"
|
40 |
}
|
41 |
},
|
42 |
+
"autoload-dev": {
|
43 |
+
"psr-4" : {
|
44 |
+
"Twig\\Tests\\" : "tests"
|
45 |
+
}
|
46 |
+
},
|
47 |
"extra": {
|
48 |
"branch-alias": {
|
49 |
+
"dev-master": "1.44-dev"
|
50 |
}
|
51 |
}
|
52 |
}
|
vendor/twig/twig/drupal_test.sh
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
|
3 |
-
set -x
|
4 |
-
set -e
|
5 |
-
|
6 |
-
REPO=`pwd`
|
7 |
-
cd /tmp
|
8 |
-
rm -rf drupal-twig-test
|
9 |
-
composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test
|
10 |
-
cd drupal-twig-test
|
11 |
-
(cd vendor/twig && rm -rf twig && ln -sf $REPO twig)
|
12 |
-
echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php
|
13 |
-
php ./web/core/scripts/drupal install --no-interaction demo_umami > output
|
14 |
-
perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output
|
15 |
-
source output
|
16 |
-
|
17 |
-
wget https://get.symfony.com/cli/installer -O - | bash
|
18 |
-
export PATH="$HOME/.symfony/bin:$PATH"
|
19 |
-
symfony server:start -d --no-tls
|
20 |
-
ENDPOINT=`symfony server:status -no-ansi | sed -E 's/^.+ http/http/'`
|
21 |
-
|
22 |
-
curl -OLsS https://get.blackfire.io/blackfire-player.phar
|
23 |
-
chmod +x blackfire-player.phar
|
24 |
-
cat > drupal-tests.bkf <<EOF
|
25 |
-
name "Drupal tests"
|
26 |
-
|
27 |
-
scenario
|
28 |
-
name "homepage"
|
29 |
-
set name "admin"
|
30 |
-
set pass "pass"
|
31 |
-
|
32 |
-
visit url('/')
|
33 |
-
expect status_code() == 200
|
34 |
-
click link('Articles')
|
35 |
-
expect status_code() == 200
|
36 |
-
click link('Dairy-free and delicious milk chocolate')
|
37 |
-
expect body() matches "/Dairy\-free milk chocolate is made in largely the same way as regular chocolate/"
|
38 |
-
expect status_code() == 200
|
39 |
-
click link('Log in')
|
40 |
-
expect status_code() == 200
|
41 |
-
submit button("Log in")
|
42 |
-
param name name
|
43 |
-
param pass pass
|
44 |
-
expect status_code() == 303
|
45 |
-
follow
|
46 |
-
expect status_code() == 200
|
47 |
-
click link('Structure')
|
48 |
-
expect status_code() == 200
|
49 |
-
EOF
|
50 |
-
./blackfire-player.phar run drupal-tests.bkf --endpoint=$ENDPOINT --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password
|
51 |
-
symfony server:stop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/twig/twig/lib/Twig/Autoloader.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Autoloads Twig classes.
|
@@ -27,7 +27,7 @@ class Twig_Autoloader
|
|
27 |
*/
|
28 |
public static function register($prepend = false)
|
29 |
{
|
30 |
-
@trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED);
|
31 |
|
32 |
spl_autoload_register([__CLASS__, 'autoload'], true, $prepend);
|
33 |
}
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Autoloads Twig classes.
|
27 |
*/
|
28 |
public static function register($prepend = false)
|
29 |
{
|
30 |
+
@trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', \E_USER_DEPRECATED);
|
31 |
|
32 |
spl_autoload_register([__CLASS__, 'autoload'], true, $prepend);
|
33 |
}
|
vendor/twig/twig/lib/Twig/Filter.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
use Twig\Node\Node;
|
13 |
|
14 |
-
@trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a template filter.
|
11 |
|
12 |
use Twig\Node\Node;
|
13 |
|
14 |
+
@trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', \E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a template filter.
|
vendor/twig/twig/lib/Twig/Filter/Function.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a function template filter.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a function template filter.
|
vendor/twig/twig/lib/Twig/Filter/Method.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
use Twig\Extension\ExtensionInterface;
|
13 |
|
14 |
-
@trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a method template filter.
|
11 |
|
12 |
use Twig\Extension\ExtensionInterface;
|
13 |
|
14 |
+
@trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', \E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a method template filter.
|
vendor/twig/twig/lib/Twig/Filter/Node.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template filter as a node.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template filter as a node.
|
vendor/twig/twig/lib/Twig/Function.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
use Twig\Node\Node;
|
13 |
|
14 |
-
@trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a template function.
|
11 |
|
12 |
use Twig\Node\Node;
|
13 |
|
14 |
+
@trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', \E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a template function.
|
vendor/twig/twig/lib/Twig/Function/Function.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* file that was distributed with this source code.
|
11 |
*/
|
12 |
|
13 |
-
@trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
|
14 |
|
15 |
/**
|
16 |
* Represents a function template function.
|
10 |
* file that was distributed with this source code.
|
11 |
*/
|
12 |
|
13 |
+
@trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', \E_USER_DEPRECATED);
|
14 |
|
15 |
/**
|
16 |
* Represents a function template function.
|
vendor/twig/twig/lib/Twig/Function/Method.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
|
13 |
use Twig\Extension\ExtensionInterface;
|
14 |
|
15 |
-
@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
|
16 |
|
17 |
/**
|
18 |
* Represents a method template function.
|
12 |
|
13 |
use Twig\Extension\ExtensionInterface;
|
14 |
|
15 |
+
@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', \E_USER_DEPRECATED);
|
16 |
|
17 |
/**
|
18 |
* Represents a method template function.
|
vendor/twig/twig/lib/Twig/Function/Node.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template function as a node.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template function as a node.
|
vendor/twig/twig/lib/Twig/Loader/String.php
CHANGED
@@ -14,7 +14,7 @@ use Twig\Loader\LoaderInterface;
|
|
14 |
use Twig\Loader\SourceContextLoaderInterface;
|
15 |
use Twig\Source;
|
16 |
|
17 |
-
@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use "Twig\Loader\ArrayLoader" instead or "Twig\Environment::createTemplate()".', E_USER_DEPRECATED);
|
18 |
|
19 |
/**
|
20 |
* Loads a template from a string.
|
@@ -36,7 +36,7 @@ class Twig_Loader_String implements LoaderInterface, ExistsLoaderInterface, Sour
|
|
36 |
{
|
37 |
public function getSource($name)
|
38 |
{
|
39 |
-
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.',
|
40 |
|
41 |
return $name;
|
42 |
}
|
14 |
use Twig\Loader\SourceContextLoaderInterface;
|
15 |
use Twig\Source;
|
16 |
|
17 |
+
@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use "Twig\Loader\ArrayLoader" instead or "Twig\Environment::createTemplate()".', \E_USER_DEPRECATED);
|
18 |
|
19 |
/**
|
20 |
* Loads a template from a string.
|
36 |
{
|
37 |
public function getSource($name)
|
38 |
{
|
39 |
+
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', static::class), \E_USER_DEPRECATED);
|
40 |
|
41 |
return $name;
|
42 |
}
|
vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
use Twig\Compiler;
|
13 |
use Twig\Node\Expression\AbstractExpression;
|
14 |
|
15 |
-
@trigger_error('The Twig_Node_Expression_ExtensionReference class is deprecated since version 1.23 and will be removed in 2.0.', E_USER_DEPRECATED);
|
16 |
|
17 |
/**
|
18 |
* Represents an extension call node.
|
12 |
use Twig\Compiler;
|
13 |
use Twig\Node\Expression\AbstractExpression;
|
14 |
|
15 |
+
@trigger_error('The Twig_Node_Expression_ExtensionReference class is deprecated since version 1.23 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
16 |
|
17 |
/**
|
18 |
* Represents an extension call node.
|
vendor/twig/twig/lib/Twig/TemplateInterface.php
CHANGED
@@ -20,9 +20,9 @@ use Twig\Environment;
|
|
20 |
*/
|
21 |
interface Twig_TemplateInterface
|
22 |
{
|
23 |
-
const ANY_CALL = 'any';
|
24 |
-
const ARRAY_CALL = 'array';
|
25 |
-
const METHOD_CALL = 'method';
|
26 |
|
27 |
/**
|
28 |
* Renders the template with the given context and returns it as string.
|
20 |
*/
|
21 |
interface Twig_TemplateInterface
|
22 |
{
|
23 |
+
public const ANY_CALL = 'any';
|
24 |
+
public const ARRAY_CALL = 'array';
|
25 |
+
public const METHOD_CALL = 'method';
|
26 |
|
27 |
/**
|
28 |
* Renders the template with the given context and returns it as string.
|
vendor/twig/twig/lib/Twig/Test.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template test.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template test.
|
vendor/twig/twig/lib/Twig/Test/Function.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a function template test.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a function template test.
|
vendor/twig/twig/lib/Twig/Test/Method.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
use Twig\Extension\ExtensionInterface;
|
13 |
|
14 |
-
@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a method template test.
|
@@ -39,4 +39,9 @@ class Twig_Test_Method extends Twig_Test
|
|
39 |
{
|
40 |
return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method);
|
41 |
}
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
11 |
|
12 |
use Twig\Extension\ExtensionInterface;
|
13 |
|
14 |
+
@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', \E_USER_DEPRECATED);
|
15 |
|
16 |
/**
|
17 |
* Represents a method template test.
|
39 |
{
|
40 |
return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method);
|
41 |
}
|
42 |
+
|
43 |
+
public function hasOneMandatoryArgument(): bool
|
44 |
+
{
|
45 |
+
return (bool) ($this->options['one_mandatory_argument'] ?? false);
|
46 |
+
}
|
47 |
}
|
vendor/twig/twig/lib/Twig/Test/Node.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
@trigger_error('The Twig_Test_Node class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template test as a Node.
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
@trigger_error('The Twig_Test_Node class is deprecated since version 1.12 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
13 |
|
14 |
/**
|
15 |
* Represents a template test as a Node.
|
vendor/twig/twig/lib/Twig/TokenParserBroker.php
CHANGED
@@ -33,7 +33,7 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
|
|
33 |
public function __construct($parsers = [], $brokers = [], $triggerDeprecationError = true)
|
34 |
{
|
35 |
if ($triggerDeprecationError) {
|
36 |
-
@trigger_error('The '.__CLASS__.' class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
|
37 |
}
|
38 |
|
39 |
foreach ($parsers as $parser) {
|
33 |
public function __construct($parsers = [], $brokers = [], $triggerDeprecationError = true)
|
34 |
{
|
35 |
if ($triggerDeprecationError) {
|
36 |
+
@trigger_error('The '.__CLASS__.' class is deprecated since version 1.12 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
37 |
}
|
38 |
|
39 |
foreach ($parsers as $parser) {
|
vendor/twig/twig/src/Cache/FilesystemCache.php
CHANGED
@@ -18,7 +18,7 @@ namespace Twig\Cache;
|
|
18 |
*/
|
19 |
class FilesystemCache implements CacheInterface
|
20 |
{
|
21 |
-
const FORCE_BYTECODE_INVALIDATION = 1;
|
22 |
|
23 |
private $directory;
|
24 |
private $options;
|
@@ -67,8 +67,8 @@ class FilesystemCache implements CacheInterface
|
|
67 |
|
68 |
if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
|
69 |
// Compile cached file into bytecode cache
|
70 |
-
if (\function_exists('opcache_invalidate')) {
|
71 |
-
opcache_invalidate($key, true);
|
72 |
} elseif (\function_exists('apc_compile_file')) {
|
73 |
apc_compile_file($key);
|
74 |
}
|
18 |
*/
|
19 |
class FilesystemCache implements CacheInterface
|
20 |
{
|
21 |
+
public const FORCE_BYTECODE_INVALIDATION = 1;
|
22 |
|
23 |
private $directory;
|
24 |
private $options;
|
67 |
|
68 |
if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
|
69 |
// Compile cached file into bytecode cache
|
70 |
+
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) {
|
71 |
+
@opcache_invalidate($key, true);
|
72 |
} elseif (\function_exists('apc_compile_file')) {
|
73 |
apc_compile_file($key);
|
74 |
}
|
vendor/twig/twig/src/Compiler.php
CHANGED
@@ -41,7 +41,7 @@ class Compiler implements \Twig_CompilerInterface
|
|
41 |
*/
|
42 |
public function getFilename()
|
43 |
{
|
44 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
|
45 |
|
46 |
return $this->filename;
|
47 |
}
|
@@ -143,7 +143,7 @@ class Compiler implements \Twig_CompilerInterface
|
|
143 |
*/
|
144 |
public function addIndentation()
|
145 |
{
|
146 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', E_USER_DEPRECATED);
|
147 |
|
148 |
$this->source .= str_repeat(' ', $this->indentation * 4);
|
149 |
|
@@ -174,14 +174,14 @@ class Compiler implements \Twig_CompilerInterface
|
|
174 |
public function repr($value)
|
175 |
{
|
176 |
if (\is_int($value) || \is_float($value)) {
|
177 |
-
if (false !== $locale = setlocale(LC_NUMERIC, '0')) {
|
178 |
-
setlocale(LC_NUMERIC, 'C');
|
179 |
}
|
180 |
|
181 |
$this->raw(var_export($value, true));
|
182 |
|
183 |
if (false !== $locale) {
|
184 |
-
setlocale(LC_NUMERIC, $locale);
|
185 |
}
|
186 |
} elseif (null === $value) {
|
187 |
$this->raw('null');
|
@@ -221,7 +221,7 @@ class Compiler implements \Twig_CompilerInterface
|
|
221 |
// mb_substr_count() replaces substr_count()
|
222 |
// but they have different signatures!
|
223 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
224 |
-
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED);
|
225 |
|
226 |
// this is much slower than the "right" version
|
227 |
$this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
|
41 |
*/
|
42 |
public function getFilename()
|
43 |
{
|
44 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), \E_USER_DEPRECATED);
|
45 |
|
46 |
return $this->filename;
|
47 |
}
|
143 |
*/
|
144 |
public function addIndentation()
|
145 |
{
|
146 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', \E_USER_DEPRECATED);
|
147 |
|
148 |
$this->source .= str_repeat(' ', $this->indentation * 4);
|
149 |
|
174 |
public function repr($value)
|
175 |
{
|
176 |
if (\is_int($value) || \is_float($value)) {
|
177 |
+
if (false !== $locale = setlocale(\LC_NUMERIC, '0')) {
|
178 |
+
setlocale(\LC_NUMERIC, 'C');
|
179 |
}
|
180 |
|
181 |
$this->raw(var_export($value, true));
|
182 |
|
183 |
if (false !== $locale) {
|
184 |
+
setlocale(\LC_NUMERIC, $locale);
|
185 |
}
|
186 |
} elseif (null === $value) {
|
187 |
$this->raw('null');
|
221 |
// mb_substr_count() replaces substr_count()
|
222 |
// but they have different signatures!
|
223 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
224 |
+
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
225 |
|
226 |
// this is much slower than the "right" version
|
227 |
$this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
|
vendor/twig/twig/src/Environment.php
CHANGED
@@ -35,18 +35,18 @@ use Twig\RuntimeLoader\RuntimeLoaderInterface;
|
|
35 |
use Twig\TokenParser\TokenParserInterface;
|
36 |
|
37 |
/**
|
38 |
-
* Stores the Twig configuration.
|
39 |
*
|
40 |
* @author Fabien Potencier <fabien@symfony.com>
|
41 |
*/
|
42 |
class Environment
|
43 |
{
|
44 |
-
const VERSION = '1.
|
45 |
-
const VERSION_ID =
|
46 |
-
const MAJOR_VERSION = 1;
|
47 |
-
const MINOR_VERSION =
|
48 |
-
const RELEASE_VERSION =
|
49 |
-
const EXTRA_VERSION = '';
|
50 |
|
51 |
protected $charset;
|
52 |
protected $loader;
|
@@ -124,7 +124,7 @@ class Environment
|
|
124 |
if (null !== $loader) {
|
125 |
$this->setLoader($loader);
|
126 |
} else {
|
127 |
-
@trigger_error('Not passing a "Twig\Lodaer\LoaderInterface" as the first constructor argument of "Twig\Environment" is deprecated since version 1.21.', E_USER_DEPRECATED);
|
128 |
}
|
129 |
|
130 |
$options = array_merge([
|
@@ -139,7 +139,7 @@ class Environment
|
|
139 |
], $options);
|
140 |
|
141 |
$this->debug = (bool) $options['debug'];
|
142 |
-
$this->charset = strtoupper($options['charset']);
|
143 |
$this->baseTemplateClass = $options['base_template_class'];
|
144 |
$this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
|
145 |
$this->strictVariables = (bool) $options['strict_variables'];
|
@@ -154,14 +154,14 @@ class Environment
|
|
154 |
if (\is_string($this->originalCache)) {
|
155 |
$r = new \ReflectionMethod($this, 'writeCacheFile');
|
156 |
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
157 |
-
@trigger_error('The Twig\Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
|
158 |
|
159 |
$this->bcWriteCacheFile = true;
|
160 |
}
|
161 |
|
162 |
$r = new \ReflectionMethod($this, 'getCacheFilename');
|
163 |
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
164 |
-
@trigger_error('The Twig\Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
|
165 |
|
166 |
$this->bcGetCacheFilename = true;
|
167 |
}
|
@@ -301,13 +301,13 @@ class Environment
|
|
301 |
$this->originalCache = $cache;
|
302 |
$this->cache = new NullCache();
|
303 |
} elseif (null === $cache) {
|
304 |
-
@trigger_error('Using "null" as the cache strategy is deprecated since version 1.23 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
|
305 |
$this->originalCache = false;
|
306 |
$this->cache = new NullCache();
|
307 |
} elseif ($cache instanceof CacheInterface) {
|
308 |
$this->originalCache = $this->cache = $cache;
|
309 |
} else {
|
310 |
-
throw new \LogicException(
|
311 |
}
|
312 |
}
|
313 |
|
@@ -322,7 +322,7 @@ class Environment
|
|
322 |
*/
|
323 |
public function getCacheFilename($name)
|
324 |
{
|
325 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
326 |
|
327 |
$key = $this->cache->generateKey($name, $this->getTemplateClass($name));
|
328 |
|
@@ -362,7 +362,7 @@ class Environment
|
|
362 |
*/
|
363 |
public function getTemplateClassPrefix()
|
364 |
{
|
365 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
366 |
|
367 |
return $this->templateClassPrefix;
|
368 |
}
|
@@ -515,7 +515,7 @@ class Environment
|
|
515 |
*
|
516 |
* This method should not be used as a generic way to load templates.
|
517 |
*
|
518 |
-
* @param string $template The template
|
519 |
* @param string $name An optional name of the template to be used in error messages
|
520 |
*
|
521 |
* @return TemplateWrapper A template instance representing the given template name
|
@@ -626,7 +626,7 @@ class Environment
|
|
626 |
*/
|
627 |
public function clearTemplateCache()
|
628 |
{
|
629 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.18.3 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
630 |
|
631 |
$this->loadedTemplates = [];
|
632 |
}
|
@@ -638,7 +638,7 @@ class Environment
|
|
638 |
*/
|
639 |
public function clearCacheFiles()
|
640 |
{
|
641 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
642 |
|
643 |
if (\is_string($this->originalCache)) {
|
644 |
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->originalCache), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
|
@@ -658,7 +658,7 @@ class Environment
|
|
658 |
*/
|
659 |
public function getLexer()
|
660 |
{
|
661 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
|
662 |
|
663 |
if (null === $this->lexer) {
|
664 |
$this->lexer = new Lexer($this);
|
@@ -685,7 +685,7 @@ class Environment
|
|
685 |
public function tokenize($source, $name = null)
|
686 |
{
|
687 |
if (!$source instanceof Source) {
|
688 |
-
@trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
689 |
$source = new Source($source, $name);
|
690 |
}
|
691 |
|
@@ -705,7 +705,7 @@ class Environment
|
|
705 |
*/
|
706 |
public function getParser()
|
707 |
{
|
708 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
|
709 |
|
710 |
if (null === $this->parser) {
|
711 |
$this->parser = new Parser($this);
|
@@ -744,7 +744,7 @@ class Environment
|
|
744 |
*/
|
745 |
public function getCompiler()
|
746 |
{
|
747 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
|
748 |
|
749 |
if (null === $this->compiler) {
|
750 |
$this->compiler = new Compiler($this);
|
@@ -785,7 +785,7 @@ class Environment
|
|
785 |
public function compileSource($source, $name = null)
|
786 |
{
|
787 |
if (!$source instanceof Source) {
|
788 |
-
@trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
789 |
$source = new Source($source, $name);
|
790 |
}
|
791 |
|
@@ -802,7 +802,7 @@ class Environment
|
|
802 |
public function setLoader(LoaderInterface $loader)
|
803 |
{
|
804 |
if (!$loader instanceof SourceContextLoaderInterface && 0 !== strpos(\get_class($loader), 'Mock_')) {
|
805 |
-
@trigger_error(sprintf('Twig loader "%s" should implement Twig\Loader\SourceContextLoaderInterface since version 1.27.', \get_class($loader)), E_USER_DEPRECATED);
|
806 |
}
|
807 |
|
808 |
$this->loader = $loader;
|
@@ -857,7 +857,7 @@ class Environment
|
|
857 |
|
858 |
$parentClass = $m->getDeclaringClass()->getName();
|
859 |
if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
|
860 |
-
@trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated since version 1.23. Use the `needs_environment` option to get the \Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig\Extension\InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED);
|
861 |
}
|
862 |
}
|
863 |
|
@@ -883,7 +883,7 @@ class Environment
|
|
883 |
|
884 |
if (isset($this->extensions[$class])) {
|
885 |
if ($class !== \get_class($this->extensions[$class])) {
|
886 |
-
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
|
887 |
}
|
888 |
|
889 |
return true;
|
@@ -918,7 +918,7 @@ class Environment
|
|
918 |
|
919 |
if (isset($this->extensions[$class])) {
|
920 |
if ($class !== \get_class($this->extensions[$class])) {
|
921 |
-
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
|
922 |
}
|
923 |
|
924 |
return $this->extensions[$class];
|
@@ -965,7 +965,7 @@ class Environment
|
|
965 |
if ($class !== $extension->getName()) {
|
966 |
if (isset($this->extensions[$extension->getName()])) {
|
967 |
unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]);
|
968 |
-
@trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), E_USER_DEPRECATED);
|
969 |
}
|
970 |
}
|
971 |
|
@@ -986,7 +986,7 @@ class Environment
|
|
986 |
*/
|
987 |
public function removeExtension($name)
|
988 |
{
|
989 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.12 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
990 |
|
991 |
if ($this->extensionInitialized) {
|
992 |
throw new \LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name));
|
@@ -1001,7 +1001,7 @@ class Environment
|
|
1001 |
|
1002 |
if (isset($this->extensions[$class])) {
|
1003 |
if ($class !== \get_class($this->extensions[$class])) {
|
1004 |
-
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
|
1005 |
}
|
1006 |
|
1007 |
unset($this->extensions[$class]);
|
@@ -1120,7 +1120,7 @@ class Environment
|
|
1120 |
$filter = $name;
|
1121 |
$name = $filter->getName();
|
1122 |
} else {
|
1123 |
-
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), E_USER_DEPRECATED);
|
1124 |
}
|
1125 |
|
1126 |
if ($this->extensionInitialized) {
|
@@ -1215,7 +1215,7 @@ class Environment
|
|
1215 |
$test = $name;
|
1216 |
$name = $test->getName();
|
1217 |
} else {
|
1218 |
-
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), E_USER_DEPRECATED);
|
1219 |
}
|
1220 |
|
1221 |
if ($this->extensionInitialized) {
|
@@ -1292,7 +1292,7 @@ class Environment
|
|
1292 |
$function = $name;
|
1293 |
$name = $function->getName();
|
1294 |
} else {
|
1295 |
-
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), E_USER_DEPRECATED);
|
1296 |
}
|
1297 |
|
1298 |
if ($this->extensionInitialized) {
|
@@ -1389,7 +1389,7 @@ class Environment
|
|
1389 |
|
1390 |
if (!\array_key_exists($name, $this->globals)) {
|
1391 |
// The deprecation notice must be turned into the following exception in Twig 2.0
|
1392 |
-
@trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated since version 1.21.', $name), E_USER_DEPRECATED);
|
1393 |
//throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
|
1394 |
}
|
1395 |
}
|
@@ -1479,7 +1479,7 @@ class Environment
|
|
1479 |
*/
|
1480 |
public function computeAlternatives($name, $items)
|
1481 |
{
|
1482 |
-
@trigger_error(sprintf('The %s method is deprecated since version 1.23 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
|
1483 |
|
1484 |
return SyntaxError::computeAlternatives($name, $items);
|
1485 |
}
|
@@ -1496,7 +1496,7 @@ class Environment
|
|
1496 |
|
1497 |
$parentClass = $m->getDeclaringClass()->getName();
|
1498 |
if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
|
1499 |
-
@trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.', $name), E_USER_DEPRECATED);
|
1500 |
}
|
1501 |
}
|
1502 |
|
@@ -1548,7 +1548,7 @@ class Environment
|
|
1548 |
if ($filter instanceof TwigFilter) {
|
1549 |
$name = $filter->getName();
|
1550 |
} else {
|
1551 |
-
@trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated since version 1.21. Use \Twig_SimpleFilter instead.', \get_class($filter), $name), E_USER_DEPRECATED);
|
1552 |
}
|
1553 |
|
1554 |
$this->filters[$name] = $filter;
|
@@ -1559,7 +1559,7 @@ class Environment
|
|
1559 |
if ($function instanceof TwigFunction) {
|
1560 |
$name = $function->getName();
|
1561 |
} else {
|
1562 |
-
@trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated since version 1.21. Use \Twig_SimpleFunction instead.', \get_class($function), $name), E_USER_DEPRECATED);
|
1563 |
}
|
1564 |
|
1565 |
$this->functions[$name] = $function;
|
@@ -1570,7 +1570,7 @@ class Environment
|
|
1570 |
if ($test instanceof TwigTest) {
|
1571 |
$name = $test->getName();
|
1572 |
} else {
|
1573 |
-
@trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated since version 1.21. Use \Twig_SimpleTest instead.', \get_class($test), $name), E_USER_DEPRECATED);
|
1574 |
}
|
1575 |
|
1576 |
$this->tests[$name] = $test;
|
@@ -1581,7 +1581,7 @@ class Environment
|
|
1581 |
if ($parser instanceof TokenParserInterface) {
|
1582 |
$this->parsers->addTokenParser($parser);
|
1583 |
} elseif ($parser instanceof \Twig_TokenParserBrokerInterface) {
|
1584 |
-
@trigger_error('Registering a \Twig_TokenParserBrokerInterface instance is deprecated since version 1.21.', E_USER_DEPRECATED);
|
1585 |
|
1586 |
$this->parsers->addTokenParserBroker($parser);
|
1587 |
} else {
|
@@ -1623,8 +1623,8 @@ class Environment
|
|
1623 |
array_keys($this->extensions),
|
1624 |
[
|
1625 |
(int) \function_exists('twig_template_get_attributes'),
|
1626 |
-
PHP_MAJOR_VERSION,
|
1627 |
-
PHP_MINOR_VERSION,
|
1628 |
self::VERSION,
|
1629 |
(int) $this->debug,
|
1630 |
$this->baseTemplateClass,
|
35 |
use Twig\TokenParser\TokenParserInterface;
|
36 |
|
37 |
/**
|
38 |
+
* Stores the Twig configuration and renders templates.
|
39 |
*
|
40 |
* @author Fabien Potencier <fabien@symfony.com>
|
41 |
*/
|
42 |
class Environment
|
43 |
{
|
44 |
+
public const VERSION = '1.44.6';
|
45 |
+
public const VERSION_ID = 14406;
|
46 |
+
public const MAJOR_VERSION = 1;
|
47 |
+
public const MINOR_VERSION = 44;
|
48 |
+
public const RELEASE_VERSION = 6;
|
49 |
+
public const EXTRA_VERSION = '';
|
50 |
|
51 |
protected $charset;
|
52 |
protected $loader;
|
124 |
if (null !== $loader) {
|
125 |
$this->setLoader($loader);
|
126 |
} else {
|
127 |
+
@trigger_error('Not passing a "Twig\Lodaer\LoaderInterface" as the first constructor argument of "Twig\Environment" is deprecated since version 1.21.', \E_USER_DEPRECATED);
|
128 |
}
|
129 |
|
130 |
$options = array_merge([
|
139 |
], $options);
|
140 |
|
141 |
$this->debug = (bool) $options['debug'];
|
142 |
+
$this->charset = null === $options['charset'] ? null : strtoupper($options['charset']);
|
143 |
$this->baseTemplateClass = $options['base_template_class'];
|
144 |
$this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
|
145 |
$this->strictVariables = (bool) $options['strict_variables'];
|
154 |
if (\is_string($this->originalCache)) {
|
155 |
$r = new \ReflectionMethod($this, 'writeCacheFile');
|
156 |
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
157 |
+
@trigger_error('The Twig\Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', \E_USER_DEPRECATED);
|
158 |
|
159 |
$this->bcWriteCacheFile = true;
|
160 |
}
|
161 |
|
162 |
$r = new \ReflectionMethod($this, 'getCacheFilename');
|
163 |
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
164 |
+
@trigger_error('The Twig\Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', \E_USER_DEPRECATED);
|
165 |
|
166 |
$this->bcGetCacheFilename = true;
|
167 |
}
|
301 |
$this->originalCache = $cache;
|
302 |
$this->cache = new NullCache();
|
303 |
} elseif (null === $cache) {
|
304 |
+
@trigger_error('Using "null" as the cache strategy is deprecated since version 1.23 and will be removed in Twig 2.0.', \E_USER_DEPRECATED);
|
305 |
$this->originalCache = false;
|
306 |
$this->cache = new NullCache();
|
307 |
} elseif ($cache instanceof CacheInterface) {
|
308 |
$this->originalCache = $this->cache = $cache;
|
309 |
} else {
|
310 |
+
throw new \LogicException('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.');
|
311 |
}
|
312 |
}
|
313 |
|
322 |
*/
|
323 |
public function getCacheFilename($name)
|
324 |
{
|
325 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
326 |
|
327 |
$key = $this->cache->generateKey($name, $this->getTemplateClass($name));
|
328 |
|
362 |
*/
|
363 |
public function getTemplateClassPrefix()
|
364 |
{
|
365 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
366 |
|
367 |
return $this->templateClassPrefix;
|
368 |
}
|
515 |
*
|
516 |
* This method should not be used as a generic way to load templates.
|
517 |
*
|
518 |
+
* @param string $template The template source
|
519 |
* @param string $name An optional name of the template to be used in error messages
|
520 |
*
|
521 |
* @return TemplateWrapper A template instance representing the given template name
|
626 |
*/
|
627 |
public function clearTemplateCache()
|
628 |
{
|
629 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.18.3 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
630 |
|
631 |
$this->loadedTemplates = [];
|
632 |
}
|
638 |
*/
|
639 |
public function clearCacheFiles()
|
640 |
{
|
641 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
642 |
|
643 |
if (\is_string($this->originalCache)) {
|
644 |
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->originalCache), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
|
658 |
*/
|
659 |
public function getLexer()
|
660 |
{
|
661 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), \E_USER_DEPRECATED);
|
662 |
|
663 |
if (null === $this->lexer) {
|
664 |
$this->lexer = new Lexer($this);
|
685 |
public function tokenize($source, $name = null)
|
686 |
{
|
687 |
if (!$source instanceof Source) {
|
688 |
+
@trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), \E_USER_DEPRECATED);
|
689 |
$source = new Source($source, $name);
|
690 |
}
|
691 |
|
705 |
*/
|
706 |
public function getParser()
|
707 |
{
|
708 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), \E_USER_DEPRECATED);
|
709 |
|
710 |
if (null === $this->parser) {
|
711 |
$this->parser = new Parser($this);
|
744 |
*/
|
745 |
public function getCompiler()
|
746 |
{
|
747 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), \E_USER_DEPRECATED);
|
748 |
|
749 |
if (null === $this->compiler) {
|
750 |
$this->compiler = new Compiler($this);
|
785 |
public function compileSource($source, $name = null)
|
786 |
{
|
787 |
if (!$source instanceof Source) {
|
788 |
+
@trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), \E_USER_DEPRECATED);
|
789 |
$source = new Source($source, $name);
|
790 |
}
|
791 |
|
802 |
public function setLoader(LoaderInterface $loader)
|
803 |
{
|
804 |
if (!$loader instanceof SourceContextLoaderInterface && 0 !== strpos(\get_class($loader), 'Mock_')) {
|
805 |
+
@trigger_error(sprintf('Twig loader "%s" should implement Twig\Loader\SourceContextLoaderInterface since version 1.27.', \get_class($loader)), \E_USER_DEPRECATED);
|
806 |
}
|
807 |
|
808 |
$this->loader = $loader;
|
857 |
|
858 |
$parentClass = $m->getDeclaringClass()->getName();
|
859 |
if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
|
860 |
+
@trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated since version 1.23. Use the `needs_environment` option to get the \Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig\Extension\InitRuntimeInterface if needed (not recommended).', $name), \E_USER_DEPRECATED);
|
861 |
}
|
862 |
}
|
863 |
|
883 |
|
884 |
if (isset($this->extensions[$class])) {
|
885 |
if ($class !== \get_class($this->extensions[$class])) {
|
886 |
+
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), \E_USER_DEPRECATED);
|
887 |
}
|
888 |
|
889 |
return true;
|
918 |
|
919 |
if (isset($this->extensions[$class])) {
|
920 |
if ($class !== \get_class($this->extensions[$class])) {
|
921 |
+
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), \E_USER_DEPRECATED);
|
922 |
}
|
923 |
|
924 |
return $this->extensions[$class];
|
965 |
if ($class !== $extension->getName()) {
|
966 |
if (isset($this->extensions[$extension->getName()])) {
|
967 |
unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]);
|
968 |
+
@trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), \E_USER_DEPRECATED);
|
969 |
}
|
970 |
}
|
971 |
|
986 |
*/
|
987 |
public function removeExtension($name)
|
988 |
{
|
989 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.12 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
990 |
|
991 |
if ($this->extensionInitialized) {
|
992 |
throw new \LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name));
|
1001 |
|
1002 |
if (isset($this->extensions[$class])) {
|
1003 |
if ($class !== \get_class($this->extensions[$class])) {
|
1004 |
+
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), \E_USER_DEPRECATED);
|
1005 |
}
|
1006 |
|
1007 |
unset($this->extensions[$class]);
|
1120 |
$filter = $name;
|
1121 |
$name = $filter->getName();
|
1122 |
} else {
|
1123 |
+
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), \E_USER_DEPRECATED);
|
1124 |
}
|
1125 |
|
1126 |
if ($this->extensionInitialized) {
|
1215 |
$test = $name;
|
1216 |
$name = $test->getName();
|
1217 |
} else {
|
1218 |
+
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), \E_USER_DEPRECATED);
|
1219 |
}
|
1220 |
|
1221 |
if ($this->extensionInitialized) {
|
1292 |
$function = $name;
|
1293 |
$name = $function->getName();
|
1294 |
} else {
|
1295 |
+
@trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), \E_USER_DEPRECATED);
|
1296 |
}
|
1297 |
|
1298 |
if ($this->extensionInitialized) {
|
1389 |
|
1390 |
if (!\array_key_exists($name, $this->globals)) {
|
1391 |
// The deprecation notice must be turned into the following exception in Twig 2.0
|
1392 |
+
@trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated since version 1.21.', $name), \E_USER_DEPRECATED);
|
1393 |
//throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
|
1394 |
}
|
1395 |
}
|
1479 |
*/
|
1480 |
public function computeAlternatives($name, $items)
|
1481 |
{
|
1482 |
+
@trigger_error(sprintf('The %s method is deprecated since version 1.23 and will be removed in Twig 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
1483 |
|
1484 |
return SyntaxError::computeAlternatives($name, $items);
|
1485 |
}
|
1496 |
|
1497 |
$parentClass = $m->getDeclaringClass()->getName();
|
1498 |
if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
|
1499 |
+
@trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.', $name), \E_USER_DEPRECATED);
|
1500 |
}
|
1501 |
}
|
1502 |
|
1548 |
if ($filter instanceof TwigFilter) {
|
1549 |
$name = $filter->getName();
|
1550 |
} else {
|
1551 |
+
@trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated since version 1.21. Use \Twig_SimpleFilter instead.', \get_class($filter), $name), \E_USER_DEPRECATED);
|
1552 |
}
|
1553 |
|
1554 |
$this->filters[$name] = $filter;
|
1559 |
if ($function instanceof TwigFunction) {
|
1560 |
$name = $function->getName();
|
1561 |
} else {
|
1562 |
+
@trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated since version 1.21. Use \Twig_SimpleFunction instead.', \get_class($function), $name), \E_USER_DEPRECATED);
|
1563 |
}
|
1564 |
|
1565 |
$this->functions[$name] = $function;
|
1570 |
if ($test instanceof TwigTest) {
|
1571 |
$name = $test->getName();
|
1572 |
} else {
|
1573 |
+
@trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated since version 1.21. Use \Twig_SimpleTest instead.', \get_class($test), $name), \E_USER_DEPRECATED);
|
1574 |
}
|
1575 |
|
1576 |
$this->tests[$name] = $test;
|
1581 |
if ($parser instanceof TokenParserInterface) {
|
1582 |
$this->parsers->addTokenParser($parser);
|
1583 |
} elseif ($parser instanceof \Twig_TokenParserBrokerInterface) {
|
1584 |
+
@trigger_error('Registering a \Twig_TokenParserBrokerInterface instance is deprecated since version 1.21.', \E_USER_DEPRECATED);
|
1585 |
|
1586 |
$this->parsers->addTokenParserBroker($parser);
|
1587 |
} else {
|
1623 |
array_keys($this->extensions),
|
1624 |
[
|
1625 |
(int) \function_exists('twig_template_get_attributes'),
|
1626 |
+
\PHP_MAJOR_VERSION,
|
1627 |
+
\PHP_MINOR_VERSION,
|
1628 |
self::VERSION,
|
1629 |
(int) $this->debug,
|
1630 |
$this->baseTemplateClass,
|
vendor/twig/twig/src/Error/Error.php
CHANGED
@@ -96,7 +96,7 @@ class Error extends \Exception
|
|
96 |
*/
|
97 |
public function getTemplateFile()
|
98 |
{
|
99 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
100 |
|
101 |
return $this->filename;
|
102 |
}
|
@@ -110,7 +110,7 @@ class Error extends \Exception
|
|
110 |
*/
|
111 |
public function setTemplateFile($name)
|
112 |
{
|
113 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
114 |
|
115 |
$this->filename = $name;
|
116 |
|
@@ -126,7 +126,7 @@ class Error extends \Exception
|
|
126 |
*/
|
127 |
public function getTemplateName()
|
128 |
{
|
129 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
130 |
|
131 |
return $this->filename;
|
132 |
}
|
@@ -140,7 +140,7 @@ class Error extends \Exception
|
|
140 |
*/
|
141 |
public function setTemplateName($name)
|
142 |
{
|
143 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
144 |
|
145 |
$this->filename = $name;
|
146 |
$this->sourceCode = $this->sourcePath = null;
|
@@ -264,11 +264,11 @@ class Error extends \Exception
|
|
264 |
$template = null;
|
265 |
$templateClass = null;
|
266 |
|
267 |
-
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
268 |
foreach ($backtrace as $trace) {
|
269 |
if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) {
|
270 |
$currentClass = \get_class($trace['object']);
|
271 |
-
$isEmbedContainer = 0 === strpos($templateClass, $currentClass);
|
272 |
if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) {
|
273 |
$template = $trace['object'];
|
274 |
$templateClass = \get_class($trace['object']);
|
96 |
*/
|
97 |
public function getTemplateFile()
|
98 |
{
|
99 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
100 |
|
101 |
return $this->filename;
|
102 |
}
|
110 |
*/
|
111 |
public function setTemplateFile($name)
|
112 |
{
|
113 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
114 |
|
115 |
$this->filename = $name;
|
116 |
|
126 |
*/
|
127 |
public function getTemplateName()
|
128 |
{
|
129 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
130 |
|
131 |
return $this->filename;
|
132 |
}
|
140 |
*/
|
141 |
public function setTemplateName($name)
|
142 |
{
|
143 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
144 |
|
145 |
$this->filename = $name;
|
146 |
$this->sourceCode = $this->sourcePath = null;
|
264 |
$template = null;
|
265 |
$templateClass = null;
|
266 |
|
267 |
+
$backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
268 |
foreach ($backtrace as $trace) {
|
269 |
if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) {
|
270 |
$currentClass = \get_class($trace['object']);
|
271 |
+
$isEmbedContainer = null === $templateClass ? false : 0 === strpos($templateClass, $currentClass);
|
272 |
if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) {
|
273 |
$template = $trace['object'];
|
274 |
$templateClass = \get_class($trace['object']);
|
vendor/twig/twig/src/ExpressionParser.php
CHANGED
@@ -43,8 +43,8 @@ use Twig\Node\Node;
|
|
43 |
*/
|
44 |
class ExpressionParser
|
45 |
{
|
46 |
-
const OPERATOR_LEFT = 1;
|
47 |
-
const OPERATOR_RIGHT = 2;
|
48 |
|
49 |
protected $parser;
|
50 |
protected $unaryOperators;
|
@@ -61,7 +61,7 @@ class ExpressionParser
|
|
61 |
$this->unaryOperators = $env->getUnaryOperators();
|
62 |
$this->binaryOperators = $env->getBinaryOperators();
|
63 |
} else {
|
64 |
-
@trigger_error('Passing the operators as constructor arguments to '.__METHOD__.' is deprecated since version 1.27. Pass the environment instead.', E_USER_DEPRECATED);
|
65 |
|
66 |
$this->env = $parser->getEnvironment();
|
67 |
$this->unaryOperators = func_get_arg(1);
|
@@ -376,7 +376,16 @@ class ExpressionParser
|
|
376 |
// * a string -- 'a'
|
377 |
// * a name, which is equivalent to a string -- a
|
378 |
// * an expression, which must be enclosed in parentheses -- (1 + 2)
|
379 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
$key = new ConstantExpression($token->getValue(), $token->getLine());
|
381 |
} elseif ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
|
382 |
$key = $this->parseExpression();
|
@@ -598,6 +607,11 @@ class ExpressionParser
|
|
598 |
while (!$stream->test(Token::PUNCTUATION_TYPE, ')')) {
|
599 |
if (!empty($args)) {
|
600 |
$stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma');
|
|
|
|
|
|
|
|
|
|
|
601 |
}
|
602 |
|
603 |
if ($definition) {
|
@@ -618,7 +632,7 @@ class ExpressionParser
|
|
618 |
$value = $this->parsePrimaryExpression();
|
619 |
|
620 |
if (!$this->checkConstantExpression($value)) {
|
621 |
-
throw new SyntaxError(
|
622 |
}
|
623 |
} else {
|
624 |
$value = $this->parseExpression(0, $allowArrow);
|
@@ -657,7 +671,7 @@ class ExpressionParser
|
|
657 |
$stream->expect(Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
658 |
}
|
659 |
$value = $token->getValue();
|
660 |
-
if (\in_array(
|
661 |
throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
|
662 |
}
|
663 |
$targets[] = new AssignNameExpression($value, $token->getLine());
|
@@ -697,6 +711,8 @@ class ExpressionParser
|
|
697 |
$arguments = null;
|
698 |
if ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
|
699 |
$arguments = $this->parseArguments(true);
|
|
|
|
|
700 |
}
|
701 |
|
702 |
return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine());
|
@@ -740,9 +756,9 @@ class ExpressionParser
|
|
740 |
$message .= sprintf('. Use "%s" instead', $test->getAlternative());
|
741 |
}
|
742 |
$src = $stream->getSourceContext();
|
743 |
-
$message .= sprintf(' in %s at line %d.', $src->getPath()
|
744 |
|
745 |
-
@trigger_error($message, E_USER_DEPRECATED);
|
746 |
}
|
747 |
|
748 |
if ($test instanceof TwigTest) {
|
@@ -770,9 +786,9 @@ class ExpressionParser
|
|
770 |
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
|
771 |
}
|
772 |
$src = $this->parser->getStream()->getSourceContext();
|
773 |
-
$message .= sprintf(' in %s at line %d.', $src->getPath()
|
774 |
|
775 |
-
@trigger_error($message, E_USER_DEPRECATED);
|
776 |
}
|
777 |
|
778 |
if ($function instanceof TwigFunction) {
|
@@ -800,9 +816,9 @@ class ExpressionParser
|
|
800 |
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
|
801 |
}
|
802 |
$src = $this->parser->getStream()->getSourceContext();
|
803 |
-
$message .= sprintf(' in %s at line %d.', $src->getPath()
|
804 |
|
805 |
-
@trigger_error($message, E_USER_DEPRECATED);
|
806 |
}
|
807 |
|
808 |
if ($filter instanceof TwigFilter) {
|
43 |
*/
|
44 |
class ExpressionParser
|
45 |
{
|
46 |
+
public const OPERATOR_LEFT = 1;
|
47 |
+
public const OPERATOR_RIGHT = 2;
|
48 |
|
49 |
protected $parser;
|
50 |
protected $unaryOperators;
|
61 |
$this->unaryOperators = $env->getUnaryOperators();
|
62 |
$this->binaryOperators = $env->getBinaryOperators();
|
63 |
} else {
|
64 |
+
@trigger_error('Passing the operators as constructor arguments to '.__METHOD__.' is deprecated since version 1.27. Pass the environment instead.', \E_USER_DEPRECATED);
|
65 |
|
66 |
$this->env = $parser->getEnvironment();
|
67 |
$this->unaryOperators = func_get_arg(1);
|
376 |
// * a string -- 'a'
|
377 |
// * a name, which is equivalent to a string -- a
|
378 |
// * an expression, which must be enclosed in parentheses -- (1 + 2)
|
379 |
+
if ($token = $stream->nextIf(Token::NAME_TYPE)) {
|
380 |
+
$key = new ConstantExpression($token->getValue(), $token->getLine());
|
381 |
+
|
382 |
+
// {a} is a shortcut for {a:a}
|
383 |
+
if ($stream->test(Token::PUNCTUATION_TYPE, [',', '}'])) {
|
384 |
+
$value = new NameExpression($key->getAttribute('value'), $key->getTemplateLine());
|
385 |
+
$node->addElement($value, $key);
|
386 |
+
continue;
|
387 |
+
}
|
388 |
+
} elseif (($token = $stream->nextIf(Token::STRING_TYPE)) || $token = $stream->nextIf(Token::NUMBER_TYPE)) {
|
389 |
$key = new ConstantExpression($token->getValue(), $token->getLine());
|
390 |
} elseif ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
|
391 |
$key = $this->parseExpression();
|
607 |
while (!$stream->test(Token::PUNCTUATION_TYPE, ')')) {
|
608 |
if (!empty($args)) {
|
609 |
$stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma');
|
610 |
+
|
611 |
+
// if the comma above was a trailing comma, early exit the argument parse loop
|
612 |
+
if ($stream->test(Token::PUNCTUATION_TYPE, ')')) {
|
613 |
+
break;
|
614 |
+
}
|
615 |
}
|
616 |
|
617 |
if ($definition) {
|
632 |
$value = $this->parsePrimaryExpression();
|
633 |
|
634 |
if (!$this->checkConstantExpression($value)) {
|
635 |
+
throw new SyntaxError('A default value for an argument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $stream->getSourceContext());
|
636 |
}
|
637 |
} else {
|
638 |
$value = $this->parseExpression(0, $allowArrow);
|
671 |
$stream->expect(Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
672 |
}
|
673 |
$value = $token->getValue();
|
674 |
+
if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) {
|
675 |
throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
|
676 |
}
|
677 |
$targets[] = new AssignNameExpression($value, $token->getLine());
|
711 |
$arguments = null;
|
712 |
if ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
|
713 |
$arguments = $this->parseArguments(true);
|
714 |
+
} elseif ($test->hasOneMandatoryArgument()) {
|
715 |
+
$arguments = new Node([0 => $this->parsePrimaryExpression()]);
|
716 |
}
|
717 |
|
718 |
return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine());
|
756 |
$message .= sprintf('. Use "%s" instead', $test->getAlternative());
|
757 |
}
|
758 |
$src = $stream->getSourceContext();
|
759 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine());
|
760 |
|
761 |
+
@trigger_error($message, \E_USER_DEPRECATED);
|
762 |
}
|
763 |
|
764 |
if ($test instanceof TwigTest) {
|
786 |
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
|
787 |
}
|
788 |
$src = $this->parser->getStream()->getSourceContext();
|
789 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
|
790 |
|
791 |
+
@trigger_error($message, \E_USER_DEPRECATED);
|
792 |
}
|
793 |
|
794 |
if ($function instanceof TwigFunction) {
|
816 |
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
|
817 |
}
|
818 |
$src = $this->parser->getStream()->getSourceContext();
|
819 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
|
820 |
|
821 |
+
@trigger_error($message, \E_USER_DEPRECATED);
|
822 |
}
|
823 |
|
824 |
if ($filter instanceof TwigFilter) {
|
vendor/twig/twig/src/Extension/AbstractExtension.php
CHANGED
@@ -65,7 +65,7 @@ abstract class AbstractExtension implements ExtensionInterface
|
|
65 |
*/
|
66 |
public function getName()
|
67 |
{
|
68 |
-
return
|
69 |
}
|
70 |
}
|
71 |
|
65 |
*/
|
66 |
public function getName()
|
67 |
{
|
68 |
+
return static::class;
|
69 |
}
|
70 |
}
|
71 |
|
vendor/twig/twig/src/Extension/CoreExtension.php
CHANGED
@@ -194,9 +194,9 @@ class CoreExtension extends AbstractExtension
|
|
194 |
new TwigFilter('sort', 'twig_sort_filter'),
|
195 |
new TwigFilter('merge', 'twig_array_merge'),
|
196 |
new TwigFilter('batch', 'twig_array_batch'),
|
197 |
-
new TwigFilter('filter', 'twig_array_filter'),
|
198 |
-
new TwigFilter('map', 'twig_array_map'),
|
199 |
-
new TwigFilter('reduce', 'twig_array_reduce'),
|
200 |
|
201 |
// string/array filters
|
202 |
new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]),
|
@@ -244,11 +244,11 @@ class CoreExtension extends AbstractExtension
|
|
244 |
new TwigTest('odd', null, ['node_class' => '\Twig\Node\Expression\Test\OddTest']),
|
245 |
new TwigTest('defined', null, ['node_class' => '\Twig\Node\Expression\Test\DefinedTest']),
|
246 |
new TwigTest('sameas', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'deprecated' => '1.21', 'alternative' => 'same as']),
|
247 |
-
new TwigTest('same as', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest']),
|
248 |
new TwigTest('none', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
|
249 |
new TwigTest('null', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
|
250 |
new TwigTest('divisibleby', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'deprecated' => '1.21', 'alternative' => 'divisible by']),
|
251 |
-
new TwigTest('divisible by', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest']),
|
252 |
new TwigTest('constant', null, ['node_class' => '\Twig\Node\Expression\Test\ConstantTest']),
|
253 |
new TwigTest('empty', 'twig_test_empty'),
|
254 |
new TwigTest('iterable', 'twig_test_iterable'),
|
@@ -313,6 +313,8 @@ use Twig\Loader\SourceContextLoaderInterface;
|
|
313 |
use Twig\Markup;
|
314 |
use Twig\Node\Expression\ConstantExpression;
|
315 |
use Twig\Node\Node;
|
|
|
|
|
316 |
|
317 |
/**
|
318 |
* Cycles over a value.
|
@@ -347,7 +349,7 @@ function twig_cycle($values, $position)
|
|
347 |
function twig_random(Environment $env, $values = null, $max = null)
|
348 |
{
|
349 |
if (null === $values) {
|
350 |
-
return null === $max ? mt_rand() : mt_rand(0, $max);
|
351 |
}
|
352 |
|
353 |
if (\is_int($values) || \is_float($values)) {
|
@@ -364,7 +366,7 @@ function twig_random(Environment $env, $values = null, $max = null)
|
|
364 |
$max = $max;
|
365 |
}
|
366 |
|
367 |
-
return mt_rand($min, $max);
|
368 |
}
|
369 |
|
370 |
if (\is_string($values)) {
|
@@ -459,7 +461,7 @@ function twig_date_modify_filter(Environment $env, $date, $modifier)
|
|
459 |
* @param \DateTime|\DateTimeInterface|string|null $date A date
|
460 |
* @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
|
461 |
*
|
462 |
-
* @return \
|
463 |
*/
|
464 |
function twig_date_converter(Environment $env, $date = null, $timezone = null)
|
465 |
{
|
@@ -487,6 +489,10 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null)
|
|
487 |
}
|
488 |
|
489 |
if (null === $date || 'now' === $date) {
|
|
|
|
|
|
|
|
|
490 |
return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone());
|
491 |
}
|
492 |
|
@@ -509,14 +515,14 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null)
|
|
509 |
*
|
510 |
* @param string $str String to replace in
|
511 |
* @param array|\Traversable $from Replace values
|
512 |
-
* @param string|null $to Replace to, deprecated (@see https://
|
513 |
*
|
514 |
* @return string
|
515 |
*/
|
516 |
function twig_replace_filter($str, $from, $to = null)
|
517 |
{
|
518 |
if (\is_string($from) && \is_string($to)) {
|
519 |
-
@trigger_error('Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0', E_USER_DEPRECATED);
|
520 |
|
521 |
return strtr($str, $from, $to);
|
522 |
}
|
@@ -539,15 +545,15 @@ function twig_replace_filter($str, $from, $to = null)
|
|
539 |
*/
|
540 |
function twig_round($value, $precision = 0, $method = 'common')
|
541 |
{
|
542 |
-
if ('common'
|
543 |
return round($value, $precision);
|
544 |
}
|
545 |
|
546 |
-
if ('ceil'
|
547 |
throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.');
|
548 |
}
|
549 |
|
550 |
-
return $method($value *
|
551 |
}
|
552 |
|
553 |
/**
|
@@ -593,7 +599,7 @@ function twig_urlencode_filter($url)
|
|
593 |
{
|
594 |
if (\is_array($url)) {
|
595 |
if (\defined('PHP_QUERY_RFC3986')) {
|
596 |
-
return http_build_query($url, '', '&', PHP_QUERY_RFC3986);
|
597 |
}
|
598 |
|
599 |
return http_build_query($url, '', '&');
|
@@ -790,7 +796,7 @@ function twig_join_filter($value, $glue = '', $and = null)
|
|
790 |
*/
|
791 |
function twig_split_filter(Environment $env, $value, $delimiter, $limit = null)
|
792 |
{
|
793 |
-
if (
|
794 |
return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit);
|
795 |
}
|
796 |
|
@@ -1041,7 +1047,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char
|
|
1041 |
|
1042 |
switch ($strategy) {
|
1043 |
case 'html':
|
1044 |
-
// see https://
|
1045 |
|
1046 |
// Using a static variable to avoid initializing the array
|
1047 |
// each time the function is called. Moving the declaration on the
|
@@ -1064,18 +1070,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char
|
|
1064 |
];
|
1065 |
|
1066 |
if (isset($htmlspecialcharsCharsets[$charset])) {
|
1067 |
-
return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
|
1068 |
}
|
1069 |
|
1070 |
if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) {
|
1071 |
// cache the lowercase variant for future iterations
|
1072 |
$htmlspecialcharsCharsets[$charset] = true;
|
1073 |
|
1074 |
-
return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
|
1075 |
}
|
1076 |
|
1077 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1078 |
-
$string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
1079 |
|
1080 |
return twig_convert_encoding($string, $charset, 'UTF-8');
|
1081 |
|
@@ -1214,7 +1220,7 @@ function _twig_escape_js_callback($matches)
|
|
1214 |
|
1215 |
/*
|
1216 |
* A few characters have short escape sequences in JSON and JavaScript.
|
1217 |
-
* Escape sequences supported only by JavaScript, not JSON, are
|
1218 |
* \" is also supported but omitted, because the resulting string is not HTML safe.
|
1219 |
*/
|
1220 |
static $shortMap = [
|
@@ -1231,15 +1237,18 @@ function _twig_escape_js_callback($matches)
|
|
1231 |
return $shortMap[$char];
|
1232 |
}
|
1233 |
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
if (4 >= \strlen($char)) {
|
1239 |
-
return sprintf('\u%04s', $char);
|
1240 |
}
|
1241 |
|
1242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1243 |
}
|
1244 |
|
1245 |
function _twig_escape_css_callback($matches)
|
@@ -1376,7 +1385,7 @@ if (\function_exists('mb_get_info')) {
|
|
1376 |
function twig_title_string_filter(Environment $env, $string)
|
1377 |
{
|
1378 |
if (null !== $charset = $env->getCharset()) {
|
1379 |
-
return mb_convert_case($string, MB_CASE_TITLE, $charset);
|
1380 |
}
|
1381 |
|
1382 |
return ucwords(strtolower($string));
|
@@ -1504,7 +1513,11 @@ function twig_to_array($seq, $preserveKeys = true)
|
|
1504 |
function twig_test_empty($value)
|
1505 |
{
|
1506 |
if ($value instanceof \Countable) {
|
1507 |
-
return 0
|
|
|
|
|
|
|
|
|
1508 |
}
|
1509 |
|
1510 |
if (\is_object($value) && method_exists($value, '__toString')) {
|
@@ -1556,6 +1569,13 @@ function twig_include(Environment $env, $context, $template, $variables = [], $w
|
|
1556 |
if (!$alreadySandboxed = $sandbox->isSandboxed()) {
|
1557 |
$sandbox->enableSandbox();
|
1558 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1559 |
}
|
1560 |
|
1561 |
$loaded = null;
|
@@ -1689,8 +1709,16 @@ function twig_array_batch($items, $size, $fill = null, $preserveKeys = true)
|
|
1689 |
return $result;
|
1690 |
}
|
1691 |
|
1692 |
-
function twig_array_filter($array, $arrow)
|
1693 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1694 |
if (\is_array($array)) {
|
1695 |
if (\PHP_VERSION_ID >= 50600) {
|
1696 |
return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH);
|
@@ -1703,8 +1731,12 @@ function twig_array_filter($array, $arrow)
|
|
1703 |
return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow);
|
1704 |
}
|
1705 |
|
1706 |
-
function twig_array_map($array, $arrow)
|
1707 |
{
|
|
|
|
|
|
|
|
|
1708 |
$r = [];
|
1709 |
foreach ($array as $k => $v) {
|
1710 |
$r[$k] = $arrow($v, $k);
|
@@ -1713,9 +1745,17 @@ function twig_array_map($array, $arrow)
|
|
1713 |
return $r;
|
1714 |
}
|
1715 |
|
1716 |
-
function twig_array_reduce($array, $arrow, $initial = null)
|
1717 |
{
|
|
|
|
|
|
|
|
|
1718 |
if (!\is_array($array)) {
|
|
|
|
|
|
|
|
|
1719 |
$array = iterator_to_array($array);
|
1720 |
}
|
1721 |
|
194 |
new TwigFilter('sort', 'twig_sort_filter'),
|
195 |
new TwigFilter('merge', 'twig_array_merge'),
|
196 |
new TwigFilter('batch', 'twig_array_batch'),
|
197 |
+
new TwigFilter('filter', 'twig_array_filter', ['needs_environment' => true]),
|
198 |
+
new TwigFilter('map', 'twig_array_map', ['needs_environment' => true]),
|
199 |
+
new TwigFilter('reduce', 'twig_array_reduce', ['needs_environment' => true]),
|
200 |
|
201 |
// string/array filters
|
202 |
new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]),
|
244 |
new TwigTest('odd', null, ['node_class' => '\Twig\Node\Expression\Test\OddTest']),
|
245 |
new TwigTest('defined', null, ['node_class' => '\Twig\Node\Expression\Test\DefinedTest']),
|
246 |
new TwigTest('sameas', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'deprecated' => '1.21', 'alternative' => 'same as']),
|
247 |
+
new TwigTest('same as', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'one_mandatory_argument' => true]),
|
248 |
new TwigTest('none', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
|
249 |
new TwigTest('null', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
|
250 |
new TwigTest('divisibleby', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'deprecated' => '1.21', 'alternative' => 'divisible by']),
|
251 |
+
new TwigTest('divisible by', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'one_mandatory_argument' => true]),
|
252 |
new TwigTest('constant', null, ['node_class' => '\Twig\Node\Expression\Test\ConstantTest']),
|
253 |
new TwigTest('empty', 'twig_test_empty'),
|
254 |
new TwigTest('iterable', 'twig_test_iterable'),
|
313 |
use Twig\Markup;
|
314 |
use Twig\Node\Expression\ConstantExpression;
|
315 |
use Twig\Node\Node;
|
316 |
+
use Twig\Template;
|
317 |
+
use Twig\TemplateWrapper;
|
318 |
|
319 |
/**
|
320 |
* Cycles over a value.
|
349 |
function twig_random(Environment $env, $values = null, $max = null)
|
350 |
{
|
351 |
if (null === $values) {
|
352 |
+
return null === $max ? mt_rand() : mt_rand(0, (int) $max);
|
353 |
}
|
354 |
|
355 |
if (\is_int($values) || \is_float($values)) {
|
366 |
$max = $max;
|
367 |
}
|
368 |
|
369 |
+
return mt_rand((int) $min, (int) $max);
|
370 |
}
|
371 |
|
372 |
if (\is_string($values)) {
|
461 |
* @param \DateTime|\DateTimeInterface|string|null $date A date
|
462 |
* @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
|
463 |
*
|
464 |
+
* @return \DateTimeInterface
|
465 |
*/
|
466 |
function twig_date_converter(Environment $env, $date = null, $timezone = null)
|
467 |
{
|
489 |
}
|
490 |
|
491 |
if (null === $date || 'now' === $date) {
|
492 |
+
if (null === $date) {
|
493 |
+
$date = 'now';
|
494 |
+
}
|
495 |
+
|
496 |
return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone());
|
497 |
}
|
498 |
|
515 |
*
|
516 |
* @param string $str String to replace in
|
517 |
* @param array|\Traversable $from Replace values
|
518 |
+
* @param string|null $to Replace to, deprecated (@see https://www.php.net/manual/en/function.strtr.php)
|
519 |
*
|
520 |
* @return string
|
521 |
*/
|
522 |
function twig_replace_filter($str, $from, $to = null)
|
523 |
{
|
524 |
if (\is_string($from) && \is_string($to)) {
|
525 |
+
@trigger_error('Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0', \E_USER_DEPRECATED);
|
526 |
|
527 |
return strtr($str, $from, $to);
|
528 |
}
|
545 |
*/
|
546 |
function twig_round($value, $precision = 0, $method = 'common')
|
547 |
{
|
548 |
+
if ('common' === $method) {
|
549 |
return round($value, $precision);
|
550 |
}
|
551 |
|
552 |
+
if ('ceil' !== $method && 'floor' !== $method) {
|
553 |
throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.');
|
554 |
}
|
555 |
|
556 |
+
return $method($value * 10 ** $precision) / 10 ** $precision;
|
557 |
}
|
558 |
|
559 |
/**
|
599 |
{
|
600 |
if (\is_array($url)) {
|
601 |
if (\defined('PHP_QUERY_RFC3986')) {
|
602 |
+
return http_build_query($url, '', '&', \PHP_QUERY_RFC3986);
|
603 |
}
|
604 |
|
605 |
return http_build_query($url, '', '&');
|
796 |
*/
|
797 |
function twig_split_filter(Environment $env, $value, $delimiter, $limit = null)
|
798 |
{
|
799 |
+
if (\strlen($delimiter) > 0) {
|
800 |
return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit);
|
801 |
}
|
802 |
|
1047 |
|
1048 |
switch ($strategy) {
|
1049 |
case 'html':
|
1050 |
+
// see https://www.php.net/htmlspecialchars
|
1051 |
|
1052 |
// Using a static variable to avoid initializing the array
|
1053 |
// each time the function is called. Moving the declaration on the
|
1070 |
];
|
1071 |
|
1072 |
if (isset($htmlspecialcharsCharsets[$charset])) {
|
1073 |
+
return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset);
|
1074 |
}
|
1075 |
|
1076 |
if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) {
|
1077 |
// cache the lowercase variant for future iterations
|
1078 |
$htmlspecialcharsCharsets[$charset] = true;
|
1079 |
|
1080 |
+
return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset);
|
1081 |
}
|
1082 |
|
1083 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1084 |
+
$string = htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8');
|
1085 |
|
1086 |
return twig_convert_encoding($string, $charset, 'UTF-8');
|
1087 |
|
1220 |
|
1221 |
/*
|
1222 |
* A few characters have short escape sequences in JSON and JavaScript.
|
1223 |
+
* Escape sequences supported only by JavaScript, not JSON, are omitted.
|
1224 |
* \" is also supported but omitted, because the resulting string is not HTML safe.
|
1225 |
*/
|
1226 |
static $shortMap = [
|
1237 |
return $shortMap[$char];
|
1238 |
}
|
1239 |
|
1240 |
+
$codepoint = mb_ord($char, 'UTF-8');
|
1241 |
+
if (0x10000 > $codepoint) {
|
1242 |
+
return sprintf('\u%04X', $codepoint);
|
|
|
|
|
|
|
1243 |
}
|
1244 |
|
1245 |
+
// Split characters outside the BMP into surrogate pairs
|
1246 |
+
// https://tools.ietf.org/html/rfc2781.html#section-2.1
|
1247 |
+
$u = $codepoint - 0x10000;
|
1248 |
+
$high = 0xD800 | ($u >> 10);
|
1249 |
+
$low = 0xDC00 | ($u & 0x3FF);
|
1250 |
+
|
1251 |
+
return sprintf('\u%04X\u%04X', $high, $low);
|
1252 |
}
|
1253 |
|
1254 |
function _twig_escape_css_callback($matches)
|
1385 |
function twig_title_string_filter(Environment $env, $string)
|
1386 |
{
|
1387 |
if (null !== $charset = $env->getCharset()) {
|
1388 |
+
return mb_convert_case($string, \MB_CASE_TITLE, $charset);
|
1389 |
}
|
1390 |
|
1391 |
return ucwords(strtolower($string));
|
1513 |
function twig_test_empty($value)
|
1514 |
{
|
1515 |
if ($value instanceof \Countable) {
|
1516 |
+
return 0 === \count($value);
|
1517 |
+
}
|
1518 |
+
|
1519 |
+
if ($value instanceof \Traversable) {
|
1520 |
+
return !iterator_count($value);
|
1521 |
}
|
1522 |
|
1523 |
if (\is_object($value) && method_exists($value, '__toString')) {
|
1569 |
if (!$alreadySandboxed = $sandbox->isSandboxed()) {
|
1570 |
$sandbox->enableSandbox();
|
1571 |
}
|
1572 |
+
|
1573 |
+
foreach ((\is_array($template) ? $template : [$template]) as $name) {
|
1574 |
+
// if a Template instance is passed, it might have been instantiated outside of a sandbox, check security
|
1575 |
+
if ($name instanceof TemplateWrapper || $name instanceof Template) {
|
1576 |
+
$name->unwrap()->checkSecurity();
|
1577 |
+
}
|
1578 |
+
}
|
1579 |
}
|
1580 |
|
1581 |
$loaded = null;
|
1709 |
return $result;
|
1710 |
}
|
1711 |
|
1712 |
+
function twig_array_filter(Environment $env, $array, $arrow)
|
1713 |
{
|
1714 |
+
if (!twig_test_iterable($array)) {
|
1715 |
+
throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array)));
|
1716 |
+
}
|
1717 |
+
|
1718 |
+
if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) {
|
1719 |
+
throw new RuntimeError('The callable passed to "filter" filter must be a Closure in sandbox mode.');
|
1720 |
+
}
|
1721 |
+
|
1722 |
if (\is_array($array)) {
|
1723 |
if (\PHP_VERSION_ID >= 50600) {
|
1724 |
return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH);
|
1731 |
return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow);
|
1732 |
}
|
1733 |
|
1734 |
+
function twig_array_map(Environment $env, $array, $arrow)
|
1735 |
{
|
1736 |
+
if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) {
|
1737 |
+
throw new RuntimeError('The callable passed to the "map" filter must be a Closure in sandbox mode.');
|
1738 |
+
}
|
1739 |
+
|
1740 |
$r = [];
|
1741 |
foreach ($array as $k => $v) {
|
1742 |
$r[$k] = $arrow($v, $k);
|
1745 |
return $r;
|
1746 |
}
|
1747 |
|
1748 |
+
function twig_array_reduce(Environment $env, $array, $arrow, $initial = null)
|
1749 |
{
|
1750 |
+
if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) {
|
1751 |
+
throw new RuntimeError('The callable passed to the "reduce" filter must be a Closure in sandbox mode.');
|
1752 |
+
}
|
1753 |
+
|
1754 |
if (!\is_array($array)) {
|
1755 |
+
if (!$array instanceof \Traversable) {
|
1756 |
+
throw new RuntimeError(sprintf('The "reduce" filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array)));
|
1757 |
+
}
|
1758 |
+
|
1759 |
$array = iterator_to_array($array);
|
1760 |
}
|
1761 |
|
vendor/twig/twig/src/Extension/EscaperExtension.php
CHANGED
@@ -60,13 +60,13 @@ class EscaperExtension extends AbstractExtension
|
|
60 |
{
|
61 |
// for BC
|
62 |
if (true === $defaultStrategy) {
|
63 |
-
@trigger_error('Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead.', E_USER_DEPRECATED);
|
64 |
|
65 |
$defaultStrategy = 'html';
|
66 |
}
|
67 |
|
68 |
if ('filename' === $defaultStrategy) {
|
69 |
-
@trigger_error('Using "filename" as the default strategy is deprecated since version 1.27. Use "name" instead.', E_USER_DEPRECATED);
|
70 |
|
71 |
$defaultStrategy = 'name';
|
72 |
}
|
60 |
{
|
61 |
// for BC
|
62 |
if (true === $defaultStrategy) {
|
63 |
+
@trigger_error('Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead.', \E_USER_DEPRECATED);
|
64 |
|
65 |
$defaultStrategy = 'html';
|
66 |
}
|
67 |
|
68 |
if ('filename' === $defaultStrategy) {
|
69 |
+
@trigger_error('Using "filename" as the default strategy is deprecated since version 1.27. Use "name" instead.', \E_USER_DEPRECATED);
|
70 |
|
71 |
$defaultStrategy = 'name';
|
72 |
}
|
vendor/twig/twig/src/Extension/ProfilerExtension.php
CHANGED
@@ -41,7 +41,7 @@ class ProfilerExtension extends AbstractExtension
|
|
41 |
|
42 |
public function getNodeVisitors()
|
43 |
{
|
44 |
-
return [new ProfilerNodeVisitor(
|
45 |
}
|
46 |
|
47 |
public function getName()
|
41 |
|
42 |
public function getNodeVisitors()
|
43 |
{
|
44 |
+
return [new ProfilerNodeVisitor(static::class)];
|
45 |
}
|
46 |
|
47 |
public function getName()
|
vendor/twig/twig/src/Extension/StagingExtension.php
CHANGED
@@ -35,7 +35,7 @@ class StagingExtension extends AbstractExtension
|
|
35 |
public function addFunction($name, $function)
|
36 |
{
|
37 |
if (isset($this->functions[$name])) {
|
38 |
-
@trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
39 |
}
|
40 |
|
41 |
$this->functions[$name] = $function;
|
@@ -49,7 +49,7 @@ class StagingExtension extends AbstractExtension
|
|
49 |
public function addFilter($name, $filter)
|
50 |
{
|
51 |
if (isset($this->filters[$name])) {
|
52 |
-
@trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
53 |
}
|
54 |
|
55 |
$this->filters[$name] = $filter;
|
@@ -73,7 +73,7 @@ class StagingExtension extends AbstractExtension
|
|
73 |
public function addTokenParser(TokenParserInterface $parser)
|
74 |
{
|
75 |
if (isset($this->tokenParsers[$parser->getTag()])) {
|
76 |
-
@trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), E_USER_DEPRECATED);
|
77 |
}
|
78 |
|
79 |
$this->tokenParsers[$parser->getTag()] = $parser;
|
@@ -97,7 +97,7 @@ class StagingExtension extends AbstractExtension
|
|
97 |
public function addTest($name, $test)
|
98 |
{
|
99 |
if (isset($this->tests[$name])) {
|
100 |
-
@trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
101 |
}
|
102 |
|
103 |
$this->tests[$name] = $test;
|
35 |
public function addFunction($name, $function)
|
36 |
{
|
37 |
if (isset($this->functions[$name])) {
|
38 |
+
@trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), \E_USER_DEPRECATED);
|
39 |
}
|
40 |
|
41 |
$this->functions[$name] = $function;
|
49 |
public function addFilter($name, $filter)
|
50 |
{
|
51 |
if (isset($this->filters[$name])) {
|
52 |
+
@trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), \E_USER_DEPRECATED);
|
53 |
}
|
54 |
|
55 |
$this->filters[$name] = $filter;
|
73 |
public function addTokenParser(TokenParserInterface $parser)
|
74 |
{
|
75 |
if (isset($this->tokenParsers[$parser->getTag()])) {
|
76 |
+
@trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), \E_USER_DEPRECATED);
|
77 |
}
|
78 |
|
79 |
$this->tokenParsers[$parser->getTag()] = $parser;
|
97 |
public function addTest($name, $test)
|
98 |
{
|
99 |
if (isset($this->tests[$name])) {
|
100 |
+
@trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), \E_USER_DEPRECATED);
|
101 |
}
|
102 |
|
103 |
$this->tests[$name] = $test;
|
vendor/twig/twig/src/FileExtensionEscapingStrategy.php
CHANGED
@@ -41,7 +41,7 @@ class FileExtensionEscapingStrategy
|
|
41 |
$name = substr($name, 0, -5);
|
42 |
}
|
43 |
|
44 |
-
$extension = pathinfo($name, PATHINFO_EXTENSION);
|
45 |
|
46 |
switch ($extension) {
|
47 |
case 'js':
|
41 |
$name = substr($name, 0, -5);
|
42 |
}
|
43 |
|
44 |
+
$extension = pathinfo($name, \PATHINFO_EXTENSION);
|
45 |
|
46 |
switch ($extension) {
|
47 |
case 'js':
|
vendor/twig/twig/src/Lexer.php
CHANGED
@@ -40,18 +40,18 @@ class Lexer implements \Twig_LexerInterface
|
|
40 |
|
41 |
private $source;
|
42 |
|
43 |
-
const STATE_DATA = 0;
|
44 |
-
const STATE_BLOCK = 1;
|
45 |
-
const STATE_VAR = 2;
|
46 |
-
const STATE_STRING = 3;
|
47 |
-
const STATE_INTERPOLATION = 4;
|
48 |
-
|
49 |
-
const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A';
|
50 |
-
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A';
|
51 |
-
const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
|
52 |
-
const REGEX_DQ_STRING_DELIM = '/"/A';
|
53 |
-
const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
|
54 |
-
const PUNCTUATION = '()[]{}?:.,|';
|
55 |
|
56 |
public function __construct(Environment $env, array $options = [])
|
57 |
{
|
@@ -117,7 +117,7 @@ class Lexer implements \Twig_LexerInterface
|
|
117 |
// #}
|
118 |
'lex_comment' => '{
|
119 |
(?:'.
|
120 |
-
preg_quote($this->options['whitespace_trim']
|
121 |
'|'.
|
122 |
preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]*
|
123 |
'|'.
|
@@ -163,14 +163,14 @@ class Lexer implements \Twig_LexerInterface
|
|
163 |
public function tokenize($code, $name = null)
|
164 |
{
|
165 |
if (!$code instanceof Source) {
|
166 |
-
@trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
167 |
$this->source = new Source($code, $name);
|
168 |
} else {
|
169 |
$this->source = $code;
|
170 |
}
|
171 |
|
172 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
173 |
-
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED);
|
174 |
}
|
175 |
|
176 |
if (\function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
|
@@ -192,7 +192,7 @@ class Lexer implements \Twig_LexerInterface
|
|
192 |
$this->position = -1;
|
193 |
|
194 |
// find all token starts in one go
|
195 |
-
preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE);
|
196 |
$this->positions = $matches;
|
197 |
|
198 |
while ($this->cursor < $this->end) {
|
@@ -351,7 +351,7 @@ class Lexer implements \Twig_LexerInterface
|
|
351 |
// numbers
|
352 |
elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) {
|
353 |
$number = (float) $match[0]; // floats
|
354 |
-
if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) {
|
355 |
$number = (int) $match[0]; // integers lower than the maximum
|
356 |
}
|
357 |
$this->pushToken(Token::NUMBER_TYPE, $number);
|
@@ -398,10 +398,10 @@ class Lexer implements \Twig_LexerInterface
|
|
398 |
protected function lexRawData($tag)
|
399 |
{
|
400 |
if ('raw' === $tag) {
|
401 |
-
@trigger_error(sprintf('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED);
|
402 |
}
|
403 |
|
404 |
-
if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
405 |
throw new SyntaxError(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source);
|
406 |
}
|
407 |
|
@@ -425,7 +425,7 @@ class Lexer implements \Twig_LexerInterface
|
|
425 |
|
426 |
protected function lexComment()
|
427 |
{
|
428 |
-
if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
429 |
throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source);
|
430 |
}
|
431 |
|
@@ -499,11 +499,15 @@ class Lexer implements \Twig_LexerInterface
|
|
499 |
$regex = [];
|
500 |
foreach ($operators as $operator => $length) {
|
501 |
// an operator that ends with a character must be followed by
|
502 |
-
// a whitespace or
|
|
|
503 |
if (ctype_alpha($operator[$length - 1])) {
|
504 |
-
$r
|
505 |
-
}
|
506 |
-
|
|
|
|
|
|
|
507 |
}
|
508 |
|
509 |
// an operator with a space can be any amount of whitespaces
|
40 |
|
41 |
private $source;
|
42 |
|
43 |
+
public const STATE_DATA = 0;
|
44 |
+
public const STATE_BLOCK = 1;
|
45 |
+
public const STATE_VAR = 2;
|
46 |
+
public const STATE_STRING = 3;
|
47 |
+
public const STATE_INTERPOLATION = 4;
|
48 |
+
|
49 |
+
public const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A';
|
50 |
+
public const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A';
|
51 |
+
public const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
|
52 |
+
public const REGEX_DQ_STRING_DELIM = '/"/A';
|
53 |
+
public const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
|
54 |
+
public const PUNCTUATION = '()[]{}?:.,|';
|
55 |
|
56 |
public function __construct(Environment $env, array $options = [])
|
57 |
{
|
117 |
// #}
|
118 |
'lex_comment' => '{
|
119 |
(?:'.
|
120 |
+
preg_quote($this->options['whitespace_trim'].$this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n?
|
121 |
'|'.
|
122 |
preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]*
|
123 |
'|'.
|
163 |
public function tokenize($code, $name = null)
|
164 |
{
|
165 |
if (!$code instanceof Source) {
|
166 |
+
@trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a \Twig\Source instance instead.', __METHOD__), \E_USER_DEPRECATED);
|
167 |
$this->source = new Source($code, $name);
|
168 |
} else {
|
169 |
$this->source = $code;
|
170 |
}
|
171 |
|
172 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
173 |
+
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
174 |
}
|
175 |
|
176 |
if (\function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
|
192 |
$this->position = -1;
|
193 |
|
194 |
// find all token starts in one go
|
195 |
+
preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, \PREG_OFFSET_CAPTURE);
|
196 |
$this->positions = $matches;
|
197 |
|
198 |
while ($this->cursor < $this->end) {
|
351 |
// numbers
|
352 |
elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) {
|
353 |
$number = (float) $match[0]; // floats
|
354 |
+
if (ctype_digit($match[0]) && $number <= \PHP_INT_MAX) {
|
355 |
$number = (int) $match[0]; // integers lower than the maximum
|
356 |
}
|
357 |
$this->pushToken(Token::NUMBER_TYPE, $number);
|
398 |
protected function lexRawData($tag)
|
399 |
{
|
400 |
if ('raw' === $tag) {
|
401 |
+
@trigger_error(sprintf('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), \E_USER_DEPRECATED);
|
402 |
}
|
403 |
|
404 |
+
if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) {
|
405 |
throw new SyntaxError(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source);
|
406 |
}
|
407 |
|
425 |
|
426 |
protected function lexComment()
|
427 |
{
|
428 |
+
if (!preg_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) {
|
429 |
throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source);
|
430 |
}
|
431 |
|
499 |
$regex = [];
|
500 |
foreach ($operators as $operator => $length) {
|
501 |
// an operator that ends with a character must be followed by
|
502 |
+
// a whitespace, a parenthesis, an opening map [ or sequence {
|
503 |
+
$r = preg_quote($operator, '/');
|
504 |
if (ctype_alpha($operator[$length - 1])) {
|
505 |
+
$r .= '(?=[\s()\[{])';
|
506 |
+
}
|
507 |
+
|
508 |
+
// an operator that begins with a character must not have a dot or pipe before
|
509 |
+
if (ctype_alpha($operator[0])) {
|
510 |
+
$r = '(?<![\.\|])'.$r;
|
511 |
}
|
512 |
|
513 |
// an operator with a space can be any amount of whitespaces
|
vendor/twig/twig/src/Loader/ArrayLoader.php
CHANGED
@@ -53,7 +53,7 @@ class ArrayLoader implements LoaderInterface, ExistsLoaderInterface, SourceConte
|
|
53 |
|
54 |
public function getSource($name)
|
55 |
{
|
56 |
-
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.',
|
57 |
|
58 |
$name = (string) $name;
|
59 |
if (!isset($this->templates[$name])) {
|
53 |
|
54 |
public function getSource($name)
|
55 |
{
|
56 |
+
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', static::class), \E_USER_DEPRECATED);
|
57 |
|
58 |
$name = (string) $name;
|
59 |
if (!isset($this->templates[$name])) {
|
vendor/twig/twig/src/Loader/ChainLoader.php
CHANGED
@@ -52,7 +52,7 @@ class ChainLoader implements LoaderInterface, ExistsLoaderInterface, SourceConte
|
|
52 |
|
53 |
public function getSource($name)
|
54 |
{
|
55 |
-
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.',
|
56 |
|
57 |
$exceptions = [];
|
58 |
foreach ($this->loaders as $loader) {
|
52 |
|
53 |
public function getSource($name)
|
54 |
{
|
55 |
+
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', static::class), \E_USER_DEPRECATED);
|
56 |
|
57 |
$exceptions = [];
|
58 |
foreach ($this->loaders as $loader) {
|
vendor/twig/twig/src/Loader/FilesystemLoader.php
CHANGED
@@ -22,7 +22,7 @@ use Twig\Source;
|
|
22 |
class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface
|
23 |
{
|
24 |
/** Identifier of the main namespace. */
|
25 |
-
const MAIN_NAMESPACE = '__main__';
|
26 |
|
27 |
protected $paths = [];
|
28 |
protected $cache = [];
|
@@ -37,7 +37,7 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
|
|
37 |
public function __construct($paths = [], $rootPath = null)
|
38 |
{
|
39 |
$this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR;
|
40 |
-
if (false !== $realPath = realpath($rootPath)) {
|
41 |
$this->rootPath = $realPath.\DIRECTORY_SEPARATOR;
|
42 |
}
|
43 |
|
@@ -138,7 +138,7 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
|
|
138 |
|
139 |
public function getSource($name)
|
140 |
{
|
141 |
-
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.',
|
142 |
|
143 |
if (null === ($path = $this->findTemplate($name)) || false === $path) {
|
144 |
return '';
|
@@ -180,7 +180,7 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
|
|
180 |
try {
|
181 |
return null !== ($path = $this->findTemplate($name, false)) && false !== $path;
|
182 |
} catch (LoaderError $e) {
|
183 |
-
@trigger_error(sprintf('In %s::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.',
|
184 |
|
185 |
return false;
|
186 |
}
|
@@ -315,7 +315,7 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
|
|
315 |
&& ':' === substr($file, 1, 1)
|
316 |
&& strspn($file, '/\\', 2, 1)
|
317 |
)
|
318 |
-
|| null !== parse_url($file, PHP_URL_SCHEME)
|
319 |
;
|
320 |
}
|
321 |
}
|
22 |
class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface
|
23 |
{
|
24 |
/** Identifier of the main namespace. */
|
25 |
+
public const MAIN_NAMESPACE = '__main__';
|
26 |
|
27 |
protected $paths = [];
|
28 |
protected $cache = [];
|
37 |
public function __construct($paths = [], $rootPath = null)
|
38 |
{
|
39 |
$this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR;
|
40 |
+
if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) {
|
41 |
$this->rootPath = $realPath.\DIRECTORY_SEPARATOR;
|
42 |
}
|
43 |
|
138 |
|
139 |
public function getSource($name)
|
140 |
{
|
141 |
+
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', static::class), \E_USER_DEPRECATED);
|
142 |
|
143 |
if (null === ($path = $this->findTemplate($name)) || false === $path) {
|
144 |
return '';
|
180 |
try {
|
181 |
return null !== ($path = $this->findTemplate($name, false)) && false !== $path;
|
182 |
} catch (LoaderError $e) {
|
183 |
+
@trigger_error(sprintf('In %s::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.', static::class), \E_USER_DEPRECATED);
|
184 |
|
185 |
return false;
|
186 |
}
|
315 |
&& ':' === substr($file, 1, 1)
|
316 |
&& strspn($file, '/\\', 2, 1)
|
317 |
)
|
318 |
+
|| null !== parse_url($file, \PHP_URL_SCHEME)
|
319 |
;
|
320 |
}
|
321 |
}
|
vendor/twig/twig/src/Markup.php
CHANGED
@@ -32,6 +32,9 @@ class Markup implements \Countable
|
|
32 |
return $this->content;
|
33 |
}
|
34 |
|
|
|
|
|
|
|
35 |
public function count()
|
36 |
{
|
37 |
return \function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : \strlen($this->content);
|
32 |
return $this->content;
|
33 |
}
|
34 |
|
35 |
+
/**
|
36 |
+
* @return int
|
37 |
+
*/
|
38 |
public function count()
|
39 |
{
|
40 |
return \function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : \strlen($this->content);
|
vendor/twig/twig/src/Node/CheckSecurityCallNode.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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\Node;
|
13 |
+
|
14 |
+
use Twig\Compiler;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class CheckSecurityCallNode extends Node
|
20 |
+
{
|
21 |
+
public function compile(Compiler $compiler)
|
22 |
+
{
|
23 |
+
$compiler
|
24 |
+
->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n")
|
25 |
+
->write("\$this->checkSecurity();\n")
|
26 |
+
;
|
27 |
+
}
|
28 |
+
}
|
vendor/twig/twig/src/Node/CheckSecurityNode.php
CHANGED
@@ -45,10 +45,13 @@ class CheckSecurityNode extends Node
|
|
45 |
}
|
46 |
|
47 |
$compiler
|
48 |
-
->write("
|
49 |
-
->write(
|
50 |
-
->write(
|
51 |
-
->
|
|
|
|
|
|
|
52 |
->write("try {\n")
|
53 |
->indent()
|
54 |
->write("\$this->sandbox->checkSecurity(\n")
|
@@ -78,6 +81,8 @@ class CheckSecurityNode extends Node
|
|
78 |
->write("throw \$e;\n")
|
79 |
->outdent()
|
80 |
->write("}\n\n")
|
|
|
|
|
81 |
;
|
82 |
}
|
83 |
}
|
45 |
}
|
46 |
|
47 |
$compiler
|
48 |
+
->write("\n")
|
49 |
+
->write("public function checkSecurity()\n")
|
50 |
+
->write("{\n")
|
51 |
+
->indent()
|
52 |
+
->write('static $tags = ')->repr(array_filter($tags))->raw(";\n")
|
53 |
+
->write('static $filters = ')->repr(array_filter($filters))->raw(";\n")
|
54 |
+
->write('static $functions = ')->repr(array_filter($functions))->raw(";\n\n")
|
55 |
->write("try {\n")
|
56 |
->indent()
|
57 |
->write("\$this->sandbox->checkSecurity(\n")
|
81 |
->write("throw \$e;\n")
|
82 |
->outdent()
|
83 |
->write("}\n\n")
|
84 |
+
->outdent()
|
85 |
+
->write("}\n")
|
86 |
;
|
87 |
}
|
88 |
}
|
vendor/twig/twig/src/Node/EmbedNode.php
CHANGED
@@ -23,7 +23,7 @@ use Twig\Node\Expression\ConstantExpression;
|
|
23 |
class EmbedNode extends IncludeNode
|
24 |
{
|
25 |
// we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module)
|
26 |
-
public function __construct($name, $index, AbstractExpression $variables
|
27 |
{
|
28 |
parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag);
|
29 |
|
23 |
class EmbedNode extends IncludeNode
|
24 |
{
|
25 |
// we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module)
|
26 |
+
public function __construct($name, $index, ?AbstractExpression $variables, $only, $ignoreMissing, $lineno, $tag = null)
|
27 |
{
|
28 |
parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag);
|
29 |
|
vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php
CHANGED
@@ -25,10 +25,10 @@ class BlockReferenceExpression extends AbstractExpression
|
|
25 |
/**
|
26 |
* @param Node|null $template
|
27 |
*/
|
28 |
-
public function __construct(\Twig_NodeInterface $name, $template
|
29 |
{
|
30 |
if (\is_bool($template)) {
|
31 |
-
@trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED);
|
32 |
|
33 |
$template = null;
|
34 |
}
|
25 |
/**
|
26 |
* @param Node|null $template
|
27 |
*/
|
28 |
+
public function __construct(\Twig_NodeInterface $name, $template, $lineno, $tag = null)
|
29 |
{
|
30 |
if (\is_bool($template)) {
|
31 |
+
@trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
32 |
|
33 |
$template = null;
|
34 |
}
|
vendor/twig/twig/src/Node/Expression/CallExpression.php
CHANGED
@@ -149,7 +149,16 @@ abstract class CallExpression extends AbstractExpression
|
|
149 |
$optionalArguments = [];
|
150 |
$pos = 0;
|
151 |
foreach ($callableParameters as $callableParameter) {
|
152 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
if (\array_key_exists($name, $parameters)) {
|
155 |
if (\array_key_exists($pos, $parameters)) {
|
@@ -254,7 +263,8 @@ abstract class CallExpression extends AbstractExpression
|
|
254 |
}
|
255 |
if ($isVariadic) {
|
256 |
$argument = end($parameters);
|
257 |
-
|
|
|
258 |
array_pop($parameters);
|
259 |
} else {
|
260 |
$callableName = $r->name;
|
149 |
$optionalArguments = [];
|
150 |
$pos = 0;
|
151 |
foreach ($callableParameters as $callableParameter) {
|
152 |
+
$name = $this->normalizeName($callableParameter->name);
|
153 |
+
if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) {
|
154 |
+
if ('start' === $name) {
|
155 |
+
$name = 'low';
|
156 |
+
} elseif ('end' === $name) {
|
157 |
+
$name = 'high';
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
$names[] = $name;
|
162 |
|
163 |
if (\array_key_exists($name, $parameters)) {
|
164 |
if (\array_key_exists($pos, $parameters)) {
|
263 |
}
|
264 |
if ($isVariadic) {
|
265 |
$argument = end($parameters);
|
266 |
+
$isArray = $argument && $argument->hasType() && 'array' === $argument->getType()->getName();
|
267 |
+
if ($isArray && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) {
|
268 |
array_pop($parameters);
|
269 |
} else {
|
270 |
$callableName = $r->name;
|
vendor/twig/twig/src/Node/Expression/GetAttrExpression.php
CHANGED
@@ -17,7 +17,7 @@ use Twig\Template;
|
|
17 |
|
18 |
class GetAttrExpression extends AbstractExpression
|
19 |
{
|
20 |
-
public function __construct(AbstractExpression $node, AbstractExpression $attribute, AbstractExpression $arguments
|
21 |
{
|
22 |
$nodes = ['node' => $node, 'attribute' => $attribute];
|
23 |
if (null !== $arguments) {
|
@@ -30,7 +30,7 @@ class GetAttrExpression extends AbstractExpression
|
|
30 |
public function compile(Compiler $compiler)
|
31 |
{
|
32 |
if ($this->getAttribute('disable_c_ext')) {
|
33 |
-
@trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED);
|
34 |
}
|
35 |
|
36 |
if (\function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
|
17 |
|
18 |
class GetAttrExpression extends AbstractExpression
|
19 |
{
|
20 |
+
public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno)
|
21 |
{
|
22 |
$nodes = ['node' => $node, 'attribute' => $attribute];
|
23 |
if (null !== $arguments) {
|
30 |
public function compile(Compiler $compiler)
|
31 |
{
|
32 |
if ($this->getAttribute('disable_c_ext')) {
|
33 |
+
@trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), \E_USER_DEPRECATED);
|
34 |
}
|
35 |
|
36 |
if (\function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
|
vendor/twig/twig/src/Node/Expression/NameExpression.php
CHANGED
@@ -36,7 +36,7 @@ class NameExpression extends AbstractExpression
|
|
36 |
if ($this->getAttribute('is_defined_test')) {
|
37 |
if ($this->isSpecial()) {
|
38 |
$compiler->repr(true);
|
39 |
-
} elseif (\PHP_VERSION_ID >=
|
40 |
$compiler
|
41 |
->raw('array_key_exists(')
|
42 |
->string($name)
|
36 |
if ($this->getAttribute('is_defined_test')) {
|
37 |
if ($this->isSpecial()) {
|
38 |
$compiler->repr(true);
|
39 |
+
} elseif (\PHP_VERSION_ID >= 70400) {
|
40 |
$compiler
|
41 |
->raw('array_key_exists(')
|
42 |
->string($name)
|
vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php
CHANGED
@@ -22,11 +22,15 @@ class NullCoalesceExpression extends ConditionalExpression
|
|
22 |
{
|
23 |
public function __construct(\Twig_NodeInterface $left, \Twig_NodeInterface $right, $lineno)
|
24 |
{
|
25 |
-
$test = new
|
26 |
-
|
27 |
-
|
28 |
-
$
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
parent::__construct($test, $left, $right, $lineno);
|
32 |
}
|
22 |
{
|
23 |
public function __construct(\Twig_NodeInterface $left, \Twig_NodeInterface $right, $lineno)
|
24 |
{
|
25 |
+
$test = new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine());
|
26 |
+
// for "block()", we don't need the null test as the return value is always a string
|
27 |
+
if (!$left instanceof BlockReferenceExpression) {
|
28 |
+
$test = new AndBinary(
|
29 |
+
$test,
|
30 |
+
new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()),
|
31 |
+
$left->getTemplateLine()
|
32 |
+
);
|
33 |
+
}
|
34 |
|
35 |
parent::__construct($test, $left, $right, $lineno);
|
36 |
}
|
vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php
CHANGED
@@ -33,7 +33,7 @@ use Twig\Node\Expression\TestExpression;
|
|
33 |
*/
|
34 |
class DefinedTest extends TestExpression
|
35 |
{
|
36 |
-
public function __construct(\Twig_NodeInterface $node, $name,
|
37 |
{
|
38 |
if ($node instanceof NameExpression) {
|
39 |
$node->setAttribute('is_defined_test', true);
|
33 |
*/
|
34 |
class DefinedTest extends TestExpression
|
35 |
{
|
36 |
+
public function __construct(\Twig_NodeInterface $node, $name, ?\Twig_NodeInterface $arguments, $lineno)
|
37 |
{
|
38 |
if ($node instanceof NameExpression) {
|
39 |
$node->setAttribute('is_defined_test', true);
|
vendor/twig/twig/src/Node/Expression/Test/OddTest.php
CHANGED
@@ -28,7 +28,7 @@ class OddTest extends TestExpression
|
|
28 |
$compiler
|
29 |
->raw('(')
|
30 |
->subcompile($this->getNode('node'))
|
31 |
-
->raw(' % 2
|
32 |
->raw(')')
|
33 |
;
|
34 |
}
|
28 |
$compiler
|
29 |
->raw('(')
|
30 |
->subcompile($this->getNode('node'))
|
31 |
+
->raw(' % 2 != 0')
|
32 |
->raw(')')
|
33 |
;
|
34 |
}
|
vendor/twig/twig/src/Node/Expression/TestExpression.php
CHANGED
@@ -16,7 +16,7 @@ use Twig\TwigTest;
|
|
16 |
|
17 |
class TestExpression extends CallExpression
|
18 |
{
|
19 |
-
public function __construct(\Twig_NodeInterface $node, $name,
|
20 |
{
|
21 |
$nodes = ['node' => $node];
|
22 |
if (null !== $arguments) {
|
16 |
|
17 |
class TestExpression extends CallExpression
|
18 |
{
|
19 |
+
public function __construct(\Twig_NodeInterface $node, $name, ?\Twig_NodeInterface $arguments, $lineno)
|
20 |
{
|
21 |
$nodes = ['node' => $node];
|
22 |
if (null !== $arguments) {
|
vendor/twig/twig/src/Node/ForNode.php
CHANGED
@@ -25,7 +25,7 @@ class ForNode extends Node
|
|
25 |
{
|
26 |
protected $loop;
|
27 |
|
28 |
-
public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, AbstractExpression $ifexpr
|
29 |
{
|
30 |
$body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]);
|
31 |
|
25 |
{
|
26 |
protected $loop;
|
27 |
|
28 |
+
public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?AbstractExpression $ifexpr, \Twig_NodeInterface $body, ?\Twig_NodeInterface $else, $lineno, $tag = null)
|
29 |
{
|
30 |
$body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]);
|
31 |
|
vendor/twig/twig/src/Node/IfNode.php
CHANGED
@@ -21,7 +21,7 @@ use Twig\Compiler;
|
|
21 |
*/
|
22 |
class IfNode extends Node
|
23 |
{
|
24 |
-
public function __construct(\Twig_NodeInterface $tests,
|
25 |
{
|
26 |
$nodes = ['tests' => $tests];
|
27 |
if (null !== $else) {
|
21 |
*/
|
22 |
class IfNode extends Node
|
23 |
{
|
24 |
+
public function __construct(\Twig_NodeInterface $tests, ?\Twig_NodeInterface $else, $lineno, $tag = null)
|
25 |
{
|
26 |
$nodes = ['tests' => $tests];
|
27 |
if (null !== $else) {
|
vendor/twig/twig/src/Node/IncludeNode.php
CHANGED
@@ -22,7 +22,7 @@ use Twig\Node\Expression\AbstractExpression;
|
|
22 |
*/
|
23 |
class IncludeNode extends Node implements NodeOutputInterface
|
24 |
{
|
25 |
-
public function __construct(AbstractExpression $expr, AbstractExpression $variables
|
26 |
{
|
27 |
$nodes = ['expr' => $expr];
|
28 |
if (null !== $variables) {
|
22 |
*/
|
23 |
class IncludeNode extends Node implements NodeOutputInterface
|
24 |
{
|
25 |
+
public function __construct(AbstractExpression $expr, ?AbstractExpression $variables, $only, $ignoreMissing, $lineno, $tag = null)
|
26 |
{
|
27 |
$nodes = ['expr' => $expr];
|
28 |
if (null !== $variables) {
|
vendor/twig/twig/src/Node/MacroNode.php
CHANGED
@@ -21,7 +21,7 @@ use Twig\Error\SyntaxError;
|
|
21 |
*/
|
22 |
class MacroNode extends Node
|
23 |
{
|
24 |
-
const VARARGS_NAME = 'varargs';
|
25 |
|
26 |
public function __construct($name, \Twig_NodeInterface $body, \Twig_NodeInterface $arguments, $lineno, $tag = null)
|
27 |
{
|
21 |
*/
|
22 |
class MacroNode extends Node
|
23 |
{
|
24 |
+
public const VARARGS_NAME = 'varargs';
|
25 |
|
26 |
public function __construct($name, \Twig_NodeInterface $body, \Twig_NodeInterface $arguments, $lineno, $tag = null)
|
27 |
{
|
vendor/twig/twig/src/Node/ModuleNode.php
CHANGED
@@ -28,10 +28,10 @@ use Twig\Source;
|
|
28 |
*/
|
29 |
class ModuleNode extends Node
|
30 |
{
|
31 |
-
public function __construct(\Twig_NodeInterface $body, AbstractExpression $parent
|
32 |
{
|
33 |
if (!$name instanceof Source) {
|
34 |
-
@trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
35 |
$source = new Source($source, $name);
|
36 |
} else {
|
37 |
$source = $name;
|
28 |
*/
|
29 |
class ModuleNode extends Node
|
30 |
{
|
31 |
+
public function __construct(\Twig_NodeInterface $body, ?AbstractExpression $parent, \Twig_NodeInterface $blocks, \Twig_NodeInterface $macros, \Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '')
|
32 |
{
|
33 |
if (!$name instanceof Source) {
|
34 |
+
@trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), \E_USER_DEPRECATED);
|
35 |
$source = new Source($source, $name);
|
36 |
} else {
|
37 |
$source = $name;
|
vendor/twig/twig/src/Node/Node.php
CHANGED
@@ -40,7 +40,7 @@ class Node implements \Twig_NodeInterface
|
|
40 |
{
|
41 |
foreach ($nodes as $name => $node) {
|
42 |
if (!$node instanceof \Twig_NodeInterface) {
|
43 |
-
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name,
|
44 |
}
|
45 |
}
|
46 |
$this->nodes = $nodes;
|
@@ -56,7 +56,7 @@ class Node implements \Twig_NodeInterface
|
|
56 |
$attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true)));
|
57 |
}
|
58 |
|
59 |
-
$repr = [
|
60 |
|
61 |
if (\count($this->nodes)) {
|
62 |
foreach ($this->nodes as $name => $node) {
|
@@ -82,14 +82,14 @@ class Node implements \Twig_NodeInterface
|
|
82 |
*/
|
83 |
public function toXml($asDom = false)
|
84 |
{
|
85 |
-
@trigger_error(sprintf('%s is deprecated since version 1.16.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED);
|
86 |
|
87 |
$dom = new \DOMDocument('1.0', 'UTF-8');
|
88 |
$dom->formatOutput = true;
|
89 |
$dom->appendChild($xml = $dom->createElement('twig'));
|
90 |
|
91 |
$xml->appendChild($node = $dom->createElement('node'));
|
92 |
-
$node->setAttribute('class',
|
93 |
|
94 |
foreach ($this->attributes as $name => $value) {
|
95 |
$node->appendChild($attribute = $dom->createElement('attribute'));
|
@@ -129,7 +129,7 @@ class Node implements \Twig_NodeInterface
|
|
129 |
*/
|
130 |
public function getLine()
|
131 |
{
|
132 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', E_USER_DEPRECATED);
|
133 |
|
134 |
return $this->lineno;
|
135 |
}
|
@@ -153,7 +153,7 @@ class Node implements \Twig_NodeInterface
|
|
153 |
public function getAttribute($name)
|
154 |
{
|
155 |
if (!\array_key_exists($name, $this->attributes)) {
|
156 |
-
throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name,
|
157 |
}
|
158 |
|
159 |
return $this->attributes[$name];
|
@@ -187,7 +187,7 @@ class Node implements \Twig_NodeInterface
|
|
187 |
public function getNode($name)
|
188 |
{
|
189 |
if (!\array_key_exists($name, $this->nodes)) {
|
190 |
-
throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name,
|
191 |
}
|
192 |
|
193 |
return $this->nodes[$name];
|
@@ -196,7 +196,7 @@ class Node implements \Twig_NodeInterface
|
|
196 |
public function setNode($name, $node = null)
|
197 |
{
|
198 |
if (!$node instanceof \Twig_NodeInterface) {
|
199 |
-
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name,
|
200 |
}
|
201 |
|
202 |
$this->nodes[$name] = $node;
|
@@ -207,11 +207,17 @@ class Node implements \Twig_NodeInterface
|
|
207 |
unset($this->nodes[$name]);
|
208 |
}
|
209 |
|
|
|
|
|
|
|
210 |
public function count()
|
211 |
{
|
212 |
return \count($this->nodes);
|
213 |
}
|
214 |
|
|
|
|
|
|
|
215 |
public function getIterator()
|
216 |
{
|
217 |
return new \ArrayIterator($this->nodes);
|
@@ -236,7 +242,7 @@ class Node implements \Twig_NodeInterface
|
|
236 |
{
|
237 |
$this->sourceContext = $source;
|
238 |
foreach ($this->nodes as $node) {
|
239 |
-
if ($node instanceof
|
240 |
$node->setSourceContext($source);
|
241 |
}
|
242 |
}
|
@@ -252,7 +258,7 @@ class Node implements \Twig_NodeInterface
|
|
252 |
*/
|
253 |
public function setFilename($name)
|
254 |
{
|
255 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use setTemplateName() instead.', E_USER_DEPRECATED);
|
256 |
|
257 |
$this->setTemplateName($name);
|
258 |
}
|
@@ -262,7 +268,7 @@ class Node implements \Twig_NodeInterface
|
|
262 |
*/
|
263 |
public function getFilename()
|
264 |
{
|
265 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateName() instead.', E_USER_DEPRECATED);
|
266 |
|
267 |
return $this->name;
|
268 |
}
|
40 |
{
|
41 |
foreach ($nodes as $name => $node) {
|
42 |
if (!$node instanceof \Twig_NodeInterface) {
|
43 |
+
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, static::class), \E_USER_DEPRECATED);
|
44 |
}
|
45 |
}
|
46 |
$this->nodes = $nodes;
|
56 |
$attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true)));
|
57 |
}
|
58 |
|
59 |
+
$repr = [static::class.'('.implode(', ', $attributes)];
|
60 |
|
61 |
if (\count($this->nodes)) {
|
62 |
foreach ($this->nodes as $name => $node) {
|
82 |
*/
|
83 |
public function toXml($asDom = false)
|
84 |
{
|
85 |
+
@trigger_error(sprintf('%s is deprecated since version 1.16.1 and will be removed in 2.0.', __METHOD__), \E_USER_DEPRECATED);
|
86 |
|
87 |
$dom = new \DOMDocument('1.0', 'UTF-8');
|
88 |
$dom->formatOutput = true;
|
89 |
$dom->appendChild($xml = $dom->createElement('twig'));
|
90 |
|
91 |
$xml->appendChild($node = $dom->createElement('node'));
|
92 |
+
$node->setAttribute('class', static::class);
|
93 |
|
94 |
foreach ($this->attributes as $name => $value) {
|
95 |
$node->appendChild($attribute = $dom->createElement('attribute'));
|
129 |
*/
|
130 |
public function getLine()
|
131 |
{
|
132 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', \E_USER_DEPRECATED);
|
133 |
|
134 |
return $this->lineno;
|
135 |
}
|
153 |
public function getAttribute($name)
|
154 |
{
|
155 |
if (!\array_key_exists($name, $this->attributes)) {
|
156 |
+
throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, static::class));
|
157 |
}
|
158 |
|
159 |
return $this->attributes[$name];
|
187 |
public function getNode($name)
|
188 |
{
|
189 |
if (!\array_key_exists($name, $this->nodes)) {
|
190 |
+
throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, static::class));
|
191 |
}
|
192 |
|
193 |
return $this->nodes[$name];
|
196 |
public function setNode($name, $node = null)
|
197 |
{
|
198 |
if (!$node instanceof \Twig_NodeInterface) {
|
199 |
+
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, static::class), \E_USER_DEPRECATED);
|
200 |
}
|
201 |
|
202 |
$this->nodes[$name] = $node;
|
207 |
unset($this->nodes[$name]);
|
208 |
}
|
209 |
|
210 |
+
/**
|
211 |
+
* @return int
|
212 |
+
*/
|
213 |
public function count()
|
214 |
{
|
215 |
return \count($this->nodes);
|
216 |
}
|
217 |
|
218 |
+
/**
|
219 |
+
* @return \Traversable
|
220 |
+
*/
|
221 |
public function getIterator()
|
222 |
{
|
223 |
return new \ArrayIterator($this->nodes);
|
242 |
{
|
243 |
$this->sourceContext = $source;
|
244 |
foreach ($this->nodes as $node) {
|
245 |
+
if ($node instanceof self) {
|
246 |
$node->setSourceContext($source);
|
247 |
}
|
248 |
}
|
258 |
*/
|
259 |
public function setFilename($name)
|
260 |
{
|
261 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use setTemplateName() instead.', \E_USER_DEPRECATED);
|
262 |
|
263 |
$this->setTemplateName($name);
|
264 |
}
|
268 |
*/
|
269 |
public function getFilename()
|
270 |
{
|
271 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateName() instead.', \E_USER_DEPRECATED);
|
272 |
|
273 |
return $this->name;
|
274 |
}
|
vendor/twig/twig/src/Node/SandboxNode.php
CHANGED
@@ -34,12 +34,19 @@ class SandboxNode extends Node
|
|
34 |
->write("\$this->sandbox->enableSandbox();\n")
|
35 |
->outdent()
|
36 |
->write("}\n")
|
|
|
|
|
37 |
->subcompile($this->getNode('body'))
|
|
|
|
|
|
|
38 |
->write("if (!\$alreadySandboxed) {\n")
|
39 |
->indent()
|
40 |
->write("\$this->sandbox->disableSandbox();\n")
|
41 |
->outdent()
|
42 |
->write("}\n")
|
|
|
|
|
43 |
;
|
44 |
}
|
45 |
}
|
34 |
->write("\$this->sandbox->enableSandbox();\n")
|
35 |
->outdent()
|
36 |
->write("}\n")
|
37 |
+
->write("try {\n")
|
38 |
+
->indent()
|
39 |
->subcompile($this->getNode('body'))
|
40 |
+
->outdent()
|
41 |
+
->write("} finally {\n")
|
42 |
+
->indent()
|
43 |
->write("if (!\$alreadySandboxed) {\n")
|
44 |
->indent()
|
45 |
->write("\$this->sandbox->disableSandbox();\n")
|
46 |
->outdent()
|
47 |
->write("}\n")
|
48 |
+
->outdent()
|
49 |
+
->write("}\n")
|
50 |
;
|
51 |
}
|
52 |
}
|
vendor/twig/twig/src/Node/WithNode.php
CHANGED
@@ -20,7 +20,7 @@ use Twig\Compiler;
|
|
20 |
*/
|
21 |
class WithNode extends Node
|
22 |
{
|
23 |
-
public function __construct(Node $body, Node $variables
|
24 |
{
|
25 |
$nodes = ['body' => $body];
|
26 |
if (null !== $variables) {
|
20 |
*/
|
21 |
class WithNode extends Node
|
22 |
{
|
23 |
+
public function __construct(Node $body, ?Node $variables, $only, $lineno, $tag = null)
|
24 |
{
|
25 |
$nodes = ['body' => $body];
|
26 |
if (null !== $variables) {
|
vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php
CHANGED
@@ -43,11 +43,11 @@ use Twig\Node\SetTempNode;
|
|
43 |
*/
|
44 |
class OptimizerNodeVisitor extends AbstractNodeVisitor
|
45 |
{
|
46 |
-
const OPTIMIZE_ALL = -1;
|
47 |
-
const OPTIMIZE_NONE = 0;
|
48 |
-
const OPTIMIZE_FOR = 2;
|
49 |
-
const OPTIMIZE_RAW_FILTER = 4;
|
50 |
-
const OPTIMIZE_VAR_ACCESS = 8;
|
51 |
|
52 |
protected $loops = [];
|
53 |
protected $loopsTargets = [];
|
43 |
*/
|
44 |
class OptimizerNodeVisitor extends AbstractNodeVisitor
|
45 |
{
|
46 |
+
public const OPTIMIZE_ALL = -1;
|
47 |
+
public const OPTIMIZE_NONE = 0;
|
48 |
+
public const OPTIMIZE_FOR = 2;
|
49 |
+
public const OPTIMIZE_RAW_FILTER = 4;
|
50 |
+
public const OPTIMIZE_VAR_ACCESS = 8;
|
51 |
|
52 |
protected $loops = [];
|
53 |
protected $loopsTargets = [];
|
vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php
CHANGED
@@ -12,6 +12,7 @@
|
|
12 |
namespace Twig\NodeVisitor;
|
13 |
|
14 |
use Twig\Environment;
|
|
|
15 |
use Twig\Node\CheckSecurityNode;
|
16 |
use Twig\Node\CheckToStringNode;
|
17 |
use Twig\Node\Expression\Binary\ConcatBinary;
|
@@ -102,7 +103,8 @@ class SandboxNodeVisitor extends AbstractNodeVisitor
|
|
102 |
if ($node instanceof ModuleNode) {
|
103 |
$this->inAModule = false;
|
104 |
|
105 |
-
$node->
|
|
|
106 |
} elseif ($this->inAModule) {
|
107 |
if ($node instanceof PrintNode || $node instanceof SetNode) {
|
108 |
$this->needsToStringWrap = false;
|
12 |
namespace Twig\NodeVisitor;
|
13 |
|
14 |
use Twig\Environment;
|
15 |
+
use Twig\Node\CheckSecurityCallNode;
|
16 |
use Twig\Node\CheckSecurityNode;
|
17 |
use Twig\Node\CheckToStringNode;
|
18 |
use Twig\Node\Expression\Binary\ConcatBinary;
|
103 |
if ($node instanceof ModuleNode) {
|
104 |
$this->inAModule = false;
|
105 |
|
106 |
+
$node->setNode('constructor_end', new Node([new CheckSecurityCallNode(), $node->getNode('constructor_end')]));
|
107 |
+
$node->setNode('class_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('class_end')]));
|
108 |
} elseif ($this->inAModule) {
|
109 |
if ($node instanceof PrintNode || $node instanceof SetNode) {
|
110 |
$this->needsToStringWrap = false;
|
vendor/twig/twig/src/Parser.php
CHANGED
@@ -60,7 +60,7 @@ class Parser implements \Twig_ParserInterface
|
|
60 |
*/
|
61 |
public function getEnvironment()
|
62 |
{
|
63 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED);
|
64 |
|
65 |
return $this->env;
|
66 |
}
|
@@ -75,7 +75,7 @@ class Parser implements \Twig_ParserInterface
|
|
75 |
*/
|
76 |
public function getFilename()
|
77 |
{
|
78 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use $parser->getStream()->getSourceContext()->getPath() instead.', __METHOD__), E_USER_DEPRECATED);
|
79 |
|
80 |
return $this->stream->getSourceContext()->getName();
|
81 |
}
|
@@ -229,7 +229,7 @@ class Parser implements \Twig_ParserInterface
|
|
229 |
*/
|
230 |
public function addHandler($name, $class)
|
231 |
{
|
232 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED);
|
233 |
|
234 |
$this->handlers[$name] = $class;
|
235 |
}
|
@@ -239,7 +239,7 @@ class Parser implements \Twig_ParserInterface
|
|
239 |
*/
|
240 |
public function addNodeVisitor(NodeVisitorInterface $visitor)
|
241 |
{
|
242 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED);
|
243 |
|
244 |
$this->visitors[] = $visitor;
|
245 |
}
|
@@ -299,7 +299,7 @@ class Parser implements \Twig_ParserInterface
|
|
299 |
$this->reservedMacroNames = [];
|
300 |
$r = new \ReflectionClass($this->env->getBaseTemplateClass());
|
301 |
foreach ($r->getMethods() as $method) {
|
302 |
-
$methodName =
|
303 |
|
304 |
if ('get' === substr($methodName, 0, 3) && isset($methodName[3])) {
|
305 |
$this->reservedMacroNames[] = substr($methodName, 3);
|
@@ -307,7 +307,7 @@ class Parser implements \Twig_ParserInterface
|
|
307 |
}
|
308 |
}
|
309 |
|
310 |
-
return \in_array(
|
311 |
}
|
312 |
|
313 |
public function addTrait($trait)
|
60 |
*/
|
61 |
public function getEnvironment()
|
62 |
{
|
63 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
64 |
|
65 |
return $this->env;
|
66 |
}
|
75 |
*/
|
76 |
public function getFilename()
|
77 |
{
|
78 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use $parser->getStream()->getSourceContext()->getPath() instead.', __METHOD__), \E_USER_DEPRECATED);
|
79 |
|
80 |
return $this->stream->getSourceContext()->getName();
|
81 |
}
|
229 |
*/
|
230 |
public function addHandler($name, $class)
|
231 |
{
|
232 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
233 |
|
234 |
$this->handlers[$name] = $class;
|
235 |
}
|
239 |
*/
|
240 |
public function addNodeVisitor(NodeVisitorInterface $visitor)
|
241 |
{
|
242 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
243 |
|
244 |
$this->visitors[] = $visitor;
|
245 |
}
|
299 |
$this->reservedMacroNames = [];
|
300 |
$r = new \ReflectionClass($this->env->getBaseTemplateClass());
|
301 |
foreach ($r->getMethods() as $method) {
|
302 |
+
$methodName = strtr($method->getName(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
|
303 |
|
304 |
if ('get' === substr($methodName, 0, 3) && isset($methodName[3])) {
|
305 |
$this->reservedMacroNames[] = substr($methodName, 3);
|
307 |
}
|
308 |
}
|
309 |
|
310 |
+
return \in_array(strtr($name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), $this->reservedMacroNames);
|
311 |
}
|
312 |
|
313 |
public function addTrait($trait)
|
vendor/twig/twig/src/Profiler/Profile.php
CHANGED
@@ -18,10 +18,10 @@ namespace Twig\Profiler;
|
|
18 |
*/
|
19 |
class Profile implements \IteratorAggregate, \Serializable
|
20 |
{
|
21 |
-
const ROOT = 'ROOT';
|
22 |
-
const BLOCK = 'block';
|
23 |
-
const TEMPLATE = 'template';
|
24 |
-
const MACRO = 'macro';
|
25 |
|
26 |
private $template;
|
27 |
private $name;
|
@@ -153,17 +153,17 @@ class Profile implements \IteratorAggregate, \Serializable
|
|
153 |
$this->enter();
|
154 |
}
|
155 |
|
156 |
-
public function getIterator()
|
157 |
{
|
158 |
return new \ArrayIterator($this->profiles);
|
159 |
}
|
160 |
|
161 |
-
public function serialize()
|
162 |
{
|
163 |
return serialize($this->__serialize());
|
164 |
}
|
165 |
|
166 |
-
public function unserialize($data)
|
167 |
{
|
168 |
$this->__unserialize(unserialize($data));
|
169 |
}
|
@@ -171,7 +171,7 @@ class Profile implements \IteratorAggregate, \Serializable
|
|
171 |
/**
|
172 |
* @internal
|
173 |
*/
|
174 |
-
public function __serialize()
|
175 |
{
|
176 |
return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles];
|
177 |
}
|
@@ -179,7 +179,7 @@ class Profile implements \IteratorAggregate, \Serializable
|
|
179 |
/**
|
180 |
* @internal
|
181 |
*/
|
182 |
-
public function __unserialize(array $data)
|
183 |
{
|
184 |
list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data;
|
185 |
}
|
18 |
*/
|
19 |
class Profile implements \IteratorAggregate, \Serializable
|
20 |
{
|
21 |
+
public const ROOT = 'ROOT';
|
22 |
+
public const BLOCK = 'block';
|
23 |
+
public const TEMPLATE = 'template';
|
24 |
+
public const MACRO = 'macro';
|
25 |
|
26 |
private $template;
|
27 |
private $name;
|
153 |
$this->enter();
|
154 |
}
|
155 |
|
156 |
+
public function getIterator(): \Traversable
|
157 |
{
|
158 |
return new \ArrayIterator($this->profiles);
|
159 |
}
|
160 |
|
161 |
+
public function serialize(): string
|
162 |
{
|
163 |
return serialize($this->__serialize());
|
164 |
}
|
165 |
|
166 |
+
public function unserialize($data): void
|
167 |
{
|
168 |
$this->__unserialize(unserialize($data));
|
169 |
}
|
171 |
/**
|
172 |
* @internal
|
173 |
*/
|
174 |
+
public function __serialize(): array
|
175 |
{
|
176 |
return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles];
|
177 |
}
|
179 |
/**
|
180 |
* @internal
|
181 |
*/
|
182 |
+
public function __unserialize(array $data): void
|
183 |
{
|
184 |
list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data;
|
185 |
}
|
vendor/twig/twig/src/Sandbox/SecurityPolicy.php
CHANGED
@@ -51,7 +51,7 @@ class SecurityPolicy implements SecurityPolicyInterface
|
|
51 |
{
|
52 |
$this->allowedMethods = [];
|
53 |
foreach ($methods as $class => $m) {
|
54 |
-
$this->allowedMethods[$class] = array_map('
|
55 |
}
|
56 |
}
|
57 |
|
@@ -93,7 +93,7 @@ class SecurityPolicy implements SecurityPolicyInterface
|
|
93 |
}
|
94 |
|
95 |
$allowed = false;
|
96 |
-
$method =
|
97 |
foreach ($this->allowedMethods as $class => $methods) {
|
98 |
if ($obj instanceof $class) {
|
99 |
$allowed = \in_array($method, $methods);
|
51 |
{
|
52 |
$this->allowedMethods = [];
|
53 |
foreach ($methods as $class => $m) {
|
54 |
+
$this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]);
|
55 |
}
|
56 |
}
|
57 |
|
93 |
}
|
94 |
|
95 |
$allowed = false;
|
96 |
+
$method = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
|
97 |
foreach ($this->allowedMethods as $class => $methods) {
|
98 |
if ($obj instanceof $class) {
|
99 |
$allowed = \in_array($method, $methods);
|
vendor/twig/twig/src/Template.php
CHANGED
@@ -80,7 +80,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
80 |
*/
|
81 |
public function getSource()
|
82 |
{
|
83 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
|
84 |
|
85 |
return '';
|
86 |
}
|
@@ -100,7 +100,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
100 |
*/
|
101 |
public function getEnvironment()
|
102 |
{
|
103 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', E_USER_DEPRECATED);
|
104 |
|
105 |
return $this->env;
|
106 |
}
|
@@ -111,8 +111,6 @@ abstract class Template implements \Twig_TemplateInterface
|
|
111 |
* This method is for internal use only and should never be called
|
112 |
* directly.
|
113 |
*
|
114 |
-
* @param array $context
|
115 |
-
*
|
116 |
* @return \Twig_TemplateInterface|TemplateWrapper|false The parent template or false if there is no parent
|
117 |
*
|
118 |
* @internal
|
@@ -235,7 +233,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
235 |
} elseif (false !== $parent = $this->getParent($context)) {
|
236 |
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
|
237 |
} else {
|
238 |
-
@trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), E_USER_DEPRECATED);
|
239 |
}
|
240 |
}
|
241 |
|
@@ -303,7 +301,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
303 |
public function hasBlock($name, array $context = null, array $blocks = [])
|
304 |
{
|
305 |
if (null === $context) {
|
306 |
-
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED);
|
307 |
|
308 |
return isset($this->blocks[(string) $name]);
|
309 |
}
|
@@ -337,7 +335,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
337 |
public function getBlockNames(array $context = null, array $blocks = [])
|
338 |
{
|
339 |
if (null === $context) {
|
340 |
-
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED);
|
341 |
|
342 |
return array_keys($this->blocks);
|
343 |
}
|
@@ -366,7 +364,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
366 |
}
|
367 |
|
368 |
if ($template === $this->getTemplateName()) {
|
369 |
-
$class =
|
370 |
if (false !== $pos = strrpos($class, '___', -1)) {
|
371 |
$class = substr($class, 0, $pos);
|
372 |
}
|
@@ -399,7 +397,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
399 |
*
|
400 |
* @return Template
|
401 |
*/
|
402 |
-
|
403 |
{
|
404 |
return $this;
|
405 |
}
|
@@ -537,7 +535,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
537 |
if (self::METHOD_CALL !== $type) {
|
538 |
$arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item;
|
539 |
|
540 |
-
if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, $object)))
|
541 |
|| ($object instanceof \ArrayAccess && isset($object[$arrayItem]))
|
542 |
) {
|
543 |
if ($isDefinedTest) {
|
@@ -604,7 +602,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
604 |
|
605 |
// object property
|
606 |
if (self::METHOD_CALL !== $type && !$object instanceof self) { // \Twig\Template does not have public properties, and we don't want to allow access to internal ones
|
607 |
-
if (isset($object->$item) || \array_key_exists((string) $item, $object)) {
|
608 |
if ($isDefinedTest) {
|
609 |
return true;
|
610 |
}
|
@@ -628,7 +626,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
628 |
|
629 |
foreach ($ref->getMethods(\ReflectionMethod::IS_PUBLIC) as $refMethod) {
|
630 |
// Accessing the environment from templates is forbidden to prevent untrusted changes to the environment
|
631 |
-
if ('getenvironment' !==
|
632 |
$methods[] = $refMethod->name;
|
633 |
}
|
634 |
}
|
@@ -642,7 +640,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
642 |
|
643 |
foreach ($methods as $method) {
|
644 |
$cache[$method] = $method;
|
645 |
-
$cache[$lcName =
|
646 |
|
647 |
if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) {
|
648 |
$name = substr($method, 3);
|
@@ -670,7 +668,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
670 |
$call = false;
|
671 |
if (isset(self::$cache[$class][$item])) {
|
672 |
$method = self::$cache[$class][$item];
|
673 |
-
} elseif (isset(self::$cache[$class][$lcItem =
|
674 |
$method = self::$cache[$class][$lcItem];
|
675 |
} elseif (isset(self::$cache[$class]['__call'])) {
|
676 |
$method = $item;
|
@@ -721,7 +719,7 @@ abstract class Template implements \Twig_TemplateInterface
|
|
721 |
} elseif ('render' === $method || 'display' === $method) {
|
722 |
$message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
|
723 |
}
|
724 |
-
@trigger_error($message, E_USER_DEPRECATED);
|
725 |
|
726 |
return '' === $ret ? '' : new Markup($ret, $this->env->getCharset());
|
727 |
}
|
80 |
*/
|
81 |
public function getSource()
|
82 |
{
|
83 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', \E_USER_DEPRECATED);
|
84 |
|
85 |
return '';
|
86 |
}
|
100 |
*/
|
101 |
public function getEnvironment()
|
102 |
{
|
103 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', \E_USER_DEPRECATED);
|
104 |
|
105 |
return $this->env;
|
106 |
}
|
111 |
* This method is for internal use only and should never be called
|
112 |
* directly.
|
113 |
*
|
|
|
|
|
114 |
* @return \Twig_TemplateInterface|TemplateWrapper|false The parent template or false if there is no parent
|
115 |
*
|
116 |
* @internal
|
233 |
} elseif (false !== $parent = $this->getParent($context)) {
|
234 |
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
|
235 |
} else {
|
236 |
+
@trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), \E_USER_DEPRECATED);
|
237 |
}
|
238 |
}
|
239 |
|
301 |
public function hasBlock($name, array $context = null, array $blocks = [])
|
302 |
{
|
303 |
if (null === $context) {
|
304 |
+
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', \E_USER_DEPRECATED);
|
305 |
|
306 |
return isset($this->blocks[(string) $name]);
|
307 |
}
|
335 |
public function getBlockNames(array $context = null, array $blocks = [])
|
336 |
{
|
337 |
if (null === $context) {
|
338 |
+
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', \E_USER_DEPRECATED);
|
339 |
|
340 |
return array_keys($this->blocks);
|
341 |
}
|
364 |
}
|
365 |
|
366 |
if ($template === $this->getTemplateName()) {
|
367 |
+
$class = static::class;
|
368 |
if (false !== $pos = strrpos($class, '___', -1)) {
|
369 |
$class = substr($class, 0, $pos);
|
370 |
}
|
397 |
*
|
398 |
* @return Template
|
399 |
*/
|
400 |
+
public function unwrap()
|
401 |
{
|
402 |
return $this;
|
403 |
}
|
535 |
if (self::METHOD_CALL !== $type) {
|
536 |
$arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item;
|
537 |
|
538 |
+
if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, (array) $object)))
|
539 |
|| ($object instanceof \ArrayAccess && isset($object[$arrayItem]))
|
540 |
) {
|
541 |
if ($isDefinedTest) {
|
602 |
|
603 |
// object property
|
604 |
if (self::METHOD_CALL !== $type && !$object instanceof self) { // \Twig\Template does not have public properties, and we don't want to allow access to internal ones
|
605 |
+
if (isset($object->$item) || \array_key_exists((string) $item, (array) $object)) {
|
606 |
if ($isDefinedTest) {
|
607 |
return true;
|
608 |
}
|
626 |
|
627 |
foreach ($ref->getMethods(\ReflectionMethod::IS_PUBLIC) as $refMethod) {
|
628 |
// Accessing the environment from templates is forbidden to prevent untrusted changes to the environment
|
629 |
+
if ('getenvironment' !== strtr($refMethod->name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) {
|
630 |
$methods[] = $refMethod->name;
|
631 |
}
|
632 |
}
|
640 |
|
641 |
foreach ($methods as $method) {
|
642 |
$cache[$method] = $method;
|
643 |
+
$cache[$lcName = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')] = $method;
|
644 |
|
645 |
if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) {
|
646 |
$name = substr($method, 3);
|
668 |
$call = false;
|
669 |
if (isset(self::$cache[$class][$item])) {
|
670 |
$method = self::$cache[$class][$item];
|
671 |
+
} elseif (isset(self::$cache[$class][$lcItem = strtr($item, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')])) {
|
672 |
$method = self::$cache[$class][$lcItem];
|
673 |
} elseif (isset(self::$cache[$class]['__call'])) {
|
674 |
$method = $item;
|
719 |
} elseif ('render' === $method || 'display' === $method) {
|
720 |
$message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
|
721 |
}
|
722 |
+
@trigger_error($message, \E_USER_DEPRECATED);
|
723 |
|
724 |
return '' === $ret ? '' : new Markup($ret, $this->env->getCharset());
|
725 |
}
|
vendor/twig/twig/src/Test/IntegrationTestCase.php
CHANGED
@@ -120,7 +120,7 @@ abstract class IntegrationTestCase extends TestCase
|
|
120 |
$condition = $match[2];
|
121 |
$templates = self::parseTemplates($match[3]);
|
122 |
$exception = false;
|
123 |
-
preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER);
|
124 |
} else {
|
125 |
throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file)));
|
126 |
}
|
@@ -245,9 +245,9 @@ abstract class IntegrationTestCase extends TestCase
|
|
245 |
protected static function parseTemplates($test)
|
246 |
{
|
247 |
$templates = [];
|
248 |
-
preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER);
|
249 |
foreach ($matches as $match) {
|
250 |
-
$templates[($match[1]
|
251 |
}
|
252 |
|
253 |
return $templates;
|
120 |
$condition = $match[2];
|
121 |
$templates = self::parseTemplates($match[3]);
|
122 |
$exception = false;
|
123 |
+
preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, \PREG_SET_ORDER);
|
124 |
} else {
|
125 |
throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file)));
|
126 |
}
|
245 |
protected static function parseTemplates($test)
|
246 |
{
|
247 |
$templates = [];
|
248 |
+
preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER);
|
249 |
foreach ($matches as $match) {
|
250 |
+
$templates[($match[1] ?: 'index.twig')] = $match[2];
|
251 |
}
|
252 |
|
253 |
return $templates;
|
vendor/twig/twig/src/Token.php
CHANGED
@@ -25,20 +25,20 @@ class Token
|
|
25 |
protected $type;
|
26 |
protected $lineno;
|
27 |
|
28 |
-
const EOF_TYPE = -1;
|
29 |
-
const TEXT_TYPE = 0;
|
30 |
-
const BLOCK_START_TYPE = 1;
|
31 |
-
const VAR_START_TYPE = 2;
|
32 |
-
const BLOCK_END_TYPE = 3;
|
33 |
-
const VAR_END_TYPE = 4;
|
34 |
-
const NAME_TYPE = 5;
|
35 |
-
const NUMBER_TYPE = 6;
|
36 |
-
const STRING_TYPE = 7;
|
37 |
-
const OPERATOR_TYPE = 8;
|
38 |
-
const PUNCTUATION_TYPE = 9;
|
39 |
-
const INTERPOLATION_START_TYPE = 10;
|
40 |
-
const INTERPOLATION_END_TYPE = 11;
|
41 |
-
const ARROW_TYPE = 12;
|
42 |
|
43 |
/**
|
44 |
* @param int $type The type of the token
|
25 |
protected $type;
|
26 |
protected $lineno;
|
27 |
|
28 |
+
public const EOF_TYPE = -1;
|
29 |
+
public const TEXT_TYPE = 0;
|
30 |
+
public const BLOCK_START_TYPE = 1;
|
31 |
+
public const VAR_START_TYPE = 2;
|
32 |
+
public const BLOCK_END_TYPE = 3;
|
33 |
+
public const VAR_END_TYPE = 4;
|
34 |
+
public const NAME_TYPE = 5;
|
35 |
+
public const NUMBER_TYPE = 6;
|
36 |
+
public const STRING_TYPE = 7;
|
37 |
+
public const OPERATOR_TYPE = 8;
|
38 |
+
public const PUNCTUATION_TYPE = 9;
|
39 |
+
public const INTERPOLATION_START_TYPE = 10;
|
40 |
+
public const INTERPOLATION_END_TYPE = 11;
|
41 |
+
public const ARROW_TYPE = 12;
|
42 |
|
43 |
/**
|
44 |
* @param int $type The type of the token
|
vendor/twig/twig/src/TokenParser/ApplyTokenParser.php
CHANGED
@@ -22,7 +22,7 @@ use Twig\Token;
|
|
22 |
*
|
23 |
* {% apply upper %}
|
24 |
* This text becomes uppercase
|
25 |
-
* {%
|
26 |
*/
|
27 |
final class ApplyTokenParser extends AbstractTokenParser
|
28 |
{
|
22 |
*
|
23 |
* {% apply upper %}
|
24 |
* This text becomes uppercase
|
25 |
+
* {% endapply %}
|
26 |
*/
|
27 |
final class ApplyTokenParser extends AbstractTokenParser
|
28 |
{
|
vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php
CHANGED
@@ -57,7 +57,7 @@ class AutoEscapeTokenParser extends AbstractTokenParser
|
|
57 |
}
|
58 |
|
59 |
if ($compat && $stream->test(Token::NAME_TYPE)) {
|
60 |
-
@trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED);
|
61 |
|
62 |
if (false === $value) {
|
63 |
throw new SyntaxError('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
57 |
}
|
58 |
|
59 |
if ($compat && $stream->test(Token::NAME_TYPE)) {
|
60 |
+
@trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', \E_USER_DEPRECATED);
|
61 |
|
62 |
if (false === $value) {
|
63 |
throw new SyntaxError('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
vendor/twig/twig/src/TokenStream.php
CHANGED
@@ -38,7 +38,7 @@ class TokenStream
|
|
38 |
{
|
39 |
if (!$name instanceof Source) {
|
40 |
if (null !== $name || null !== $source) {
|
41 |
-
@trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
42 |
}
|
43 |
$this->source = new Source($source, $name);
|
44 |
} else {
|
@@ -164,7 +164,7 @@ class TokenStream
|
|
164 |
*/
|
165 |
public function getFilename()
|
166 |
{
|
167 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
168 |
|
169 |
return $this->source->getName();
|
170 |
}
|
@@ -180,7 +180,7 @@ class TokenStream
|
|
180 |
*/
|
181 |
public function getSource()
|
182 |
{
|
183 |
-
@trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
184 |
|
185 |
return $this->source->getCode();
|
186 |
}
|
38 |
{
|
39 |
if (!$name instanceof Source) {
|
40 |
if (null !== $name || null !== $source) {
|
41 |
+
@trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), \E_USER_DEPRECATED);
|
42 |
}
|
43 |
$this->source = new Source($source, $name);
|
44 |
} else {
|
164 |
*/
|
165 |
public function getFilename()
|
166 |
{
|
167 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
168 |
|
169 |
return $this->source->getName();
|
170 |
}
|
180 |
*/
|
181 |
public function getSource()
|
182 |
{
|
183 |
+
@trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), \E_USER_DEPRECATED);
|
184 |
|
185 |
return $this->source->getCode();
|
186 |
}
|
vendor/twig/twig/src/TwigTest.php
CHANGED
@@ -35,6 +35,7 @@ class TwigTest
|
|
35 |
'node_class' => '\Twig\Node\Expression\TestExpression',
|
36 |
'deprecated' => false,
|
37 |
'alternative' => null,
|
|
|
38 |
], $options);
|
39 |
}
|
40 |
|
@@ -82,6 +83,11 @@ class TwigTest
|
|
82 |
{
|
83 |
return $this->arguments;
|
84 |
}
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
class_alias('Twig\TwigTest', 'Twig_SimpleTest');
|
35 |
'node_class' => '\Twig\Node\Expression\TestExpression',
|
36 |
'deprecated' => false,
|
37 |
'alternative' => null,
|
38 |
+
'one_mandatory_argument' => false,
|
39 |
], $options);
|
40 |
}
|
41 |
|
83 |
{
|
84 |
return $this->arguments;
|
85 |
}
|
86 |
+
|
87 |
+
public function hasOneMandatoryArgument(): bool
|
88 |
+
{
|
89 |
+
return (bool) $this->options['one_mandatory_argument'];
|
90 |
+
}
|
91 |
}
|
92 |
|
93 |
class_alias('Twig\TwigTest', 'Twig_SimpleTest');
|
vendor/twig/twig/src/Util/DeprecationCollector.php
CHANGED
@@ -83,7 +83,7 @@ class DeprecationCollector
|
|
83 |
*/
|
84 |
public function errorHandler($type, $msg)
|
85 |
{
|
86 |
-
if (E_USER_DEPRECATED === $type) {
|
87 |
$this->deprecations[] = $msg;
|
88 |
}
|
89 |
}
|
83 |
*/
|
84 |
public function errorHandler($type, $msg)
|
85 |
{
|
86 |
+
if (\E_USER_DEPRECATED === $type) {
|
87 |
$this->deprecations[] = $msg;
|
88 |
}
|
89 |
}
|
wp-rss-aggregator.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: WP RSS Aggregator
|
5 |
* Plugin URI: https://www.wprssaggregator.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpraplugin
|
6 |
* Description: Imports and aggregates multiple RSS Feeds.
|
7 |
-
* Version: 4.
|
8 |
* Author: RebelCode
|
9 |
* Author URI: https://www.wprssaggregator.com
|
10 |
* Text Domain: wprss
|
@@ -76,7 +76,7 @@ use RebelCode\Wpra\Core\Plugin;
|
|
76 |
|
77 |
// Set the version number of the plugin.
|
78 |
if( !defined( 'WPRSS_VERSION' ) )
|
79 |
-
define( 'WPRSS_VERSION', '4.
|
80 |
|
81 |
if( !defined( 'WPRSS_WP_MIN_VERSION' ) )
|
82 |
define( 'WPRSS_WP_MIN_VERSION', '4.8' );
|
4 |
* Plugin Name: WP RSS Aggregator
|
5 |
* Plugin URI: https://www.wprssaggregator.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpraplugin
|
6 |
* Description: Imports and aggregates multiple RSS Feeds.
|
7 |
+
* Version: 4.22
|
8 |
* Author: RebelCode
|
9 |
* Author URI: https://www.wprssaggregator.com
|
10 |
* Text Domain: wprss
|
76 |
|
77 |
// Set the version number of the plugin.
|
78 |
if( !defined( 'WPRSS_VERSION' ) )
|
79 |
+
define( 'WPRSS_VERSION', '4.22' );
|
80 |
|
81 |
if( !defined( 'WPRSS_WP_MIN_VERSION' ) )
|
82 |
define( 'WPRSS_WP_MIN_VERSION', '4.8' );
|