From 7dcc7a3ece7e559bfb8cd2576df64a2566c3aeab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 05:38:15 +0000 Subject: [PATCH] Update dependency twig/twig to v2.15.3 [SECURITY] --- system/backend/php/composer.lock | 133 +- .../php/vendor/composer/installed.json | 139 +- .../vendor/symfony/polyfill-ctype/Ctype.php | 53 +- .../vendor/symfony/polyfill-ctype/README.md | 2 +- .../symfony/polyfill-ctype/bootstrap.php | 24 + .../symfony/polyfill-ctype/bootstrap80.php | 46 + .../symfony/polyfill-ctype/composer.json | 11 +- .../symfony/polyfill-mbstring/Mbstring.php | 184 ++- .../symfony/polyfill-mbstring/README.md | 4 +- .../Resources/unidata/lowerCase.php | 305 +++- .../Resources/unidata/upperCase.php | 441 +++++- .../symfony/polyfill-mbstring/bootstrap.php | 165 +- .../symfony/polyfill-mbstring/bootstrap80.php | 143 ++ .../symfony/polyfill-mbstring/composer.json | 11 +- .../php/vendor/twig/twig/.gitattributes | 4 + .../vendor/twig/twig/.github/dependabot.yml | 6 + .../vendor/twig/twig/.github/workflows/ci.yml | 148 ++ .../twig/.github/workflows/documentation.yml | 64 + .../backend/php/vendor/twig/twig/.gitignore | 3 + .../{.php_cs.dist => .php-cs-fixer.dist.php} | 6 +- .../backend/php/vendor/twig/twig/.travis.yml | 28 - system/backend/php/vendor/twig/twig/CHANGELOG | 1349 +++-------------- system/backend/php/vendor/twig/twig/LICENSE | 44 +- .../backend/php/vendor/twig/twig/README.rst | 12 +- .../php/vendor/twig/twig/composer.json | 16 +- .../php/vendor/twig/twig/doc/advanced.rst | 917 ----------- .../backend/php/vendor/twig/twig/doc/api.rst | 593 -------- .../vendor/twig/twig/doc/coding_standards.rst | 101 -- .../php/vendor/twig/twig/doc/deprecated.rst | 115 -- .../php/vendor/twig/twig/doc/filters/abs.rst | 18 - .../vendor/twig/twig/doc/filters/batch.rst | 48 - .../twig/twig/doc/filters/capitalize.rst | 11 - .../vendor/twig/twig/doc/filters/column.rst | 27 - .../twig/doc/filters/convert_encoding.rst | 22 - .../php/vendor/twig/twig/doc/filters/date.rst | 82 - .../twig/twig/doc/filters/date_modify.rst | 20 - .../vendor/twig/twig/doc/filters/default.rst | 33 - .../vendor/twig/twig/doc/filters/escape.rst | 119 -- .../vendor/twig/twig/doc/filters/filter.rst | 58 - .../vendor/twig/twig/doc/filters/first.rst | 22 - .../vendor/twig/twig/doc/filters/format.rst | 16 - .../vendor/twig/twig/doc/filters/index.rst | 42 - .../php/vendor/twig/twig/doc/filters/join.rst | 35 - .../twig/twig/doc/filters/json_encode.rst | 23 - .../php/vendor/twig/twig/doc/filters/keys.rst | 11 - .../php/vendor/twig/twig/doc/filters/last.rst | 22 - .../vendor/twig/twig/doc/filters/length.rst | 23 - .../vendor/twig/twig/doc/filters/lower.rst | 10 - .../php/vendor/twig/twig/doc/filters/map.rst | 38 - .../vendor/twig/twig/doc/filters/merge.rst | 48 - .../vendor/twig/twig/doc/filters/nl2br.rst | 19 - .../twig/twig/doc/filters/number_format.rst | 50 - .../php/vendor/twig/twig/doc/filters/raw.rst | 38 - .../vendor/twig/twig/doc/filters/reduce.rst | 33 - .../vendor/twig/twig/doc/filters/replace.rst | 25 - .../vendor/twig/twig/doc/filters/reverse.rst | 44 - .../vendor/twig/twig/doc/filters/round.rst | 34 - .../vendor/twig/twig/doc/filters/slice.rst | 68 - .../php/vendor/twig/twig/doc/filters/sort.rst | 18 - .../twig/twig/doc/filters/spaceless.rst | 65 - .../vendor/twig/twig/doc/filters/split.rst | 50 - .../twig/twig/doc/filters/striptags.rst | 29 - .../vendor/twig/twig/doc/filters/title.rst | 11 - .../php/vendor/twig/twig/doc/filters/trim.rst | 39 - .../vendor/twig/twig/doc/filters/upper.rst | 10 - .../twig/twig/doc/filters/url_encode.rst | 22 - .../twig/twig/doc/functions/attribute.rst | 23 - .../vendor/twig/twig/doc/functions/block.rst | 35 - .../twig/twig/doc/functions/constant.rst | 23 - .../vendor/twig/twig/doc/functions/cycle.rst | 28 - .../vendor/twig/twig/doc/functions/date.rst | 46 - .../vendor/twig/twig/doc/functions/dump.rst | 66 - .../twig/twig/doc/functions/include.rst | 77 - .../vendor/twig/twig/doc/functions/index.rst | 20 - .../vendor/twig/twig/doc/functions/max.rst | 17 - .../vendor/twig/twig/doc/functions/min.rst | 17 - .../vendor/twig/twig/doc/functions/parent.rst | 20 - .../vendor/twig/twig/doc/functions/random.rst | 30 - .../vendor/twig/twig/doc/functions/range.rst | 58 - .../vendor/twig/twig/doc/functions/source.rst | 26 - .../doc/functions/template_from_string.rst | 40 - .../php/vendor/twig/twig/doc/index.rst | 19 - .../php/vendor/twig/twig/doc/installation.rst | 10 - .../php/vendor/twig/twig/doc/internals.rst | 140 -- .../php/vendor/twig/twig/doc/intro.rst | 70 - .../php/vendor/twig/twig/doc/recipes.rst | 527 ------- .../php/vendor/twig/twig/doc/tags/apply.rst | 23 - .../vendor/twig/twig/doc/tags/autoescape.rst | 61 - .../php/vendor/twig/twig/doc/tags/block.rst | 11 - .../vendor/twig/twig/doc/tags/deprecated.rst | 30 - .../php/vendor/twig/twig/doc/tags/do.rst | 9 - .../php/vendor/twig/twig/doc/tags/embed.rst | 175 --- .../php/vendor/twig/twig/doc/tags/extends.rst | 265 ---- .../php/vendor/twig/twig/doc/tags/filter.rst | 26 - .../php/vendor/twig/twig/doc/tags/flush.rst | 14 - .../php/vendor/twig/twig/doc/tags/for.rst | 176 --- .../php/vendor/twig/twig/doc/tags/from.rst | 6 - .../php/vendor/twig/twig/doc/tags/if.rst | 79 - .../php/vendor/twig/twig/doc/tags/import.rst | 6 - .../php/vendor/twig/twig/doc/tags/include.rst | 111 -- .../php/vendor/twig/twig/doc/tags/index.rst | 27 - .../php/vendor/twig/twig/doc/tags/macro.rst | 182 --- .../php/vendor/twig/twig/doc/tags/sandbox.rst | 30 - .../php/vendor/twig/twig/doc/tags/set.rst | 78 - .../vendor/twig/twig/doc/tags/spaceless.rst | 41 - .../php/vendor/twig/twig/doc/tags/use.rst | 117 -- .../vendor/twig/twig/doc/tags/verbatim.rst | 16 - .../php/vendor/twig/twig/doc/tags/with.rst | 41 - .../php/vendor/twig/twig/doc/templates.rst | 869 ----------- .../vendor/twig/twig/doc/tests/constant.rst | 19 - .../vendor/twig/twig/doc/tests/defined.rst | 30 - .../twig/twig/doc/tests/divisibleby.rst | 10 - .../php/vendor/twig/twig/doc/tests/empty.rst | 22 - .../php/vendor/twig/twig/doc/tests/even.rst | 10 - .../php/vendor/twig/twig/doc/tests/index.rst | 15 - .../vendor/twig/twig/doc/tests/iterable.rst | 16 - .../php/vendor/twig/twig/doc/tests/null.rst | 12 - .../php/vendor/twig/twig/doc/tests/odd.rst | 10 - .../php/vendor/twig/twig/doc/tests/sameas.rst | 11 - .../php/vendor/twig/twig/drupal_test.sh | 52 - .../twig/twig/lib/Twig/BaseNodeVisitor.php | 4 +- .../twig/twig/lib/Twig/Cache/Filesystem.php | 4 +- .../vendor/twig/twig/lib/Twig/Cache/Null.php | 4 +- .../twig/twig/lib/Twig/CacheInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Compiler.php | 4 +- .../twig/lib/Twig/ContainerRuntimeLoader.php | 4 +- .../vendor/twig/twig/lib/Twig/Environment.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Error.php | 4 +- .../twig/twig/lib/Twig/Error/Loader.php | 4 +- .../twig/twig/lib/Twig/Error/Runtime.php | 4 +- .../twig/twig/lib/Twig/Error/Syntax.php | 4 +- .../twig/lib/Twig/ExistsLoaderInterface.php | 4 +- .../twig/twig/lib/Twig/ExpressionParser.php | 4 +- .../vendor/twig/twig/lib/Twig/Extension.php | 4 +- .../twig/twig/lib/Twig/Extension/Core.php | 4 +- .../twig/twig/lib/Twig/Extension/Debug.php | 4 +- .../twig/twig/lib/Twig/Extension/Escaper.php | 4 +- .../lib/Twig/Extension/GlobalsInterface.php | 4 +- .../Twig/Extension/InitRuntimeInterface.php | 4 +- .../twig/lib/Twig/Extension/Optimizer.php | 4 +- .../twig/twig/lib/Twig/Extension/Profiler.php | 4 +- .../twig/twig/lib/Twig/Extension/Sandbox.php | 4 +- .../twig/twig/lib/Twig/Extension/Staging.php | 4 +- .../twig/lib/Twig/Extension/StringLoader.php | 4 +- .../twig/twig/lib/Twig/ExtensionInterface.php | 4 +- .../twig/twig/lib/Twig/ExtensionSet.php | 4 +- .../twig/lib/Twig/FactoryRuntimeLoader.php | 4 +- .../Twig/FileExtensionEscapingStrategy.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Filter.php | 4 +- .../vendor/twig/twig/lib/Twig/Function.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Lexer.php | 4 +- .../twig/twig/lib/Twig/Loader/Array.php | 4 +- .../twig/twig/lib/Twig/Loader/Chain.php | 4 +- .../twig/twig/lib/Twig/Loader/Filesystem.php | 4 +- .../twig/twig/lib/Twig/LoaderInterface.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Markup.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Node.php | 4 +- .../twig/twig/lib/Twig/Node/AutoEscape.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Block.php | 4 +- .../twig/lib/Twig/Node/BlockReference.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Body.php | 4 +- .../twig/twig/lib/Twig/Node/CheckSecurity.php | 4 +- .../twig/twig/lib/Twig/Node/Deprecated.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Node/Do.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Embed.php | 4 +- .../twig/twig/lib/Twig/Node/Expression.php | 4 +- .../twig/lib/Twig/Node/Expression/Array.php | 4 +- .../lib/Twig/Node/Expression/AssignName.php | 4 +- .../twig/lib/Twig/Node/Expression/Binary.php | 4 +- .../lib/Twig/Node/Expression/Binary/Add.php | 4 +- .../lib/Twig/Node/Expression/Binary/And.php | 4 +- .../Node/Expression/Binary/BitwiseAnd.php | 4 +- .../Twig/Node/Expression/Binary/BitwiseOr.php | 4 +- .../Node/Expression/Binary/BitwiseXor.php | 4 +- .../Twig/Node/Expression/Binary/Concat.php | 4 +- .../lib/Twig/Node/Expression/Binary/Div.php | 4 +- .../Twig/Node/Expression/Binary/EndsWith.php | 4 +- .../lib/Twig/Node/Expression/Binary/Equal.php | 4 +- .../Twig/Node/Expression/Binary/FloorDiv.php | 4 +- .../Twig/Node/Expression/Binary/Greater.php | 4 +- .../Node/Expression/Binary/GreaterEqual.php | 4 +- .../lib/Twig/Node/Expression/Binary/In.php | 4 +- .../lib/Twig/Node/Expression/Binary/Less.php | 4 +- .../Twig/Node/Expression/Binary/LessEqual.php | 4 +- .../Twig/Node/Expression/Binary/Matches.php | 4 +- .../lib/Twig/Node/Expression/Binary/Mod.php | 4 +- .../lib/Twig/Node/Expression/Binary/Mul.php | 4 +- .../Twig/Node/Expression/Binary/NotEqual.php | 4 +- .../lib/Twig/Node/Expression/Binary/NotIn.php | 4 +- .../lib/Twig/Node/Expression/Binary/Or.php | 4 +- .../lib/Twig/Node/Expression/Binary/Power.php | 4 +- .../lib/Twig/Node/Expression/Binary/Range.php | 4 +- .../Node/Expression/Binary/StartsWith.php | 4 +- .../lib/Twig/Node/Expression/Binary/Sub.php | 4 +- .../Twig/Node/Expression/BlockReference.php | 4 +- .../twig/lib/Twig/Node/Expression/Call.php | 4 +- .../lib/Twig/Node/Expression/Conditional.php | 4 +- .../lib/Twig/Node/Expression/Constant.php | 4 +- .../twig/lib/Twig/Node/Expression/Filter.php | 4 +- .../Twig/Node/Expression/Filter/Default.php | 4 +- .../lib/Twig/Node/Expression/Function.php | 4 +- .../twig/lib/Twig/Node/Expression/GetAttr.php | 4 +- .../lib/Twig/Node/Expression/MethodCall.php | 4 +- .../twig/lib/Twig/Node/Expression/Name.php | 4 +- .../lib/Twig/Node/Expression/NullCoalesce.php | 4 +- .../twig/lib/Twig/Node/Expression/Parent.php | 4 +- .../lib/Twig/Node/Expression/TempName.php | 4 +- .../twig/lib/Twig/Node/Expression/Test.php | 4 +- .../Twig/Node/Expression/Test/Constant.php | 4 +- .../lib/Twig/Node/Expression/Test/Defined.php | 4 +- .../Twig/Node/Expression/Test/Divisibleby.php | 4 +- .../lib/Twig/Node/Expression/Test/Even.php | 4 +- .../lib/Twig/Node/Expression/Test/Null.php | 4 +- .../lib/Twig/Node/Expression/Test/Odd.php | 4 +- .../lib/Twig/Node/Expression/Test/Sameas.php | 4 +- .../twig/lib/Twig/Node/Expression/Unary.php | 4 +- .../lib/Twig/Node/Expression/Unary/Neg.php | 4 +- .../lib/Twig/Node/Expression/Unary/Not.php | 4 +- .../lib/Twig/Node/Expression/Unary/Pos.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Flush.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/For.php | 4 +- .../twig/twig/lib/Twig/Node/ForLoop.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Node/If.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Import.php | 4 +- .../twig/twig/lib/Twig/Node/Include.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Macro.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Module.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Print.php | 4 +- .../twig/twig/lib/Twig/Node/Sandbox.php | 4 +- .../twig/lib/Twig/Node/SandboxedPrint.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Set.php | 4 +- .../twig/twig/lib/Twig/Node/Spaceless.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Text.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/With.php | 4 +- .../twig/lib/Twig/NodeCaptureInterface.php | 4 +- .../twig/lib/Twig/NodeOutputInterface.php | 4 +- .../twig/twig/lib/Twig/NodeTraverser.php | 4 +- .../twig/lib/Twig/NodeVisitor/Escaper.php | 4 +- .../twig/lib/Twig/NodeVisitor/Optimizer.php | 4 +- .../lib/Twig/NodeVisitor/SafeAnalysis.php | 4 +- .../twig/lib/Twig/NodeVisitor/Sandbox.php | 4 +- .../twig/lib/Twig/NodeVisitorInterface.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Parser.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Base.php | 4 +- .../lib/Twig/Profiler/Dumper/Blackfire.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Html.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Text.php | 4 +- .../lib/Twig/Profiler/Node/EnterProfile.php | 4 +- .../lib/Twig/Profiler/Node/LeaveProfile.php | 4 +- .../Twig/Profiler/NodeVisitor/Profiler.php | 4 +- .../twig/twig/lib/Twig/Profiler/Profile.php | 4 +- .../twig/lib/Twig/RuntimeLoaderInterface.php | 4 +- .../twig/lib/Twig/Sandbox/SecurityError.php | 4 +- .../Sandbox/SecurityNotAllowedFilterError.php | 4 +- .../SecurityNotAllowedFunctionError.php | 4 +- .../Sandbox/SecurityNotAllowedMethodError.php | 4 +- .../SecurityNotAllowedPropertyError.php | 4 +- .../Sandbox/SecurityNotAllowedTagError.php | 4 +- .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 4 +- .../Twig/Sandbox/SecurityPolicyInterface.php | 4 +- .../twig/twig/lib/Twig/SimpleFilter.php | 2 +- .../twig/twig/lib/Twig/SimpleFunction.php | 2 +- .../vendor/twig/twig/lib/Twig/SimpleTest.php | 2 +- .../php/vendor/twig/twig/lib/Twig/Source.php | 4 +- .../lib/Twig/SourceContextLoaderInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Template.php | 4 +- .../twig/twig/lib/Twig/TemplateWrapper.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Test.php | 4 +- .../lib/Twig/Test/IntegrationTestCase.php | 4 +- .../twig/twig/lib/Twig/Test/NodeTestCase.php | 4 +- .../php/vendor/twig/twig/lib/Twig/Token.php | 4 +- .../vendor/twig/twig/lib/Twig/TokenParser.php | 4 +- .../twig/lib/Twig/TokenParser/AutoEscape.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Block.php | 4 +- .../twig/lib/Twig/TokenParser/Deprecated.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Do.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Embed.php | 4 +- .../twig/lib/Twig/TokenParser/Extends.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Filter.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Flush.php | 4 +- .../twig/twig/lib/Twig/TokenParser/For.php | 4 +- .../twig/twig/lib/Twig/TokenParser/From.php | 4 +- .../twig/twig/lib/Twig/TokenParser/If.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Import.php | 4 +- .../twig/lib/Twig/TokenParser/Include.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Macro.php | 4 +- .../twig/lib/Twig/TokenParser/Sandbox.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Set.php | 4 +- .../twig/lib/Twig/TokenParser/Spaceless.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Use.php | 4 +- .../twig/twig/lib/Twig/TokenParser/With.php | 4 +- .../twig/lib/Twig/TokenParserInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/TokenStream.php | 4 +- .../lib/Twig/Util/DeprecationCollector.php | 4 +- .../lib/Twig/Util/TemplateDirIterator.php | 4 +- .../php/vendor/twig/twig/phpunit.xml.dist | 33 - .../twig/twig/src/Cache/FilesystemCache.php | 8 +- .../php/vendor/twig/twig/src/Compiler.php | 8 +- .../php/vendor/twig/twig/src/Environment.php | 49 +- .../php/vendor/twig/twig/src/Error/Error.php | 8 +- .../vendor/twig/twig/src/ExpressionParser.php | 34 +- .../twig/twig/src/Extension/CoreExtension.php | 252 ++- .../twig/src/Extension/DebugExtension.php | 2 +- .../twig/src/Extension/EscaperExtension.php | 51 +- .../twig/src/Extension/ProfilerExtension.php | 2 +- .../twig/src/Extension/SandboxExtension.php | 4 +- .../php/vendor/twig/twig/src/ExtensionSet.php | 2 - .../src/FileExtensionEscapingStrategy.php | 2 +- .../php/vendor/twig/twig/src/Lexer.php | 57 +- .../twig/twig/src/Loader/FilesystemLoader.php | 12 +- .../php/vendor/twig/twig/src/Markup.php | 8 + .../twig/src/Node/CheckSecurityCallNode.php | 28 + .../twig/twig/src/Node/CheckSecurityNode.php | 13 +- .../vendor/twig/twig/src/Node/EmbedNode.php | 2 +- .../Expression/ArrowFunctionExpression.php | 2 +- .../Expression/Binary/SpaceshipBinary.php | 22 + .../Expression/BlockReferenceExpression.php | 2 +- .../src/Node/Expression/CallExpression.php | 106 +- .../src/Node/Expression/GetAttrExpression.php | 2 +- .../src/Node/Expression/NameExpression.php | 2 +- .../Expression/NullCoalesceExpression.php | 14 +- .../src/Node/Expression/Test/DefinedTest.php | 2 +- .../twig/src/Node/Expression/Test/OddTest.php | 2 +- .../src/Node/Expression/TestExpression.php | 2 +- .../php/vendor/twig/twig/src/Node/ForNode.php | 2 +- .../php/vendor/twig/twig/src/Node/IfNode.php | 7 +- .../vendor/twig/twig/src/Node/IncludeNode.php | 2 +- .../vendor/twig/twig/src/Node/MacroNode.php | 10 +- .../vendor/twig/twig/src/Node/ModuleNode.php | 6 +- .../php/vendor/twig/twig/src/Node/Node.php | 18 +- .../vendor/twig/twig/src/Node/SandboxNode.php | 7 + .../php/vendor/twig/twig/src/Node/SetNode.php | 6 +- .../twig/twig/src/Node/SpacelessNode.php | 8 +- .../vendor/twig/twig/src/Node/WithNode.php | 2 +- .../vendor/twig/twig/src/NodeTraverser.php | 2 +- .../MacroAutoImportNodeVisitor.php | 6 +- .../src/NodeVisitor/OptimizerNodeVisitor.php | 10 +- .../src/NodeVisitor/SandboxNodeVisitor.php | 4 +- .../php/vendor/twig/twig/src/Parser.php | 11 +- .../NodeVisitor/ProfilerNodeVisitor.php | 22 +- .../vendor/twig/twig/src/Profiler/Profile.php | 23 +- .../Sandbox/SecurityNotAllowedFilterError.php | 6 +- .../SecurityNotAllowedFunctionError.php | 6 +- .../Sandbox/SecurityNotAllowedMethodError.php | 6 +- .../SecurityNotAllowedPropertyError.php | 6 +- .../Sandbox/SecurityNotAllowedTagError.php | 6 +- .../twig/twig/src/Sandbox/SecurityPolicy.php | 4 +- .../src/Sandbox/SecurityPolicyInterface.php | 12 +- .../php/vendor/twig/twig/src/Template.php | 30 +- .../vendor/twig/twig/src/TemplateWrapper.php | 6 +- .../twig/src/Test/IntegrationTestCase.php | 10 +- .../php/vendor/twig/twig/src/Token.php | 28 +- .../twig/src/TokenParser/ApplyTokenParser.php | 2 +- .../src/TokenParser/FilterTokenParser.php | 2 +- .../twig/src/TokenParser/ForTokenParser.php | 2 +- .../src/TokenParser/SpacelessTokenParser.php | 4 +- .../php/vendor/twig/twig/src/TwigFilter.php | 4 +- .../php/vendor/twig/twig/src/TwigFunction.php | 4 +- .../php/vendor/twig/twig/src/TwigTest.php | 10 +- .../twig/src/Util/DeprecationCollector.php | 2 +- .../twig/src/Util/TemplateDirIterator.php | 8 + .../test/Twig/Tests/Cache/FilesystemTest.php | 195 --- .../twig/test/Twig/Tests/CompilerTest.php | 37 - .../Twig/Tests/ContainerRuntimeLoaderTest.php | 36 - .../test/Twig/Tests/CustomExtensionTest.php | 82 - .../twig/test/Twig/Tests/EnvironmentTest.php | 517 ------- .../twig/twig/test/Twig/Tests/ErrorTest.php | 211 --- .../test/Twig/Tests/ExpressionParserTest.php | 388 ----- .../test/Twig/Tests/Extension/CoreTest.php | 332 ---- .../test/Twig/Tests/Extension/EscaperTest.php | 403 ----- .../test/Twig/Tests/Extension/SandboxTest.php | 368 ----- .../Twig/Tests/FactoryRuntimeLoaderTest.php | 34 - .../FileExtensionEscapingStrategyTest.php | 53 - .../twig/test/Twig/Tests/FilesystemHelper.php | 26 - .../Twig/Tests/Fixtures/autoescape/block.test | 21 - .../Twig/Tests/Fixtures/autoescape/name.test | 22 - .../test/Twig/Tests/Fixtures/errors/base.html | 1 - .../Twig/Tests/Fixtures/errors/index.html | 7 - .../child_contents_outside_blocks.test | 15 - .../exception_in_extension_extends.test | 12 - .../exception_in_extension_include.test | 12 - ...ltiline_array_with_undefined_variable.test | 18 - ...e_array_with_undefined_variable_again.test | 18 - ...line_function_with_undefined_variable.test | 12 - ...tiline_function_with_unknown_argument.test | 9 - ...multiline_tag_with_undefined_variable.test | 12 - .../strict_comparison_operator.test | 6 - .../syntax_error_in_reused_template.test | 10 - .../Fixtures/exceptions/unclosed_tag.test | 20 - .../Fixtures/exceptions/undefined_parent.test | 10 - .../undefined_template_in_child_template.test | 15 - .../Fixtures/exceptions/undefined_trait.test | 9 - .../Tests/Fixtures/expressions/_self.test | 8 - .../Tests/Fixtures/expressions/array.test | 105 -- .../Fixtures/expressions/array_call.test | 14 - .../Tests/Fixtures/expressions/binary.test | 46 - .../Tests/Fixtures/expressions/bitwise.test | 14 - .../call_argument_defined_twice.test | 8 - .../call_positional_arg_after_named_arg.test | 8 - .../Fixtures/expressions/comparison.test | 14 - .../Fixtures/expressions/divisibleby.test | 17 - .../Tests/Fixtures/expressions/dotdot.test | 20 - .../Tests/Fixtures/expressions/ends_with.test | 26 - .../Tests/Fixtures/expressions/floats.test | 14 - .../Tests/Fixtures/expressions/grouping.test | 8 - .../Tests/Fixtures/expressions/literals.test | 22 - .../Fixtures/expressions/magic_call.test | 27 - .../Tests/Fixtures/expressions/matches.test | 12 - .../Fixtures/expressions/method_call.test | 28 - .../expressions/negative_numbers.test | 18 - .../Fixtures/expressions/not_arrow_fn.test | 8 - .../expressions/operators_as_variables.test | 16 - .../Tests/Fixtures/expressions/postfix.test | 22 - .../Tests/Fixtures/expressions/power.test | 20 - .../Tests/Fixtures/expressions/sameas.test | 21 - .../Fixtures/expressions/starts_with.test | 27 - .../string_operator_as_var_assignment.test | 18 - .../Tests/Fixtures/expressions/strings.test | 10 - .../expressions/ternary_operator.test | 18 - .../expressions/ternary_operator_noelse.test | 10 - .../expressions/ternary_operator_nothen.test | 10 - .../two_word_operators_as_variables.test | 8 - .../Tests/Fixtures/expressions/unary.test | 12 - .../expressions/unary_macro_arguments.test | 22 - .../expressions/unary_precedence.test | 14 - .../extensions/anonymous_functions.test | 10 - .../test/Twig/Tests/Fixtures/filters/abs.test | 30 - .../Twig/Tests/Fixtures/filters/batch.test | 31 - .../Tests/Fixtures/filters/batch_float.test | 29 - .../filters/batch_with_empty_fill.test | 37 - .../filters/batch_with_exact_elements.test | 33 - .../Fixtures/filters/batch_with_fill.test | 37 - .../Fixtures/filters/batch_with_keys.test | 10 - .../filters/batch_with_more_elements.test | 23 - .../filters/batch_with_zero_elements.test | 10 - .../Twig/Tests/Fixtures/filters/column.test | 11 - .../Fixtures/filters/convert_encoding.test | 8 - .../Twig/Tests/Fixtures/filters/date.test | 90 -- .../Fixtures/filters/date_default_format.test | 14 - .../filters/date_default_format_interval.test | 14 - .../Fixtures/filters/date_immutable.test | 35 - .../Tests/Fixtures/filters/date_interval.test | 17 - .../Tests/Fixtures/filters/date_modify.test | 14 - .../Fixtures/filters/date_namedargs.test | 13 - .../Twig/Tests/Fixtures/filters/default.test | 159 -- .../Fixtures/filters/dynamic_filter.test | 10 - .../Twig/Tests/Fixtures/filters/escape.test | 8 - .../Fixtures/filters/escape_html_attr.test | 8 - .../Fixtures/filters/escape_javascript.test | 8 - .../filters/escape_non_supported_charset.test | 8 - .../Twig/Tests/Fixtures/filters/filter.test | 70 - .../Twig/Tests/Fixtures/filters/first.test | 17 - .../Tests/Fixtures/filters/force_escape.test | 18 - .../Twig/Tests/Fixtures/filters/format.test | 8 - .../Twig/Tests/Fixtures/filters/join.test | 38 - .../Tests/Fixtures/filters/json_encode.test | 12 - .../Twig/Tests/Fixtures/filters/last.test | 17 - .../Twig/Tests/Fixtures/filters/length.test | 40 - .../Tests/Fixtures/filters/length_utf8.test | 10 - .../test/Twig/Tests/Fixtures/filters/map.test | 41 - .../Twig/Tests/Fixtures/filters/merge.test | 25 - .../Twig/Tests/Fixtures/filters/nl2br.test | 14 - .../Tests/Fixtures/filters/number_format.test | 18 - .../filters/number_format_default.test | 21 - .../Twig/Tests/Fixtures/filters/reduce.test | 14 - .../Twig/Tests/Fixtures/filters/replace.test | 12 - .../Fixtures/filters/replace_invalid_arg.test | 8 - .../Twig/Tests/Fixtures/filters/reverse.test | 18 - .../Twig/Tests/Fixtures/filters/round.test | 22 - .../Twig/Tests/Fixtures/filters/slice.test | 54 - .../Twig/Tests/Fixtures/filters/sort.test | 12 - .../Tests/Fixtures/filters/spaceless.test | 8 - .../Tests/Fixtures/filters/special_chars.test | 8 - .../Twig/Tests/Fixtures/filters/split.test | 20 - .../Tests/Fixtures/filters/split_utf8.test | 22 - .../Tests/Fixtures/filters/static_calls.test | 10 - .../Twig/Tests/Fixtures/filters/trim.test | 24 - .../Tests/Fixtures/filters/urlencode.test | 14 - .../Tests/Fixtures/functions/attribute.test | 18 - .../Twig/Tests/Fixtures/functions/block.test | 12 - .../functions/block_with_template.test | 22 - .../functions/block_without_name.test | 12 - .../functions/block_without_parent.test | 11 - .../Tests/Fixtures/functions/constant.test | 10 - .../Twig/Tests/Fixtures/functions/cycle.test | 16 - .../Twig/Tests/Fixtures/functions/date.test | 27 - .../Fixtures/functions/date_namedargs.test | 11 - .../Twig/Tests/Fixtures/functions/dump.test | 16 - .../Tests/Fixtures/functions/dump_array.test | 19 - .../Fixtures/functions/dynamic_function.test | 10 - .../functions/include/assignment.test | 13 - .../functions/include/autoescaping.test | 10 - .../Fixtures/functions/include/basic.test | 17 - .../functions/include/expression.test | 17 - .../functions/include/ignore_missing.test | 10 - .../include/ignore_missing_exists.test | 11 - .../include/include_missing_extends.test | 13 - .../Fixtures/functions/include/missing.test | 8 - .../functions/include/missing_nested.test | 16 - .../Fixtures/functions/include/sandbox.test | 13 - .../functions/include/sandbox_disabling.test | 16 - .../sandbox_disabling_ignore_missing.test | 13 - .../functions/include/template_instance.test | 10 - .../functions/include/templates_as_array.test | 12 - .../functions/include/with_context.test | 16 - .../functions/include/with_variables.test | 12 - .../include_template_from_string.test | 11 - .../Tests/Fixtures/functions/magic_call.test | 8 - .../Fixtures/functions/magic_static_call.test | 10 - .../Twig/Tests/Fixtures/functions/max.test | 12 - .../Twig/Tests/Fixtures/functions/min.test | 12 - .../Twig/Tests/Fixtures/functions/range.test | 8 - .../recursive_block_with_inheritance.test | 21 - .../Twig/Tests/Fixtures/functions/source.test | 17 - .../Fixtures/functions/special_chars.test | 8 - .../Fixtures/functions/static_calls.test | 10 - .../functions/template_from_string.test | 15 - .../functions/template_from_string_error.test | 8 - .../Fixtures/functions/undefined_block.test | 16 - .../functions/undefined_block_deep.test | 20 - .../Tests/Fixtures/macros/default_values.test | 16 - .../Tests/Fixtures/macros/nested_calls.test | 18 - .../Fixtures/macros/reserved_variables.test | 14 - .../Twig/Tests/Fixtures/macros/simple.test | 22 - .../Tests/Fixtures/macros/unknown_macro.test | 10 - .../Twig/Tests/Fixtures/macros/varargs.test | 21 - .../Fixtures/macros/varargs_argument.test | 7 - .../Tests/Fixtures/macros/with_filters.test | 14 - .../regression/block_names_unicity.test | 19 - .../regression/combined_debug_info.test | 15 - .../Fixtures/regression/empty_token.test | 8 - .../Tests/Fixtures/regression/issue_1143.test | 23 - .../Fixtures/regression/multi_word_tests.test | 10 - .../regression/simple_xml_element.test | 17 - .../regression/strings_like_numbers.test | 8 - .../Twig/Tests/Fixtures/tags/apply/basic.test | 10 - .../Fixtures/tags/apply/json_encode.test | 8 - .../Tests/Fixtures/tags/apply/multiple.test | 10 - .../Tests/Fixtures/tags/apply/nested.test | 16 - .../Twig/Tests/Fixtures/tags/apply/scope.test | 15 - .../Fixtures/tags/apply/with_for_tag.test | 13 - .../Fixtures/tags/apply/with_if_tag.test | 29 - .../Tests/Fixtures/tags/autoescape/basic.test | 22 - .../Fixtures/tags/autoescape/blocks.test | 12 - .../tags/autoescape/double_escaping.test | 10 - .../Fixtures/tags/autoescape/functions.test | 83 - .../Fixtures/tags/autoescape/literal.test | 87 -- .../Fixtures/tags/autoescape/nested.test | 26 - .../Fixtures/tags/autoescape/objects.test | 26 - .../Tests/Fixtures/tags/autoescape/raw.test | 10 - .../Fixtures/tags/autoescape/strategy.test | 11 - .../Tests/Fixtures/tags/autoescape/type.test | 69 - .../tags/autoescape/with_filters.test | 131 -- .../autoescape/with_filters_arguments.test | 23 - .../autoescape/with_pre_escape_filters.test | 68 - .../with_preserves_safety_filters.test | 50 - .../Twig/Tests/Fixtures/tags/block/basic.test | 11 - .../tags/block/block_unique_name.test | 11 - .../Fixtures/tags/block/capturing_block.test | 24 - .../tags/block/conditional_block.test | 9 - .../Fixtures/tags/block/special_chars.test | 10 - .../tags/deprecated/block.legacy.test | 20 - .../tags/deprecated/macro.legacy.test | 21 - .../tags/deprecated/template.legacy.test | 12 - .../Twig/Tests/Fixtures/tags/embed/basic.test | 35 - .../tags/embed/complex_dynamic_parent.test | 35 - .../Fixtures/tags/embed/dynamic_parent.test | 35 - .../Tests/Fixtures/tags/embed/error_line.test | 16 - .../Tests/Fixtures/tags/embed/multiple.test | 50 - .../Tests/Fixtures/tags/embed/nested.test | 42 - .../Fixtures/tags/embed/with_extends.test | 60 - .../Fixtures/tags/filter/basic.legacy.test | 12 - .../tags/filter/json_encode.legacy.test | 10 - .../Fixtures/tags/filter/multiple.legacy.test | 12 - .../Fixtures/tags/filter/nested.legacy.test | 19 - .../Fixtures/tags/filter/scope.legacy.test | 13 - .../tags/filter/with_for_tag.legacy.test | 15 - .../tags/filter/with_if_tag.legacy.test | 31 - .../Fixtures/tags/for/condition.legacy.test | 16 - .../Twig/Tests/Fixtures/tags/for/context.test | 18 - .../Twig/Tests/Fixtures/tags/for/else.test | 23 - .../Fixtures/tags/for/inner_variables.test | 17 - .../Twig/Tests/Fixtures/tags/for/keys.test | 11 - .../Fixtures/tags/for/keys_and_values.test | 11 - .../Tests/Fixtures/tags/for/loop_context.test | 19 - .../Fixtures/tags/for/loop_context_local.test | 10 - .../Fixtures/tags/for/loop_not_defined.test | 10 - .../tags/for/loop_not_defined_cond.test | 9 - .../Tests/Fixtures/tags/for/nested_else.test | 17 - .../Twig/Tests/Fixtures/tags/for/objects.test | 43 - .../Fixtures/tags/for/objects_countable.test | 47 - .../Tests/Fixtures/tags/for/recursive.test | 18 - .../Twig/Tests/Fixtures/tags/for/values.test | 11 - .../test/Twig/Tests/Fixtures/tags/from.test | 14 - .../Twig/Tests/Fixtures/tags/if/basic.test | 22 - .../Tests/Fixtures/tags/if/expression.test | 22 - .../Tests/Fixtures/tags/include/basic.test | 16 - .../Fixtures/tags/include/expression.test | 16 - .../Fixtures/tags/include/ignore_missing.test | 10 - .../tags/include/ignore_missing_exists.test | 11 - .../tags/include/include_missing_extends.test | 13 - .../Tests/Fixtures/tags/include/missing.test | 8 - .../Fixtures/tags/include/missing_nested.test | 16 - .../Tests/Fixtures/tags/include/only.test | 20 - .../tags/include/template_instance.test | 10 - .../tags/include/templates_as_array.test | 12 - .../Fixtures/tags/include/with_variables.test | 14 - .../Fixtures/tags/inheritance/basic.test | 14 - .../Fixtures/tags/inheritance/block_expr.test | 30 - .../tags/inheritance/block_expr2.test | 32 - .../tags/inheritance/capturing_block.test | 17 - .../tags/inheritance/conditional.test | 14 - .../inheritance/conditional_block.legacy.test | 16 - .../Fixtures/tags/inheritance/dynamic.test | 14 - .../Fixtures/tags/inheritance/empty.test | 10 - .../tags/inheritance/extends_as_array.test | 12 - .../extends_as_array_with_empty_name.test | 12 - .../extends_as_array_with_null_name.test | 12 - .../tags/inheritance/extends_in_block.test | 10 - .../tags/inheritance/extends_in_macro.test | 10 - .../Fixtures/tags/inheritance/multiple.test | 12 - .../tags/inheritance/multiple_dynamic.test | 22 - .../tags/inheritance/nested_blocks.test | 22 - .../nested_blocks_parent_only.test | 15 - .../tags/inheritance/nested_inheritance.test | 16 - .../Fixtures/tags/inheritance/parent.test | 12 - .../parent_as_template_wrapper.test | 12 - .../tags/inheritance/parent_change.test | 16 - .../tags/inheritance/parent_isolation.test | 20 - .../tags/inheritance/parent_nested.test | 28 - .../inheritance/parent_without_extends.test | 8 - .../parent_without_extends_but_traits.test | 14 - .../tags/inheritance/template_instance.test | 14 - .../Tests/Fixtures/tags/inheritance/use.test | 44 - .../Fixtures/tags/macro/auto_import.test | 16 - .../tags/macro/auto_import_blocks.test | 18 - .../Twig/Tests/Fixtures/tags/macro/basic.test | 17 - .../Fixtures/tags/macro/endmacro_name.test | 16 - .../Tests/Fixtures/tags/macro/external.test | 17 - .../Twig/Tests/Fixtures/tags/macro/from.test | 18 - .../macro/from_embed_with_global_macro.test | 21 - .../tags/macro/from_in_block_is_local.test | 18 - .../tags/macro/from_local_override.test | 28 - .../tags/macro/from_macro_in_a_macro.test | 18 - .../tags/macro/from_macros_in_parent.test | 16 - .../tags/macro/from_nested_blocks.test | 18 - .../from_nested_blocks_with_global_macro.test | 18 - .../Fixtures/tags/macro/from_recursive.test | 27 - .../Fixtures/tags/macro/from_self_parent.test | 20 - .../tags/macro/from_syntax_error.test | 8 - .../Tests/Fixtures/tags/macro/global.test | 14 - .../tags/macro/import_and_blocks.test | 36 - .../macro/import_embed_with_global_macro.test | 21 - .../macro/import_from_string_template.test | 10 - .../tags/macro/import_in_block_is_local.test | 18 - .../tags/macro/import_local_override.test | 28 - .../tags/macro/import_macro_in_a_macro.test | 18 - .../tags/macro/import_macros_in_parent.test | 16 - .../tags/macro/import_nested_blocks.test | 18 - ...mport_nested_blocks_with_global_macro.test | 18 - .../macro/import_same_parent_and_child.test | 30 - .../tags/macro/import_self_parent.test | 23 - .../tags/macro/import_syntax_error.test | 10 - .../Fixtures/tags/macro/self_import.test | 17 - .../Fixtures/tags/macro/special_chars.test | 14 - .../Fixtures/tags/macro/super_globals.test | 14 - .../Tests/Fixtures/tags/sandbox/array.test | 16 - .../Fixtures/tags/sandbox/not_valid1.test | 11 - .../Fixtures/tags/sandbox/not_valid2.test | 14 - .../Tests/Fixtures/tags/sandbox/simple.test | 22 - .../Twig/Tests/Fixtures/tags/set/basic.test | 20 - .../Fixtures/tags/set/capture-empty.test | 9 - .../Twig/Tests/Fixtures/tags/set/capture.test | 10 - .../Fixtures/tags/set/capture_scope.test | 10 - .../Tests/Fixtures/tags/set/expression.test | 12 - .../Tests/Fixtures/tags/set/inheritance.test | 24 - .../tags/set/inheritance_overriding.test | 24 - .../Tests/Fixtures/tags/set/mutating.test | 17 - .../spaceless/root_level_in_child.legacy.test | 23 - .../Tests/Fixtures/tags/spaceless/simple.test | 14 - .../Tests/Fixtures/tags/special_chars.test | 8 - .../Twig/Tests/Fixtures/tags/use/aliases.test | 12 - .../Twig/Tests/Fixtures/tags/use/basic.test | 12 - .../Twig/Tests/Fixtures/tags/use/deep.test | 22 - .../Tests/Fixtures/tags/use/deep_empty.test | 10 - .../Tests/Fixtures/tags/use/inheritance.test | 25 - .../Tests/Fixtures/tags/use/inheritance2.test | 24 - .../Tests/Fixtures/tags/use/multiple.test | 21 - .../Fixtures/tags/use/multiple_aliases.test | 23 - .../Tests/Fixtures/tags/use/parent_block.test | 24 - .../Fixtures/tags/use/parent_block2.test | 24 - .../Fixtures/tags/use/parent_block3.test | 38 - .../Fixtures/tags/use/use_with_parent.test | 24 - .../Tests/Fixtures/tags/verbatim/basic.test | 10 - .../tags/verbatim/whitespace_control.test | 56 - .../Twig/Tests/Fixtures/tags/with/basic.test | 13 - .../Tests/Fixtures/tags/with/expression.test | 10 - .../Tests/Fixtures/tags/with/globals.test | 10 - .../Tests/Fixtures/tags/with/iterable.test | 10 - .../Twig/Tests/Fixtures/tags/with/nested.test | 15 - .../Fixtures/tags/with/with_no_hash.test | 10 - .../Tests/Fixtures/tags/with/with_only.test | 10 - .../test/Twig/Tests/Fixtures/tests/array.test | 24 - .../Twig/Tests/Fixtures/tests/constant.test | 14 - .../Twig/Tests/Fixtures/tests/defined.test | 129 -- .../Fixtures/tests/defined_for_attribute.test | 35 - .../Fixtures/tests/defined_for_blocks.test | 38 - .../defined_for_blocks_with_template.test | 17 - .../Fixtures/tests/defined_for_constants.test | 14 - .../Fixtures/tests/defined_for_macros.test | 41 - .../tests/defined_on_complex_expr.test | 8 - .../Tests/Fixtures/tests/dynamic_test.test | 14 - .../test/Twig/Tests/Fixtures/tests/empty.test | 42 - .../test/Twig/Tests/Fixtures/tests/even.test | 14 - .../test/Twig/Tests/Fixtures/tests/in.test | 118 -- .../Tests/Fixtures/tests/in_with_objects.test | 19 - .../Twig/Tests/Fixtures/tests/iterable.test | 19 - .../Tests/Fixtures/tests/null_coalesce.test | 30 - .../test/Twig/Tests/Fixtures/tests/odd.test | 10 - .../Tests/Fixtures/whitespace/trim_block.test | 68 - .../whitespace/trim_delimiter_as_strings.test | 10 - .../Tests/Fixtures/whitespace/trim_left.test | 32 - .../Fixtures/whitespace/trim_line_left.test | 33 - .../Fixtures/whitespace/trim_line_right.test | 32 - .../Tests/Fixtures/whitespace/trim_right.test | 28 - .../twig/test/Twig/Tests/IntegrationTest.php | 386 ----- .../twig/twig/test/Twig/Tests/LexerTest.php | 370 ----- .../twig/test/Twig/Tests/Loader/ArrayTest.php | 88 -- .../twig/test/Twig/Tests/Loader/ChainTest.php | 95 -- .../test/Twig/Tests/Loader/FilesystemTest.php | 242 --- .../array_inheritance_empty_parent.html.twig | 3 - ...y_inheritance_nonexistent_parent.html.twig | 3 - .../array_inheritance_null_parent.html.twig | 3 - .../array_inheritance_valid_parent.html.twig | 3 - .../Fixtures/inheritance/parent.html.twig | 1 - .../inheritance/spare_parent.html.twig | 1 - .../Tests/Loader/Fixtures/named/index.html | 1 - .../Loader/Fixtures/named_bis/index.html | 1 - .../Loader/Fixtures/named_final/index.html | 1 - .../Fixtures/named_quater/named_absolute.html | 1 - .../Loader/Fixtures/named_ter/index.html | 1 - .../Tests/Loader/Fixtures/normal/index.html | 1 - .../Loader/Fixtures/normal_bis/index.html | 1 - .../Loader/Fixtures/normal_final/index.html | 1 - .../Loader/Fixtures/normal_ter/index.html | 1 - .../Loader/Fixtures/phar/phar-sample.phar | Bin 6786 -> 0 bytes .../Fixtures/themes/theme1/blocks.html.twig | 3 - .../Fixtures/themes/theme2/blocks.html.twig | 3 - .../test/Twig/Tests/Node/AutoEscapeTest.php | 37 - .../Twig/Tests/Node/BlockReferenceTest.php | 34 - .../twig/test/Twig/Tests/Node/BlockTest.php | 44 - .../test/Twig/Tests/Node/DeprecatedTest.php | 82 - .../twig/twig/test/Twig/Tests/Node/DoTest.php | 36 - .../Twig/Tests/Node/Expression/ArrayTest.php | 41 - .../Tests/Node/Expression/AssignNameTest.php | 32 - .../Tests/Node/Expression/Binary/AddTest.php | 38 - .../Tests/Node/Expression/Binary/AndTest.php | 38 - .../Node/Expression/Binary/ConcatTest.php | 38 - .../Tests/Node/Expression/Binary/DivTest.php | 38 - .../Node/Expression/Binary/FloorDivTest.php | 38 - .../Tests/Node/Expression/Binary/ModTest.php | 38 - .../Tests/Node/Expression/Binary/MulTest.php | 38 - .../Tests/Node/Expression/Binary/OrTest.php | 38 - .../Tests/Node/Expression/Binary/SubTest.php | 38 - .../Twig/Tests/Node/Expression/CallTest.php | 153 -- .../Tests/Node/Expression/ConditionalTest.php | 42 - .../Tests/Node/Expression/ConstantTest.php | 33 - .../Twig/Tests/Node/Expression/FilterTest.php | 160 -- .../Tests/Node/Expression/FunctionTest.php | 120 -- .../Tests/Node/Expression/GetAttrTest.php | 58 - .../Twig/Tests/Node/Expression/NameTest.php | 44 - .../Node/Expression/NullCoalesceTest.php | 27 - .../Twig/Tests/Node/Expression/ParentTest.php | 31 - .../Twig/Tests/Node/Expression/TestTest.php | 89 -- .../Tests/Node/Expression/Unary/NegTest.php | 36 - .../Tests/Node/Expression/Unary/NotTest.php | 35 - .../Tests/Node/Expression/Unary/PosTest.php | 35 - .../twig/test/Twig/Tests/Node/ForTest.php | 200 --- .../twig/twig/test/Twig/Tests/Node/IfTest.php | 95 -- .../twig/test/Twig/Tests/Node/ImportTest.php | 45 - .../twig/test/Twig/Tests/Node/IncludeTest.php | 93 -- .../twig/test/Twig/Tests/Node/MacroTest.php | 68 - .../twig/test/Twig/Tests/Node/ModuleTest.php | 274 ---- .../twig/test/Twig/Tests/Node/PrintTest.php | 33 - .../twig/test/Twig/Tests/Node/SandboxTest.php | 47 - .../twig/test/Twig/Tests/Node/SetTest.php | 78 - .../test/Twig/Tests/Node/SpacelessTest.php | 42 - .../twig/test/Twig/Tests/Node/TextTest.php | 31 - .../Twig/Tests/NodeVisitor/OptimizerTest.php | 114 -- .../twig/twig/test/Twig/Tests/ParserTest.php | 211 --- .../Tests/Profiler/Dumper/AbstractTest.php | 105 -- .../Tests/Profiler/Dumper/BlackfireTest.php | 34 - .../Twig/Tests/Profiler/Dumper/HtmlTest.php | 32 - .../Twig/Tests/Profiler/Dumper/TextTest.php | 32 - .../test/Twig/Tests/Profiler/ProfileTest.php | 112 -- .../twig/test/Twig/Tests/TemplateTest.php | 746 --------- .../test/Twig/Tests/TemplateWrapperTest.php | 68 - .../twig/test/Twig/Tests/TokenStreamTest.php | 73 - .../Tests/Util/DeprecationCollectorTest.php | 47 - 799 files changed, 2873 insertions(+), 24205 deletions(-) create mode 100644 system/backend/php/vendor/symfony/polyfill-ctype/bootstrap80.php create mode 100644 system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 system/backend/php/vendor/twig/twig/.gitattributes create mode 100644 system/backend/php/vendor/twig/twig/.github/dependabot.yml create mode 100644 system/backend/php/vendor/twig/twig/.github/workflows/ci.yml create mode 100644 system/backend/php/vendor/twig/twig/.github/workflows/documentation.yml rename system/backend/php/vendor/twig/twig/{.php_cs.dist => .php-cs-fixer.dist.php} (75%) delete mode 100644 system/backend/php/vendor/twig/twig/.travis.yml delete mode 100644 system/backend/php/vendor/twig/twig/doc/advanced.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/api.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/coding_standards.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/deprecated.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/abs.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/batch.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/capitalize.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/column.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/convert_encoding.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/date.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/date_modify.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/default.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/escape.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/filter.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/first.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/format.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/index.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/join.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/json_encode.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/keys.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/last.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/length.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/lower.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/map.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/merge.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/nl2br.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/number_format.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/raw.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/reduce.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/replace.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/reverse.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/round.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/slice.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/sort.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/spaceless.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/split.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/striptags.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/title.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/trim.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/upper.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/filters/url_encode.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/attribute.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/block.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/constant.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/cycle.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/date.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/dump.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/include.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/index.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/max.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/min.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/parent.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/random.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/range.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/source.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/functions/template_from_string.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/index.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/installation.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/internals.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/intro.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/recipes.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/apply.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/autoescape.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/block.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/deprecated.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/do.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/embed.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/extends.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/filter.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/flush.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/for.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/from.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/if.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/import.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/include.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/index.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/macro.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/sandbox.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/set.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/spaceless.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/use.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/verbatim.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tags/with.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/templates.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/constant.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/defined.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/divisibleby.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/empty.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/even.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/index.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/iterable.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/null.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/odd.rst delete mode 100644 system/backend/php/vendor/twig/twig/doc/tests/sameas.rst delete mode 100755 system/backend/php/vendor/twig/twig/drupal_test.sh delete mode 100644 system/backend/php/vendor/twig/twig/phpunit.xml.dist create mode 100644 system/backend/php/vendor/twig/twig/src/Node/CheckSecurityCallNode.php create mode 100644 system/backend/php/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/CompilerTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/ErrorTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/EscaperTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/extensions/anonymous_functions.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/column.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_static_call.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block_deep.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/unknown_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/capturing_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/conditional_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/capturing_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional_block.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_embed_with_global_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macros_in_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_recursive.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_self_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_embed_with_global_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macros_in_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_same_parent_and_child.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/root_level_in_child.legacy.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_macros.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/LexerTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/ParserTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php delete mode 100644 system/backend/php/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php diff --git a/system/backend/php/composer.lock b/system/backend/php/composer.lock index 7083240fb2e..c882ab0c685 100644 --- a/system/backend/php/composer.lock +++ b/system/backend/php/composer.lock @@ -775,20 +775,23 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.11.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" @@ -796,29 +799,33 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, { "name": "Gert de Pagter", "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -829,7 +836,21 @@ "polyfill", "portable" ], - "time": "2019-02-06T07:57:58+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -998,20 +1019,23 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.11.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" @@ -1019,16 +1043,20 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1053,7 +1081,21 @@ "portable", "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php72", @@ -1189,32 +1231,32 @@ }, { "name": "twig/twig", - "version": "v2.11.2", + "version": "v2.15.5", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79" + "reference": "fc02a6af3eeb97c4bf5650debc76c2eda85ac22e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/84a463403da1c81afbcedda8f0e788c78bd25a79", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/fc02a6af3eeb97c4bf5650debc76c2eda85ac22e", + "reference": "fc02a6af3eeb97c4bf5650debc76c2eda85ac22e", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.1.3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11-dev" + "dev-master": "2.15-dev" } }, "autoload": { @@ -1236,15 +1278,14 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://twig.symfony.com/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -1252,7 +1293,17 @@ "keywords": [ "templating" ], - "time": "2019-06-05T11:17:07+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2023-05-03T17:49:41+00:00" }, { "name": "zircote/swagger-php", diff --git a/system/backend/php/vendor/composer/installed.json b/system/backend/php/vendor/composer/installed.json index 891b026f8ba..5536e8819d9 100644 --- a/system/backend/php/vendor/composer/installed.json +++ b/system/backend/php/vendor/composer/installed.json @@ -792,53 +792,60 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.11.0", - "version_normalized": "1.11.0.0", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" }, - "time": "2019-02-06T07:57:58+00:00", + "time": "2022-11-03T14:55:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, { "name": "Gert de Pagter", "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -848,6 +855,20 @@ "ctype", "polyfill", "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ] }, { @@ -1021,40 +1042,47 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.11.0", - "version_normalized": "1.11.0.0", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2019-02-06T07:57:58+00:00", + "time": "2022-11-03T14:55:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1078,6 +1106,20 @@ "polyfill", "portable", "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ] }, { @@ -1218,34 +1260,34 @@ }, { "name": "twig/twig", - "version": "v2.11.2", - "version_normalized": "2.11.2.0", + "version": "v2.15.5", + "version_normalized": "2.15.5.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79" + "reference": "fc02a6af3eeb97c4bf5650debc76c2eda85ac22e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/84a463403da1c81afbcedda8f0e788c78bd25a79", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/fc02a6af3eeb97c4bf5650debc76c2eda85ac22e", + "reference": "fc02a6af3eeb97c4bf5650debc76c2eda85ac22e", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.1.3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2019-06-05T11:17:07+00:00", + "time": "2023-05-03T17:49:41+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11-dev" + "dev-master": "2.15-dev" } }, "installation-source": "dist", @@ -1268,21 +1310,30 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://twig.symfony.com/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", "homepage": "https://twig.symfony.com", "keywords": [ "templating" + ], + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } ] }, { diff --git a/system/backend/php/vendor/symfony/polyfill-ctype/Ctype.php b/system/backend/php/vendor/symfony/polyfill-ctype/Ctype.php index 58414dc73bd..ba75a2c95fc 100644 --- a/system/backend/php/vendor/symfony/polyfill-ctype/Ctype.php +++ b/system/backend/php/vendor/symfony/polyfill-ctype/Ctype.php @@ -25,13 +25,13 @@ final class Ctype * * @see https://php.net/ctype-alnum * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ public static function ctype_alnum($text) * * @see https://php.net/ctype-alpha * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ public static function ctype_alpha($text) * * @see https://php.net/ctype-cntrl * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ public static function ctype_cntrl($text) * * @see https://php.net/ctype-digit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ public static function ctype_digit($text) * * @see https://php.net/ctype-graph * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ public static function ctype_graph($text) * * @see https://php.net/ctype-lower * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ public static function ctype_lower($text) * * @see https://php.net/ctype-print * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ public static function ctype_print($text) * * @see https://php.net/ctype-punct * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ public static function ctype_punct($text) * * @see https://php.net/ctype-space * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ public static function ctype_space($text) * * @see https://php.net/ctype-upper * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ public static function ctype_upper($text) * * @see https://php.net/ctype-xdigit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,11 +204,12 @@ public static function ctype_xdigit($text) * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param string|int $int + * @param mixed $int + * @param string $function * * @return mixed */ - private static function convert_int_to_char_for_ctype($int) + private static function convert_int_to_char_for_ctype($int, $function) { if (!\is_int($int)) { return $int; @@ -218,6 +219,10 @@ private static function convert_int_to_char_for_ctype($int) return (string) $int; } + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if ($int < 0) { $int += 256; } diff --git a/system/backend/php/vendor/symfony/polyfill-ctype/README.md b/system/backend/php/vendor/symfony/polyfill-ctype/README.md index 8add1ab0096..b144d03c3c6 100644 --- a/system/backend/php/vendor/symfony/polyfill-ctype/README.md +++ b/system/backend/php/vendor/symfony/polyfill-ctype/README.md @@ -4,7 +4,7 @@ Symfony Polyfill / Ctype This component provides `ctype_*` functions to users who run php versions without the ctype extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap.php b/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap.php index 14d1d0faa37..d54524b31b4 100644 --- a/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap.php +++ b/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap.php @@ -11,16 +11,40 @@ use Symfony\Polyfill\Ctype as p; +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + if (!function_exists('ctype_alnum')) { function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } +} +if (!function_exists('ctype_alpha')) { function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } +} +if (!function_exists('ctype_cntrl')) { function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } +} +if (!function_exists('ctype_digit')) { function ctype_digit($text) { return p\Ctype::ctype_digit($text); } +} +if (!function_exists('ctype_graph')) { function ctype_graph($text) { return p\Ctype::ctype_graph($text); } +} +if (!function_exists('ctype_lower')) { function ctype_lower($text) { return p\Ctype::ctype_lower($text); } +} +if (!function_exists('ctype_print')) { function ctype_print($text) { return p\Ctype::ctype_print($text); } +} +if (!function_exists('ctype_punct')) { function ctype_punct($text) { return p\Ctype::ctype_punct($text); } +} +if (!function_exists('ctype_space')) { function ctype_space($text) { return p\Ctype::ctype_space($text); } +} +if (!function_exists('ctype_upper')) { function ctype_upper($text) { return p\Ctype::ctype_upper($text); } +} +if (!function_exists('ctype_xdigit')) { function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } } diff --git a/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap80.php b/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap80.php new file mode 100644 index 00000000000..ab2f8611dac --- /dev/null +++ b/system/backend/php/vendor/symfony/polyfill-ctype/bootstrap80.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Ctype as p; + +if (!function_exists('ctype_alnum')) { + function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } +} +if (!function_exists('ctype_alpha')) { + function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } +} +if (!function_exists('ctype_cntrl')) { + function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } +} +if (!function_exists('ctype_digit')) { + function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } +} +if (!function_exists('ctype_graph')) { + function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } +} +if (!function_exists('ctype_lower')) { + function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } +} +if (!function_exists('ctype_print')) { + function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } +} +if (!function_exists('ctype_punct')) { + function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } +} +if (!function_exists('ctype_space')) { + function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } +} +if (!function_exists('ctype_upper')) { + function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } +} +if (!function_exists('ctype_xdigit')) { + function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } +} diff --git a/system/backend/php/vendor/symfony/polyfill-ctype/composer.json b/system/backend/php/vendor/symfony/polyfill-ctype/composer.json index c24e20ca75f..1b3efff5725 100644 --- a/system/backend/php/vendor/symfony/polyfill-ctype/composer.json +++ b/system/backend/php/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,10 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, @@ -28,7 +31,11 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } } } diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/Mbstring.php b/system/backend/php/vendor/symfony/polyfill-mbstring/Mbstring.php index a5e4a8fde4b..bce5c4a84ab 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -35,6 +35,7 @@ * - mb_strlen - Get string length * - mb_strpos - Find position of first occurrence of string in a string * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array * - mb_strtolower - Make a string lowercase * - mb_strtoupper - Make a string uppercase * - mb_substitute_character - Set/Get substitution character @@ -66,19 +67,20 @@ */ final class Mbstring { - const MB_CASE_FOLD = PHP_INT_MAX; + public const MB_CASE_FOLD = \PHP_INT_MAX; - private static $encodingList = array('ASCII', 'UTF-8'); + private const CASE_FOLD = [ + ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; - private static $caseFold = array( - array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), - array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), - ); public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -103,24 +105,22 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); } - return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); } if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); $fromEncoding = 'UTF-8'; } return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } - public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) { - $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); - $ok = true; array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { $ok = false; } }); @@ -135,23 +135,23 @@ public static function mb_decode_mimeheader($s) public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); } public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; } - if (!\is_array($convmap) || !$convmap) { + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { return false; } if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return ''; // Instead of null (cf. mb_encode_numericentity). } @@ -184,7 +184,7 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; for ($i = 0; $i < $cnt; $i += 4) { if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return Mbstring::mb_chr($c - $convmap[$i + 2]); + return self::mb_chr($c - $convmap[$i + 2]); } } @@ -200,24 +200,24 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; } - if (!\is_array($convmap) || !$convmap) { + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { return false; } if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; // Instead of '' (cf. mb_decode_numericentity). } if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); return null; } @@ -238,7 +238,7 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ $s = iconv($encoding, 'UTF-8//IGNORE', $s); } - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; $cnt = floor(\count($convmap) / 4) * 4; $i = 0; @@ -286,14 +286,14 @@ public static function mb_convert_case($s, $mode, $encoding = null) $s = iconv($encoding, 'UTF-8//IGNORE', $s); } - if (MB_CASE_TITLE == $mode) { + if (\MB_CASE_TITLE == $mode) { static $titleRegexp = null; if (null === $titleRegexp) { $titleRegexp = self::getData('titleCaseRegexp'); } - $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); } else { - if (MB_CASE_UPPER == $mode) { + if (\MB_CASE_UPPER == $mode) { static $upper = null; if (null === $upper) { $upper = self::getData('upperCase'); @@ -301,7 +301,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); } static $lower = null; @@ -311,7 +311,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $lower; } - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; $i = 0; $len = \strlen($s); @@ -352,15 +352,19 @@ public static function mb_internal_encoding($encoding = null) return self::$internalEncoding; } - $encoding = self::getEncoding($encoding); + $normalizedEncoding = self::getEncoding($encoding); - if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { - self::$internalEncoding = $encoding; + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; return true; } - return false; + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); } public static function mb_language($lang = null) @@ -369,20 +373,24 @@ public static function mb_language($lang = null) return self::$language; } - switch ($lang = strtolower($lang)) { + switch ($normalizedLang = strtolower($lang)) { case 'uni': case 'neutral': - self::$language = $lang; + self::$language = $normalizedLang; return true; } - return false; + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); } public static function mb_list_encodings() { - return array('UTF-8'); + return ['UTF-8']; } public static function mb_encoding_aliases($encoding) @@ -390,7 +398,7 @@ public static function mb_encoding_aliases($encoding) switch (strtoupper($encoding)) { case 'UTF8': case 'UTF-8': - return array('utf8'); + return ['utf8']; } return false; @@ -405,7 +413,7 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -492,9 +500,13 @@ public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = nu $needle = (string) $needle; if ('' === $needle) { - trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - return false; + return false; + } + + return 0; } return iconv_strpos($haystack, $needle, $offset, $encoding); @@ -511,42 +523,98 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = n $offset = 0; } elseif ($offset = (int) $offset) { if ($offset < 0) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } $offset = 0; } else { $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); } } - $pos = iconv_strrpos($haystack, $needle, $encoding); + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); return false !== $pos ? $offset + $pos : false; } + public static function mb_str_split($string, $split_length = 1, $encoding = null) + { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + + return null; + } + + if (1 > $split_length = (int) $split_length) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + } + + $result = []; + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + public static function mb_strtolower($s, $encoding = null) { - return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); } public static function mb_strtoupper($s, $encoding = null) { - return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); } public static function mb_substitute_character($c = null) { + if (null === $c) { + return 'none'; + } if (0 === strcasecmp($c, 'none')) { return true; } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } - return null !== $c ? false : 'none'; + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } public static function mb_substr($s, $start, $length = null, $encoding = null) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - return substr($s, $start, null === $length ? 2147483647 : $length); + return (string) substr($s, $start, null === $length ? 2147483647 : $length); } if ($start < 0) { @@ -587,10 +655,11 @@ public static function mb_strrchr($haystack, $needle, $part = false, $encoding = { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrchr($haystack, $needle, $part); + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); } - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } @@ -626,7 +695,7 @@ public static function mb_strstr($haystack, $needle, $part = false, $encoding = public static function mb_get_info($type = 'all') { - $info = array( + $info = [ 'internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', @@ -641,7 +710,7 @@ public static function mb_get_info($type = 'all') 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off', - ); + ]; if ('all' === $type) { return $info; @@ -745,7 +814,7 @@ private static function html_encoding_callback(array $m) { $i = 1; $entities = ''; - $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); while (isset($m[$i])) { if (0x80 > $m[$i]) { @@ -768,7 +837,7 @@ private static function html_encoding_callback(array $m) private static function title_case(array $s) { - return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); } private static function getData($file) @@ -786,11 +855,16 @@ private static function getEncoding($encoding) return self::$internalEncoding; } + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + $encoding = strtoupper($encoding); if ('8BIT' === $encoding || 'BINARY' === $encoding) { return 'CP850'; } + if ('UTF8' === $encoding) { return 'UTF-8'; } diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/README.md b/system/backend/php/vendor/symfony/polyfill-mbstring/README.md index 342e8286dbf..478b40da25e 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/README.md +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/README.md @@ -2,10 +2,10 @@ Symfony Polyfill / Mbstring =========================== This component provides a partial, native PHP implementation for the -[Mbstring](http://php.net/mbstring) extension. +[Mbstring](https://php.net/mbstring) extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php index e6fbfa64e62..fac60b081a1 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -1,6 +1,6 @@ 'a', 'B' => 'b', 'C' => 'c', @@ -81,7 +81,7 @@ 'Ī' => 'ī', 'Ĭ' => 'ĭ', 'Į' => 'į', - 'İ' => 'i', + 'İ' => 'i̇', 'IJ' => 'ij', 'Ĵ' => 'ĵ', 'Ķ' => 'ķ', @@ -510,6 +510,138 @@ 'Ⴥ' => 'ⴥ', 'Ⴧ' => 'ⴧ', 'Ⴭ' => 'ⴭ', + 'Ꭰ' => 'ꭰ', + 'Ꭱ' => 'ꭱ', + 'Ꭲ' => 'ꭲ', + 'Ꭳ' => 'ꭳ', + 'Ꭴ' => 'ꭴ', + 'Ꭵ' => 'ꭵ', + 'Ꭶ' => 'ꭶ', + 'Ꭷ' => 'ꭷ', + 'Ꭸ' => 'ꭸ', + 'Ꭹ' => 'ꭹ', + 'Ꭺ' => 'ꭺ', + 'Ꭻ' => 'ꭻ', + 'Ꭼ' => 'ꭼ', + 'Ꭽ' => 'ꭽ', + 'Ꭾ' => 'ꭾ', + 'Ꭿ' => 'ꭿ', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ꮁ', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ꮅ', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ꮍ', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ꮏ', + 'Ꮐ' => 'ꮐ', + 'Ꮑ' => 'ꮑ', + 'Ꮒ' => 'ꮒ', + 'Ꮓ' => 'ꮓ', + 'Ꮔ' => 'ꮔ', + 'Ꮕ' => 'ꮕ', + 'Ꮖ' => 'ꮖ', + 'Ꮗ' => 'ꮗ', + 'Ꮘ' => 'ꮘ', + 'Ꮙ' => 'ꮙ', + 'Ꮚ' => 'ꮚ', + 'Ꮛ' => 'ꮛ', + 'Ꮜ' => 'ꮜ', + 'Ꮝ' => 'ꮝ', + 'Ꮞ' => 'ꮞ', + 'Ꮟ' => 'ꮟ', + 'Ꮠ' => 'ꮠ', + 'Ꮡ' => 'ꮡ', + 'Ꮢ' => 'ꮢ', + 'Ꮣ' => 'ꮣ', + 'Ꮤ' => 'ꮤ', + 'Ꮥ' => 'ꮥ', + 'Ꮦ' => 'ꮦ', + 'Ꮧ' => 'ꮧ', + 'Ꮨ' => 'ꮨ', + 'Ꮩ' => 'ꮩ', + 'Ꮪ' => 'ꮪ', + 'Ꮫ' => 'ꮫ', + 'Ꮬ' => 'ꮬ', + 'Ꮭ' => 'ꮭ', + 'Ꮮ' => 'ꮮ', + 'Ꮯ' => 'ꮯ', + 'Ꮰ' => 'ꮰ', + 'Ꮱ' => 'ꮱ', + 'Ꮲ' => 'ꮲ', + 'Ꮳ' => 'ꮳ', + 'Ꮴ' => 'ꮴ', + 'Ꮵ' => 'ꮵ', + 'Ꮶ' => 'ꮶ', + 'Ꮷ' => 'ꮷ', + 'Ꮸ' => 'ꮸ', + 'Ꮹ' => 'ꮹ', + 'Ꮺ' => 'ꮺ', + 'Ꮻ' => 'ꮻ', + 'Ꮼ' => 'ꮼ', + 'Ꮽ' => 'ꮽ', + 'Ꮾ' => 'ꮾ', + 'Ꮿ' => 'ꮿ', + 'Ᏸ' => 'ᏸ', + 'Ᏹ' => 'ᏹ', + 'Ᏺ' => 'ᏺ', + 'Ᏻ' => 'ᏻ', + 'Ᏼ' => 'ᏼ', + 'Ᏽ' => 'ᏽ', + 'Ა' => 'ა', + 'Ბ' => 'ბ', + 'Გ' => 'გ', + 'Დ' => 'დ', + 'Ე' => 'ე', + 'Ვ' => 'ვ', + 'Ზ' => 'ზ', + 'Თ' => 'თ', + 'Ი' => 'ი', + 'Კ' => 'კ', + 'Ლ' => 'ლ', + 'Მ' => 'მ', + 'Ნ' => 'ნ', + 'Ო' => 'ო', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'Რ' => 'რ', + 'Ს' => 'ს', + 'Ტ' => 'ტ', + 'Უ' => 'უ', + 'Ფ' => 'ფ', + 'Ქ' => 'ქ', + 'Ღ' => 'ღ', + 'Ყ' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'Ჭ' => 'ჭ', + 'Ხ' => 'ხ', + 'Ჯ' => 'ჯ', + 'Ჰ' => 'ჰ', + 'Ჱ' => 'ჱ', + 'Ჲ' => 'ჲ', + 'Ჳ' => 'ჳ', + 'Ჴ' => 'ჴ', + 'Ჵ' => 'ჵ', + 'Ჶ' => 'ჶ', + 'Ჷ' => 'ჷ', + 'Ჸ' => 'ჸ', + 'Ჹ' => 'ჹ', + 'Ჺ' => 'ჺ', + 'Ჽ' => 'ჽ', + 'Ჾ' => 'ჾ', + 'Ჿ' => 'ჿ', 'Ḁ' => 'ḁ', 'Ḃ' => 'ḃ', 'Ḅ' => 'ḅ', @@ -993,8 +1125,24 @@ 'Ɜ' => 'ɜ', 'Ɡ' => 'ɡ', 'Ɬ' => 'ɬ', + 'Ɪ' => 'ɪ', 'Ʞ' => 'ʞ', 'Ʇ' => 'ʇ', + 'Ʝ' => 'ʝ', + 'Ꭓ' => 'ꭓ', + 'Ꞵ' => 'ꞵ', + 'Ꞷ' => 'ꞷ', + 'Ꞹ' => 'ꞹ', + 'Ꞻ' => 'ꞻ', + 'Ꞽ' => 'ꞽ', + 'Ꞿ' => 'ꞿ', + 'Ꟃ' => 'ꟃ', + 'Ꞔ' => 'ꞔ', + 'Ʂ' => 'ʂ', + 'Ᶎ' => 'ᶎ', + 'Ꟈ' => 'ꟈ', + 'Ꟊ' => 'ꟊ', + 'Ꟶ' => 'ꟶ', 'A' => 'a', 'B' => 'b', 'C' => 'c', @@ -1061,6 +1209,93 @@ '𐐥' => '𐑍', '𐐦' => '𐑎', '𐐧' => '𐑏', + '𐒰' => '𐓘', + '𐒱' => '𐓙', + '𐒲' => '𐓚', + '𐒳' => '𐓛', + '𐒴' => '𐓜', + '𐒵' => '𐓝', + '𐒶' => '𐓞', + '𐒷' => '𐓟', + '𐒸' => '𐓠', + '𐒹' => '𐓡', + '𐒺' => '𐓢', + '𐒻' => '𐓣', + '𐒼' => '𐓤', + '𐒽' => '𐓥', + '𐒾' => '𐓦', + '𐒿' => '𐓧', + '𐓀' => '𐓨', + '𐓁' => '𐓩', + '𐓂' => '𐓪', + '𐓃' => '𐓫', + '𐓄' => '𐓬', + '𐓅' => '𐓭', + '𐓆' => '𐓮', + '𐓇' => '𐓯', + '𐓈' => '𐓰', + '𐓉' => '𐓱', + '𐓊' => '𐓲', + '𐓋' => '𐓳', + '𐓌' => '𐓴', + '𐓍' => '𐓵', + '𐓎' => '𐓶', + '𐓏' => '𐓷', + '𐓐' => '𐓸', + '𐓑' => '𐓹', + '𐓒' => '𐓺', + '𐓓' => '𐓻', + '𐲀' => '𐳀', + '𐲁' => '𐳁', + '𐲂' => '𐳂', + '𐲃' => '𐳃', + '𐲄' => '𐳄', + '𐲅' => '𐳅', + '𐲆' => '𐳆', + '𐲇' => '𐳇', + '𐲈' => '𐳈', + '𐲉' => '𐳉', + '𐲊' => '𐳊', + '𐲋' => '𐳋', + '𐲌' => '𐳌', + '𐲍' => '𐳍', + '𐲎' => '𐳎', + '𐲏' => '𐳏', + '𐲐' => '𐳐', + '𐲑' => '𐳑', + '𐲒' => '𐳒', + '𐲓' => '𐳓', + '𐲔' => '𐳔', + '𐲕' => '𐳕', + '𐲖' => '𐳖', + '𐲗' => '𐳗', + '𐲘' => '𐳘', + '𐲙' => '𐳙', + '𐲚' => '𐳚', + '𐲛' => '𐳛', + '𐲜' => '𐳜', + '𐲝' => '𐳝', + '𐲞' => '𐳞', + '𐲟' => '𐳟', + '𐲠' => '𐳠', + '𐲡' => '𐳡', + '𐲢' => '𐳢', + '𐲣' => '𐳣', + '𐲤' => '𐳤', + '𐲥' => '𐳥', + '𐲦' => '𐳦', + '𐲧' => '𐳧', + '𐲨' => '𐳨', + '𐲩' => '𐳩', + '𐲪' => '𐳪', + '𐲫' => '𐳫', + '𐲬' => '𐳬', + '𐲭' => '𐳭', + '𐲮' => '𐳮', + '𐲯' => '𐳯', + '𐲰' => '𐳰', + '𐲱' => '𐳱', + '𐲲' => '𐳲', '𑢠' => '𑣀', '𑢡' => '𑣁', '𑢢' => '𑣂', @@ -1093,4 +1328,70 @@ '𑢽' => '𑣝', '𑢾' => '𑣞', '𑢿' => '𑣟', + '𖹀' => '𖹠', + '𖹁' => '𖹡', + '𖹂' => '𖹢', + '𖹃' => '𖹣', + '𖹄' => '𖹤', + '𖹅' => '𖹥', + '𖹆' => '𖹦', + '𖹇' => '𖹧', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + '𖹍' => '𖹭', + '𖹎' => '𖹮', + '𖹏' => '𖹯', + '𖹐' => '𖹰', + '𖹑' => '𖹱', + '𖹒' => '𖹲', + '𖹓' => '𖹳', + '𖹔' => '𖹴', + '𖹕' => '𖹵', + '𖹖' => '𖹶', + '𖹗' => '𖹷', + '𖹘' => '𖹸', + '𖹙' => '𖹹', + '𖹚' => '𖹺', + '𖹛' => '𖹻', + '𖹜' => '𖹼', + '𖹝' => '𖹽', + '𖹞' => '𖹾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + '𞤁' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + '𞤍' => '𞤯', + '𞤎' => '𞤰', + '𞤏' => '𞤱', + '𞤐' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + '𞤝' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => '𞥁', + '𞤠' => '𞥂', + '𞤡' => '𞥃', ); diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php index b8103b2e808..56b9cb85207 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php @@ -1,6 +1,6 @@ 'A', 'b' => 'B', 'c' => 'C', @@ -225,6 +225,7 @@ 'ɦ' => 'Ɦ', 'ɨ' => 'Ɨ', 'ɩ' => 'Ɩ', + 'ɪ' => 'Ɪ', 'ɫ' => 'Ɫ', 'ɬ' => 'Ɬ', 'ɯ' => 'Ɯ', @@ -233,6 +234,7 @@ 'ɵ' => 'Ɵ', 'ɽ' => 'Ɽ', 'ʀ' => 'Ʀ', + 'ʂ' => 'Ʂ', 'ʃ' => 'Ʃ', 'ʇ' => 'Ʇ', 'ʈ' => 'Ʈ', @@ -241,6 +243,7 @@ 'ʋ' => 'Ʋ', 'ʌ' => 'Ʌ', 'ʒ' => 'Ʒ', + 'ʝ' => 'Ʝ', 'ʞ' => 'Ʞ', 'ͅ' => 'Ι', 'ͱ' => 'Ͱ', @@ -493,8 +496,70 @@ 'ք' => 'Ք', 'օ' => 'Օ', 'ֆ' => 'Ֆ', + 'ა' => 'Ა', + 'ბ' => 'Ბ', + 'გ' => 'Გ', + 'დ' => 'Დ', + 'ე' => 'Ე', + 'ვ' => 'Ვ', + 'ზ' => 'Ზ', + 'თ' => 'Თ', + 'ი' => 'Ი', + 'კ' => 'Კ', + 'ლ' => 'Ლ', + 'მ' => 'Მ', + 'ნ' => 'Ნ', + 'ო' => 'Ო', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'Რ', + 'ს' => 'Ს', + 'ტ' => 'Ტ', + 'უ' => 'Უ', + 'ფ' => 'Ფ', + 'ქ' => 'Ქ', + 'ღ' => 'Ღ', + 'ყ' => 'Ყ', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'Ჭ', + 'ხ' => 'Ხ', + 'ჯ' => 'Ჯ', + 'ჰ' => 'Ჰ', + 'ჱ' => 'Ჱ', + 'ჲ' => 'Ჲ', + 'ჳ' => 'Ჳ', + 'ჴ' => 'Ჴ', + 'ჵ' => 'Ჵ', + 'ჶ' => 'Ჶ', + 'ჷ' => 'Ჷ', + 'ჸ' => 'Ჸ', + 'ჹ' => 'Ჹ', + 'ჺ' => 'Ჺ', + 'ჽ' => 'Ჽ', + 'ჾ' => 'Ჾ', + 'ჿ' => 'Ჿ', + 'ᏸ' => 'Ᏸ', + 'ᏹ' => 'Ᏹ', + 'ᏺ' => 'Ᏺ', + 'ᏻ' => 'Ᏻ', + 'ᏼ' => 'Ᏼ', + 'ᏽ' => 'Ᏽ', + 'ᲀ' => 'В', + 'ᲁ' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'ᲅ' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ѣ', + 'ᲈ' => 'Ꙋ', 'ᵹ' => 'Ᵹ', 'ᵽ' => 'Ᵽ', + 'ᶎ' => 'Ᶎ', 'ḁ' => 'Ḁ', 'ḃ' => 'Ḃ', 'ḅ' => 'Ḅ', @@ -681,41 +746,41 @@ 'ύ' => 'Ύ', 'ὼ' => 'Ὼ', 'ώ' => 'Ώ', - 'ᾀ' => 'ᾈ', - 'ᾁ' => 'ᾉ', - 'ᾂ' => 'ᾊ', - 'ᾃ' => 'ᾋ', - 'ᾄ' => 'ᾌ', - 'ᾅ' => 'ᾍ', - 'ᾆ' => 'ᾎ', - 'ᾇ' => 'ᾏ', - 'ᾐ' => 'ᾘ', - 'ᾑ' => 'ᾙ', - 'ᾒ' => 'ᾚ', - 'ᾓ' => 'ᾛ', - 'ᾔ' => 'ᾜ', - 'ᾕ' => 'ᾝ', - 'ᾖ' => 'ᾞ', - 'ᾗ' => 'ᾟ', - 'ᾠ' => 'ᾨ', - 'ᾡ' => 'ᾩ', - 'ᾢ' => 'ᾪ', - 'ᾣ' => 'ᾫ', - 'ᾤ' => 'ᾬ', - 'ᾥ' => 'ᾭ', - 'ᾦ' => 'ᾮ', - 'ᾧ' => 'ᾯ', + 'ᾀ' => 'ἈΙ', + 'ᾁ' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'ᾅ' => 'ἍΙ', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'ἏΙ', + 'ᾐ' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'ᾒ' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'ᾔ' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'ᾖ' => 'ἮΙ', + 'ᾗ' => 'ἯΙ', + 'ᾠ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'ᾢ' => 'ὪΙ', + 'ᾣ' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'ᾥ' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'ᾧ' => 'ὯΙ', 'ᾰ' => 'Ᾰ', 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ᾼ', + 'ᾳ' => 'ΑΙ', 'ι' => 'Ι', - 'ῃ' => 'ῌ', + 'ῃ' => 'ΗΙ', 'ῐ' => 'Ῐ', 'ῑ' => 'Ῑ', 'ῠ' => 'Ῠ', 'ῡ' => 'Ῡ', 'ῥ' => 'Ῥ', - 'ῳ' => 'ῼ', + 'ῳ' => 'ΩΙ', 'ⅎ' => 'Ⅎ', 'ⅰ' => 'Ⅰ', 'ⅱ' => 'Ⅱ', @@ -993,6 +1058,7 @@ 'ꞌ' => 'Ꞌ', 'ꞑ' => 'Ꞑ', 'ꞓ' => 'Ꞓ', + 'ꞔ' => 'Ꞔ', 'ꞗ' => 'Ꞗ', 'ꞙ' => 'Ꞙ', 'ꞛ' => 'Ꞛ', @@ -1003,6 +1069,97 @@ 'ꞥ' => 'Ꞥ', 'ꞧ' => 'Ꞧ', 'ꞩ' => 'Ꞩ', + 'ꞵ' => 'Ꞵ', + 'ꞷ' => 'Ꞷ', + 'ꞹ' => 'Ꞹ', + 'ꞻ' => 'Ꞻ', + 'ꞽ' => 'Ꞽ', + 'ꞿ' => 'Ꞿ', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ꭓ' => 'Ꭓ', + 'ꭰ' => 'Ꭰ', + 'ꭱ' => 'Ꭱ', + 'ꭲ' => 'Ꭲ', + 'ꭳ' => 'Ꭳ', + 'ꭴ' => 'Ꭴ', + 'ꭵ' => 'Ꭵ', + 'ꭶ' => 'Ꭶ', + 'ꭷ' => 'Ꭷ', + 'ꭸ' => 'Ꭸ', + 'ꭹ' => 'Ꭹ', + 'ꭺ' => 'Ꭺ', + 'ꭻ' => 'Ꭻ', + 'ꭼ' => 'Ꭼ', + 'ꭽ' => 'Ꭽ', + 'ꭾ' => 'Ꭾ', + 'ꭿ' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ꮁ' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ꮅ' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ꮍ' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ꮏ' => 'Ꮏ', + 'ꮐ' => 'Ꮐ', + 'ꮑ' => 'Ꮑ', + 'ꮒ' => 'Ꮒ', + 'ꮓ' => 'Ꮓ', + 'ꮔ' => 'Ꮔ', + 'ꮕ' => 'Ꮕ', + 'ꮖ' => 'Ꮖ', + 'ꮗ' => 'Ꮗ', + 'ꮘ' => 'Ꮘ', + 'ꮙ' => 'Ꮙ', + 'ꮚ' => 'Ꮚ', + 'ꮛ' => 'Ꮛ', + 'ꮜ' => 'Ꮜ', + 'ꮝ' => 'Ꮝ', + 'ꮞ' => 'Ꮞ', + 'ꮟ' => 'Ꮟ', + 'ꮠ' => 'Ꮠ', + 'ꮡ' => 'Ꮡ', + 'ꮢ' => 'Ꮢ', + 'ꮣ' => 'Ꮣ', + 'ꮤ' => 'Ꮤ', + 'ꮥ' => 'Ꮥ', + 'ꮦ' => 'Ꮦ', + 'ꮧ' => 'Ꮧ', + 'ꮨ' => 'Ꮨ', + 'ꮩ' => 'Ꮩ', + 'ꮪ' => 'Ꮪ', + 'ꮫ' => 'Ꮫ', + 'ꮬ' => 'Ꮬ', + 'ꮭ' => 'Ꮭ', + 'ꮮ' => 'Ꮮ', + 'ꮯ' => 'Ꮯ', + 'ꮰ' => 'Ꮰ', + 'ꮱ' => 'Ꮱ', + 'ꮲ' => 'Ꮲ', + 'ꮳ' => 'Ꮳ', + 'ꮴ' => 'Ꮴ', + 'ꮵ' => 'Ꮵ', + 'ꮶ' => 'Ꮶ', + 'ꮷ' => 'Ꮷ', + 'ꮸ' => 'Ꮸ', + 'ꮹ' => 'Ꮹ', + 'ꮺ' => 'Ꮺ', + 'ꮻ' => 'Ꮻ', + 'ꮼ' => 'Ꮼ', + 'ꮽ' => 'Ꮽ', + 'ꮾ' => 'Ꮾ', + 'ꮿ' => 'Ꮿ', 'a' => 'A', 'b' => 'B', 'c' => 'C', @@ -1069,6 +1226,93 @@ '𐑍' => '𐐥', '𐑎' => '𐐦', '𐑏' => '𐐧', + '𐓘' => '𐒰', + '𐓙' => '𐒱', + '𐓚' => '𐒲', + '𐓛' => '𐒳', + '𐓜' => '𐒴', + '𐓝' => '𐒵', + '𐓞' => '𐒶', + '𐓟' => '𐒷', + '𐓠' => '𐒸', + '𐓡' => '𐒹', + '𐓢' => '𐒺', + '𐓣' => '𐒻', + '𐓤' => '𐒼', + '𐓥' => '𐒽', + '𐓦' => '𐒾', + '𐓧' => '𐒿', + '𐓨' => '𐓀', + '𐓩' => '𐓁', + '𐓪' => '𐓂', + '𐓫' => '𐓃', + '𐓬' => '𐓄', + '𐓭' => '𐓅', + '𐓮' => '𐓆', + '𐓯' => '𐓇', + '𐓰' => '𐓈', + '𐓱' => '𐓉', + '𐓲' => '𐓊', + '𐓳' => '𐓋', + '𐓴' => '𐓌', + '𐓵' => '𐓍', + '𐓶' => '𐓎', + '𐓷' => '𐓏', + '𐓸' => '𐓐', + '𐓹' => '𐓑', + '𐓺' => '𐓒', + '𐓻' => '𐓓', + '𐳀' => '𐲀', + '𐳁' => '𐲁', + '𐳂' => '𐲂', + '𐳃' => '𐲃', + '𐳄' => '𐲄', + '𐳅' => '𐲅', + '𐳆' => '𐲆', + '𐳇' => '𐲇', + '𐳈' => '𐲈', + '𐳉' => '𐲉', + '𐳊' => '𐲊', + '𐳋' => '𐲋', + '𐳌' => '𐲌', + '𐳍' => '𐲍', + '𐳎' => '𐲎', + '𐳏' => '𐲏', + '𐳐' => '𐲐', + '𐳑' => '𐲑', + '𐳒' => '𐲒', + '𐳓' => '𐲓', + '𐳔' => '𐲔', + '𐳕' => '𐲕', + '𐳖' => '𐲖', + '𐳗' => '𐲗', + '𐳘' => '𐲘', + '𐳙' => '𐲙', + '𐳚' => '𐲚', + '𐳛' => '𐲛', + '𐳜' => '𐲜', + '𐳝' => '𐲝', + '𐳞' => '𐲞', + '𐳟' => '𐲟', + '𐳠' => '𐲠', + '𐳡' => '𐲡', + '𐳢' => '𐲢', + '𐳣' => '𐲣', + '𐳤' => '𐲤', + '𐳥' => '𐲥', + '𐳦' => '𐲦', + '𐳧' => '𐲧', + '𐳨' => '𐲨', + '𐳩' => '𐲩', + '𐳪' => '𐲪', + '𐳫' => '𐲫', + '𐳬' => '𐲬', + '𐳭' => '𐲭', + '𐳮' => '𐲮', + '𐳯' => '𐲯', + '𐳰' => '𐲰', + '𐳱' => '𐲱', + '𐳲' => '𐲲', '𑣀' => '𑢠', '𑣁' => '𑢡', '𑣂' => '𑢢', @@ -1101,4 +1345,145 @@ '𑣝' => '𑢽', '𑣞' => '𑢾', '𑣟' => '𑢿', + '𖹠' => '𖹀', + '𖹡' => '𖹁', + '𖹢' => '𖹂', + '𖹣' => '𖹃', + '𖹤' => '𖹄', + '𖹥' => '𖹅', + '𖹦' => '𖹆', + '𖹧' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + '𖹭' => '𖹍', + '𖹮' => '𖹎', + '𖹯' => '𖹏', + '𖹰' => '𖹐', + '𖹱' => '𖹑', + '𖹲' => '𖹒', + '𖹳' => '𖹓', + '𖹴' => '𖹔', + '𖹵' => '𖹕', + '𖹶' => '𖹖', + '𖹷' => '𖹗', + '𖹸' => '𖹘', + '𖹹' => '𖹙', + '𖹺' => '𖹚', + '𖹻' => '𖹛', + '𖹼' => '𖹜', + '𖹽' => '𖹝', + '𖹾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => '𞤁', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => '𞤍', + '𞤰' => '𞤎', + '𞤱' => '𞤏', + '𞤲' => '𞤐', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => '𞤝', + '𞥀' => '𞤞', + '𞥁' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'fi' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'և' => 'ԵՒ', + 'ﬓ' => 'ՄՆ', + 'ﬔ' => 'ՄԵ', + 'ﬕ' => 'ՄԻ', + 'ﬖ' => 'ՎՆ', + 'ﬗ' => 'ՄԽ', + 'ʼn' => 'ʼN', + 'ΐ' => 'Ϊ́', + 'ΰ' => 'Ϋ́', + 'ǰ' => 'J̌', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'W̊', + 'ẙ' => 'Y̊', + 'ẚ' => 'Aʾ', + 'ὐ' => 'Υ̓', + 'ὒ' => 'Υ̓̀', + 'ὔ' => 'Υ̓́', + 'ὖ' => 'Υ̓͂', + 'ᾶ' => 'Α͂', + 'ῆ' => 'Η͂', + 'ῒ' => 'Ϊ̀', + 'ΐ' => 'Ϊ́', + 'ῖ' => 'Ι͂', + 'ῗ' => 'Ϊ͂', + 'ῢ' => 'Ϋ̀', + 'ΰ' => 'Ϋ́', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'ῧ' => 'Ϋ͂', + 'ῶ' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'ᾍ' => 'ἍΙ', + 'ᾎ' => 'ἎΙ', + 'ᾏ' => 'ἏΙ', + 'ᾘ' => 'ἨΙ', + 'ᾙ' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'ᾛ' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'ᾝ' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'ᾭ' => 'ὭΙ', + 'ᾮ' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'ᾼ' => 'ΑΙ', + 'ῌ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'ᾲ' => 'ᾺΙ', + 'ᾴ' => 'ΆΙ', + 'ῂ' => 'ῊΙ', + 'ῄ' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'ῴ' => 'ΏΙ', + 'ᾷ' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'ῷ' => 'Ω͂Ι', ); diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap.php b/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap.php index 2fdcc5a6f69..1fedd1f7c84 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -11,48 +11,137 @@ use Symfony\Polyfill\Mbstring as p; -if (!function_exists('mb_strlen')) { - define('MB_CASE_UPPER', 0); - define('MB_CASE_LOWER', 1); - define('MB_CASE_TITLE', 2); +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } - function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } - function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } } if (!function_exists('mb_chr')) { - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); } diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap80.php b/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 00000000000..82f5ac4d0f1 --- /dev/null +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/system/backend/php/vendor/symfony/polyfill-mbstring/composer.json b/system/backend/php/vendor/symfony/polyfill-mbstring/composer.json index 0bce08782ea..44895536bad 100644 --- a/system/backend/php/vendor/symfony/polyfill-mbstring/composer.json +++ b/system/backend/php/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,10 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, @@ -28,7 +31,11 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } } } diff --git a/system/backend/php/vendor/twig/twig/.gitattributes b/system/backend/php/vendor/twig/twig/.gitattributes new file mode 100644 index 00000000000..06bc3671340 --- /dev/null +++ b/system/backend/php/vendor/twig/twig/.gitattributes @@ -0,0 +1,4 @@ +/doc/ export-ignore +/extra/ export-ignore +/tests/ export-ignore +/phpunit.xml.dist export-ignore diff --git a/system/backend/php/vendor/twig/twig/.github/dependabot.yml b/system/backend/php/vendor/twig/twig/.github/dependabot.yml new file mode 100644 index 00000000000..5ace4600a1f --- /dev/null +++ b/system/backend/php/vendor/twig/twig/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/system/backend/php/vendor/twig/twig/.github/workflows/ci.yml b/system/backend/php/vendor/twig/twig/.github/workflows/ci.yml new file mode 100644 index 00000000000..3f49259ca9a --- /dev/null +++ b/system/backend/php/vendor/twig/twig/.github/workflows/ci.yml @@ -0,0 +1,148 @@ +name: "CI" + +on: + pull_request: + push: + branches: + - '2.x' + +env: + SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 + +permissions: + contents: read + +jobs: + tests: + name: "PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-latest' + + continue-on-error: ${{ matrix.experimental }} + + strategy: + matrix: + php-version: + - '7.1.3' + - '7.2.5' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + - '8.2' + experimental: [false] + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + + - name: "Add PHPUnit matcher" + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - run: composer install + + - name: "Install PHPUnit" + run: vendor/bin/simple-phpunit install + + - name: "PHPUnit version" + run: vendor/bin/simple-phpunit --version + + - name: "Run tests" + run: vendor/bin/simple-phpunit + + extension-tests: + needs: + - 'tests' + + name: "${{ matrix.extension }} with PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-latest' + + continue-on-error: true + + strategy: + matrix: + php-version: + - '7.2.5' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + - '8.2' + extension: + - 'extra/cssinliner-extra' + - 'extra/html-extra' + - 'extra/inky-extra' + - 'extra/intl-extra' + - 'extra/markdown-extra' + - 'extra/string-extra' + - 'extra/twig-extra-bundle' + experimental: [false] + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + + - name: "Add PHPUnit matcher" + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - run: composer install + + - name: "Install PHPUnit" + run: vendor/bin/simple-phpunit install + + - name: "PHPUnit version" + run: vendor/bin/simple-phpunit --version + + - name: "Composer install" + working-directory: ${{ matrix.extension}} + run: composer install + + - name: "Run tests" + working-directory: ${{ matrix.extension}} + run: ../../vendor/bin/simple-phpunit + + integration-tests: + needs: + - 'tests' + + name: "Integration tests with PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-20.04' + + continue-on-error: true + + strategy: + matrix: + php-version: + - '7.3' + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + extensions: "gd, pdo_sqlite" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + tools: composer:v2 + + - run: bash ./tests/drupal_test.sh + shell: "bash" diff --git a/system/backend/php/vendor/twig/twig/.github/workflows/documentation.yml b/system/backend/php/vendor/twig/twig/.github/workflows/documentation.yml new file mode 100644 index 00000000000..f2f46fc6d6e --- /dev/null +++ b/system/backend/php/vendor/twig/twig/.github/workflows/documentation.yml @@ -0,0 +1,64 @@ +name: "Documentation" + +on: + pull_request: + push: + branches: + - '2.x' + - '3.x' + +permissions: + contents: read + +jobs: + build: + name: "Build" + + runs-on: ubuntu-latest + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + + - name: "Set-up PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: none + tools: "composer:v2" + + - name: Get composer cache directory + id: composercache + working-directory: doc/_build + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: "Install dependencies" + working-directory: doc/_build + run: composer install --prefer-dist --no-progress + + - name: "Build the docs" + working-directory: doc/_build + run: php build.php --disable-cache + + doctor-rst: + name: "DOCtor-RST" + + runs-on: ubuntu-latest + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + + - name: "Run DOCtor-RST" + uses: docker://oskarstark/doctor-rst + with: + args: --short + env: + DOCS_DIR: 'doc/' diff --git a/system/backend/php/vendor/twig/twig/.gitignore b/system/backend/php/vendor/twig/twig/.gitignore index bc959c53318..b197246ba80 100644 --- a/system/backend/php/vendor/twig/twig/.gitignore +++ b/system/backend/php/vendor/twig/twig/.gitignore @@ -1,3 +1,6 @@ +/doc/_build/vendor +/doc/_build/output /composer.lock /phpunit.xml /vendor +.phpunit.result.cache diff --git a/system/backend/php/vendor/twig/twig/.php_cs.dist b/system/backend/php/vendor/twig/twig/.php-cs-fixer.dist.php similarity index 75% rename from system/backend/php/vendor/twig/twig/.php_cs.dist rename to system/backend/php/vendor/twig/twig/.php-cs-fixer.dist.php index 1b31c0a3dc7..b07ac7fcabd 100644 --- a/system/backend/php/vendor/twig/twig/.php_cs.dist +++ b/system/backend/php/vendor/twig/twig/.php-cs-fixer.dist.php @@ -1,9 +1,11 @@ setRules([ '@Symfony' => true, '@Symfony:risky' => true, + '@PHPUnit75Migration:risky' => true, + 'php_unit_dedicate_assert' => ['target' => '5.6'], 'array_syntax' => ['syntax' => 'short'], 'php_unit_fqcn_annotation' => true, 'no_unreachable_default_argument_value' => false, @@ -14,5 +16,5 @@ 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], ]) ->setRiskyAllowed(true) - ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) + ->setFinder((new PhpCsFixer\Finder())->in(__DIR__)) ; diff --git a/system/backend/php/vendor/twig/twig/.travis.yml b/system/backend/php/vendor/twig/twig/.travis.yml deleted file mode 100644 index c2395895b7d..00000000000 --- a/system/backend/php/vendor/twig/twig/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - vendor - - $HOME/.composer/cache/files - -before_install: - - phpenv config-rm xdebug.ini || return 0 - -install: - - travis_retry composer install - -script: ./vendor/bin/simple-phpunit - -jobs: - fast_finish: true - include: - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4snapshot - - stage: integration tests - php: 7.3 - script: ./drupal_test.sh diff --git a/system/backend/php/vendor/twig/twig/CHANGELOG b/system/backend/php/vendor/twig/twig/CHANGELOG index 0468803badd..a48393ad05a 100644 --- a/system/backend/php/vendor/twig/twig/CHANGELOG +++ b/system/backend/php/vendor/twig/twig/CHANGELOG @@ -1,14 +1,179 @@ -* 2.11.2 (2019-06-05) +# 2.15.5 (2023-05-03) + + * Make the Lexer initialize itself lazily + +# 2.15.4 (2022-12-27) + + * Fix optimizing closures callbacks + * Add a better exception when getting an undefined constant via `constant` + * Fix `if` nodes when outside of a block and with an empty body + +# 2.15.3 (2022-09-28) + + * Fix a security issue on filesystem loader (possibility to load a template outside a configured directory) + +# 2.15.2 (2022-08-12) + + * Allow inherited magic method to still run with calling class + * Fix CallExpression::reflectCallable() throwing TypeError + * Fix typo in naming (currency_code) + +# 2.15.1 (2022-05-17) + +* Fix optimizing non-public named closures + +# 2.15.0 (2022-05-15) + + * Add support for named closures + +# 2.14.13 (2022-04-06) + + * Enable bytecode invalidation when auto_reload is enabled + +# 2.14.12 (2022-03-25) + + * Fix custom escapers when using multiple Twig environments + * Do not reuse internally generated variable names during parsing + +# 2.14.11 (2022-02-04) + + * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter + * Fix deprecation notice on `round` + * Fix call to deprecated `convertToHtml` method + +# 2.14.10 (2022-01-03) + + * Allow more null arguments when Twig expects a string (for better 8.1 support) + +# 2.14.9 (2022-01-03) + +* Allow null when Twig expects a string (for better 8.1 support) +* Add support for PHP 7.1 back +* Make some performance optimizations +* Allow Symfony translation contract v3+ + +# 2.14.8 (2021-11-25) + + * Bump minimum supported Symfony component versions + * Fix a deprecated message + +# 2.14.7 (2021-09-17) + + * Allow Symfony 6 + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + +# 2.14.6 (2021-05-16) + + * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" + +# 2.14.5 (2021-05-12) + + * Fix PHP 8.1 compatibility + * Throw a proper exception when a template name is an absolute path (as it has never been supported) + +# 2.14.4 (2021-03-10) + + * Add the slug filter + +# 2.14.3 (2021-01-05) + + * Fix extra bundle compat with older versions of Symfony + +# 2.14.2 (2021-01-05) + + * Fix "odd" not working for negative numbers + +# 2.14.1 (2020-10-27) + +* Fix "include(template_from_string())" + +# 2.14.0 (2020-10-21) + + * Fix sandbox support when using "include(template_from_string())" + * Make round brackets optional for one argument tests like "same as" or "divisible by" + * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } + * Drop PHP 7.1 support + +# 2.13.1 (2020-08-05) + + * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag + * Fix a regression when not using a space before an operator + * Restrict callables to closures in filters + * Allow trailing commas in argument lists (in calls as well as definitions) + +# 2.13.0 (2020-07-05) + + * Fix options not taken into account when using "Michelf\MarkdownExtra" + * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument + * Drop support for PHP 7.0 + * Throw exception in case non-Traversable data is passed to "filter" + * Fix context optimization on PHP 7.4 + * Fix PHP 8 compatibility + * Fix ambiguous syntax parsing + +# 2.12.5 (2020-02-11) + + * Add a check to ensure that iconv() is defined + +# 2.12.4 (2020-02-11) + + * Avoid exceptions when an intl resource is not found + * Fix implementation of case-insensitivity for method names + +# 2.12.3 (2019-12-28) + + * fixed Symfony 5.0 support for the HTML extra extension + * fixed number formatter in Intl extra extension when using a formatter prototype + +# 2.12.2 (2019-11-11) + + * added supported for exponential numbers + +# 2.12.1 (2019-10-17) + + * added the String extension in the "extra" repositories: "u" filter + +# 2.12.0 (2019-10-05) + + * added the spaceship operator ("<=>"), useful when using an arrow function in the "sort" filter + * added support for an "arrow" function on the "sort" filter + * added the CssInliner extension in the "extra" repositories: "inline_css" + filter + * added the Inky extension in the "extra" repositories: "inky_to_html" filter + * added Intl extension in the "extra" repositories: "country_name", + "currency_name", "currency_symbol", "language_name", "locale_name", + "timezone_name", "format_currency", "format_number", + "format_*_number", "format_datetime", "format_date", and "format_time" + filters, and the "country_timezones" function + * added the Markdown extension in the "extra" repositories: "markdown_to_html", + and "html_to_markdown" filters + * added the HtmlExtension extension in the "extra" repositories: "date_uri" + filter, and "html_classes" function + * optimized "block('foo') ?? 'bar'" + * fixed the empty test on Traversable instances + * fixed array_key_exists() on objects + * fixed cache when opcache is installed but disabled + * fixed using macros in arrow functions + * fixed split filter on edge case + +# 2.11.3 (2019-06-18) + + * display partial output (PHP buffer) when an error occurs in debug mode + * fixed the filter filter (allow the result to be used several times) + * fixed macro auto-import when a template contains only macros + +# 2.11.2 (2019-06-05) * fixed macro auto-import -* 2.11.1 (2019-06-04) +# 2.11.1 (2019-06-04) * added support for "Twig\Markup" instances in the "in" test (again) * allowed string operators as variables names in assignments * fixed support for macros defined in parent templates -* 2.11.0 (2019-05-31) +# 2.11.0 (2019-05-31) * added the possibility to register classes/interfaces as being safe for the escaper ("EscaperExtension::addSafeClass()") * deprecated CoreExtension::setEscaper() and CoreExtension::getEscapers() in favor of the same methods on EscaperExtension @@ -22,14 +187,14 @@ * fixed a PHP fatal error when calling a macro imported in the template in another macro * fixed wrong error message on "import" and "from" -* 2.10.0 (2019-05-14) +# 2.10.0 (2019-05-14) * deprecated "if" conditions on "for" tags * added "filter", "map", and "reduce" filters (and support for arrow functions) * fixed partial output leak when a PHP fatal error occurs * optimized context access on PHP 7.4 -* 2.9.0 (2019-04-28) +# 2.9.0 (2019-04-28) * deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode() * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) @@ -41,13 +206,13 @@ * fixed Lexer when using custom options containing the # char * added template line number to twig_get_attribute() -* 2.8.1 (2019-04-16) +# 2.8.1 (2019-04-16) * fixed EscaperNodeVisitor * deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes * deprecated Node::setTemplateName() in favor of Node::setSourceContext() -* 2.8.0 (2019-04-16) +# 2.8.0 (2019-04-16) * added Traversable support for the length filter * fixed some wrong location in error messages @@ -59,12 +224,12 @@ * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) * added the "column" filter -* 2.7.4 (2019-03-23) +# 2.7.4 (2019-03-23) * fixed variadic support * fixed CheckToStringNode implementation (broken when a function/filter is variadic) -* 2.7.3 (2019-03-21) +# 2.7.3 (2019-03-21) * fixed the spaceless filter so that it behaves like the spaceless tag * fixed BC break on Environment::resolveTemplate() @@ -72,15 +237,15 @@ * allowed Traversable objects to be used in the "with" tag * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags -* 2.7.2 (2019-03-12) +# 2.7.2 (2019-03-12) * added TemplateWrapper::getTemplateName() -* 2.7.1 (2019-03-12) +# 2.7.1 (2019-03-12) * fixed class aliases -* 2.7.0 (2019-03-12) +# 2.7.0 (2019-03-12) * fixed sandbox security issue (under some circumstances, calling the __toString() method on an object was possible even if not allowed by the @@ -107,11 +272,11 @@ * changed internal code to use the namespaced classes as much as possible * deprecated Twig_Parser::isReservedMacroName() -* 2.6.2 (2019-01-14) +# 2.6.2 (2019-01-14) * fixed regression (key exists check for non ArrayObject objects) -* 2.6.1 (2019-01-14) +# 2.6.1 (2019-01-14) * fixed ArrayObject access with a null value * fixed embedded templates starting with a BOM @@ -122,7 +287,7 @@ * fixed float representation in compiled templates * added a second argument to the join filter (last separator configuration) -* 2.6.0 (2018-12-16) +# 2.6.0 (2018-12-16) * made sure twig_include returns a string * fixed multi-byte UFT-8 in escape('html_attr') @@ -131,7 +296,7 @@ * fixed GlobalsInterface extended class * fixed filesystem loader throwing an exception instead of returning false -* 2.5.0 (2018-07-13) +# 2.5.0 (2018-07-13) * deprecated using the spaceless tag at the root level of a child template (noop anyway) * deprecated the possibility to define a block in a non-capturing block in a child template @@ -141,11 +306,11 @@ * ensured that syntax errors are triggered with the right line * "js" filter now produces valid JSON -* 2.4.8 (2018-04-02) +# 2.4.8 (2018-04-02) * fixed a regression when using the "default" filter or the "defined" test on non-existing arrays -* 2.4.7 (2018-03-20) +# 2.4.7 (2018-03-20) * optimized runtime performance * optimized parser performance by inlining the constant values @@ -154,11 +319,11 @@ * added missing else clause to avoid infinite loops * fixed .. (range operator) in sandbox policy -* 2.4.6 (2018-03-03) +# 2.4.6 (2018-03-03) * fixed a regression in the way the profiler is registered in templates -* 2.4.5 (2018-03-02) +# 2.4.5 (2018-03-02) * optimized the performance of calling an extension method at runtime * optimized the performance of the dot operator for array and method calls @@ -168,7 +333,7 @@ * fixed length filter when passing an instance of IteratorAggregate * fixed Environment::resolveTemplate to accept instances of TemplateWrapper -* 2.4.4 (2017-09-27) +# 2.4.4 (2017-09-27) * added Twig_Profiler_Profile::reset() * fixed use TokenParser to return an empty Node @@ -178,19 +343,19 @@ * fixed deprecation when using Twig_Profiler_Dumper_Html * removed @final from Twig_Profiler_Dumper_Text -* 2.4.3 (2017-06-07) +# 2.4.3 (2017-06-07) * fixed namespaces introduction -* 2.4.2 (2017-06-05) +# 2.4.2 (2017-06-05) * fixed namespaces introduction -* 2.4.1 (2017-06-05) +# 2.4.1 (2017-06-05) * fixed namespaces introduction -* 2.4.0 (2017-06-05) +# 2.4.0 (2017-06-05) * added support for PHPUnit 6 when testing extensions * fixed PHP 7.2 compatibility @@ -200,15 +365,15 @@ * added namespaced aliases for all (non-deprecated) classes and interfaces * marked Twig_Filter, Twig_Function, Twig_Test, Twig_Node_Module and Twig_Profiler_Profile as final via the @final annotation -* 2.3.2 (2017-04-20) +# 2.3.2 (2017-04-20) * fixed edge case in the method cache for Twig attributes -* 2.3.1 (2017-04-18) +# 2.3.1 (2017-04-18) * fixed the empty() test -* 2.3.0 (2017-03-22) +# 2.3.0 (2017-03-22) * fixed a race condition handling when writing cache files * "length" filter now returns string length when applied to an object that does @@ -218,17 +383,17 @@ * fixed JS escaping for unicode characters with higher code points * added error message when calling `parent()` in a block that doesn't exist in the parent template -* 2.2.0 (2017-02-26) +# 2.2.0 (2017-02-26) * added a PSR-11 compatible runtime loader * added `side` argument to `trim` to allow left or right trimming only. -* 2.1.0 (2017-01-11) +# 2.1.0 (2017-01-11) * fixed twig_get_attribute() * added Twig_NodeCaptureInterface for nodes that capture all output -* 2.0.0 (2017-01-05) +# 2.0.0 (2017-01-05) * removed the C extension * moved Twig_Environment::getAttribute() to twig_get_attribute() @@ -248,1125 +413,3 @@ * removed the ability to register a global variable after the runtime or the extensions have been initialized * improved the performance of the filesystem loader * removed features that were deprecated in 1.x - -* 1.42.2 (2019-XX-XX) - - * n/a - -* 1.42.1 (2019-06-04) - - * added support for "Twig\Markup" instances in the "in" test (again) - * allowed string operators as variables names in assignments - -* 1.42.0 (2019-05-31) - - * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) - * fixed a PHP fatal error when calling a macro imported in a block in a nested block - * fixed a PHP fatal error when calling a macro imported in the template in another macro - * fixed wrong error message on "import" and "from" - -* 1.41.0 (2019-05-14) - - * fixed support for PHP 7.4 - * added "filter", "map", and "reduce" filters (and support for arrow functions) - * fixed partial output leak when a PHP fatal error occurs - * optimized context access on PHP 7.4 - -* 1.40.1 (2019-04-29) - -* fixed regression in NodeTraverser - -* 1.40.0 (2019-04-28) - - * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) - * added the "apply" tag as a replacement for the "filter" tag - * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) - * added support for "Twig\Markup" instances in the "in" test - * fixed Lexer when using custom options containing the # char - * fixed "import" when macros are stored in a template string - -* 1.39.1 (2019-04-16) - - * fixed EscaperNodeVisitor - -* 1.39.0 (2019-04-16) - - * added Traversable support for the length filter - * fixed some wrong location in error messages - * made exception creation faster - * made escaping on ternary expressions (?: and ??) more fine-grained - * added the possibility to give a nice name to string templates (template_from_string function) - * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) - * fixed "include" with "ignore missing" when an error loading occurs in the included template - * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) - -* 1.38.4 (2019-03-23) - - * fixed CheckToStringNode implementation (broken when a function/filter is variadic) - -* 1.38.3 (2019-03-21) - - * fixed the spaceless filter so that it behaves like the spaceless tag - * fixed BC break on Environment::resolveTemplate() - * fixed the bundled Autoloader to also load namespaced classes - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags - -* 1.38.2 (2019-03-12) - - * added TemplateWrapper::getTemplateName() - -* 1.38.1 (2019-03-12) - - * fixed class aliases - -* 1.38.0 (2019-03-12) - - * fixed sandbox security issue (under some circumstances, calling the - __toString() method on an object was possible even if not allowed by the - security policy) - * fixed batch filter clobbers array keys when fill parameter is used - * added preserveKeys support for the batch filter - * fixed "embed" support when used from "template_from_string" - * added the possibility to pass a TemplateWrapper to Twig\Environment::load() - * improved the performance of the sandbox - * added a spaceless filter - * added max value to the "random" function - * made namespace classes the default classes (PSR-0 ones are aliases now) - * removed duplicated directory separator in FilesystemLoader - * added Twig\Loader\ChainLoader::getLoaders() - * changed internal code to use the namespaced classes as much as possible - -* 1.37.1 (2019-01-14) - - * fixed regression (key exists check for non ArrayObject objects) - * fixed logic in TemplateWrapper - -* 1.37.0 (2019-01-14) - - * fixed ArrayObject access with a null value - * fixed embedded templates starting with a BOM - * fixed using a Twig_TemplateWrapper instance as an argument to extends - * switched generated code to use the PHP short array notation - * dropped PHP 5.3 support - * fixed float representation in compiled templates - * added a second argument to the join filter (last separator configuration) - -* 1.36.0 (2018-12-16) - - * made sure twig_include returns a string - * fixed multi-byte UFT-8 in escape('html_attr') - * added the "deprecated" tag - * added support for dynamically named tests - * fixed GlobalsInterface extended class - * fixed filesystem loader throwing an exception instead of returning false - -* 1.35.4 (2018-07-13) - - * ensured that syntax errors are triggered with the right line - * added the Symfony ctype polyfill as a dependency - * "js" filter now produces valid JSON - -* 1.35.3 (2018-03-20) - - * fixed block names unicity - * fixed counting children of SimpleXMLElement objects - * added missing else clause to avoid infinite loops - * fixed .. (range operator) in sandbox policy - -* 1.35.2 (2018-03-03) - - * fixed a regression in the way the profiler is registered in templates - -* 1.35.1 (2018-03-02) - - * added an exception when using "===" instead of "same as" - * fixed possible array to string conversion concealing actual error - * made variable names deterministic in compiled templates - * fixed length filter when passing an instance of IteratorAggregate - * fixed Environment::resolveTemplate to accept instances of TemplateWrapper - -* 1.35.0 (2017-09-27) - - * added Twig_Profiler_Profile::reset() - * fixed use TokenParser to return an empty Node - * added RuntimeExtensionInterface - * added circular reference detection when loading templates - -* 1.34.4 (2017-07-04) - - * added support for runtime loaders in IntegrationTestCase - * fixed deprecation when using Twig_Profiler_Dumper_Html - -* 1.34.3 (2017-06-07) - - * fixed namespaces introduction - -* 1.34.2 (2017-06-05) - - * fixed namespaces introduction - -* 1.34.1 (2017-06-05) - - * fixed namespaces introduction - -* 1.34.0 (2017-06-05) - - * added support for PHPUnit 6 when testing extensions - * fixed PHP 7.2 compatibility - * fixed template name generation in Twig_Environment::createTemplate() - * removed final tag on Twig_TokenParser_Include - * added namespaced aliases for all (non-deprecated) classes and interfaces - * dropped HHVM support - * dropped PHP 5.2 support - -* 1.33.2 (2017-04-20) - - * fixed edge case in the method cache for Twig attributes - -* 1.33.1 (2017-04-18) - - * fixed the empty() test - -* 1.33.0 (2017-03-22) - - * fixed a race condition handling when writing cache files - * "length" filter now returns string length when applied to an object that does - not implement \Countable but provides __toString() - * "empty" test will now consider the return value of the __toString() method for - objects implement __toString() but not \Countable - * fixed JS escaping for unicode characters with higher code points - -* 1.32.0 (2017-02-26) - - * fixed deprecation notice in Twig_Util_DeprecationCollector - * added a PSR-11 compatible runtime loader - * added `side` argument to `trim` to allow left or right trimming only. - -* 1.31.0 (2017-01-11) - - * added Twig_NodeCaptureInterface for nodes that capture all output - * fixed marking the environment as initialized too early - * fixed C89 compat for the C extension - * turned fatal error into exception when a previously generated cache is corrupted - * fixed offline cache warm-ups for embedded templates - -* 1.30.0 (2016-12-23) - - * added Twig_FactoryRuntimeLoader - * deprecated function/test/filter/tag overriding - * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr - -* 1.29.0 (2016-12-13) - - * fixed sandbox being left enabled if an exception is thrown while rendering - * marked some classes as being final (via @final) - * made Twig_Error report real source path when possible - * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }}) - * deprecated silent display of undefined blocks - * deprecated support for mbstring.func_overload != 0 - -* 1.28.2 (2016-11-23) - - * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute() - * improved a deprecation message - -* 1.28.1 (2016-11-18) - - * fixed block() function when used with a template argument - -* 1.28.0 (2016-11-17) - - * added support for the PHP 7 null coalescing operator for the ?? Twig implementation - * exposed a way to access template data and methods in a portable way - * changed context access to use the PHP 7 null coalescing operator when available - * added the "with" tag - * added support for a custom template on the block() function - * added "is defined" support for block() and constant() - * optimized the way attributes are fetched - -* 1.27.0 (2016-10-25) - - * deprecated Twig_Parser::getEnvironment() - * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() - * deprecated Twig_Compiler::addIndentation() - * fixed regression when registering two extensions having the same class name - * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead) - * fixed the filesystem loader with relative paths - * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine() - * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext() - * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName() - * deprecated the "filename" escaping strategy (use "name" instead) - * added Twig_Source to hold information about the original template - * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName() - * deprecated Parser::getFilename() - * fixed template paths when a template name contains a protocol like vfs:// - * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties - -* 1.26.1 (2016-10-05) - - * removed template source code from generated template classes when debug is disabled - * fixed default implementation of Twig_Template::getDebugInfo() for better BC - * fixed regression on static calls for functions/filters/tests - -* 1.26.0 (2016-10-02) - - * added template cache invalidation based on more environment options - * added a missing deprecation notice - * fixed template paths when a template is stored in a PHAR file - * allowed filters/functions/tests implementation to use a different class than the extension they belong to - * deprecated Twig_ExtensionInterface::getName() - -* 1.25.0 (2016-09-21) - - * changed the way we store template source in template classes - * removed usage of realpath in cache keys - * fixed Twig cache sharing when used with different versions of PHP - * removed embed parent workaround for simple use cases - * deprecated the ability to store non Node instances in Node::$nodes - * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() - * deprecated Twig_Compiler::getFilename() - -* 1.24.2 (2016-09-01) - - * fixed static callables - * fixed a potential PHP warning when loading the cache - * fixed a case where the autoescaping does not work as expected - -* 1.24.1 (2016-05-30) - - * fixed reserved keywords (forbids true, false, null and none keywords for variables names) - * fixed support for PHP7 (Throwable support) - * marked the following methods as being internals on Twig_Environment: - getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(), - getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(), - getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension() - -* 1.24.0 (2016-01-25) - - * adding support for the ?? operator - * fixed the defined test when used on a constant, a map, or a sequence - * undeprecated _self (should only be used to get the template name, not the template instance) - * fixed parsing on PHP7 - -* 1.23.3 (2016-01-11) - - * fixed typo - -* 1.23.2 (2015-01-11) - - * added versions in deprecated messages - * made file cache tolerant for trailing (back)slashes on directory configuration - * deprecated unused Twig_Node_Expression_ExtensionReference class - -* 1.23.1 (2015-11-05) - - * fixed some exception messages which triggered PHP warnings - * fixed BC on Twig_Test_NodeTestCase - -* 1.23.0 (2015-10-29) - - * deprecated the possibility to override an extension by registering another one with the same name - * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC) - * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC) - * deprecated Twig_Environment::computeAlternatives() - -* 1.22.3 (2015-10-13) - - * fixed regression when using null as a cache strategy - * improved performance when checking template freshness - * fixed warnings when loaded templates do not exist - * fixed template class name generation to prevent possible collisions - * fixed logic for custom escapers to call them even on integers and null values - * changed template cache names to take into account the Twig C extension - -* 1.22.2 (2015-09-22) - - * fixed a race condition in template loading - -* 1.22.1 (2015-09-15) - - * fixed regression in template_from_string - -* 1.22.0 (2015-09-13) - - * made Twig_Test_IntegrationTestCase more flexible - * added an option to force PHP bytecode invalidation when writing a compiled template into the cache - * fixed the profiler duration for the root node - * changed template cache names to take into account enabled extensions - * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), - Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix() - * added a way to override the filesystem template cache system - * added a way to get the original template source from Twig_Template - -* 1.21.2 (2015-09-09) - - * fixed variable names for the deprecation triggering code - * fixed escaping strategy detection based on filename - * added Traversable support for replace, merge, and sort - * deprecated support for character by character replacement for the "replace" filter - -* 1.21.1 (2015-08-26) - - * fixed regression when using the deprecated Twig_Test_* classes - -* 1.21.0 (2015-08-24) - - * added deprecation notices for deprecated features - * added a deprecation "framework" for filters/functions/tests and test fixtures - -* 1.20.0 (2015-08-12) - - * forbid access to the Twig environment from templates and internal parts of Twig_Template - * fixed limited RCEs when in sandbox mode - * deprecated Twig_Template::getEnvironment() - * deprecated the _self variable for usage outside of the from and import tags - * added Twig_BaseNodeVisitor to ease the compatibility of node visitors - between 1.x and 2.x - -* 1.19.0 (2015-07-31) - - * fixed wrong error message when including an undefined template in a child template - * added support for variadic filters, functions, and tests - * added support for extra positional arguments in macros - * added ignore_missing flag to the source function - * fixed batch filter with zero items - * deprecated Twig_Environment::clearTemplateCache() - * fixed sandbox disabling when using the include function - -* 1.18.2 (2015-06-06) - - * fixed template/line guessing in exceptions for nested templates - * optimized the number of inodes and the size of realpath cache when using the cache - -* 1.18.1 (2015-04-19) - - * fixed memory leaks in the C extension - * deprecated Twig_Loader_String - * fixed the slice filter when used with a SimpleXMLElement object - * fixed filesystem loader when trying to load non-files (like directories) - -* 1.18.0 (2015-01-25) - - * fixed some error messages where the line was wrong (unknown variables or argument names) - * added a new way to customize the main Module node (via empty nodes) - * added Twig_Environment::createTemplate() to create a template from a string - * added a profiler - * fixed filesystem loader cache when different file paths are used for the same template - -* 1.17.0 (2015-01-14) - - * added a 'filename' autoescaping strategy, which dynamically chooses the - autoescaping strategy for a template based on template file extension. - -* 1.16.3 (2014-12-25) - - * fixed regression for dynamic parent templates - * fixed cache management with statcache - * fixed a regression in the slice filter - -* 1.16.2 (2014-10-17) - - * fixed timezone on dates as strings - * fixed 2-words test names when a custom node class is not used - * fixed macros when using an argument named like a PHP super global (like GET or POST) - * fixed date_modify when working with DateTimeImmutable - * optimized for loops - * fixed multi-byte characters handling in the split filter - * fixed a regression in the in operator - * fixed a regression in the slice filter - -* 1.16.1 (2014-10-10) - - * improved error reporting in a sandboxed template - * fixed missing error file/line information under certain circumstances - * fixed wrong error line number in some error messages - * fixed the in operator to use strict comparisons - * sped up the slice filter - * fixed for mb function overload mb_substr acting different - * fixed the attribute() function when passing a variable for the arguments - -* 1.16.0 (2014-07-05) - - * changed url_encode to always encode according to RFC 3986 - * fixed inheritance in a 'use'-hierarchy - * removed the __toString policy check when the sandbox is disabled - * fixed recursively calling blocks in templates with inheritance - -* 1.15.1 (2014-02-13) - - * fixed the conversion of the special '0000-00-00 00:00' date - * added an error message when trying to import an undefined block from a trait - * fixed a C extension crash when accessing defined but uninitialized property. - -* 1.15.0 (2013-12-06) - - * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException - * added min and max functions - * added the round filter - * fixed a bug that prevented the optimizers to be enabled/disabled selectively - * fixed first and last filters for UTF-8 strings - * added a source function to include the content of a template without rendering it - * fixed the C extension sandbox behavior when get or set is prepend to method name - -* 1.14.2 (2013-10-30) - - * fixed error filename/line when an error occurs in an included file - * allowed operators that contain whitespaces to have more than one whitespace - * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by") - -* 1.14.1 (2013-10-15) - - * made it possible to use named operators as variables - * fixed the possibility to have a variable named 'matches' - * added support for PHP 5.5 DateTimeInterface - -* 1.14.0 (2013-10-03) - - * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy - * added new operators: ends with, starts with, and matches - * fixed some compatibility issues with HHVM - * added a way to add custom escaping strategies - * fixed the C extension compilation on Windows - * fixed the batch filter when using a fill argument with an exact match of elements to batch - * fixed the filesystem loader cache when a template name exists in several namespaces - * fixed template_from_string when the template includes or extends other ones - * fixed a crash of the C extension on an edge case - -* 1.13.2 (2013-08-03) - - * fixed the error line number for an error occurs in and embedded template - * fixed crashes of the C extension on some edge cases - -* 1.13.1 (2013-06-06) - - * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem - * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface - * adjusted backtrace call to reduce memory usage when an error occurs - * added support for object instances as the second argument of the constant test - * fixed the include function when used in an assignment - -* 1.13.0 (2013-05-10) - - * fixed getting a numeric-like item on a variable ('09' for instance) - * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access: - `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`) - * made the escape filter 20% faster for happy path (escaping string for html with UTF-8) - * changed ☃ to § in tests - * enforced usage of named arguments after positional ones - -* 1.12.3 (2013-04-08) - - * fixed a security issue in the filesystem loader where it was possible to include a template one - level above the configured path - * fixed fatal error that should be an exception when adding a filter/function/test too late - * added a batch filter - * added support for encoding an array as query string in the url_encode filter - -* 1.12.2 (2013-02-09) - - * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00) - * fixed globals when getGlobals is called early on - * added the first and last filter - -* 1.12.1 (2013-01-15) - - * added support for object instances as the second argument of the constant function - * relaxed globals management to avoid a BC break - * added support for {{ some_string[:2] }} - -* 1.12.0 (2013-01-08) - - * added verbatim as an alias for the raw tag to avoid confusion with the raw filter - * fixed registration of tests and functions as anonymous functions - * fixed globals management - -* 1.12.0-RC1 (2012-12-29) - - * added an include function (does the same as the include tag but in a more flexible way) - * added the ability to use any PHP callable to define filters, functions, and tests - * added a syntax error when using a loop variable that is not defined - * added the ability to set default values for macro arguments - * added support for named arguments for filters, tests, and functions - * moved filters/functions/tests syntax errors to the parser - * added support for extended ternary operator syntaxes - -* 1.11.1 (2012-11-11) - - * fixed debug info line numbering (was off by 2) - * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1) - * optimized variable access on PHP 5.4 - * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX) - -* 1.11.0 (2012-11-07) - - * fixed macro compilation when a variable name is a PHP reserved keyword - * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone - * fixed bitwise operator precedences - * added the template_from_string function - * fixed default timezone usage for the date function - * optimized the way Twig exceptions are managed (to make them faster) - * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster) - -* 1.10.3 (2012-10-19) - - * fixed wrong template location in some error messages - * reverted a BC break introduced in 1.10.2 - * added a split filter - -* 1.10.2 (2012-10-15) - - * fixed macro calls on PHP 5.4 - -* 1.10.1 (2012-10-15) - - * made a speed optimization to macro calls when imported via the "import" tag - * fixed C extension compilation on Windows - * fixed a segfault in the C extension when using DateTime objects - -* 1.10.0 (2012-09-28) - - * extracted functional tests framework to make it reusable for third-party extensions - * added namespaced templates support in Twig_Loader_Filesystem - * added Twig_Loader_Filesystem::prependPath() - * fixed an error when a token parser pass a closure as a test to the subparse() method - -* 1.9.2 (2012-08-25) - - * fixed the in operator for objects that contain circular references - * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface - -* 1.9.1 (2012-07-22) - - * optimized macro calls when auto-escaping is on - * fixed wrong parent class for Twig_Function_Node - * made Twig_Loader_Chain more explicit about problems - -* 1.9.0 (2012-07-13) - - * made the parsing independent of the template loaders - * fixed exception trace when an error occurs when rendering a child template - * added escaping strategies for CSS, URL, and HTML attributes - * fixed nested embed tag calls - * added the date_modify filter - -* 1.8.3 (2012-06-17) - - * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash - * fixed escaping when a project defines a function named html or js - * fixed chmod mode to apply the umask correctly - -* 1.8.2 (2012-05-30) - - * added the abs filter - * fixed a regression when using a number in template attributes - * fixed compiler when mbstring.func_overload is set to 2 - * fixed DateTimeZone support in date filter - -* 1.8.1 (2012-05-17) - - * fixed a regression when dealing with SimpleXMLElement instances in templates - * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini - * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ) - -* 1.8.0 (2012-05-08) - - * enforced interface when adding tests, filters, functions, and node visitors from extensions - * fixed a side-effect of the date filter where the timezone might be changed - * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) - * added a way to dynamically change the auto-escaping strategy according to the template "filename" - * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) - * added an embed tag - -* 1.7.0 (2012-04-24) - - * fixed a PHP warning when using CIFS - * fixed template line number in some exceptions - * added an iterable test - * added an error when defining two blocks with the same name in a template - * added the preserves_safety option for filters - * fixed a PHP notice when trying to access a key on a non-object/array variable - * enhanced error reporting when the template file is an instance of SplFileInfo - * added Twig_Environment::mergeGlobals() - * added compilation checks to avoid misuses of the sandbox tag - * fixed filesystem loader freshness logic for high traffic websites - * fixed random function when charset is null - -* 1.6.5 (2012-04-11) - - * fixed a regression when a template only extends another one without defining any blocks - -* 1.6.4 (2012-04-02) - - * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 - * fixed performance when compiling large files - * optimized parent template creation when the template does not use dynamic inheritance - -* 1.6.3 (2012-03-22) - - * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension - * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot - * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate - -* 1.6.2 (2012-03-18) - - * fixed sandbox mode when used with inheritance - * added preserveKeys support for the slice filter - * fixed the date filter when a DateTime instance is passed with a specific timezone - * added a trim filter - -* 1.6.1 (2012-02-29) - - * fixed Twig C extension - * removed the creation of Twig_Markup instances when not needed - * added a way to set the default global timezone for dates - * fixed the slice filter on strings when the length is not specified - * fixed the creation of the cache directory in case of a race condition - -* 1.6.0 (2012-02-04) - - * fixed raw blocks when used with the whitespace trim option - * made a speed optimization to macro calls when imported via the "from" tag - * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added - * fixed the attribute function when passing arguments - * added slice notation support for the [] operator (syntactic sugar for the slice operator) - * added a slice filter - * added string support for the reverse filter - * fixed the empty test and the length filter for Twig_Markup instances - * added a date function to ease date comparison - * fixed unary operators precedence - * added recursive parsing support in the parser - * added string and integer handling for the random function - -* 1.5.1 (2012-01-05) - - * fixed a regression when parsing strings - -* 1.5.0 (2012-01-04) - - * added Traversable objects support for the join filter - -* 1.5.0-RC2 (2011-12-30) - - * added a way to set the default global date interval format - * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) - * refactored Twig_Template::display() to ease its extension - * added a number_format filter - -* 1.5.0-RC1 (2011-12-26) - - * removed the need to quote hash keys - * allowed hash keys to be any expression - * added a do tag - * added a flush tag - * added support for dynamically named filters and functions - * added a dump function to help debugging templates - * added a nl2br filter - * added a random function - * added a way to change the default format for the date filter - * fixed the lexer when an operator ending with a letter ends a line - * added string interpolation support - * enhanced exceptions for unknown filters, functions, tests, and tags - -* 1.4.0 (2011-12-07) - - * fixed lexer when using big numbers (> PHP_INT_MAX) - * added missing preserveKeys argument to the reverse filter - * fixed macros containing filter tag calls - -* 1.4.0-RC2 (2011-11-27) - - * removed usage of Reflection in Twig_Template::getAttribute() - * added a C extension that can optionally replace Twig_Template::getAttribute() - * added negative timestamp support to the date filter - -* 1.4.0-RC1 (2011-11-20) - - * optimized variable access when using PHP 5.4 - * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby - * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders - * added Twig_Function_Node to allow more complex functions to have their own Node class - * added Twig_Filter_Node to allow more complex filters to have their own Node class - * added Twig_Test_Node to allow more complex tests to have their own Node class - * added a better error message when a template is empty but contain a BOM - * fixed "in" operator for empty strings - * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) - * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) - * added Twig_Environment::display() - * made the escape filter smarter when the encoding is not supported by PHP - * added a convert_encoding filter - * moved all node manipulations outside the compile() Node method - * made several speed optimizations - -* 1.3.0 (2011-10-08) - -no changes - -* 1.3.0-RC1 (2011-10-04) - - * added an optimization for the parent() function - * added cache reloading when auto_reload is true and an extension has been modified - * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) - * allowed empty templates to be used as traits - * added traits support for the "parent" function - -* 1.2.0 (2011-09-13) - -no changes - -* 1.2.0-RC1 (2011-09-10) - - * enhanced the exception when a tag remains unclosed - * added support for empty Countable objects for the "empty" test - * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) - * added better support for encoding problems when escaping a string (available as of PHP 5.4) - * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) - * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) - * added support for bitwise operators in expressions - * added the "attribute" function to allow getting dynamic attributes on variables - * added Twig_Loader_Chain - * added Twig_Loader_Array::setTemplate() - * added an optimization for the set tag when used to capture a large chunk of static text - * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) - * removed the possibility to use the "extends" tag from a block - * added "if" modifier support to "for" loops - -* 1.1.2 (2011-07-30) - - * fixed json_encode filter on PHP 5.2 - * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) - * fixed inheritance when using conditional parents - * fixed compilation of templates when the body of a child template is not empty - * fixed output when a macro throws an exception - * fixed a parsing problem when a large chunk of text is enclosed in a comment tag - * added PHPDoc for all Token parsers and Core extension functions - -* 1.1.1 (2011-07-17) - - * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) - * made some performance improvement for some edge cases - -* 1.1.0 (2011-06-28) - - * fixed json_encode filter - -* 1.1.0-RC3 (2011-06-24) - - * fixed method case-sensitivity when using the sandbox mode - * added timezone support for the date filter - * fixed possible security problems with NUL bytes - -* 1.1.0-RC2 (2011-06-16) - - * added an exception when the template passed to "use" is not a string - * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) - * added {% line \d+ %} directive - -* 1.1.0-RC1 (2011-05-28) - -Flush your cache after upgrading. - - * fixed date filter when using a timestamp - * fixed the defined test for some cases - * fixed a parsing problem when a large chunk of text is enclosed in a raw tag - * added support for horizontal reuse of template blocks (see docs for more information) - * added whitespace control modifier to all tags (see docs for more information) - * added null as an alias for none (the null test is also an alias for the none test now) - * made TRUE, FALSE, NONE equivalent to their lowercase counterparts - * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line - * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) - -* 1.0.0 (2011-03-27) - - * fixed output when using mbstring - * fixed duplicate call of methods when using the sandbox - * made the charset configurable for the escape filter - -* 1.0.0-RC2 (2011-02-21) - - * changed the way {% set %} works when capturing (the content is now marked as safe) - * added support for macro name in the endmacro tag - * make Twig_Error compatible with PHP 5.3.0 > - * fixed an infinite loop on some Windows configurations - * fixed the "length" filter for numbers - * fixed Template::getAttribute() as properties in PHP are case sensitive - * removed coupling between Twig_Node and Twig_Template - * fixed the ternary operator precedence rule - -* 1.0.0-RC1 (2011-01-09) - -Backward incompatibilities: - - * the "items" filter, which has been deprecated for quite a long time now, has been removed - * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) - * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} - * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} - * the "for" tag does not support "joined by" anymore - * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") - * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) - * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) - * removed the grammar and simple token parser (moved to the Twig Extensions repository) - -Changes: - - * added "needs_context" option for filters and functions (the context is then passed as a first argument) - * added global variables support - * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) - * added the "from" tag to import macros as functions - * added support for functions (a function is just syntactic sugar for a getAttribute() call) - * made macros callable when sandbox mode is enabled - * added an exception when a macro uses a reserved name - * the "default" filter now uses the "empty" test instead of just checking for null - * added the "empty" test - -* 0.9.10 (2010-12-16) - -Backward incompatibilities: - - * The Escaper extension is enabled by default, which means that all displayed - variables are now automatically escaped. You can revert to the previous - behavior by removing the extension via $env->removeExtension('escaper') - or just set the 'autoescape' option to 'false'. - * removed the "without loop" attribute for the "for" tag (not needed anymore - as the Optimizer take care of that for most cases) - * arrays and hashes have now a different syntax - * arrays keep the same syntax with square brackets: [1, 2] - * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) - * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) - * the i18n extension is now part of the Twig Extensions repository - -Changes: - - * added the merge filter - * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead - * fixed usage of operators as method names (like is, in, and not) - * changed the order of execution for node visitors - * fixed default() filter behavior when used with strict_variables set to on - * fixed filesystem loader compatibility with PHAR files - * enhanced error messages when an unexpected token is parsed in an expression - * fixed filename not being added to syntax error messages - * added the autoescape option to enable/disable autoescaping - * removed the newline after a comment (mimics PHP behavior) - * added a syntax error exception when parent block is used on a template that does not extend another one - * made the Escaper extension enabled by default - * fixed sandbox extension when used with auto output escaping - * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) - * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) - * added priority to node visitors - -* 0.9.9 (2010-11-28) - -Backward incompatibilities: - * the self special variable has been renamed to _self - * the odd and even filters are now tests: - {{ foo|odd }} must now be written {{ foo is odd }} - * the "safe" filter has been renamed to "raw" - * in Node classes, - sub-nodes are now accessed via getNode() (instead of property access) - attributes via getAttribute() (instead of array access) - * the urlencode filter had been renamed to url_encode - * the include tag now merges the passed variables with the current context by default - (the old behavior is still possible by adding the "only" keyword) - * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) - * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) - * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) - -Changes: - * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template - * changed trans tag to accept any variable for the plural count - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) - * added the ** (power) operator - * changed the algorithm used for parsing expressions - * added the spaceless tag - * removed trim_blocks option - * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) - * changed all exceptions to extend Twig_Error - * fixed unary expressions ({{ not(1 or 0) }}) - * fixed child templates (with an extend tag) that uses one or more imports - * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) - * escaping has been rewritten - * the implementation of template inheritance has been rewritten - (blocks can now be called individually and still work with inheritance) - * fixed error handling for if tag when a syntax error occurs within a subparse process - * added a way to implement custom logic for resolving token parsers given a tag name - * fixed js escaper to be stricter (now uses a whilelist-based js escaper) - * added the following filers: "constant", "trans", "replace", "json_encode" - * added a "constant" test - * fixed objects with __toString() not being autoescaped - * fixed subscript expressions when calling __call() (methods now keep the case) - * added "test" feature (accessible via the "is" operator) - * removed the debug tag (should be done in an extension) - * fixed trans tag when no vars are used in plural form - * fixed race condition when writing template cache - * added the special _charset variable to reference the current charset - * added the special _context variable to reference the current context - * renamed self to _self (to avoid conflict) - * fixed Twig_Template::getAttribute() for protected properties - -* 0.9.8 (2010-06-28) - -Backward incompatibilities: - * the trans tag plural count is now attached to the plural tag: - old: `{% trans count %}...{% plural %}...{% endtrans %}` - new: `{% trans %}...{% plural count %}...{% endtrans %}` - - * added a way to translate strings coming from a variable ({% trans var %}) - * fixed trans tag when used with the Escaper extension - * fixed default cache umask - * removed Twig_Template instances from the debug tag output - * fixed objects with __isset() defined - * fixed set tag when used with a capture - * fixed type hinting for Twig_Environment::addFilter() method - -* 0.9.7 (2010-06-12) - -Backward incompatibilities: - * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) - * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) - * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) - - * added self as a special variable that refers to the current template (useful for importing macros from the current template) - * added Twig_Template instance support to the include tag - * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) - * added a grammar sub-framework to ease the creation of custom tags - * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) - * removed the Twig_Resource::resolveMissingFilter() method - * fixed the filter tag which did not apply filtering to included files - * added a bunch of unit tests - * added a bunch of phpdoc - * added a sandbox tag in the sandbox extension - * changed the date filter to support any date format supported by DateTime - * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) - * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor - * changed the cache option to only accepts an explicit path to a cache directory or false - * added a way to add token parsers, filters, and visitors without creating an extension - * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface - * changed the generated code to match the new coding standards - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) - * added an exception when a child template has a non-empty body (as it is always ignored when rendering) - -* 0.9.6 (2010-05-12) - - * fixed variables defined outside a loop and for which the value changes in a for loop - * fixed the test suite for PHP 5.2 and older versions of PHPUnit - * added support for __call() in expression resolution - * fixed node visiting for macros (macros are now visited by visitors as any other node) - * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) - * added the cycle filter - * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII - * added a long-syntax for the set tag ({% set foo %}...{% endset %}) - * unit tests are now powered by PHPUnit - * added support for gettext via the `i18n` extension - * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values - * added a more useful exception if an if tag is not closed properly - * added support for escaping strategy in the autoescape tag - * fixed lexer when a template has a big chunk of text between/in a block - -* 0.9.5 (2010-01-20) - -As for any new release, don't forget to remove all cached templates after -upgrading. - -If you have defined custom filters, you MUST upgrade them for this release. To -upgrade, replace "array" with "new Twig_Filter_Function", and replace the -environment constant by the "needs_environment" option: - - // before - 'even' => array('twig_is_even_filter', false), - 'escape' => array('twig_escape_filter', true), - - // after - 'even' => new Twig_Filter_Function('twig_is_even_filter'), - 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), - -If you have created NodeTransformer classes, you will need to upgrade them to -the new interface (please note that the interface is not yet considered -stable). - - * fixed list nodes that did not extend the Twig_NodeListInterface - * added the "without loop" option to the for tag (it disables the generation of the loop variable) - * refactored node transformers to node visitors - * fixed automatic-escaping for blocks - * added a way to specify variables to pass to an included template - * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) - * improved the filter system to allow object methods to be used as filters - * changed the Array and String loaders to actually make use of the cache mechanism - * included the default filter function definitions in the extension class files directly (Core, Escaper) - * added the // operator (like the floor() PHP function) - * added the .. operator (as a syntactic sugar for the range filter when the step is 1) - * added the in operator (as a syntactic sugar for the in filter) - * added the following filters in the Core extension: in, range - * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) - * enhanced some error messages to provide better feedback in case of parsing errors - -* 0.9.4 (2009-12-02) - -If you have custom loaders, you MUST upgrade them for this release: The -Twig_Loader base class has been removed, and the Twig_LoaderInterface has also -been changed (see the source code for more information or the documentation). - - * added support for DateTime instances for the date filter - * fixed loop.last when the array only has one item - * made it possible to insert newlines in tag and variable blocks - * fixed a bug when a literal '\n' were present in a template text - * fixed bug when the filename of a template contains */ - * refactored loaders - -* 0.9.3 (2009-11-11) - -This release is NOT backward compatible with the previous releases. - - The loaders do not take the cache and autoReload arguments anymore. Instead, - the Twig_Environment class has two new options: cache and auto_reload. - Upgrading your code means changing this kind of code: - - $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); - $twig = new Twig_Environment($loader); - - to something like this: - - $loader = new Twig_Loader_Filesystem('/path/to/templates'); - $twig = new Twig_Environment($loader, array( - 'cache' => '/path/to/compilation_cache', - 'auto_reload' => true, - )); - - * deprecated the "items" filter as it is not needed anymore - * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader - * optimized template loading speed - * removed output when an error occurs in a template and render() is used - * made major speed improvements for loops (up to 300% on even the smallest loops) - * added properties as part of the sandbox mode - * added public properties support (obj.item can now be the item property on the obj object) - * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) - * fixed bug when \ was used in HTML - -* 0.9.2 (2009-10-29) - - * made some speed optimizations - * changed the cache extension to .php - * added a js escaping strategy - * added support for short block tag - * changed the filter tag to allow chained filters - * made lexer more flexible as you can now change the default delimiters - * added set tag - * changed default directory permission when cache dir does not exist (more secure) - * added macro support - * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance - * made Twig_Autoloader::autoload() a static method - * avoid writing template file if an error occurs - * added $ escaping when outputting raw strings - * enhanced some error messages to ease debugging - * fixed empty cache files when the template contains an error - -* 0.9.1 (2009-10-14) - - * fixed a bug in PHP 5.2.6 - * fixed numbers with one than one decimal - * added support for method calls with arguments ({{ foo.bar('a', 43) }}) - * made small speed optimizations - * made minor tweaks to allow better extensibility and flexibility - -* 0.9.0 (2009-10-12) - - * Initial release diff --git a/system/backend/php/vendor/twig/twig/LICENSE b/system/backend/php/vendor/twig/twig/LICENSE index d06ced2a39c..fd8234e511b 100644 --- a/system/backend/php/vendor/twig/twig/LICENSE +++ b/system/backend/php/vendor/twig/twig/LICENSE @@ -1,31 +1,27 @@ -Copyright (c) 2009-2019 by the Twig Team. +Copyright (c) 2009-present by the Twig Team. -Some rights reserved. +All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Twig nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/system/backend/php/vendor/twig/twig/README.rst b/system/backend/php/vendor/twig/twig/README.rst index f33ea336d86..fbe7e9a9f83 100644 --- a/system/backend/php/vendor/twig/twig/README.rst +++ b/system/backend/php/vendor/twig/twig/README.rst @@ -1,12 +1,20 @@ Twig, the flexible, fast, and secure template language for PHP ============================================================== -Twig is a template language for PHP, released under the new BSD license (code -and documentation). +Twig is a template language for PHP. Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. +Sponsors +-------- + +.. raw:: html + + + Blackfire.io + + More Information ---------------- diff --git a/system/backend/php/vendor/twig/twig/composer.json b/system/backend/php/vendor/twig/twig/composer.json index c1bbd55a514..4bc2421a9da 100644 --- a/system/backend/php/vendor/twig/twig/composer.json +++ b/system/backend/php/vendor/twig/twig/composer.json @@ -5,6 +5,7 @@ "keywords": ["templating"], "homepage": "https://twig.symfony.com", "license": "BSD-3-Clause", + "minimum-stability": "dev", "authors": [ { "name": "Fabien Potencier", @@ -14,7 +15,6 @@ }, { "name": "Twig Team", - "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" }, { @@ -24,13 +24,13 @@ } ], "require": { - "php": "^7.0", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-ctype": "^1.8" + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0", - "symfony/debug": "^4.0.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "psr/container": "^1.0" }, "autoload": { @@ -42,13 +42,13 @@ } }, "autoload-dev": { - "psr-0" : { - "Twig_Tests_" : "test/" + "psr-4" : { + "Twig\\Tests\\" : "tests/" } }, "extra": { "branch-alias": { - "dev-master": "2.11-dev" + "dev-master": "2.15-dev" } } } diff --git a/system/backend/php/vendor/twig/twig/doc/advanced.rst b/system/backend/php/vendor/twig/twig/doc/advanced.rst deleted file mode 100644 index 4d22fcce613..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/advanced.rst +++ /dev/null @@ -1,917 +0,0 @@ -Extending Twig -============== - -Twig can be extended in many ways; you can add extra tags, filters, tests, -operators, global variables, and functions. You can even extend the parser -itself with node visitors. - -.. note:: - - The first section of this chapter describes how to extend Twig. If you want - to reuse your changes in different projects or if you want to share them - with others, you should then create an extension as described in the - following section. - -.. caution:: - - When extending Twig without creating an extension, Twig won't be able to - recompile your templates when the PHP code is updated. To see your changes - in real-time, either disable template caching or package your code into an - extension (see the next section of this chapter). - -Before extending Twig, you must understand the differences between all the -different possible extension points and when to use them. - -First, remember that Twig has two main language constructs: - -* ``{{ }}``: used to print the result of an expression evaluation; - -* ``{% %}``: used to execute statements. - -To understand why Twig exposes so many extension points, let's see how to -implement a *Lorem ipsum* generator (it needs to know the number of words to -generate). - -You can use a ``lipsum`` *tag*: - -.. code-block:: twig - - {% lipsum 40 %} - -That works, but using a tag for ``lipsum`` is not a good idea for at least -three main reasons: - -* ``lipsum`` is not a language construct; -* The tag outputs something; -* The tag is not flexible as you cannot use it in an expression: - - .. code-block:: twig - - {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }} - -In fact, you rarely need to create tags; and that's good news because tags are -the most complex extension point. - -Now, let's use a ``lipsum`` *filter*: - -.. code-block:: twig - - {{ 40|lipsum }} - -Again, it works. But a filter should transform the passed value to something -else. Here, we use the value to indicate the number of words to generate (so, -``40`` is an argument of the filter, not the value we want to transform). - -Next, let's use a ``lipsum`` *function*: - -.. code-block:: twig - - {{ lipsum(40) }} - -Here we go. For this specific example, the creation of a function is the -extension point to use. And you can use it anywhere an expression is accepted: - -.. code-block:: twig - - {{ 'some text' ~ lipsum(40) ~ 'some more text' }} - - {% set lipsum = lipsum(40) %} - -Lastly, you can also use a *global* object with a method able to generate lorem -ipsum text: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -As a rule of thumb, use functions for frequently used features and global -objects for everything else. - -Keep in mind the following when you want to extend Twig: - -========== ========================== ========== ========================= -What? Implementation difficulty? How often? When? -========== ========================== ========== ========================= -*macro* simple frequent Content generation -*global* simple frequent Helper object -*function* simple frequent Content generation -*filter* simple frequent Value transformation -*tag* complex rare DSL language construct -*test* simple rare Boolean decision -*operator* simple rare Values transformation -========== ========================== ========== ========================= - -Globals -------- - -A global variable is like any other template variable, except that it's -available in all templates and macros:: - - $twig = new \Twig\Environment($loader); - $twig->addGlobal('text', new Text()); - -You can then use the ``text`` variable anywhere in a template: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -Filters -------- - -Creating a filter consists of associating a name with a PHP callable:: - - // an anonymous function - $filter = new \Twig\TwigFilter('rot13', function ($string) { - return str_rot13($string); - }); - - // or a simple PHP function - $filter = new \Twig\TwigFilter('rot13', 'str_rot13'); - - // or a class static method - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - $filter = new \Twig\TwigFilter('rot13', 'SomeClass::rot13Filter'); - - // or a class method - $filter = new \Twig\TwigFilter('rot13', [$this, 'rot13Filter']); - // the one below needs a runtime implementation (see below for more information) - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - -The first argument passed to the ``\Twig\TwigFilter`` constructor is the name of the -filter you will use in templates and the second one is the PHP callable to -associate with it. - -Then, add the filter to the Twig environment:: - - $twig = new \Twig\Environment($loader); - $twig->addFilter($filter); - -And here is how to use it in a template: - -.. code-block:: twig - - {{ 'Twig'|rot13 }} - - {# will output Gjvt #} - -When called by Twig, the PHP callable receives the left side of the filter -(before the pipe ``|``) as the first argument and the extra arguments passed -to the filter (within parentheses ``()``) as extra arguments. - -For instance, the following code: - -.. code-block:: twig - - {{ 'TWIG'|lower }} - {{ now|date('d/m/Y') }} - -is compiled to something like the following:: - - - - -The ``\Twig\TwigFilter`` class takes an array of options as its last argument:: - - $filter = new \Twig\TwigFilter('rot13', 'str_rot13', $options); - -Environment-aware Filters -~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current environment instance in your filter, set the -``needs_environment`` option to ``true``; Twig will pass the current -environment as the first argument to the filter call:: - - $filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $string) { - // get the current charset for instance - $charset = $env->getCharset(); - - return str_rot13($string); - }, ['needs_environment' => true]); - -Context-aware Filters -~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current context in your filter, set the -``needs_context`` option to ``true``; Twig will pass the current context as -the first argument to the filter call (or the second one if -``needs_environment`` is also set to ``true``):: - - $filter = new \Twig\TwigFilter('rot13', function ($context, $string) { - // ... - }, ['needs_context' => true]); - - $filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $context, $string) { - // ... - }, ['needs_context' => true, 'needs_environment' => true]); - -Automatic Escaping -~~~~~~~~~~~~~~~~~~ - -If automatic escaping is enabled, the output of the filter may be escaped -before printing. If your filter acts as an escaper (or explicitly outputs HTML -or JavaScript code), you will want the raw output to be printed. In such a -case, set the ``is_safe`` option:: - - $filter = new \Twig\TwigFilter('nl2br', 'nl2br', ['is_safe' => ['html']]); - -Some filters may need to work on input that is already escaped or safe, for -example when adding (safe) HTML tags to originally unsafe output. In such a -case, set the ``pre_escape`` option to escape the input data before it is run -through your filter:: - - $filter = new \Twig\TwigFilter('somefilter', 'somefilter', ['pre_escape' => 'html', 'is_safe' => ['html']]); - -Variadic Filters -~~~~~~~~~~~~~~~~ - -When a filter should accept an arbitrary number of arguments, set the -``is_variadic`` option to ``true``; Twig will pass the extra arguments as the -last argument to the filter call as an array:: - - $filter = new \Twig\TwigFilter('thumbnail', function ($file, array $options = []) { - // ... - }, ['is_variadic' => true]); - -Be warned that :ref:`named arguments ` passed to a variadic -filter cannot be checked for validity as they will automatically end up in the -option array. - -Dynamic Filters -~~~~~~~~~~~~~~~ - -A filter name containing the special ``*`` character is a dynamic filter and -the ``*`` part will match any string:: - - $filter = new \Twig\TwigFilter('*_path', function ($name, $arguments) { - // ... - }); - -The following filters are matched by the above defined dynamic filter: - -* ``product_path`` -* ``category_path`` - -A dynamic filter can define more than one dynamic parts:: - - $filter = new \Twig\TwigFilter('*_path_*', function ($name, $suffix, $arguments) { - // ... - }); - -The filter receives all dynamic part values before the normal filter arguments, -but after the environment and the context. For instance, a call to -``'foo'|a_path_b()`` will result in the following arguments to be passed to the -filter: ``('a', 'b', 'foo')``. - -Deprecated Filters -~~~~~~~~~~~~~~~~~~ - -You can mark a filter as being deprecated by setting the ``deprecated`` option -to ``true``. You can also give an alternative filter that replaces the -deprecated one when that makes sense:: - - $filter = new \Twig\TwigFilter('obsolete', function () { - // ... - }, ['deprecated' => true, 'alternative' => 'new_one']); - -When a filter is deprecated, Twig emits a deprecation notice when compiling a -template using it. See :ref:`deprecation-notices` for more information. - -Functions ---------- - -Functions are defined in the exact same way as filters, but you need to create -an instance of ``\Twig\TwigFunction``:: - - $twig = new \Twig\Environment($loader); - $function = new \Twig\TwigFunction('function_name', function () { - // ... - }); - $twig->addFunction($function); - -Functions support the same features as filters, except for the ``pre_escape`` -and ``preserves_safety`` options. - -Tests ------ - -Tests are defined in the exact same way as filters and functions, but you need -to create an instance of ``\Twig\TwigTest``:: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('test_name', function () { - // ... - }); - $twig->addTest($test); - -Tests allow you to create custom application specific logic for evaluating -boolean conditions. As a simple example, let's create a Twig test that checks if -objects are 'red':: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('red', function ($value) { - if (isset($value->color) && $value->color == 'red') { - return true; - } - if (isset($value->paint) && $value->paint == 'red') { - return true; - } - return false; - }); - $twig->addTest($test); - -Test functions must always return ``true``/``false``. - -When creating tests you can use the ``node_class`` option to provide custom test -compilation. This is useful if your test can be compiled into PHP primitives. -This is used by many of the tests built into Twig:: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest( - 'odd', - null, - ['node_class' => \Twig\Node\Expression\Test\OddTest::class]); - $twig->addTest($test); - - class Twig_Node_Expression_Test_Odd extends \Twig\Node\Expression\TestExpression - { - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 == 1') - ->raw(')') - ; - } - } - -The above example shows how you can create tests that use a node class. The node -class has access to one sub-node called ``node``. This sub-node contains the -value that is being tested. When the ``odd`` filter is used in code such as: - -.. code-block:: twig - - {% if my_value is odd %} - -The ``node`` sub-node will contain an expression of ``my_value``. Node-based -tests also have access to the ``arguments`` node. This node will contain the -various other arguments that have been provided to your test. - -.. versionadded:: 2.6 - Dynamic tests support was added in Twig 2.6. - -If you want to pass a variable number of positional or named arguments to the -test, set the ``is_variadic`` option to ``true``. Tests support dynamic -names (see dynamic filters for the syntax). - -Tags ----- - -One of the most exciting features of a template engine like Twig is the -possibility to define new **language constructs**. This is also the most complex -feature as you need to understand how Twig's internals work. - -Most of the time though, a tag is not needed: - -* If your tag generates some output, use a **function** instead. - -* If your tag modifies some content and returns it, use a **filter** instead. - - For instance, if you want to create a tag that converts a Markdown formatted - text to HTML, create a ``markdown`` filter instead: - - .. code-block:: twig - - {{ '**markdown** text'|markdown }} - - If you want use this filter on large amounts of text, wrap it with the - :doc:`apply ` tag: - - .. code-block:: twig - - {% apply markdown %} - Title - ===== - - Much better than creating a tag as you can **compose** filters. - {% endapply %} - - .. note:: - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -* If your tag does not output anything, but only exists because of a side - effect, create a **function** that returns nothing and call it via the - :doc:`filter ` tag. - - For instance, if you want to create a tag that logs text, create a ``log`` - function instead and call it via the :doc:`do ` tag: - - .. code-block:: twig - - {% do log('Log some things') %} - -If you still want to create a tag for a new language construct, great! - -Let's create a ``set`` tag that allows the definition of simple variables from -within a template. The tag can be used like follows: - -.. code-block:: twig - - {% set name = "value" %} - - {{ name }} - - {# should output value #} - -.. note:: - - The ``set`` tag is part of the Core extension and as such is always - available. The built-in version is slightly more powerful and supports - multiple assignments by default. - -Three steps are needed to define a new tag: - -* Defining a Token Parser class (responsible for parsing the template code); - -* Defining a Node class (responsible for converting the parsed code to PHP); - -* Registering the tag. - -Registering a new tag -~~~~~~~~~~~~~~~~~~~~~ - -Add a tag by calling the ``addTokenParser`` method on the ``\Twig\Environment`` -instance:: - - $twig = new \Twig\Environment($loader); - $twig->addTokenParser(new Project_Set_TokenParser()); - -Defining a Token Parser -~~~~~~~~~~~~~~~~~~~~~~~ - -Now, let's see the actual code of this class:: - - class Project_Set_TokenParser extends \Twig\TokenParser\AbstractTokenParser - { - public function parse(\Twig\Token $token) - { - $parser = $this->parser; - $stream = $parser->getStream(); - - $name = $stream->expect(\Twig\Token::NAME_TYPE)->getValue(); - $stream->expect(\Twig\Token::OPERATOR_TYPE, '='); - $value = $parser->getExpressionParser()->parseExpression(); - $stream->expect(\Twig\Token::BLOCK_END_TYPE); - - return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'set'; - } - } - -The ``getTag()`` method must return the tag we want to parse, here ``set``. - -The ``parse()`` method is invoked whenever the parser encounters a ``set`` -tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the -``Project_Set_Node`` calls creating is explained in the next section). - -The parsing process is simplified thanks to a bunch of methods you can call -from the token stream (``$this->parser->getStream()``): - -* ``getCurrent()``: Gets the current token in the stream. - -* ``next()``: Moves to the next token in the stream, *but returns the old one*. - -* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether - the current token is of a particular type or value (or both). The value may be an - array of several possible values. - -* ``expect($type[, $value[, $message]])``: If the current token isn't of the given - type/value a syntax error is thrown. Otherwise, if the type and value are correct, - the token is returned and the stream moves to the next token. - -* ``look()``: Looks at the next token without consuming it. - -Parsing expressions is done by calling the ``parseExpression()`` like we did for -the ``set`` tag. - -.. tip:: - - Reading the existing ``TokenParser`` classes is the best way to learn all - the nitty-gritty details of the parsing process. - -Defining a Node -~~~~~~~~~~~~~~~ - -The ``Project_Set_Node`` class itself is quite short:: - - class Project_Set_Node extends \Twig\Node\Node - { - public function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $line, $tag = null) - { - parent::__construct(['value' => $value], ['name' => $name], $line, $tag); - } - - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('$context[\''.$this->getAttribute('name').'\'] = ') - ->subcompile($this->getNode('value')) - ->raw(";\n") - ; - } - } - -The compiler implements a fluid interface and provides methods that helps the -developer generate beautiful and readable PHP code: - -* ``subcompile()``: Compiles a node. - -* ``raw()``: Writes the given string as is. - -* ``write()``: Writes the given string by adding indentation at the beginning - of each line. - -* ``string()``: Writes a quoted string. - -* ``repr()``: Writes a PHP representation of a given value (see - ``\Twig\Node\ForNode`` for a usage example). - -* ``addDebugInfo()``: Adds the line of the original template file related to - the current node as a comment. - -* ``indent()``: Indents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -* ``outdent()``: Outdents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -.. _creating_extensions: - -Creating an Extension ---------------------- - -The main motivation for writing an extension is to move often used code into a -reusable class like adding support for internationalization. An extension can -define tags, filters, tests, operators, functions, and node visitors. - -Most of the time, it is useful to create a single extension for your project, -to host all the specific tags and filters you want to add to Twig. - -.. tip:: - - When packaging your code into an extension, Twig is smart enough to - recompile your templates whenever you make a change to it (when - ``auto_reload`` is enabled). - -.. note:: - - Before writing your own extensions, have a look at the Twig official - extension repository: https://github.com/twigphp/Twig-extensions. - -An extension is a class that implements the following interface:: - - interface \Twig\Extension\ExtensionInterface - { - /** - * Returns the token parser instances to add to the existing list. - * - * @return \Twig\TokenParser\TokenParserInterface[] - */ - public function getTokenParsers(); - - /** - * Returns the node visitor instances to add to the existing list. - * - * @return \Twig\NodeVisitor\NodeVisitorInterface[] - */ - public function getNodeVisitors(); - - /** - * Returns a list of filters to add to the existing list. - * - * @return \Twig\TwigFilter[] - */ - public function getFilters(); - - /** - * Returns a list of tests to add to the existing list. - * - * @return \Twig\TwigTest[] - */ - public function getTests(); - - /** - * Returns a list of functions to add to the existing list. - * - * @return \Twig\TwigFunction[] - */ - public function getFunctions(); - - /** - * Returns a list of operators to add to the existing list. - * - * @return array First array of unary operators, second array of binary operators - */ - public function getOperators(); - } - -To keep your extension class clean and lean, inherit from the built-in -``\Twig\Extension\AbstractExtension`` class instead of implementing the interface as it provides -empty implementations for all methods: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - } - -This extension does nothing for now. We will customize it in the next sections. - -You can save your extension anywhere on the filesystem, as all extensions must -be registered explicitly to be available in your templates. - -You can register an extension by using the ``addExtension()`` method on your -main ``Environment`` object:: - - $twig = new \Twig\Environment($loader); - $twig->addExtension(new Project_Twig_Extension()); - -.. tip:: - - The Twig core extensions are great examples of how extensions work. - -Globals -~~~~~~~ - -Global variables can be registered in an extension via the ``getGlobals()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension implements \Twig\Extension\GlobalsInterface - { - public function getGlobals() - { - return [ - 'text' => new Text(), - ]; - } - - // ... - } - -Functions -~~~~~~~~~ - -Functions can be registered in an extension via the ``getFunctions()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('lipsum', 'generate_lipsum'), - ]; - } - - // ... - } - -Filters -~~~~~~~ - -To add a filter to an extension, you need to override the ``getFilters()`` -method. This method must return an array of filters to add to the Twig -environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFilters() - { - return [ - new \Twig\TwigFilter('rot13', 'str_rot13'), - ]; - } - - // ... - } - -Tags -~~~~ - -Adding a tag in an extension can be done by overriding the -``getTokenParsers()`` method. This method must return an array of tags to add -to the Twig environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTokenParsers() - { - return [new Project_Set_TokenParser()]; - } - - // ... - } - -In the above code, we have added a single new tag, defined by the -``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is -responsible for parsing the tag and compiling it to PHP. - -Operators -~~~~~~~~~ - -The ``getOperators()`` methods lets you add new operators. Here is how to add -the ``!``, ``||``, and ``&&`` operators:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getOperators() - { - return [ - [ - '!' => ['precedence' => 50, 'class' => \Twig\Node\Expression\Unary\NotUnary::class], - ], - [ - '||' => ['precedence' => 10, 'class' => \Twig\Node\Expression\Binary\OrBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - '&&' => ['precedence' => 15, 'class' => \Twig\Node\Expression\Binary\AndBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - ], - ]; - } - - // ... - } - -Tests -~~~~~ - -The ``getTests()`` method lets you add new test functions:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTests() - { - return [ - new \Twig\TwigTest('even', 'twig_test_even'), - ]; - } - - // ... - } - -Definition vs Runtime -~~~~~~~~~~~~~~~~~~~~~ - -Twig filters, functions, and tests runtime implementations can be defined as -any valid PHP callable: - -* **functions/static methods**: Simple to implement and fast (used by all Twig - core extensions); but it is hard for the runtime to depend on external - objects; - -* **closures**: Simple to implement; - -* **object methods**: More flexible and required if your runtime code depends - on external objects. - -The simplest way to use methods is to define them on the extension itself:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', [$this, 'rot13']), - ]; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - -This is very convenient but not recommended as it makes template compilation -depend on runtime dependencies even if they are not needed (think for instance -as a dependency that connects to a database engine). - -You can easily decouple the extension definitions from their runtime -implementations by registering a ``\Twig\RuntimeLoader\RuntimeLoaderInterface`` instance on -the environment that knows how to instantiate such runtime classes (runtime -classes must be autoload-able):: - - class RuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface - { - public function load($class) - { - // implement the logic to create an instance of $class - // and inject its dependencies - // most of the time, it means using your dependency injection container - if ('Project_Twig_RuntimeExtension' === $class) { - return new $class(new Rot13Provider()); - } else { - // ... - } - } - } - - $twig->addRuntimeLoader(new RuntimeLoader()); - -.. note:: - - Twig comes with a PSR-11 compatible runtime loader - (``\Twig\RuntimeLoader\ContainerRuntimeLoader``). - -It is now possible to move the runtime logic to a new -``Project_Twig_RuntimeExtension`` class and use it directly in the extension:: - - class Project_Twig_RuntimeExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', ['Project_Twig_RuntimeExtension', 'rot13']), - // or - new \Twig\TwigFunction('rot13', 'Project_Twig_RuntimeExtension::rot13'), - ]; - } - } - -Testing an Extension --------------------- - -Functional Tests -~~~~~~~~~~~~~~~~ - -You can create functional tests for extensions by creating the following file -structure in your test directory:: - - Fixtures/ - filters/ - foo.test - bar.test - functions/ - foo.test - bar.test - tags/ - foo.test - bar.test - IntegrationTest.php - -The ``IntegrationTest.php`` file should look like this:: - - class Project_Tests_IntegrationTest extends \Twig\Test\IntegrationTestCase - { - public function getExtensions() - { - return [ - new Project_Twig_Extension1(), - new Project_Twig_Extension2(), - ]; - } - - public function getFixturesDir() - { - return dirname(__FILE__).'/Fixtures/'; - } - } - -Fixtures examples can be found within the Twig repository -`tests/Twig/Fixtures`_ directory. - -Node Tests -~~~~~~~~~~ - -Testing the node visitors can be complex, so extend your test cases from -``\Twig\Test\NodeTestCase``. Examples can be found in the Twig repository -`tests/Twig/Node`_ directory. - -.. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Node diff --git a/system/backend/php/vendor/twig/twig/doc/api.rst b/system/backend/php/vendor/twig/twig/doc/api.rst deleted file mode 100644 index 5c0294c20b0..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/api.rst +++ /dev/null @@ -1,593 +0,0 @@ -Twig for Developers -=================== - -This chapter describes the API to Twig and not the template language. It will -be most useful as reference to those implementing the template interface to -the application and not those who are creating Twig templates. - -Basics ------- - -Twig uses a central object called the **environment** (of class -``\Twig\Environment``). Instances of this class are used to store the -configuration and extensions, and are used to load templates. - -Most applications create one ``\Twig\Environment`` object on application -initialization and use that to load templates. In some cases, it might be useful -to have multiple environments side by side, with different configurations. - -The typical way to configure Twig to load templates for an application looks -roughly like this:: - - require_once '/path/to/vendor/autoload.php'; - - $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates'); - $twig = new \Twig\Environment($loader, [ - 'cache' => '/path/to/compilation_cache', - ]); - -This creates a template environment with a default configuration and a loader -that looks up templates in the ``/path/to/templates/`` directory. Different -loaders are available and you can also write your own if you want to load -templates from a database or other resources. - -.. note:: - - Notice that the second argument of the environment is an array of options. - The ``cache`` option is a compilation cache directory, where Twig caches - the compiled templates to avoid the parsing phase for sub-sequent - requests. It is very different from the cache you might want to add for - the evaluated templates. For such a need, you can use any available PHP - cache library. - -Rendering Templates -------------------- - -To load a template from a Twig environment, call the ``load()`` method which -returns a ``\Twig\TemplateWrapper`` instance:: - - $template = $twig->load('index.html'); - -To render the template with some variables, call the ``render()`` method:: - - echo $template->render(['the' => 'variables', 'go' => 'here']); - -.. note:: - - The ``display()`` method is a shortcut to output the rendered template. - -You can also load and render the template in one fell swoop:: - - echo $twig->render('index.html', ['the' => 'variables', 'go' => 'here']); - -If a template defines blocks, they can be rendered individually via the -``renderBlock()`` call:: - - echo $template->renderBlock('block_name', ['the' => 'variables', 'go' => 'here']); - -.. _environment_options: - -Environment Options -------------------- - -When creating a new ``\Twig\Environment`` instance, you can pass an array of -options as the constructor second argument:: - - $twig = new \Twig\Environment($loader, ['debug' => true]); - -The following options are available: - -* ``debug`` *boolean* - - When set to ``true``, the generated templates have a - ``__toString()`` method that you can use to display the generated nodes - (default to ``false``). - -* ``charset`` *string* (defaults to ``utf-8``) - - The charset used by the templates. - -* ``base_template_class`` *string* (defaults to ``\Twig\Template``) - - The base template class to use for generated - templates. - -* ``cache`` *string* or ``false`` - - An absolute path where to store the compiled templates, or - ``false`` to disable caching (which is the default). - -* ``auto_reload`` *boolean* - - When developing with Twig, it's useful to recompile the - template whenever the source code changes. If you don't provide a value for - the ``auto_reload`` option, it will be determined automatically based on the - ``debug`` value. - -* ``strict_variables`` *boolean* - - If set to ``false``, Twig will silently ignore invalid - variables (variables and or attributes/methods that do not exist) and - replace them with a ``null`` value. When set to ``true``, Twig throws an - exception instead (default to ``false``). - -* ``autoescape`` *string* - - Sets the default auto-escaping strategy (``name``, ``html``, ``js``, ``css``, - ``url``, ``html_attr``, or a PHP callback that takes the template "filename" - and returns the escaping strategy to use -- the callback cannot be a function - name to avoid collision with built-in escaping strategies); set it to - ``false`` to disable auto-escaping. The ``name`` escaping strategy determines - the escaping strategy to use for a template based on the template filename - extension (this strategy does not incur any overhead at runtime as - auto-escaping is done at compilation time.) - -* ``optimizations`` *integer* - - A flag that indicates which optimizations to apply - (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to - disable). - -Loaders -------- - -Loaders are responsible for loading templates from a resource such as the file -system. - -Compilation Cache -~~~~~~~~~~~~~~~~~ - -All template loaders can cache the compiled templates on the filesystem for -future reuse. It speeds up Twig a lot as templates are only compiled once; and -the performance boost is even larger if you use a PHP accelerator such as -OPCache. See the ``cache`` and ``auto_reload`` options of ``\Twig\Environment`` -above for more information. - -Built-in Loaders -~~~~~~~~~~~~~~~~ - -Here is a list of the built-in loaders: - -``\Twig\Loader\FilesystemLoader`` -................................. - -``\Twig\Loader\FilesystemLoader`` loads templates from the file system. This loader -can find templates in folders on the file system and is the preferred way to -load them:: - - $loader = new \Twig\Loader\FilesystemLoader($templateDir); - -It can also look for templates in an array of directories:: - - $loader = new \Twig\Loader\FilesystemLoader([$templateDir1, $templateDir2]); - -With such a configuration, Twig will first look for templates in -``$templateDir1`` and if they do not exist, it will fallback to look for them -in the ``$templateDir2``. - -You can add or prepend paths via the ``addPath()`` and ``prependPath()`` -methods:: - - $loader->addPath($templateDir3); - $loader->prependPath($templateDir4); - -The filesystem loader also supports namespaced templates. This allows to group -your templates under different namespaces which have their own template paths. - -When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods, -specify the namespace as the second argument (when not specified, these -methods act on the "main" namespace):: - - $loader->addPath($templateDir, 'admin'); - -Namespaced templates can be accessed via the special -``@namespace_name/template_path`` notation:: - - $twig->render('@admin/index.html', []); - -``\Twig\Loader\FilesystemLoader`` support absolute and relative paths. Using relative -paths is preferred as it makes the cache keys independent of the project root -directory (for instance, it allows warming the cache from a build server where -the directory might be different from the one used on production servers):: - - $loader = new \Twig\Loader\FilesystemLoader('templates', getcwd().'/..'); - -.. note:: - - When not passing the root path as a second argument, Twig uses ``getcwd()`` - for relative paths. - -``\Twig\Loader\ArrayLoader`` -............................ - -``\Twig\Loader\ArrayLoader`` loads a template from a PHP array. It is passed an -array of strings bound to template names:: - - $loader = new \Twig\Loader\ArrayLoader([ - 'index.html' => 'Hello {{ name }}!', - ]); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.html', ['name' => 'Fabien']); - -This loader is very useful for unit testing. It can also be used for small -projects where storing all templates in a single PHP file might make sense. - -.. tip:: - - When using the ``Array`` loader with a cache mechanism, you should know that - a new cache key is generated each time a template content "changes" (the - cache key being the source code of the template). If you don't want to see - your cache grows out of control, you need to take care of clearing the old - cache file by yourself. - -``\Twig\Loader\ChainLoader`` -............................ - -``\Twig\Loader\ChainLoader`` delegates the loading of templates to other loaders:: - - $loader1 = new \Twig\Loader\ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - ]); - $loader2 = new \Twig\Loader\ArrayLoader([ - 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}', - 'base.html' => 'Will never be loaded', - ]); - - $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]); - - $twig = new \Twig\Environment($loader); - -When looking for a template, Twig tries each loader in turn and returns as soon -as the template is found. When rendering the ``index.html`` template from the -above example, Twig will load it with ``$loader2`` but the ``base.html`` -template will be loaded from ``$loader1``. - -.. note:: - - You can also add loaders via the ``addLoader()`` method. - -Create your own Loader -~~~~~~~~~~~~~~~~~~~~~~ - -All loaders implement the ``\Twig\Loader\LoaderInterface``:: - - interface \Twig\Loader\LoaderInterface - { - /** - * Returns the source context for a given template logical name. - * - * @param string $name The template logical name - * - * @return \Twig\Source - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getSourceContext($name); - - /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getCacheKey($name); - - /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template - * - * @return bool true if the template is fresh, false otherwise - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function isFresh($name, $time); - - /** - * Check if we have the source code of a template, given its name. - * - * @param string $name The name of the template to check if we can load - * - * @return bool If the template source code is handled by this loader or not - */ - public function exists($name); - } - -The ``isFresh()`` method must return ``true`` if the current cached template -is still fresh, given the last modification time, or ``false`` otherwise. - -The ``getSourceContext()`` method must return an instance of ``\Twig\Source``. - -Using Extensions ----------------- - -Twig extensions are packages that add new features to Twig. Register an -extension via the ``addExtension()`` method:: - - $twig->addExtension(new \Twig\Extension\SandboxExtension()); - -Twig comes bundled with the following extensions: - -* *Twig\Extension\CoreExtension*: Defines all the core features of Twig. - -* *Twig\Extension\DebugExtension*: Defines the ``dump`` function to help debug - template variables. - -* *Twig\Extension\EscaperExtension*: Adds automatic output-escaping and the - possibility to escape/unescape blocks of code. - -* *Twig\Extension\SandboxExtension*: Adds a sandbox mode to the default Twig - environment, making it safe to evaluate untrusted code. - -* *Twig\Extension\ProfilerExtension*: Enabled the built-in Twig profiler. - -* *Twig\Extension\OptimizerExtension*: Optimizes the node tree before - compilation. - -* *Twig\Extension\StringLoaderExtension*: Defined the ``template_from_string`` - function to allow loading templates from string in a template. - -The Core, Escaper, and Optimizer extensions are registered by default. - -Built-in Extensions -------------------- - -This section describes the features added by the built-in extensions. - -.. tip:: - - Read the chapter about extending Twig to learn how to create your own - extensions. - -Core Extension -~~~~~~~~~~~~~~ - -The ``core`` extension defines all the core features of Twig: - -* :doc:`Tags `; -* :doc:`Filters `; -* :doc:`Functions `; -* :doc:`Tests `. - -Escaper Extension -~~~~~~~~~~~~~~~~~ - -The ``escaper`` extension adds automatic output escaping to Twig. It defines a -tag, ``autoescape``, and a filter, ``raw``. - -When creating the escaper extension, you can switch on or off the global -output escaping strategy:: - - $escaper = new \Twig\Extension\EscaperExtension('html'); - $twig->addExtension($escaper); - -If set to ``html``, all variables in templates are escaped (using the ``html`` -escaping strategy), except those using the ``raw`` filter: - -.. code-block:: twig - - {{ article.to_html|raw }} - -You can also change the escaping mode locally by using the ``autoescape`` tag: - -.. code-block:: twig - - {% autoescape 'html' %} - {{ var }} - {{ var|raw }} {# var won't be escaped #} - {{ var|escape }} {# var won't be double-escaped #} - {% endautoescape %} - -.. warning:: - - The ``autoescape`` tag has no effect on included files. - -The escaping rules are implemented as follows: - -* Literals (integers, booleans, arrays, ...) used in the template directly as - variables or filter arguments are never automatically escaped: - - .. code-block:: twig - - {{ "Twig
" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ text }} {# will be escaped #} - -* Expressions which the result is always a literal or a variable marked safe - are never automatically escaped: - - .. code-block:: twig - - {{ foo ? "Twig
" : "
Twig" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ foo ? text : "
Twig" }} {# will be escaped #} - - {% set text = "Twig
" %} - {{ foo ? text|raw : "
Twig" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ foo ? text|escape : "
Twig" }} {# the result of the expression won't be escaped #} - -* Objects with a ``__toString`` method are converted to strings and - escaped. You can mark some classes and/or interfaces as being safe for some - strategies via ``EscaperExtension::addSafeClass()``: - - .. code-block:: twig - - // mark object of class Foo as safe for the HTML strategy - $escaper->addSafeClass('Foo', ['html']); - - // mark object of interface Foo as safe for the HTML strategy - $escaper->addSafeClass('FooInterface', ['html']); - - // mark object of class Foo as safe for the HTML and JS strategies - $escaper->addSafeClass('Foo', ['html', 'js']); - - // mark object of class Foo as safe for all strategies - $escaper->addSafeClass('Foo', ['all']); - -* Escaping is applied before printing, after any other filter is applied: - - .. code-block:: twig - - {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #} - -* The `raw` filter should only be used at the end of the filter chain: - - .. code-block:: twig - - {{ var|raw|upper }} {# will be escaped #} - - {{ var|upper|raw }} {# won't be escaped #} - -* Automatic escaping is not applied if the last filter in the chain is marked - safe for the current context (e.g. ``html`` or ``js``). ``escape`` and - ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked - safe for JavaScript, ``raw`` is marked safe for everything. - - .. code-block:: twig - - {% autoescape 'js' %} - {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #} - {{ var }} {# will be escaped for JavaScript #} - {{ var|escape('js') }} {# won't be double-escaped #} - {% endautoescape %} - -.. note:: - - Note that autoescaping has some limitations as escaping is applied on - expressions after evaluation. For instance, when working with - concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as - escaping is applied on the result of the concatenation, not on the - individual variables (so, the ``raw`` filter won't have any effect here). - -Sandbox Extension -~~~~~~~~~~~~~~~~~ - -The ``sandbox`` extension can be used to evaluate untrusted code. Access to -unsafe attributes and methods is prohibited. The sandbox security is managed -by a policy instance. By default, Twig comes with one policy class: -``\Twig\Sandbox\SecurityPolicy``. This class allows you to white-list some -tags, filters, properties, and methods:: - - $tags = ['if']; - $filters = ['upper']; - $methods = [ - 'Article' => ['getTitle', 'getBody'], - ]; - $properties = [ - 'Article' => ['title', 'body'], - ]; - $functions = ['range']; - $policy = new \Twig\Sandbox\SecurityPolicy($tags, $filters, $methods, $properties, $functions); - -With the previous configuration, the security policy will only allow usage of -the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be -able to call the ``getTitle()`` and ``getBody()`` methods on ``Article`` -objects, and the ``title`` and ``body`` public properties. Everything else -won't be allowed and will generate a ``\Twig\Sandbox\SecurityError`` exception. - -The policy object is the first argument of the sandbox constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy); - $twig->addExtension($sandbox); - -By default, the sandbox mode is disabled and should be enabled when including -untrusted template code by using the ``sandbox`` tag: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -You can sandbox all templates by passing ``true`` as the second argument of -the extension constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy, true); - -Profiler Extension -~~~~~~~~~~~~~~~~~~ - -The ``profiler`` extension enables a profiler for Twig templates; it should -only be used on your development machines as it adds some overhead:: - - $profile = new \Twig\Profiler\Profile(); - $twig->addExtension(new \Twig\Extension\ProfilerExtension($profile)); - - $dumper = new \Twig\Profiler\Dumper\TextDumper(); - echo $dumper->dump($profile); - -A profile contains information about time and memory consumption for template, -block, and macro executions. - -You can also dump the data in a `Blackfire.io `_ -compatible format:: - - $dumper = new \Twig\Profiler\Dumper\BlackfireDumper(); - file_put_contents('/path/to/profile.prof', $dumper->dump($profile)); - -Upload the profile to visualize it (create a `free account -`_ -first): - -.. code-block:: sh - - blackfire --slot=7 upload /path/to/profile.prof - -Optimizer Extension -~~~~~~~~~~~~~~~~~~~ - -The ``optimizer`` extension optimizes the node tree before compilation:: - - $twig->addExtension(new \Twig\Extension\OptimizerExtension()); - -By default, all optimizations are turned on. You can select the ones you want -to enable by passing them to the constructor:: - - $optimizer = new \Twig\Extension\OptimizerExtension(\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR); - - $twig->addExtension($optimizer); - -Twig supports the following optimizations: - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_ALL``, enables all optimizations - (this is the default value). - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_NONE``, disables all optimizations. - This reduces the compilation time, but it can increase the execution time - and the consumed memory. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR``, optimizes the ``for`` tag by - removing the ``loop`` variable creation whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER``, removes the ``raw`` - filter whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_VAR_ACCESS``, simplifies the creation - and access of variables in the compiled templates whenever possible. - -Exceptions ----------- - -Twig can throw exceptions: - -* ``\Twig\Error\Error``: The base exception for all errors. - -* ``\Twig\Error\SyntaxError``: Thrown to tell the user that there is a problem with - the template syntax. - -* ``\Twig\Error\RuntimeError``: Thrown when an error occurs at runtime (when a filter - does not exist for instance). - -* ``\Twig\Error\LoaderError``: Thrown when an error occurs during template loading. - -* ``\Twig\Sandbox\SecurityError``: Thrown when an unallowed tag, filter, or - method is called in a sandboxed template. diff --git a/system/backend/php/vendor/twig/twig/doc/coding_standards.rst b/system/backend/php/vendor/twig/twig/doc/coding_standards.rst deleted file mode 100644 index 721b0f13aaf..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/coding_standards.rst +++ /dev/null @@ -1,101 +0,0 @@ -Coding Standards -================ - -When writing Twig templates, we recommend you to follow these official coding -standards: - -* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``, - and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``): - - .. code-block:: twig - - {{ foo }} - {# comment #} - {% if foo %}{% endif %} - - When using the whitespace control character, do not put any spaces between - it and the delimiter: - - .. code-block:: twig - - {{- foo -}} - {#- comment -#} - {%- if foo -%}{%- endif -%} - -* Put one (and only one) space before and after the following operators: - comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math - operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic - operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary - operator (``?:``): - - .. code-block:: twig - - {{ 1 + 2 }} - {{ foo ~ bar }} - {{ true ? true : false }} - -* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in - arrays and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Do not put any spaces after an opening parenthesis and before a closing - parenthesis in expressions: - - .. code-block:: twig - - {{ 1 + (2 * 3) }} - -* Do not put any spaces before and after string delimiters: - - .. code-block:: twig - - {{ 'foo' }} - {{ "foo" }} - -* Do not put any spaces before and after the following operators: ``|``, - ``.``, ``..``, ``[]``: - - .. code-block:: twig - - {{ foo|upper|lower }} - {{ user.name }} - {{ user[name] }} - {% for i in 1..12 %}{% endfor %} - -* Do not put any spaces before and after the parenthesis used for filter and - function calls: - - .. code-block:: twig - - {{ foo|default('foo') }} - {{ range(1..10) }} - -* Do not put any spaces before and after the opening and the closing of arrays - and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Use lower cased and underscored variable names: - - .. code-block:: twig - - {% set foo = 'foo' %} - {% set foo_bar = 'foo' %} - -* Indent your code inside tags (use the same indentation as the one used for - the target language of the rendered template): - - .. code-block:: twig - - {% block foo %} - {% if true %} - true - {% endif %} - {% endblock %} diff --git a/system/backend/php/vendor/twig/twig/doc/deprecated.rst b/system/backend/php/vendor/twig/twig/doc/deprecated.rst deleted file mode 100644 index d7a6145ed4d..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/deprecated.rst +++ /dev/null @@ -1,115 +0,0 @@ -Deprecated Features -=================== - -This document lists deprecated features in Twig 2.x. Deprecated features are -kept for backward compatibility and removed in the next major release (a -feature that was deprecated in Twig 2.x is removed in Twig 3.0). - -PSR-0 ------ - -* PSR-0 classes are deprecated in favor of namespaced ones since Twig 2.7. - -Inheritance ------------ - -* Defining a "block" definition in a non-capturing block in a child template is - deprecated since Twig 2.5.0. In Twig 3.0, it will throw a - ``Twig\Error\SyntaxError`` exception. It does not work anyway, so most - projects won't need to do anything to upgrade. - -Errors ------- - - * Passing a string as the ``$source`` argument on ``\Twig\Error\Error`` / - ``Twig\Error\Error`` constructor is deprecated since Twig 2.6.1. Pass an - instance of ``Twig\Source`` instead. - -Tags ----- - -* The ``spaceless`` tag is deprecated in Twig 2.7. Use the ``spaceless`` filter - instead or ``{% apply spaceless %}`` (the ``Twig\Node\SpacelessNode`` and - ``Twig\TokenParser\SpacelessTokenParser`` classes are also deprecated). - -* Using the ``spaceless`` tag at the root level of a child template is - deprecated in Twig 2.5.0. This does not work as one would expect it to work - anyway. In Twig 3.0, it will throw a ``Twig\Error\SyntaxError`` exception. - -* The ``filter`` tag is deprecated in Twig 2.9. Use the ``apply`` tag instead - (the ``Twig\TokenParser\FilterTokenParser`` classes is also deprecated). - -* Adding an ``if`` condition on a ``for`` tag is deprecated in Twig 2.10. Use a - ``filter`` filter or an "if" condition inside the "for" body instead (if your condition - depends on a variable updated inside the loop) - -Final Classes -------------- - -The following classes are marked as ``@final`` in Twig 2 and will be final in -3.0: - -* ``Twig\Node\ModuleNode`` -* ``Twig\TwigFilter`` -* ``Twig\TwigFunction`` -* ``Twig\TwigTest`` -* ``Twig\Profiler\Profile`` - -Parser ------- - -* As of Twig 2.7, the ``\Twig\Parser::isReservedMacroName()`` / ``Twig\Parser`` - function is deprecated and will be removed in Twig 3.0. It always returns - ``false`` anyway as Twig 2 does not have any reserved macro names. - -Environment ------------ - -* As of Twig 2.7, the ``base_template_class`` option on ``Twig\Environment`` is - deprecated and will be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Environment::getBaseTemplateClass()`` and - ``Twig\Environment::setBaseTemplateClass()`` methods are deprecated and will - be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Environment::getTemplateClass()`` is marked as - being internal and should not be used. - -* As of Twig 2.7, passing a ``Twig\Template`` instance to the - ``Twig\Environment::load()`` and ``Twig\Environment::resolveTemplate()`` is - deprecated. - -* Depending on the input, ``Twig\Environment::resolveTemplate()`` can return - a ``Twig\Template`` or a ``Twig\TemplateWrapper`` instance. In Twig 3.0, this - method will **always** return a ``Twig\TemplateWrapper`` instance. You should - only rely on the methods of this class if you want to be forward-compatible. - -Interfaces ----------- - -* As of Twig 2.7, the empty ``Twig\Loader\ExistsLoaderInterface`` interface is - deprecated and will be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Extension\InitRuntimeInterface`` interface is - deprecated and will be removed in Twig 3.0. - -Extensions ----------- - -* As of Twig 2.11, the ``Twig\Extension\CoreExtension::setEscaper()`` and - ``Twig\Extension\CoreExtension::getEscapers()`` are deprecated. Use the same - methods on ``Twig\Extension\EscaperExtension`` instead. - -Miscellaneous -------------- - -* As of Twig 2.7, the ``Twig_SimpleFilter``, ``Twig_SimpleFunction``, and - ``Twig_SimpleTest`` empty classes are deprecated and will be removed in Twig - 3.0. Use ``Twig\TwigFilter``, ``Twig\TwigFunction``, and ``Twig\TwigTest`` - respectively. - -* As of Twig 2.8.2, all usage of - ``Twig\Loader\FilesystemLoader::findTemplate()`` check for a ``null`` return - value (same meaning as returning ``false``). If you are overidding - ``Twig\Loader\FilesystemLoader::findTemplate()``, you must return ``null`` instead of ``false`` - to be compatible with Twig 3.0. diff --git a/system/backend/php/vendor/twig/twig/doc/filters/abs.rst b/system/backend/php/vendor/twig/twig/doc/filters/abs.rst deleted file mode 100644 index 77d5cf05495..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/abs.rst +++ /dev/null @@ -1,18 +0,0 @@ -``abs`` -======= - -The ``abs`` filter returns the absolute value. - -.. code-block:: twig - - {# number = -5 #} - - {{ number|abs }} - - {# outputs 5 #} - -.. note:: - - Internally, Twig uses the PHP `abs`_ function. - -.. _`abs`: https://secure.php.net/abs diff --git a/system/backend/php/vendor/twig/twig/doc/filters/batch.rst b/system/backend/php/vendor/twig/twig/doc/filters/batch.rst deleted file mode 100644 index 2f936c15e5e..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/batch.rst +++ /dev/null @@ -1,48 +0,0 @@ -``batch`` -========= - -The ``batch`` filter "batches" items by returning a list of lists with the -given number of items. A second parameter can be provided and used to fill in -missing items: - -.. code-block:: twig - - {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %} - - - {% for row in items|batch(3, 'No item') %} - - {% for column in row %} - - {% endfor %} - - {% endfor %} -
{{ column }}
- -The above example will be rendered as: - -.. code-block:: twig - - - - - - - - - - - - - - - - - -
abc
def
gNo itemNo item
- -Arguments ---------- - -* ``size``: The size of the batch; fractional numbers will be rounded up -* ``fill``: Used to fill in missing items diff --git a/system/backend/php/vendor/twig/twig/doc/filters/capitalize.rst b/system/backend/php/vendor/twig/twig/doc/filters/capitalize.rst deleted file mode 100644 index 2353658bf15..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/capitalize.rst +++ /dev/null @@ -1,11 +0,0 @@ -``capitalize`` -============== - -The ``capitalize`` filter capitalizes a value. The first character will be -uppercase, all others lowercase: - -.. code-block:: twig - - {{ 'my first car'|capitalize }} - - {# outputs 'My first car' #} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/column.rst b/system/backend/php/vendor/twig/twig/doc/filters/column.rst deleted file mode 100644 index 97a3037dce2..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/column.rst +++ /dev/null @@ -1,27 +0,0 @@ -``column`` -========== - -.. versionadded:: 2.8 - The ``column`` filter was added in Twig 2.8. - -The ``column`` filter returns the values from a single column in the input -array. - -.. code-block:: twig - - {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %} - - {% set fruits = items|column('fruit') %} - - {# fruits now contains ['apple', 'orange'] #} - -.. note:: - - Internally, Twig uses the PHP `array_column`_ function. - -Arguments ---------- - -* ``name``: The column name to extract - -.. _`array_column`: https://secure.php.net/array_column diff --git a/system/backend/php/vendor/twig/twig/doc/filters/convert_encoding.rst b/system/backend/php/vendor/twig/twig/doc/filters/convert_encoding.rst deleted file mode 100644 index d977c752c8e..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/convert_encoding.rst +++ /dev/null @@ -1,22 +0,0 @@ -``convert_encoding`` -==================== - -The ``convert_encoding`` filter converts a string from one encoding to -another. The first argument is the expected output charset and the second one -is the input charset: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - -.. note:: - - This filter relies on the `iconv`_ extension. - -Arguments ---------- - -* ``to``: The output charset -* ``from``: The input charset - -.. _`iconv`: https://secure.php.net/iconv diff --git a/system/backend/php/vendor/twig/twig/doc/filters/date.rst b/system/backend/php/vendor/twig/twig/doc/filters/date.rst deleted file mode 100644 index 195e8523612..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/date.rst +++ /dev/null @@ -1,82 +0,0 @@ -``date`` -======== - -The ``date`` filter formats a date to a given format: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y") }} - -The format specifier is the same as supported by `date`_, -except when the filtered data is of type `DateInterval`_, when the format must conform to -`DateInterval::format`_ instead. - -The ``date`` filter accepts strings (it must be in a format supported by the -`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For -instance, to display the current date, filter the word "now": - -.. code-block:: twig - - {{ "now"|date("m/d/Y") }} - -To escape words and characters in the date format use ``\\`` in front of each -character: - -.. code-block:: twig - - {{ post.published_at|date("F jS \\a\\t g:ia") }} - -If the value passed to the ``date`` filter is ``null``, it will return the -current date by default. If an empty string is desired instead of the current -date, use a ternary operator: - -.. code-block:: twig - - {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} - -If no format is provided, Twig will use the default one: ``F j, Y H:i``. This -default can be easily changed by calling the ``setDateFormat()`` method on the -``core`` extension instance. The first argument is the default format for -dates and the second one is the default format for date intervals: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setDateFormat('d/m/Y', '%d days'); - -Timezone --------- - -By default, the date is displayed by applying the default timezone (the one -specified in php.ini or declared in Twig -- see below), but you can override -it by explicitly specifying a timezone: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", "Europe/Paris") }} - -If the date is already a DateTime object, and if you want to keep its current -timezone, pass ``false`` as the timezone value: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", false) }} - -The default timezone can also be set globally by calling ``setTimezone()``: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``format``: The date format -* ``timezone``: The date timezone - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime -.. _`DateInterval`: https://secure.php.net/DateInterval -.. _`date`: https://secure.php.net/date -.. _`DateInterval::format`: https://secure.php.net/DateInterval.format diff --git a/system/backend/php/vendor/twig/twig/doc/filters/date_modify.rst b/system/backend/php/vendor/twig/twig/doc/filters/date_modify.rst deleted file mode 100644 index 5668f9e0584..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/date_modify.rst +++ /dev/null @@ -1,20 +0,0 @@ -``date_modify`` -=============== - -The ``date_modify`` filter modifies a date with a given modifier string: - -.. code-block:: twig - - {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }} - -The ``date_modify`` filter accepts strings (it must be in a format supported -by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine -it with the :doc:`date` filter for formatting. - -Arguments ---------- - -* ``modifier``: The modifier - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime diff --git a/system/backend/php/vendor/twig/twig/doc/filters/default.rst b/system/backend/php/vendor/twig/twig/doc/filters/default.rst deleted file mode 100644 index c4ccb56a500..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/default.rst +++ /dev/null @@ -1,33 +0,0 @@ -``default`` -=========== - -The ``default`` filter returns the passed default value if the value is -undefined or empty, otherwise the value of the variable: - -.. code-block:: twig - - {{ var|default('var is not defined') }} - - {{ var.foo|default('foo item on var is not defined') }} - - {{ var['foo']|default('foo item on var is not defined') }} - - {{ ''|default('passed var is empty') }} - -When using the ``default`` filter on an expression that uses variables in some -method calls, be sure to use the ``default`` filter whenever a variable can be -undefined: - -.. code-block:: twig - - {{ var.method(foo|default('foo'))|default('foo') }} - -.. note:: - - Read the documentation for the :doc:`defined<../tests/defined>` and - :doc:`empty<../tests/empty>` tests to learn more about their semantics. - -Arguments ---------- - -* ``default``: The default value diff --git a/system/backend/php/vendor/twig/twig/doc/filters/escape.rst b/system/backend/php/vendor/twig/twig/doc/filters/escape.rst deleted file mode 100644 index 7c654ab60a1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/escape.rst +++ /dev/null @@ -1,119 +0,0 @@ -``escape`` -========== - -The ``escape`` filter escapes a string using strategies that depend on the -context. - -By default, it uses the HTML escaping strategy: - -.. code-block:: html+twig - -

- {{ user.username|escape }} -

- -For convenience, the ``e`` filter is defined as an alias: - -.. code-block:: html+twig - -

- {{ user.username|e }} -

- -The ``escape`` filter can also be used in other contexts than HTML thanks to -an optional argument which defines the escaping strategy to use: - -.. code-block:: twig - - {{ user.username|e }} - {# is equivalent to #} - {{ user.username|e('html') }} - -And here is how to escape variables included in JavaScript code: - -.. code-block:: twig - - {{ user.username|escape('js') }} - {{ user.username|e('js') }} - -The ``escape`` filter supports the following escaping strategies for HTML -documents: - -* ``html``: escapes a string for the **HTML body** context. - -* ``js``: escapes a string for the **JavaScript** context. - -* ``css``: escapes a string for the **CSS** context. CSS escaping can be - applied to any string being inserted into CSS and escapes everything except - alphanumerics. - -* ``url``: escapes a string for the **URI or parameter** contexts. This should - not be used to escape an entire URI; only a subcomponent being inserted. - -* ``html_attr``: escapes a string for the **HTML attribute** context. - -Note that doing contextual escaping in HTML documents is hard and choosing the -right escaping strategy depends on a lot of factors. Please, read related -documentation like `the OWASP prevention cheat sheet -`_ -to learn more about this topic. - -.. note:: - - Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function - for the HTML escaping strategy. - -.. caution:: - - When using automatic escaping, Twig tries to not double-escape a variable - when the automatic escaping strategy is the same as the one applied by the - escape filter; but that does not work when using a variable as the - escaping strategy: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape('html') }} {# won't be double-escaped #} - {{ var|escape(strategy) }} {# will be double-escaped #} - {% endautoescape %} - - When using a variable as the escaping strategy, you should disable - automatic escaping: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape(strategy)|raw }} {# won't be double-escaped #} - {% endautoescape %} - -Custom Escapers ---------------- - -You can define custom escapers by calling the ``setEscaper()`` method on the -``core`` extension instance. The first argument is the escaper name (to be -used in the ``escape`` call) and the second one must be a valid PHP callable: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setEscaper('csv', 'csv_escaper'); - -When called by Twig, the callable receives the Twig environment instance, the -string to escape, and the charset. - -.. note:: - - Built-in escapers cannot be overridden mainly because they should be - considered as the final implementation and also for better performance. - -Arguments ---------- - -* ``strategy``: The escaping strategy -* ``charset``: The string charset - -.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars diff --git a/system/backend/php/vendor/twig/twig/doc/filters/filter.rst b/system/backend/php/vendor/twig/twig/doc/filters/filter.rst deleted file mode 100644 index 310e63a73e4..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/filter.rst +++ /dev/null @@ -1,58 +0,0 @@ -``filter`` -========= - -.. versionadded:: 1.41 - The ``filter`` filter was added in Twig 1.41 and 2.10. - -The ``filter`` filter filters elements of a sequence or a mapping using an arrow -function. The arrow function receives the value of the sequence or mapping: - -.. code-block:: twig - - {% set sizes = [34, 36, 38, 40, 42] %} - - {{ sizes|filter(v => v > 38)|join(', ') }} - {# output 40, 42 #} - -Combined with the ``for`` tag, it allows to filter the items to iterate over: - -.. code-block:: twig - - {% for v in sizes|filter(v => v > 38) -%} - {{ v }} - {% endfor %} - {# output 40 42 #} - -It also works with mappings: - -.. code-block:: twig - - {% set sizes = { - xs: 34, - s: 36, - m: 38, - l: 40, - xl: 42, - } %} - - {% for k, v in sizes|filter(v => v > 38) -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 xl = 42 #} - -The arrow function also receives the key as a second argument: - -.. code-block:: twig - - {% for k, v in sizes|filter((v, k) => v > 38 and k != "xl") -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``array``: The sequence or mapping -* ``arrow``: The arrow function diff --git a/system/backend/php/vendor/twig/twig/doc/filters/first.rst b/system/backend/php/vendor/twig/twig/doc/filters/first.rst deleted file mode 100644 index 8d7081a53f1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/first.rst +++ /dev/null @@ -1,22 +0,0 @@ -``first`` -========= - -The ``first`` filter returns the first "element" of a sequence, a mapping, or -a string: - -.. code-block:: twig - - {{ [1, 2, 3, 4]|first }} - {# outputs 1 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|first }} - {# outputs 1 #} - - {{ '1234'|first }} - {# outputs 1 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php diff --git a/system/backend/php/vendor/twig/twig/doc/filters/format.rst b/system/backend/php/vendor/twig/twig/doc/filters/format.rst deleted file mode 100644 index c0c96ee3f54..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/format.rst +++ /dev/null @@ -1,16 +0,0 @@ -``format`` -========== - -The ``format`` filter formats a given string by replacing the placeholders -(placeholders follows the `sprintf`_ notation): - -.. code-block:: twig - - {{ "I like %s and %s."|format(foo, "bar") }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - -.. _`sprintf`: https://secure.php.net/sprintf - -.. seealso:: :doc:`replace` diff --git a/system/backend/php/vendor/twig/twig/doc/filters/index.rst b/system/backend/php/vendor/twig/twig/doc/filters/index.rst deleted file mode 100644 index f3468f683c9..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/index.rst +++ /dev/null @@ -1,42 +0,0 @@ -Filters -======= - -.. toctree:: - :maxdepth: 1 - - abs - batch - capitalize - column - convert_encoding - date - date_modify - default - escape - filter - first - format - join - json_encode - keys - last - length - lower - map - merge - nl2br - number_format - raw - reduce - replace - reverse - round - slice - sort - spaceless - split - striptags - title - trim - upper - url_encode diff --git a/system/backend/php/vendor/twig/twig/doc/filters/join.rst b/system/backend/php/vendor/twig/twig/doc/filters/join.rst deleted file mode 100644 index a9ea147e404..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/join.rst +++ /dev/null @@ -1,35 +0,0 @@ -``join`` -======== - -.. versionadded:: 2.6.1 - The ``and`` argument was added in Twig 2.6.1. - -The ``join`` filter returns a string which is the concatenation of the items -of a sequence: - -.. code-block:: twig - - {{ [1, 2, 3]|join }} - {# returns 123 #} - -The separator between elements is an empty string per default, but you can -define it with the optional first parameter: - -.. code-block:: twig - - {{ [1, 2, 3]|join('|') }} - {# outputs 1|2|3 #} - -A second parameter can also be provided that will be the separator used between -the last two items of the sequence: - -.. code-block:: twig - - {{ [1, 2, 3]|join(', ', ' and ') }} - {# outputs 1, 2 and 3 #} - -Arguments ---------- - -* ``glue``: The separator -* ``and``: The separator for the last pair of input items diff --git a/system/backend/php/vendor/twig/twig/doc/filters/json_encode.rst b/system/backend/php/vendor/twig/twig/doc/filters/json_encode.rst deleted file mode 100644 index 434e2f17832..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/json_encode.rst +++ /dev/null @@ -1,23 +0,0 @@ -``json_encode`` -=============== - -The ``json_encode`` filter returns the JSON representation of a value: - -.. code-block:: twig - - {{ data|json_encode() }} - -.. note:: - - Internally, Twig uses the PHP `json_encode`_ function. - -Arguments ---------- - -* ``options``: A bitmask of `json_encode options`_: ``{{ - data|json_encode(constant('JSON_PRETTY_PRINT')) }}``. - Combine constants using :ref:`bitwise operators`: - ``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT')) }}`` - -.. _`json_encode`: https://secure.php.net/json_encode -.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php diff --git a/system/backend/php/vendor/twig/twig/doc/filters/keys.rst b/system/backend/php/vendor/twig/twig/doc/filters/keys.rst deleted file mode 100644 index 58609471720..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/keys.rst +++ /dev/null @@ -1,11 +0,0 @@ -``keys`` -======== - -The ``keys`` filter returns the keys of an array. It is useful when you want to -iterate over the keys of an array: - -.. code-block:: twig - - {% for key in array|keys %} - ... - {% endfor %} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/last.rst b/system/backend/php/vendor/twig/twig/doc/filters/last.rst deleted file mode 100644 index 2b7c45bd167..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/last.rst +++ /dev/null @@ -1,22 +0,0 @@ -``last`` -======== - -The ``last`` filter returns the last "element" of a sequence, a mapping, or -a string: - -.. code-block:: twig - - {{ [1, 2, 3, 4]|last }} - {# outputs 4 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|last }} - {# outputs 4 #} - - {{ '1234'|last }} - {# outputs 4 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php diff --git a/system/backend/php/vendor/twig/twig/doc/filters/length.rst b/system/backend/php/vendor/twig/twig/doc/filters/length.rst deleted file mode 100644 index 3ea6d1a65d3..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/length.rst +++ /dev/null @@ -1,23 +0,0 @@ -``length`` -========== - -.. versionadded:: 2.3 - - Support for the ``__toString()`` magic method has been added in Twig 2.3. - -The ``length`` filter returns the number of items of a sequence or mapping, or -the length of a string. - -For objects that implement the ``Countable`` interface, ``length`` will use the -return value of the ``count()`` method. - -For objects that implement the ``__toString()`` magic method (and not ``Countable``), -it will return the length of the string provided by that method. - -For objects that implement the ``IteratorAggregate`` interface, ``length`` will use the return value of the ``iterator_count()`` method. - -.. code-block:: twig - - {% if users|length > 10 %} - ... - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/lower.rst b/system/backend/php/vendor/twig/twig/doc/filters/lower.rst deleted file mode 100644 index c0a0e0cddf4..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/lower.rst +++ /dev/null @@ -1,10 +0,0 @@ -``lower`` -========= - -The ``lower`` filter converts a value to lowercase: - -.. code-block:: twig - - {{ 'WELCOME'|lower }} - - {# outputs 'welcome' #} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/map.rst b/system/backend/php/vendor/twig/twig/doc/filters/map.rst deleted file mode 100644 index 777b05a7c34..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/map.rst +++ /dev/null @@ -1,38 +0,0 @@ -``map`` -======= - -.. versionadded:: 1.41 - The ``map`` filter was added in Twig 1.41 and 2.10. - -The ``map`` filter applies an arrow function to the elements of a sequence or a -mapping. The arrow function receives the value of the sequence or mapping: - -.. code-block:: twig - - {% set people = [ - {first: "Bob", last: "Smith"}, - {first: "Alice", last: "Dupond"}, - ] %} - - {{ people|map(p => "#{p.first} #{p.last}")|join(', ') }} - {# outputs Bob Smith, Alice Dupond #} - -The arrow function also receives the key as a second argument: - -.. code-block:: twig - - {% set people = { - "Bob": "Smith", - "Alice": "Dupond", - } %} - - {{ people|map((first, last) => "#{first} #{last}")|join(', ') }} - {# outputs Bob Smith, Alice Dupond #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``array``: The sequence or mapping -* ``arrow``: The arrow function diff --git a/system/backend/php/vendor/twig/twig/doc/filters/merge.rst b/system/backend/php/vendor/twig/twig/doc/filters/merge.rst deleted file mode 100644 index e26e51c242b..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/merge.rst +++ /dev/null @@ -1,48 +0,0 @@ -``merge`` -========= - -The ``merge`` filter merges an array with another array: - -.. code-block:: twig - - {% set values = [1, 2] %} - - {% set values = values|merge(['apple', 'orange']) %} - - {# values now contains [1, 2, 'apple', 'orange'] #} - -New values are added at the end of the existing ones. - -The ``merge`` filter also works on hashes: - -.. code-block:: twig - - {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %} - - {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #} - -For hashes, the merging process occurs on the keys: if the key does not -already exist, it is added but if the key already exists, its value is -overridden. - -.. tip:: - - If you want to ensure that some values are defined in an array (by given - default values), reverse the two elements in the call: - - .. code-block:: twig - - {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} - - {% set items = { 'apple': 'unknown' }|merge(items) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #} - -.. note:: - - Internally, Twig uses the PHP `array_merge`_ function. It supports - Traversable objects by transforming those to arrays. - -.. _`array_merge`: https://secure.php.net/array_merge diff --git a/system/backend/php/vendor/twig/twig/doc/filters/nl2br.rst b/system/backend/php/vendor/twig/twig/doc/filters/nl2br.rst deleted file mode 100644 index 1eefb04aa0c..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/nl2br.rst +++ /dev/null @@ -1,19 +0,0 @@ -``nl2br`` -========= - -The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: - -.. code-block:: twig - - {{ "I like Twig.\nYou will like it too."|nl2br }} - {# outputs - - I like Twig.
- You will like it too. - - #} - -.. note:: - - The ``nl2br`` filter pre-escapes the input before applying the - transformation. diff --git a/system/backend/php/vendor/twig/twig/doc/filters/number_format.rst b/system/backend/php/vendor/twig/twig/doc/filters/number_format.rst deleted file mode 100644 index 77b613b9717..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/number_format.rst +++ /dev/null @@ -1,50 +0,0 @@ -``number_format`` -================= - -The ``number_format`` filter formats numbers. It is a wrapper around PHP's -`number_format`_ function: - -.. code-block:: twig - - {{ 200.35|number_format }} - -You can control the number of decimal places, decimal point, and thousands -separator using the additional arguments: - -.. code-block:: twig - - {{ 9800.333|number_format(2, '.', ',') }} - -To format negative numbers, wrap the number with parentheses (needed because of -Twig's :ref:`precedence of operators `: - -.. code-block:: twig - - {{ -9800.333|number_format(2, '.', ',') }} {# outputs : -9 #} - {{ (-9800.333)|number_format(2, '.', ',') }} {# outputs : -9,800.33 #} - -If no formatting options are provided then Twig will use the default formatting -options of: - -* 0 decimal places. -* ``.`` as the decimal point. -* ``,`` as the thousands separator. - -These defaults can be easily changed through the core extension: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setNumberFormat(3, '.', ','); - -The defaults set for ``number_format`` can be over-ridden upon each call using the -additional parameters. - -Arguments ---------- - -* ``decimal``: The number of decimal points to display -* ``decimal_point``: The character(s) to use for the decimal point -* ``thousand_sep``: The character(s) to use for the thousands separator - -.. _`number_format`: https://secure.php.net/number_format diff --git a/system/backend/php/vendor/twig/twig/doc/filters/raw.rst b/system/backend/php/vendor/twig/twig/doc/filters/raw.rst deleted file mode 100644 index ad74a52aee1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/raw.rst +++ /dev/null @@ -1,38 +0,0 @@ -``raw`` -======= - -The ``raw`` filter marks the value as being "safe", which means that in an -environment with automatic escaping enabled this variable will not be escaped -if ``raw`` is the last filter applied to it: - -.. code-block:: twig - - {% autoescape %} - {{ var|raw }} {# var won't be escaped #} - {% endautoescape %} - -.. note:: - - **This note only applies to Twig before versions 1.39 and 2.8**. - - Be careful when using the ``raw`` filter inside expressions: - - .. code-block:: twig - - {% autoescape %} - {% set hello = 'Hello' %} - {% set hola = 'Hola' %} - - {{ false ? 'Hola' : hello|raw }} - does not render the same as - {{ false ? hola : hello|raw }} - but renders the same as - {{ (false ? hola : hello)|raw }} - {% endautoescape %} - - The first ternary statement is not escaped: ``hello`` is marked as being - safe and Twig does not escape static values (see - :doc:`escape<../tags/autoescape>`). In the second ternary statement, even - if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole - expression. The third ternary statement is marked as safe and the result is - not escaped. diff --git a/system/backend/php/vendor/twig/twig/doc/filters/reduce.rst b/system/backend/php/vendor/twig/twig/doc/filters/reduce.rst deleted file mode 100644 index 7d04d6c7b08..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/reduce.rst +++ /dev/null @@ -1,33 +0,0 @@ -``reduce`` -========= - -.. versionadded:: 1.41 - The ``reduce`` filter was added in Twig 1.41 and 2.10. - -The ``reduce`` filter iteratively reduces a sequence or a mapping to a single -value using an arrow function, so as to reduce it to a single value. The arrow -function receives the return value of the previous iteration and the current -value of the sequence or mapping: - -.. code-block:: twig - - {% set numbers = [1, 2, 3] %} - - {{ numbers|reduce((carry, v) => carry + v) }} - {# output 6 #} - -The ``reduce`` filter takes an ``initial`` value as a second argument: - -.. code-block:: twig - - {{ numbers|reduce((carry, v) => carry + v, 10) }} - {# output 16 #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``array``: The sequence or mapping -* ``arrow``: The arrow function -* ``initial``: The initial value diff --git a/system/backend/php/vendor/twig/twig/doc/filters/replace.rst b/system/backend/php/vendor/twig/twig/doc/filters/replace.rst deleted file mode 100644 index ceb6c009715..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/replace.rst +++ /dev/null @@ -1,25 +0,0 @@ -``replace`` -=========== - -The ``replace`` filter formats a given string by replacing the placeholders -(placeholders are free-form): - -.. code-block:: twig - - {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - - {# using % as a delimiter is purely conventional and optional #} - - {{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }} - - {# outputs I like foo and bar #} - -Arguments ---------- - -* ``from``: The placeholder values - -.. seealso:: :doc:`format` diff --git a/system/backend/php/vendor/twig/twig/doc/filters/reverse.rst b/system/backend/php/vendor/twig/twig/doc/filters/reverse.rst deleted file mode 100644 index c5ceb7d0508..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/reverse.rst +++ /dev/null @@ -1,44 +0,0 @@ -``reverse`` -=========== - -The ``reverse`` filter reverses a sequence, a mapping, or a string: - -.. code-block:: twig - - {% for user in users|reverse %} - ... - {% endfor %} - - {{ '1234'|reverse }} - - {# outputs 4321 #} - -.. tip:: - - For sequences and mappings, numeric keys are not preserved. To reverse - them as well, pass ``true`` as an argument to the ``reverse`` filter: - - .. code-block:: twig - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 0: c 1: b 2: a #} - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 3: c 2: b 1: a #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence. - -.. _`Traversable`: https://secure.php.net/Traversable diff --git a/system/backend/php/vendor/twig/twig/doc/filters/round.rst b/system/backend/php/vendor/twig/twig/doc/filters/round.rst deleted file mode 100644 index 2c970b7f9e1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/round.rst +++ /dev/null @@ -1,34 +0,0 @@ -``round`` -========= - -The ``round`` filter rounds a number to a given precision: - -.. code-block:: twig - - {{ 42.55|round }} - {# outputs 43 #} - - {{ 42.55|round(1, 'floor') }} - {# outputs 42.5 #} - -The ``round`` filter takes two optional arguments; the first one specifies the -precision (default is ``0``) and the second the rounding method (default is -``common``): - -* ``common`` rounds either up or down (rounds the value up to precision decimal - places away from zero, when it is half way there -- making 1.5 into 2 and - -1.5 into -2); - -* ``ceil`` always rounds up; - -* ``floor`` always rounds down. - -.. note:: - - The ``//`` operator is equivalent to ``|round(0, 'floor')``. - -Arguments ---------- - -* ``precision``: The rounding precision -* ``method``: The rounding method diff --git a/system/backend/php/vendor/twig/twig/doc/filters/slice.rst b/system/backend/php/vendor/twig/twig/doc/filters/slice.rst deleted file mode 100644 index 9cc0ca4e814..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/slice.rst +++ /dev/null @@ -1,68 +0,0 @@ -``slice`` -=========== - -The ``slice`` filter extracts a slice of a sequence, a mapping, or a string: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %} - {# will iterate over 2 and 3 #} - {% endfor %} - - {{ '12345'|slice(1, 2) }} - - {# outputs 23 #} - -You can use any valid expression for both the start and the length: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5]|slice(start, length) %} - {# ... #} - {% endfor %} - -As syntactic sugar, you can also use the ``[]`` notation: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5][start:length] %} - {# ... #} - {% endfor %} - - {{ '12345'[1:2] }} {# will display "23" #} - - {# you can omit the first argument -- which is the same as 0 #} - {{ '12345'[:2] }} {# will display "12" #} - - {# you can omit the last argument -- which will select everything till the end #} - {{ '12345'[2:] }} {# will display "345" #} - -The ``slice`` filter works as the `array_slice`_ PHP function for arrays and -`mb_substr`_ for strings with a fallback to `substr`_. - -If the start is non-negative, the sequence will start at that start in the -variable. If start is negative, the sequence will start that far from the end -of the variable. - -If length is given and is positive, then the sequence will have up to that -many elements in it. If the variable is shorter than the length, then only the -available variable elements will be present. If length is given and is -negative then the sequence will stop that many elements from the end of the -variable. If it is omitted, then the sequence will have everything from offset -up until the end of the variable. - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``start``: The start of the slice -* ``length``: The size of the slice -* ``preserve_keys``: Whether to preserve key or not (when the input is an array) - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php -.. _`array_slice`: https://secure.php.net/array_slice -.. _`mb_substr` : https://secure.php.net/mb-substr -.. _`substr`: https://secure.php.net/substr diff --git a/system/backend/php/vendor/twig/twig/doc/filters/sort.rst b/system/backend/php/vendor/twig/twig/doc/filters/sort.rst deleted file mode 100644 index f7c0329fe23..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/sort.rst +++ /dev/null @@ -1,18 +0,0 @@ -``sort`` -======== - -The ``sort`` filter sorts an array: - -.. code-block:: twig - - {% for user in users|sort %} - ... - {% endfor %} - -.. note:: - - Internally, Twig uses the PHP `asort`_ function to maintain index - association. It supports Traversable objects by transforming - those to arrays. - -.. _`asort`: https://secure.php.net/asort diff --git a/system/backend/php/vendor/twig/twig/doc/filters/spaceless.rst b/system/backend/php/vendor/twig/twig/doc/filters/spaceless.rst deleted file mode 100644 index 17966a81971..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/spaceless.rst +++ /dev/null @@ -1,65 +0,0 @@ -``spaceless`` -============= - -.. versionadded:: 1.38 - - The ``spaceless`` filter was added in Twig 1.38. - -Use the ``spaceless`` filter to remove whitespace *between HTML tags*, not -whitespace within HTML tags or whitespace in plain text: - -.. code-block:: twig - - {{ - "
- foo -
- "|spaceless }} - - {# output will be
foo
#} - -You can combine ``spaceless`` with the ``apply`` tag to apply the transformation -on large amounts of HTML: - -.. code-block:: twig - - {% apply spaceless %} -
- foo -
- {% endapply %} - - {# output will be
foo
#} - -.. note:: - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -This tag is not meant to "optimize" the size of the generated HTML content but -merely to avoid extra whitespace between HTML tags to avoid browser rendering -quirks under some circumstances. - -.. caution:: - - As the filter uses a regular expression behind the scenes, its performance - is directly related to the text size you are working on (remember that - filters are executed at runtime). - -.. tip:: - - If you want to optimize the size of the generated HTML content, gzip - compress the output instead. - -.. tip:: - - If you want to create a tag that actually removes all extra whitespace in - an HTML string, be warned that this is not as easy as it seems to be - (think of ``textarea`` or ``pre`` tags for instance). Using a third-party - library like Tidy is probably a better idea. - -.. tip:: - - For more information on whitespace control, read the - :ref:`dedicated section ` of the documentation and learn how - you can also use the whitespace control modifier on your tags. diff --git a/system/backend/php/vendor/twig/twig/doc/filters/split.rst b/system/backend/php/vendor/twig/twig/doc/filters/split.rst deleted file mode 100644 index 38c4b7df04d..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/split.rst +++ /dev/null @@ -1,50 +0,0 @@ -``split`` -========= - -The ``split`` filter splits a string by the given delimiter and returns a list -of strings: - -.. code-block:: twig - - {% set foo = "one,two,three"|split(',') %} - {# foo contains ['one', 'two', 'three'] #} - -You can also pass a ``limit`` argument: - -* If ``limit`` is positive, the returned array will contain a maximum of - limit elements with the last element containing the rest of string; - -* If ``limit`` is negative, all components except the last -limit are - returned; - -* If ``limit`` is zero, then this is treated as 1. - -.. code-block:: twig - - {% set foo = "one,two,three,four,five"|split(',', 3) %} - {# foo contains ['one', 'two', 'three,four,five'] #} - -If the ``delimiter`` is an empty string, then value will be split by equal -chunks. Length is set by the ``limit`` argument (one character by default). - -.. code-block:: twig - - {% set foo = "123"|split('') %} - {# foo contains ['1', '2', '3'] #} - - {% set bar = "aabbcc"|split('', 2) %} - {# bar contains ['aa', 'bb', 'cc'] #} - -.. note:: - - Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is - empty) functions for string splitting. - -Arguments ---------- - -* ``delimiter``: The delimiter -* ``limit``: The limit argument - -.. _`explode`: https://secure.php.net/explode -.. _`str_split`: https://secure.php.net/str_split diff --git a/system/backend/php/vendor/twig/twig/doc/filters/striptags.rst b/system/backend/php/vendor/twig/twig/doc/filters/striptags.rst deleted file mode 100644 index 62b2a7b3c13..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/striptags.rst +++ /dev/null @@ -1,29 +0,0 @@ -``striptags`` -============= - -The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace -by one space: - -.. code-block:: twig - - {{ some_html|striptags }} - -You can also provide tags which should not be stripped: - -.. code-block:: twig - - {{ some_html|striptags('

') }} - -In this example, the ``
``, ``
``, ``

``, and ``

`` tags won't be -removed from the string. - -.. note:: - - Internally, Twig uses the PHP `strip_tags`_ function. - -Arguments ---------- - -* ``allowable_tags``: Tags which should not be stripped - -.. _`strip_tags`: https://secure.php.net/strip_tags diff --git a/system/backend/php/vendor/twig/twig/doc/filters/title.rst b/system/backend/php/vendor/twig/twig/doc/filters/title.rst deleted file mode 100644 index dd0311ca3dc..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/title.rst +++ /dev/null @@ -1,11 +0,0 @@ -``title`` -========= - -The ``title`` filter returns a titlecased version of the value. Words will -start with uppercase letters, all remaining characters are lowercase: - -.. code-block:: twig - - {{ 'my first car'|title }} - - {# outputs 'My First Car' #} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/trim.rst b/system/backend/php/vendor/twig/twig/doc/filters/trim.rst deleted file mode 100644 index 81d5e041511..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/trim.rst +++ /dev/null @@ -1,39 +0,0 @@ -``trim`` -======== - -The ``trim`` filter strips whitespace (or other characters) from the beginning -and end of a string: - -.. code-block:: twig - - {{ ' I like Twig. '|trim }} - - {# outputs 'I like Twig.' #} - - {{ ' I like Twig.'|trim('.') }} - - {# outputs ' I like Twig' #} - - {{ ' I like Twig. '|trim(side='left') }} - - {# outputs 'I like Twig. ' #} - - {{ ' I like Twig. '|trim(' ', 'right') }} - - {# outputs ' I like Twig.' #} - -.. note:: - - Internally, Twig uses the PHP `trim`_, `ltrim`_, and `rtrim`_ functions. - -Arguments ---------- - -* ``character_mask``: The characters to strip - -* ``side``: The default is to strip from the left and the right (`both`) sides, but `left` - and `right` will strip from either the left side or right side only - -.. _`trim`: https://secure.php.net/trim -.. _`ltrim`: https://secure.php.net/ltrim -.. _`rtrim`: https://secure.php.net/rtrim diff --git a/system/backend/php/vendor/twig/twig/doc/filters/upper.rst b/system/backend/php/vendor/twig/twig/doc/filters/upper.rst deleted file mode 100644 index 01c9fbb0b53..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/upper.rst +++ /dev/null @@ -1,10 +0,0 @@ -``upper`` -========= - -The ``upper`` filter converts a value to uppercase: - -.. code-block:: twig - - {{ 'welcome'|upper }} - - {# outputs 'WELCOME' #} diff --git a/system/backend/php/vendor/twig/twig/doc/filters/url_encode.rst b/system/backend/php/vendor/twig/twig/doc/filters/url_encode.rst deleted file mode 100644 index 50a44e5d672..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/filters/url_encode.rst +++ /dev/null @@ -1,22 +0,0 @@ -``url_encode`` -============== - -The ``url_encode`` filter percent encodes a given string as URL segment -or an array as query string: - -.. code-block:: twig - - {{ "path-seg*ment"|url_encode }} - {# outputs "path-seg%2Ament" #} - - {{ "string with spaces"|url_encode }} - {# outputs "string%20with%20spaces" #} - - {{ {'param': 'value', 'foo': 'bar'}|url_encode }} - {# outputs "param=value&foo=bar" #} - -.. note:: - - Internally, Twig uses the PHP ``rawurlencode``. - -.. _`rawurlencode`: https://secure.php.net/rawurlencode diff --git a/system/backend/php/vendor/twig/twig/doc/functions/attribute.rst b/system/backend/php/vendor/twig/twig/doc/functions/attribute.rst deleted file mode 100644 index e9d9a842ef3..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/attribute.rst +++ /dev/null @@ -1,23 +0,0 @@ -``attribute`` -============= - -The ``attribute`` function can be used to access a "dynamic" attribute of a -variable: - -.. code-block:: twig - - {{ attribute(object, method) }} - {{ attribute(object, method, arguments) }} - {{ attribute(array, item) }} - -In addition, the ``defined`` test can check for the existence of a dynamic -attribute: - -.. code-block:: twig - - {{ attribute(object, method) is defined ? 'Method exists' : 'Method does not exist' }} - -.. note:: - - The resolution algorithm is the same as the one used for the ``.`` - notation, except that the item can be any valid expression. diff --git a/system/backend/php/vendor/twig/twig/doc/functions/block.rst b/system/backend/php/vendor/twig/twig/doc/functions/block.rst deleted file mode 100644 index 01184320347..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/block.rst +++ /dev/null @@ -1,35 +0,0 @@ -``block`` -========= - -When a template uses inheritance and if you want to print a block multiple -times, use the ``block`` function: - -.. code-block:: twig - - {% block title %}{% endblock %} - -

{{ block('title') }}

- - {% block body %}{% endblock %} - -The ``block`` function can also be used to display one block from another -template: - -.. code-block:: twig - - {{ block("title", "common_blocks.twig") }} - -Use the ``defined`` test to check if a block exists in the context of the -current template: - -.. code-block:: twig - - {% if block("footer") is defined %} - ... - {% endif %} - - {% if block("footer", "common_blocks.twig") is defined %} - ... - {% endif %} - -.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` diff --git a/system/backend/php/vendor/twig/twig/doc/functions/constant.rst b/system/backend/php/vendor/twig/twig/doc/functions/constant.rst deleted file mode 100644 index 660bf870c0b..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/constant.rst +++ /dev/null @@ -1,23 +0,0 @@ -``constant`` -============ - -``constant`` returns the constant value for a given string: - -.. code-block:: twig - - {{ some_date|date(constant('DATE_W3C')) }} - {{ constant('Namespace\\Classname::CONSTANT_NAME') }} - -You can read constants from object instances as well: - -.. code-block:: twig - - {{ constant('RSS', date) }} - -Use the ``defined`` test to check if a constant is defined: - -.. code-block:: twig - - {% if constant('SOME_CONST') is defined %} - ... - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/functions/cycle.rst b/system/backend/php/vendor/twig/twig/doc/functions/cycle.rst deleted file mode 100644 index 84cff6a1d5a..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/cycle.rst +++ /dev/null @@ -1,28 +0,0 @@ -``cycle`` -========= - -The ``cycle`` function cycles on an array of values: - -.. code-block:: twig - - {% set start_year = date() | date('Y') %} - {% set end_year = start_year + 5 %} - - {% for year in start_year..end_year %} - {{ cycle(['odd', 'even'], loop.index0) }} - {% endfor %} - -The array can contain any number of values: - -.. code-block:: twig - - {% set fruits = ['apple', 'orange', 'citrus'] %} - - {% for i in 0..10 %} - {{ cycle(fruits, i) }} - {% endfor %} - -Arguments ---------- - -* ``position``: The cycle position diff --git a/system/backend/php/vendor/twig/twig/doc/functions/date.rst b/system/backend/php/vendor/twig/twig/doc/functions/date.rst deleted file mode 100644 index ee80a4e0314..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/date.rst +++ /dev/null @@ -1,46 +0,0 @@ -``date`` -======== - -Converts an argument to a date to allow date comparison: - -.. code-block:: twig - - {% if date(user.created_at) < date('-2days') %} - {# do something #} - {% endif %} - -The argument must be in one of PHP’s supported `date and time formats`_. - -You can pass a timezone as the second argument: - -.. code-block:: twig - - {% if date(user.created_at) < date('-2days', 'Europe/Paris') %} - {# do something #} - {% endif %} - -If no argument is passed, the function returns the current date: - -.. code-block:: twig - - {% if date(user.created_at) < date() %} - {# always! #} - {% endif %} - -.. note:: - - You can set the default timezone globally by calling ``setTimezone()`` on - the ``core`` extension instance: - - .. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``date``: The date -* ``timezone``: The timezone - -.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php diff --git a/system/backend/php/vendor/twig/twig/doc/functions/dump.rst b/system/backend/php/vendor/twig/twig/doc/functions/dump.rst deleted file mode 100644 index b295b875a61..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/dump.rst +++ /dev/null @@ -1,66 +0,0 @@ -``dump`` -======== - -The ``dump`` function dumps information about a template variable. This is -mostly useful to debug a template that does not behave as expected by -introspecting its variables: - -.. code-block:: twig - - {{ dump(user) }} - -.. note:: - - The ``dump`` function is not available by default. You must add the - ``\Twig\Extension\DebugExtension`` extension explicitly when creating your Twig - environment:: - - $twig = new \Twig\Environment($loader, [ - 'debug' => true, - // ... - ]); - $twig->addExtension(new \Twig\Extension\DebugExtension()); - - Even when enabled, the ``dump`` function won't display anything if the - ``debug`` option on the environment is not enabled (to avoid leaking debug - information on a production server). - -In an HTML context, wrap the output with a ``pre`` tag to make it easier to -read: - -.. code-block:: twig - -
-        {{ dump(user) }}
-    
- -.. tip:: - - Using a ``pre`` tag is not needed when `XDebug`_ is enabled and - ``html_errors`` is ``on``; as a bonus, the output is also nicer with - XDebug enabled. - -You can debug several variables by passing them as additional arguments: - -.. code-block:: twig - - {{ dump(user, categories) }} - -If you don't pass any value, all variables from the current context are -dumped: - -.. code-block:: twig - - {{ dump() }} - -.. note:: - - Internally, Twig uses the PHP `var_dump`_ function. - -Arguments ---------- - -* ``context``: The context to dump - -.. _`XDebug`: https://xdebug.org/docs/display -.. _`var_dump`: https://secure.php.net/var_dump diff --git a/system/backend/php/vendor/twig/twig/doc/functions/include.rst b/system/backend/php/vendor/twig/twig/doc/functions/include.rst deleted file mode 100644 index f49971a8fed..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/include.rst +++ /dev/null @@ -1,77 +0,0 @@ -``include`` -=========== - -The ``include`` function returns the rendered content of a template: - -.. code-block:: twig - - {{ include('template.html') }} - {{ include(some_var) }} - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -The context is passed by default to the template but you can also pass -additional variables: - -.. code-block:: twig - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {{ include('template.html', {foo: 'bar'}) }} - -You can disable access to the context by setting ``with_context`` to -``false``: - -.. code-block:: twig - - {# only the foo variable will be accessible #} - {{ include('template.html', {foo: 'bar'}, with_context = false) }} - -.. code-block:: twig - - {# no variables will be accessible #} - {{ include('template.html', with_context = false) }} - -And if the expression evaluates to a ``\Twig\Template`` or a -``\Twig\TemplateWrapper`` instance, Twig will use it directly:: - - // {{ include(template) }} - - $template = $twig->load('some_template.twig'); - - $twig->display('template.twig', ['template' => $template]); - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: twig - - {{ include('sidebar.html', ignore_missing = true) }} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be rendered: - -.. code-block:: twig - - {{ include(['page_detailed.html', 'page.html']) }} - -If ``ignore_missing`` is set, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. - -When including a template created by an end user, you should consider -sandboxing it: - -.. code-block:: twig - - {{ include('page.html', sandboxed = true) }} - -Arguments ---------- - -* ``template``: The template to render -* ``variables``: The variables to pass to the template -* ``with_context``: Whether to pass the current context variables or not -* ``ignore_missing``: Whether to ignore missing templates or not -* ``sandboxed``: Whether to sandbox the template or not diff --git a/system/backend/php/vendor/twig/twig/doc/functions/index.rst b/system/backend/php/vendor/twig/twig/doc/functions/index.rst deleted file mode 100644 index 07214a76c18..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -Functions -========= - -.. toctree:: - :maxdepth: 1 - - attribute - block - constant - cycle - date - dump - include - max - min - parent - random - range - source - template_from_string diff --git a/system/backend/php/vendor/twig/twig/doc/functions/max.rst b/system/backend/php/vendor/twig/twig/doc/functions/max.rst deleted file mode 100644 index 230b3c8f013..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/max.rst +++ /dev/null @@ -1,17 +0,0 @@ -``max`` -======= - -``max`` returns the biggest value of a sequence or a set of values: - -.. code-block:: twig - - {{ max(1, 3, 2) }} - {{ max([1, 3, 2]) }} - -When called with a mapping, max ignores keys and only compares values: - -.. code-block:: twig - - {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }} - {# returns "e" #} - diff --git a/system/backend/php/vendor/twig/twig/doc/functions/min.rst b/system/backend/php/vendor/twig/twig/doc/functions/min.rst deleted file mode 100644 index 65318580a0c..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/min.rst +++ /dev/null @@ -1,17 +0,0 @@ -``min`` -======= - -``min`` returns the lowest value of a sequence or a set of values: - -.. code-block:: twig - - {{ min(1, 3, 2) }} - {{ min([1, 3, 2]) }} - -When called with a mapping, min ignores keys and only compares values: - -.. code-block:: twig - - {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }} - {# returns "a" #} - diff --git a/system/backend/php/vendor/twig/twig/doc/functions/parent.rst b/system/backend/php/vendor/twig/twig/doc/functions/parent.rst deleted file mode 100644 index 9beb5d21cf9..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/parent.rst +++ /dev/null @@ -1,20 +0,0 @@ -``parent`` -========== - -When a template uses inheritance, it's possible to render the contents of the -parent block when overriding a block by using the ``parent`` function: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block sidebar %} -

Table Of Contents

- ... - {{ parent() }} - {% endblock %} - -The ``parent()`` call will return the content of the ``sidebar`` block as -defined in the ``base.html`` template. - -.. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>` diff --git a/system/backend/php/vendor/twig/twig/doc/functions/random.rst b/system/backend/php/vendor/twig/twig/doc/functions/random.rst deleted file mode 100644 index baaaf962955..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/random.rst +++ /dev/null @@ -1,30 +0,0 @@ -``random`` -========== - -.. versionadded:: 2.7 - The "max" argument was added in Twig 2.7. - -The ``random`` function returns a random value depending on the supplied -parameter type: - -* a random item from a sequence; -* a random character from a string; -* a random integer between 0 and the integer parameter (inclusive). -* a random integer between the integer parameter (when negative) and 0 (inclusive). -* a random integer between the first integer and the second integer parameter (inclusive). - -.. code-block:: twig - - {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} - {{ random('ABC') }} {# example output: C #} - {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #} - {{ random(5) }} {# example output: 3 #} - {{ random(50, 100) }} {# example output: 63 #} - -Arguments ---------- - -* ``values``: The values -* ``max``: The max value when values is an integer - -.. _`mt_rand`: https://secure.php.net/mt_rand diff --git a/system/backend/php/vendor/twig/twig/doc/functions/range.rst b/system/backend/php/vendor/twig/twig/doc/functions/range.rst deleted file mode 100644 index a1f0e7c097d..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/range.rst +++ /dev/null @@ -1,58 +0,0 @@ -``range`` -========= - -Returns a list containing an arithmetic progression of integers: - -.. code-block:: twig - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 1, 2, 3, #} - -When step is given (as the third parameter), it specifies the increment (or -decrement for negative values): - -.. code-block:: twig - - {% for i in range(0, 6, 2) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 2, 4, 6, #} - -.. note:: - - Note that if the start is greater than the end, ``range`` assumes a step of - ``-1``: - - .. code-block:: twig - - {% for i in range(3, 0) %} - {{ i }}, - {% endfor %} - - {# outputs 3, 2, 1, 0, #} - -The Twig built-in ``..`` operator is just syntactic sugar for the ``range`` -function (with a step of ``1``, or ``-1`` if the start is greater than the end): - -.. code-block:: twig - - {% for i in 0..3 %} - {{ i }}, - {% endfor %} - -.. tip:: - - The ``range`` function works as the native PHP `range`_ function. - -Arguments ---------- - -* ``low``: The first value of the sequence. -* ``high``: The highest possible value of the sequence. -* ``step``: The increment between elements of the sequence. - -.. _`range`: https://secure.php.net/range diff --git a/system/backend/php/vendor/twig/twig/doc/functions/source.rst b/system/backend/php/vendor/twig/twig/doc/functions/source.rst deleted file mode 100644 index 080e2befe57..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/source.rst +++ /dev/null @@ -1,26 +0,0 @@ -``source`` -========== - -The ``source`` function returns the content of a template without rendering it: - -.. code-block:: twig - - {{ source('template.html') }} - {{ source(some_var) }} - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: twig - - {{ source('template.html', ignore_missing = true) }} - -The function uses the same template loaders as the ones used to include -templates. So, if you are using the filesystem loader, the templates are looked -for in the paths defined by it. - -Arguments ---------- - -* ``name``: The name of the template to read -* ``ignore_missing``: Whether to ignore missing templates or not diff --git a/system/backend/php/vendor/twig/twig/doc/functions/template_from_string.rst b/system/backend/php/vendor/twig/twig/doc/functions/template_from_string.rst deleted file mode 100644 index fd61871c1cd..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/functions/template_from_string.rst +++ /dev/null @@ -1,40 +0,0 @@ -``template_from_string`` -======================== - -.. versionadded:: 2.8 - The name argument was added in Twig 2.8. - -The ``template_from_string`` function loads a template from a string: - -.. code-block:: twig - - {{ include(template_from_string("Hello {{ name }}")) }} - {{ include(template_from_string(page.template)) }} - -To ease debugging, you can also give the template a name that will be part of -any related error message: - -.. code-block:: twig - - {{ include(template_from_string(page.template, "template for page " ~ page.name)) }} - -.. note:: - - The ``template_from_string`` function is not available by default. You - must add the ``\Twig\Extension\StringLoaderExtension`` extension explicitly when - creating your Twig environment:: - - $twig = new \Twig\Environment(...); - $twig->addExtension(new \Twig\Extension\StringLoaderExtension()); - -.. note:: - - Even if you will probably always use the ``template_from_string`` function - with the ``include`` function, you can use it with any tag or function that - takes a template as an argument (like the ``embed`` or ``extends`` tags). - -Arguments ---------- - -* ``template``: The template -* ``name``: A name for the template diff --git a/system/backend/php/vendor/twig/twig/doc/index.rst b/system/backend/php/vendor/twig/twig/doc/index.rst deleted file mode 100644 index 358bd738ed0..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -Twig -==== - -.. toctree:: - :maxdepth: 2 - - intro - installation - templates - api - advanced - internals - deprecated - recipes - coding_standards - tags/index - filters/index - functions/index - tests/index diff --git a/system/backend/php/vendor/twig/twig/doc/installation.rst b/system/backend/php/vendor/twig/twig/doc/installation.rst deleted file mode 100644 index d6bd29acacd..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/installation.rst +++ /dev/null @@ -1,10 +0,0 @@ -Installation -============ - -Install `Composer`_ and run the following command to get the latest version: - -.. code-block:: bash - - composer require "twig/twig:^2.0" - -.. _`Composer`: https://getcomposer.org/download/ diff --git a/system/backend/php/vendor/twig/twig/doc/internals.rst b/system/backend/php/vendor/twig/twig/doc/internals.rst deleted file mode 100644 index 1a3c60848fe..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/internals.rst +++ /dev/null @@ -1,140 +0,0 @@ -Twig Internals -============== - -Twig is very extensible and you can easily hack it. Keep in mind that you -should probably try to create an extension before hacking the core, as most -features and enhancements can be handled with extensions. This chapter is also -useful for people who want to understand how Twig works under the hood. - -How does Twig work? -------------------- - -The rendering of a Twig template can be summarized into four key steps: - -* **Load** the template: If the template is already compiled, load it and go - to the *evaluation* step, otherwise: - - * First, the **lexer** tokenizes the template source code into small pieces - for easier processing; - - * Then, the **parser** converts the token stream into a meaningful tree - of nodes (the Abstract Syntax Tree); - - * Finally, the *compiler* transforms the AST into PHP code. - -* **Evaluate** the template: It means calling the ``display()`` - method of the compiled template and passing it the context. - -The Lexer ---------- - -The lexer tokenizes a template source code into a token stream (each token is -an instance of ``\Twig\Token``, and the stream is an instance of -``\Twig\TokenStream``). The default lexer recognizes 13 different token types: - -* ``\Twig\Token::BLOCK_START_TYPE``, ``\Twig\Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``) -* ``\Twig\Token::VAR_START_TYPE``, ``\Twig\Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``) -* ``\Twig\Token::TEXT_TYPE``: A text outside an expression; -* ``\Twig\Token::NAME_TYPE``: A name in an expression; -* ``\Twig\Token::NUMBER_TYPE``: A number in an expression; -* ``\Twig\Token::STRING_TYPE``: A string in an expression; -* ``\Twig\Token::OPERATOR_TYPE``: An operator; -* ``\Twig\Token::PUNCTUATION_TYPE``: A punctuation sign; -* ``\Twig\Token::INTERPOLATION_START_TYPE``, ``\Twig\Token::INTERPOLATION_END_TYPE``: Delimiters for string interpolation; -* ``\Twig\Token::EOF_TYPE``: Ends of template. - -You can manually convert a source code into a token stream by calling the -``tokenize()`` method of an environment:: - - $stream = $twig->tokenize(new \Twig\Source($source, $identifier)); - -As the stream has a ``__toString()`` method, you can have a textual -representation of it by echoing the object:: - - echo $stream."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - TEXT_TYPE(Hello ) - VAR_START_TYPE() - NAME_TYPE(name) - VAR_END_TYPE() - EOF_TYPE() - -.. note:: - - The default lexer (``\Twig\Lexer``) can be changed by calling - the ``setLexer()`` method:: - - $twig->setLexer($lexer); - -The Parser ----------- - -The parser converts the token stream into an AST (Abstract Syntax Tree), or a -node tree (an instance of ``\Twig\Node\ModuleNode``). The core extension defines -the basic nodes like: ``for``, ``if``, ... and the expression nodes. - -You can manually convert a token stream into a node tree by calling the -``parse()`` method of an environment:: - - $nodes = $twig->parse($stream); - -Echoing the node object gives you a nice representation of the tree:: - - echo $nodes."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - \Twig\Node\ModuleNode( - \Twig\Node\TextNode(Hello ) - \Twig\Node\PrintNode( - \Twig\Node\Expression\NameExpression(name) - ) - ) - -.. note:: - - The default parser (``\Twig\TokenParser\AbstractTokenParser``) can be changed by calling the - ``setParser()`` method:: - - $twig->setParser($parser); - -The Compiler ------------- - -The last step is done by the compiler. It takes a node tree as an input and -generates PHP code usable for runtime execution of the template. - -You can manually compile a node tree to PHP code with the ``compile()`` method -of an environment:: - - $php = $twig->compile($nodes); - -The generated template for a ``Hello {{ name }}`` template reads as follows -(the actual output can differ depending on the version of Twig you are -using):: - - /* Hello {{ name }} */ - class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends \Twig\Template - { - protected function doDisplay(array $context, array $blocks = []) - { - // line 1 - echo "Hello "; - echo twig_escape_filter($this->env, (isset($context["name"]) ? $context["name"] : null), "html", null, true); - } - - // some more code - } - -.. note:: - - The default compiler (``\Twig\Compiler``) can be changed by calling the - ``setCompiler()`` method:: - - $twig->setCompiler($compiler); diff --git a/system/backend/php/vendor/twig/twig/doc/intro.rst b/system/backend/php/vendor/twig/twig/doc/intro.rst deleted file mode 100644 index c477c78380a..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/intro.rst +++ /dev/null @@ -1,70 +0,0 @@ -Introduction -============ - -Welcome to the documentation for Twig, the flexible, fast, and secure template -engine for PHP. - -Twig is both designer and developer friendly by sticking to PHP's principles and -adding functionality useful for templating environments. - -The key-features are... - -* *Fast*: Twig compiles templates down to plain optimized PHP code. The - overhead compared to regular PHP code was reduced to the very minimum. - -* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This - allows Twig to be used as a template language for applications where users - may modify the template design. - -* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the - developer to define their own custom tags and filters, and to create their own DSL. - -Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish, -phpBB, Matomo, OroCRM; and many frameworks have support for it as well like -Slim, Yii, Laravel, and Codeigniter — just to name a few. - -Prerequisites -------------- - -Twig needs at least **PHP 7.0.0** to run. - -Installation ------------- - -The recommended way to install Twig is via Composer: - -.. code-block:: bash - - composer require "twig/twig:^2.0" - -Basic API Usage ---------------- - -This section gives you a brief introduction to the PHP API for Twig. - -.. code-block:: php - - require_once '/path/to/vendor/autoload.php'; - - $loader = new \Twig\Loader\ArrayLoader([ - 'index' => 'Hello {{ name }}!', - ]); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index', ['name' => 'Fabien']); - -Twig uses a loader (``\Twig\Loader\ArrayLoader``) to locate templates, and an -environment (``\Twig\Environment``) to store its configuration. - -The ``render()`` method loads the template passed as a first argument and -renders it with the variables passed as a second argument. - -As templates are generally stored on the filesystem, Twig also comes with a -filesystem loader:: - - $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates'); - $twig = new \Twig\Environment($loader, [ - 'cache' => '/path/to/compilation_cache', - ]); - - echo $twig->render('index.html', ['name' => 'Fabien']); diff --git a/system/backend/php/vendor/twig/twig/doc/recipes.rst b/system/backend/php/vendor/twig/twig/doc/recipes.rst deleted file mode 100644 index 41e759e3ce8..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/recipes.rst +++ /dev/null @@ -1,527 +0,0 @@ -Recipes -======= - -.. _deprecation-notices: - -Displaying Deprecation Notices ------------------------------- - -Deprecated features generate deprecation notices (via a call to the -``trigger_error()`` PHP function). By default, they are silenced and never -displayed nor logged. - -To remove all deprecated feature usages from your templates, write and run a -script along the lines of the following:: - - require_once __DIR__.'/vendor/autoload.php'; - - $twig = create_your_twig_env(); - - $deprecations = new \Twig\Util\DeprecationCollector($twig); - - print_r($deprecations->collectDir(__DIR__.'/templates')); - -The ``collectDir()`` method compiles all templates found in a directory, -catches deprecation notices, and return them. - -.. tip:: - - If your templates are not stored on the filesystem, use the ``collect()`` - method instead. ``collect()`` takes a ``Traversable`` which must return - template names as keys and template contents as values (as done by - ``\Twig\Util\TemplateDirIterator``). - -However, this code won't find all deprecations (like using deprecated some Twig -classes). To catch all notices, register a custom error handler like the one -below:: - - $deprecations = []; - set_error_handler(function ($type, $msg) use (&$deprecations) { - if (E_USER_DEPRECATED === $type) { - $deprecations[] = $msg; - } - }); - - // run your application - - print_r($deprecations); - -Note that most deprecation notices are triggered during **compilation**, so -they won't be generated when templates are already cached. - -.. tip:: - - If you want to manage the deprecation notices from your PHPUnit tests, have - a look at the `symfony/phpunit-bridge - `_ package, which eases the - process. - -Making a Layout conditional ---------------------------- - -Working with Ajax means that the same content is sometimes displayed as is, -and sometimes decorated with a layout. As Twig layout template names can be -any valid expression, you can pass a variable that evaluates to ``true`` when -the request is made via Ajax and choose the layout accordingly: - -.. code-block:: twig - - {% extends request.ajax ? "base_ajax.html" : "base.html" %} - - {% block content %} - This is the content to be displayed. - {% endblock %} - -Making an Include dynamic -------------------------- - -When including a template, its name does not need to be a string. For -instance, the name can depend on the value of a variable: - -.. code-block:: twig - - {% include var ~ '_foo.html' %} - -If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be -rendered. - -As a matter of fact, the template name can be any valid expression, such as -the following: - -.. code-block:: twig - - {% include var|default('index') ~ '_foo.html' %} - -Overriding a Template that also extends itself ----------------------------------------------- - -A template can be customized in two different ways: - -* *Inheritance*: A template *extends* a parent template and overrides some - blocks; - -* *Replacement*: If you use the filesystem loader, Twig loads the first - template it finds in a list of configured directories; a template found in a - directory *replaces* another one from a directory further in the list. - -But how do you combine both: *replace* a template that also extends itself -(aka a template in a directory further in the list)? - -Let's say that your templates are loaded from both ``.../templates/mysite`` -and ``.../templates/default`` in this order. The ``page.twig`` template, -stored in ``.../templates/default`` reads as follows: - -.. code-block:: twig - - {# page.twig #} - {% extends "layout.twig" %} - - {% block content %} - {% endblock %} - -You can replace this template by putting a file with the same name in -``.../templates/mysite``. And if you want to extend the original template, you -might be tempted to write the following: - -.. code-block:: twig - - {# page.twig in .../templates/mysite #} - {% extends "page.twig" %} {# from .../templates/default #} - -Of course, this will not work as Twig will always load the template from -``.../templates/mysite``. - -It turns out it is possible to get this to work, by adding a directory right -at the end of your template directories, which is the parent of all of the -other directories: ``.../templates`` in our case. This has the effect of -making every template file within our system uniquely addressable. Most of the -time you will use the "normal" paths, but in the special case of wanting to -extend a template with an overriding version of itself we can reference its -parent's full, unambiguous template path in the extends tag: - -.. code-block:: twig - - {# page.twig in .../templates/mysite #} - {% extends "default/page.twig" %} {# from .../templates #} - -.. note:: - - This recipe was inspired by the following Django wiki page: - https://code.djangoproject.com/wiki/ExtendingTemplates - -Customizing the Syntax ----------------------- - -Twig allows some syntax customization for the block delimiters. It's **not** -recommended to use this feature as templates will be tied with your custom -syntax. But for specific projects, it can make sense to change the defaults. - -To change the block delimiters, you need to create your own lexer object:: - - $twig = new \Twig\Environment(...); - - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['{#', '#}'], - 'tag_block' => ['{%', '%}'], - 'tag_variable' => ['{{', '}}'], - 'interpolation' => ['#{', '}'], - ]); - $twig->setLexer($lexer); - -Here are some configuration example that simulates some other template engines -syntax:: - - // Ruby erb syntax - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['<%#', '%>'], - 'tag_block' => ['<%', '%>'], - 'tag_variable' => ['<%=', '%>'], - ]); - - // SGML Comment Syntax - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => [''], - 'tag_block' => [''], - 'tag_variable' => ['${', '}'], - ]); - - // Smarty like - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['{*', '*}'], - 'tag_block' => ['{', '}'], - 'tag_variable' => ['{$', '}'], - ]); - -Using dynamic Object Properties -------------------------------- - -When Twig encounters a variable like ``article.title``, it tries to find a -``title`` public property in the ``article`` object. - -It also works if the property does not exist but is rather defined dynamically -thanks to the magic ``__get()`` method; you need to also implement the -``__isset()`` magic method like shown in the following snippet of code:: - - class Article - { - public function __get($name) - { - if ('title' == $name) { - return 'The title'; - } - - // throw some kind of error - } - - public function __isset($name) - { - if ('title' == $name) { - return true; - } - - return false; - } - } - -Accessing the parent Context in Nested Loops --------------------------------------------- - -Sometimes, when using nested loops, you need to access the parent context. The -parent context is always accessible via the ``loop.parent`` variable. For -instance, if you have the following template data:: - - $data = [ - 'topics' => [ - 'topic1' => ['Message 1 of topic 1', 'Message 2 of topic 1'], - 'topic2' => ['Message 1 of topic 2', 'Message 2 of topic 2'], - ], - ]; - -And the following template to display all messages in all topics: - -.. code-block:: twig - - {% for topic, messages in topics %} - * {{ loop.index }}: {{ topic }} - {% for message in messages %} - - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }} - {% endfor %} - {% endfor %} - -The output will be similar to: - -.. code-block:: text - - * 1: topic1 - - 1.1: The message 1 of topic 1 - - 1.2: The message 2 of topic 1 - * 2: topic2 - - 2.1: The message 1 of topic 2 - - 2.2: The message 2 of topic 2 - -In the inner loop, the ``loop.parent`` variable is used to access the outer -context. So, the index of the current ``topic`` defined in the outer for loop -is accessible via the ``loop.parent.loop.index`` variable. - -Defining undefined Functions and Filters on the Fly ---------------------------------------------------- - -When a function (or a filter) is not defined, Twig defaults to throw a -``\Twig\Error\SyntaxError`` exception. However, it can also call a `callback`_ (any -valid PHP callable) which should return a function (or a filter). - -For filters, register callbacks with ``registerUndefinedFilterCallback()``. -For functions, use ``registerUndefinedFunctionCallback()``:: - - // auto-register all native PHP functions as Twig functions - // don't try this at home as it's not secure at all! - $twig->registerUndefinedFunctionCallback(function ($name) { - if (function_exists($name)) { - return new \Twig\TwigFunction($name, $name); - } - - return false; - }); - -If the callable is not able to return a valid function (or filter), it must -return ``false``. - -If you register more than one callback, Twig will call them in turn until one -does not return ``false``. - -.. tip:: - - As the resolution of functions and filters is done during compilation, - there is no overhead when registering these callbacks. - -Validating the Template Syntax ------------------------------- - -When template code is provided by a third-party (through a web interface for -instance), it might be interesting to validate the template syntax before -saving it. If the template code is stored in a `$template` variable, here is -how you can do it:: - - try { - $twig->parse($twig->tokenize(new \Twig\Source($template))); - - // the $template is valid - } catch (\Twig\Error\SyntaxError $e) { - // $template contains one or more syntax errors - } - -If you iterate over a set of files, you can pass the filename to the -``tokenize()`` method to get the filename in the exception message:: - - foreach ($files as $file) { - try { - $twig->parse($twig->tokenize(new \Twig\Source($template, $file->getFilename(), $file))); - - // the $template is valid - } catch (\Twig\Error\SyntaxError $e) { - // $template contains one or more syntax errors - } - } - -.. note:: - - This method won't catch any sandbox policy violations because the policy - is enforced during template rendering (as Twig needs the context for some - checks like allowed methods on objects). - -Refreshing modified Templates when OPcache or APC is enabled ------------------------------------------------------------- - -When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC -with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template -cache won't update the cache. - -To get around this, force Twig to invalidate the bytecode cache:: - - $twig = new \Twig\Environment($loader, [ - 'cache' => new \Twig\Cache\FilesystemCache('/some/cache/path', \Twig\Cache\FilesystemCache::FORCE_BYTECODE_INVALIDATION), - // ... - ]); - -Reusing a stateful Node Visitor -------------------------------- - -When attaching a visitor to a ``\Twig\Environment`` instance, Twig uses it to -visit *all* templates it compiles. If you need to keep some state information -around, you probably want to reset it when visiting a new template. - -This can be easily achieved with the following code:: - - protected $someTemplateState = []; - - public function enterNode(\Twig\Node\Node $node, \Twig\Environment $env) - { - if ($node instanceof \Twig\Node\ModuleNode) { - // reset the state as we are entering a new template - $this->someTemplateState = []; - } - - // ... - - return $node; - } - -Using a Database to store Templates ------------------------------------ - -If you are developing a CMS, templates are usually stored in a database. This -recipe gives you a simple PDO template loader you can use as a starting point -for your own. - -First, let's create a temporary in-memory SQLite3 database to work with:: - - $dbh = new PDO('sqlite::memory:'); - $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)'); - $base = '{% block content %}{% endblock %}'; - $index = ' - {% extends "base.twig" %} - {% block content %}Hello {{ name }}{% endblock %} - '; - $now = time(); - $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['base.twig', $base, $now]); - $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['index.twig', $index, $now]); - -We have created a simple ``templates`` table that hosts two templates: -``base.twig`` and ``index.twig``. - -Now, let's define a loader able to use this database:: - - class DatabaseTwigLoader implements \Twig\Loader\LoaderInterface - { - protected $dbh; - - public function __construct(PDO $dbh) - { - $this->dbh = $dbh; - } - - public function getSourceContext($name) - { - if (false === $source = $this->getValue('source', $name)) { - throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name)); - } - - return new \Twig\Source($source, $name); - } - - public function exists($name) - { - return $name === $this->getValue('name', $name); - } - - public function getCacheKey($name) - { - return $name; - } - - public function isFresh($name, $time) - { - if (false === $lastModified = $this->getValue('last_modified', $name)) { - return false; - } - - return $lastModified <= $time; - } - - protected function getValue($column, $name) - { - $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name'); - $sth->execute([':name' => (string) $name]); - - return $sth->fetchColumn(); - } - } - -Finally, here is an example on how you can use it:: - - $loader = new DatabaseTwigLoader($dbh); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.twig', ['name' => 'Fabien']); - -Using different Template Sources --------------------------------- - -This recipe is the continuation of the previous one. Even if you store the -contributed templates in a database, you might want to keep the original/base -templates on the filesystem. When templates can be loaded from different -sources, you need to use the ``\Twig\Loader\ChainLoader`` loader. - -As you can see in the previous recipe, we reference the template in the exact -same way as we would have done it with a regular filesystem loader. This is -the key to be able to mix and match templates coming from the database, the -filesystem, or any other loader for that matter: the template name should be a -logical name, and not the path from the filesystem:: - - $loader1 = new DatabaseTwigLoader($dbh); - $loader2 = new \Twig\Loader\ArrayLoader([ - 'base.twig' => '{% block content %}{% endblock %}', - ]); - $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]); - - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.twig', ['name' => 'Fabien']); - -Now that the ``base.twig`` templates is defined in an array loader, you can -remove it from the database, and everything else will still work as before. - -Loading a Template from a String --------------------------------- - -From a template, you can easily load a template stored in a string via the -``template_from_string`` function (via the ``\Twig\Extension\StringLoaderExtension`` -extension): - -.. code-block:: twig - - {{ include(template_from_string("Hello {{ name }}")) }} - -From PHP, it's also possible to load a template stored in a string via -``\Twig\Environment::createTemplate()``:: - - $template = $twig->createTemplate('hello {{ name }}'); - echo $template->render(['name' => 'Fabien']); - -Using Twig and AngularJS in the same Templates ----------------------------------------------- - -Mixing different template syntaxes in the same file is not a recommended -practice as both AngularJS and Twig use the same delimiters in their syntax: -``{{`` and ``}}``. - -Still, if you want to use AngularJS and Twig in the same template, there are -two ways to make it work depending on the amount of AngularJS you need to -include in your templates: - -* Escaping the AngularJS delimiters by wrapping AngularJS sections with the - ``{% verbatim %}`` tag or by escaping each delimiter via ``{{ '{{' }}`` and - ``{{ '}}' }}``; - -* Changing the delimiters of one of the template engines (depending on which - engine you introduced last): - - * For AngularJS, change the interpolation tags using the - ``interpolateProvider`` service, for instance at the module initialization - time: - - .. code-block:: javascript - - angular.module('myApp', []).config(function($interpolateProvider) { - $interpolateProvider.startSymbol('{[').endSymbol(']}'); - }); - - * For Twig, change the delimiters via the ``tag_variable`` Lexer option: - - .. code-block:: php - - $env->setLexer(new \Twig\Lexer($env, [ - 'tag_variable' => ['{[', ']}'], - ])); - -.. _callback: https://secure.php.net/manual/en/function.is-callable.php diff --git a/system/backend/php/vendor/twig/twig/doc/tags/apply.rst b/system/backend/php/vendor/twig/twig/doc/tags/apply.rst deleted file mode 100644 index 2c3b00c0860..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/apply.rst +++ /dev/null @@ -1,23 +0,0 @@ -``apply`` -========= - -.. versionadded:: 2.9 - The ``apply`` tag was added in Twig 2.9. - -The ``apply`` tag allows you to apply Twig filters on a block of template data: - -.. code-block:: twig - - {% apply upper %} - This text becomes uppercase - {% endapply %} - -You can also chain filters and pass arguments to them: - -.. code-block:: twig - - {% apply lower|escape('html') %} - SOME TEXT - {% endapply %} - - {# outputs "<strong>some text</strong>" #} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/autoescape.rst b/system/backend/php/vendor/twig/twig/doc/tags/autoescape.rst deleted file mode 100644 index 520d779d0e1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/autoescape.rst +++ /dev/null @@ -1,61 +0,0 @@ -``autoescape`` -============== - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the ``autoescape`` tag: - -.. code-block:: twig - - {% autoescape %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'html' %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'js' %} - Everything will be automatically escaped in this block - using the js escaping strategy - {% endautoescape %} - - {% autoescape false %} - Everything will be outputted as is in this block - {% endautoescape %} - -When automatic escaping is enabled everything is escaped by default except for -values explicitly marked as safe. Those can be marked in the template by using -the :doc:`raw<../filters/raw>` filter: - -.. code-block:: twig - - {% autoescape %} - {{ safe_value|raw }} - {% endautoescape %} - -Functions returning template data (like :doc:`macros` and -:doc:`parent<../functions/parent>`) always return safe markup. - -.. note:: - - Twig is smart enough to not escape an already escaped value by the - :doc:`escape<../filters/escape>` filter. - -.. note:: - - Twig does not escape static expressions: - - .. code-block:: twig - - {% set hello = "Hello" %} - {{ hello }} - {{ "world" }} - - Will be rendered "Hello **world**". - -.. note:: - - The chapter :doc:`Twig for Developers<../api>` gives more information - about when and how automatic escaping is applied. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/block.rst b/system/backend/php/vendor/twig/twig/doc/tags/block.rst deleted file mode 100644 index e3804823250..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/block.rst +++ /dev/null @@ -1,11 +0,0 @@ -``block`` -========= - -Blocks are used for inheritance and act as placeholders and replacements at -the same time. They are documented in detail in the documentation for the -:doc:`extends<../tags/extends>` tag. - -Block names should consist of alphanumeric characters, and underscores. Dashes -are not permitted. - -.. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>` diff --git a/system/backend/php/vendor/twig/twig/doc/tags/deprecated.rst b/system/backend/php/vendor/twig/twig/doc/tags/deprecated.rst deleted file mode 100644 index 70b81f81130..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/deprecated.rst +++ /dev/null @@ -1,30 +0,0 @@ -``deprecated`` -============== - -.. versionadded:: 2.6 - The ``deprecated`` tag was added in Twig 2.6. - -Twig generates a deprecation notice (via a call to the ``trigger_error()`` -PHP function) where the ``deprecated`` tag is used in a template: - -.. code-block:: twig - - {# base.twig #} - {% deprecated 'The "base.twig" template is deprecated, use "layout.twig" instead.' %} - {% extends 'layout.twig' %} - -Also you can deprecate a block in the following way: - -.. code-block:: twig - - {% block hey %} - {% deprecated 'The "hey" block is deprecated, use "greet" instead.' %} - {{ block('greet') }} - {% endblock %} - - {% block greet %} - Hey you! - {% endblock %} - -Note that by default, the deprecation notices are silenced and never displayed nor logged. -See :ref:`deprecation-notices` to learn how to handle them. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/do.rst b/system/backend/php/vendor/twig/twig/doc/tags/do.rst deleted file mode 100644 index b8fe9f08b66..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/do.rst +++ /dev/null @@ -1,9 +0,0 @@ -``do`` -====== - -The ``do`` tag works exactly like the regular variable expression (``{{ ... -}}``) just that it doesn't print anything: - -.. code-block:: twig - - {% do 1 + 2 %} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/embed.rst b/system/backend/php/vendor/twig/twig/doc/tags/embed.rst deleted file mode 100644 index 3ee166698be..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/embed.rst +++ /dev/null @@ -1,175 +0,0 @@ -``embed`` -========= - -The ``embed`` tag combines the behaviour of :doc:`include` and -:doc:`extends`. -It allows you to include another template's contents, just like ``include`` -does. But it also allows you to override any block defined inside the -included template, like when extending a template. - -Think of an embedded template as a "micro layout skeleton". - -.. code-block:: twig - - {% embed "teasers_skeleton.twig" %} - {# These blocks are defined in "teasers_skeleton.twig" #} - {# and we override them right here: #} - {% block left_teaser %} - Some content for the left teaser box - {% endblock %} - {% block right_teaser %} - Some content for the right teaser box - {% endblock %} - {% endembed %} - -The ``embed`` tag takes the idea of template inheritance to the level of -content fragments. While template inheritance allows for "document skeletons", -which are filled with life by child templates, the ``embed`` tag allows you to -create "skeletons" for smaller units of content and re-use and fill them -anywhere you like. - -Since the use case may not be obvious, let's look at a simplified example. -Imagine a base template shared by multiple HTML pages, defining a single block -named "content": - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ │ │ - │ │ (child template to │ │ - │ │ put content here) │ │ - │ │ │ │ - │ │ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Some pages ("foo" and "bar") share the same content structure - -two vertically stacked boxes: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ ┌─ block "top" ───┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ │ ┌─ block "bottom" ┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -While other pages ("boom" and "baz") share a different content structure - -two boxes side by side: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ ┌ block ┐ ┌ block ┐ │ │ - │ │ │"left" │ │"right"│ │ │ - │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ - │ │ └───────┘ └───────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Without the ``embed`` tag, you have two ways to design your templates: - -* Create two "intermediate" base templates that extend the master layout - template: one with vertically stacked boxes to be used by the "foo" and - "bar" pages and another one with side-by-side boxes for the "boom" and - "baz" pages. - -* Embed the markup for the top/bottom and left/right boxes into each page - template directly. - -These two solutions do not scale well because they each have a major drawback: - -* The first solution may indeed work for this simplified example. But imagine - we add a sidebar, which may again contain different, recurring structures - of content. Now we would need to create intermediate base templates for - all occurring combinations of content structure and sidebar structure... - and so on. - -* The second solution involves duplication of common code with all its negative - consequences: any change involves finding and editing all affected copies - of the structure, correctness has to be verified for each copy, copies may - go out of sync by careless modifications etc. - -In such a situation, the ``embed`` tag comes in handy. The common layout -code can live in a single base template, and the two different content structures, -let's call them "micro layouts" go into separate templates which are embedded -as necessary: - -Page template ``foo.twig``: - -.. code-block:: twig - - {% extends "layout_skeleton.twig" %} - - {% block content %} - {% embed "vertical_boxes_skeleton.twig" %} - {% block top %} - Some content for the top box - {% endblock %} - - {% block bottom %} - Some content for the bottom box - {% endblock %} - {% endembed %} - {% endblock %} - -And here is the code for ``vertical_boxes_skeleton.twig``: - -.. code-block:: html+twig - -
- {% block top %} - Top box default content - {% endblock %} -
- -
- {% block bottom %} - Bottom box default content - {% endblock %} -
- -The goal of the ``vertical_boxes_skeleton.twig`` template being to factor -out the HTML markup for the boxes. - -The ``embed`` tag takes the exact same arguments as the ``include`` tag: - -.. code-block:: twig - - {% embed "base" with {'foo': 'bar'} %} - ... - {% endembed %} - - {% embed "base" with {'foo': 'bar'} only %} - ... - {% endembed %} - - {% embed "base" ignore missing %} - ... - {% endembed %} - -.. warning:: - - As embedded templates do not have "names", auto-escaping strategies based - on the template name won't work as expected if you change the context (for - instance, if you embed a CSS/JavaScript template into an HTML one). In that - case, explicitly set the default auto-escaping strategy with the - ``autoescape`` tag. - -.. seealso:: :doc:`include<../tags/include>` diff --git a/system/backend/php/vendor/twig/twig/doc/tags/extends.rst b/system/backend/php/vendor/twig/twig/doc/tags/extends.rst deleted file mode 100644 index e0f401d143b..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/extends.rst +++ /dev/null @@ -1,265 +0,0 @@ -``extends`` -=========== - -The ``extends`` tag can be used to extend a template from another one. - -.. note:: - - Like PHP, Twig does not support multiple inheritance. So you can only have - one extends tag called per rendering. However, Twig supports horizontal - :doc:`reuse`. - -Let's define a base template, ``base.html``, which defines a simple HTML -skeleton document: - -.. code-block:: html+twig - - - - - {% block head %} - - {% block title %}{% endblock %} - My Webpage - {% endblock %} - - -
{% block content %}{% endblock %}
- - - - -In this example, the :doc:`block` tags define four blocks that child -templates can fill in. - -All the ``block`` tag does is to tell the template engine that a child -template may override those portions of the template. - -Child Template --------------- - -A child template might look like this: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - - {% endblock %} - {% block content %} -

Index

-

- Welcome on my awesome homepage. -

- {% endblock %} - -The ``extends`` tag is the key here. It tells the template engine that this -template "extends" another template. When the template system evaluates this -template, first it locates the parent. The extends tag should be the first tag -in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -You can't define multiple ``block`` tags with the same name in the same -template. This limitation exists because a block tag works in "both" -directions. That is, a block tag doesn't just provide a hole to fill - it also -defines the content that fills the hole in the *parent*. If there were two -similarly-named ``block`` tags in a template, that template's parent wouldn't -know which one of the blocks' content to use. - -If you want to print a block multiple times you can however use the -``block`` function: - -.. code-block:: twig - - {% block title %}{% endblock %} -

{{ block('title') }}

- {% block body %}{% endblock %} - -Parent Blocks -------------- - -It's possible to render the contents of the parent block by using the -:doc:`parent<../functions/parent>` function. This gives back the results of -the parent block: - -.. code-block:: twig - - {% block sidebar %} -

Table Of Contents

- ... - {{ parent() }} - {% endblock %} - -Named Block End-Tags --------------------- - -Twig allows you to put the name of the block after the end tag for better -readability: - -.. code-block:: twig - - {% block sidebar %} - {% block inner_sidebar %} - ... - {% endblock inner_sidebar %} - {% endblock sidebar %} - -Of course, the name after the ``endblock`` word must match the block name. - -Block Nesting and Scope ------------------------ - -Blocks can be nested for more complex layouts. Per default, blocks have access -to variables from outer scopes: - -.. code-block:: twig - - {% for item in seq %} -
  • {% block loop_item %}{{ item }}{% endblock %}
  • - {% endfor %} - -Block Shortcuts ---------------- - -For blocks with little content, it's possible to use a shortcut syntax. The -following constructs do the same thing: - -.. code-block:: twig - - {% block title %} - {{ page_title|title }} - {% endblock %} - -.. code-block:: twig - - {% block title page_title|title %} - -Dynamic Inheritance -------------------- - -Twig supports dynamic inheritance by using a variable as the base template: - -.. code-block:: twig - - {% extends some_var %} - -If the variable evaluates to a ``\Twig\Template`` or a ``\Twig\TemplateWrapper`` -instance, Twig will use it as the parent template:: - - // {% extends layout %} - - $layout = $twig->load('some_layout_template.twig'); - - $twig->display('template.twig', ['layout' => $layout]); - -You can also provide a list of templates that are checked for existence. The -first template that exists will be used as a parent: - -.. code-block:: twig - - {% extends ['layout.html', 'base_layout.html'] %} - -Conditional Inheritance ------------------------ - -As the template name for the parent can be any valid Twig expression, it's -possible to make the inheritance mechanism conditional: - -.. code-block:: twig - - {% extends standalone ? "minimum.html" : "base.html" %} - -In this example, the template will extend the "minimum.html" layout template -if the ``standalone`` variable evaluates to ``true``, and "base.html" -otherwise. - -How do blocks work? -------------------- - -A block provides a way to change how a certain part of a template is rendered -but it does not interfere in any way with the logic around it. - -Let's take the following example to illustrate how a block works and more -importantly, how it does not work: - -.. code-block:: twig - - {# base.twig #} - - {% for post in posts %} - {% block post %} -

    {{ post.title }}

    -

    {{ post.body }}

    - {% endblock %} - {% endfor %} - -If you render this template, the result would be exactly the same with or -without the ``block`` tag. The ``block`` inside the ``for`` loop is just a way -to make it overridable by a child template: - -.. code-block:: twig - - {# child.twig #} - - {% extends "base.twig" %} - - {% block post %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endblock %} - -Now, when rendering the child template, the loop is going to use the block -defined in the child template instead of the one defined in the base one; the -executed template is then equivalent to the following one: - -.. code-block:: twig - - {% for post in posts %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endfor %} - -Let's take another example: a block included within an ``if`` statement: - -.. code-block:: twig - - {% if posts is empty %} - {% block head %} - {{ parent() }} - - - {% endblock head %} - {% endif %} - -Contrary to what you might think, this template does not define a block -conditionally; it just makes overridable by a child template the output of -what will be rendered when the condition is ``true``. - -If you want the output to be displayed conditionally, use the following -instead: - -.. code-block:: twig - - {% block head %} - {{ parent() }} - - {% if posts is empty %} - - {% endif %} - {% endblock head %} - -.. seealso:: :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>` diff --git a/system/backend/php/vendor/twig/twig/doc/tags/filter.rst b/system/backend/php/vendor/twig/twig/doc/tags/filter.rst deleted file mode 100644 index f225fb25139..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/filter.rst +++ /dev/null @@ -1,26 +0,0 @@ -``filter`` -========== - -.. note:: - - As of Twig 2.9, you should use the ``apply`` tag instead which does the - same thing except that the wrapped template data is not scoped. - -Filter sections allow you to apply regular Twig filters on a block of template -data. Just wrap the code in the special ``filter`` section: - -.. code-block:: twig - - {% filter upper %} - This text becomes uppercase - {% endfilter %} - -You can also chain filters and pass arguments to them: - -.. code-block:: twig - - {% filter lower|escape('html') %} - SOME TEXT - {% endfilter %} - - {# outputs "<strong>some text</strong>" #} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/flush.rst b/system/backend/php/vendor/twig/twig/doc/tags/flush.rst deleted file mode 100644 index 332e9825145..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/flush.rst +++ /dev/null @@ -1,14 +0,0 @@ -``flush`` -========= - -The ``flush`` tag tells Twig to flush the output buffer: - -.. code-block:: twig - - {% flush %} - -.. note:: - - Internally, Twig uses the PHP `flush`_ function. - -.. _`flush`: https://secure.php.net/flush diff --git a/system/backend/php/vendor/twig/twig/doc/tags/for.rst b/system/backend/php/vendor/twig/twig/doc/tags/for.rst deleted file mode 100644 index 8e9b4e58246..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/for.rst +++ /dev/null @@ -1,176 +0,0 @@ -``for`` -======= - -Loop over each item in a sequence. For example, to display a list of users -provided in a variable called ``users``: - -.. code-block:: twig - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -.. note:: - - A sequence can be either an array or an object implementing the - ``Traversable`` interface. - -If you do need to iterate over a sequence of numbers, you can use the ``..`` -operator: - -.. code-block:: twig - - {% for i in 0..10 %} - * {{ i }} - {% endfor %} - -The above snippet of code would print all numbers from 0 to 10. - -It can be also useful with letters: - -.. code-block:: twig - - {% for letter in 'a'..'z' %} - * {{ letter }} - {% endfor %} - -The ``..`` operator can take any expression at both sides: - -.. code-block:: twig - - {% for letter in 'a'|upper..'z'|upper %} - * {{ letter }} - {% endfor %} - -.. tip: - - If you need a step different from 1, you can use the ``range`` function - instead. - -The `loop` variable -------------------- - -Inside of a ``for`` loop block you can access some special variables: - -===================== ============================================================= -Variable Description -===================== ============================================================= -``loop.index`` The current iteration of the loop. (1 indexed) -``loop.index0`` The current iteration of the loop. (0 indexed) -``loop.revindex`` The number of iterations from the end of the loop (1 indexed) -``loop.revindex0`` The number of iterations from the end of the loop (0 indexed) -``loop.first`` True if first iteration -``loop.last`` True if last iteration -``loop.length`` The number of items in the sequence -``loop.parent`` The parent context -===================== ============================================================= - -.. code-block:: twig - - {% for user in users %} - {{ loop.index }} - {{ user.username }} - {% endfor %} - -.. note:: - - The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and - ``loop.last`` variables are only available for PHP arrays, or objects that - implement the ``Countable`` interface. They are also not available when - looping with a condition. - -Adding a condition ------------------- - -.. tip:: - - As of Twig 2.10, use the :doc:`filter <../filters/filter>` filter instead, - or an ``if`` condition inside the ``for`` body (if your condition depends on - a variable updated inside the loop and you are not using the ``loop`` - variable). - -Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You -can however filter the sequence during iteration which allows you to skip -items. The following example skips all the users which are not active: - -.. code-block:: twig - -
      - {% for user in users if user.active %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The advantage is that the special loop variable will count correctly thus not -counting the users not iterated over. Keep in mind that properties like -``loop.last`` will not be defined when using loop conditions. - -.. note:: - - Using the ``loop`` variable within the condition is not recommended as it - will probably not be doing what you expect it to. For instance, adding a - condition like ``loop.index > 4`` won't work as the index is only - incremented when the condition is true (so the condition will never - match). - -The `else` Clause ------------------ - -If no iteration took place because the sequence was empty, you can render a -replacement block by using ``else``: - -.. code-block:: twig - -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% else %} -
    • no user found
    • - {% endfor %} -
    - -Iterating over Keys -------------------- - -By default, a loop iterates over the values of the sequence. You can iterate -on keys by using the ``keys`` filter: - -.. code-block:: twig - -

    Members

    -
      - {% for key in users|keys %} -
    • {{ key }}
    • - {% endfor %} -
    - -Iterating over Keys and Values ------------------------------- - -You can also access both keys and values: - -.. code-block:: twig - -

    Members

    -
      - {% for key, user in users %} -
    • {{ key }}: {{ user.username|e }}
    • - {% endfor %} -
    - -Iterating over a Subset ------------------------ - -You might want to iterate over a subset of values. This can be achieved using -the :doc:`slice <../filters/slice>` filter: - -.. code-block:: twig - -

    Top Ten Members

    -
      - {% for user in users|slice(0, 10) %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    diff --git a/system/backend/php/vendor/twig/twig/doc/tags/from.rst b/system/backend/php/vendor/twig/twig/doc/tags/from.rst deleted file mode 100644 index 96c439aa74b..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/from.rst +++ /dev/null @@ -1,6 +0,0 @@ -``from`` -======== - -The ``from`` tag imports :doc:`macro<../tags/macro>` names into the current -namespace. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/if.rst b/system/backend/php/vendor/twig/twig/doc/tags/if.rst deleted file mode 100644 index 2a1610c822a..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/if.rst +++ /dev/null @@ -1,79 +0,0 @@ -``if`` -====== - -The ``if`` statement in Twig is comparable with the if statements of PHP. - -In the simplest form you can use it to test if an expression evaluates to -``true``: - -.. code-block:: twig - - {% if online == false %} -

    Our website is in maintenance mode. Please, come back later.

    - {% endif %} - -You can also test if an array is not empty: - -.. code-block:: twig - - {% if users %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -.. note:: - - If you want to test if the variable is defined, use ``if users is - defined`` instead. - -You can also use ``not`` to check for values that evaluate to ``false``: - -.. code-block:: twig - - {% if not user.subscribed %} -

    You are not subscribed to our mailing list.

    - {% endif %} - -For multiple conditions, ``and`` and ``or`` can be used: - -.. code-block:: twig - - {% if temperature > 18 and temperature < 27 %} -

    It's a nice day for a walk in the park.

    - {% endif %} - -For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can -use more complex ``expressions`` there too: - -.. code-block:: twig - - {% if product.stock > 10 %} - Available - {% elseif product.stock > 0 %} - Only {{ product.stock }} left! - {% else %} - Sold-out! - {% endif %} - -.. note:: - - The rules to determine if an expression is ``true`` or ``false`` are the - same as in PHP; here are the edge cases rules: - - ====================== ==================== - Value Boolean evaluation - ====================== ==================== - empty string false - numeric zero false - NAN (Not A Number) true - INF (Infinity) true - whitespace-only string true - string "0" or '0' false - empty array false - null false - non-empty array true - object true - ====================== ==================== diff --git a/system/backend/php/vendor/twig/twig/doc/tags/import.rst b/system/backend/php/vendor/twig/twig/doc/tags/import.rst deleted file mode 100644 index f217479fb38..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/import.rst +++ /dev/null @@ -1,6 +0,0 @@ -``import`` -========== - -The ``import`` tag imports :doc:`macro<../tags/macro>` names in a local -variable. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/include.rst b/system/backend/php/vendor/twig/twig/doc/tags/include.rst deleted file mode 100644 index 9797af1b522..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/include.rst +++ /dev/null @@ -1,111 +0,0 @@ -``include`` -=========== - -The ``include`` statement includes a template and returns the rendered content -of that file: - -.. code-block:: twig - - {% include 'header.html' %} - Body - {% include 'footer.html' %} - -.. note:: - - As of Twig 1.12, it is recommended to use the - :doc:`include<../functions/include>` function instead as it provides the - same features with a bit more flexibility: - - * The ``include`` function is semantically more "correct" (including a - template outputs its rendered contents in the current scope; a tag should - not display anything); - - * The ``include`` function is more "composable": - - .. code-block:: twig - - {# Store a rendered template in a variable #} - {% set content %} - {% include 'template.html' %} - {% endset %} - {# vs #} - {% set content = include('template.html') %} - - {# Filter a rendered template #} - {% filter upper %} - {% include 'template.html' %} - {% endfilter %} - {# vs #} - {% include('template.html')|upper %} - - * The ``include`` function does not impose any specific order for - arguments thanks to :ref:`named arguments `. - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -You can add additional variables by passing them after the ``with`` keyword: - -.. code-block:: twig - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {% include 'template.html' with {'foo': 'bar'} %} - - {% set vars = {'foo': 'bar'} %} - {% include 'template.html' with vars %} - -You can disable access to the context by appending the ``only`` keyword: - -.. code-block:: twig - - {# only the foo variable will be accessible #} - {% include 'template.html' with {'foo': 'bar'} only %} - -.. code-block:: twig - - {# no variables will be accessible #} - {% include 'template.html' only %} - -.. tip:: - - When including a template created by an end user, you should consider - sandboxing it. More information in the :doc:`Twig for Developers<../api>` - chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation. - -The template name can be any valid Twig expression: - -.. code-block:: twig - - {% include some_var %} - {% include ajax ? 'ajax.html' : 'not_ajax.html' %} - -And if the expression evaluates to a ``\Twig\Template`` or a -``\Twig\TemplateWrapper`` instance, Twig will use it directly:: - - // {% include template %} - - $template = $twig->load('some_template.twig'); - - $twig->display('template.twig', ['template' => $template]); - -You can mark an include with ``ignore missing`` in which case Twig will ignore -the statement if the template to be included does not exist. It has to be -placed just after the template name. Here some valid examples: - -.. code-block:: twig - - {% include 'sidebar.html' ignore missing %} - {% include 'sidebar.html' ignore missing with {'foo': 'bar'} %} - {% include 'sidebar.html' ignore missing only %} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be included: - -.. code-block:: twig - - {% include ['page_detailed.html', 'page.html'] %} - -If ``ignore missing`` is given, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/index.rst b/system/backend/php/vendor/twig/twig/doc/tags/index.rst deleted file mode 100644 index 530f95f1005..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/index.rst +++ /dev/null @@ -1,27 +0,0 @@ -Tags -==== - -.. toctree:: - :maxdepth: 1 - - apply - autoescape - block - deprecated - do - embed - extends - filter - flush - for - from - if - import - include - macro - sandbox - set - spaceless - use - verbatim - with diff --git a/system/backend/php/vendor/twig/twig/doc/tags/macro.rst b/system/backend/php/vendor/twig/twig/doc/tags/macro.rst deleted file mode 100644 index 33808f5a8f5..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/macro.rst +++ /dev/null @@ -1,182 +0,0 @@ -``macro`` -========= - -Macros are comparable with functions in regular programming languages. They -are useful to reuse template fragments to not repeat yourself. - -Macros are defined in regular templates. - -Imagine having a generic helper template that define how to render HTML forms -via macros (called ``forms.html``): - -.. code-block:: twig - - {% macro input(name, value, type = "text", size = 20) %} - - {% endmacro %} - - {% macro textarea(name, value, rows = 10, cols = 40) %} - - {% endmacro %} - -Each macro argument can have a default value (here ``text`` is the default value -for ``type`` if not provided in the call). - -Macros differ from native PHP functions in a few ways: - -* Arguments of a macro are always optional. - -* If extra positional arguments are passed to a macro, they end up in the - special ``varargs`` variable as a list of values. - -But as with PHP functions, macros don't have access to the current template -variables. - -.. tip:: - - You can pass the whole context as an argument by using the special - ``_context`` variable. - -Importing Macros ----------------- - -There are two ways to import macros. You can import the complete template -containing the macros into a local variable (via the ``import`` tag) or only -import specific macros from the template (via the ``from`` tag). - -To import all macros from a template into a local variable, use the ``import`` -tag: - -.. code-block:: twig - - {% import "forms.html" as forms %} - -The above ``import`` call imports the ``forms.html`` file (which can contain -only macros, or a template and some macros), and import the macros as items of -the ``forms`` local variable. - -The macros can then be called at will in the *current* template: - -.. code-block:: twig - -

    {{ forms.input('username') }}

    -

    {{ forms.input('password', null, 'password') }}

    - -Alternatively you can import names from the template into the current namespace -via the ``from`` tag: - -.. code-block:: twig - - {% from 'forms.html' import input as input_field, textarea %} - -

    {{ input_field('password', '', 'password') }}

    -

    {{ textarea('comment') }}

    - -.. tip:: - - When macro usages and definitions are in the same template, you don't need to - import the macros as they are automatically available under the special - ``_self`` variable: - - .. code-block:: twig - -

    {{ _self.input('password', '', 'password') }}

    - - {% macro input(name, value, type = "text", size = 20) %} - - {% endmacro %} - - Auto-import is only available as of Twig 2.11. For older versions, import - macros using the special ``_self`` variable for the template name: - - .. code-block:: twig - - {% import _self as forms %} - -

    {{ forms.input('username') }}

    - -.. note:: - - Before Twig 2.11, when you want to use a macro in another macro from the - same file, you need to import it locally: - - .. code-block:: twig - - {% macro input(name, value, type, size) %} - - {% endmacro %} - - {% macro wrapped_input(name, value, type, size) %} - {% import _self as forms %} - -
    - {{ forms.input(name, value, type, size) }} -
    - {% endmacro %} - -Macros Scoping --------------- - -.. versionadded:: 2.11 - - The scoping rules described in this paragraph are implemented as of Twig - 2.11. - -The scoping rules are the same whether you imported macros via ``import`` or -``from``. - -Imported macros are always **local** to the current template. It means that -macros are available in all blocks and other macros defined in the current -template, but they are not available in included templates or child templates; -you need to explicitely re-import macros in each template. - -When calling ``import`` or ``from`` from a ``block`` tag, the imported macros -are only defined in the current block and they override macros defined at the -template level with the same names. - -When calling ``import`` or ``from`` from a ``macro`` tag, the imported macros -are only defined in the current macro and they override macros defined at the -template level with the same names. - -.. note:: - - Before Twig 2.11, it was possible to use macros imported in a block in a - "sub-block". When upgrading to 2.11, you need to either move the import in - the global scope or reimport the macros explicitly in the "sub-blocks". - -Checking if a Macro is defined ------------------------------- - -.. versionadded:: 2.11 - - Support for the ``defined`` test on macros was added in Twig 2.11. - -You can check if a macro is defined via the ``defined`` test: - -.. code-block:: twig - - {% import "macros.twig" as macros %} - - {% from "macros.twig" import hello %} - - {% if macros.hello is defined -%} - OK - {% endif %} - - {% if hello is defined -%} - OK - {% endif %} - -Named Macro End-Tags --------------------- - -Twig allows you to put the name of the macro after the end tag for better -readability: - -.. code-block:: twig - - {% macro input() %} - ... - {% endmacro input %} - -Of course, the name after the ``endmacro`` word must match the macro name. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/sandbox.rst b/system/backend/php/vendor/twig/twig/doc/tags/sandbox.rst deleted file mode 100644 index b331fdb8e69..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/sandbox.rst +++ /dev/null @@ -1,30 +0,0 @@ -``sandbox`` -=========== - -The ``sandbox`` tag can be used to enable the sandboxing mode for an included -template, when sandboxing is not enabled globally for the Twig environment: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -.. warning:: - - The ``sandbox`` tag is only available when the sandbox extension is - enabled (see the :doc:`Twig for Developers<../api>` chapter). - -.. note:: - - The ``sandbox`` tag can only be used to sandbox an include tag and it - cannot be used to sandbox a section of a template. The following example - won't work: - - .. code-block:: twig - - {% sandbox %} - {% for i in 1..2 %} - {{ i }} - {% endfor %} - {% endsandbox %} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/set.rst b/system/backend/php/vendor/twig/twig/doc/tags/set.rst deleted file mode 100644 index f752fddb67b..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/set.rst +++ /dev/null @@ -1,78 +0,0 @@ -``set`` -======= - -Inside code blocks you can also assign values to variables. Assignments use -the ``set`` tag and can have multiple targets. - -Here is how you can assign the ``bar`` value to the ``foo`` variable: - -.. code-block:: twig - - {% set foo = 'bar' %} - -After the ``set`` call, the ``foo`` variable is available in the template like -any other ones: - -.. code-block:: twig - - {# displays bar #} - {{ foo }} - -The assigned value can be any valid :ref:`Twig expression -`: - -.. code-block:: twig - - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - {% set foo = 'foo' ~ 'bar' %} - -Several variables can be assigned in one block: - -.. code-block:: twig - - {% set foo, bar = 'foo', 'bar' %} - - {# is equivalent to #} - - {% set foo = 'foo' %} - {% set bar = 'bar' %} - -The ``set`` tag can also be used to 'capture' chunks of text: - -.. code-block:: twig - - {% set foo %} - - {% endset %} - -.. caution:: - - If you enable automatic output escaping, Twig will only consider the - content to be safe when capturing chunks of text. - -.. note:: - - Note that loops are scoped in Twig; therefore a variable declared inside a - ``for`` loop is not accessible outside the loop itself: - - .. code-block:: twig - - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is NOT available #} - - If you want to access the variable, just declare it before the loop: - - .. code-block:: twig - - {% set foo = "" %} - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is available #} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/spaceless.rst b/system/backend/php/vendor/twig/twig/doc/tags/spaceless.rst deleted file mode 100644 index 2608538aae6..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/spaceless.rst +++ /dev/null @@ -1,41 +0,0 @@ -``spaceless`` -============= - -.. tip:: - - As of Twig 1.38, use the :doc:`spaceless <../filters/spaceless>` filter instead. - -Use the ``spaceless`` tag to remove whitespace *between HTML tags*, not -whitespace within HTML tags or whitespace in plain text: - -.. code-block:: twig - - {% spaceless %} -
    - foo -
    - {% endspaceless %} - - {# output will be
    foo
    #} - -This tag is not meant to "optimize" the size of the generated HTML content but -merely to avoid extra whitespace between HTML tags to avoid browser rendering -quirks under some circumstances. - -.. tip:: - - If you want to optimize the size of the generated HTML content, gzip - compress the output instead. - -.. tip:: - - If you want to create a tag that actually removes all extra whitespace in - an HTML string, be warned that this is not as easy as it seems to be - (think of ``textarea`` or ``pre`` tags for instance). Using a third-party - library like Tidy is probably a better idea. - -.. tip:: - - For more information on whitespace control, read the - :ref:`dedicated section ` of the documentation and learn how - you can also use the whitespace control modifier on your tags. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/use.rst b/system/backend/php/vendor/twig/twig/doc/tags/use.rst deleted file mode 100644 index 2aca6a01fb4..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/use.rst +++ /dev/null @@ -1,117 +0,0 @@ -``use`` -======= - -.. note:: - - Horizontal reuse is an advanced Twig feature that is hardly ever needed in - regular templates. It is mainly used by projects that need to make - template blocks reusable without using inheritance. - -Template inheritance is one of the most powerful features of Twig but it is -limited to single inheritance; a template can only extend one other template. -This limitation makes template inheritance simple to understand and easy to -debug: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -Horizontal reuse is a way to achieve the same goal as multiple inheritance, -but without the associated complexity: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``use`` statement tells Twig to import the blocks defined in -``blocks.html`` into the current template (it's like macros, but for blocks): - -.. code-block:: twig - - {# blocks.html #} - - {% block sidebar %}{% endblock %} - -In this example, the ``use`` statement imports the ``sidebar`` block into the -main template. The code is mostly equivalent to the following one (the -imported blocks are not outputted automatically): - -.. code-block:: twig - - {% extends "base.html" %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -.. note:: - - The ``use`` tag only imports a template if it does not extend another - template, if it does not define macros, and if the body is empty. But it - can *use* other templates. - -.. note:: - - Because ``use`` statements are resolved independently of the context - passed to the template, the template reference cannot be an expression. - -The main template can also override any imported block. If the template -already defines the ``sidebar`` block, then the one defined in ``blocks.html`` -is ignored. To avoid name conflicts, you can rename imported blocks: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as base_sidebar, title as base_title %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``parent()`` function automatically determines the correct inheritance -tree, so it can be used when overriding a block defined in an imported -template: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block sidebar %} - {{ parent() }} - {% endblock %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -In this example, ``parent()`` will correctly call the ``sidebar`` block from -the ``blocks.html`` template. - -.. tip:: - - Renaming allows you to simulate inheritance by calling the "parent" block: - - .. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as parent_sidebar %} - - {% block sidebar %} - {{ block('parent_sidebar') }} - {% endblock %} - -.. note:: - - You can use as many ``use`` statements as you want in any given template. - If two imported templates define the same block, the latest one wins. diff --git a/system/backend/php/vendor/twig/twig/doc/tags/verbatim.rst b/system/backend/php/vendor/twig/twig/doc/tags/verbatim.rst deleted file mode 100644 index 88c615285e4..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/verbatim.rst +++ /dev/null @@ -1,16 +0,0 @@ -``verbatim`` -============ - -The ``verbatim`` tag marks sections as being raw text that should not be -parsed. For example to put Twig syntax as example into a template you can use -this snippet: - -.. code-block:: twig - - {% verbatim %} -
      - {% for item in seq %} -
    • {{ item }}
    • - {% endfor %} -
    - {% endverbatim %} diff --git a/system/backend/php/vendor/twig/twig/doc/tags/with.rst b/system/backend/php/vendor/twig/twig/doc/tags/with.rst deleted file mode 100644 index 107432f6fc8..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tags/with.rst +++ /dev/null @@ -1,41 +0,0 @@ -``with`` -======== - -Use the ``with`` tag to create a new inner scope. Variables set within this -scope are not visible outside of the scope: - -.. code-block:: twig - - {% with %} - {% set foo = 42 %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - -Instead of defining variables at the beginning of the scope, you can pass a -hash of variables you want to define in the ``with`` tag; the previous example -is equivalent to the following one: - -.. code-block:: twig - - {% with { foo: 42 } %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - - {# it works with any expression that resolves to a hash #} - {% set vars = { foo: 42 } %} - {% with vars %} - ... - {% endwith %} - -By default, the inner scope has access to the outer scope context; you can -disable this behavior by appending the ``only`` keyword: - -.. code-block:: twig - - {% set bar = 'bar' %} - {% with { foo: 42 } only %} - {# only foo is defined #} - {# bar is not defined #} - {% endwith %} diff --git a/system/backend/php/vendor/twig/twig/doc/templates.rst b/system/backend/php/vendor/twig/twig/doc/templates.rst deleted file mode 100644 index 3aa3ea96f94..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/templates.rst +++ /dev/null @@ -1,869 +0,0 @@ -Twig for Template Designers -=========================== - -This document describes the syntax and semantics of the template engine and -will be most useful as reference to those creating Twig templates. - -Synopsis --------- - -A template is a regular text file. It can generate any text-based format (HTML, -XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or -``.xml`` are just fine. - -A template contains **variables** or **expressions**, which get replaced with -values when the template is evaluated, and **tags**, which control the -template's logic. - -Below is a minimal template that illustrates a few basics. We will cover further -details later on: - -.. code-block:: html+twig - - - - - My Webpage - - - - -

    My Webpage

    - {{ a_variable }} - - - -There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first -one is used to execute statements such as for-loops, the latter outputs the -result of an expression. - -IDEs Integration ----------------- - -Many IDEs support syntax highlighting and auto-completion for Twig: - -* *Textmate* via the `Twig bundle`_ -* *Vim* via the `Jinja syntax plugin`_ or the `vim-twig plugin`_ -* *Netbeans* via the `Twig syntax plugin`_ (until 7.1, native as of 7.2) -* *PhpStorm* (native as of 2.1) -* *Eclipse* via the `Twig plugin`_ -* *Sublime Text* via the `Twig bundle`_ -* *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects) -* *Coda* and *SubEthaEdit* via the `Twig syntax mode`_ -* *Coda 2* via the `other Twig syntax mode`_ -* *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode -* *Notepad++* via the `Notepad++ Twig Highlighter`_ -* *Emacs* via `web-mode.el`_ -* *Atom* via the `PHP-twig for atom`_ -* *Visual Studio Code* via the `Twig pack`_ - -Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates -from a browser; it supports all versions of Twig. - -Variables ---------- - -The application passes variables to the templates for manipulation in the -template. Variables may have attributes or elements you can access, too. The -visual representation of a variable depends heavily on the application providing -it. - -Use a dot (``.``) to access attributes of a variable (methods or properties of a -PHP object, or items of a PHP array): - -.. code-block:: twig - - {{ foo.bar }} - -.. note:: - - It's important to know that the curly braces are *not* part of the - variable but the print statement. When accessing variables inside tags, - don't put the braces around them. - -.. sidebar:: Implementation - - For convenience's sake ``foo.bar`` does the following things on the PHP - layer: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid property; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid method - (even if ``bar`` is the constructor - use ``__construct()`` instead); - * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``hasBar`` is a valid method; - * if not, return a ``null`` value. - - Twig also supports a specific syntax for accessing items on PHP arrays, - ``foo['bar']``: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, return a ``null`` value. - -If a variable or attribute does not exist, you will receive a ``null`` value -when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables`` -is set, Twig will throw an error (see :ref:`environment options`). - -.. note:: - - If you want to access a dynamic attribute of a variable, use the - :doc:`attribute` function instead. - - The ``attribute`` function is also useful when the attribute contains - special characters (like ``-`` that would be interpreted as the minus - operator): - - .. code-block:: twig - - {# equivalent to the non-working foo.data-foo #} - {{ attribute(foo, 'data-foo') }} - -Global Variables -~~~~~~~~~~~~~~~~ - -The following variables are always available in templates: - -* ``_self``: references the current template name; -* ``_context``: references the current context; -* ``_charset``: references the current charset. - -Setting Variables -~~~~~~~~~~~~~~~~~ - -You can assign values to variables inside code blocks. Assignments use the -:doc:`set` tag: - -.. code-block:: twig - - {% set foo = 'foo' %} - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - -Filters -------- - -Variables can be modified by **filters**. Filters are separated from the -variable by a pipe symbol (``|``). Multiple filters can be chained. The output -of one filter is applied to the next. - -The following example removes all HTML tags from the ``name`` and title-cases -it: - -.. code-block:: twig - - {{ name|striptags|title }} - -Filters that accept arguments have parentheses around the arguments. This -example joins the elements of a list by commas: - -.. code-block:: twig - - {{ list|join(', ') }} - -To apply a filter on a section of code, wrap it with the -:doc:`apply` tag: - -.. code-block:: twig - - {% apply upper %} - This text becomes uppercase - {% endapply %} - -Go to the :doc:`filters` page to learn more about built-in -filters. - -.. note:: - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -Functions ---------- - -Functions can be called to generate content. Functions are called by their -name followed by parentheses (``()``) and may have arguments. - -For instance, the ``range`` function returns a list containing an arithmetic -progression of integers: - -.. code-block:: twig - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - -Go to the :doc:`functions` page to learn more about the -built-in functions. - -.. _named-arguments: - -Named Arguments ---------------- - -.. code-block:: twig - - {% for i in range(low=1, high=10, step=2) %} - {{ i }}, - {% endfor %} - -Using named arguments makes your templates more explicit about the meaning of -the values you pass as arguments: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - - {# versus #} - - {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }} - -Named arguments also allow you to skip some arguments for which you don't want -to change the default value: - -.. code-block:: twig - - {# the first argument is the date format, which defaults to the global date format if null is passed #} - {{ "now"|date(null, "Europe/Paris") }} - - {# or skip the format value by using a named argument for the time zone #} - {{ "now"|date(timezone="Europe/Paris") }} - -You can also use both positional and named arguments in one call, in which -case positional arguments must always come before named arguments: - -.. code-block:: twig - - {{ "now"|date('d/m/Y H:i', timezone="Europe/Paris") }} - -.. tip:: - - Each function and filter documentation page has a section where the names - of all arguments are listed when supported. - -Control Structure ------------------ - -A control structure refers to all those things that control the flow of a -program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as -well as things like blocks. Control structures appear inside ``{% ... %}`` -blocks. - -For example, to display a list of users provided in a variable called -``users``, use the :doc:`for` tag: - -.. code-block:: twig - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The :doc:`if` tag can be used to test an expression: - -.. code-block:: twig - - {% if users|length > 0 %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -Go to the :doc:`tags` page to learn more about the built-in tags. - -Comments --------- - -To comment-out part of a line in a template, use the comment syntax ``{# ... -#}``. This is useful for debugging or to add information for other template -designers or yourself: - -.. code-block:: twig - - {# note: disabled template because we no longer use this - {% for user in users %} - ... - {% endfor %} - #} - -Including other Templates -------------------------- - -The :doc:`include` function is useful to include a template -and return the rendered content of that template into the current one: - -.. code-block:: twig - - {{ include('sidebar.html') }} - -By default, included templates have access to the same context as the template -which includes them. This means that any variable defined in the main template -will be available in the included template too: - -.. code-block:: twig - - {% for box in boxes %} - {{ include('render_box.html') }} - {% endfor %} - -The included template ``render_box.html`` is able to access the ``box`` variable. - -The name of the template depends on the template loader. For instance, the -``\Twig\Loader\FilesystemLoader`` allows you to access other templates by giving the -filename. You can access templates in subdirectories with a slash: - -.. code-block:: twig - - {{ include('sections/articles/sidebar.html') }} - -This behavior depends on the application embedding Twig. - -Template Inheritance --------------------- - -The most powerful part of Twig is template inheritance. Template inheritance -allows you to build a base "skeleton" template that contains all the common -elements of your site and defines **blocks** that child templates can -override. - -It's easier to understand the concept by starting with an example. - -Let's define a base template, ``base.html``, which defines an HTML skeleton -document that might be used for a two-column page: - -.. code-block:: html+twig - - - - - {% block head %} - - {% block title %}{% endblock %} - My Webpage - {% endblock %} - - -
    {% block content %}{% endblock %}
    - - - - -In this example, the :doc:`block` tags define four blocks that -child templates can fill in. All the ``block`` tag does is to tell the -template engine that a child template may override those portions of the -template. - -A child template might look like this: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - - {% endblock %} - {% block content %} -

    Index

    -

    - Welcome to my awesome homepage. -

    - {% endblock %} - -The :doc:`extends` tag is the key here. It tells the template -engine that this template "extends" another template. When the template system -evaluates this template, first it locates the parent. The extends tag should -be the first tag in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -It's possible to render the contents of the parent block by using the -:doc:`parent` function. This gives back the results of the -parent block: - -.. code-block:: twig - - {% block sidebar %} -

    Table Of Contents

    - ... - {{ parent() }} - {% endblock %} - -.. tip:: - - The documentation page for the :doc:`extends` tag describes - more advanced features like block nesting, scope, dynamic inheritance, and - conditional inheritance. - -.. note:: - - Twig also supports multiple inheritance via "horizontal reuse" with the help - of the :doc:`use` tag. - -HTML Escaping -------------- - -When generating HTML from templates, there's always a risk that a variable -will include characters that affect the resulting HTML. There are two -approaches: manually escaping each variable or automatically escaping -everything by default. - -Twig supports both, automatic escaping is enabled by default. - -The automatic escaping strategy can be configured via the -:ref:`autoescape` option and defaults to ``html``. - -Working with Manual Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If manual escaping is enabled, it is **your** responsibility to escape variables -if needed. What to escape? Any variable that comes from an untrusted source. - -Escaping works by using the :doc:`escape` or ``e`` filter: - -.. code-block:: twig - - {{ user.username|e }} - -By default, the ``escape`` filter uses the ``html`` strategy, but depending on -the escaping context, you might want to explicitly use an other strategy: - -.. code-block:: twig - - {{ user.username|e('js') }} - {{ user.username|e('css') }} - {{ user.username|e('url') }} - {{ user.username|e('html_attr') }} - -Working with Automatic Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the :doc:`autoescape` -tag: - -.. code-block:: twig - - {% autoescape %} - Everything will be automatically escaped in this block (using the HTML strategy) - {% endautoescape %} - -By default, auto-escaping uses the ``html`` escaping strategy. If you output -variables in other contexts, you need to explicitly escape them with the -appropriate escaping strategy: - -.. code-block:: twig - - {% autoescape 'js' %} - Everything will be automatically escaped in this block (using the JS strategy) - {% endautoescape %} - -Escaping --------- - -It is sometimes desirable or even necessary to have Twig ignore parts it would -otherwise handle as variables or blocks. For example if the default syntax is -used and you want to use ``{{`` as raw string in the template and not start a -variable you have to use a trick. - -The easiest way is to output the variable delimiter (``{{``) by using a variable -expression: - -.. code-block:: twig - - {{ '{{' }} - -For bigger sections it makes sense to mark a block -:doc:`verbatim`. - -Macros ------- - -Macros are comparable with functions in regular programming languages. They are -useful to reuse HTML fragments to not repeat yourself. They are described in the -:doc:`macro` tag documentation. - -.. _twig-expressions: - -Expressions ------------ - -Twig allows expressions everywhere. - -.. note:: - - The operator precedence is as follows, with the lowest-precedence operators - listed first: ``?:`` (ternary operator), ``b-and``, ``b-xor``, ``b-or``, - ``or``, ``and``, ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``, - ``matches``, ``starts with``, ``ends with``, ``..``, ``+``, ``-``, ``~``, - ``*``, ``/``, ``//``, ``%``, ``is`` (tests), ``**``, ``??``, ``|`` - (filters), ``[]``, and ``.``. - - .. code-block:: twig - - {% set greeting = 'Hello ' %} - {% set name = 'Fabien' %} - - {{ greeting ~ name|lower }} {# Hello fabien #} - - {# use parenthesis to change precedence #} - {{ (greeting ~ name)|lower }} {# hello fabien #} - -Literals -~~~~~~~~ - -The simplest form of expressions are literals. Literals are representations -for PHP types such as strings, numbers, and arrays. The following literals -exist: - -* ``"Hello World"``: Everything between two double or single quotes is a - string. They are useful whenever you need a string in the template (for - example as arguments to function calls, filters or just to extend or include - a template). A string can contain a delimiter if it is preceded by a - backslash (``\``) -- like in ``'It\'s good'``. If the string contains a - backslash (e.g. ``'c:\Program Files'``) escape it by doubling it - (e.g. ``'c:\\Program Files'``). - -* ``42`` / ``42.23``: Integers and floating point numbers are created by - writing the number down. If a dot is present the number is a float, - otherwise an integer. - -* ``["foo", "bar"]``: Arrays are defined by a sequence of expressions - separated by a comma (``,``) and wrapped with squared brackets (``[]``). - -* ``{"foo": "bar"}``: Hashes are defined by a list of keys and values - separated by a comma (``,``) and wrapped with curly braces (``{}``): - - .. code-block:: twig - - {# keys as string #} - { 'foo': 'foo', 'bar': 'bar' } - - {# keys as names (equivalent to the previous hash) #} - { foo: 'foo', bar: 'bar' } - - {# keys as integer #} - { 2: 'foo', 4: 'bar' } - - {# keys as expressions (the expression must be enclosed into parentheses) #} - {% set foo = 'foo' %} - { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' } - -* ``true`` / ``false``: ``true`` represents the true value, ``false`` - represents the false value. - -* ``null``: ``null`` represents no specific value. This is the value returned - when a variable does not exist. ``none`` is an alias for ``null``. - -Arrays and hashes can be nested: - -.. code-block:: twig - - {% set foo = [1, {"foo": "bar"}] %} - -.. tip:: - - Using double-quoted or single-quoted strings has no impact on performance - but :ref:`string interpolation ` is only - supported in double-quoted strings. - -Math -~~~~ - -Twig allows you to do math in templates; the following operators are supported: - -* ``+``: Adds two numbers together (the operands are casted to numbers). ``{{ - 1 + 1 }}`` is ``2``. - -* ``-``: Subtracts the second number from the first one. ``{{ 3 - 2 }}`` is - ``1``. - -* ``/``: Divides two numbers. The returned value will be a floating point - number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``. - -* ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is - ``4``. - -* ``//``: Divides two numbers and returns the floored integer result. ``{{ 20 - // 7 }}`` is ``2``, ``{{ -20 // 7 }}`` is ``-3`` (this is just syntactic - sugar for the :doc:`round` filter). - -* ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would - return ``4``. - -* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** - 3 }}`` would return ``8``. - -.. _template_logic: - -Logic -~~~~~ - -You can combine multiple expressions with the following operators: - -* ``and``: Returns true if the left and the right operands are both true. - -* ``or``: Returns true if the left or the right operand is true. - -* ``not``: Negates a statement. - -* ``(expr)``: Groups an expression. - -.. note:: - - Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``). - -.. note:: - - Operators are case sensitive. - -Comparisons -~~~~~~~~~~~ - -The following comparison operators are supported in any expression: ``==``, -``!=``, ``<``, ``>``, ``>=``, and ``<=``. - -You can also check if a string ``starts with`` or ``ends with`` another -string: - -.. code-block:: twig - - {% if 'Fabien' starts with 'F' %} - {% endif %} - - {% if 'Fabien' ends with 'n' %} - {% endif %} - -.. note:: - - For complex string comparisons, the ``matches`` operator allows you to use - `regular expressions`_: - - .. code-block:: twig - - {% if phone matches '/^[\\d\\.]+$/' %} - {% endif %} - -Containment Operator -~~~~~~~~~~~~~~~~~~~~ - -The ``in`` operator performs containment test. It returns ``true`` if the left -operand is contained in the right: - -.. code-block:: twig - - {# returns true #} - - {{ 1 in [1, 2, 3] }} - - {{ 'cd' in 'abcde' }} - -.. tip:: - - You can use this filter to perform a containment test on strings, arrays, - or objects implementing the ``Traversable`` interface. - -To perform a negative test, use the ``not in`` operator: - -.. code-block:: twig - - {% if 1 not in [1, 2, 3] %} - - {# is equivalent to #} - {% if not (1 in [1, 2, 3]) %} - -Test Operator -~~~~~~~~~~~~~ - -The ``is`` operator performs tests. Tests can be used to test a variable against -a common expression. The right operand is name of the test: - -.. code-block:: twig - - {# find out if a variable is odd #} - - {{ name is odd }} - -Tests can accept arguments too: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - -Tests can be negated by using the ``is not`` operator: - -.. code-block:: twig - - {% if post.status is not constant('Post::PUBLISHED') %} - - {# is equivalent to #} - {% if not (post.status is constant('Post::PUBLISHED')) %} - -Go to the :doc:`tests` page to learn more about the built-in -tests. - -Other Operators -~~~~~~~~~~~~~~~ - -The following operators don't fit into any of the other categories: - -* ``|``: Applies a filter. - -* ``..``: Creates a sequence based on the operand before and after the operator - (this is syntactic sugar for the :doc:`range` function): - - .. code-block:: twig - - {{ 1..5 }} - - {# equivalent to #} - {{ range(1, 5) }} - - Note that you must use parentheses when combining it with the filter operator - due to the :ref:`operator precedence rules `: - - .. code-block:: twig - - (1..5)|join(', ') - -* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello - " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello - John!``. - -* ``.``, ``[]``: Gets an attribute of a variable. - -* ``?:``: The ternary operator: - - .. code-block:: twig - - {{ foo ? 'yes' : 'no' }} - {{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }} - {{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }} - -* ``??``: The null-coalescing operator: - - .. code-block:: twig - - {# returns the value of foo if it is defined and not null, 'no' otherwise #} - {{ foo ?? 'no' }} - -.. _templates-string-interpolation: - -String Interpolation -~~~~~~~~~~~~~~~~~~~~ - -String interpolation (``#{expression}``) allows any valid expression to appear -within a *double-quoted string*. The result of evaluating that expression is -inserted into the string: - -.. code-block:: twig - - {{ "foo #{bar} baz" }} - {{ "foo #{1 + 2} baz" }} - -.. _templates-whitespace-control: - -Whitespace Control ------------------- - -.. versionadded:: 2.8 - Tag level Line whitespace control was added in Twig 2.8. - -The first newline after a template tag is removed automatically (like in PHP). -Whitespace is not further modified by the template engine, so each whitespace -(spaces, tabs, newlines etc.) is returned unchanged. - -You can also control whitespace on a per tag level. By using the whitespace -control modifiers on your tags, you can trim leading and or trailing whitespace. - -Twig supports two modifiers: - -* *Whitespace trimming* via the ``-`` modifier: Removes all whitespace - (including newlines); - -* *Line whitespace trimming* via the ``~`` modifier: Removes all whitespace - (excluding newlines). Using this modifier on the right disables the default - removal of the first newline inherited from PHP. - -The modifiers can be used on either side of the tags like in ``{%-`` or ``-%}`` -and they consume all whitespace for that side of the tag. It is possible to use -the modifiers on one side of a tag or on both sides: - -.. code-block:: twig - - {% set value = 'no spaces' %} - {#- No leading/trailing whitespace -#} - {%- if true -%} - {{- value -}} - {%- endif -%} - {# output 'no spaces' #} - -
  • - {{ value }}
  • - {# outputs '
  • \n no spaces
  • ' #} - -
  • - {{- value }}
  • - {# outputs '
  • no spaces
  • ' #} - -
  • - {{~ value }}
  • - {# outputs '
  • \nno spaces
  • ' #} - -.. tip:: - - In addition to the whitespace modifiers, Twig also has a ``spaceless`` filter - that removes whitespace **between HTML tags**: - - .. code-block:: twig - - {% apply spaceless %} -
    - foo bar -
    - {% endapply %} - - {# output will be
    foo bar
    #} - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -Extensions ----------- - -Twig can be extended. If you are looking for new tags, filters, or functions, -have a look at the Twig official `extension repository`_. - -If you want to create your own, read the :ref:`Creating an -Extension` chapter. - -.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle -.. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim -.. _`vim-twig plugin`: https://github.com/lumiliet/vim-twig -.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig -.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin -.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language -.. _`extension repository`: https://github.com/twigphp/Twig-extensions -.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode -.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode -.. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig -.. _`web-mode.el`: http://web-mode.org/ -.. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php -.. _`PHP-twig for atom`: https://github.com/reesef/php-twig -.. _`TwigFiddle`: https://twigfiddle.com/ -.. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack diff --git a/system/backend/php/vendor/twig/twig/doc/tests/constant.rst b/system/backend/php/vendor/twig/twig/doc/tests/constant.rst deleted file mode 100644 index 448c238bcaa..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/constant.rst +++ /dev/null @@ -1,19 +0,0 @@ -``constant`` -============ - -``constant`` checks if a variable has the exact same value as a constant. You -can use either global constants or class constants: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} - -You can test constants from object instances as well: - -.. code-block:: twig - - {% if post.status is constant('PUBLISHED', post) %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/tests/defined.rst b/system/backend/php/vendor/twig/twig/doc/tests/defined.rst deleted file mode 100644 index 234a28988a0..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/defined.rst +++ /dev/null @@ -1,30 +0,0 @@ -``defined`` -=========== - -``defined`` checks if a variable is defined in the current context. This is very -useful if you use the ``strict_variables`` option: - -.. code-block:: twig - - {# defined works with variable names #} - {% if foo is defined %} - ... - {% endif %} - - {# and attributes on variables names #} - {% if foo.bar is defined %} - ... - {% endif %} - - {% if foo['bar'] is defined %} - ... - {% endif %} - -When using the ``defined`` test on an expression that uses variables in some -method calls, be sure that they are all defined first: - -.. code-block:: twig - - {% if var is defined and foo.method(var) is defined %} - ... - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/tests/divisibleby.rst b/system/backend/php/vendor/twig/twig/doc/tests/divisibleby.rst deleted file mode 100644 index 8032d349aba..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/divisibleby.rst +++ /dev/null @@ -1,10 +0,0 @@ -``divisible by`` -================ - -``divisible by`` checks if a variable is divisible by a number: - -.. code-block:: twig - - {% if loop.index is divisible by(3) %} - ... - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/tests/empty.rst b/system/backend/php/vendor/twig/twig/doc/tests/empty.rst deleted file mode 100644 index 2cd28069bb7..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/empty.rst +++ /dev/null @@ -1,22 +0,0 @@ -``empty`` -========= - -.. versionadded:: 2.3 - - Support for the ``__toString()`` magic method has been added in Twig 2.3. - -``empty`` checks if a variable is an empty string, an empty array, an empty -hash, exactly ``false``, or exactly ``null``. - -For objects that implement the ``Countable`` interface, ``empty`` will check the -return value of the ``count()`` method. - -For objects that implement the ``__toString()`` magic method (and not ``Countable``), -it will check if an empty string is returned. - -.. code-block:: twig - - {% if foo is empty %} - ... - {% endif %} - diff --git a/system/backend/php/vendor/twig/twig/doc/tests/even.rst b/system/backend/php/vendor/twig/twig/doc/tests/even.rst deleted file mode 100644 index 5d9c87694a1..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/even.rst +++ /dev/null @@ -1,10 +0,0 @@ -``even`` -======== - -``even`` returns ``true`` if the given number is even: - -.. code-block:: twig - - {{ var is even }} - -.. seealso:: :doc:`odd<../tests/odd>` diff --git a/system/backend/php/vendor/twig/twig/doc/tests/index.rst b/system/backend/php/vendor/twig/twig/doc/tests/index.rst deleted file mode 100644 index c63208ee74d..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -Tests -===== - -.. toctree:: - :maxdepth: 1 - - constant - defined - divisibleby - empty - even - iterable - null - odd - sameas diff --git a/system/backend/php/vendor/twig/twig/doc/tests/iterable.rst b/system/backend/php/vendor/twig/twig/doc/tests/iterable.rst deleted file mode 100644 index 4ebfe9d8a50..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/iterable.rst +++ /dev/null @@ -1,16 +0,0 @@ -``iterable`` -============ - -``iterable`` checks if a variable is an array or a traversable object: - -.. code-block:: twig - - {# evaluates to true if the foo variable is iterable #} - {% if users is iterable %} - {% for user in users %} - Hello {{ user }}! - {% endfor %} - {% else %} - {# users is probably a string #} - Hello {{ users }}! - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/doc/tests/null.rst b/system/backend/php/vendor/twig/twig/doc/tests/null.rst deleted file mode 100644 index 9ed93f6bb29..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/null.rst +++ /dev/null @@ -1,12 +0,0 @@ -``null`` -======== - -``null`` returns ``true`` if the variable is ``null``: - -.. code-block:: twig - - {{ var is null }} - -.. note:: - - ``none`` is an alias for ``null``. diff --git a/system/backend/php/vendor/twig/twig/doc/tests/odd.rst b/system/backend/php/vendor/twig/twig/doc/tests/odd.rst deleted file mode 100644 index 0546f83c5a6..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/odd.rst +++ /dev/null @@ -1,10 +0,0 @@ -``odd`` -======= - -``odd`` returns ``true`` if the given number is odd: - -.. code-block:: twig - - {{ var is odd }} - -.. seealso:: :doc:`even<../tests/even>` diff --git a/system/backend/php/vendor/twig/twig/doc/tests/sameas.rst b/system/backend/php/vendor/twig/twig/doc/tests/sameas.rst deleted file mode 100644 index cd2b1ad2607..00000000000 --- a/system/backend/php/vendor/twig/twig/doc/tests/sameas.rst +++ /dev/null @@ -1,11 +0,0 @@ -``same as`` -=========== - -``same as`` checks if a variable is the same as another variable. -This is the equivalent to ``===`` in PHP: - -.. code-block:: twig - - {% if foo.attribute is same as(false) %} - the foo attribute really is the 'false' PHP value - {% endif %} diff --git a/system/backend/php/vendor/twig/twig/drupal_test.sh b/system/backend/php/vendor/twig/twig/drupal_test.sh deleted file mode 100755 index 3bc1f08ab20..00000000000 --- a/system/backend/php/vendor/twig/twig/drupal_test.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -x -set -e - -REPO=`pwd` -cd /tmp -rm -rf drupal-twig-test -composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test -cd drupal-twig-test -(cd vendor/twig && rm -rf twig && ln -sf $REPO twig) -echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php -composer require drupal/core:8.7.x-dev webflo/drupal-core-require-dev:8.7.x-dev "egulias/email-validator:^2.0" -php ./web/core/scripts/drupal install --no-interaction demo_umami > output -perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output -source output - -wget https://get.symfony.com/cli/installer -O - | bash -export PATH="$HOME/.symfony/bin:$PATH" -symfony server:start -d --no-tls -ENDPOINT=`symfony server:status -no-ansi | sed -E 's/^.+ http/http/'` - -curl -OLsS https://get.blackfire.io/blackfire-player.phar -chmod +x blackfire-player.phar -cat > drupal-tests.bkf < - - - - - ./test/Twig/ - - - - - - - - - - - - - - - ./src/ - - - diff --git a/system/backend/php/vendor/twig/twig/src/Cache/FilesystemCache.php b/system/backend/php/vendor/twig/twig/src/Cache/FilesystemCache.php index 7e228799a69..c32c81884ba 100644 --- a/system/backend/php/vendor/twig/twig/src/Cache/FilesystemCache.php +++ b/system/backend/php/vendor/twig/twig/src/Cache/FilesystemCache.php @@ -18,7 +18,7 @@ */ class FilesystemCache implements CacheInterface { - const FORCE_BYTECODE_INVALIDATION = 1; + public const FORCE_BYTECODE_INVALIDATION = 1; private $directory; private $options; @@ -35,7 +35,7 @@ public function __construct($directory, $options = 0) public function generateKey($name, $className) { - $hash = hash('sha256', $className); + $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $className); return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; } @@ -67,8 +67,8 @@ public function write($key, $content) if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { // Compile cached file into bytecode cache - if (\function_exists('opcache_invalidate')) { - opcache_invalidate($key, true); + if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { + @opcache_invalidate($key, true); } elseif (\function_exists('apc_compile_file')) { apc_compile_file($key); } diff --git a/system/backend/php/vendor/twig/twig/src/Compiler.php b/system/backend/php/vendor/twig/twig/src/Compiler.php index 56933e20380..8727991d1b7 100644 --- a/system/backend/php/vendor/twig/twig/src/Compiler.php +++ b/system/backend/php/vendor/twig/twig/src/Compiler.php @@ -141,14 +141,14 @@ public function string($value) public function repr($value) { if (\is_int($value) || \is_float($value)) { - if (false !== $locale = setlocale(LC_NUMERIC, '0')) { - setlocale(LC_NUMERIC, 'C'); + if (false !== $locale = setlocale(\LC_NUMERIC, '0')) { + setlocale(\LC_NUMERIC, 'C'); } $this->raw(var_export($value, true)); if (false !== $locale) { - setlocale(LC_NUMERIC, $locale); + setlocale(\LC_NUMERIC, $locale); } } elseif (null === $value) { $this->raw('null'); @@ -238,7 +238,7 @@ public function outdent($step = 1) public function getVarName() { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); + return sprintf('__internal_compile_%d', $this->varNameSalt++); } } diff --git a/system/backend/php/vendor/twig/twig/src/Environment.php b/system/backend/php/vendor/twig/twig/src/Environment.php index 926ce1a05e9..9cebf35d56f 100644 --- a/system/backend/php/vendor/twig/twig/src/Environment.php +++ b/system/backend/php/vendor/twig/twig/src/Environment.php @@ -32,18 +32,18 @@ use Twig\TokenParser\TokenParserInterface; /** - * Stores the Twig configuration. + * Stores the Twig configuration and renders templates. * * @author Fabien Potencier */ class Environment { - const VERSION = '2.11.2'; - const VERSION_ID = 21102; - const MAJOR_VERSION = 2; - const MINOR_VERSION = 11; - const RELEASE_VERSION = 2; - const EXTRA_VERSION = ''; + public const VERSION = '2.15.5'; + public const VERSION_ID = 21505; + public const MAJOR_VERSION = 2; + public const MINOR_VERSION = 15; + public const RELEASE_VERSION = 5; + public const EXTRA_VERSION = ''; private $charset; private $loader; @@ -118,7 +118,7 @@ public function __construct(LoaderInterface $loader, $options = []) $this->setCharset($options['charset']); $this->baseTemplateClass = '\\'.ltrim($options['base_template_class'], '\\'); if ('\\'.Template::class !== $this->baseTemplateClass && '\Twig_Template' !== $this->baseTemplateClass) { - @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); } $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; $this->strictVariables = (bool) $options['strict_variables']; @@ -138,7 +138,7 @@ public function __construct(LoaderInterface $loader, $options = []) public function getBaseTemplateClass() { if (1 > \func_num_args() || \func_get_arg(0)) { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); } return $this->baseTemplateClass; @@ -151,7 +151,7 @@ public function getBaseTemplateClass() */ public function setBaseTemplateClass($class) { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); $this->baseTemplateClass = $class; $this->updateOptionsHash(); @@ -264,14 +264,14 @@ public function setCache($cache) { if (\is_string($cache)) { $this->originalCache = $cache; - $this->cache = new FilesystemCache($cache); + $this->cache = new FilesystemCache($cache, $this->autoReload ? FilesystemCache::FORCE_BYTECODE_INVALIDATION : 0); } elseif (false === $cache) { $this->originalCache = $cache; $this->cache = new NullCache(); } elseif ($cache instanceof CacheInterface) { $this->originalCache = $this->cache = $cache; } else { - throw new \LogicException(sprintf('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.')); + throw new \LogicException('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.'); } } @@ -298,7 +298,7 @@ public function getTemplateClass($name, $index = null) { $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; - return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index); + return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index); } /** @@ -351,7 +351,7 @@ public function load($name) } if ($name instanceof Template) { - @trigger_error('Passing a \Twig\Template instance to '.__METHOD__.' is deprecated since Twig 2.7.0, use \Twig\TemplateWrapper instead.', E_USER_DEPRECATED); + @trigger_error('Passing a \Twig\Template instance to '.__METHOD__.' is deprecated since Twig 2.7.0, use \Twig\TemplateWrapper instead.', \E_USER_DEPRECATED); return new TemplateWrapper($this, $name); } @@ -435,7 +435,7 @@ public function loadClass($cls, $name, $index = null) * * This method should not be used as a generic way to load templates. * - * @param string $template The template name + * @param string $template The template source * @param string $name An optional name of the template to be used in error messages * * @return TemplateWrapper A template instance representing the given template name @@ -445,7 +445,7 @@ public function loadClass($cls, $name, $index = null) */ public function createTemplate($template, string $name = null) { - $hash = hash('sha256', $template, false); + $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $template, false); if (null !== $name) { $name = sprintf('%s (string template %s)', $name, $hash); } else { @@ -501,6 +501,7 @@ public function resolveTemplate($names) $names = [$names]; } + $count = \count($names); foreach ($names as $name) { if ($name instanceof Template) { return $name; @@ -509,13 +510,11 @@ public function resolveTemplate($names) return $name; } - try { - return $this->loadTemplate($name); - } catch (LoaderError $e) { - if (1 === \count($names)) { - throw $e; - } + if (1 !== $count && !$this->getLoader()->exists($name)) { + continue; } + + return $this->loadTemplate($name); } throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); @@ -623,7 +622,7 @@ public function getLoader() */ public function setCharset($charset) { - if ('UTF8' === $charset = strtoupper($charset)) { + if ('UTF8' === $charset = null === $charset ? null : strtoupper($charset)) { // iconv on Windows requires "UTF-8" instead of "UTF8" $charset = 'UTF-8'; } @@ -982,8 +981,8 @@ private function updateOptionsHash() { $this->optionsHash = implode(':', [ $this->extensionSet->getSignature(), - PHP_MAJOR_VERSION, - PHP_MINOR_VERSION, + \PHP_MAJOR_VERSION, + \PHP_MINOR_VERSION, self::VERSION, (int) $this->debug, $this->baseTemplateClass, diff --git a/system/backend/php/vendor/twig/twig/src/Error/Error.php b/system/backend/php/vendor/twig/twig/src/Error/Error.php index a64cbcbc065..13f6f745ce5 100644 --- a/system/backend/php/vendor/twig/twig/src/Error/Error.php +++ b/system/backend/php/vendor/twig/twig/src/Error/Error.php @@ -62,7 +62,7 @@ public function __construct(string $message, int $lineno = -1, $source = null, \ if (null === $source) { $name = null; } elseif (!$source instanceof Source && !$source instanceof \Twig_Source) { - @trigger_error(sprintf('Passing a string as a source to %s is deprecated since Twig 2.6.1; pass a Twig\Source instance instead.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a string as a source to %s is deprecated since Twig 2.6.1; pass a Twig\Source instance instead.', __CLASS__), \E_USER_DEPRECATED); $name = $source; } else { $name = $source->getName(); @@ -196,11 +196,11 @@ private function guessTemplateInfo() $template = null; $templateClass = null; - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT); foreach ($backtrace as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) { + if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig\Template' !== \get_class($trace['object'])) { $currentClass = \get_class($trace['object']); - $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + $isEmbedContainer = null === $templateClass ? false : 0 === strpos($templateClass, $currentClass); if (null === $this->name || ($this->name == $trace['object']->getTemplateName() && !$isEmbedContainer)) { $template = $trace['object']; $templateClass = \get_class($trace['object']); diff --git a/system/backend/php/vendor/twig/twig/src/ExpressionParser.php b/system/backend/php/vendor/twig/twig/src/ExpressionParser.php index 2c5df63f147..b0bcf10809f 100644 --- a/system/backend/php/vendor/twig/twig/src/ExpressionParser.php +++ b/system/backend/php/vendor/twig/twig/src/ExpressionParser.php @@ -45,8 +45,8 @@ */ class ExpressionParser { - const OPERATOR_LEFT = 1; - const OPERATOR_RIGHT = 2; + public const OPERATOR_LEFT = 1; + public const OPERATOR_RIGHT = 2; private $parser; private $env; @@ -366,7 +366,16 @@ public function parseHashExpression() // * a string -- 'a' // * a name, which is equivalent to a string -- a // * an expression, which must be enclosed in parentheses -- (1 + 2) - if (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) || $token = $stream->nextIf(/* Token::NUMBER_TYPE */ 6)) { + if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) { + $key = new ConstantExpression($token->getValue(), $token->getLine()); + + // {a} is a shortcut for {a:a} + if ($stream->test(Token::PUNCTUATION_TYPE, [',', '}'])) { + $value = new NameExpression($key->getAttribute('value'), $key->getTemplateLine()); + $node->addElement($value, $key); + continue; + } + } elseif (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || $token = $stream->nextIf(/* Token::NUMBER_TYPE */ 6)) { $key = new ConstantExpression($token->getValue(), $token->getLine()); } elseif ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { $key = $this->parseExpression(); @@ -479,7 +488,7 @@ public function parseSubscriptExpression($node) } } } else { - throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext()); + throw new SyntaxError(sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext()); } if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { @@ -584,6 +593,11 @@ public function parseArguments($namedArguments = false, $definition = false, $al while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { if (!empty($args)) { $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'Arguments must be separated by a comma'); + + // if the comma above was a trailing comma, early exit the argument parse loop + if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { + break; + } } if ($definition) { @@ -604,7 +618,7 @@ public function parseArguments($namedArguments = false, $definition = false, $al $value = $this->parsePrimaryExpression(); if (!$this->checkConstantExpression($value)) { - throw new SyntaxError(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext()); + 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()); } } else { $value = $this->parseExpression(0, $allowArrow); @@ -643,7 +657,7 @@ public function parseAssignmentExpression() $stream->expect(/* Token::NAME_TYPE */ 5, null, 'Only variables can be assigned to'); } $value = $token->getValue(); - if (\in_array(strtolower($value), ['true', 'false', 'none', 'null'])) { + if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) { throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext()); } $targets[] = new AssignNameExpression($value, $token->getLine()); @@ -683,6 +697,8 @@ private function parseTestExpression(Node $node): TestExpression $arguments = null; if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { $arguments = $this->parseArguments(true); + } elseif ($test->hasOneMandatoryArgument()) { + $arguments = new Node([0 => $this->parsePrimaryExpression()]); } if ('defined' === $name && $node instanceof NameExpression && null !== $alias = $this->parser->getImportedSymbol('function', $node->getAttribute('name'))) { @@ -734,7 +750,7 @@ private function getTestNodeClass(TwigTest $test): string $src = $stream->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine()); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $test->getNodeClass(); @@ -760,7 +776,7 @@ private function getFunctionNodeClass(string $name, int $line): string $src = $this->parser->getStream()->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $function->getNodeClass(); @@ -786,7 +802,7 @@ private function getFilterNodeClass(string $name, int $line): string $src = $this->parser->getStream()->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $filter->getNodeClass(); diff --git a/system/backend/php/vendor/twig/twig/src/Extension/CoreExtension.php b/system/backend/php/vendor/twig/twig/src/Extension/CoreExtension.php index eda04872767..5c4087ec217 100644 --- a/system/backend/php/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/system/backend/php/vendor/twig/twig/src/Extension/CoreExtension.php @@ -34,6 +34,7 @@ use Twig\Node\Expression\Binary\OrBinary; use Twig\Node\Expression\Binary\PowerBinary; use Twig\Node\Expression\Binary\RangeBinary; +use Twig\Node\Expression\Binary\SpaceshipBinary; use Twig\Node\Expression\Binary\StartsWithBinary; use Twig\Node\Expression\Binary\SubBinary; use Twig\Node\Expression\Filter\DefaultFilter; @@ -88,7 +89,7 @@ final class CoreExtension extends AbstractExtension */ public function setEscaper($strategy, callable $callable) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::setEscaper" instead.', __METHOD__, EscaperExtension::class), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::setEscaper" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); $this->escapers[$strategy] = $callable; } @@ -102,8 +103,8 @@ public function setEscaper($strategy, callable $callable) */ public function getEscapers(/* $triggerDeprecation = true */) { - if (0 === \func_num_args() || func_get_arg(0)) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::getEscapers" instead.', __METHOD__, EscaperExtension::class), E_USER_DEPRECATED); + if (0 === \func_num_args() || \func_get_arg(0)) { + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::getEscapers" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); } return $this->escapers; @@ -212,7 +213,7 @@ public function getFilters() // formatting filters new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), - new TwigFilter('format', 'sprintf'), + new TwigFilter('format', 'twig_sprintf'), new TwigFilter('replace', 'twig_replace_filter'), new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), new TwigFilter('abs', 'abs'), @@ -228,21 +229,21 @@ public function getFilters() new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]), new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]), - new TwigFilter('striptags', 'strip_tags'), + new TwigFilter('striptags', 'twig_striptags'), new TwigFilter('trim', 'twig_trim_filter'), - new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), + new TwigFilter('nl2br', 'twig_nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), // array helpers new TwigFilter('join', 'twig_join_filter'), new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), - new TwigFilter('sort', 'twig_sort_filter'), + new TwigFilter('sort', 'twig_sort_filter', ['needs_environment' => true]), new TwigFilter('merge', 'twig_array_merge'), new TwigFilter('batch', 'twig_array_batch'), new TwigFilter('column', 'twig_array_column'), - new TwigFilter('filter', 'twig_array_filter'), - new TwigFilter('map', 'twig_array_map'), - new TwigFilter('reduce', 'twig_array_reduce'), + new TwigFilter('filter', 'twig_array_filter', ['needs_environment' => true]), + new TwigFilter('map', 'twig_array_map', ['needs_environment' => true]), + new TwigFilter('reduce', 'twig_array_reduce', ['needs_environment' => true]), // string/array filters new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]), @@ -278,10 +279,10 @@ public function getTests() new TwigTest('even', null, ['node_class' => EvenTest::class]), new TwigTest('odd', null, ['node_class' => OddTest::class]), new TwigTest('defined', null, ['node_class' => DefinedTest::class]), - new TwigTest('same as', null, ['node_class' => SameasTest::class]), + new TwigTest('same as', null, ['node_class' => SameasTest::class, 'one_mandatory_argument' => true]), new TwigTest('none', null, ['node_class' => NullTest::class]), new TwigTest('null', null, ['node_class' => NullTest::class]), - new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class]), + new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class, 'one_mandatory_argument' => true]), new TwigTest('constant', null, ['node_class' => ConstantTest::class]), new TwigTest('empty', 'twig_test_empty'), new TwigTest('iterable', 'twig_test_iterable'), @@ -309,6 +310,7 @@ public function getOperators() 'b-and' => ['precedence' => 18, 'class' => BitwiseAndBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], '==' => ['precedence' => 20, 'class' => EqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], '!=' => ['precedence' => 20, 'class' => NotEqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], + '<=>' => ['precedence' => 20, 'class' => SpaceshipBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], '<' => ['precedence' => 20, 'class' => LessBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], '>' => ['precedence' => 20, 'class' => GreaterBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], '>=' => ['precedence' => 20, 'class' => GreaterEqualBinary::class, 'associativity' => ExpressionParser::OPERATOR_LEFT], @@ -347,8 +349,9 @@ class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core'); use Twig\Markup; use Twig\Source; use Twig\Template; + use Twig\TemplateWrapper; - /** +/** * Cycles over a value. * * @param \ArrayAccess|array $values @@ -381,7 +384,7 @@ function twig_cycle($values, $position) function twig_random(Environment $env, $values = null, $max = null) { if (null === $values) { - return null === $max ? mt_rand() : mt_rand(0, $max); + return null === $max ? mt_rand() : mt_rand(0, (int) $max); } if (\is_int($values) || \is_float($values)) { @@ -398,7 +401,7 @@ function twig_random(Environment $env, $values = null, $max = null) $max = $max; } - return mt_rand($min, $max); + return mt_rand((int) $min, (int) $max); } if (\is_string($values)) { @@ -409,7 +412,7 @@ function twig_random(Environment $env, $values = null, $max = null) $charset = $env->getCharset(); if ('UTF-8' !== $charset) { - $values = iconv($charset, 'UTF-8', $values); + $values = twig_convert_encoding($values, 'UTF-8', $charset); } // unicode version of str_split() @@ -418,7 +421,7 @@ function twig_random(Environment $env, $values = null, $max = null) if ('UTF-8' !== $charset) { foreach ($values as $i => $value) { - $values[$i] = iconv('UTF-8', $charset, $value); + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); } } } @@ -478,6 +481,19 @@ function twig_date_modify_filter(Environment $env, $date, $modifier) return $date->modify($modifier); } +/** + * Returns a formatted string. + * + * @param string|null $format + * @param ...$values + * + * @return string + */ +function twig_sprintf($format, ...$values) +{ + return sprintf($format ?? '', ...$values); +} + /** * Converts an input to a \DateTime instance. * @@ -488,7 +504,7 @@ function twig_date_modify_filter(Environment $env, $date, $modifier) * @param \DateTimeInterface|string|null $date A date or null to use the current time * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged * - * @return \DateTime + * @return \DateTimeInterface */ function twig_date_converter(Environment $env, $date = null, $timezone = null) { @@ -516,6 +532,10 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) } if (null === $date || 'now' === $date) { + if (null === $date) { + $date = 'now'; + } + return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension(CoreExtension::class)->getTimezone()); } @@ -536,7 +556,7 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) /** * Replaces strings within a string. * - * @param string $str String to replace in + * @param string|null $str String to replace in * @param array|\Traversable $from Replace values * * @return string @@ -547,36 +567,38 @@ function twig_replace_filter($str, $from) throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); } - return strtr($str, twig_to_array($from)); + return strtr($str ?? '', twig_to_array($from)); } /** * Rounds a number. * - * @param int|float $value The value to round - * @param int|float $precision The rounding precision - * @param string $method The method to use for rounding + * @param int|float|string|null $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding * * @return int|float The rounded number */ function twig_round($value, $precision = 0, $method = 'common') { - if ('common' == $method) { + $value = (float) $value; + + if ('common' === $method) { return round($value, $precision); } - if ('ceil' != $method && 'floor' != $method) { + if ('ceil' !== $method && 'floor' !== $method) { throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.'); } - return $method($value * pow(10, $precision)) / pow(10, $precision); + return $method($value * 10 ** $precision) / 10 ** $precision; } /** * Number format filter. * * All of the formatting options can be left null, in that case the defaults will - * be used. Supplying any of the parameters will override the defaults set in the + * be used. Supplying any of the parameters will override the defaults set in the * environment object. * * @param mixed $number A float/int/string of the number to format @@ -607,17 +629,17 @@ function twig_number_format_filter(Environment $env, $number, $decimal = null, $ /** * URL encodes (RFC 3986) a string as a path segment or an array as a query string. * - * @param string|array $url A URL or an array of query parameters + * @param string|array|null $url A URL or an array of query parameters * * @return string The URL encoded value */ function twig_urlencode_filter($url) { if (\is_array($url)) { - return http_build_query($url, '', '&', PHP_QUERY_RFC3986); + return http_build_query($url, '', '&', \PHP_QUERY_RFC3986); } - return rawurlencode($url); + return rawurlencode($url ?? ''); } /** @@ -679,9 +701,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe return \array_slice($item, $start, $length, $preserveKeys); } - $item = (string) $item; - - return (string) mb_substr($item, $start, $length, $env->getCharset()); + return (string) mb_substr((string) $item, $start, $length, $env->getCharset()); } /** @@ -770,15 +790,17 @@ function twig_join_filter($value, $glue = '', $and = null) * {{ "aabbcc"|split('', 2) }} * {# returns [aa, bb, cc] #} * - * @param string $value A string - * @param string $delimiter The delimiter - * @param int $limit The limit + * @param string|null $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit * * @return array The split string as an array */ function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) { - if (!empty($delimiter)) { + $value = $value ?? ''; + + if (\strlen($delimiter) > 0) { return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } @@ -863,8 +885,8 @@ function twig_get_array_keys_filter($array) /** * Reverses a variable. * - * @param array|\Traversable|string $item An array, a \Traversable instance, or a string - * @param bool $preserveKeys Whether to preserve key or not + * @param array|\Traversable|string|null $item An array, a \Traversable instance, or a string + * @param bool $preserveKeys Whether to preserve key or not * * @return mixed The reversed input */ @@ -883,15 +905,15 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) $charset = $env->getCharset(); if ('UTF-8' !== $charset) { - $item = iconv($charset, 'UTF-8', $string); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } - preg_match_all('/./us', $item, $matches); + preg_match_all('/./us', $string, $matches); $string = implode('', array_reverse($matches[0])); if ('UTF-8' !== $charset) { - $string = iconv('UTF-8', $charset, $string); + $string = twig_convert_encoding($string, $charset, 'UTF-8'); } return $string; @@ -904,7 +926,7 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) * * @return array */ -function twig_sort_filter($array) +function twig_sort_filter(Environment $env, $array, $arrow = null) { if ($array instanceof \Traversable) { $array = iterator_to_array($array); @@ -912,7 +934,13 @@ function twig_sort_filter($array) throw new RuntimeError(sprintf('The sort filter only works with arrays or "Traversable", got "%s".', \gettype($array))); } - asort($array); + if (null !== $arrow) { + twig_check_arrow_in_sandbox($env, $arrow, 'sort', 'filter'); + + uasort($array, $arrow); + } else { + asort($array); + } return $array; } @@ -957,6 +985,10 @@ function twig_in_filter($value, $compare) /** * Returns a trimmed string. * + * @param string|null $string + * @param string|null $characterMask + * @param string $side + * * @return string * * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') @@ -969,29 +1001,54 @@ function twig_trim_filter($string, $characterMask = null, $side = 'both') switch ($side) { case 'both': - return trim($string, $characterMask); + return trim($string ?? '', $characterMask); case 'left': - return ltrim($string, $characterMask); + return ltrim($string ?? '', $characterMask); case 'right': - return rtrim($string, $characterMask); + return rtrim($string ?? '', $characterMask); default: throw new RuntimeError('Trimming side must be "left", "right" or "both".'); } } +/** + * Inserts HTML line breaks before all newlines in a string. + * + * @param string|null $string + * + * @return string + */ +function twig_nl2br($string) +{ + return nl2br($string ?? ''); +} + /** * Removes whitespaces between HTML tags. * + * @param string|null $string + * * @return string */ function twig_spaceless($content) { - return trim(preg_replace('/>\s+<', $content)); + return trim(preg_replace('/>\s+<', $content ?? '')); } +/** + * @param string|null $string + * @param string $to + * @param string $from + * + * @return string + */ function twig_convert_encoding($string, $to, $from) { - return iconv($from, $to, $string); + if (!\function_exists('iconv')) { + throw new RuntimeError('Unable to convert encoding: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); + } + + return iconv($from, $to, $string ?? ''); } /** @@ -1029,47 +1086,60 @@ function twig_length_filter(Environment $env, $thing) /** * Converts a string to uppercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The uppercased string */ function twig_upper_filter(Environment $env, $string) { - return mb_strtoupper($string, $env->getCharset()); + return mb_strtoupper($string ?? '', $env->getCharset()); } /** * Converts a string to lowercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The lowercased string */ function twig_lower_filter(Environment $env, $string) { - return mb_strtolower($string, $env->getCharset()); + return mb_strtolower($string ?? '', $env->getCharset()); +} + +/** + * Strips HTML and PHP tags from a string. + * + * @param string|null $string + * @param string[]|string|null $string + * + * @return string + */ +function twig_striptags($string, $allowable_tags = null) +{ + return strip_tags($string ?? '', $allowable_tags); } /** * Returns a titlecased string. * - * @param string $string A string + * @param string|null $string A string * * @return string The titlecased string */ function twig_title_string_filter(Environment $env, $string) { if (null !== $charset = $env->getCharset()) { - return mb_convert_case($string, MB_CASE_TITLE, $charset); + return mb_convert_case($string ?? '', \MB_CASE_TITLE, $charset); } - return ucwords(strtolower($string)); + return ucwords(strtolower($string ?? '')); } /** * Returns a capitalized string. * - * @param string $string A string + * @param string|null $string A string * * @return string The capitalized string */ @@ -1077,7 +1147,7 @@ function twig_capitalize_string_filter(Environment $env, $string) { $charset = $env->getCharset(); - return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, null, $charset), $charset); + return mb_strtoupper(mb_substr($string ?? '', 0, 1, $charset), $charset).mb_strtolower(mb_substr($string ?? '', 1, null, $charset), $charset); } /** @@ -1142,7 +1212,11 @@ function twig_to_array($seq, $preserveKeys = true) function twig_test_empty($value) { if ($value instanceof \Countable) { - return 0 == \count($value); + return 0 === \count($value); + } + + if ($value instanceof \Traversable) { + return !iterator_count($value); } if (\is_object($value) && method_exists($value, '__toString')) { @@ -1194,6 +1268,13 @@ function twig_include(Environment $env, $context, $template, $variables = [], $w if (!$alreadySandboxed = $sandbox->isSandboxed()) { $sandbox->enableSandbox(); } + + foreach ((\is_array($template) ? $template : [$template]) as $name) { + // if a Template instance is passed, it might have been instantiated outside of a sandbox, check security + if ($name instanceof TemplateWrapper || $name instanceof Template) { + $name->unwrap()->checkSecurity(); + } + } } try { @@ -1248,6 +1329,10 @@ function twig_constant($constant, $object = null) $constant = \get_class($object).'::'.$constant; } + if (!\defined($constant)) { + throw new RuntimeError(sprintf('Constant "%s" is undefined.', $constant)); + } + return \constant($constant); } @@ -1322,7 +1407,7 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar if (/* Template::METHOD_CALL */ 'method' !== $type) { $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; - if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, $object))) + if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, (array) $object))) || ($object instanceof ArrayAccess && isset($object[$arrayItem])) ) { if ($isDefinedTest) { @@ -1393,7 +1478,7 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar // object property if (/* Template::METHOD_CALL */ 'method' !== $type) { - if (isset($object->$item) || \array_key_exists((string) $item, $object)) { + if (isset($object->$item) || \array_key_exists((string) $item, (array) $object)) { if ($isDefinedTest) { return true; } @@ -1415,7 +1500,7 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar if (!isset($cache[$class])) { $methods = get_class_methods($object); sort($methods); - $lcMethods = array_map('strtolower', $methods); + $lcMethods = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, $methods); $classCache = []; foreach ($methods as $i => $method) { $classCache[$method] = $method; @@ -1454,7 +1539,7 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar $call = false; if (isset($cache[$class][$item])) { $method = $cache[$class][$item]; - } elseif (isset($cache[$class][$lcItem = strtolower($item)])) { + } elseif (isset($cache[$class][$lcItem = strtr($item, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')])) { $method = $cache[$class][$lcItem]; } elseif (isset($cache[$class]['__call'])) { $method = $item; @@ -1506,10 +1591,11 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar * * @param array|Traversable $array An array * @param mixed $name The column name + * @param mixed $index The column to use as the index/keys for the returned array * * @return array The array of values */ -function twig_array_column($array, $name): array +function twig_array_column($array, $name, $index = null): array { if ($array instanceof Traversable) { $array = iterator_to_array($array); @@ -1517,20 +1603,29 @@ function twig_array_column($array, $name): array throw new RuntimeError(sprintf('The column filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array))); } - return array_column($array, $name); + return array_column($array, $name, $index); } -function twig_array_filter($array, $arrow) +function twig_array_filter(Environment $env, $array, $arrow) { - foreach ($array as $k => $v) { - if ($arrow($v, $k)) { - yield $k => $v; - } + if (!twig_test_iterable($array)) { + throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array))); } + + twig_check_arrow_in_sandbox($env, $arrow, 'filter', 'filter'); + + if (\is_array($array)) { + return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH); + } + + // the IteratorIterator wrapping is needed as some internal PHP classes are \Traversable but do not implement \Iterator + return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow); } -function twig_array_map($array, $arrow) +function twig_array_map(Environment $env, $array, $arrow) { + twig_check_arrow_in_sandbox($env, $arrow, 'map', 'filter'); + $r = []; foreach ($array as $k => $v) { $r[$k] = $arrow($v, $k); @@ -1539,12 +1634,25 @@ function twig_array_map($array, $arrow) return $r; } -function twig_array_reduce($array, $arrow, $initial = null) +function twig_array_reduce(Environment $env, $array, $arrow, $initial = null) { + twig_check_arrow_in_sandbox($env, $arrow, 'reduce', 'filter'); + if (!\is_array($array)) { + if (!$array instanceof \Traversable) { + throw new RuntimeError(sprintf('The "reduce" filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array))); + } + $array = iterator_to_array($array); } return array_reduce($array, $arrow, $initial); } + +function twig_check_arrow_in_sandbox(Environment $env, $arrow, $thing, $type) +{ + if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { + throw new RuntimeError(sprintf('The callable passed to the "%s" %s must be a Closure in sandbox mode.', $thing, $type)); + } +} } diff --git a/system/backend/php/vendor/twig/twig/src/Extension/DebugExtension.php b/system/backend/php/vendor/twig/twig/src/Extension/DebugExtension.php index cd3edacaada..2e8510dfb1d 100644 --- a/system/backend/php/vendor/twig/twig/src/Extension/DebugExtension.php +++ b/system/backend/php/vendor/twig/twig/src/Extension/DebugExtension.php @@ -46,7 +46,7 @@ function twig_var_dump(Environment $env, $context, ...$vars) return; } - ob_start(function () { return ''; }); + ob_start(); if (!$vars) { $vars = []; diff --git a/system/backend/php/vendor/twig/twig/src/Extension/EscaperExtension.php b/system/backend/php/vendor/twig/twig/src/Extension/EscaperExtension.php index b8dabccf112..19dfd7d100d 100644 --- a/system/backend/php/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/system/backend/php/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -211,7 +211,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char switch ($strategy) { case 'html': - // see https://secure.php.net/htmlspecialchars + // see https://www.php.net/htmlspecialchars // Using a static variable to avoid initializing the array // each time the function is called. Moving the declaration on the @@ -234,18 +234,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char ]; if (isset($htmlspecialcharsCharsets[$charset])) { - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); } if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { // cache the lowercase variant for future iterations $htmlspecialcharsCharsets[$charset] = true; - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); } - $string = iconv($charset, 'UTF-8', $string); - $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + $string = twig_convert_encoding($string, 'UTF-8', $charset); + $string = htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); return iconv('UTF-8', $charset, $string); @@ -253,7 +253,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char // escape all non-alphanumeric characters // into their \x or \uHHHH representations if ('UTF-8' !== $charset) { - $string = iconv($charset, 'UTF-8', $string); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } if (!preg_match('//u', $string)) { @@ -265,7 +265,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char /* * A few characters have short escape sequences in JSON and JavaScript. - * Escape sequences supported only by JavaScript, not JSON, are ommitted. + * Escape sequences supported only by JavaScript, not JSON, are omitted. * \" is also supported but omitted, because the resulting string is not HTML safe. */ static $shortMap = [ @@ -282,15 +282,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char return $shortMap[$char]; } - // \uHHHH - $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); - $char = strtoupper(bin2hex($char)); - - if (4 >= \strlen($char)) { - return sprintf('\u%04s', $char); + $codepoint = mb_ord($char, 'UTF-8'); + if (0x10000 > $codepoint) { + return sprintf('\u%04X', $codepoint); } - return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); + // Split characters outside the BMP into surrogate pairs + // https://tools.ietf.org/html/rfc2781.html#section-2.1 + $u = $codepoint - 0x10000; + $high = 0xD800 | ($u >> 10); + $low = 0xDC00 | ($u & 0x3FF); + + return sprintf('\u%04X\u%04X', $high, $low); }, $string); if ('UTF-8' !== $charset) { @@ -301,7 +304,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char case 'css': if ('UTF-8' !== $charset) { - $string = iconv($charset, 'UTF-8', $string); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } if (!preg_match('//u', $string)) { @@ -322,7 +325,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char case 'html_attr': if ('UTF-8' !== $charset) { - $string = iconv($charset, 'UTF-8', $string); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } if (!preg_match('//u', $string)) { @@ -389,20 +392,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char return rawurlencode($string); default: - static $escapers; - - if (null === $escapers) { - // merge the ones set on CoreExtension for BC (to be removed in 3.0) - $escapers = array_merge( - $env->getExtension(CoreExtension::class)->getEscapers(false), - $env->getExtension(EscaperExtension::class)->getEscapers() - ); + // check the ones set on CoreExtension for BC (to be removed in 3.0) + $legacyEscapers = $env->getExtension(CoreExtension::class)->getEscapers(false); + if (array_key_exists($strategy, $legacyEscapers)) { + return $legacyEscapers[$strategy]($env, $string, $charset); } - if (isset($escapers[$strategy])) { + $escapers = $env->getExtension(EscaperExtension::class)->getEscapers(); + if (array_key_exists($strategy, $escapers)) { return $escapers[$strategy]($env, $string, $charset); } + $escapers = array_merge($legacyEscapers, $escapers); $validStrategies = implode(', ', array_merge(['html', 'js', 'url', 'css', 'html_attr'], array_keys($escapers))); throw new RuntimeError(sprintf('Invalid escaping strategy "%s" (valid ones: %s).', $strategy, $validStrategies)); diff --git a/system/backend/php/vendor/twig/twig/src/Extension/ProfilerExtension.php b/system/backend/php/vendor/twig/twig/src/Extension/ProfilerExtension.php index ca5367c451e..9e87c05a037 100644 --- a/system/backend/php/vendor/twig/twig/src/Extension/ProfilerExtension.php +++ b/system/backend/php/vendor/twig/twig/src/Extension/ProfilerExtension.php @@ -41,7 +41,7 @@ public function leave(Profile $profile) public function getNodeVisitors() { - return [new ProfilerNodeVisitor(\get_class($this))]; + return [new ProfilerNodeVisitor(static::class)]; } } diff --git a/system/backend/php/vendor/twig/twig/src/Extension/SandboxExtension.php b/system/backend/php/vendor/twig/twig/src/Extension/SandboxExtension.php index d16e4edd012..dca3262a432 100644 --- a/system/backend/php/vendor/twig/twig/src/Extension/SandboxExtension.php +++ b/system/backend/php/vendor/twig/twig/src/Extension/SandboxExtension.php @@ -91,11 +91,11 @@ public function checkMethodAllowed($obj, $method, int $lineno = -1, Source $sour } } - public function checkPropertyAllowed($obj, $method, int $lineno = -1, Source $source = null) + public function checkPropertyAllowed($obj, $property, int $lineno = -1, Source $source = null) { if ($this->isSandboxed()) { try { - $this->policy->checkPropertyAllowed($obj, $method); + $this->policy->checkPropertyAllowed($obj, $property); } catch (SecurityNotAllowedPropertyError $e) { $e->setSourceContext($source); $e->setTemplateLine($lineno); diff --git a/system/backend/php/vendor/twig/twig/src/ExtensionSet.php b/system/backend/php/vendor/twig/twig/src/ExtensionSet.php index dc25b133b7a..deba573fbba 100644 --- a/system/backend/php/vendor/twig/twig/src/ExtensionSet.php +++ b/system/backend/php/vendor/twig/twig/src/ExtensionSet.php @@ -149,8 +149,6 @@ public function addExtension(ExtensionInterface $extension) throw new \LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $class)); } - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass($class))->name; $this->extensions[$class] = $extension; } diff --git a/system/backend/php/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/system/backend/php/vendor/twig/twig/src/FileExtensionEscapingStrategy.php index bc95f33435c..d79106c3148 100644 --- a/system/backend/php/vendor/twig/twig/src/FileExtensionEscapingStrategy.php +++ b/system/backend/php/vendor/twig/twig/src/FileExtensionEscapingStrategy.php @@ -41,7 +41,7 @@ public static function guess($name) $name = substr($name, 0, -5); } - $extension = pathinfo($name, PATHINFO_EXTENSION); + $extension = pathinfo($name, \PATHINFO_EXTENSION); switch ($extension) { case 'js': diff --git a/system/backend/php/vendor/twig/twig/src/Lexer.php b/system/backend/php/vendor/twig/twig/src/Lexer.php index 8bcd0f875c5..78931d7119d 100644 --- a/system/backend/php/vendor/twig/twig/src/Lexer.php +++ b/system/backend/php/vendor/twig/twig/src/Lexer.php @@ -21,6 +21,8 @@ */ class Lexer { + private $isInitialized = false; + private $tokens; private $code; private $cursor; @@ -37,18 +39,18 @@ class Lexer private $positions; private $currentVarBlockLine; - const STATE_DATA = 0; - const STATE_BLOCK = 1; - const STATE_VAR = 2; - const STATE_STRING = 3; - const STATE_INTERPOLATION = 4; + public const STATE_DATA = 0; + public const STATE_BLOCK = 1; + public const STATE_VAR = 2; + public const STATE_STRING = 3; + public const STATE_INTERPOLATION = 4; - const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; - const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; - const REGEX_DQ_STRING_DELIM = '/"/A'; - const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; - const PUNCTUATION = '()[]{}?:.,|'; + public const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + public const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; + public const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + public const REGEX_DQ_STRING_DELIM = '/"/A'; + public const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + public const PUNCTUATION = '()[]{}?:.,|'; public function __construct(Environment $env, array $options = []) { @@ -63,6 +65,15 @@ public function __construct(Environment $env, array $options = []) 'whitespace_line_chars' => ' \t\0\x0B', 'interpolation' => ['#{', '}'], ], $options); + } + + private function initialize() + { + if ($this->isInitialized) { + return; + } + + $this->isInitialized = true; // when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default $this->regexes = [ @@ -112,7 +123,7 @@ public function __construct(Environment $env, array $options = []) // #} 'lex_comment' => '{ (?:'. - preg_quote($this->options['whitespace_trim']).preg_quote($this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? + preg_quote($this->options['whitespace_trim'].$this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? '|'. preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]* '|'. @@ -155,6 +166,8 @@ public function __construct(Environment $env, array $options = []) public function tokenize(Source $source) { + $this->initialize(); + $this->source = $source; $this->code = str_replace(["\r\n", "\r"], "\n", $source->getCode()); $this->cursor = 0; @@ -167,7 +180,7 @@ public function tokenize(Source $source) $this->position = -1; // find all token starts in one go - preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, \PREG_OFFSET_CAPTURE); $this->positions = $matches; while ($this->cursor < $this->end) { @@ -322,7 +335,7 @@ private function lexExpression() // numbers elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) { $number = (float) $match[0]; // floats - if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + if (ctype_digit($match[0]) && $number <= \PHP_INT_MAX) { $number = (int) $match[0]; // integers lower than the maximum } $this->pushToken(/* Token::NUMBER_TYPE */ 6, $number); @@ -368,7 +381,7 @@ private function lexExpression() private function lexRawData() { - if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unexpected end of file: Unclosed "verbatim" block.', $this->lineno, $this->source); } @@ -392,7 +405,7 @@ private function lexRawData() private function lexComment() { - if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); } @@ -466,11 +479,15 @@ private function getOperatorRegex() $regex = []; foreach ($operators as $operator => $length) { // an operator that ends with a character must be followed by - // a whitespace or a parenthesis + // a whitespace, a parenthesis, an opening map [ or sequence { + $r = preg_quote($operator, '/'); if (ctype_alpha($operator[$length - 1])) { - $r = preg_quote($operator, '/').'(?=[\s()])'; - } else { - $r = preg_quote($operator, '/'); + $r .= '(?=[\s()\[{])'; + } + + // an operator that begins with a character must not have a dot or pipe before + if (ctype_alpha($operator[0])) { + $r = '(?rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR; - if (false !== $realPath = realpath($rootPath)) { + if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) { $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; } @@ -206,9 +206,9 @@ protected function findTemplate($name, $throw = true) } try { - $this->validateName($name); - list($namespace, $shortname) = $this->parseName($name); + + $this->validateName($shortname); } catch (LoaderError $e) { if (!$throw) { return false; @@ -252,7 +252,7 @@ protected function findTemplate($name, $throw = true) private function normalizeName($name) { - return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)); + return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); } private function parseName($name, $default = self::MAIN_NAMESPACE) @@ -300,7 +300,7 @@ private function isAbsolutePath($file) && ':' === $file[1] && strspn($file, '/\\', 2, 1) ) - || null !== parse_url($file, PHP_URL_SCHEME) + || null !== parse_url($file, \PHP_URL_SCHEME) ; } } diff --git a/system/backend/php/vendor/twig/twig/src/Markup.php b/system/backend/php/vendor/twig/twig/src/Markup.php index 43c890b4651..0cc45bef134 100644 --- a/system/backend/php/vendor/twig/twig/src/Markup.php +++ b/system/backend/php/vendor/twig/twig/src/Markup.php @@ -32,11 +32,19 @@ public function __toString() return $this->content; } + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return mb_strlen($this->content, $this->charset); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->content; diff --git a/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityCallNode.php b/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityCallNode.php new file mode 100644 index 00000000000..a78a38d80bb --- /dev/null +++ b/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityCallNode.php @@ -0,0 +1,28 @@ + + */ +class CheckSecurityCallNode extends Node +{ + public function compile(Compiler $compiler) + { + $compiler + ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") + ->write("\$this->checkSecurity();\n") + ; + } +} diff --git a/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityNode.php b/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityNode.php index 59857ca5a47..489a3652ddf 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/CheckSecurityNode.php @@ -45,10 +45,13 @@ public function compile(Compiler $compiler) } $compiler - ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") - ->write('$tags = ')->repr(array_filter($tags))->raw(";\n") - ->write('$filters = ')->repr(array_filter($filters))->raw(";\n") - ->write('$functions = ')->repr(array_filter($functions))->raw(";\n\n") + ->write("\n") + ->write("public function checkSecurity()\n") + ->write("{\n") + ->indent() + ->write('static $tags = ')->repr(array_filter($tags))->raw(";\n") + ->write('static $filters = ')->repr(array_filter($filters))->raw(";\n") + ->write('static $functions = ')->repr(array_filter($functions))->raw(";\n\n") ->write("try {\n") ->indent() ->write("\$this->sandbox->checkSecurity(\n") @@ -78,6 +81,8 @@ public function compile(Compiler $compiler) ->write("throw \$e;\n") ->outdent() ->write("}\n\n") + ->outdent() + ->write("}\n") ; } } diff --git a/system/backend/php/vendor/twig/twig/src/Node/EmbedNode.php b/system/backend/php/vendor/twig/twig/src/Node/EmbedNode.php index 4a1ef6fc592..016c17f8780 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/EmbedNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/EmbedNode.php @@ -23,7 +23,7 @@ class EmbedNode extends IncludeNode { // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) - public function __construct(string $name, int $index, AbstractExpression $variables = null, bool $only = false, bool $ignoreMissing = false, int $lineno, string $tag = null) + public function __construct(string $name, int $index, ?AbstractExpression $variables, bool $only, bool $ignoreMissing, int $lineno, string $tag = null) { parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php index 36b77da86f5..b5b720eddf6 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php @@ -44,7 +44,7 @@ public function compile(Compiler $compiler) ; } $compiler - ->raw(') use ($context) { ') + ->raw(') use ($context, $macros) { ') ; foreach ($this->getNode('names') as $name) { $compiler diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php new file mode 100644 index 00000000000..5245e4051ca --- /dev/null +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php @@ -0,0 +1,22 @@ +raw('<=>'); + } +} diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php index c68989ae7fe..8a6db4d002e 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php @@ -22,7 +22,7 @@ */ class BlockReferenceExpression extends AbstractExpression { - public function __construct(Node $name, Node $template = null, int $lineno, string $tag = null) + public function __construct(Node $name, ?Node $template, int $lineno, string $tag = null) { $nodes = ['name' => $name]; if (null !== $template) { diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/CallExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/CallExpression.php index 4ecd2c111b4..aeb38c42f89 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/CallExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/CallExpression.php @@ -24,21 +24,21 @@ protected function compileCallable(Compiler $compiler) { $callable = $this->getAttribute('callable'); - $closingParenthesis = false; - $isArray = false; if (\is_string($callable) && false === strpos($callable, '::')) { $compiler->raw($callable); } else { - list($r, $callable) = $this->reflectCallable($callable); - if ($r instanceof \ReflectionMethod && \is_string($callable[0])) { - if ($r->isStatic()) { + [$r, $callable] = $this->reflectCallable($callable); + + if (\is_string($callable)) { + $compiler->raw($callable); + } elseif (\is_array($callable) && \is_string($callable[0])) { + if (!$r instanceof \ReflectionMethod || $r->isStatic()) { $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1])); } else { $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); } - } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) { - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass(\get_class($callable[0])))->name; + } elseif (\is_array($callable) && $callable[0] instanceof ExtensionInterface) { + $class = \get_class($callable[0]); if (!$compiler->getEnvironment()->hasExtension($class)) { // Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error $compiler->raw(sprintf('$this->env->getExtension(\'%s\')', $class)); @@ -48,17 +48,11 @@ protected function compileCallable(Compiler $compiler) $compiler->raw(sprintf('->%s', $callable[1])); } else { - $closingParenthesis = true; - $isArray = true; - $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), ', ucfirst($this->getAttribute('type')), $this->getAttribute('name'))); + $compiler->raw(sprintf('$this->env->get%s(\'%s\')->getCallable()', ucfirst($this->getAttribute('type')), $this->getAttribute('name'))); } } - $this->compileArguments($compiler, $isArray); - - if ($closingParenthesis) { - $compiler->raw(')'); - } + $this->compileArguments($compiler); } protected function compileArguments(Compiler $compiler, $isArray = false) @@ -113,7 +107,7 @@ protected function compileArguments(Compiler $compiler, $isArray = false) $compiler->raw($isArray ? ']' : ')'); } - protected function getArguments($callable = null, $arguments) + protected function getArguments($callable, $arguments) { $callType = $this->getAttribute('type'); $callName = $this->getAttribute('name'); @@ -153,7 +147,16 @@ protected function getArguments($callable = null, $arguments) $optionalArguments = []; $pos = 0; foreach ($callableParameters as $callableParameter) { - $names[] = $name = $this->normalizeName($callableParameter->name); + $name = $this->normalizeName($callableParameter->name); + if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) { + if ('start' === $name) { + $name = 'low'; + } elseif ('end' === $name) { + $name = 'high'; + } + } + + $names[] = $name; if (\array_key_exists($name, $parameters)) { if (\array_key_exists($pos, $parameters)) { @@ -236,10 +239,7 @@ protected function normalizeName($name) private function getCallableParameters($callable, bool $isVariadic): array { - list($r) = $this->reflectCallable($callable); - if (null === $r) { - return [[], false]; - } + [$r, , $callableName] = $this->reflectCallable($callable); $parameters = $r->getParameters(); if ($this->hasNode('node')) { @@ -259,17 +259,13 @@ private function getCallableParameters($callable, bool $isVariadic): array $isPhpVariadic = false; if ($isVariadic) { $argument = end($parameters); - if ($argument && $argument->isArray() && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { + $isArray = $argument && $argument->hasType() && 'array' === $argument->getType()->getName(); + if ($isArray && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { array_pop($parameters); } elseif ($argument && $argument->isVariadic()) { array_pop($parameters); $isPhpVariadic = true; } else { - $callableName = $r->name; - if ($r instanceof \ReflectionMethod) { - $callableName = $r->getDeclaringClass()->name.'::'.$callableName; - } - throw new \LogicException(sprintf('The last parameter of "%s" for %s "%s" must be an array with default value, eg. "array $arg = []".', $callableName, $this->getAttribute('type'), $this->getAttribute('name'))); } } @@ -283,30 +279,44 @@ private function reflectCallable($callable) return $this->reflector; } - if (\is_array($callable)) { - if (!method_exists($callable[0], $callable[1])) { - // __call() - return [null, []]; - } + if (\is_string($callable) && false !== $pos = strpos($callable, '::')) { + $callable = [substr($callable, 0, $pos), substr($callable, 2 + $pos)]; + } + + if (\is_array($callable) && method_exists($callable[0], $callable[1])) { $r = new \ReflectionMethod($callable[0], $callable[1]); - } elseif (\is_object($callable) && !$callable instanceof \Closure) { - $r = new \ReflectionObject($callable); - $r = $r->getMethod('__invoke'); - $callable = [$callable, '__invoke']; - } elseif (\is_string($callable) && false !== $pos = strpos($callable, '::')) { - $class = substr($callable, 0, $pos); - $method = substr($callable, $pos + 2); - if (!method_exists($class, $method)) { - // __staticCall() - return [null, []]; - } - $r = new \ReflectionMethod($callable); - $callable = [$class, $method]; + + return $this->reflector = [$r, $callable, $r->class.'::'.$r->name]; + } + + $checkVisibility = $callable instanceof \Closure; + try { + $closure = \Closure::fromCallable($callable); + } catch (\TypeError $e) { + throw new \LogicException(sprintf('Callback for %s "%s" is not callable in the current scope.', $this->getAttribute('type'), $this->getAttribute('name')), 0, $e); + } + $r = new \ReflectionFunction($closure); + + if (false !== strpos($r->name, '{closure}')) { + return $this->reflector = [$r, $callable, 'Closure']; + } + + if ($object = $r->getClosureThis()) { + $callable = [$object, $r->name]; + $callableName = (\function_exists('get_debug_type') ? get_debug_type($object) : \get_class($object)).'::'.$r->name; + } elseif (\PHP_VERSION_ID >= 80111 && $class = $r->getClosureCalledClass()) { + $callableName = $class->name.'::'.$r->name; + } elseif (\PHP_VERSION_ID < 80111 && $class = $r->getClosureScopeClass()) { + $callableName = (\is_array($callable) ? $callable[0] : $class->name).'::'.$r->name; } else { - $r = new \ReflectionFunction($callable); + $callable = $callableName = $r->name; + } + + if ($checkVisibility && \is_array($callable) && method_exists(...$callable) && !(new \ReflectionMethod(...$callable))->isPublic()) { + $callable = $r->getClosure(); } - return $this->reflector = [$r, $callable]; + return $this->reflector = [$r, $callable, $callableName]; } } diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php index 7b066170ed5..de76845a746 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php @@ -18,7 +18,7 @@ class GetAttrExpression extends AbstractExpression { - public function __construct(AbstractExpression $node, AbstractExpression $attribute, AbstractExpression $arguments = null, string $type, int $lineno) + public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno) { $nodes = ['node' => $node, 'attribute' => $attribute]; if (null !== $arguments) { diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/NameExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/NameExpression.php index ff7a046a728..f8426bcc1f2 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/NameExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/NameExpression.php @@ -36,7 +36,7 @@ public function compile(Compiler $compiler) if ($this->getAttribute('is_defined_test')) { if ($this->isSpecial()) { $compiler->repr(true); - } elseif (\PHP_VERSION_ID >= 700400) { + } elseif (\PHP_VERSION_ID >= 70400) { $compiler ->raw('array_key_exists(') ->string($name) diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php index c551f2f6fac..de03ff22025 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php @@ -22,11 +22,15 @@ class NullCoalesceExpression extends ConditionalExpression { public function __construct(Node $left, Node $right, int $lineno) { - $test = new AndBinary( - new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()), - new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), - $left->getTemplateLine() - ); + $test = new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()); + // for "block()", we don't need the null test as the return value is always a string + if (!$left instanceof BlockReferenceExpression) { + $test = new AndBinary( + $test, + new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), + $left->getTemplateLine() + ); + } parent::__construct($test, $left, $right, $lineno); } diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php index 7a898406ccb..d748e86f0dc 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php @@ -35,7 +35,7 @@ */ class DefinedTest extends TestExpression { - public function __construct(Node $node, string $name, Node $arguments = null, int $lineno) + public function __construct(Node $node, string $name, ?Node $arguments, int $lineno) { if ($node instanceof NameExpression) { $node->setAttribute('is_defined_test', true); diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/OddTest.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/OddTest.php index 2dc693a9ae6..189e51e761e 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/OddTest.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/Test/OddTest.php @@ -28,7 +28,7 @@ public function compile(Compiler $compiler) $compiler ->raw('(') ->subcompile($this->getNode('node')) - ->raw(' % 2 == 1') + ->raw(' % 2 != 0') ->raw(')') ; } diff --git a/system/backend/php/vendor/twig/twig/src/Node/Expression/TestExpression.php b/system/backend/php/vendor/twig/twig/src/Node/Expression/TestExpression.php index 50aab052b71..24aa3903c3b 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Expression/TestExpression.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Expression/TestExpression.php @@ -16,7 +16,7 @@ class TestExpression extends CallExpression { - public function __construct(Node $node, string $name, Node $arguments = null, int $lineno) + public function __construct(Node $node, string $name, ?Node $arguments, int $lineno) { $nodes = ['node' => $node]; if (null !== $arguments) { diff --git a/system/backend/php/vendor/twig/twig/src/Node/ForNode.php b/system/backend/php/vendor/twig/twig/src/Node/ForNode.php index 54afe938349..d5c34e617c3 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/ForNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/ForNode.php @@ -25,7 +25,7 @@ class ForNode extends Node { private $loop; - public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, AbstractExpression $ifexpr = null, Node $body, Node $else = null, int $lineno, string $tag = null) + public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?AbstractExpression $ifexpr, Node $body, ?Node $else, int $lineno, string $tag = null) { $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); diff --git a/system/backend/php/vendor/twig/twig/src/Node/IfNode.php b/system/backend/php/vendor/twig/twig/src/Node/IfNode.php index 814a6f3a9f3..e74ca523b03 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/IfNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/IfNode.php @@ -21,7 +21,7 @@ */ class IfNode extends Node { - public function __construct(Node $tests, Node $else = null, int $lineno, string $tag = null) + public function __construct(Node $tests, ?Node $else, int $lineno, string $tag = null) { $nodes = ['tests' => $tests]; if (null !== $else) { @@ -50,8 +50,11 @@ public function compile(Compiler $compiler) ->subcompile($this->getNode('tests')->getNode($i)) ->raw(") {\n") ->indent() - ->subcompile($this->getNode('tests')->getNode($i + 1)) ; + // The node might not exists if the content is empty + if ($this->getNode('tests')->hasNode($i + 1)) { + $compiler->subcompile($this->getNode('tests')->getNode($i + 1)); + } } if ($this->hasNode('else')) { diff --git a/system/backend/php/vendor/twig/twig/src/Node/IncludeNode.php b/system/backend/php/vendor/twig/twig/src/Node/IncludeNode.php index d45303016bb..3bc91295b08 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/IncludeNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/IncludeNode.php @@ -22,7 +22,7 @@ */ class IncludeNode extends Node implements NodeOutputInterface { - public function __construct(AbstractExpression $expr, AbstractExpression $variables = null, bool $only = false, bool $ignoreMissing = false, int $lineno, string $tag = null) + public function __construct(AbstractExpression $expr, ?AbstractExpression $variables, bool $only, bool $ignoreMissing, int $lineno, string $tag = null) { $nodes = ['expr' => $expr]; if (null !== $variables) { diff --git a/system/backend/php/vendor/twig/twig/src/Node/MacroNode.php b/system/backend/php/vendor/twig/twig/src/Node/MacroNode.php index 6bb190937df..ca4686ce95f 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/MacroNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/MacroNode.php @@ -21,7 +21,7 @@ */ class MacroNode extends Node { - const VARARGS_NAME = 'varargs'; + public const VARARGS_NAME = 'varargs'; public function __construct(string $name, Node $body, Node $arguments, int $lineno, string $tag = null) { @@ -88,7 +88,13 @@ public function compile(Compiler $compiler) ->outdent() ->write("]);\n\n") ->write("\$blocks = [];\n\n") - ->write("ob_start(function () { return ''; });\n") + ; + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } + $compiler ->write("try {\n") ->indent() ->subcompile($this->getNode('body')) diff --git a/system/backend/php/vendor/twig/twig/src/Node/ModuleNode.php b/system/backend/php/vendor/twig/twig/src/Node/ModuleNode.php index b23a342e861..29af67706d9 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/ModuleNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/ModuleNode.php @@ -30,10 +30,10 @@ */ class ModuleNode extends Node { - public function __construct(Node $body, AbstractExpression $parent = null, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) + public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) { - if (__CLASS__ !== \get_class($this)) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + if (__CLASS__ !== static::class) { + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $nodes = [ diff --git a/system/backend/php/vendor/twig/twig/src/Node/Node.php b/system/backend/php/vendor/twig/twig/src/Node/Node.php index 909a687e4db..97447525f71 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/Node.php +++ b/system/backend/php/vendor/twig/twig/src/Node/Node.php @@ -40,7 +40,7 @@ public function __construct(array $nodes = [], array $attributes = [], int $line { foreach ($nodes as $name => $node) { if (!$node instanceof self) { - throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, \get_class($this))); + throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, static::class)); } } $this->nodes = $nodes; @@ -56,7 +56,7 @@ public function __toString() $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); } - $repr = [\get_class($this).'('.implode(', ', $attributes)]; + $repr = [static::class.'('.implode(', ', $attributes)]; if (\count($this->nodes)) { foreach ($this->nodes as $name => $node) { @@ -108,7 +108,7 @@ public function hasAttribute($name) public function getAttribute($name) { if (!\array_key_exists($name, $this->attributes)) { - throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, \get_class($this))); + throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, static::class)); } return $this->attributes[$name]; @@ -142,7 +142,7 @@ public function hasNode($name) public function getNode($name) { if (!isset($this->nodes[$name])) { - throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, \get_class($this))); + throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, static::class)); } return $this->nodes[$name]; @@ -158,11 +158,19 @@ public function removeNode($name) unset($this->nodes[$name]); } + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return \count($this->nodes); } + /** + * @return \Traversable + */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->nodes); @@ -175,7 +183,7 @@ public function setTemplateName($name/*, $triggerDeprecation = true */) { $triggerDeprecation = 2 > \func_num_args() || \func_get_arg(1); if ($triggerDeprecation) { - @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use setSourceContext() instead.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use setSourceContext() instead.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/system/backend/php/vendor/twig/twig/src/Node/SandboxNode.php b/system/backend/php/vendor/twig/twig/src/Node/SandboxNode.php index fe59313bf64..9f8ba46cd43 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/SandboxNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/SandboxNode.php @@ -34,12 +34,19 @@ public function compile(Compiler $compiler) ->write("\$this->sandbox->enableSandbox();\n") ->outdent() ->write("}\n") + ->write("try {\n") + ->indent() ->subcompile($this->getNode('body')) + ->outdent() + ->write("} finally {\n") + ->indent() ->write("if (!\$alreadySandboxed) {\n") ->indent() ->write("\$this->sandbox->disableSandbox();\n") ->outdent() ->write("}\n") + ->outdent() + ->write("}\n") ; } } diff --git a/system/backend/php/vendor/twig/twig/src/Node/SetNode.php b/system/backend/php/vendor/twig/twig/src/Node/SetNode.php index f7dbf686cc7..3cf4615f2b4 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/SetNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/SetNode.php @@ -57,8 +57,12 @@ public function compile(Compiler $compiler) $compiler->raw(')'); } else { if ($this->getAttribute('capture')) { + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } $compiler - ->write("ob_start(function () { return ''; });\n") ->subcompile($this->getNode('values')) ; } diff --git a/system/backend/php/vendor/twig/twig/src/Node/SpacelessNode.php b/system/backend/php/vendor/twig/twig/src/Node/SpacelessNode.php index 07c3107e608..8fc4a2df3cf 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/SpacelessNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/SpacelessNode.php @@ -33,7 +33,13 @@ public function compile(Compiler $compiler) { $compiler ->addDebugInfo($this) - ->write("ob_start(function () { return ''; });\n") + ; + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } + $compiler ->subcompile($this->getNode('body')) ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") ; diff --git a/system/backend/php/vendor/twig/twig/src/Node/WithNode.php b/system/backend/php/vendor/twig/twig/src/Node/WithNode.php index 74d1ea0a3b0..07a1c4e30d3 100644 --- a/system/backend/php/vendor/twig/twig/src/Node/WithNode.php +++ b/system/backend/php/vendor/twig/twig/src/Node/WithNode.php @@ -20,7 +20,7 @@ */ class WithNode extends Node { - public function __construct(Node $body, Node $variables = null, bool $only = false, int $lineno, string $tag = null) + public function __construct(Node $body, ?Node $variables, bool $only, int $lineno, string $tag = null) { $nodes = ['body' => $body]; if (null !== $variables) { diff --git a/system/backend/php/vendor/twig/twig/src/NodeTraverser.php b/system/backend/php/vendor/twig/twig/src/NodeTraverser.php index 625b049af94..12c5a16d602 100644 --- a/system/backend/php/vendor/twig/twig/src/NodeTraverser.php +++ b/system/backend/php/vendor/twig/twig/src/NodeTraverser.php @@ -71,7 +71,7 @@ private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node) } } else { if (false === $m) { - @trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', E_USER_DEPRECATED); + @trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', \E_USER_DEPRECATED); } $node->removeNode($k); diff --git a/system/backend/php/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php b/system/backend/php/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php index 684e73af4ab..f41d4637e14 100644 --- a/system/backend/php/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php +++ b/system/backend/php/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php @@ -44,11 +44,7 @@ public function leaveNode(Node $node, Environment $env) if ($node instanceof ModuleNode) { $this->inAModule = false; if ($this->hasMacroCalls) { - $body = [new ImportNode(new NameExpression('_self', 0), new AssignNameExpression('_self', 0), 0, 'import', true)]; - foreach ($node->getNode('body') as $n) { - $body[] = $n; - } - $node->setNode('body', new Node($body)); + $node->getNode('constructor_end')->setNode('_auto_macro_import', new ImportNode(new NameExpression('_self', 0), new AssignNameExpression('_self', 0), 0, 'import', true)); } } elseif ($this->inAModule) { if ( diff --git a/system/backend/php/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/system/backend/php/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php index 9f7cae4da61..62f7aafbaee 100644 --- a/system/backend/php/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +++ b/system/backend/php/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php @@ -37,12 +37,12 @@ */ final class OptimizerNodeVisitor extends AbstractNodeVisitor { - const OPTIMIZE_ALL = -1; - const OPTIMIZE_NONE = 0; - const OPTIMIZE_FOR = 2; - const OPTIMIZE_RAW_FILTER = 4; + public const OPTIMIZE_ALL = -1; + public const OPTIMIZE_NONE = 0; + public const OPTIMIZE_FOR = 2; + public const OPTIMIZE_RAW_FILTER = 4; // obsolete, does not do anything - const OPTIMIZE_VAR_ACCESS = 8; + public const OPTIMIZE_VAR_ACCESS = 8; private $loops = []; private $loopsTargets = []; diff --git a/system/backend/php/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php b/system/backend/php/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php index 9fb432d6872..a51fa10d69e 100644 --- a/system/backend/php/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php +++ b/system/backend/php/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php @@ -12,6 +12,7 @@ namespace Twig\NodeVisitor; use Twig\Environment; +use Twig\Node\CheckSecurityCallNode; use Twig\Node\CheckSecurityNode; use Twig\Node\CheckToStringNode; use Twig\Node\Expression\Binary\ConcatBinary; @@ -100,7 +101,8 @@ protected function doLeaveNode(Node $node, Environment $env) if ($node instanceof ModuleNode) { $this->inAModule = false; - $node->setNode('constructor_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('display_start')])); + $node->setNode('constructor_end', new Node([new CheckSecurityCallNode(), $node->getNode('constructor_end')])); + $node->setNode('class_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('class_end')])); } elseif ($this->inAModule) { if ($node instanceof PrintNode || $node instanceof SetNode) { $this->needsToStringWrap = false; diff --git a/system/backend/php/vendor/twig/twig/src/Parser.php b/system/backend/php/vendor/twig/twig/src/Parser.php index 8a937e329d1..0ef3dc2a079 100644 --- a/system/backend/php/vendor/twig/twig/src/Parser.php +++ b/system/backend/php/vendor/twig/twig/src/Parser.php @@ -56,13 +56,13 @@ public function __construct(Environment $env) public function getVarName() { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); + return sprintf('__internal_parse_%d', $this->varNameSalt++); } public function parse(TokenStream $stream, $test = null, $dropNeedle = false) { $vars = get_object_vars($this); - unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']); + unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames'], $vars['varNameSalt']); $this->stack[] = $vars; // tag handlers @@ -92,7 +92,6 @@ public function parse(TokenStream $stream, $test = null, $dropNeedle = false) $this->blockStack = []; $this->importedSymbols = [[]]; $this->embeddedTemplates = []; - $this->varNameSalt = 0; try { $body = $this->subparse($test, $dropNeedle); @@ -250,7 +249,7 @@ public function setMacro($name, MacroNode $node) */ public function isReservedMacroName($name) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), \E_USER_DEPRECATED); return false; } @@ -360,7 +359,7 @@ private function filterBodyNodes(Node $node, bool $nested = false) // to be removed completely in Twig 3.0 if (!$nested && $node instanceof SpacelessNode) { - @trigger_error(sprintf('Using the spaceless tag at the root level of a child template in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), E_USER_DEPRECATED); + @trigger_error(sprintf('Using the spaceless tag at the root level of a child template in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); } // "block" tags that are not captured (see above) are only used for defining @@ -368,7 +367,7 @@ private function filterBodyNodes(Node $node, bool $nested = false) // expected as the definition is not part of the default template code flow. if ($nested && ($node instanceof BlockReferenceNode || $node instanceof \Twig_Node_BlockReference)) { //throw new SyntaxError('A block definition cannot be nested under non-capturing nodes.', $node->getTemplateLine(), $this->stream->getSourceContext()); - @trigger_error(sprintf('Nesting a block definition under a non-capturing node in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), E_USER_DEPRECATED); + @trigger_error(sprintf('Nesting a block definition under a non-capturing node in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); return; } diff --git a/system/backend/php/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/system/backend/php/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php index f19f6b78fba..8b7c18adb67 100644 --- a/system/backend/php/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ b/system/backend/php/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -28,10 +28,12 @@ final class ProfilerNodeVisitor extends AbstractNodeVisitor { private $extensionName; + private $varName; public function __construct(string $extensionName) { $this->extensionName = $extensionName; + $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); } protected function doEnterNode(Node $node, Environment $env) @@ -42,33 +44,25 @@ protected function doEnterNode(Node $node, Environment $env) protected function doLeaveNode(Node $node, Environment $env) { if ($node instanceof ModuleNode) { - $varName = $this->getVarName(); - $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); - $node->setNode('display_end', new Node([new LeaveProfileNode($varName), $node->getNode('display_end')])); + $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); + $node->setNode('display_end', new Node([new LeaveProfileNode($this->varName), $node->getNode('display_end')])); } elseif ($node instanceof BlockNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } elseif ($node instanceof MacroNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } return $node; } - private function getVarName(): string - { - return sprintf('__internal_%s', hash('sha256', $this->extensionName)); - } - public function getPriority() { return 0; diff --git a/system/backend/php/vendor/twig/twig/src/Profiler/Profile.php b/system/backend/php/vendor/twig/twig/src/Profiler/Profile.php index e9726d6d601..3a5ff8b50fb 100644 --- a/system/backend/php/vendor/twig/twig/src/Profiler/Profile.php +++ b/system/backend/php/vendor/twig/twig/src/Profiler/Profile.php @@ -18,10 +18,10 @@ */ class Profile implements \IteratorAggregate, \Serializable { - const ROOT = 'ROOT'; - const BLOCK = 'block'; - const TEMPLATE = 'template'; - const MACRO = 'macro'; + public const ROOT = 'ROOT'; + public const BLOCK = 'block'; + public const TEMPLATE = 'template'; + public const MACRO = 'macro'; private $template; private $name; @@ -32,8 +32,8 @@ class Profile implements \IteratorAggregate, \Serializable public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main') { - if (__CLASS__ !== \get_class($this)) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + if (__CLASS__ !== static::class) { + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->template = $template; @@ -157,17 +157,18 @@ public function reset() $this->enter(); } - public function getIterator() + #[\ReturnTypeWillChange] + public function getIterator(): \Traversable { return new \ArrayIterator($this->profiles); } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } - public function unserialize($data) + public function unserialize($data): void { $this->__unserialize(unserialize($data)); } @@ -175,7 +176,7 @@ public function unserialize($data) /** * @internal */ - public function __serialize() + public function __serialize(): array { return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; } @@ -183,7 +184,7 @@ public function __serialize() /** * @internal */ - public function __unserialize(array $data) + public function __unserialize(array $data): void { list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php index 767ec5b3dd8..33c84f2231f 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedFilterError extends SecurityError public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->filterName = $functionName; diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php index 5a3013998cc..5151762b567 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedFunctionError extends SecurityError public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->functionName = $functionName; diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php index c8103ea0f16..62c3fddd5f1 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php @@ -26,13 +26,13 @@ class SecurityNotAllowedMethodError extends SecurityError public function __construct(string $message, string $className, string $methodName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->className = $className; diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php index d148f08d2e2..a9e4aff2725 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php @@ -26,13 +26,13 @@ class SecurityNotAllowedPropertyError extends SecurityError public function __construct(string $message, string $className, string $propertyName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->className = $className; diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php index 25f6361131e..0abc49ef312 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedTagError extends SecurityError public function __construct(string $message, string $tagName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->tagName = $tagName; diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicy.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicy.php index 01fecf8044a..1406e8061a9 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicy.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicy.php @@ -50,7 +50,7 @@ public function setAllowedMethods(array $methods) { $this->allowedMethods = []; foreach ($methods as $class => $m) { - $this->allowedMethods[$class] = array_map('strtolower', \is_array($m) ? $m : [$m]); + $this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); } } @@ -92,7 +92,7 @@ public function checkMethodAllowed($obj, $method) } $allowed = false; - $method = strtolower($method); + $method = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); foreach ($this->allowedMethods as $class => $methods) { if ($obj instanceof $class) { $allowed = \in_array($method, $methods); diff --git a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php index 8b2ab4a9ce9..0166f67a389 100644 --- a/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php +++ b/system/backend/php/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php @@ -19,19 +19,29 @@ interface SecurityPolicyInterface { /** + * @param string[] $tags + * @param string[] $filters + * @param string[] $functions + * * @throws SecurityError */ public function checkSecurity($tags, $filters, $functions); /** + * @param object $obj + * @param string $method + * * @throws SecurityNotAllowedMethodError */ public function checkMethodAllowed($obj, $method); /** + * @param object $obj + * @param string $property + * * @throws SecurityNotAllowedPropertyError */ - public function checkPropertyAllowed($obj, $method); + public function checkPropertyAllowed($obj, $property); } class_alias('Twig\Sandbox\SecurityPolicyInterface', 'Twig_Sandbox_SecurityPolicyInterface'); diff --git a/system/backend/php/vendor/twig/twig/src/Template.php b/system/backend/php/vendor/twig/twig/src/Template.php index ed680a42c34..76d55cbcb3a 100644 --- a/system/backend/php/vendor/twig/twig/src/Template.php +++ b/system/backend/php/vendor/twig/twig/src/Template.php @@ -29,9 +29,9 @@ */ abstract class Template { - const ANY_CALL = 'any'; - const ARRAY_CALL = 'array'; - const METHOD_CALL = 'method'; + public const ANY_CALL = 'any'; + public const ARRAY_CALL = 'array'; + public const METHOD_CALL = 'method'; protected $parent; protected $parents = []; @@ -85,8 +85,6 @@ public function getSourceContext() * This method is for internal use only and should never be called * directly. * - * @param array $context - * * @return Template|TemplateWrapper|false The parent template or false if there is no parent */ public function getParent(array $context) @@ -223,7 +221,11 @@ public function displayBlock($name, array $context, array $blocks = [], $useBloc */ public function renderParentBlock($name, array $context, array $blocks = []) { - ob_start(function () { return ''; }); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } $this->displayParentBlock($name, $context, $blocks); return ob_get_clean(); @@ -244,7 +246,11 @@ public function renderParentBlock($name, array $context, array $blocks = []) */ public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true) { - ob_start(function () { return ''; }); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } $this->displayBlock($name, $context, $blocks, $useBlocks); return ob_get_clean(); @@ -316,7 +322,7 @@ protected function loadTemplate($template, $templateName = null, $line = null, $ } if ($template === $this->getTemplateName()) { - $class = \get_class($this); + $class = static::class; if (false !== $pos = strrpos($class, '___', -1)) { $class = substr($class, 0, $pos); } @@ -349,7 +355,7 @@ protected function loadTemplate($template, $templateName = null, $line = null, $ * * @return Template */ - protected function unwrap() + public function unwrap() { return $this; } @@ -375,7 +381,11 @@ public function display(array $context, array $blocks = []) public function render(array $context) { $level = ob_get_level(); - ob_start(function () { return ''; }); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } try { $this->display($context); } catch (\Throwable $e) { diff --git a/system/backend/php/vendor/twig/twig/src/TemplateWrapper.php b/system/backend/php/vendor/twig/twig/src/TemplateWrapper.php index 8dea3ac08e9..8b44815313c 100644 --- a/system/backend/php/vendor/twig/twig/src/TemplateWrapper.php +++ b/system/backend/php/vendor/twig/twig/src/TemplateWrapper.php @@ -92,7 +92,11 @@ public function renderBlock(string $name, array $context = []): string { $context = $this->env->mergeGlobals($context); $level = ob_get_level(); - ob_start(function () { return ''; }); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } try { $this->template->displayBlock($name, $context); } catch (\Throwable $e) { diff --git a/system/backend/php/vendor/twig/twig/src/Test/IntegrationTestCase.php b/system/backend/php/vendor/twig/twig/src/Test/IntegrationTestCase.php index d9c32902948..df880a84128 100644 --- a/system/backend/php/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ b/system/backend/php/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -120,7 +120,7 @@ public function getTests($name, $legacyTests = false) $deprecation = $match[3]; $templates = self::parseTemplates($match[4]); $exception = false; - preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, \PREG_SET_ORDER); } else { throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); } @@ -186,12 +186,12 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e // avoid using the same PHP class name for different cases $p = new \ReflectionProperty($twig, 'templateClassPrefix'); $p->setAccessible(true); - $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); + $p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid(mt_rand(), true), false).'_'); $deprecations = []; try { $prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) { - if (E_USER_DEPRECATED === $type) { + if (\E_USER_DEPRECATED === $type) { $deprecations[] = $msg; return true; @@ -255,9 +255,9 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e protected static function parseTemplates($test) { $templates = []; - preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER); foreach ($matches as $match) { - $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + $templates[($match[1] ?: 'index.twig')] = $match[2]; } return $templates; diff --git a/system/backend/php/vendor/twig/twig/src/Token.php b/system/backend/php/vendor/twig/twig/src/Token.php index 262fa48db74..0b2ef9be43c 100644 --- a/system/backend/php/vendor/twig/twig/src/Token.php +++ b/system/backend/php/vendor/twig/twig/src/Token.php @@ -23,20 +23,20 @@ final class Token private $type; private $lineno; - const EOF_TYPE = -1; - const TEXT_TYPE = 0; - const BLOCK_START_TYPE = 1; - const VAR_START_TYPE = 2; - const BLOCK_END_TYPE = 3; - const VAR_END_TYPE = 4; - const NAME_TYPE = 5; - const NUMBER_TYPE = 6; - const STRING_TYPE = 7; - const OPERATOR_TYPE = 8; - const PUNCTUATION_TYPE = 9; - const INTERPOLATION_START_TYPE = 10; - const INTERPOLATION_END_TYPE = 11; - const ARROW_TYPE = 12; + public const EOF_TYPE = -1; + public const TEXT_TYPE = 0; + public const BLOCK_START_TYPE = 1; + public const VAR_START_TYPE = 2; + public const BLOCK_END_TYPE = 3; + public const VAR_END_TYPE = 4; + public const NAME_TYPE = 5; + public const NUMBER_TYPE = 6; + public const STRING_TYPE = 7; + public const OPERATOR_TYPE = 8; + public const PUNCTUATION_TYPE = 9; + public const INTERPOLATION_START_TYPE = 10; + public const INTERPOLATION_END_TYPE = 11; + public const ARROW_TYPE = 12; /** * @param int $type The type of the token diff --git a/system/backend/php/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php b/system/backend/php/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php index 879879a2b01..c75e5ef8aa9 100644 --- a/system/backend/php/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php +++ b/system/backend/php/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php @@ -22,7 +22,7 @@ * * {% apply upper %} * This text becomes uppercase - * {% endapplys %} + * {% endapply %} */ final class ApplyTokenParser extends AbstractTokenParser { diff --git a/system/backend/php/vendor/twig/twig/src/TokenParser/FilterTokenParser.php b/system/backend/php/vendor/twig/twig/src/TokenParser/FilterTokenParser.php index e57fc90aa78..5f66c58296c 100644 --- a/system/backend/php/vendor/twig/twig/src/TokenParser/FilterTokenParser.php +++ b/system/backend/php/vendor/twig/twig/src/TokenParser/FilterTokenParser.php @@ -33,7 +33,7 @@ public function parse(Token $token) $stream = $this->parser->getStream(); $lineno = $token->getLine(); - @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $name = $this->parser->getVarName(); $ref = new BlockReferenceExpression(new ConstantExpression($name, $lineno), null, $lineno, $this->getTag()); diff --git a/system/backend/php/vendor/twig/twig/src/TokenParser/ForTokenParser.php b/system/backend/php/vendor/twig/twig/src/TokenParser/ForTokenParser.php index 34430f00b00..a7987d95d9b 100644 --- a/system/backend/php/vendor/twig/twig/src/TokenParser/ForTokenParser.php +++ b/system/backend/php/vendor/twig/twig/src/TokenParser/ForTokenParser.php @@ -43,7 +43,7 @@ public function parse(Token $token) $ifexpr = null; if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'if')) { - @trigger_error(sprintf('Using an "if" condition on "for" tag in "%s" at line %d is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('Using an "if" condition on "for" tag in "%s" at line %d is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $ifexpr = $this->parser->getExpressionParser()->parseExpression(); } diff --git a/system/backend/php/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php b/system/backend/php/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php index 601e476fc89..a609c2f7e2f 100644 --- a/system/backend/php/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php +++ b/system/backend/php/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php @@ -24,7 +24,7 @@ * {% endspaceless %} * {# output will be
    foo
    #} * - * @deprecated since Twig 2.7, to be removed in 3.0 (use the spaceless filter instead) + * @deprecated since Twig 2.7, to be removed in 3.0 (use the "spaceless" filter with the "apply" tag instead) */ final class SpacelessTokenParser extends AbstractTokenParser { @@ -33,7 +33,7 @@ public function parse(Token $token) $stream = $this->parser->getStream(); $lineno = $token->getLine(); - @trigger_error(sprintf('The spaceless tag in "%s" at line %d is deprecated since Twig 2.7, use the spaceless filter instead.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('The spaceless tag in "%s" at line %d is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $stream->expect(/* Token::BLOCK_END_TYPE */ 3); $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); diff --git a/system/backend/php/vendor/twig/twig/src/TwigFilter.php b/system/backend/php/vendor/twig/twig/src/TwigFilter.php index 9e7b8388e53..4351cf1397e 100644 --- a/system/backend/php/vendor/twig/twig/src/TwigFilter.php +++ b/system/backend/php/vendor/twig/twig/src/TwigFilter.php @@ -39,8 +39,8 @@ class TwigFilter */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== \get_class($this)) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + if (__CLASS__ !== static::class) { + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/system/backend/php/vendor/twig/twig/src/TwigFunction.php b/system/backend/php/vendor/twig/twig/src/TwigFunction.php index c5779af6137..e0d961f868d 100644 --- a/system/backend/php/vendor/twig/twig/src/TwigFunction.php +++ b/system/backend/php/vendor/twig/twig/src/TwigFunction.php @@ -39,8 +39,8 @@ class TwigFunction */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== \get_class($this)) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + if (__CLASS__ !== static::class) { + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/system/backend/php/vendor/twig/twig/src/TwigTest.php b/system/backend/php/vendor/twig/twig/src/TwigTest.php index e15da41cbf5..6a58a56e3fd 100644 --- a/system/backend/php/vendor/twig/twig/src/TwigTest.php +++ b/system/backend/php/vendor/twig/twig/src/TwigTest.php @@ -38,8 +38,8 @@ class TwigTest */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== \get_class($this)) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + if (__CLASS__ !== static::class) { + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; @@ -49,6 +49,7 @@ public function __construct(string $name, $callable = null, array $options = []) 'node_class' => TestExpression::class, 'deprecated' => false, 'alternative' => null, + 'one_mandatory_argument' => false, ], $options); } @@ -101,6 +102,11 @@ public function getAlternative() { return $this->options['alternative']; } + + public function hasOneMandatoryArgument(): bool + { + return (bool) $this->options['one_mandatory_argument']; + } } // For Twig 1.x compatibility diff --git a/system/backend/php/vendor/twig/twig/src/Util/DeprecationCollector.php b/system/backend/php/vendor/twig/twig/src/Util/DeprecationCollector.php index d37369841fd..17c169f74c8 100644 --- a/system/backend/php/vendor/twig/twig/src/Util/DeprecationCollector.php +++ b/system/backend/php/vendor/twig/twig/src/Util/DeprecationCollector.php @@ -57,7 +57,7 @@ public function collect(\Traversable $iterator) { $deprecations = []; set_error_handler(function ($type, $msg) use (&$deprecations) { - if (E_USER_DEPRECATED === $type) { + if (\E_USER_DEPRECATED === $type) { $deprecations[] = $msg; } }); diff --git a/system/backend/php/vendor/twig/twig/src/Util/TemplateDirIterator.php b/system/backend/php/vendor/twig/twig/src/Util/TemplateDirIterator.php index 1ab0dac59d5..b0356d4c2f5 100644 --- a/system/backend/php/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ b/system/backend/php/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -16,11 +16,19 @@ */ class TemplateDirIterator extends \IteratorIterator { + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function current() { return file_get_contents(parent::current()); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function key() { return (string) parent::key(); diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php deleted file mode 100644 index 8ea464d6325..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php +++ /dev/null @@ -1,195 +0,0 @@ -classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce; - $this->directory = sys_get_temp_dir().'/twig-test'; - $this->cache = new FilesystemCache($this->directory); - } - - protected function tearDown() - { - if (file_exists($this->directory)) { - Twig_Tests_FilesystemHelper::removeDir($this->directory); - } - } - - public function testLoad() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertTrue(is_dir($dir)); - $this->assertFalse(class_exists($this->classname, false)); - - $content = $this->generateSource(); - file_put_contents($key, $content); - - $this->cache->load($key); - - $this->assertTrue(class_exists($this->classname, false)); - } - - public function testLoadMissing() - { - $key = $this->directory.'/cache/cachefile.php'; - - $this->assertFalse(class_exists($this->classname, false)); - - $this->cache->load($key); - - $this->assertFalse(class_exists($this->classname, false)); - } - - public function testWrite() - { - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - $this->assertFileNotExists($this->directory); - - $this->cache->write($key, $content); - - $this->assertFileExists($this->directory); - $this->assertFileExists($key); - $this->assertSame(file_get_contents($key), $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to create the cache directory - */ - public function testWriteFailMkdir() - { - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create read-only root directory. - @mkdir($this->directory, 0555, true); - $this->assertTrue(is_dir($this->directory)); - - $this->cache->write($key, $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to write in the cache directory - */ - public function testWriteFailDirWritable() - { - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create root directory. - @mkdir($this->directory, 0777, true); - // Create read-only subdirectory. - @mkdir($this->directory.'/cache', 0555); - $this->assertTrue(is_dir($this->directory.'/cache')); - - $this->cache->write($key, $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Failed to write cache file - */ - public function testWriteFailWriteFile() - { - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create a directory in the place of the cache file. - @mkdir($key, 0777, true); - $this->assertTrue(is_dir($key)); - - $this->cache->write($key, $content); - } - - public function testGetTimestamp() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertTrue(is_dir($dir)); - - // Create the file with a specific modification time. - touch($key, 1234567890); - - $this->assertSame(1234567890, $this->cache->getTimestamp($key)); - } - - public function testGetTimestampMissingFile() - { - $key = $this->directory.'/cache/cachefile.php'; - $this->assertSame(0, $this->cache->getTimestamp($key)); - } - - /** - * Test file cache is tolerant towards trailing (back)slashes on the configured cache directory. - * - * @dataProvider provideDirectories - */ - public function testGenerateKey($expected, $input) - { - $cache = new FilesystemCache($input); - $this->assertRegExp($expected, $cache->generateKey('_test_', \get_class($this))); - } - - public function provideDirectories() - { - $pattern = '#a/b/[a-zA-Z0-9]+/[a-zA-Z0-9]+.php$#'; - - return [ - [$pattern, 'a/b'], - [$pattern, 'a/b/'], - [$pattern, 'a/b\\'], - [$pattern, 'a/b\\/'], - [$pattern, 'a/b\\//'], - ['#/'.substr($pattern, 1), '/a/b'], - ]; - } - - private function generateSource() - { - return strtr(' $this->classname, - ]); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/CompilerTest.php deleted file mode 100644 index f03342afbc0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/CompilerTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock())); - - $locale = setlocale(LC_NUMERIC, 0); - if (false === $locale) { - $this->markTestSkipped('Your platform does not support locales.'); - } - - $required_locales = ['fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252']; - if (false === setlocale(LC_NUMERIC, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); - } - - $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); - $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_NUMERIC, $locale); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php deleted file mode 100644 index 488e855a73d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php +++ /dev/null @@ -1,36 +0,0 @@ -getMockBuilder(ContainerInterface::class)->getMock(); - $container->expects($this->once())->method('has')->with('stdClass')->willReturn(true); - $container->expects($this->once())->method('get')->with('stdClass')->willReturn(new \stdClass()); - - $loader = new ContainerRuntimeLoader($container); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - public function testLoadUnknownRuntimeReturnsNull() - { - $container = $this->getMockBuilder(ContainerInterface::class)->getMock(); - $container->expects($this->once())->method('has')->with('Foo'); - $container->expects($this->never())->method('get'); - - $this->assertNull((new ContainerRuntimeLoader($container))->load('Foo')); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php deleted file mode 100644 index 4d05ac14e2a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php +++ /dev/null @@ -1,82 +0,0 @@ -expectException('InvalidArgumentException'); - $this->expectExceptionMessage($expectedExceptionMessage); - } else { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - } - - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $env->addExtension($extension); - $env->getUnaryOperators(); - } - - public function provideInvalidExtensions() - { - return [ - [new InvalidOperatorExtension(new \stdClass()), '"InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'], - [new InvalidOperatorExtension([1, 2, 3]), '"InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'], - ]; - } -} - -class InvalidOperatorExtension implements ExtensionInterface -{ - private $operators; - - public function __construct($operators) - { - $this->operators = $operators; - } - - public function getTokenParsers() - { - return []; - } - - public function getNodeVisitors() - { - return []; - } - - public function getFilters() - { - return []; - } - - public function getTests() - { - return []; - } - - public function getFunctions() - { - return []; - } - - public function getOperators() - { - return $this->operators; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php deleted file mode 100644 index a164a0cde69..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +++ /dev/null @@ -1,517 +0,0 @@ - '{{ foo }} {{ foo }}', - 'js' => '{{ bar }} {{ bar }}', - ]); - - $twig = new Environment($loader, [ - 'debug' => true, - 'cache' => false, - 'autoescape' => [$this, 'escapingStrategyCallback'], - ]); - - $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', ['foo' => 'foo
    '])); - $this->assertEquals('foo\u003Cbr\/\u0020\u003E foo\u003Cbr\/\u0020\u003E', $twig->render('js', ['bar' => 'foo
    '])); - } - - public function escapingStrategyCallback($name) - { - return $name; - } - - public function testGlobals() - { - $loader = $this->getMockBuilder(LoaderInterface::class)->getMock(); - $loader->expects($this->any())->method('getSourceContext')->willReturn(new Source('', '')); - - // globals can be added after calling getGlobals - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions and a template has been loaded - $arrayLoader = new ArrayLoader(['index' => '{{foo}}']); - $twig = new Environment($arrayLoader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - $twig = new Environment($arrayLoader); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $template = $twig->load('index'); - $this->assertEquals('bar', $template->render([])); - - // globals cannot be added after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertArrayNotHasKey('bar', $twig->getGlobals()); - } - - // globals cannot be added after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertArrayNotHasKey('bar', $twig->getGlobals()); - } - - // globals cannot be added after extensions and a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertArrayNotHasKey('bar', $twig->getGlobals()); - } - - // test adding globals after a template has been loaded without call to getGlobals - $twig = new Environment($loader); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertArrayNotHasKey('bar', $twig->getGlobals()); - } - } - - public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate() - { - $cache = new FilesystemCache($dir = sys_get_temp_dir().'/twig'); - $options = ['cache' => $cache, 'auto_reload' => false, 'debug' => false]; - - // force compilation - $twig = new Environment($loader = new ArrayLoader(['index' => '{{ foo }}']), $options); - - $key = $cache->generateKey('index', $twig->getTemplateClass('index')); - $cache->write($key, $twig->compileSource(new Source('{{ foo }}', 'index'))); - - // check that extensions won't be initialized when rendering a template that is already in the cache - $twig = $this - ->getMockBuilder(Environment::class) - ->setConstructorArgs([$loader, $options]) - ->setMethods(['initExtensions']) - ->getMock() - ; - - $twig->expects($this->never())->method('initExtensions'); - - // render template - $output = $twig->render('index', ['foo' => 'bar']); - $this->assertEquals('bar', $output); - - Twig_Tests_FilesystemHelper::removeDir($dir); - } - - public function testAutoReloadCacheMiss() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder(CacheInterface::class)->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - // Cache miss: getTimestamp returns 0 and as a result the load() is - // skipped. - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn(0); - $loader->expects($this->never()) - ->method('isFresh'); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder(CacheInterface::class)->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - // Cache hit: getTimestamp returns something > extension timestamps and - // the loader returns true for isFresh(). - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(true); - $cache->expects($this->atLeastOnce()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadOutdatedCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder(CacheInterface::class)->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(false); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - public function testHasGetExtensionByClassName() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $twig->addExtension($ext = new Twig_Tests_EnvironmentTest_Extension()); - $this->assertTrue($twig->hasExtension('Twig_Tests_EnvironmentTest_Extension')); - $this->assertTrue($twig->hasExtension('\Twig_Tests_EnvironmentTest_Extension')); - - $this->assertSame($ext, $twig->getExtension('Twig_Tests_EnvironmentTest_Extension')); - $this->assertSame($ext, $twig->getExtension('\Twig_Tests_EnvironmentTest_Extension')); - - $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest\Extension')); - $this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest\Extension')); - } - - public function testAddExtension() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - - $this->assertArrayHasKey('test', $twig->getTags()); - $this->assertArrayHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayHasKey('foo_test', $twig->getTests()); - $this->assertArrayHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - $visitors = $twig->getNodeVisitors(); - $found = false; - foreach ($visitors as $visitor) { - if ($visitor instanceof Twig_Tests_EnvironmentTest_NodeVisitor) { - $found = true; - } - } - $this->assertTrue($found); - } - - public function testAddMockExtension() - { - $extension = $this->getMockBuilder(ExtensionInterface::class)->getMock(); - - $loader = new ArrayLoader(['page' => 'hey']); - - $twig = new Environment($loader); - $twig->addExtension($extension); - - $this->assertInstanceOf(ExtensionInterface::class, $twig->getExtension(\get_class($extension))); - $this->assertTrue($twig->isTemplateFresh('page', time())); - } - - /** - * @group legacy - */ - public function testInitRuntimeWithAnExtensionUsingInitRuntimeNoDeprecation() - { - $loader = $this->getMockBuilder(LoaderInterface::class)->getMock(); - $twig = new Environment($loader); - $loader->expects($this->once())->method('getSourceContext')->willReturn(new Source('', '')); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime()); - $twig->load(''); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any deprecations - $this->addToAssertionCount(1); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Unable to register extension "Twig_Tests_EnvironmentTest_Extension" as it is already registered. - */ - public function testOverrideExtension() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - } - - public function testAddRuntimeLoader() - { - $runtimeLoader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock(); - $runtimeLoader->expects($this->any())->method('load')->willReturn(new Twig_Tests_EnvironmentTest_Runtime()); - - $loader = new ArrayLoader([ - 'func_array' => '{{ from_runtime_array("foo") }}', - 'func_array_default' => '{{ from_runtime_array() }}', - 'func_array_named_args' => '{{ from_runtime_array(name="foo") }}', - 'func_string' => '{{ from_runtime_string("foo") }}', - 'func_string_default' => '{{ from_runtime_string() }}', - 'func_string_named_args' => '{{ from_runtime_string(name="foo") }}', - ]); - - $twig = new Environment($loader); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime()); - $twig->addRuntimeLoader($runtimeLoader); - - $this->assertEquals('foo', $twig->render('func_array')); - $this->assertEquals('bar', $twig->render('func_array_default')); - $this->assertEquals('foo', $twig->render('func_array_named_args')); - $this->assertEquals('foo', $twig->render('func_string')); - $this->assertEquals('bar', $twig->render('func_string_default')); - $this->assertEquals('foo', $twig->render('func_string_named_args')); - } - - /** - * @expectedException \Twig\Error\RuntimeError - * @expectedExceptionMessage Failed to load Twig template "testFailLoadTemplate.twig", index "112233": cache might be corrupted in "testFailLoadTemplate.twig". - */ - public function testFailLoadTemplate() - { - $template = 'testFailLoadTemplate.twig'; - $twig = new Environment(new ArrayLoader([$template => false])); - $twig->loadTemplate($template, 112233); - } - - protected function getMockLoader($templateName, $templateContent) - { - $loader = $this->getMockBuilder(LoaderInterface::class)->getMock(); - $loader->expects($this->any()) - ->method('getSourceContext') - ->with($templateName) - ->willReturn(new Source($templateContent, $templateName)); - $loader->expects($this->any()) - ->method('getCacheKey') - ->with($templateName) - ->willReturn($templateName); - - return $loader; - } -} - -class Twig_Tests_EnvironmentTest_Extension_WithGlobals extends AbstractExtension -{ - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} - -class Twig_Tests_EnvironmentTest_Extension extends AbstractExtension implements GlobalsInterface -{ - public function getTokenParsers() - { - return [ - new Twig_Tests_EnvironmentTest_TokenParser(), - ]; - } - - public function getNodeVisitors() - { - return [ - new Twig_Tests_EnvironmentTest_NodeVisitor(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('foo_filter'), - ]; - } - - public function getTests() - { - return [ - new TwigTest('foo_test'), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('foo_function'), - ]; - } - - public function getOperators() - { - return [ - ['foo_unary' => []], - ['foo_binary' => []], - ]; - } - - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} -class_alias('Twig_Tests_EnvironmentTest_Extension', 'Twig\Tests\EnvironmentTest\Extension', false); - -class Twig_Tests_EnvironmentTest_TokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - } - - public function getTag() - { - return 'test'; - } -} - -class Twig_Tests_EnvironmentTest_NodeVisitor implements NodeVisitorInterface -{ - public function enterNode(Node $node, Environment $env) - { - return $node; - } - - public function leaveNode(Node $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime extends AbstractExtension -{ - public function initRuntime(Environment $env) - { - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime extends AbstractExtension implements InitRuntimeInterface -{ - public function initRuntime(Environment $env) - { - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtension -{ - public function getFunctions() - { - return [ - new TwigFunction('from_runtime_array', ['Twig_Tests_EnvironmentTest_Runtime', 'fromRuntime']), - new TwigFunction('from_runtime_string', 'Twig_Tests_EnvironmentTest_Runtime::fromRuntime'), - ]; - } -} - -class Twig_Tests_EnvironmentTest_Runtime -{ - public function fromRuntime($name = 'bar') - { - return $name; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/ErrorTest.php deleted file mode 100644 index 361c30029d7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ErrorTest.php +++ /dev/null @@ -1,211 +0,0 @@ -setSourceContext(new Source('', new \SplFileInfo(__FILE__))); - - $this->assertContains('test'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); - } - - public function testTwigExceptionGuessWithMissingVarAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => << true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithExceptionAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => << true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithMissingVarAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - public function testTwigExceptionGuessWithExceptionAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...").', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - /** - * @dataProvider getErroredTemplates - */ - public function testTwigExceptionAddsFileAndLine($templates, $name, $line) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index'); - - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('Variable "foo" does not exist in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('An exception has been thrown during the rendering of a template ("Runtime error...") in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - } - - public function getErroredTemplates() - { - return [ - // error occurs in a template - [ - [ - 'index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}", - ], - 'index', 3, - ], - - // error occurs in an included template - [ - [ - 'index' => "{% include 'partial' %}", - 'partial' => '{{ foo.bar }}', - ], - 'partial', 1, - ], - - // error occurs in a parent block when called via parent() - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ parent() }} - {% endblock %}", - 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', - ], - 'base', 1, - ], - - // error occurs in a block from the child - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ foo.bar }} - {% endblock %} - {% block foo %} - {{ foo.bar }} - {% endblock %}", - 'base' => '{% block content %}{% endblock %}', - ], - 'index', 3, - ], - ]; - } -} - -class Twig_Tests_ErrorTest_Foo -{ - public function bar() - { - throw new \Exception('Runtime error...'); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php deleted file mode 100644 index ccf331ba3b6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +++ /dev/null @@ -1,388 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForAssignment() - { - return [ - ['{% set false = "foo" %}'], - ['{% set FALSE = "foo" %}'], - ['{% set true = "foo" %}'], - ['{% set TRUE = "foo" %}'], - ['{% set none = "foo" %}'], - ['{% set NONE = "foo" %}'], - ['{% set null = "foo" %}'], - ['{% set NULL = "foo" %}'], - ['{% set 3 = "foo" %}'], - ['{% set 1 + 2 = "foo" %}'], - ['{% set "bar" = "foo" %}'], - ['{% set %}{% endset %}'], - ]; - } - - /** - * @dataProvider getTestsForArray - */ - public function testArrayExpression($template, $expected) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @dataProvider getFailingTestsForArray - */ - public function testArraySyntaxError($template) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForArray() - { - return [ - ['{{ [1, "a": "b"] }}'], - ['{{ {"a": "b", 2} }}'], - ]; - } - - public function getTestsForArray() - { - return [ - // simple array - ['{{ [1, 2] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // array with trailing , - ['{{ [1, 2, ] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // simple hash - ['{{ {"a": "b", "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash with trailing , - ['{{ {"a": "b", "b": "c", } }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash in an array - ['{{ [1, {"a": "b", "b": "c"}] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], 1), - ], - - // array in a hash - ['{{ {"a": [1, 2], "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize(new Source('{{ "a" "b" }}', 'index')); - $parser = new Parser($env); - - $parser->parse($stream); - } - - /** - * @dataProvider getTestsForString - */ - public function testStringExpression($template, $expected) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - public function getTestsForString() - { - return [ - [ - '{{ "foo" }}', new ConstantExpression('foo', 1), - ], - [ - '{{ "foo #{bar}" }}', new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - ], - [ - '{{ "foo #{bar} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - - [ - '{{ "foo #{"foo #{bar} baz"} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testAttributeCallDoesNotSupportNamedArguments() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foo.bar(name="Foo") }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testMacroCallDoesNotSupportNamedArguments() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1. - */ - public function testMacroDefinitionDoesNotSupportNonNameVariableName() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% macro foo("a") %}{% endmacro %}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1 - * @dataProvider getMacroDefinitionDoesNotSupportNonConstantDefaultValues - */ - public function testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getMacroDefinitionDoesNotSupportNonConstantDefaultValues() - { - return [ - ['{% macro foo(name = "a #{foo} a") %}{% endmacro %}'], - ['{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'], - ]; - } - - /** - * @dataProvider getMacroDefinitionSupportsConstantDefaultValues - */ - public function testMacroDefinitionSupportsConstantDefaultValues($template) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function getMacroDefinitionSupportsConstantDefaultValues() - { - return [ - ['{% macro foo(name = "aa") %}{% endmacro %}'], - ['{% macro foo(name = 12) %}{% endmacro %}'], - ['{% macro foo(name = true) %}{% endmacro %}'], - ['{% macro foo(name = ["a"]) %}{% endmacro %}'], - ['{% macro foo(name = [["a"]]) %}{% endmacro %}'], - ['{% macro foo(name = {a: "a"}) %}{% endmacro %}'], - ['{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "cycl" function. Did you mean "cycle" in "index" at line 1? - */ - public function testUnknownFunction() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ cycl() }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" function in "index" at line 1. - */ - public function testUnknownFunctionWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foobar() }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "lowe" filter. Did you mean "lower" in "index" at line 1? - */ - public function testUnknownFilter() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|lowe }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" filter in "index" at line 1. - */ - public function testUnknownFilterWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|foobar }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "nul" test. Did you mean "null" in "index" at line 1 - */ - public function testUnknownTest() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - $stream = $env->tokenize(new Source('{{ 1 is nul }}', 'index')); - $parser->parse($stream); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" test in "index" at line 1. - */ - public function testUnknownTestWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1 is foobar }}', 'index'))); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php deleted file mode 100644 index 5dc0685241b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +++ /dev/null @@ -1,332 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock()); - - for ($i = 0; $i < 100; ++$i) { - $this->assertTrue(\in_array(twig_random($env, $value1, $value2), $expectedInArray, true)); // assertContains() would not consider the type - } - } - - public function getRandomFunctionTestData() - { - return [ - 'array' => [ - ['apple', 'orange', 'citrus'], - ['apple', 'orange', 'citrus'], - ], - 'Traversable' => [ - ['apple', 'orange', 'citrus'], - new ArrayObject(['apple', 'orange', 'citrus']), - ], - 'unicode string' => [ - ['Ä', '€', 'é'], - 'Ä€é', - ], - 'numeric but string' => [ - ['1', '2', '3'], - '123', - ], - 'integer' => [ - range(0, 5, 1), - 5, - ], - 'float' => [ - range(0, 5, 1), - 5.9, - ], - 'negative' => [ - [0, -1, -2], - -2, - ], - 'min max int' => [ - range(50, 100), - 50, - 100, - ], - 'min max float' => [ - range(-10, 10), - -9.5, - 9.5, - ], - 'min null' => [ - range(0, 100), - null, - 100, - ], - ]; - } - - public function testRandomFunctionWithoutParameter() - { - $max = mt_getrandmax(); - - for ($i = 0; $i < 100; ++$i) { - $val = twig_random(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $this->assertTrue(\is_int($val) && $val >= 0 && $val <= $max); - } - } - - public function testRandomFunctionReturnsAsIs() - { - $this->assertSame('', twig_random(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()), '')); - $this->assertSame('', twig_random(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['charset' => null]), '')); - - $instance = new \stdClass(); - $this->assertSame($instance, twig_random(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()), $instance)); - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testRandomFunctionOfEmptyArrayThrowsException() - { - twig_random(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()), []); - } - - public function testRandomFunctionOnNonUTF8String() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $twig->setCharset('ISO-8859-1'); - - $text = iconv('UTF-8', 'ISO-8859-1', 'Äé'); - for ($i = 0; $i < 30; ++$i) { - $rand = twig_random($twig, $text); - $this->assertTrue(\in_array(iconv('ISO-8859-1', 'UTF-8', $rand), ['Ä', 'é'], true)); - } - } - - public function testReverseFilterOnNonUTF8String() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $twig->setCharset('ISO-8859-1'); - - $input = iconv('UTF-8', 'ISO-8859-1', 'Äé'); - $output = iconv('ISO-8859-1', 'UTF-8', twig_reverse_filter($twig, $input)); - - $this->assertEquals($output, 'éÄ'); - } - - /** - * @dataProvider provideTwigFirstCases - */ - public function testTwigFirst($expected, $input) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $this->assertSame($expected, twig_first($twig, $input)); - } - - public function provideTwigFirstCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['a', 'abc'], - [1, [1, 2, 3]], - ['', null], - ['', ''], - ['a', new CoreTestIterator($i, array_keys($i), true, 3)], - ]; - } - - /** - * @dataProvider provideTwigLastCases - */ - public function testTwigLast($expected, $input) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $this->assertSame($expected, twig_last($twig, $input)); - } - - public function provideTwigLastCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['c', 'abc'], - [3, [1, 2, 3]], - ['', null], - ['', ''], - ['c', new CoreTestIterator($i, array_keys($i), true)], - ]; - } - - /** - * @dataProvider provideArrayKeyCases - */ - public function testArrayKeysFilter(array $expected, $input) - { - $this->assertSame($expected, twig_get_array_keys_filter($input)); - } - - public function provideArrayKeyCases() - { - $array = ['a' => 'a1', 'b' => 'b1', 'c' => 'c1']; - $keys = array_keys($array); - - return [ - [$keys, $array], - [$keys, new CoreTestIterator($array, $keys)], - [$keys, new CoreTestIteratorAggregate($array, $keys)], - [$keys, new CoreTestIteratorAggregateAggregate($array, $keys)], - [[], null], - [['a'], new \SimpleXMLElement('')], - ]; - } - - /** - * @dataProvider provideInFilterCases - */ - public function testInFilter($expected, $value, $compare) - { - $this->assertSame($expected, twig_in_filter($value, $compare)); - } - - public function provideInFilterCases() - { - $array = [1, 2, 'a' => 3, 5, 6, 7]; - $keys = array_keys($array); - - return [ - [true, 1, $array], - [true, '3', $array], - [true, '3', 'abc3def'], - [true, 1, new CoreTestIterator($array, $keys, true, 1)], - [true, '3', new CoreTestIterator($array, $keys, true, 3)], - [true, '3', new CoreTestIteratorAggregateAggregate($array, $keys, true, 3)], - [false, 4, $array], - [false, 4, new CoreTestIterator($array, $keys, true)], - [false, 4, new CoreTestIteratorAggregateAggregate($array, $keys, true)], - [false, 1, 1], - [true, 'b', new \SimpleXMLElement('b')], - ]; - } - - /** - * @dataProvider provideSliceFilterCases - */ - public function testSliceFilter($expected, $input, $start, $length = null, $preserveKeys = false) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $this->assertSame($expected, twig_slice($twig, $input, $start, $length, $preserveKeys)); - } - - public function provideSliceFilterCases() - { - $i = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4]; - $keys = array_keys($i); - - return [ - [['a' => 1], $i, 0, 1, true], - [['a' => 1], $i, 0, 1, false], - [['b' => 2, 'c' => 3], $i, 1, 2], - [[1], [1, 2, 3, 4], 0, 1], - [[2, 3], [1, 2, 3, 4], 1, 2], - [[2, 3], new CoreTestIterator($i, $keys, true), 1, 2], - [['c' => 3, 'd' => 4], new CoreTestIteratorAggregate($i, $keys, true), 2, null, true], - [$i, new CoreTestIterator($i, $keys, true), 0, \count($keys) + 10, true], - [[], new CoreTestIterator($i, $keys, true), \count($keys) + 10], - ['de', 'abcdef', 3, 2], - [[], new \SimpleXMLElement('12'), 3], - [[], new \ArrayIterator([1, 2]), 3], - ]; - } -} - -final class CoreTestIteratorAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIterator($array, $keys, $allowAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIteratorAggregateAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIteratorAggregate($array, $keys, $allowValueAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIterator implements \Iterator -{ - private $position; - private $array; - private $arrayKeys; - private $allowValueAccess; - private $maxPosition; - - public function __construct(array $values, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->array = $values; - $this->arrayKeys = $keys; - $this->position = 0; - $this->allowValueAccess = $allowValueAccess; - $this->maxPosition = false === $maxPosition ? \count($values) + 1 : $maxPosition; - } - - public function rewind() - { - $this->position = 0; - } - - public function current() - { - if ($this->allowValueAccess) { - return $this->array[$this->key()]; - } - - throw new \LogicException('Code should only use the keys, not the values provided by iterator.'); - } - - public function key() - { - return $this->arrayKeys[$this->position]; - } - - public function next() - { - ++$this->position; - if ($this->position === $this->maxPosition) { - throw new \LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition)); - } - } - - public function valid() - { - return isset($this->arrayKeys[$this->position]); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/EscaperTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/EscaperTest.php deleted file mode 100644 index 98f5a078426..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/EscaperTest.php +++ /dev/null @@ -1,403 +0,0 @@ - ''', - '"' => '"', - '<' => '<', - '>' => '>', - '&' => '&', - ]; - - protected $htmlAttrSpecialChars = [ - '\'' => ''', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => 'Ā', - '😀' => '😀', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '-' => '-', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => ' ', - "\n" => ' ', - "\t" => ' ', - "\0" => '�', // should use Unicode replacement char - /* Encode chars as named entities where possible */ - '<' => '<', - '>' => '>', - '&' => '&', - '"' => '"', - /* Encode spaces for quoteless attribute protection */ - ' ' => ' ', - ]; - - protected $jsSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\u003C', - '>' => '\\u003E', - '\'' => '\\u0027', - '"' => '\\u0022', - '&' => '\\u0026', - '/' => '\\/', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\u0100', - '😀' => '\\uD83D\\uDE00', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\r', - "\n" => '\n', - "\x08" => '\b', - "\t" => '\t', - "\x0C" => '\f', - "\0" => '\\u0000', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\u0020', - ]; - - protected $urlSpecialChars = [ - /* HTML special chars - escape without exception to percent encoding */ - '<' => '%3C', - '>' => '%3E', - '\'' => '%27', - '"' => '%22', - '&' => '%26', - /* Characters beyond ASCII value 255 to hex sequence */ - 'Ā' => '%C4%80', - /* Punctuation and unreserved check */ - ',' => '%2C', - '.' => '.', - '_' => '_', - '-' => '-', - ':' => '%3A', - ';' => '%3B', - '!' => '%21', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '%0D', - "\n" => '%0A', - "\t" => '%09', - "\0" => '%00', - /* PHP quirks from the past */ - ' ' => '%20', - '~' => '~', - '+' => '%2B', - ]; - - protected $cssSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\3C ', - '>' => '\\3E ', - '\'' => '\\27 ', - '"' => '\\22 ', - '&' => '\\26 ', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\100 ', - /* Immune chars excluded */ - ',' => '\\2C ', - '.' => '\\2E ', - '_' => '\\5F ', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\\D ', - "\n" => '\\A ', - "\t" => '\\9 ', - "\0" => '\\0 ', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\20 ', - ]; - - public function testHtmlEscapingConvertsSpecialChars() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - foreach ($this->htmlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($twig, $key, 'html'), 'Failed to escape: '.$key); - } - } - - public function testHtmlAttributeEscapingConvertsSpecialChars() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - foreach ($this->htmlAttrSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($twig, $key, 'html_attr'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingConvertsSpecialChars() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - foreach ($this->jsSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($twig, $key, 'js'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingReturnsStringIfZeroLength() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $this->assertEquals('', twig_escape_filter($twig, '', 'js')); - } - - public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $this->assertEquals('123', twig_escape_filter($twig, '123', 'js')); - } - - public function testCssEscapingConvertsSpecialChars() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - foreach ($this->cssSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($twig, $key, 'css'), 'Failed to escape: '.$key); - } - } - - public function testCssEscapingReturnsStringIfZeroLength() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $this->assertEquals('', twig_escape_filter($twig, '', 'css')); - } - - public function testCssEscapingReturnsStringIfContainsOnlyDigits() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $this->assertEquals('123', twig_escape_filter($twig, '123', 'css')); - } - - public function testUrlEscapingConvertsSpecialChars() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - foreach ($this->urlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($twig, $key, 'url'), 'Failed to escape: '.$key); - } - } - - /** - * Range tests to confirm escaped range of characters is within OWASP recommendation. - */ - - /** - * Only testing the first few 2 ranges on this prot. function as that's all these - * other range tests require. - */ - public function testUnicodeCodepointConversionToUtf8() - { - $expected = ' ~ޙ'; - $codepoints = [0x20, 0x7e, 0x799]; - $result = ''; - foreach ($codepoints as $value) { - $result .= $this->codepointToUtf8($value); - } - $this->assertEquals($expected, $result); - } - - /** - * Convert a Unicode Codepoint to a literal UTF-8 character. - * - * @param int $codepoint Unicode codepoint in hex notation - * - * @return string UTF-8 literal string - */ - protected function codepointToUtf8($codepoint) - { - if ($codepoint < 0x80) { - return \chr($codepoint); - } - if ($codepoint < 0x800) { - return \chr($codepoint >> 6 & 0x3f | 0xc0) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x10000) { - return \chr($codepoint >> 12 & 0x0f | 0xe0) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x110000) { - return \chr($codepoint >> 18 & 0x07 | 0xf0) - .\chr($codepoint >> 12 & 0x3f | 0x80) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - throw new \Exception('Codepoint requested outside of Unicode range.'); - } - - public function testJavascriptEscapingEscapesOwaspRecommendedRanges() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $immune = [',', '.', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($twig, $literal, 'js')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($twig, $literal, 'js')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($twig, $literal, 'js'), - "$literal should be escaped!"); - } - } - } - } - - public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - $immune = [',', '.', '-', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($twig, $literal, 'html_attr')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($twig, $literal, 'html_attr')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($twig, $literal, 'html_attr'), - "$literal should be escaped!"); - } - } - } - } - - public function testCssEscapingEscapesOwaspRecommendedRanges() - { - $twig = new \Twig\Environment($this->getMockBuilder(\Twig\Loader\LoaderInterface::class)->getMock()); - // CSS has no exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($twig, $literal, 'css')); - } else { - $literal = $this->codepointToUtf8($chr); - $this->assertNotEquals( - $literal, - twig_escape_filter($twig, $literal, 'css'), - "$literal should be escaped!"); - } - } - } - - /** - * @dataProvider provideCustomEscaperCases - */ - public function testCustomEscaper($expected, $string, $strategy) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $twig->getExtension(EscaperExtension::class)->setEscaper('foo', 'foo_escaper_for_test'); - - $this->assertSame($expected, twig_escape_filter($twig, $string, $strategy)); - } - - public function provideCustomEscaperCases() - { - return [ - ['fooUTF-8', 'foo', 'foo'], - ['UTF-8', null, 'foo'], - ['42UTF-8', 42, 'foo'], - ]; - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testUnknownCustomEscaper() - { - twig_escape_filter(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()), 'foo', 'bar'); - } - - /** - * @dataProvider provideObjectsForEscaping - */ - public function testObjectEscaping(string $escapedHtml, string $escapedJs, array $safeClasses) - { - $obj = new Twig_Tests_Extension_TestClass(); - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->getExtension('\Twig\Extension\EscaperExtension')->setSafeClasses($safeClasses); - $this->assertSame($escapedHtml, twig_escape_filter($twig, $obj, 'html', null, true)); - $this->assertSame($escapedJs, twig_escape_filter($twig, $obj, 'js', null, true)); - } - - public function provideObjectsForEscaping() - { - return [ - ['<br />', '
    ', ['\Twig_Tests_Extension_TestClass' => ['js']]], - ['
    ', '\u003Cbr\u0020\/\u003E', ['\Twig_Tests_Extension_TestClass' => ['html']]], - ['<br />', '
    ', ['\Twig_Tests_Extension_SafeHtmlInterface' => ['js']]], - ['
    ', '
    ', ['\Twig_Tests_Extension_SafeHtmlInterface' => ['all']]], - ]; - } -} - -function foo_escaper_for_test(Environment $twig, $string, $charset) -{ - return $string.$charset; -} - -interface Twig_Tests_Extension_SafeHtmlInterface -{ -} -class Twig_Tests_Extension_TestClass implements Twig_Tests_Extension_SafeHtmlInterface -{ - public function __toString() - { - return '
    '; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php deleted file mode 100644 index 5596180f7fc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +++ /dev/null @@ -1,368 +0,0 @@ - 'Fabien', - 'obj' => new FooObject(), - 'arr' => ['obj' => new FooObject()], - ]; - - self::$templates = [ - '1_basic1' => '{{ obj.foo }}', - '1_basic2' => '{{ name|upper }}', - '1_basic3' => '{% if name %}foo{% endif %}', - '1_basic4' => '{{ obj.bar }}', - '1_basic5' => '{{ obj }}', - '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', - '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', - '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}', - '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - '1_layout' => '{% block content %}{% endblock %}', - '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}", - '1_include' => '{{ include("1_basic1", sandboxed=true) }}', - '1_range_operator' => '{{ (1..2)[0] }}', - ]; - } - - /** - * @expectedException \Twig\Sandbox\SecurityError - * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child" at line 3. - */ - public function testSandboxWithInheritance() - { - $twig = $this->getEnvironment(true, [], self::$templates, ['block']); - $twig->load('1_child')->render([]); - } - - public function testSandboxGloballySet() - { - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('FOO', $twig->load('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); - } - - public function testSandboxUnallowedMethodAccessor() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic1')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedMethodError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('foo', $e->getMethodName(), 'Exception should be raised on the "foo" method'); - } - } - - public function testSandboxUnallowedFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic2')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedFilterError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFilterError'); - $this->assertEquals('upper', $e->getFilterName(), 'Exception should be raised on the "upper" filter'); - } - } - - public function testSandboxUnallowedTag() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic3')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedTagError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('if', $e->getTagName(), 'Exception should be raised on the "if" tag'); - } - } - - public function testSandboxUnallowedProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic4')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedPropertyError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedPropertyError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('bar', $e->getPropertyName(), 'Exception should be raised on the "bar" property'); - } - } - - /** - * @dataProvider getSandboxUnallowedToStringTests - */ - public function testSandboxUnallowedToString($template) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], [], ['upper'], ['FooObject' => 'getAnotherFooObject'], [], ['random']); - try { - $twig->load('index')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedMethodError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('__tostring', $e->getMethodName(), 'Exception should be raised on the "__toString" method'); - } - } - - public function getSandboxUnallowedToStringTests() - { - return [ - 'simple' => ['{{ obj }}'], - 'object_from_array' => ['{{ arr.obj }}'], - 'object_chain' => ['{{ obj.anotherFooObject }}'], - 'filter' => ['{{ obj|upper }}'], - 'filter_from_array' => ['{{ arr.obj|upper }}'], - 'function' => ['{{ random(obj) }}'], - 'function_from_array' => ['{{ random(arr.obj) }}'], - 'function_and_filter' => ['{{ random(obj|upper) }}'], - 'function_and_filter_from_array' => ['{{ random(arr.obj|upper) }}'], - 'object_chain_and_filter' => ['{{ obj.anotherFooObject|upper }}'], - 'object_chain_and_function' => ['{{ random(obj.anotherFooObject) }}'], - 'concat' => ['{{ obj ~ "" }}'], - 'concat_again' => ['{{ "" ~ obj }}'], - ]; - } - - /** - * @dataProvider getSandboxAllowedToStringTests - */ - public function testSandboxAllowedToString($template, $output) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], ['set'], [], ['FooObject' => ['foo', 'getAnotherFooObject']]); - $this->assertEquals($output, $twig->load('index')->render(self::$params)); - } - - public function getSandboxAllowedToStringTests() - { - return [ - 'constant_test' => ['{{ obj is constant("PHP_INT_MAX") }}', ''], - 'set_object' => ['{% set a = obj.anotherFooObject %}{{ a.foo }}', 'foo'], - 'is_defined' => ['{{ obj.anotherFooObject is defined }}', '1'], - 'is_null' => ['{{ obj is null }}', ''], - 'is_sameas' => ['{{ obj is same as(obj) }}', '1'], - 'is_sameas_from_array' => ['{{ arr.obj is same as(arr.obj) }}', '1'], - 'is_sameas_from_another_method' => ['{{ obj.anotherFooObject is same as(obj.anotherFooObject) }}', ''], - ]; - } - - public function testSandboxAllowMethodToString() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => '__toString']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowMethodToStringDisabled() - { - $twig = $this->getEnvironment(false, [], self::$templates); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allows __toString when sandbox disabled'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxUnallowedFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic7')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedFunctionError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('cycle', $e->getFunctionName(), 'Exception should be raised on the "cycle" function'); - } - } - - public function testSandboxUnallowedRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_range_operator')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if the unallowed range operator is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedFunctionError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('range', $e->getFunctionName(), 'Exception should be raised on the "range" function'); - } - } - - public function testSandboxAllowMethodFoo() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => 'foo']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic1')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], ['upper']); - $this->assertEquals('FABIEN', $twig->load('1_basic2')->render(self::$params), 'Sandbox allow some filters'); - } - - public function testSandboxAllowTag() - { - $twig = $this->getEnvironment(true, [], self::$templates, ['if']); - $this->assertEquals('foo', $twig->load('1_basic3')->render(self::$params), 'Sandbox allow some tags'); - } - - public function testSandboxAllowProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], ['FooObject' => 'bar']); - $this->assertEquals('bar', $twig->load('1_basic4')->render(self::$params), 'Sandbox allow some properties'); - } - - public function testSandboxAllowFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['cycle']); - $this->assertEquals('bar', $twig->load('1_basic7')->render(self::$params), 'Sandbox allow some functions'); - } - - public function testSandboxAllowRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['range']); - $this->assertEquals('1', $twig->load('1_range_operator')->render(self::$params), 'Sandbox allow the range operator'); - } - - public function testSandboxAllowFunctionsCaseInsensitive() - { - foreach (['getfoobar', 'getFoobar', 'getFooBar'] as $name) { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => $name]); - FooObject::reset(); - $this->assertEquals('foobarfoobar', $twig->load('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); - $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); - - $this->assertEquals('foobarfoobar', $twig->load('1_basic9')->render(self::$params), 'Sandbox allow methods via shortcut names (ie. without get/set)'); - } - } - - public function testSandboxLocallySetForAnInclude() - { - self::$templates = [ - '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', - '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('fooFOOfoo', $twig->load('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); - - self::$templates = [ - '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', - '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('3_basic')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); - } catch (SecurityError $e) { - $this->assertInstanceOf(SecurityNotAllowedTagError::class, $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('sandbox', $e->getTagName()); - } - } - - public function testMacrosInASandbox() - { - $twig = $this->getEnvironment(true, ['autoescape' => 'html'], ['index' => <<{{ text }}

    {% endmacro %} - -{{- macros.test('username') }} -EOF - ], ['macro', 'import'], ['escape']); - - $this->assertEquals('

    username

    ', $twig->load('index')->render([])); - } - - public function testSandboxDisabledAfterIncludeFunctionError() - { - $twig = $this->getEnvironment(false, [], self::$templates); - - $e = null; - try { - $twig->load('1_include')->render(self::$params); - } catch (\Throwable $e) { - } - if (null === $e) { - $this->fail('An exception should be thrown for this test to be valid.'); - } - - $this->assertFalse($twig->getExtension(SandboxExtension::class)->isSandboxed(), 'Sandboxed include() function call should not leave Sandbox enabled when an error occurs.'); - } - - protected function getEnvironment($sandboxed, $options, $templates, $tags = [], $filters = [], $methods = [], $properties = [], $functions = []) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, array_merge(['debug' => true, 'cache' => false, 'autoescape' => false], $options)); - $policy = new SecurityPolicy($tags, $filters, $methods, $properties, $functions); - $twig->addExtension(new SandboxExtension($policy, $sandboxed)); - - return $twig; - } -} - -class FooObject -{ - public static $called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - - public $bar = 'bar'; - - public static function reset() - { - self::$called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - } - - public function __toString() - { - ++self::$called['__toString']; - - return 'foo'; - } - - public function foo() - { - ++self::$called['foo']; - - return 'foo'; - } - - public function getFooBar() - { - ++self::$called['getFooBar']; - - return 'foobar'; - } - - public function getAnotherFooObject() - { - return new self(); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php deleted file mode 100644 index 47d62afc884..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php +++ /dev/null @@ -1,34 +0,0 @@ - 'getRuntime']); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - public function testLoadReturnsNullForUnmappedRuntime() - { - $loader = new FactoryRuntimeLoader(); - - $this->assertNull($loader->load('stdClass')); - } -} - -function getRuntime() -{ - return new \stdClass(); -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php deleted file mode 100644 index 120d9ce7c44..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -assertSame($strategy, FileExtensionEscapingStrategy::guess($filename)); - } - - public function getGuessData() - { - return [ - // default - ['html', 'foo.html'], - ['html', 'foo.html.twig'], - ['html', 'foo'], - ['html', 'foo.bar.twig'], - ['html', 'foo.txt/foo'], - ['html', 'foo.txt/foo.js/'], - - // css - ['css', 'foo.css'], - ['css', 'foo.css.twig'], - ['css', 'foo.twig.css'], - ['css', 'foo.js.css'], - ['css', 'foo.js.css.twig'], - - // js - ['js', 'foo.js'], - ['js', 'foo.js.twig'], - ['js', 'foo.txt/foo.js'], - ['js', 'foo.txt.twig/foo.js'], - - // txt - [false, 'foo.txt'], - [false, 'foo.txt.twig'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php deleted file mode 100644 index b3ea3a8a1c3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php +++ /dev/null @@ -1,26 +0,0 @@ - $fileInfo) { - if ($fileInfo->isDir()) { - rmdir($filename); - } else { - unlink($filename); - } - } - rmdir($dir); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test deleted file mode 100644 index a80b80c376e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -blocks and autoescape ---TEMPLATE-- -{{ include('unrelated.txt.twig') -}} -{{ include('template.html.twig') -}} ---TEMPLATE(unrelated.txt.twig)-- -{% block content %}{% endblock %} ---TEMPLATE(template.html.twig)-- -{% extends 'parent.html.twig' %} -{% block content %} -{{ br -}} -{% endblock %} ---TEMPLATE(parent.html.twig)-- -{% set _content = block('content')|raw %} -{{ _content|raw }} ---DATA-- -return ['br' => '
    '] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test deleted file mode 100644 index 5ad573cf0aa..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"name" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.js.twig') -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.js.twig)-- -{{ br -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return ['br' => '
    '] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> -\u003Cbr\u0020\/\u003E -<br /> -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html deleted file mode 100644 index cb0dbe444bb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html +++ /dev/null @@ -1 +0,0 @@ -{% block content %}{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html deleted file mode 100644 index df57c822f92..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test deleted file mode 100644 index 74a1cc2833c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for child templates defining content outside blocks defined by parent ---TEMPLATE-- -{% extends 'base.twig' %} - -Content outside a block. - -{% block sidebar %} - Content inside a block. -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3? diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test deleted file mode 100644 index 2ab298059d3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from a child for an extension error ---TEMPLATE-- -{% extends 'base.twig' %} ---TEMPLATE(base.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "base.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test deleted file mode 100644 index e2281b2903b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from an include for an extension error ---TEMPLATE-- -{% include 'content.twig' %} ---TEMPLATE(content.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "content.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test deleted file mode 100644 index 66784292c91..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return ['foobar' => 'foobar'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foo2" does not exist in "index.twig" at line 11. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test deleted file mode 100644 index 7f5e96b0491..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foobar" does not exist in "index.twig" at line 7. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test deleted file mode 100644 index 8bc524ef181..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multile function with undefined variable ---TEMPLATE-- -{{ include('foo', - with_context=with_context -) }} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "with_context" does not exist in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test deleted file mode 100644 index 5f413d406af..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for multiline function with unknown argument ---TEMPLATE-- -{{ include('foo', - with_context=True, - invalid=False -) }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test deleted file mode 100644 index 032ad831ec5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multiline tag with undefined variable ---TEMPLATE-- -{% include 'foo' - with vars -%} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "vars" does not exist in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test deleted file mode 100644 index e14beb672dd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -The PHP === strict comparison operator is not supported ---TEMPLATE-- -{{ 1 === 2 }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test deleted file mode 100644 index 4ce06854fb7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for syntax error in reused template ---TEMPLATE-- -{% use 'foo.twig' %} ---TEMPLATE(foo.twig)-- -{% block bar %} - {% do node.data = 5 %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test deleted file mode 100644 index b4fc1691676..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Exception for an unclosed tag ---TEMPLATE-- -{% block foo %} - {% if foo %} - - - - - {% for i in fo %} - - - - {% endfor %} - - - -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected "endblock" tag (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test deleted file mode 100644 index 07f855a3feb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for an undefined parent ---TEMPLATE-- -{% extends 'foo.html' %} - -{% set foo = "foo" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.html" is not defined in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test deleted file mode 100644 index 904faa50ad4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for an undefined template in a child template ---TEMPLATE-- -{% extends 'base.twig' %} - -{% block sidebar %} - {{ include('include.twig') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "include.twig" is not defined in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test deleted file mode 100644 index 5bfdd07e612..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for an undefined trait ---TEMPLATE-- -{% use 'foo' with foobar as bar %} ---TEMPLATE(foo)-- -{% block bar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\RuntimeError: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test deleted file mode 100644 index fb88f4c859d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -_self returns the template name ---TEMPLATE-- -{{ _self }} ---DATA-- -return [] ---EXPECT-- -index.twig diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test deleted file mode 100644 index 35579dc13d2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -Twig supports array notation ---TEMPLATE-- -{# empty array #} -{{ []|join(',') }} - -{{ [1, 2]|join(',') }} -{{ ['foo', "bar"]|join(',') }} -{{ {0: 1, 'foo': 'bar'}|join(',') }} -{{ {0: 1, 'foo': 'bar'}|keys|join(',') }} - -{{ {0: 1, foo: 'bar'}|join(',') }} -{{ {0: 1, foo: 'bar'}|keys|join(',') }} - -{# nested arrays #} -{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} -{{ a[2]|join(',') }} -{{ a[3]["foo"]|join(',') }} - -{# works even if [] is used inside the array #} -{{ [foo[bar]]|join(',') }} - -{# elements can be any expression #} -{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} - -{# arrays can have a trailing , like in PHP #} -{{ - [ - 1, - 2, - ]|join(',') -}} - -{# keys can be any expression #} -{% set a = 1 %} -{% set b = "foo" %} -{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} -{{ ary|keys|join(',') }} -{{ ary|join(',') }} - -{# ArrayAccess #} -{{ array_access['a'] }} - -{# array that does not exist #} -{{ does_not_exist[0]|default('ok') }} -{{ does_not_exist[0].does_not_exist_either|default('ok') }} -{{ does_not_exist[0]['does_not_exist_either']|default('ok') }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'array_access' => new \ArrayObject(['a' => 'b'])] ---EXPECT-- -1,2 -foo,bar -1,bar -0,foo - -1,bar -0,foo - -1,2 -bar - -bar - -FOO,BAR, - -1,2 - -1,foo,c,1foo -a,b,c,d - -b - -ok -ok -ok ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'array_access' => new \ArrayObject(['a' => 'b'])] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -1,2 -foo,bar -1,bar -0,foo - -1,bar -0,foo - -1,2 -bar - -bar - -FOO,BAR, - -1,2 - -1,foo,c,1foo -a,b,c,d - -b - -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test deleted file mode 100644 index 8c7a2ee7cb8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo }} -{{ items['foo'] }} -{{ items[foo] }} -{{ items[items[foo]] }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => 'bar', 'bar' => 'foo']] ---EXPECT-- -bar -bar -foo -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test deleted file mode 100644 index b4e8be58d3c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Twig supports binary operations (+, -, *, /, ~, %, and, or) ---TEMPLATE-- -{{ 1 + 1 }} -{{ 2 - 1 }} -{{ 2 * 2 }} -{{ 2 / 2 }} -{{ 3 % 2 }} -{{ 1 and 1 }} -{{ 1 and 0 }} -{{ 0 and 1 }} -{{ 0 and 0 }} -{{ 1 or 1 }} -{{ 1 or 0 }} -{{ 0 or 1 }} -{{ 0 or 0 }} -{{ 0 or 1 and 0 }} -{{ 1 or 0 and 1 }} -{{ "foo" ~ "bar" }} -{{ foo ~ "bar" }} -{{ "foo" ~ bar }} -{{ foo ~ bar }} -{{ 20 // 7 }} ---DATA-- -return ['foo' => 'bar', 'bar' => 'foo'] ---EXPECT-- -2 -1 -4 -1 -1 -1 - - - -1 -1 -1 - - -1 -foobar -barbar -foofoo -barfoo -2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test deleted file mode 100644 index c2bda1cc6b6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports bitwise operations ---TEMPLATE-- -{{ 1 b-and 5 }} -{{ 1 b-or 5 }} -{{ 1 b-xor 5 }} -{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXPECT-- -1 -5 -4 -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test deleted file mode 100644 index 36539a6d132..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Argument is defined twice in a call ---TEMPLATE-- -{{ date(987654, date = 123456) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Argument "date" is defined twice for function "date" in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test deleted file mode 100644 index 729c6748597..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Positional arguments after named arguments in a call ---TEMPLATE-- -{{ date(date = 123456, 'Y-m-d') }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Positional arguments cannot be used after named arguments for function "date" in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test deleted file mode 100644 index 2811634f76a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports comparison operators (==, !=, <, >, >=, <=) ---TEMPLATE-- -{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} -{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} -{{ 1 == 1 }}/{{ 1 == 2 }} -{{ 1 != 1 }}/{{ 1 != 2 }} ---DATA-- -return [] ---EXPECT-- -///1 -1//1/1 -1/ -/1 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test deleted file mode 100644 index f1bf5681e59..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Twig supports the "divisible by" operator ---TEMPLATE-- -{{ 8 is divisible by(2) ? 'OK' }} -{{ 8 is not divisible by(3) ? 'OK' }} -{{ 8 is divisible by (2) ? 'OK' }} -{{ 8 is not - divisible - by - (3) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test deleted file mode 100644 index 0efa9305694..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig supports the .. operator ---TEMPLATE-- -{% for i in 0..10 %}{{ i }} {% endfor %} - -{% for letter in 'a'..'z' %}{{ letter }} {% endfor %} - -{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} - -{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} - -{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} ---DATA-- -return ['foo' => [1, 10]] ---EXPECT-- -0 1 2 3 4 5 6 7 8 9 10 -a b c d e f g h i j k l m n o p q r s t u v w x y z -A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -1 2 3 4 5 6 7 8 9 10 -1 2 3 4 5 6 7 8 9 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test deleted file mode 100644 index c8086d6d4c2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Twig supports the "ends with" operator ---TEMPLATE-- -{{ 'foo' ends with 'o' ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' ends with '' ? 'OK' : 'KO' }} -{{ '1' ends with true ? 'OK' : 'KO' }} -{{ 1 ends with true ? 'OK' : 'KO' }} -{{ 0 ends with false ? 'OK' : 'KO' }} -{{ '' ends with false ? 'OK' : 'KO' }} -{{ false ends with false ? 'OK' : 'KO' }} -{{ false ends with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -KO -KO -KO -KO -KO -KO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test deleted file mode 100644 index be5bfafa75a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig compiles floats properly ---TEMPLATE-- -{% set val2 = 0.0 %} - -{{ val is same as (0.0) ? 'Yes' : 'No' }} -{{ val2 is same as (0.0) ? 'Yes' : 'No' }} -{{ val is same as (val2) ? 'Yes' : 'No' }} ---DATA-- -return ['val' => 0.0] ---EXPECT-- -Yes -Yes -Yes diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test deleted file mode 100644 index 069ebf793d1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig supports grouping of expressions ---TEMPLATE-- -{{ (2 + 2) / 2 }} ---DATA-- -return [] ---EXPECT-- -2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test deleted file mode 100644 index 308e8df2ac6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig supports literals ---TEMPLATE-- -1 {{ true }} -2 {{ TRUE }} -3 {{ false }} -4 {{ FALSE }} -5 {{ none }} -6 {{ NONE }} -7 {{ null }} -8 {{ NULL }} ---DATA-- -return [] ---EXPECT-- -1 1 -2 1 -3 -4 -5 -6 -7 -8 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test deleted file mode 100644 index 60417e04ffd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports __call() for attributes ---TEMPLATE-- -{{ foo.foo }} -{{ foo.bar }} ---DATA-- -class TestClassForMagicCallAttributes -{ - public function getBar() - { - return 'bar_from_getbar'; - } - - public function __call($method, $arguments) - { - if ('foo' === $method) { - return 'foo_from_call'; - } - - return false; - } -} - -return ['foo' => new TestClassForMagicCallAttributes()] ---EXPECT-- -foo_from_call -bar_from_getbar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test deleted file mode 100644 index 95459c3b0f2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports the "matches" operator ---TEMPLATE-- -{{ 'foo' matches '/o/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test deleted file mode 100644 index 1826842b6fb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo.foo }} -{{ items.foo.getFoo() }} -{{ items.foo.bar }} -{{ items.foo['bar'] }} -{{ items.foo.bar('a', 43) }} -{{ items.foo.bar(foo) }} -{{ items.foo.self.foo() }} -{{ items.foo.is }} -{{ items.foo.in }} -{{ items.foo.not }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => new TwigTestFoo(), 'bar' => 'foo']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -foo -foo -bar - -bar_a-43 -bar_bar -foo -is -in -not diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test deleted file mode 100644 index c2a6e340245..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig manages negative numbers correctly ---TEMPLATE-- -{{ -1 }} -{{ - 1 }} -{{ 5 - 1 }} -{{ 5-1 }} -{{ 5 + -1 }} -{{ 5 + - 1 }} ---DATA-- -return [] ---EXPECT-- --1 --1 -4 -4 -4 -4 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test deleted file mode 100644 index af82c47cf5c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -A string in parentheses cannot be confused with an arrow function ---TEMPLATE-- -{{ ["foo", "bar"]|join(("f")) }} ---DATA-- -return [] ---EXPECT-- -foofbar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test deleted file mode 100644 index fa9a843c0fa..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig allows to use named operators as variable names ---TEMPLATE-- -{% for match in matches %} - {{- match }} -{% endfor %} -{{ in }} -{{ is }} ---DATA-- -return ['matches' => [1, 2, 3], 'in' => 'in', 'is' => 'is'] ---EXPECT-- -1 -2 -3 -in -is diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test deleted file mode 100644 index 276cbf197d1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig parses postfix expressions ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo() %}foo{% endmacro %} - -{{ 'a' }} -{{ 'a'|upper }} -{{ ('a')|upper }} -{{ -1|upper }} -{{ macros.foo() }} -{{ (macros).foo() }} ---DATA-- -return [] ---EXPECT-- -a -A -A --1 -foo -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test deleted file mode 100644 index 84fd23692ce..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig parses power expressions ---TEMPLATE-- -{{ 2**3 }} -{{ (-2)**3 }} -{{ (-2)**(-3) }} -{{ a ** a }} -{{ a ** b }} -{{ b ** a }} -{{ b ** b }} ---DATA-- -return ['a' => 4, 'b' => -2] ---EXPECT-- -8 --8 --0.125 -256 -0.0625 -16 -0.25 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test deleted file mode 100644 index 83f3691f972..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Twig supports the "same as" operator ---TEMPLATE-- -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as (1) ? 'OK' }} -{{ 1 is not - same - as - (true) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test deleted file mode 100644 index a78ff1eac71..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports the "starts with" operator ---TEMPLATE-- -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts -with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts with '' ? 'OK' : 'KO' }} -{{ '1' starts with true ? 'OK' : 'KO' }} -{{ '' starts with false ? 'OK' : 'KO' }} -{{ 'a' starts with false ? 'OK' : 'KO' }} -{{ false starts with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK -KO -KO -KO -KO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test deleted file mode 100644 index 478d4eb5e54..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the string operators as variable names in assignments ---TEMPLATE-- -{% for matches in [1, 2] %} - {{- matches }} -{% endfor %} - -{% set matches = [1, 2] %} - -OK ---DATA-- -return [] ---EXPECT-- -1 -2 - - -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test deleted file mode 100644 index f402c893991..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports string interpolation ---TEMPLATE-- -{{ "foo #{"foo #{bar} baz"} baz" }} -{{ "foo #{bar}#{bar} baz" }} ---DATA-- -return ['bar' => 'BAR'] ---EXPECT-- -foo foo BAR baz baz -foo BARBAR baz diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test deleted file mode 100644 index 37eccc0f545..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} -{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} -{{ 1 == 1 ? 'foo
    ':'' }} -{{ foo ~ (bar ? ('-' ~ bar) : '') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -YES -NO -YES1 -NO1 -foo
    -foo-bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test deleted file mode 100644 index 8b0f7284b9b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' }} -{{ 0 ? 'YES' }} ---DATA-- -return [] ---EXPECT-- -YES - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test deleted file mode 100644 index ecd6b754656..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 'YES' ?: 'NO' }} -{{ 0 ?: 'NO' }} ---DATA-- -return [] ---EXPECT-- -YES -NO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test deleted file mode 100644 index eca3b285bbe..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not allow to use two-word named operators as variable names ---TEMPLATE-- -{{ starts with }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "starts with" in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test deleted file mode 100644 index 54225311903..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports unary operators (not, -, +) ---TEMPLATE-- -{{ not 1 }}/{{ not 0 }} -{{ +1 + 1 }}/{{ -1 - 1 }} -{{ not (false or true) }} ---DATA-- -return [] ---EXPECT-- -/1 -2/-2 - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test deleted file mode 100644 index 27deba3ef51..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig manages negative numbers as default parameters ---TEMPLATE-- -{% import _self as macros %} -{{ macros.negative_number1() }} -{{ macros.negative_number2() }} -{{ macros.negative_number3() }} -{{ macros.positive_number1() }} -{{ macros.positive_number2() }} -{% macro negative_number1(nb=-1) %}{{ nb }}{% endmacro %} -{% macro negative_number2(nb = --1) %}{{ nb }}{% endmacro %} -{% macro negative_number3(nb = - 1) %}{{ nb }}{% endmacro %} -{% macro positive_number1(nb = +1) %}{{ nb }}{% endmacro %} -{% macro positive_number2(nb = ++1) %}{{ nb }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- --1 -1 --1 -1 -1 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test deleted file mode 100644 index 9c56ab12c0f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig unary operators precedence ---TEMPLATE-- -{{ -1 - 1 }} -{{ -1 - -1 }} -{{ -1 * -1 }} -{{ 4 / -1 * 5 }} ---DATA-- -return [] ---EXPECT-- --2 -0 -1 --20 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/extensions/anonymous_functions.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/extensions/anonymous_functions.test deleted file mode 100644 index 842ecf7a180..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/extensions/anonymous_functions.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -use an anonymous function as a function ---TEMPLATE-- -{{ anon_foo('bar') }} -{{ 'bar'|anon_foo }} ---DATA-- -return array() ---EXPECT-- -*bar* -*bar* diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test deleted file mode 100644 index 7518769d4a0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -"abs" filter ---TEMPLATE-- -{{ (-5.5)|abs }} -{{ (-5)|abs }} -{{ (-0)|abs }} -{{ 0|abs }} -{{ 5|abs }} -{{ 5.5|abs }} -{{ number1|abs }} -{{ number2|abs }} -{{ number3|abs }} -{{ number4|abs }} -{{ number5|abs }} -{{ number6|abs }} ---DATA-- -return ['number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5] ---EXPECT-- -5.5 -5 -0 -0 -5 -5.5 -5.5 -5 -0 -0 -5 -5.5 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test deleted file mode 100644 index 0acf25bd614..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3) %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    -
    -
    d
    -
    e
    -
    f
    -
    -
    -
    g
    -
    h
    -
    i
    -
    -
    -
    j
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test deleted file mode 100644 index dad004ec2c5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3.1) %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    d
    -
    -
    -
    e
    -
    f
    -
    g
    -
    h
    -
    -
    -
    i
    -
    j
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test deleted file mode 100644 index 411b4fc7499..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, '') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
    {{ column }}
    ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
    abc
    def
    ghi
    j
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test deleted file mode 100644 index 750d1557aab..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']] ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    -
    -
    d
    -
    e
    -
    f
    -
    -
    -
    g
    -
    h
    -
    i
    -
    -
    -
    j
    -
    k
    -
    l
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test deleted file mode 100644 index 5d470d005b1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, 'fill') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
    {{ column }}
    ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
    abc
    def
    ghi
    jfillfill
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test deleted file mode 100644 index e56cd79bbc9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter preserves array keys ---TEMPLATE-- -{{ {'foo': 'bar', 'key': 'value'}|batch(4)|first|keys|join(',') }} -{{ {'foo': 'bar', 'key': 'value'}|batch(4, 'fill')|first|keys|join(',') }} ---DATA-- -return [] ---EXPECT-- -foo,key -foo,key,0,1 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test deleted file mode 100644 index 90f4de6859d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} -
    - {% for key, column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return ['items' => ['a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd', '123' => 'e']] ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    -
    -
    d
    -
    e
    -
    fill
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test deleted file mode 100644 index bc303da8ab6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter with zero elements ---TEMPLATE-- -{{ []|batch(3)|length }} -{{ []|batch(3, 'fill')|length }} ---DATA-- -return [] ---EXPECT-- -0 -0 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/column.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/column.test deleted file mode 100644 index a2a7f2eb30d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/column.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"column" filter ---TEMPLATE-- -{{ array|column('foo')|join }} -{{ traversable|column('foo')|join }} ---DATA-- -$items = array(array('bar' => 'foo', 'foo' => 'bar'), array('foo' => 'foo', 'bar' => 'bar')); -return array('array' => $items, 'traversable' => new ArrayIterator($items)); ---EXPECT-- -barfoo -barfoo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test deleted file mode 100644 index 6f0091f3019..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"convert_encoding" filter ---TEMPLATE-- -{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} ---DATA-- -return [] ---EXPECT-- -愛していますか? diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test deleted file mode 100644 index 16816aa9948..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} -{{ date1|date('e') }} -{{ date1|date('d/m/Y H:i:s') }} - -{{ date2|date }} -{{ date2|date('d/m/Y') }} -{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s', timezone1) }} -{{ date2|date('d/m/Y H:i:s') }} - -{{ date3|date }} -{{ date3|date('d/m/Y') }} - -{{ date4|date }} -{{ date4|date('d/m/Y') }} - -{{ date5|date }} -{{ date5|date('d/m/Y') }} - -{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date6|date('d/m/Y H:i:s P', false) }} -{{ date6|date('e', 'Europe/Paris') }} -{{ date6|date('e', false) }} - -{{ date7|date }} -{{ date7|date(timezone='Europe/Paris') }} -{{ date7|date(timezone='Asia/Hong_Kong') }} -{{ date7|date(timezone=false) }} -{{ date7|date(timezone='Indian/Mauritius') }} - -{{ '2010-01-28 15:00:00'|date(timezone="Europe/Paris") }} -{{ '2010-01-28 15:00:00'|date(timezone="Asia/Hong_Kong") }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), - 'date6' => new \DateTime('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'date7' => '2010-01-28T15:00:00+04:00', - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 19:45:00 +08:00 -04/10/2010 06:45:00 -05:00 -Europe/Paris -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 - -October 4, 2010 15:45 -04/10/2010 - -January 2, 1964 04:04 -02/01/1964 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York - -January 28, 2010 12:00 -January 28, 2010 12:00 -January 28, 2010 19:00 -January 28, 2010 15:00 -January 28, 2010 15:00 - -January 28, 2010 15:00 -January 28, 2010 22:00 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test deleted file mode 100644 index 3f56d4e6dc1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension(\Twig\Extension\CoreExtension::class)->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), -] ---EXPECT-- -2010-10-04 -04/10/2010 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test deleted file mode 100644 index 6b7879f7c64..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date" filter (interval support) ---TEMPLATE-- -{{ date2|date }} -{{ date2|date('%d days') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension(\Twig\Extension\CoreExtension::class)->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date2' => new \DateInterval('P2D'), -] ---EXPECT-- -2 days 0 hours -2 days diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test deleted file mode 100644 index b87a97391ed..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s', timezone1) }} -{{ date1|date('d/m/Y H:i:s') }} -{{ date1|date_modify('+1 hour')|date('d/m/Y H:i:s') }} - -{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s P', false) }} -{{ date2|date('e', 'Europe/Paris') }} -{{ date2|date('e', false) }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => new \DateTimeImmutable('2010-10-04 13:45'), - 'date2' => new \DateTimeImmutable('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 -04/10/2010 14:45:00 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test deleted file mode 100644 index 89f0c0c594f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"date" filter (interval support) ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('%d days %h hours') }} -{{ date1|date('%d days %h hours', timezone1) }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => new \DateInterval('P2D'), - // This should have no effect on \DateInterval formatting - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -2 days -2 days 0 hours -2 days 0 hours diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test deleted file mode 100644 index d7f8fdf42a1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date_modify" filter ---TEMPLATE-- -{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }} -{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => '2010-10-04 13:45', - 'date2' => new \DateTime('2010-10-04 13:45'), -] ---EXPECT-- -2010-10-03 13:45:00 -2010-10-03 13:45:00 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test deleted file mode 100644 index 2d1aa134496..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }} -{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }} -{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test deleted file mode 100644 index bcbb34edd06..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test +++ /dev/null @@ -1,159 +0,0 @@ ---TEST-- -"default" filter ---TEMPLATE-- -Variable: -{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -Array access: -{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefined['undefined'] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }} -Plain values: -{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ null |default('default') is same as('default') ? 'ok' : 'ko' }} -Precedence: -{{ 'o' ~ nullVar |default('k') }} -{{ 'o' ~ nested.nullVar |default('k') }} -Object methods: -{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }} -Deep nested: -{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['undefinedVar'][0] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefined['undefined'][0] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => true] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test deleted file mode 100644 index 27dc8784c6b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic filter ---TEMPLATE-- -{{ 'bar'|foo_path }} -{{ 'bar'|a_foo_b_bar }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test deleted file mode 100644 index 131f5b4e72b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "foo
    "|e }} ---DATA-- -return [] ---EXPECT-- -foo <br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test deleted file mode 100644 index 10e32755421..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter does not escape with the html strategy when using the html_attr strategy ---TEMPLATE-- -{{ '
    '|escape('html_attr') }} ---DATA-- -return [] ---EXPECT-- -<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test deleted file mode 100644 index 4c2fb7a3668..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "é ♜ 𝌆"|e('js') }} ---DATA-- -return [] ---EXPECT-- -\u00E9\u0020\u265C\u0020\uD834\uDF06 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test deleted file mode 100644 index 93f34297b09..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "愛していますか?
    "|e }} ---DATA-- -return [] ---EXPECT-- -愛していますか? <br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test deleted file mode 100644 index 3d3fdcc68b0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -"filter" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 5, 3, 4, 5]|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 5, 3, 4, 5]|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in ita|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} - -{# we can iterate more than once #} -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} ---DATA-- -return [ - 'it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), - 'ita' => new IteratorAggregateStub(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), - 'xml' => new \SimpleXMLElement('foobarbaz'), -] ---EXPECT-- -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -c = 5 - -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -c = 5 -d = 8 - -elem/foo -elem/bar -elem/baz - -elem/foo -elem/bar -elem/baz diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test deleted file mode 100644 index b19f2eed7bd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"first" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|first }} -{{ {a: 1, b: 2, c: 3, d: 4}|first }} -{{ '1234'|first }} -{{ arr|first }} -{{ 'Ä€é'|first }} -{{ ''|first }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -1 -1 -1 -1 -Ä diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test deleted file mode 100644 index 7efbe3200a6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{% set foo %} - foo
    -{% endset %} - -{{ foo|e('html') -}} -{{ foo|e('js') }} -{% autoescape true %} - {{ foo }} -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - foo<br /> -\u0020\u0020\u0020\u0020foo\u003Cbr\u0020\/\u003E\n - foo
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test deleted file mode 100644 index efaf8317a3c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"format" filter ---TEMPLATE-- -{{ string|format(foo, 3) }} ---DATA-- -return ['string' => '%s/%d', 'foo' => 'bar'] ---EXPECT-- -bar/3 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test deleted file mode 100644 index 5792586304c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"join" filter ---TEMPLATE-- -{{ ["foo", "bar"]|join(', ') }} -{{ foo|join(', ') }} -{{ bar|join(', ') }} - -{{ ["foo", "bar"]|join(', ', ' and ') }} -{{ foo|join(', ', ' and ') }} -{{ bar|join(', ', ' and ') }} -{{ ["one", "two", "three"]|join(', ', ' and ') }} -{{ ["a", "b", "c"]|join('','-') }} -{{ ["a", "b", "c"]|join('-','-') }} -{{ ["a", "b", "c"]|join('-','') }} -{{ ["hello"]|join('|','-') }} - -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',') }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',','-') }} ---DATA-- -return ['foo' => new TwigTestFoo(), 'bar' => new \ArrayObject([3, 4])] ---EXPECT-- -foo, bar -1, 2 -3, 4 - -foo and bar -1 and 2 -3 and 4 -one, two and three -ab-c -a-b-c -a-bc -hello - -wxyz -w,x,y,z -w,x,y-z diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test deleted file mode 100644 index 902f90b3377..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"json_encode" filter ---TEMPLATE-- -{{ "foo"|json_encode|raw }} -{{ foo|json_encode|raw }} -{{ [foo, "foo"]|json_encode|raw }} ---DATA-- -return ['foo' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -"foo" -"foo" -["foo","foo"] diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test deleted file mode 100644 index f71896c77f6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"last" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|last }} -{{ {a: 1, b: 2, c: 3, d: 4}|last }} -{{ '1234'|last }} -{{ arr|last }} -{{ 'Ä€é'|last }} -{{ ''|last }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4 -4 -4 -4 -é diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test deleted file mode 100644 index 52ad9e8b244..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -"length" filter ---TEMPLATE-- -{{ array|length }} -{{ string|length }} -{{ number|length }} -{{ to_string_able|length }} -{{ countable|length }} -{{ iterator_aggregate|length }} -{{ null|length }} -{{ magic|length }} -{{ non_countable|length }} -{{ simple_xml_element|length }} -{{ iterator|length }} ---DATA-- -return [ - 'array' => [1, 4], - 'string' => 'foo', - 'number' => 1000, - 'to_string_able' => new ToStringStub('foobar'), - 'countable' => new CountableStub(42), /* also asserts we do *not* call __toString() */ - 'iterator_aggregate' => new IteratorAggregateStub(['a', 'b', 'c']), /* also asserts we do *not* call __toString() */ - 'null' => null, - 'magic' => new MagicCallStub(), /* used to assert we do *not* call __call */ - 'non_countable' => new \StdClass(), - 'simple_xml_element' => new \SimpleXMLElement(''), - 'iterator' => new \SimpleIteratorForTesting() -] ---EXPECT-- -2 -3 -4 -6 -42 -3 -0 -1 -1 -2 -7 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test deleted file mode 100644 index 66b058b4249..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"length" filter ---TEMPLATE-- -{{ string|length }} -{{ markup|length }} ---DATA-- -return ['string' => 'été', 'markup' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -3 -3 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test deleted file mode 100644 index 5552f816683..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -"map" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 2]|map((item) => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item) => item ~ "*" ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item, k) => item ~ "*" ~ k ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 2]|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return ['it' => new \ArrayIterator([1, 2])] ---EXPECT-- -0 = 3 -1 = 4 - -a = 1* -b = 2* - -a = 1*a -b = 2*b - -0 = 3 -1 = 4 - -0 = 3 -1 = 4 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test deleted file mode 100644 index 8877501d4cc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"merge" filter ---TEMPLATE-- -{{ items|merge({'bar': 'foo'})|join }} -{{ items|merge({'bar': 'foo'})|keys|join }} -{{ {'bar': 'foo'}|merge(items)|join }} -{{ {'bar': 'foo'}|merge(items)|keys|join }} -{{ numerics|merge([4, 5, 6])|join }} -{{ traversable.a|merge(traversable.b)|join }} ---DATA-- -return [ - 'items' => ['foo' => 'bar'], - 'numerics' => [1, 2, 3], - 'traversable' => [ - 'a' => new \ArrayObject([0 => 1, 1 => 2, 2 => 3]), - 'b' => new \ArrayObject(['a' => 'b']) - ] -] ---EXPECT-- -barfoo -foobar -foobar -barfoo -123456 -123b diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test deleted file mode 100644 index 524ec45f963..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"nl2br" filter ---TEMPLATE-- -{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} -{{ text|nl2br }} ---DATA-- -return ['text' => "If you have some HTML\nit will be escaped."] ---EXPECT-- -I like Twig.
    -You will like it too.
    -
    -Everybody like it! -If you have some <strong>HTML</strong>
    -it will be escaped. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test deleted file mode 100644 index 7f1e2e16a28..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"number_format" filter ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(2) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -return [] ---EXPECT-- -20 -20 -20.25 -20,25 -1,020,25 -1.020,25 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test deleted file mode 100644 index 5946680fb69..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"number_format" filter with defaults. ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(1) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -$twig->getExtension(\Twig\Extension\CoreExtension::class)->setNumberFormat(2, '!', '='); -return [] ---EXPECT-- -20!00 -20!25 -20!3 -20,25 -1=020!25 -1=020,25 -1.020,25 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test deleted file mode 100644 index 73cad416867..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"reduce" filter ---TEMPLATE-- -{% set offset = 3 %} - -{{ [1, -1, 4]|reduce((carry, item) => carry + item + offset, 10) }} - -{{ it|reduce((carry, item) => carry + item + offset, 10) }} ---DATA-- -return ['it' => new \ArrayIterator([1, -1, 4])] ---EXPECT-- -23 - -23 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test deleted file mode 100644 index 1b9670a17b3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"replace" filter ---TEMPLATE-- -{{ "I liké %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} -{{ 'I like single replace operation only %that%'|replace({'%that%' : '%that%1'}) }} -{{ 'I like %this% and %that%.'|replace(traversable) }} ---DATA-- -return ['traversable' => new \ArrayObject(['%this%' => 'foo', '%that%' => 'bar'])] ---EXPECT-- -I liké foo and bar. -I like single replace operation only %that%1 -I like foo and bar. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test deleted file mode 100644 index ba6fea4125a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Exception for invalid argument type in replace call ---TEMPLATE-- -{{ 'test %foo%'|replace(stdClass) }} ---DATA-- -return ['stdClass' => new \stdClass()] ---EXCEPTION-- -Twig\Error\RuntimeError: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test deleted file mode 100644 index 904e5839b02..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"reverse" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|reverse|join('') }} -{{ '1234évènement'|reverse }} -{{ arr|reverse|join('') }} -{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4321 -tnemenèvé4321 -4321 -a,c -a,c -a,c diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test deleted file mode 100644 index 709237543a4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"round" filter ---TEMPLATE-- -{{ 2.7|round }} -{{ 2.1|round }} -{{ 2.1234|round(3, 'floor') }} -{{ 2.1|round(0, 'ceil') }} - -{{ 21.3|round(-1)}} -{{ 21.3|round(-1, 'ceil')}} -{{ 21.3|round(-1, 'floor')}} ---DATA-- -return [] ---EXPECT-- -3 -2 -2.123 -3 - -20 -30 -20 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test deleted file mode 100644 index fc975d7bb18..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -"slice" filter ---TEMPLATE-- -{{ [1, 2, 3, 4][1:2]|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} -{{ [1, 2, 3, 4][start:length]|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} -{{ '1234'|slice(1, 2) }} -{{ '1234'[1:2] }} -{{ arr|slice(1, 2)|join('') }} -{{ arr[1:2]|join('') }} -{{ arr[4:1]|join('') }} -{{ arr[3:2]|join('') }} - -{{ [1, 2, 3, 4]|slice(1)|join('') }} -{{ [1, 2, 3, 4][1:]|join('') }} -{{ '1234'|slice(1) }} -{{ '1234'[1:] }} -{{ '1234'[:1] }} - -{{ arr|slice(3)|join('') }} -{{ arr[2:]|join('') }} -{{ xml|slice(1)|join('')}} ---DATA-- -return ['start' => 1, 'length' => 2, 'arr' => new \ArrayObject([1, 2, 3, 4]), 'xml' => new \SimpleXMLElement('12')] ---EXPECT-- -23 -23 -23 -23 -01 -12 -23 -bc -23 -23 -23 -23 - -4 - -234 -234 -234 -234 -1 - -4 -34 -2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test deleted file mode 100644 index c3b2c70dd4a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"sort" filter ---TEMPLATE-- -{{ array1|sort|join }} -{{ array2|sort|join }} -{{ traversable|sort|join }} ---DATA-- -return ['array1' => [4, 1], 'array2' => ['foo', 'bar'], 'traversable' => new \ArrayObject([0 => 3, 1 => 2, 2 => 1])] ---EXPECT-- -14 -barfoo -123 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test deleted file mode 100644 index eadc1d4962a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"spaceless" filter ---TEMPLATE-- -{{ "
    foo
    "|spaceless }} ---DATA-- -return [] ---EXPECT-- -
    foo
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test deleted file mode 100644 index 9869ec91c34..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom filter ---TEMPLATE-- -{{ 'foo'|§ }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test deleted file mode 100644 index 92dbf0a05c9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"split" filter ---TEMPLATE-- -{{ "one,two,three,four,five"|split(',')|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} -{{ foo|split(',', -2)|join('-') }} ---DATA-- -return ['foo' => "one,two,three,four,five", 'baz' => '12345',] ---EXPECT-- -one-two-three-four-five -one-two-three-four-five -one-two-three,four,five -1-2-3-4-5 -1-2-3-4-5 -12-34-5 -one-two-three \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test deleted file mode 100644 index af48132fdd7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"split" filter ---TEMPLATE-- -{{ "é"|split('', 10)|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 1)|join('-') }} -{{ foo|split(',', 2)|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} ---DATA-- -return ['foo' => 'Ä,é,Äほ', 'baz' => 'éÄßごa',] ---EXPECT-- -é -Ä-é-Äほ -Ä,é,Äほ -Ä-é,Äほ -Ä-é-Äほ -é-Ä-ß-ご-a -é-Ä-ß-ご-a -éÄ-ßご-a \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test deleted file mode 100644 index 1626db0c972..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Filters as static method calls ---TEMPLATE-- -{{ 'foo'|static_call_string }} -{{ 'foo'|static_call_array }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test deleted file mode 100644 index 432989ff165..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"trim" filter ---TEMPLATE-- -{{ " I like Twig. "|trim }} -{{ text|trim }} -{{ " foo/"|trim("/") }} -{{ "xxxI like Twig.xxx"|trim(character_mask="x", side="left") }} -{{ "xxxI like Twig.xxx"|trim(side="right", character_mask="x") }} -{{ "xxxI like Twig.xxx"|trim("x", "right") }} -{{ "/ foo/"|trim("/", "left") }} -{{ "/ foo/"|trim(character_mask="/", side="left") }} -{{ " do nothing. "|trim("", "right") }} ---DATA-- -return ['text' => " If you have some HTML it will be escaped. "] ---EXPECT-- -I like Twig. -If you have some <strong>HTML</strong> it will be escaped. - foo -I like Twig.xxx -xxxI like Twig. -xxxI like Twig. - foo/ - foo/ - do nothing. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test deleted file mode 100644 index ac2369906dd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"url_encode" filter ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return [] ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test deleted file mode 100644 index 2972bd45eda..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"attribute" function ---TEMPLATE-- -{{ attribute(obj, method) }} -{{ attribute(array, item) }} -{{ attribute(obj, "bar", ["a", "b"]) }} -{{ attribute(obj, "bar", arguments) }} -{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} -{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} ---DATA-- -return ['obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] ---EXPECT-- -foo -bar -bar_a-b -bar_a-b -ok -ko diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test deleted file mode 100644 index 1a4fd5492f8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block('bar') }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARBAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test deleted file mode 100644 index 37cb7a4813f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" function with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') }} -{{ block('foo', included_loaded) }} -{{ block('foo', included_loaded_internal) }} -{% set output = block('foo', 'included.twig') %} -{{ output }} -{% block foo %}NOT FOO{% endblock %} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -FOO -FOO -FOO -FOO -NOT FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test deleted file mode 100644 index 236df945109..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function without arguments ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block() }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "block" function takes one argument (the block name) in "base.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_parent.test deleted file mode 100644 index 7fb7ef63246..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_parent.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" calling parent() with no definition in parent template ---TEMPLATE-- -{% extends "parent.twig" %} -{% block label %}{{ parent() }}{% endblock %} ---TEMPLATE(parent.twig)-- -{{ block('label') }} ---DATA-- -return array() ---EXCEPTION-- -Twig\Error\RuntimeError: Block "label" should not call parent() in "index.twig" as the block does not exist in the parent template "parent.twig" in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test deleted file mode 100644 index fd6dd061116..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"constant" function ---TEMPLATE-- -{{ constant('DATE_W3C') == expect ? 'true' : 'false' }} -{{ constant('ARRAY_AS_PROPS', object) }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -true -2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test deleted file mode 100644 index 0ac6dccd3ae..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"cycle" function ---TEMPLATE-- -{% for i in 0..6 %} -{{ cycle(array1, i) }}-{{ cycle(array2, i) }} -{% endfor %} ---DATA-- -return ['array1' => ['odd', 'even'], 'array2' => ['apple', 'orange', 'citrus']] ---EXPECT-- -odd-apple -even-orange -odd-citrus -even-apple -odd-orange -even-citrus -odd-apple diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test deleted file mode 100644 index c879da3cfd8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date().format('r') == date('now').format('r') ? 'OK' : 'KO' }} -{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} -{{ date() > date('-1day') ? 'OK' : 'KO' }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), -] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test deleted file mode 100644 index 11f60ee8bf2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }} -{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 09:45:00 -04:00 -04/10/2010 09:45:00 -04:00 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test deleted file mode 100644 index 691a3abea9b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"dump" function ---CONDITION-- -!extension_loaded('xdebug') ---TEMPLATE-- -{{ dump('foo') }} -{{ dump('foo', 'bar') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -string(3) "foo" - -string(3) "foo" -string(3) "bar" diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test deleted file mode 100644 index 5fd9383cd6a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded ---CONDITION-- -!extension_loaded('xdebug') || (($r = new \ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) ---TEMPLATE-- -{{ dump() }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -array(3) { - ["foo"]=> - string(3) "foo" - ["bar"]=> - string(3) "bar" - ["global"]=> - string(6) "global" -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test deleted file mode 100644 index c7b3539c402..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic function ---TEMPLATE-- -{{ foo_path('bar') }} -{{ a_foo_b_bar('bar') }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test deleted file mode 100644 index c9ce8123fea..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% set tmp = include("foo.twig") %} - -FOO{{ tmp }}BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO -FOOBARBAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test deleted file mode 100644 index a3666261f39..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function is safe for auto-escaping ---TEMPLATE-- -{{ include("foo.twig") }} ---TEMPLATE(foo.twig)-- -

    Test

    ---DATA-- -return [] ---EXPECT-- -

    Test

    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test deleted file mode 100644 index f90983c02f3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -FOO -{{ include("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test deleted file mode 100644 index c6d3d1c5331..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function allows expressions for the template to include ---TEMPLATE-- -FOO -{{ include(foo) }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test deleted file mode 100644 index c05b43e1403..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true, variables = {}) }} -{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }} ---DATA-- -return [] ---EXPECT-- diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test deleted file mode 100644 index fc2d211ad86..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("included.twig", ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{{ include("DOES NOT EXIST") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test deleted file mode 100644 index 810ae824800..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(['bad.twig', 'good.twig'], ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test deleted file mode 100644 index 1d50f7ac2fe..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("foo.twig") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test deleted file mode 100644 index 9ae8c9ee759..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {{ include("foo.twig") }} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test deleted file mode 100644 index ebfdb1eb8ff..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} ---TEMPLATE(foo.twig)-- - - -{{ foo|e }} -{{ foo|e }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Sandbox\SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test deleted file mode 100644 index 1206b67fe31..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} -{{ include("bar.twig") }} ---TEMPLATE(foo.twig)-- -foo ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar
    '] ---EXPECT-- -foo - - -bar<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test deleted file mode 100644 index c5be0088af6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("unknown.twig", sandboxed = true, ignore_missing = true) }} -{{ include("bar.twig") }} ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar
    '] ---EXPECT-- - - -bar<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test deleted file mode 100644 index 4c8b450835c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function accepts Twig_Template instance ---TEMPLATE-- -{{ include(foo) }} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test deleted file mode 100644 index 21e5bb2efd2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"]) }} -{{- include(["bar.twig", "foo.twig"]) }} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test deleted file mode 100644 index 46ac8c79bdc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function accept variables and with_context ---TEMPLATE-- -{{ include("foo.twig") }} -{{- include("foo.twig", with_context = false) }} -{{- include("foo.twig", {'foo1': 'bar'}) }} -{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -foo,global,_parent, -global,_parent, -foo,global,foo1,_parent, -foo1,global,_parent, diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test deleted file mode 100644 index 0ed98fed02f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function accept variables ---TEMPLATE-- -{{ include("foo.twig", {'foo': 'bar'}) }} -{{- include("foo.twig", vars) }} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars' => ['foo' => 'bar']] ---EXPECT-- -bar -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test deleted file mode 100644 index 8d9ba60ce66..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"template_from_string" function works in an "include" ---TEMPLATE-- -{% set embed = '{% embed "embed.twig" %}{% endembed %}' %} -{{ include(template_from_string(embed)) }} ---TEMPLATE(embed.twig)-- -Cool ---DATA-- -return [] ---EXPECT-- -Cool diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test deleted file mode 100644 index 4dd5e27042b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -__call calls ---TEMPLATE-- -{{ 'foo'|magic_call }} ---DATA-- -return [] ---EXPECT-- -magic_foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_static_call.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_static_call.test deleted file mode 100644 index 944f15aff66..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_static_call.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -__staticCall calls ---TEMPLATE-- -{{ 'foo'|magic_call_string }} -{{ 'foo'|magic_call_array }} ---DATA-- -return [] ---EXPECT-- -static_magic_foo -static_magic_foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test deleted file mode 100644 index 6d2de000d5e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"max" function ---TEMPLATE-- -{{ max([2, 1, 3, 5, 4]) }} -{{ max(2, 1, 3, 5, 4) }} -{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -5 -5 -two diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test deleted file mode 100644 index 1fe5446b7ca..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"min" function ---TEMPLATE-- -{{ min(2, 1, 3, 5, 4) }} -{{ min([2, 1, 3, 5, 4]) }} -{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -1 -1 -five diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test deleted file mode 100644 index 2927333b97f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"range" function ---TEMPLATE-- -{{ range(low=0+1, high=10+0, step=2)|join(',') }} ---DATA-- -return [] ---EXPECT-- -1,3,5,7,9 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test deleted file mode 100644 index 1c3fffb5dab..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"block" function recursively called in a parent template ---TEMPLATE-- -{% extends "ordered_menu.twig" %} -{% block label %}"{{ parent() }}"{% endblock %} -{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %} ---TEMPLATE(ordered_menu.twig)-- -{% extends "menu.twig" %} -{% block list %}{% set class = class|default('a') %}
      {{ block('children') }}
    {% endblock %} ---TEMPLATE(menu.twig)-- -{% extends "base.twig" %} -{% block list %}
      {{ block('children') }}
    {% endblock %} -{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %} -{% block item %}
  • {% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}
  • {% endblock %} -{% block label %}{{ item }}{% endblock %} ---TEMPLATE(base.twig)-- -{{ block('list') }} ---DATA-- -return ['item' => ['1', '2', ['3.1', ['3.2.1', '3.2.2'], '3.4']]] ---EXPECT-- -
    1. "1"
    2. "2"
      1. "3.1"
        1. "3.2.1"
        2. "3.2.2"
      2. "3.4"
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test deleted file mode 100644 index b691ce7bcd9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"source" function ---TEMPLATE-- -FOO -{{ source("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -{{ foo }}
    ---DATA-- -return [] ---EXPECT-- -FOO - -{{ foo }}
    - -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test deleted file mode 100644 index 9c9e249455e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom function ---TEMPLATE-- -{{ §('foo') }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test deleted file mode 100644 index dd13abb0bc5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Functions as static method calls ---TEMPLATE-- -{{ static_call_string('foo') }} -{{ static_call_array('foo') }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test deleted file mode 100644 index 33b0e40d7c3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string(template) %} - -{% include template_from_string("Hello {{ name }}") %} -{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %} ---TEMPLATE(parent.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['name' => 'Fabien', 'template' => "Hello {{ name }}"] ---EXPECT-- -Hello Fabien -Hello Fabien -Hello Fabien diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test deleted file mode 100644 index 900d238bd2b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string("{{ not a Twig template ", "foo.twig") %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unclosed "variable" in "foo.twig (string template 4900163d56b1af4b704c6b0afee7f98ba53418ce7a93d37a3af1882735baf9cd)" at line 1. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block.test deleted file mode 100644 index 36584bd2489..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"block" function with undefined block ---TEMPLATE-- -{% extends "base.twig" %} -{% block foo %} - {{ parent() }} - {{ block('unknown') }} - {{ block('bar') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}Foo{% endblock %} -{% block bar %}Bar{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Block "unknown" on template "base.twig" does not exist in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block_deep.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block_deep.test deleted file mode 100644 index cc98ec09d59..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/undefined_block_deep.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"block" function with undefined block on deep inheritance ---TEMPLATE-- -{% extends "base.twig" %} -{% block foo %} - {{ parent() }} - {{ block('unknown') }} - {{ block('bar') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% extends "layout.twig" %} -{% block foo %}Foo{% endblock %} -{% block bar %}Bar{% endblock %} ---TEMPLATE(layout.twig)-- -{% block foo %}Foo{% endblock %} -{% block bar %}Bar{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Block "unknown" on template "layout.twig" does not exist in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test deleted file mode 100644 index 18bba524ad9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(a, b = 'bar') -%} -{{ a }}{{ b }} -{%- endmacro %} - -{{ test('foo') }} -{{ test('bar', 'foo') }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test deleted file mode 100644 index 4577286d0cb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo(data) %} - {{ data }} -{% endmacro %} - -{% macro bar() %} -
    -{% endmacro %} - -{{ macros.foo(macros.bar()) }} ---DATA-- -return [] ---EXPECT-- -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test deleted file mode 100644 index 05dd9213008..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(this) -%} - {{ this }} -{%- endmacro %} - -{{ test(this) }} ---DATA-- -return ['this' => 'foo'] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test deleted file mode 100644 index 8fc6b477fb2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as test %} -{% from _self import test %} - -{% macro test(a, b) -%} - {{ a|default('a') }}
    - {{- b|default('b') }}
    -{%- endmacro %} - -{{ test.test() }} -{{ test() }} -{{ test.test(1, "c") }} -{{ test(1, "c") }} ---DATA-- -return [] ---EXPECT-- -a
    b
    -a
    b
    -1
    c
    -1
    c
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/unknown_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/unknown_macro.test deleted file mode 100644 index 10ea6c62a7d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/unknown_macro.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.unknown() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Macro "unknown" is not defined in template "index.twig" in "index.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test deleted file mode 100644 index dd4b5c9f471..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -macro with arbitrary arguments ---TEMPLATE-- -{% from _self import test1, test2 %} - -{% macro test1(var) %} - {{- var }}: {{ varargs|join(", ") }} -{% endmacro %} - -{% macro test2() %} - {{- varargs|join(", ") }} -{% endmacro %} - -{{ test1("foo", "bar", "foobar") }} -{{ test2("foo", "bar", "foobar") }} ---DATA-- -return [] ---EXPECT-- -foo: bar, foobar - -foo, bar, foobar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test deleted file mode 100644 index 1ad368bf1e1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -macro with varargs argument ---TEMPLATE-- -{% macro test(varargs) %} -{% endmacro %} ---EXCEPTION-- -Twig\Error\SyntaxError: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test deleted file mode 100644 index 72a7a2f448b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro with a filter ---TEMPLATE-- -{% import _self as test %} - -{% macro test() %} - {% apply escape %}foo
    {% endapply %} -{% endmacro %} - -{{ test.test() }} ---DATA-- -return [] ---EXPECT-- -foo<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test deleted file mode 100644 index 1941467682f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Block names are unique per template ---TEMPLATE-- -{% extends 'layout' %} -{% block content -%} - {% apply title -%} - second - {% endapply %} -{% endblock %} ---TEMPLATE(layout)-- -{% apply title -%} - first -{% endapply %} -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -First -Second diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test deleted file mode 100644 index 6426d2c1d85..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception with bad line number ---TEMPLATE-- -{% block content %} - {{ foo }} - {{ include("foo") }} -{% endblock %} -index ---TEMPLATE(foo)-- -foo -{{ foo.bar }} ---DATA-- -return ['foo' => 'foo'] ---EXCEPTION-- -Twig\Error\RuntimeError: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test deleted file mode 100644 index 25bdc9e407c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig outputs 0 nodes correctly ---TEMPLATE-- -{{ foo }}0{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo0foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test deleted file mode 100644 index e2ab950e183..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -error in twig extension ---TEMPLATE-- -{{ object.region is not null ? object.regionChoices[object.region] }} ---DATA-- -class House -{ - const REGION_S = 1; - const REGION_P = 2; - - public static $regionChoices = [self::REGION_S => 'house.region.s', self::REGION_P => 'house.region.p']; - - public function getRegionChoices() - { - return self::$regionChoices; - } -} - -$object = new House(); -$object->region = 1; -return ['object' => $object] ---EXPECT-- -house.region.s diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test deleted file mode 100644 index 96ca5517a14..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig allows multi-word tests without a custom node class ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} -{{ 'foo bar' is multi word ? 'yes' : 'no' }} ---DATA-- -return [] ---EXPECT-- -no -yes diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test deleted file mode 100644 index 41e62c07c21..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Twig is able to deal with SimpleXMLElement instances as variables ---TEMPLATE-- -Hello '{{ images.image.0.group }}'! -{{ images.image.0.group.attributes.myattr }} -{{ images.children().image.count() }} -{% for image in images %} - - {{ image.group }} -{% endfor %} ---DATA-- -return ['images' => new \SimpleXMLElement('foobar')] ---EXPECT-- -Hello 'foo'! -example -2 - - foo - - bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test deleted file mode 100644 index 62fe8848587..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not confuse strings with integers in getAttribute() ---TEMPLATE-- -{{ hash['2e2'] }} ---DATA-- -return ['hash' => ['2e2' => 'works']] ---EXPECT-- -works diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test deleted file mode 100644 index 4848ee02597..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply upper %} -Some text with a {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test deleted file mode 100644 index 8a590b44ac4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply json_encode|raw %}test{% endapply %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test deleted file mode 100644 index e16998a5260..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tags accept multiple chained filters ---TEMPLATE-- -{% apply lower|title %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test deleted file mode 100644 index b64a6914c53..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"apply" tags can be nested at will ---TEMPLATE-- -{% apply lower|title %} - {{ var }} - {% apply upper %} - {{ var }} - {% endapply %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test deleted file mode 100644 index a87ff9116ba..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"apply" tag does not create a new scope ---TEMPLATE-- -{% set foo = 'baz' %} -{% apply spaceless %} - {% set foo = 'foo' %} - {% set bar = 'bar' %} -{% endapply %} -{{ 'foo' == foo ? 'OK ' ~ foo : 'KO' }} -{{ 'bar' == bar ? 'OK ' ~ bar : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK foo -OK bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test deleted file mode 100644 index 4453880b596..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "for" tags ---TEMPLATE-- -{% apply upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test deleted file mode 100644 index ca7a592cbaa..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "if" tags ---TEMPLATE-- -{% apply upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test deleted file mode 100644 index 7b037c7af78..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on its children ---TEMPLATE-- -{% autoescape %} -{{ var }}
    -{% endautoescape %} -{% autoescape 'html' %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br />
    -<br />
    -

    -

    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test deleted file mode 100644 index 292e1b4167c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on embedded blocks ---TEMPLATE-- -{% autoescape 'html' %} - {% block foo %} - {{ var }} - {% endblock %} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test deleted file mode 100644 index 1724b48787f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not double-escape ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|escape }} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test deleted file mode 100644 index 170e7074ede..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling functions ---TEMPLATE-- - -autoescape false -{% autoescape false %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -{% endautoescape %} - -autoescape 'html' -{% autoescape 'html' %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -unsafe_br()|raw -{{ (unsafe_br())|raw }} - -safe_br()|escape -{{ (safe_br())|escape }} - -safe_br()|raw -{{ (safe_br())|raw }} - -unsafe_br()|escape -{{ (unsafe_br())|escape }} - -{% endautoescape %} - -autoescape js -{% autoescape 'js' %} - -safe_br -{{ safe_br() }} - -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - -autoescape false - -safe_br -
    - -unsafe_br -
    - - -autoescape 'html' - -safe_br -
    - -unsafe_br -<br /> - -unsafe_br()|raw -
    - -safe_br()|escape -<br /> - -safe_br()|raw -
    - -unsafe_br()|escape -<br /> - - -autoescape js - -safe_br -\u003Cbr\u0020\/\u003E diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test deleted file mode 100644 index 3d8d4f8fdd2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -"autoescape" tag does not apply escaping on literals ---TEMPLATE-- -{% autoescape 'html' %} - -1. Simple literal -{{ "
    " }} - -2. Conditional expression with only literals -{{ true ? "
    " : "
    " }} - -3. Conditional expression with a variable -{{ true ? "
    " : someVar }} -{{ false ? "
    " : someVar }} -{{ true ? someVar : "
    " }} -{{ false ? someVar : "
    " }} - -4. Nested conditionals with only literals -{{ true ? (true ? "
    " : "
    ") : "\n" }} - -5. Nested conditionals with a variable -{{ true ? (true ? "
    " : someVar) : "\n" }} -{{ true ? (false ? "
    " : someVar) : "\n" }} -{{ true ? (true ? someVar : "
    ") : "\n" }} -{{ true ? (false ? someVar : "
    ") : "\n" }} -{{ false ? "\n" : (true ? someVar : "
    ") }} -{{ false ? "\n" : (false ? someVar : "
    ") }} - -6. Nested conditionals with a variable marked safe -{{ true ? (true ? "
    " : someVar|raw) : "\n" }} -{{ true ? (false ? "
    " : someVar|raw) : "\n" }} -{{ true ? (true ? someVar|raw : "
    ") : "\n" }} -{{ true ? (false ? someVar|raw : "
    ") : "\n" }} -{{ false ? "\n" : (true ? someVar|raw : "
    ") }} -{{ false ? "\n" : (false ? someVar|raw : "
    ") }} - -7. Without then clause -{{ "
    " ?: someVar }} -{{ someFalseVar ?: "
    " }} - -8. NullCoalesce -{{ aaaa ?? "
    " }} -{{ "
    " ?? someVar }} - -{% endautoescape %} ---DATA-- -return ['someVar' => '
    ', 'someFalseVar' => false] ---EXPECT-- - -1. Simple literal -
    - -2. Conditional expression with only literals -
    - -3. Conditional expression with a variable -
    -<br /> -<br /> -
    - -4. Nested conditionals with only literals -
    - -5. Nested conditionals with a variable -
    -<br /> -<br /> -
    -<br /> -
    - -6. Nested conditionals with a variable marked safe -
    -
    -
    -
    -
    -
    - -7. Without then clause -
    -
    - -8. NullCoalesce -
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test deleted file mode 100644 index 0d88c7e3a2e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tags can be nested at will ---TEMPLATE-- -{{ var }} -{% autoescape 'html' %} - {{ var }} - {% autoescape false %} - {{ var }} - {% autoescape 'html' %} - {{ var }} - {% endautoescape %} - {{ var }} - {% endautoescape %} - {{ var }} -{% endautoescape %} -{{ var }} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> - <br /> -
    - <br /> -
    - <br /> -<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test deleted file mode 100644 index 9d959b22b4f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping to object method calls ---TEMPLATE-- -{% autoescape 'html' %} -{{ user.name }} -{{ user.name|lower }} -{{ user }} -{% endautoescape %} ---DATA-- -class UserForAutoEscapeTest -{ - public function getName() - { - return 'Fabien
    '; - } - - public function __toString() - { - return 'Fabien
    '; - } -} -return ['user' => new UserForAutoEscapeTest()] ---EXPECT-- -Fabien<br /> -fabien<br /> -Fabien<br /> diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test deleted file mode 100644 index 187327c8017..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not escape when raw is used as a filter ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|raw }} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test deleted file mode 100644 index 9a0137ee27e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape 'js' %}{{ var }}{% endautoescape %} - -{% autoescape 'html' %}{{ var }}{% endautoescape %} ---DATA-- -return ['var' => '
    "'] ---EXPECT-- -\u003Cbr\u0020\/\u003E\u0022 -<br />" diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test deleted file mode 100644 index 9ae8d7bf992..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -escape types ---TEMPLATE-- - -1. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -2. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -3. autoescape 'js' |escape('js') - -{% autoescape 'js' %} - -{% endautoescape %} - -4. no escape - -{% autoescape false %} - -{% endautoescape %} - -5. |escape('js')|escape('html') - -{% autoescape false %} - -{% endautoescape %} - -6. autoescape 'html' |escape('js')|escape('html') - -{% autoescape 'html' %} - -{% endautoescape %} - ---DATA-- -return ['msg' => "<>\n'\""] ---EXPECT-- - -1. autoescape 'html' |escape('js') - - - -2. autoescape 'html' |escape('js') - - - -3. autoescape 'js' |escape('js') - - - -4. no escape - - - -5. |escape('js')|escape('html') - - - -6. autoescape 'html' |escape('js')|escape('html') - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test deleted file mode 100644 index f97105bbd1b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters ---TEMPLATE-- -{% autoescape 'html' %} - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -{{ var|escape_and_nl2br }} - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -{{ var|escape_and_nl2br|raw }} - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -{{ var|escape_and_nl2br|escape }} - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -{{ var|upper }} - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -{{ var|escape_and_nl2br|upper }} - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -{{ var|upper|escape_and_nl2br }} - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -{{ "%s"|format(var) }} - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -{{ "%s"|raw|format(var) }} - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) -{{ "%s"|format(var)|raw }} - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) -{{ "%s"|format(var|raw)|raw }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -<Fabien>
    -Twig - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -<Fabien>
    -Twig - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -&lt;Fabien&gt;<br /> -Twig - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -<FABIEN> -TWIG - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -&LT;FABIEN&GT;<BR /> -TWIG - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -<FABIEN>
    -TWIG - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) - -Twig - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) - -Twig diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test deleted file mode 100644 index 50f72d83a1e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"autoescape" tag do not applies escaping on filter arguments ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|nl2br("
    ") }} -{{ var|nl2br("
    "|escape) }} -{{ var|nl2br(sep) }} -{{ var|nl2br(sep|raw) }} -{{ var|nl2br(sep|escape) }} -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig", 'sep' => '
    '] ---EXPECT-- -<Fabien>
    -Twig -<Fabien><br /> -Twig -<Fabien>
    -Twig -<Fabien>
    -Twig -<Fabien><br /> -Twig diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test deleted file mode 100644 index c9c738055df..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters ---TEMPLATE-- -{% autoescape 'html' %} - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -{{ var|nl2br }} - -2. Don't double-pre-escape -( var|escape|nl2br ) -{{ var|escape|nl2br }} - -3. Don't escape safe values -( var|raw|nl2br ) -{{ var|raw|nl2br }} - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -{{ var|nl2br|nl2br }} - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -{{ var|escape_something|nl2br }} - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -{{ var|nl2br|upper }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -2. Don't double-pre-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -3. Don't escape safe values -( var|raw|nl2br ) -
    -Twig - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -<Fabien>

    -Twig - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -<FABIEN>
    -TWIG - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -&LT;FABIEN&GT;<BR /> -TWIG - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test deleted file mode 100644 index c764d434b09..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"autoescape" tag handles filters preserving the safety ---TEMPLATE-- -{% autoescape 'html' %} - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -{{ var|preserves_safety }} - -2. Safe values are still safe -( var|escape|preserves_safety ) -{{ var|escape|preserves_safety }} - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -{{ var|escape_something|preserves_safety }} - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -<FABIEN> -TWIG - -2. Safe values are still safe -( var|escape|preserves_safety ) -<FABIEN> -TWIG - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -<FABIEN> -TWIG - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -&LT;FABPOT&GT; -TWIG - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test deleted file mode 100644 index 988b09ce863..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block title1 %}FOO{% endblock %} -{% block title2 foo|lower %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -FOObar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test deleted file mode 100644 index 3009f8b4201..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - {% block content %} - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The block 'content' has already been defined line 2 in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/capturing_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/capturing_block.test deleted file mode 100644 index 4182b8c3617..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/capturing_block.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -capturing "block" tag ---DEPRECATION-- -The spaceless tag in "index.twig" at line 4 is deprecated since Twig 2.7, use the spaceless filter instead. ---TEMPLATE-- -{% set foo %}{% block foo %}FOO{% endblock %}{% endset %} -{{ foo }} -{% spaceless %} -{% block bar %} -

    - Title -

    -{% endblock %} -{% endspaceless %} - -{{ block('bar') }} ---DATA-- -return array() ---EXPECT-- -FOO -

    Title

    -

    - Title -

    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/conditional_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/conditional_block.test deleted file mode 100644 index d4e2ae009fb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/conditional_block.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -conditional "block" tag ---TEMPLATE-- -{% if false %}{% block foo %}FOO{% endblock %}{% endif %} -{% if true %}{% block bar %}BAR{% endblock %}{% endif %} ---DATA-- -return array() ---EXPECT-- -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test deleted file mode 100644 index e8e240eb77e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"§" special chars in a block name ---TEMPLATE-- -{% block § %} -§ -{% endblock § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test deleted file mode 100644 index 53729dd1f70..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Deprecating a block with "deprecated" tag ---TEMPLATE-- -{% use 'greeting.twig' %} - -{{ block('welcome') }} - ---TEMPLATE(greeting.twig)-- -{% block welcome %} - {% deprecated 'The "welcome" block is deprecated, use "hello" instead.' %} - {{ block('hello') }} -{% endblock %} - -{% block hello %} -Hello Fabien -{% endblock %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test deleted file mode 100644 index 5cc48dd873b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Deprecating a macro with "deprecated" tag ---TEMPLATE-- -{% import 'greeting.twig' as greeting %} - -{{ greeting.welcome('Fabien') }} - ---TEMPLATE(greeting.twig)-- -{% macro welcome(name) %} - {% deprecated 'The "welcome" macro is deprecated, use "hello" instead.' %} - {% import _self as self %} - {{ self.hello(name) }} -{% endmacro %} - -{% macro hello(name) %} -Hello {{ name }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test deleted file mode 100644 index 7f786d57fc3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Deprecating a template with "deprecated" tag ---TEMPLATE-- -{% extends 'greeting.twig' %} - -{% deprecated 'The "index.twig" template is deprecated, use "greeting.twig" instead.' %} ---TEMPLATE(greeting.twig)-- -Hello Fabien ---DATA-- -return [] ---EXPECT-- -Hello Fabien diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test deleted file mode 100644 index 16781e4186a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test deleted file mode 100644 index b799a8c95f8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo ~ ".twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test deleted file mode 100644 index 6f0879e28dc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test deleted file mode 100644 index b1c6c85e611..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE(index.twig)-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ nothing }} - {% endblock %} -{% endembed %} -BAR ---TEMPLATE(foo.twig)-- -{% block c1 %}{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "nothing" does not exist in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test deleted file mode 100644 index 9f7b52f1d82..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test deleted file mode 100644 index 9f33723366d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - - {% endblock %} -{% endembed %} ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - block1 - - -A - block1 - - block1extended - B - block2 -C - B - block2 -C diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test deleted file mode 100644 index ce726ac0092..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block c1 %} - {{ parent() }} - blockc1baseextended -{% endblock %} - -{% block c2 %} - {{ parent() }} - - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -A -{% block c1 %} - blockc1base -{% endblock %} -{% block c2 %} - blockc2base -{% endblock %} -B ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - blockc1base - - blockc1baseextended - blockc2base - - - -A - block1 - - block1extended - B - block2 -C blockc2base - -B \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.legacy.test deleted file mode 100644 index 28f12c1abc2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter upper %} -Some text with a {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.legacy.test deleted file mode 100644 index 1da38498f83..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter json_encode|raw %}test{% endfilter %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.legacy.test deleted file mode 100644 index f7aa54fb38f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"filter" tags accept multiple chained filters ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter lower|title %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.legacy.test deleted file mode 100644 index a8c69066ba3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.legacy.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"filter" tags can be nested at will ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. -The "filter" tag in "index.twig" at line 4 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter lower|title %} - {{ var }} - {% filter upper %} - {{ var }} - {% endfilter %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.legacy.test deleted file mode 100644 index 6ee1ac835b8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.legacy.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"scope" tag creates a new scope ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter spaceless %} -{% set item = 'foo' %} -{% endfilter %} -{{ item }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "item" does not exist in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.legacy.test deleted file mode 100644 index 5f3ab7bc844..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.legacy.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "for" tags ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.legacy.test deleted file mode 100644 index 034caaa5389..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.legacy.test +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "if" tags ---DEPRECATION-- -The "filter" tag in "index.twig" at line 2 is deprecated since Twig 2.9, use the "apply" tag instead. ---TEMPLATE-- -{% filter upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.legacy.test deleted file mode 100644 index a35047c0621..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.legacy.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"for" tag takes a condition ---DEPRECATION-- -Using an "if" condition on "for" tag in "index.twig" at line 2 is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). ---TEMPLATE-- -{% for i in 1..5 if i is odd -%} - {{ loop.index }}.{{ i }}{{ foo.bar }} -{% endfor %} ---DATA-- -return ['foo' => ['bar' => 'X']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -1.1X -2.3X -3.5X diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test deleted file mode 100644 index 3cdd575c83e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tag keeps the context safe ---TEMPLATE-- -{% for item in items %} - {% for item in items %} - * {{ item }} - {% endfor %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b - * a - * a - * b - * b diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test deleted file mode 100644 index 86ec9c28d3e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% else %} - no item -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b ---DATA-- -return ['items' => []] ---EXPECT-- - no item ---DATA-- -return [] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- - no item diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test deleted file mode 100644 index e1ad3c73567..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag does not reset inner variables ---TEMPLATE-- -{% for i in 1..2 %} - {% for j in 0..2 %} - {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} - {% endfor %} -{% endfor %} ---DATA-- -return ['k' => 0] ---EXPECT-- - 0 1 - 1 1 - 2 1 - 3 2 - 4 2 - 5 2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test deleted file mode 100644 index 92135575f63..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys ---TEMPLATE-- -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0 - * 1 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test deleted file mode 100644 index ab39ddf210c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys and values ---TEMPLATE-- -{% for key, item in items %} - * {{ key }}/{{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0/a - * 1/b diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test deleted file mode 100644 index 56a60c2e6ee..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context ---TEMPLATE-- -{% for item in items %} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 1/0 - * 2/1 - * 1//2 - - * 2/1 - * 1/0 - * /1/2 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test deleted file mode 100644 index 58e5a9b3451..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context locally ---TEMPLATE-- -{% for item in items %} -{% endfor %} -{% if loop is not defined %}WORKS{% endif %} ---DATA-- -return ['items' => []] ---EXPECT-- -WORKS diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test deleted file mode 100644 index 2d8c0b87389..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if i > 0 %} - {{ loop.last }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test deleted file mode 100644 index e90e96b4ae2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if loop.last > 0 %} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test deleted file mode 100644 index df1bb07ac04..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - {% for item in items1 %} - * {{ item }} - {% else %} - no {{ item }} - {% endfor %} -{% else %} - no item1 -{% endfor %} ---DATA-- -return ['items' => ['a', 'b'], 'items1' => []] ---EXPECT-- -no a - no b diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test deleted file mode 100644 index 134fe3fc3e9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -"for" tag iterates over iterable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.first }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIterator implements \Iterator -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } -} -return ['items' => new ItemsIterator()] ---EXPECT-- - * bar - * 1/0 - * 1 - - * foo - * 2/1 - * - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test deleted file mode 100644 index 97f1db0c540..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -"for" tag iterates over iterable and countable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIteratorCountable implements \Iterator, \Countable -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } - public function count() { return count($this->values); } -} -return ['items' => new ItemsIteratorCountable()] ---EXPECT-- - * bar - * 1/0 - * 2/1 - * 1//2 - - * foo - * 2/1 - * 1/0 - * /1/2 - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test deleted file mode 100644 index 3b677d60ffb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tags can be nested ---TEMPLATE-- -{% for key, item in items %} -* {{ key }} ({{ loop.length }}): -{% for value in item %} - * {{ value }} ({{ loop.length }}) -{% endfor %} -{% endfor %} ---DATA-- -return ['items' => ['a' => ['a1', 'a2', 'a3'], 'b' => ['b1']]] ---EXPECT-- -* a (2): - * a1 (3) - * a2 (3) - * a3 (3) -* b (2): - * b1 (1) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test deleted file mode 100644 index 384c41b2886..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag iterates over item values ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test deleted file mode 100644 index 1d3c9e2b58c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -global variables ---TEMPLATE-- -{% include "included.twig" %} -{% from "included.twig" import foobar %} -{{ foobar() }} ---TEMPLATE(included.twig)-- -{% macro foobar() %} -called foobar -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -called foobar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test deleted file mode 100644 index a02165e539e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" creates a condition ---TEMPLATE-- -{% if a is defined %} - {{ a }} -{% elseif b is defined %} - {{ b }} -{% else %} - NOTHING -{% endif %} ---DATA-- -return ['a' => 'a'] ---EXPECT-- - a ---DATA-- -return ['b' => 'b'] ---EXPECT-- - b ---DATA-- -return [] ---EXPECT-- - NOTHING diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test deleted file mode 100644 index eb65083c615..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" takes an expression as a test ---TEMPLATE-- -{% if a < 2 %} - A1 -{% elseif a > 10 %} - A2 -{% else %} - A3 -{% endif %} ---DATA-- -return ['a' => 1] ---EXPECT-- - A1 ---DATA-- -return ['a' => 12] ---EXPECT-- - A2 ---DATA-- -return ['a' => 7] ---EXPECT-- - A3 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test deleted file mode 100644 index 9982b039d02..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -FOO -{% include "foo.twig" %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test deleted file mode 100644 index 23db1812389..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag allows expressions for the template to include ---TEMPLATE-- -FOO -{% include foo %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test deleted file mode 100644 index 6c8bdb1e92b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] ignore missing %} -{% include "foo.twig" ignore missing %} -{% include "foo.twig" ignore missing with {} %} -{% include "foo.twig" ignore missing with {} only %} ---DATA-- -return [] ---EXPECT-- diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test deleted file mode 100644 index 1af012210e4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "included.twig" ignore missing %} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{% include "DOES NOT EXIST" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test deleted file mode 100644 index d0d1bfe5907..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ['bad.twig', 'good.twig'] ignore missing %} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test deleted file mode 100644 index ac72838e849..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "foo.twig" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test deleted file mode 100644 index 0ee51b78622..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {% include "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test deleted file mode 100644 index 8da402f7a83..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"include" tag accept variables and only ---TEMPLATE-- -{% include "foo.twig" %} -{% include "foo.twig" only %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars1 only %} -{% include "foo.twig" with vars2 %} -{% include "foo.twig" with vars2 only %} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['vars1' => ['foo1' => 'bar'], 'vars2' => new ArrayObject(['foo2' => 'bar'])] ---EXPECT-- -vars1,vars2,global,_parent, -global,_parent, -vars1,vars2,global,foo1,_parent, -foo1,global,_parent, -vars1,vars2,global,foo2,_parent, -foo2,global,_parent, diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test deleted file mode 100644 index 4fb862a175c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag accepts \Twig\TemplateWrapper instance ---TEMPLATE-- -{% include foo %} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test deleted file mode 100644 index 38063952d41..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] %} -{% include ["bar.twig", "foo.twig"] %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test deleted file mode 100644 index 45a05199ec6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"include" tag accept variables ---TEMPLATE-- -{% include "foo.twig" with {'foo': 'bar'} %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars2 %} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars1' => ['foo' => 'bar'], 'vars2' => new ArrayObject(['foo' => 'bar'])] ---EXPECT-- -bar -bar -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test deleted file mode 100644 index 703b61be176..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test deleted file mode 100644 index 0b82d4cf2dd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -block_expr ---TEMPLATE-- -{% extends "base.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test deleted file mode 100644 index 18f6604113e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -block_expr2 ---TEMPLATE-- -{% extends "base2.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base2.twig)-- -{% extends "base.twig" %} ---TEMPLATE(base.twig)-- -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/capturing_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/capturing_block.test deleted file mode 100644 index 703e33fd0cc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/capturing_block.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -capturing "block" tag with "extends" tag ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set foo %} - {%- block content %}FOO{% endblock %} -{% endset %} - -{% block content1 %}BAR{{ foo }}{% endblock %} ---TEMPLATE(layout.twig)-- -{% block content %}{% endblock %} -{% block content1 %}{% endblock %} ---DATA-- -return array() ---EXPECT-- -FOOBARFOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test deleted file mode 100644 index bd28248d137..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends standalone ? foo : 'bar.twig' %} - -{% block content %}{{ parent() }}FOO{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---TEMPLATE(bar.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => 'foo.twig', 'standalone' => true] ---EXPECT-- -FOOFOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional_block.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional_block.legacy.test deleted file mode 100644 index fb1c9b530d3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional_block.legacy.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -conditional "block" tag with "extends" tag ---DEPRECATION-- -Nesting a block definition under a non-capturing node in "index.twig" at line 5 is deprecated since Twig 2.5.0 and will become a syntax error in 3.0. ---TEMPLATE-- -{% extends "layout.twig" %} - -{% if false %} - {% block content %}FOO{% endblock %} -{% endif %} ---TEMPLATE(layout.twig)-- -{% block content %}{% endblock %} ---DATA-- -return array() ---EXPECT-- -FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test deleted file mode 100644 index e6a0f017280..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test deleted file mode 100644 index ca11bf20d1b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test deleted file mode 100644 index 4d2cb6c6572..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["foo.twig", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test deleted file mode 100644 index 5108651103b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test deleted file mode 100644 index c5ee6f193b7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends [null, "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test deleted file mode 100644 index a372ea1c81e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a block ---TEMPLATE-- -{% block foo %} - {% extends "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a block in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test deleted file mode 100644 index dc87b2a8c2d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a macro ---TEMPLATE-- -{% macro foo() %} - {% extends "foo.twig" %} -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a macro in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test deleted file mode 100644 index fc25badd34f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}base {% endblock %} ---DATA-- -return [] ---EXPECT-- -base layout index diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test deleted file mode 100644 index fa887177bd3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% set foo = 1 %} -{{ include('parent.twig') }} -{{ include('parent.twig') }} -{% set foo = 2 %} -{{ include('parent.twig') }} ---TEMPLATE(parent.twig)-- -{% extends foo~'_parent.twig' %}{% block content %}{{ parent() }} parent{% endblock %} ---TEMPLATE(1_parent.twig)-- -{% block content %}1{% endblock %} ---TEMPLATE(2_parent.twig)-- -{% block content %}2{% endblock %} ---DATA-- -return [] ---EXPECT-- -1 parent - -1 parent - -2 parent diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test deleted file mode 100644 index abea2e9d473..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block subcontent %} - {% block subsubcontent %} - SUBSUBCONTENT - {% endblock %} - {% endblock %} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - {% block subcontent %} - SUBCONTENT - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -SUBSUBCONTENT diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test deleted file mode 100644 index 20b7848f8d3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - CONTENT - {%- block subcontent -%} - SUBCONTENT - {%- endblock -%} - ENDCONTENT -{% endblock %} ---TEMPLATE(foo.twig)-- ---DATA-- -return [] ---EXPECT-- -CONTENTSUBCONTENTENDCONTENT diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test deleted file mode 100644 index 0b585b4809c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %} -{% block inside %}INSIDE{% endblock inside %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %} -{% block body %} - {% block inside '' %} -{% endblock body %} ---TEMPLATE(base.twig)-- -{% block body '' %} ---DATA-- -return [] ---EXPECT-- -INSIDE diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test deleted file mode 100644 index 73f4c0ec5eb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARFOOBAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test deleted file mode 100644 index 1aaed556c57..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag with a parent as a Twig_TemplateWrapper instance ---TEMPLATE-- -{% extends foo %} - -{% block content %}New{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}Default{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -New diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test deleted file mode 100644 index 01bd544f83c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo ? 'foo.twig' : 'bar.twig' %} ---TEMPLATE(foo.twig)-- -FOO ---TEMPLATE(bar.twig)-- -BAR ---DATA-- -return ['foo' => true] ---EXPECT-- -FOO ---DATA-- -return ['foo' => false] ---EXPECT-- -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test deleted file mode 100644 index 58a37bd9021..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "base.twig" %} -{% block content %}{% include "included.twig" %}{% endblock %} - -{% block footer %}Footer{% endblock %} ---TEMPLATE(included.twig)-- -{% extends "base.twig" %} -{% block content %}Included Content{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}Default Content{% endblock %} - -{% block footer %}Default Footer{% endblock %} ---DATA-- -return [] ---EXPECT-- -Included Content -Default Footer -Footer diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test deleted file mode 100644 index d4347bac4f8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block inside %} - INSIDE OVERRIDDEN - {% endblock %} - - BEFORE - {{ parent() }} - AFTER -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - BAR -{% endblock %} ---DATA-- -return [] ---EXPECT-- - -INSIDE OVERRIDDEN - - BEFORE - BAR - - AFTER diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test deleted file mode 100644 index 6d98891553d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% block content %} - {{ parent() }} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test deleted file mode 100644 index 39882b8b39d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% use 'foo.twig' %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BAR diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test deleted file mode 100644 index a5a223886dc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag accepts Twig_Template instance ---TEMPLATE-- -{% extends foo %} - -{% block content %} -{{ parent() }}FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BARFOO diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test deleted file mode 100644 index 4df32ee9d3f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -"parent" function ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use "use1.twig" %} -{% use "use2.twig" %} - -{% block content_parent %} - {{ parent() }} -{% endblock %} - -{% block content_use1 %} - {{ parent() }} -{% endblock %} - -{% block content_use2 %} - {{ parent() }} -{% endblock %} - -{% block content %} - {{ block('content_use1_only') }} - {{ block('content_use2_only') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block content_parent 'content_parent' %} -{% block content_use1 'content_parent' %} -{% block content_use2 'content_parent' %} -{% block content '' %} ---TEMPLATE(use1.twig)-- -{% block content_use1 'content_use1' %} -{% block content_use2 'content_use1' %} -{% block content_use1_only 'content_use1_only' %} ---TEMPLATE(use2.twig)-- -{% block content_use2 'content_use2' %} -{% block content_use2_only 'content_use2_only' %} ---DATA-- -return [] ---EXPECT-- - content_parent - content_use1 - content_use2 - content_use1_only - content_use2_only diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import.test deleted file mode 100644 index 14e0afe00a5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{{ _self.hello('Fabien') }} - -{% macro hello(name) -%} - Hello {{ _self.up(name) }} -{% endmacro %} - -{% macro up(name) -%} - {{ name|upper }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Hello FABIEN diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import_blocks.test deleted file mode 100644 index 59b739377bb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/auto_import_blocks.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block content %} - {{ _self.hello('Fabien') }} -{% endblock %} - -{% macro hello(name) -%} - Hello {{ _self.up(name) }} -{% endmacro %} - -{% macro up(name) -%} - {{ name|upper }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Hello FABIEN diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test deleted file mode 100644 index ae090f9a069..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.input('username') }} -{{ macros.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test deleted file mode 100644 index 3f3caf7773b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag supports name for endmacro ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo() }} -{{ macros.bar() }} - -{% macro foo() %}foo{% endmacro %} -{% macro bar() %}bar{% endmacro bar %} ---DATA-- -return [] ---EXPECT-- -foo -bar - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test deleted file mode 100644 index b28ca19f029..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import 'forms.twig' as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} ---TEMPLATE(forms.twig)-- -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test deleted file mode 100644 index 8b9aae87890..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} -{% from 'forms.twig' import foo as foobar, bar %} - -{{ foo('foo') }} -{{ foobar('foo') }} -{{ bar('foo') }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}foo{{ name }}{% endmacro %} -{% macro bar(name) %}bar{{ name }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foofoo -foofoo -barfoo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_embed_with_global_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_embed_with_global_macro.test deleted file mode 100644 index f06c31c938c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_embed_with_global_macro.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from _self import input %} - -{% embed 'embed' %} - {% block foo %} - {{ input("username") }} - {% endblock %} -{% endembed %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(embed)-- - {% block foo %} - {% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "input" function in "index.twig" at line 6. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test deleted file mode 100644 index 0c89ce62a8f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} -{% endblock %} - -{% block bar %} - {{- linput('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 7. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test deleted file mode 100644 index 27bfbaee1f1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {%- from "macros" import input %} - {{- input('username') }} -{% endblock %} - -{% block bar %} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test deleted file mode 100644 index 168c9b3a902..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from _self import another, foo %} - -{{ foo() }} - -{% macro foo() %} - {{ another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macros_in_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macros_in_parent.test deleted file mode 100644 index 57cff7ab177..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macros_in_parent.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from "macros" import hello %} - -{{ hello() }} ---TEMPLATE(macros)-- -{% extends "parent" %} ---TEMPLATE(parent)-- -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test deleted file mode 100644 index 8ede5db5094..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} - - {% block bar %} - {{- linput('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 6. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test deleted file mode 100644 index 384b02d8fe0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {% block bar %} - {{- input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_recursive.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_recursive.test deleted file mode 100644 index 09a29839d00..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_recursive.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"import" tag ---TEMPLATE-- -{% from _self import recursive_macro %} - -{{ recursive_macro(10) }} - -{% macro recursive_macro(n) %} - {% if n > 0 %} - {{- recursive_macro(n - 1) -}} - {% endif %} - {{- n }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_self_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_self_parent.test deleted file mode 100644 index 2a198711927..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_self_parent.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% extends "parent" %} - -{% block test %} - {{ _self.hello() }} -{% endblock test %} ---TEMPLATE(parent)-- -{% block test %} -Hello -{% endblock test %} - -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test deleted file mode 100644 index 6223cfe947a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from 'forms.twig' %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "import") in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test deleted file mode 100644 index 832740eac56..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} - -{{ foo('foo') }} -{{ foo() }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -fooglobal -fooglobal diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test deleted file mode 100644 index 721f5506a5a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} -{% from _self import input %} - -{% block foo %} - {{- macros.input('username') }} - {{- input('username') }} - - {%- import _self as lmacros %} - {%- from _self import input as linput %} - - {{- lmacros.input('username') }} - {{- linput('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - - - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_embed_with_global_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_embed_with_global_macro.test deleted file mode 100644 index 3609881f0d5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_embed_with_global_macro.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} - -{% embed 'embed' %} - {% block foo %} - {{ macros.input("username") }} - {% endblock %} -{% endembed %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(embed)-- - {% block foo %} - {% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "macros" does not exist in "index.twig" at line 6. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test deleted file mode 100644 index 6c1817be7db..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with a template as string ---TEMPLATE-- -{% import template_from_string("{% macro test() %}ok{% endmacro %}") as m %} -{{ m.test() }} ---TEMPLATE(forms.twig)-- ---DATA-- -return [] ---EXPECT-- -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test deleted file mode 100644 index 9443e122215..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} -{% endblock %} - -{% block bar %} - {{- lmacros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "lmacros" does not exist in "index.twig" at line 7. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test deleted file mode 100644 index 7cf0552f836..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {%- import "macros" as macros %} - {{- macros.input('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test deleted file mode 100644 index 1851f09749b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"import" tag with syntax error ---TEMPLATE-- -{% import _self as foo %} - -{{ foo.foo() }} - -{% macro foo() %} - {{ foo.another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macros_in_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macros_in_parent.test deleted file mode 100644 index d8d5d1639a9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macros_in_parent.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import "macros" as m %} - -{{ m.hello() }} ---TEMPLATE(macros)-- -{% extends "parent" %} ---TEMPLATE(parent)-- -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.test deleted file mode 100644 index 821f64bf75f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} - - {% block bar %} - {{- lmacros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "lmacros" does not exist in "index.twig" at line 6. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.test deleted file mode 100644 index 697d665f84f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {% block bar %} - {{- macros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_same_parent_and_child.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_same_parent_and_child.test deleted file mode 100644 index 8d9b3caa496..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_same_parent_and_child.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -"import" tag ---TEMPLATE-- -{% extends "parent" %} - -{% macro anotherThing() -%} - Do it too -{% endmacro %} - -{% import _self as macros %} -{% block content %} - {{ parent() }} - {{ macros.anotherThing() }} -{% endblock %} ---TEMPLATE(parent)-- -{% macro thing() %} - Do it -{% endmacro %} - -{% import _self as macros %} -{% block content %} - {{ macros.thing() }} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -Do it - - - Do it too diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test deleted file mode 100644 index 24a8cdb50b7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% extends "parent" %} -{% import _self as me %} - -{% block test %} - {{ me.hello() }} -{% endblock test %} ---TEMPLATE(parent)-- -{% import _self as me %} - -{% block test %} -Hello -{% endblock test %} - -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test deleted file mode 100644 index b9817f0eed6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' %} - -{{ macros.parent() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "as") in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test deleted file mode 100644 index ca3157dd884..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test deleted file mode 100644 index 491e91e80d7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"§" as a macro name ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.§('foo') }} - -{% macro §(foo) %} - §{{ foo }}§ -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test deleted file mode 100644 index 643697ce28c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Super globals as macro arguments ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo('foo') }} - -{% macro foo(GET) %} - {{ GET }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test deleted file mode 100644 index b432427e4a6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -{{ [a][0] }} -{{ dump([a][0]) }} ---DATA-- -return ['a' => 'b'] ---CONFIG-- -return ['autoescape' => false, 'debug' => true] ---EXPECT-- -b -string(1) "b" diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test deleted file mode 100644 index e26a78bc157..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - a -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test deleted file mode 100644 index bb2a329715a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - - {% if 1 %} - {%- include "foo.twig" %} - {% endif %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test deleted file mode 100644 index 4d232d8bbd2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %} - {%- include "foo.twig" %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %}{% include "foo.twig" %}{% endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo -foo -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test deleted file mode 100644 index aae1427e810..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = 'foo' %} -{% set bar = 'foo
    ' %} - -{{ foo }} -{{ bar }} - -{% set foo, bar = 'foo', 'bar' %} - -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -foo -foo<br /> - - -foobar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test deleted file mode 100644 index 97fc43cc2ab..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"set" tag block empty capture ---TEMPLATE-- -{% set foo %}{% endset %} - -{% if foo %}FAIL{% endif %} ---DATA-- -return [] ---EXPECT-- diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test deleted file mode 100644 index c3faf250038..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}f
    o
    o{% endset %} - -{{ foo }} ---DATA-- -return [] ---EXPECT-- -f
    o
    o diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test deleted file mode 100644 index bb2bbebaf0e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}{{ foo }}{% endset %} - -{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test deleted file mode 100644 index bd472771a66..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test deleted file mode 100644 index 79e89ce79b7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set bar %}bar{% endset %} - -{% block var_from_child %} - {{- bar -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test deleted file mode 100644 index 2d23c83ae67..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set foo %}bar{% endset %} - -{% block var_from_child %} - {{- foo -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test deleted file mode 100644 index ae388bb873a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = "foo" %} - -{% set bar %} - {%- set foo = "bar" -%} - bar -{% endset %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -bar -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/root_level_in_child.legacy.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/root_level_in_child.legacy.test deleted file mode 100644 index 9ed406e6fb9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/root_level_in_child.legacy.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"spaceless" tag in the root level of a child template ---DEPRECATION-- -The spaceless tag in "index.twig" at line 3 is deprecated since Twig 2.7, use the spaceless filter instead. -Using the spaceless tag at the root level of a child template in "index.twig" at line 3 is deprecated since Twig 2.5.0 and will become a syntax error in 3.0. -Nesting a block definition under a non-capturing node in "index.twig" at line 4 is deprecated since Twig 2.5.0 and will become a syntax error in 3.0. ---TEMPLATE-- -{% extends "layout.twig" %} -{% spaceless %} - {% block content %} -

    - Title -

    - {% endblock %} -{% endspaceless %} ---TEMPLATE(layout.twig)-- -{% block content %}FOO{% endblock %} ---DATA-- -return array() ---EXPECT-- -

    - Title -

    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test deleted file mode 100644 index 8dbe660e5d0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"spaceless" tag removes whites between HTML tags ---DEPRECATION-- -The spaceless tag in "index.twig" at line 2 is deprecated since Twig 2.7, use the spaceless filter instead. ---TEMPLATE-- -{% spaceless %} - -
    foo
    - -{% endspaceless %} ---DATA-- -return [] ---EXPECT-- -
    foo
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test deleted file mode 100644 index 64ffd1d76bf..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom tag ---TEMPLATE-- -{% § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test deleted file mode 100644 index b6b1d5c6688..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" with content as foo %} - -{{ block('foo') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test deleted file mode 100644 index be622a10e20..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" %} - -{{ block('content') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test deleted file mode 100644 index 771ba642b90..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} - -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -foo -foo -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test deleted file mode 100644 index f14ce83de5e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} ---TEMPLATE(bar.twig)-- ---DATA-- -return [] ---EXPECT-- diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test deleted file mode 100644 index 1edeaa1115d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% use "ancestor.twig" %} - -{% block sub_container %} -
    overridden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return [] ---EXPECT-- -
    overridden sub_container
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test deleted file mode 100644 index accec5094b1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "ancestor.twig" %} -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% block sub_container %} -
    overridden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return [] ---EXPECT-- -
    overridden sub_container
    -
    diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test deleted file mode 100644 index 85a63958dfc..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test deleted file mode 100644 index 413bdfa4ddf..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" with content as foo_content %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} -{{ block('foo_content') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar -foo diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test deleted file mode 100644 index 49328f6e87b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' with foobar as base_base_foobar %} -{% block foobar %} - {{- block('base_base_foobar') -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' with foobar as base_foobar %} -{% block foobar %} - {{- block('base_foobar') -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test deleted file mode 100644 index 274baa82166..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig'%} -{% block foobar %} - {{- parent() -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foobar %} - {{- parent() -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test deleted file mode 100644 index f6f221273f2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' %} -{% use 'file1.html.twig' with foo %} -{% block foo %} - {{- parent() -}} - Content of foo (second override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (second override) -{% endblock bar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foo %} - {{- parent() -}} - Content of foo (first override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (first override) -{% endblock bar %} ---TEMPLATE(file1.html.twig)-- -{% block foo -%} - Content of foo -{% endblock foo %} -{% block bar -%} - Content of bar -{% endblock bar %} ---DATA-- -return [] ---EXPECT-- -Content of foo -Content of foo (first override) -Content of foo (second override) -Content of bar -Content of bar (second override) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test deleted file mode 100644 index fad9a2d1896..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag with a parent block ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use 'blocks.twig' %} - -{% block body %} - {{ parent() -}} - CHILD - {{ block('content') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block body %} - PARENT -{% endblock %} ---TEMPLATE(blocks.twig)-- -{% block content 'BLOCK' %} ---DATA-- -return [] ---EXPECT-- -PARENT -CHILD - BLOCK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test deleted file mode 100644 index 9b60abc49fd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endverbatim %} ---DATA-- -return [] ---EXPECT-- -{{ foo }} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test deleted file mode 100644 index 501922bddd2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -1*** - -{%- verbatim %} - {{ 'bla' }} -{% endverbatim %} - -1*** -2*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim %} - -2*** -3*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim -%} - -3*** -4*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim %} - -4*** -5*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim -%} - -5*** ---DATA-- -return [] ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test deleted file mode 100644 index 7c2abd0f9bb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with %} - {% set bar = 'BAZ' %} - {{ foo }}{{ bar }} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -fooBAZ -foobar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test deleted file mode 100644 index e4433d44c8c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['foo' => 'baz'] ---EXPECT-- -fooBAZ diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test deleted file mode 100644 index b030e7eff3f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with [] only %} - {{ global }} -{% endwith %} ---DATA-- -return [] ---EXPECT-- -global diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test deleted file mode 100644 index 1b0cbc63e5e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an iterable expression ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => new ArrayObject(['foo' => 'baz', 'bar' => 'qux'])] ---EXPECT-- -bazqux diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test deleted file mode 100644 index 33ca390b2a8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -nested "with" tags ---TEMPLATE-- -{% set foo, bar = 'foo', 'bar' %} -{% with {bar: 'BAZ'} %} - {% with {foo: 'FOO'} %} - {{ foo }}{{ bar }} - {% endwith %} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -FOOBAZ - foobar diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test deleted file mode 100644 index 7083050b42e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an expression that is not a hash ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => 'no-hash'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variables passed to the "with" tag must be a hash in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test deleted file mode 100644 index 1aca34fc155..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression and only ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} only %} - {{ foo }}{{ bar }}{{ baz }} -{% endwith %} ---DATA-- -return ['foo' => 'baz', 'baz' => 'baz'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "baz" does not exist in "index.twig" at line 3. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test deleted file mode 100644 index 7c9a6c80aa9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -array index test ---TEMPLATE-- -{% for key, value in days %} -{{ key }} -{% endfor %} ---DATA-- -return ['days' => [ - 1 => ['money' => 9], - 2 => ['money' => 21], - 3 => ['money' => 38], - 4 => ['money' => 6], - 18 => ['money' => 6], - 19 => ['money' => 3], - 31 => ['money' => 11], -]] ---EXPECT-- -1 -2 -3 -4 -18 -19 -31 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test deleted file mode 100644 index 0fa4b37040d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"const" test ---TEMPLATE-- -{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} -{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} ---DATA-- -return ['value' => 'bar', 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test deleted file mode 100644 index 879c651e159..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -"defined" test ---TEMPLATE-- -{{ definedVar is defined ? 'ok' : 'ko' }} -{{ definedVar is not defined ? 'ko' : 'ok' }} -{{ undefinedVar is defined ? 'ko' : 'ok' }} -{{ undefinedVar is not defined ? 'ok' : 'ko' }} -{{ zeroVar is defined ? 'ok' : 'ko' }} -{{ nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is defined ? 'ok' : 'ko' }} -{{ nested['definedVar'] is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is not defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is defined ? 'ko' : 'ok' }} -{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} -{{ nested.zeroVar is defined ? 'ok' : 'ko' }} -{{ nested.nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} -{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} -{{ object.foo is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.getFoo() is defined ? 'ok' : 'ko' }} -{{ object.getFoo('a') is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} -{{ object.self.foo is defined ? 'ok' : 'ko' }} -{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} -{{ 0 is defined ? 'ok' : 'ko' }} -{{ "foo" is defined ? 'ok' : 'ko' }} -{{ true is defined ? 'ok' : 'ko' }} -{{ false is defined ? 'ok' : 'ko' }} -{{ null is defined ? 'ok' : 'ko' }} -{{ [1, 2] is defined ? 'ok' : 'ko' }} -{{ { foo: "bar" } is defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test deleted file mode 100644 index 5fd2fe3f2d2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"defined" support for attribute ---TEMPLATE-- -{{ attribute(nested, "definedVar") is defined ? 'ok' : 'ko' }} -{{ attribute(nested, "undefinedVar") is not defined ? 'ok' : 'ko' }} -{{ attribute(nested, definedVarName) is defined ? 'ok' : 'ko' }} -{{ attribute(nested, undefinedVarName) is not defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---EXPECT-- -ok -ok -ok -ok ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test deleted file mode 100644 index c8b90f8c9c4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"defined" support for blocks ---TEMPLATE-- -{% extends 'parent' %} -{% block icon %}icon{% endblock %} -{% block body %} - {{ parent() }} - {{ block('foo') is defined ? 'ok' : 'ko' }} - {{ block('footer') is defined ? 'ok' : 'ko' }} - {{ block('icon') is defined ? 'ok' : 'ko' }} - {{ block('block1') is defined ? 'ok' : 'ko' }} - {%- embed 'embed' %} - {% block content %}content{% endblock %} - {% endembed %} -{% endblock %} -{% use 'blocks' %} ---TEMPLATE(parent)-- -{% block body %} - {{ block('icon') is defined ? 'ok' : 'ko' -}} -{% endblock %} -{% block footer %}{% endblock %} ---TEMPLATE(embed)-- -{{ block('icon') is defined ? 'ok' : 'ko' }} -{{ block('content') is defined ? 'ok' : 'ko' }} -{{ block('block1') is defined ? 'ok' : 'ko' }} ---TEMPLATE(blocks)-- -{% block block1 %}{%endblock %} ---DATA-- -return [] ---EXPECT-- -ok - ko - ok - ok - ok -ko -ok -ko diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test deleted file mode 100644 index 68540de7aa3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"defined" support for blocks with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded) is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded_internal) is defined ? 'ok' : 'ko' }} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test deleted file mode 100644 index 62172e4f1f5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"defined" support for constants ---TEMPLATE-- -{{ constant('DATE_W3C') is defined ? 'ok' : 'ko' }} -{{ constant('ARRAY_AS_PROPS', object) is defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR') is not defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR', object) is not defined ? 'ok' : 'ko' }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_macros.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_macros.test deleted file mode 100644 index 1aa45fc8268..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_macros.test +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -"defined" support for macros ---TEMPLATE-- -{% import _self as macros %} -{% from _self import hello, bar %} - -{% if macros.hello is defined -%} - OK -{% endif %} - -{% if macros.foo is not defined -%} - OK -{% endif %} - -{% if hello is defined -%} - OK -{% endif %} - -{% if bar is not defined -%} - OK -{% endif %} - -{% if foo is not defined -%} - OK -{% endif %} - -{% macro hello(name) %} - Hello {{ name }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -OK - -OK - -OK - -OK - -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test deleted file mode 100644 index 2d0615832f4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"defined" support for "complex" expressions ---TEMPLATE-- -{{ (1 + 2) is defined ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "defined" test only works with simple variables in "index.twig" at line 2. diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test deleted file mode 100644 index 41625f6af1e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -dynamic test ---TEMPLATE-- -{{ 'bar' is test_bar ? '1' :'0' }} -{{ 'foo' is test_foo ? '1' :'0' }} -{{ 'bar' is test_foo ? '1' :'0' }} -{{ 'foo' is test_bar ? '1' :'0' }} ---DATA-- -return [] ---EXPECT-- -1 -1 -0 -0 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test deleted file mode 100644 index 3e7fcf01837..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"empty" test ---TEMPLATE-- -{{ string_empty is empty ? 'ok' : 'ko' }} -{{ string_zero is empty ? 'ko' : 'ok' }} -{{ value_null is empty ? 'ok' : 'ko' }} -{{ value_false is empty ? 'ok' : 'ko' }} -{{ value_int_zero is empty ? 'ko' : 'ok' }} -{{ array_empty is empty ? 'ok' : 'ko' }} -{{ array_not_empty is empty ? 'ko' : 'ok' }} -{{ magically_callable is empty ? 'ko' : 'ok' }} -{{ countable_empty is empty ? 'ok' : 'ko' }} -{{ countable_not_empty is empty ? 'ko' : 'ok' }} -{{ tostring_empty is empty ? 'ok' : 'ko' }} -{{ tostring_not_empty is empty ? 'ko' : 'ok' }} -{{ markup_empty is empty ? 'ok' : 'ko' }} -{{ markup_not_empty is empty ? 'ko' : 'ok' }} ---DATA-- -return [ - 'string_empty' => '', 'string_zero' => '0', - 'value_null' => null, 'value_false' => false, 'value_int_zero' => 0, - 'array_empty' => [], 'array_not_empty' => [1, 2], - 'magically_callable' => new MagicCallStub(), - 'countable_empty' => new CountableStub([]), 'countable_not_empty' => new CountableStub([1, 2]), - 'tostring_empty' => new ToStringStub(''), 'tostring_not_empty' => new ToStringStub('0' /* edge case of using "0" as the string */), - 'markup_empty' => new \Twig\Markup('', 'UTF-8'), 'markup_not_empty' => new \Twig\Markup('test', 'UTF-8'), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test deleted file mode 100644 index 5c73b01e908..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"even" test ---TEMPLATE-- -{{ 1 is even ? 'ko' : 'ok' }} -{{ 2 is even ? 'ok' : 'ko' }} -{{ 1 is not even ? 'ok' : 'ko' }} -{{ 2 is not even ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok -ok -ok diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test deleted file mode 100644 index f84465ee325..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Twig supports the in operator ---TEMPLATE-- -{{ bar in foo ? 'OK' : 'KO' }} -{{ not (bar in foo) ? 'KO' : 'OK' }} -{{ bar not in foo ? 'KO' : 'OK' }} -{{ 'a' in bar ? 'OK' : 'KO' }} -{{ 'c' not in bar ? 'OK' : 'KO' }} -{{ '' in bar ? 'OK' : 'KO' }} -{{ '' in '' ? 'OK' : 'KO' }} -{{ '0' not in '' ? 'OK' : 'KO' }} -{{ 'a' not in '0' ? 'OK' : 'KO' }} -{{ '0' in '0' ? 'OK' : 'KO' }} - -{{ false in [0, 1] ? 'OK' : 'KO' }} -{{ true in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [1, 0] ? 'OK' : 'KO' }} -{{ '' in [0, 1] ? 'OK' : 'KO' }} -{{ '' in [1, 0] ? 'OK' : 'KO' }} -{{ 0 in ['', 1] ? 'OK' : 'KO' }} -{{ 0 in [1, ''] ? 'OK' : 'KO' }} - -{{ '' in 'foo' ? 'OK' : 'KO' }} -{{ 0 in 'foo' ? 'KO' : 'OK' }} -{{ false in 'foo' ? 'KO' : 'OK' }} -{{ false in '100' ? 'KO' : 'OK' }} -{{ true in '100' ? 'KO' : 'OK' }} - -{{ [] in [true, false] ? 'OK' : 'KO' }} -{{ [] in [true, ''] ? 'KO' : 'OK' }} -{{ [] in [true, []] ? 'OK' : 'KO' }} - -{{ resource ? 'OK' : 'KO' }} -{{ resource in 'foo'~resource ? 'KO' : 'OK' }} -{{ object in 'stdClass' ? 'KO' : 'OK' }} -{{ [] in 'Array' ? 'KO' : 'OK' }} -{{ dir_object in 'foo'~dir_object ? 'KO' : 'OK' }} - -{{ ''~resource in resource ? 'KO' : 'OK' }} -{{ 'stdClass' in object ? 'KO' : 'OK' }} -{{ 'Array' in [] ? 'KO' : 'OK' }} -{{ ''~dir_object in dir_object ? 'KO' : 'OK' }} - -{{ resource in [''~resource] ? 'KO' : 'OK' }} -{{ resource in [resource + 1 - 1] ? 'KO' : 'OK' }} -{{ dir_object in [''~dir_object] ? 'KO' : 'OK' }} - -{{ 5 in 125 ? 'KO' : 'OK' }} -{{ 5 in '125' ? 'OK' : 'KO' }} -{{ '5' in 125 ? 'KO' : 'OK' }} -{{ '5' in '125' ? 'OK' : 'KO' }} - -{{ 5.5 in 125.5 ? 'KO' : 'OK' }} -{{ 5.5 in '125.5' ? 'OK' : 'KO' }} -{{ '5.5' in 125.5 ? 'KO' : 'OK' }} - -{{ safe in ['foo', 'bar'] ? 'OK' : 'KO' }} -{{ 'fo' in safe ? 'OK' : 'KO' }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'dir_object' => new \SplFileInfo(__DIR__), 'object' => new \stdClass(), 'resource' => opendir(__DIR__), 'safe' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test deleted file mode 100644 index b53eb067bd9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig supports the in operator when using objects ---TEMPLATE-- -{% if object in object_list %} -TRUE -{% endif %} ---DATA-- -$foo = new TwigTestFoo(); -$foo1 = new TwigTestFoo(); - -$foo->position = $foo1; -$foo1->position = $foo; - -return [ - 'object' => $foo, - 'object_list' => [$foo1, $foo], -] ---EXPECT-- -TRUE diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test deleted file mode 100644 index 75b5756e1e6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"iterable" test ---TEMPLATE-- -{{ foo is iterable ? 'ok' : 'ko' }} -{{ traversable is iterable ? 'ok' : 'ko' }} -{{ obj is iterable ? 'ok' : 'ko' }} -{{ val is iterable ? 'ok' : 'ko' }} ---DATA-- -return [ - 'foo' => [], - 'traversable' => new \ArrayIterator([]), - 'obj' => new \stdClass(), - 'val' => 'test', -] ---EXPECT-- -ok -ok -ko -ko \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test deleted file mode 100644 index 7af3255d61d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Twig supports the ?? operator ---TEMPLATE-- -{{ 'OK' ?? 'KO' }} -{{ null ?? 'OK' }} -{{ bar ?? 'KO' }} -{{ baz ?? 'OK' }} -{{ foo.bar ?? 'KO' }} -{{ foo.missing ?? 'OK' }} -{{ foo.bar.baz.missing ?? 'OK' }} -{{ foo['bar'] ?? 'KO' }} -{{ foo['missing'] ?? 'OK' }} -{{ nope ?? nada ?? 'OK' }} -{{ 1 + nope ?? nada ?? 2 }} -{{ 1 + nope ?? 3 + nada ?? 2 }} ---DATA-- -return ['bar' => 'OK', 'foo' => ['bar' => 'OK']] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -3 -6 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test deleted file mode 100644 index ec88bb519c1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"odd" test ---TEMPLATE-- -{{ 1 is odd ? 'ok' : 'ko' }} -{{ 2 is odd ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok \ No newline at end of file diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test deleted file mode 100644 index 346a11076c3..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Whitespace trimming on tags. ---TEMPLATE-- -Trim on control tag: -{% for i in range(1, 9) -%} - {{ i }} -{%- endfor %} - - -Trim on output tag: -{% for i in range(1, 9) %} - {{- i -}} -{% endfor %} - - -Trim comments: - -{#- Invisible -#} - -After the comment. - -Trim leading space: -{% if leading %} - - {{- leading }} -{% endif %} - -{%- if leading %} - {{- leading }} - -{%- endif %} - - -Trim trailing space: -{% if trailing -%} - {{ trailing -}} - -{% endif -%} - -Combined: - -{%- if both -%} -
      -
    • {{- both -}}
    • -
    - -{%- endif -%} - -end ---DATA-- -return ['leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both'] ---EXPECT-- -Trim on control tag: -123456789 - -Trim on output tag: -123456789 - -Trim comments:After the comment. - -Trim leading space: -leading space -leading space - -Trim trailing space: -trailing spaceCombined:
      -
    • both
    • -
    end diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test deleted file mode 100644 index a58818dde47..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Whitespace trimming as strings. ---TEMPLATE-- -{{ 5 * '{#-'|length }} -{{ '{{-'|length * 5 + '{%-'|length }} ---DATA-- -return [] ---EXPECT-- -15 -18 diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test deleted file mode 100644 index 75d0f803193..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - - {%- endif %}** - -** - - {{- 'foo' }}** - -** - - -{#- comment #}** - -**{% verbatim %} -foo - - {%- endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -** -foo** diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test deleted file mode 100644 index e5e845f08b7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - {%~ endif %}** - -** - {{~ 'foo' }}** - -** - {#~ comment #}** - -**{% verbatim %} -foo - - {%~ endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo -** - -** -foo** - -** -** - -** -foo - -** diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test deleted file mode 100644 index e7b510c85d8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true ~%} -foo{% endif %}** - -**{{ 'foo' ~}} -foo -** - -**{# comment ~#} - foo -** - -**{% verbatim ~%} - foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -** -foo** - -**foo -foo -** - -** - foo -** - -** - foo** diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test deleted file mode 100644 index 0ec3b0ceaa9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true -%} - - foo{% endif %}** - -**{{ 'foo' -}} - -** - -**{# comment -#} - -** - -**{% verbatim -%} - -foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -**foo** diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php deleted file mode 100644 index 6bd727b1ede..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +++ /dev/null @@ -1,386 +0,0 @@ -position = 0; - } - - public function current() - { - return $this->array[$this->position]; - } - - public function key() - { - return 'a'; - } - - public function next() - { - ++$this->position; - } - - public function valid() - { - return isset($this->array[$this->position]); - } -} - -class TwigTestTokenParser_§ extends AbstractTokenParser -{ - public function parse(Token $token) - { - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new PrintNode(new ConstantExpression('§', -1), -1); - } - - public function getTag() - { - return '§'; - } -} - -class TwigTestExtension extends AbstractExtension -{ - public function getTokenParsers() - { - return [ - new TwigTestTokenParser_§(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('§', [$this, '§Filter']), - new TwigFilter('escape_and_nl2br', [$this, 'escape_and_nl2br'], ['needs_environment' => true, 'is_safe' => ['html']]), - new TwigFilter('nl2br', [$this, 'nl2br'], ['pre_escape' => 'html', 'is_safe' => ['html']]), - new TwigFilter('escape_something', [$this, 'escape_something'], ['is_safe' => ['something']]), - new TwigFilter('preserves_safety', [$this, 'preserves_safety'], ['preserves_safety' => ['html']]), - new TwigFilter('static_call_string', 'TwigTestExtension::staticCall'), - new TwigFilter('static_call_array', ['TwigTestExtension', 'staticCall']), - new TwigFilter('magic_call', [$this, 'magicCall']), - new TwigFilter('magic_call_string', 'TwigTestExtension::magicStaticCall'), - new TwigFilter('magic_call_array', ['TwigTestExtension', 'magicStaticCall']), - new TwigFilter('*_path', [$this, 'dynamic_path']), - new TwigFilter('*_foo_*_bar', [$this, 'dynamic_foo']), - new TwigFilter('anon_foo', function ($name) { return '*'.$name.'*'; }), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('§', [$this, '§Function']), - new TwigFunction('safe_br', [$this, 'br'], ['is_safe' => ['html']]), - new TwigFunction('unsafe_br', [$this, 'br']), - new TwigFunction('static_call_string', 'TwigTestExtension::staticCall'), - new TwigFunction('static_call_array', ['TwigTestExtension', 'staticCall']), - new TwigFunction('*_path', [$this, 'dynamic_path']), - new TwigFunction('*_foo_*_bar', [$this, 'dynamic_foo']), - new TwigFunction('anon_foo', function ($name) { return '*'.$name.'*'; }), - ]; - } - - public function getTests() - { - return [ - new TwigTest('multi word', [$this, 'is_multi_word']), - new TwigTest('test_*', [$this, 'dynamic_test']), - ]; - } - - public function §Filter($value) - { - return "§{$value}§"; - } - - public function §Function($value) - { - return "§{$value}§"; - } - - /** - * nl2br which also escapes, for testing escaper filters. - */ - public function escape_and_nl2br($env, $value, $sep = '
    ') - { - return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); - } - - /** - * nl2br only, for testing filters with pre_escape. - */ - public function nl2br($value, $sep = '
    ') - { - // not secure if $value contains html tags (not only entities) - // don't use - return str_replace("\n", "$sep\n", $value); - } - - public function dynamic_path($element, $item) - { - return $element.'/'.$item; - } - - public function dynamic_foo($foo, $bar, $item) - { - return $foo.'/'.$bar.'/'.$item; - } - - public function dynamic_test($element, $item) - { - return $element === $item; - } - - public function escape_something($value) - { - return strtoupper($value); - } - - public function preserves_safety($value) - { - return strtoupper($value); - } - - public static function staticCall($value) - { - return "*$value*"; - } - - public function br() - { - return '
    '; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function __call($method, $arguments) - { - if ('magicCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __call'); - } - - return 'magic_'.$arguments[0]; - } - - public static function __callStatic($method, $arguments) - { - if ('magicStaticCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __callStatic'); - } - - return 'static_magic_'.$arguments[0]; - } -} - -/** - * This class is used in tests for the "length" filter and "empty" test. It asserts that __call is not - * used to convert such objects to strings. - */ -class MagicCallStub -{ - public function __call($name, $args) - { - throw new \Exception('__call shall not be called'); - } -} - -class ToStringStub -{ - /** - * @var string - */ - private $string; - - public function __construct($string) - { - $this->string = $string; - } - - public function __toString() - { - return $this->string; - } -} - -/** - * This class is used in tests for the length filter and empty test to show - * that when \Countable is implemented, it is preferred over the __toString() - * method. - */ -class CountableStub implements \Countable -{ - private $count; - - public function __construct($count) - { - $this->count = $count; - } - - public function count() - { - return $this->count; - } - - public function __toString() - { - throw new \Exception('__toString shall not be called on \Countables'); - } -} - -/** - * This class is used in tests for the length filter. - */ -class IteratorAggregateStub implements \IteratorAggregate -{ - private $data; - - public function __construct(array $data) - { - $this->data = $data; - } - - public function getIterator() - { - return new \ArrayIterator($this->data); - } -} - -class SimpleIteratorForTesting implements Iterator -{ - private $data = [1, 2, 3, 4, 5, 6, 7]; - private $key = 0; - - public function current() - { - return $this->key; - } - - public function next() - { - ++$this->key; - } - - public function key() - { - return $this->key; - } - - public function valid() - { - return isset($this->data[$this->key]); - } - - public function rewind() - { - $this->key = 0; - } - - public function __toString() - { - // for testing, make sure string length returned is not the same as the `iterator_count` - return str_repeat('X', iterator_count($this) + 10); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/LexerTest.php deleted file mode 100644 index 9aff56580ab..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/LexerTest.php +++ /dev/null @@ -1,370 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::BLOCK_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testNameLabelForFunction() - { - $template = '{{ §() }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::VAR_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testBracketsNesting() - { - $template = '{{ {"a":{"b":"c"}} }}'; - - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '{')); - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '}')); - } - - protected function countToken($template, $type, $value = null) - { - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $count = 0; - while (!$stream->isEOF()) { - $token = $stream->next(); - if ($type === $token->getType()) { - if (null === $value || $value === $token->getValue()) { - ++$count; - } - } - } - - return $count; - } - - public function testLineDirective() - { - $template = "foo\n" - ."bar\n" - ."{% line 10 %}\n" - ."{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar\n - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // \n (after {% line %}) - $this->assertSame(10, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(11, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(12, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLineDirectiveInline() - { - $template = "foo\n" - ."bar{% line 10 %}{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(10, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(11, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLongComments() - { - $template = '{# '.str_repeat('*', 100000).' #}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVerbatim() - { - $template = '{% verbatim %}'.str_repeat('*', 100000).'{% endverbatim %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVar() - { - $template = '{{ '.str_repeat('x', 100000).' }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongBlock() - { - $template = '{% '.str_repeat('x', 100000).' %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testBigNumbers() - { - $template = '{{ 922337203685477580700 }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->next(); - $node = $stream->next(); - $this->assertEquals('922337203685477580700', $node->getValue()); - } - - public function testStringWithEscapedDelimiter() - { - $tests = [ - "{{ 'foo \' bar' }}" => 'foo \' bar', - '{{ "foo \" bar" }}' => 'foo " bar', - ]; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - foreach ($tests as $template => $expected) { - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, $expected); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - } - - public function testStringWithInterpolation() - { - $template = 'foo {{ "bar #{ baz + 1 }" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::TEXT_TYPE, 'foo '); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'baz'); - $stream->expect(Token::OPERATOR_TYPE, '+'); - $stream->expect(Token::NUMBER_TYPE, '1'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithEscapedInterpolation() - { - $template = '{{ "bar \#{baz+1}" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar #{baz+1}'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithHash() - { - $template = '{{ "bar # baz" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar # baz'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed """ - */ - public function testStringWithUnterminatedInterpolation() - { - $template = '{{ "bar #{x" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testStringWithNestedInterpolations() - { - $template = '{{ "bar #{ "foo#{bar}" }" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithNestedInterpolationsInBlock() - { - $template = '{% foo "bar #{ "foo#{bar}" }" %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'foo'); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testOperatorEndingWithALetterAtTheEndOfALine() - { - $template = "{{ 1 and\n0}}"; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NUMBER_TYPE, 1); - $stream->expect(Token::OPERATOR_TYPE, 'and'); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed "variable" in "index" at line 3 - */ - public function testUnterminatedVariable() - { - $template = ' - -{{ - -bar - - -'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed "block" in "index" at line 3 - */ - public function testUnterminatedBlock() - { - $template = ' - -{% - -bar - - -'; - - $lexer = new Lexer(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testOverridingSyntax() - { - $template = '[# comment #]{# variable #}/# if true #/true/# endif #/'; - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), [ - 'tag_comment' => ['[#', '#]'], - 'tag_block' => ['/#', '#/'], - 'tag_variable' => ['{#', '#}'], - ]); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'variable'); - $stream->expect(Token::VAR_END_TYPE); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'if'); - $stream->expect(Token::NAME_TYPE, 'true'); - $stream->expect(Token::BLOCK_END_TYPE); - $stream->expect(Token::TEXT_TYPE, 'true'); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'endif'); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php deleted file mode 100644 index 8adfbe67694..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +++ /dev/null @@ -1,88 +0,0 @@ -getSourceContext('foo'); - } - - public function testGetCacheKey() - { - $loader = new ArrayLoader(['foo' => 'bar']); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - } - - public function testGetCacheKeyWhenTemplateHasDuplicateContent() - { - $loader = new ArrayLoader([ - 'foo' => 'bar', - 'baz' => 'bar', - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('baz:bar', $loader->getCacheKey('baz')); - } - - public function testGetCacheKeyIsProtectedFromEdgeCollisions() - { - $loader = new ArrayLoader([ - 'foo__' => 'bar', - 'foo' => '__bar', - ]); - - $this->assertEquals('foo__:bar', $loader->getCacheKey('foo__')); - $this->assertEquals('foo:__bar', $loader->getCacheKey('foo')); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testSetTemplate() - { - $loader = new ArrayLoader([]); - $loader->setTemplate('foo', 'bar'); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testIsFresh() - { - $loader = new ArrayLoader(['foo' => 'bar']); - $this->assertTrue($loader->isFresh('foo', time())); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testIsFreshWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->isFresh('foo', time()); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php deleted file mode 100644 index a71cc96db31..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +++ /dev/null @@ -1,95 +0,0 @@ - 'bar']), - new ArrayLoader(['errors/index.html' => 'baz']), - new FilesystemLoader([$path]), - ]); - - $this->assertEquals('foo', $loader->getSourceContext('foo')->getName()); - $this->assertSame('', $loader->getSourceContext('foo')->getPath()); - - $this->assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertSame('', $loader->getSourceContext('errors/index.html')->getPath()); - $this->assertEquals('baz', $loader->getSourceContext('errors/index.html')->getCode()); - - $this->assertEquals('errors/base.html', $loader->getSourceContext('errors/base.html')->getName()); - $this->assertEquals(realpath($path.'/errors/base.html'), realpath($loader->getSourceContext('errors/base.html')->getPath())); - $this->assertNotEquals('baz', $loader->getSourceContext('errors/base.html')->getCode()); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetSourceContextWhenTemplateDoesNotExist() - { - $loader = new ChainLoader([]); - - $loader->getSourceContext('foo'); - } - - public function testGetCacheKey() - { - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['foo' => 'foobar', 'bar' => 'foo']), - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('bar:foo', $loader->getCacheKey('bar')); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new ChainLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testAddLoader() - { - $loader = new ChainLoader(); - $loader->addLoader(new ArrayLoader(['foo' => 'bar'])); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testExists() - { - $loader1 = $this->getMockBuilder(LoaderInterface::class)->getMock(); - $loader1->expects($this->once())->method('exists')->willReturn(false); - $loader1->expects($this->never())->method('getSourceContext'); - - $loader2 = $this->getMockBuilder(LoaderInterface::class)->getMock(); - $loader2->expects($this->once())->method('exists')->willReturn(true); - $loader2->expects($this->never())->method('getSourceContext'); - - $loader = new ChainLoader(); - $loader->addLoader($loader1); - $loader->addLoader($loader2); - - $this->assertTrue($loader->exists('foo')); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php deleted file mode 100644 index 92fea82b499..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +++ /dev/null @@ -1,242 +0,0 @@ -assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertEquals(realpath($path.'/errors/index.html'), realpath($loader->getSourceContext('errors/index.html')->getPath())); - } - - /** - * @dataProvider getSecurityTests - */ - public function testSecurity($template) - { - $loader = new FilesystemLoader([__DIR__.'/../Fixtures']); - - try { - $loader->getCacheKey($template); - $this->fail(); - } catch (LoaderError $e) { - $this->assertNotContains('Unable to find template', $e->getMessage()); - } - } - - public function getSecurityTests() - { - return [ - ["AutoloaderTest\0.php"], - ['..\\AutoloaderTest.php'], - ['..\\\\\\AutoloaderTest.php'], - ['../AutoloaderTest.php'], - ['..////AutoloaderTest.php'], - ['./../AutoloaderTest.php'], - ['.\\..\\AutoloaderTest.php'], - ['././././././../AutoloaderTest.php'], - ['.\\./.\\./.\\./../AutoloaderTest.php'], - ['foo/../../AutoloaderTest.php'], - ['foo\\..\\..\\AutoloaderTest.php'], - ['foo/../bar/../../AutoloaderTest.php'], - ['foo/bar/../../../AutoloaderTest.php'], - ['filters/../../AutoloaderTest.php'], - ['filters//..//..//AutoloaderTest.php'], - ['filters\\..\\..\\AutoloaderTest.php'], - ['filters\\\\..\\\\..\\\\AutoloaderTest.php'], - ['filters\\//../\\/\\..\\AutoloaderTest.php'], - ['/../AutoloaderTest.php'], - ]; - } - - /** - * @dataProvider getBasePaths - */ - public function testPaths($basePath, $cacheKey, $rootPath) - { - $loader = new FilesystemLoader([$basePath.'/normal', $basePath.'/normal_bis'], $rootPath); - $loader->setPaths([$basePath.'/named', $basePath.'/named_bis'], 'named'); - $loader->addPath($basePath.'/named_ter', 'named'); - $loader->addPath($basePath.'/normal_ter'); - $loader->prependPath($basePath.'/normal_final'); - $loader->prependPath($basePath.'/named/../named_quater', 'named'); - $loader->prependPath($basePath.'/named_final', 'named'); - - $this->assertEquals([ - $basePath.'/normal_final', - $basePath.'/normal', - $basePath.'/normal_bis', - $basePath.'/normal_ter', - ], $loader->getPaths()); - $this->assertEquals([ - $basePath.'/named_final', - $basePath.'/named/../named_quater', - $basePath.'/named', - $basePath.'/named_bis', - $basePath.'/named_ter', - ], $loader->getPaths('named')); - - // do not use realpath here as it would make the test unuseful - $this->assertEquals($cacheKey, str_replace('\\', '/', $loader->getCacheKey('@named/named_absolute.html'))); - $this->assertEquals("path (final)\n", $loader->getSourceContext('index.html')->getCode()); - $this->assertEquals("path (final)\n", $loader->getSourceContext('@__main__/index.html')->getCode()); - $this->assertEquals("named path (final)\n", $loader->getSourceContext('@named/index.html')->getCode()); - } - - public function getBasePaths() - { - return [ - [ - __DIR__.'/Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - __DIR__.'/Fixtures/../Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - 'test/Twig/Tests/Loader/Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - getcwd(), - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/test/Twig/Tests/Loader', - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/test/../test/Twig/Tests/Loader', - ], - ]; - } - - public function testEmptyConstructor() - { - $loader = new FilesystemLoader(); - $this->assertEquals([], $loader->getPaths()); - } - - public function testGetNamespaces() - { - $loader = new FilesystemLoader(sys_get_temp_dir()); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE], $loader->getNamespaces()); - - $loader->addPath(sys_get_temp_dir(), 'named'); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE, 'named'], $loader->getNamespaces()); - } - - public function testFindTemplateExceptionNamespace() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - try { - $loader->getSourceContext('@named/nowhere.html'); - } catch (\Exception $e) { - $this->assertInstanceOf(LoaderError::class, $e); - $this->assertContains('Unable to find template "@named/nowhere.html"', $e->getMessage()); - } - } - - public function testFindTemplateWithCache() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - // prime the cache for index.html in the named namespace - $namedSource = $loader->getSourceContext('@named/index.html')->getCode(); - $this->assertEquals("named path\n", $namedSource); - - // get index.html from the main namespace - $this->assertEquals("path\n", $loader->getSourceContext('index.html')->getCode()); - } - - public function testLoadTemplateAndRenderBlockWithCache() - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/themes/theme2'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1', 'default_theme'); - - $twig = new Environment($loader); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 1', $template->renderBlock('b1', [])); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 2', $template->renderBlock('b2', [])); - } - - public function getArrayInheritanceTests() - { - return [ - 'valid array inheritance' => ['array_inheritance_valid_parent.html.twig'], - 'array inheritance with null first template' => ['array_inheritance_null_parent.html.twig'], - 'array inheritance with empty first template' => ['array_inheritance_empty_parent.html.twig'], - 'array inheritance with non-existent first template' => ['array_inheritance_nonexistent_parent.html.twig'], - ]; - } - - /** - * @dataProvider getArrayInheritanceTests - * - * @param $templateName string Template name with array inheritance - */ - public function testArrayInheritance($templateName) - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/inheritance'); - - $twig = new Environment($loader); - - $template = $twig->load($templateName); - $this->assertSame('VALID Child', $template->renderBlock('body', [])); - } - - public function testLoadTemplateFromPhar() - { - $loader = new FilesystemLoader([]); - // phar-sample.phar was created with the following script: - // $f = new Phar('phar-test.phar'); - // $f->addFromString('hello.twig', 'hello from phar'); - $loader->addPath('phar://'.__DIR__.'/Fixtures/phar/phar-sample.phar'); - $this->assertSame('hello from phar', $loader->getSourceContext('hello.twig')->getCode()); - } - - public function testTemplateExistsAlwaysReturnsBool() - { - $loader = new FilesystemLoader([]); - $this->assertFalse($loader->exists("foo\0.twig")); - $this->assertFalse($loader->exists('../foo.twig')); - $this->assertFalse($loader->exists('@foo')); - $this->assertFalse($loader->exists('foo')); - $this->assertFalse($loader->exists('@foo/bar.twig')); - - $loader->addPath(__DIR__.'/Fixtures/normal'); - $this->assertTrue($loader->exists('index.html')); - $loader->addPath(__DIR__.'/Fixtures/normal', 'foo'); - $this->assertTrue($loader->exists('@foo/index.html')); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig deleted file mode 100644 index 6977ebf66cd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig deleted file mode 100644 index 5b50a8b211c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['nonexistent.html.twig','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig deleted file mode 100644 index a16b3adedb8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends [null,'parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig deleted file mode 100644 index 4940dad4167..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['parent.html.twig','spare_parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig deleted file mode 100644 index d594c0ed49d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}VALID{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig deleted file mode 100644 index 70b7360a2c0..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}SPARE PARENT{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html deleted file mode 100644 index 9e5449c7c50..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html +++ /dev/null @@ -1 +0,0 @@ -named path diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html deleted file mode 100644 index d3a272b19d6..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (bis) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html deleted file mode 100644 index 9f05d15075c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (final) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html deleted file mode 100644 index b1fb5f5d7ca..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html +++ /dev/null @@ -1 +0,0 @@ -named path (quater) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html deleted file mode 100644 index 24fb68ad2e9..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (ter) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html deleted file mode 100644 index e7a8fd4d0a8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html +++ /dev/null @@ -1 +0,0 @@ -path diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html deleted file mode 100644 index bfa916049ff..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -path (bis) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html deleted file mode 100644 index 73a089bbda5..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html +++ /dev/null @@ -1 +0,0 @@ -path (final) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html deleted file mode 100644 index b7ad97d8f48..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -path (ter) diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar deleted file mode 100644 index 092bbfae3e4c98b308dc98bf7653ead68ae3ee6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6786 zcmb_hOLN=E5q5IqWh?g_#w@G>Mx-dx&rq@~*-JkvlEqM5ZLJv>0s=!4E4&r}B}(hP zu&2!Q zBabh)K{9u1HGj%1KeC-Pb*?NknLDZ3WLchaC$wigw=YvCNqCxBjRw1SkGX-9Wj0^> zS)N(uK(g;(@4Ff;dObhNdFt{cf9VJO@V}w zadTVhIUOAiN4vF@=ZiGjt$i4sBa?mjz}5||unkU5M`lALde!||Y~|^KBX%S7L!RM;DW<2Eh9F$qo(Np_{kp$|P=Z;JZ%l z$5DIP`o_6%GB@>;oK%Lsr_$prJU?!WwWLdxx5%-|y&_{t%<+X}#s{Cbzg_t5d5&Tf zd&&J3MOczVqCA#|5~={jZxP8VJ@M2LltUpRR3*B2Wbm{EHM^{k$mX$oe(7BB))akg zPJH?5;bJM2ir=M_YC43=(a;h~mJ?MA(gj))6(u25hzg-qvxaM0n{&tGsa1dBxO3im z5l49%2R#7h?{wI4e8D|7;A!YYJj#PB z^Cq?CQ7o@WkI_(CZ^t4}*pV{?wjhf^nA6BG97K+p8HnLlkv7PE@n+b6fvNWO%7Bx4 z#0fzOLQ)|k{dA(1;ov;>G_^vrI4)HlI@%rfVCMmQ8|Un0yofxClDqSm)%U3J?EfKR zdn7?0*k11E0pF)_eIucW#MsuHdz09^k|OiYJ{f2+Ayr55Bzcq7OY&{72x%n*HDtM7 zN*Q4hN|zr^V+vE9tQxA5v585=qYO<8la!8E2T3;ur`H-?CA`N<1FdwJn&*f|vwSX( zbczr&|61mh3fJ+7ByH=H6nIEZelbqR#;PaM72=ZPc5NT^_>^_X-{PJ)H&K5|uqy)f zXY&C6b9>#t>Lj3IH@Ne2API}dtQVmI=2Lw!w5ZrpxBzWz`CBja`W)LGJ*yWt=wxw+mS-@9K5XOZu$ckZ6v4b!? zpIc^sI6N8l7#gTQ?f#|I;*1 zd+a*!C#+~N%+D}>bA};02{0jA6oknNd8@&+au#v!fn^$}LP^Vw!zAVC7#_o$%1JXB zlzK*#JVn)Sc6D;?ajj|H+sU<`bU*2CS;q#CC)eGNI4mx5aSnNy5C+gSaaZnQLf!Q< zJPZAta%D+SAj&pF7I6Ehrwb)wWoLj}^34ZL)c#N$03zt0C4LN#-Fk!FMe9`8wY*E( z1gf|#v{}_wM_Ic|EmT)TS!siYErmisu51*w@0szR$>{jy>FZ3E^~zEw6%4o2Y!kPVY@6E}eU&?ts3%e=FGiu1bQDC@ZjmFrmEB8^ z4(uR27f}&olkGfy{J6>VBT+a|0xR+W)x}!Pmh^Q4a0$JKay;o)Dj%on4yPPX0X_6Ltez1B^mjZ>a#xRo3j8g)V~Wo(A#dxoZD$eP?| z2B{XsN`P%8S|m&YE)}(gd8lS;?JA`oWYb7xzf`GS(fE9BW_@U>e-u z*z)leK?^x)0`7dzIHnq!+NW}*#N@H4a-%b`)P~3i#@aLyQM&Um#zb4s0W3dy^oT5r ze>M3)SS=nkb48a^Zv<&qeZ@keYqMIn84T!~?qCgG5A2gu9P3wa-U8d-GzNq$Fw}*U z%97{Ng=LP82jF@}1y)-3Zq|KbAjcFeFd$E{kS^5&%r-?0HRucS{%A@`4&@~=zTP7x zN~h>tS}7S=brAT!(gh`5)=X}YqP1j|W+MR_H8;!nL_fbm99WYHR01RbPc|@hG?&0G zCF#xsyuXY9I0dd4^tI9k4TS<4;lOwXYCa`|A{1m$02+c616;DuJ*7J;Rv7O9Kk~wY z7oWDaDC02BBXDdmE6u17mCY>}-Gv~{96g5Aa}@c|5~Np$C0vD=qCuE3=`32uxKM=K zDZf>-@hD%Qp%qR!?XyYy%x#}}?K9p!!70eif2a zY}5~RK6da`w1npMH<9?ph>5S@BPWn}l+lC$>cYd9aRR@1r*9Vz52J-!82Nj$#F)uGaeJ3q1ba)V<%e^m|15jfyCh>Q8eK-+j5~*&>u~YU3y&d@s+0 zTH(#@$DUn{H4Fue=;e27SQRK?7Q_?F{0(|OfrP29CNWdh-#9=OWQ7yK^Nby&p@3Id z^w_~73jBzkjz|_A^DSxmtBFRLQr8BEG+n_*YRqa=G@77)9aE^#bg-&a`zwFpz;hU~ zw*C6>Xk@=QIUeB8Eklslv;8M`?%eqW{{Kq-#xMNT@PE#OAl}X|{n=+&{rQLgenr2R zUq3wj2MORuaIk3_hXVQj>yQ8J|L^Zl{`Bz2U;pj!umAb+FF!2*{Y$XDdVc);|E1Ux AZ~y=R diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig deleted file mode 100644 index dd0cbc2e712..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block b1 %}block from theme 1{% endblock %} - -{% block b2 %}block from theme 1{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig deleted file mode 100644 index 07cf9db0dea..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% use '@default_theme/blocks.html.twig' %} - -{% block b2 %}block from theme 2{% endblock %} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php deleted file mode 100644 index 1633e06046f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertTrue($node->getAttribute('value')); - } - - public function getTests() - { - $body = new Node([new TextNode('foo', 1)]); - $node = new AutoEscapeNode(true, $body, 1); - - return [ - [$node, "// line 1\necho \"foo\";"], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php deleted file mode 100644 index ff021ff76fe..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - return [ - [new BlockReferenceNode('foo', 1), <<displayBlock('foo', \$context, \$blocks); -EOF - ], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php deleted file mode 100644 index c91a4d0f75d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $node = new BlockNode('foo', $body, 1); - - return [ - [$node, <<macros; - echo "foo"; -} -EOF - ], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php deleted file mode 100644 index 71457fe8b48..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('This section is deprecated', 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setSourceContext(new Source('', 'foo.twig')); - - $tests[] = [$node, <<setSourceContext(new Source('', 'foo.twig')); - - $tests[] = [$node, <<getMockBuilder(LoaderInterface::class)->getMock()); - $environment->addFunction(new TwigFunction('foo', 'foo', [])); - - $expr = new FunctionExpression('foo', new Node(), 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setSourceContext(new Source('', 'foo.twig')); - - $compiler = $this->getCompiler($environment); - $varName = $compiler->getVarName(); - - $tests[] = [$node, <<assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new DoNode($expr, 1); - $tests[] = [$node, "// line 1\n\"foo\";"]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php deleted file mode 100644 index 842dac40ca7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php +++ /dev/null @@ -1,41 +0,0 @@ -assertEquals($foo, $node->getNode(1)); - } - - public function getTests() - { - $elements = [ - new ConstantExpression('foo', 1), - new ConstantExpression('bar', 1), - - new ConstantExpression('bar', 1), - new ConstantExpression('foo', 1), - ]; - $node = new ArrayExpression($elements, 1); - - return [ - [$node, '["foo" => "bar", "bar" => "foo"]'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php deleted file mode 100644 index 47fddcae163..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new AssignNameExpression('foo', 1); - - return [ - [$node, '$context["foo"]'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php deleted file mode 100644 index d91ee8e5c5b..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AddBinary($left, $right, 1); - - return [ - [$node, '(1 + 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php deleted file mode 100644 index 61cc1c935bd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AndBinary($left, $right, 1); - - return [ - [$node, '(1 && 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php deleted file mode 100644 index f8d4c6e6feb..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ConcatBinary($left, $right, 1); - - return [ - [$node, '(1 . 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php deleted file mode 100644 index b6054239c08..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new DivBinary($left, $right, 1); - - return [ - [$node, '(1 / 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php deleted file mode 100644 index cb27e007d51..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new FloorDivBinary($left, $right, 1); - - return [ - [$node, '(int) floor((1 / 2))'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php deleted file mode 100644 index c5497cd6ff2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ModBinary($left, $right, 1); - - return [ - [$node, '(1 % 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php deleted file mode 100644 index 3b19b05857f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new MulBinary($left, $right, 1); - - return [ - [$node, '(1 * 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php deleted file mode 100644 index 0f1c3bf4319..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new OrBinary($left, $right, 1); - - return [ - [$node, '(1 || 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php deleted file mode 100644 index 9955c4be4fd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new SubBinary($left, $right, 1); - - return [ - [$node, '(1 - 2)'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php deleted file mode 100644 index 15d28048a99..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +++ /dev/null @@ -1,153 +0,0 @@ - 'function', 'name' => 'date']); - $this->assertEquals(['U', null], $this->getArguments($node, ['date', ['format' => 'U', 'timestamp' => null]])); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Positional arguments cannot be used after named arguments for function "date". - */ - public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $this->getArguments($node, ['date', ['timestamp' => 123456, 'Y-m-d']]); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Argument "format" is defined twice for function "date". - */ - public function testGetArgumentsWhenArgumentIsDefinedTwice() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $this->getArguments($node, ['date', ['Y-m-d', 'format' => 'U']]); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown argument "unknown" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentName() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $this->getArguments($node, ['date', ['Y-m-d', 'timestamp' => null, 'unknown' => '']]); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentNames() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $this->getArguments($node, ['date', ['Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '']]); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". - */ - public function testResolveArgumentsWithMissingValueForOptionalArgument() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'substr_compare']); - $this->getArguments($node, ['substr_compare', ['abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true]]); - } - - public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_function']); - - $this->assertEquals(['arg1'], $this->getArguments($node, [[$this, 'customFunction'], ['arg1' => 'arg1']])); - } - - public function testGetArgumentsForStaticMethod() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_static_function']); - $this->assertEquals(['arg1'], $this->getArguments($node, [__CLASS__.'::customStaticFunction', ['arg1' => 'arg1']])); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage The last parameter of "Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg. "array $arg = []". - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArguments() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $this->getArguments($node, [[$this, 'customFunctionWithArbitraryArguments'], []]); - } - - public static function customStaticFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - public function customFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - private function getArguments($call, $args) - { - $m = new \ReflectionMethod($call, 'getArguments'); - $m->setAccessible(true); - - return $m->invokeArgs($call, $args); - } - - public function customFunctionWithArbitraryArguments() - { - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessageRegExp #^The last parameter of "custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\. "array \$arg \= \[\]"\.$# - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments('custom_Twig_Tests_Node_Expression_CallTest_function', []); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessageRegExp #^The last parameter of "CallableTestClass\:\:__invoke" for function "foo" must be an array with default value, eg\. "array \$arg \= \[\]"\.$# - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments(new CallableTestClass(), []); - } -} - -class Twig_Tests_Node_Expression_Call extends CallExpression -{ - public function getArguments($callable = null, $arguments) - { - return parent::getArguments($callable, $arguments); - } -} - -class CallableTestClass -{ - public function __invoke($required) - { - } -} - -function custom_Twig_Tests_Node_Expression_CallTest_function($required) -{ -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php deleted file mode 100644 index 32be4d0e5ec..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertEquals($expr1, $node->getNode('expr1')); - $this->assertEquals($expr2, $node->getNode('expr2')); - $this->assertEquals($expr3, $node->getNode('expr3')); - } - - public function getTests() - { - $tests = []; - - $expr1 = new ConstantExpression(1, 1); - $expr2 = new ConstantExpression(2, 1); - $expr3 = new ConstantExpression(3, 1); - $node = new ConditionalExpression($expr1, $expr2, $expr3, 1); - $tests[] = [$node, '((1) ? (2) : (3))']; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php deleted file mode 100644 index ae38101b58a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals('foo', $node->getAttribute('value')); - } - - public function getTests() - { - $tests = []; - - $node = new ConstantExpression('foo', 1); - $tests[] = [$node, '"foo"']; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php deleted file mode 100644 index ce1f45f01e4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php +++ /dev/null @@ -1,160 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($name, $node->getNode('filter')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $environment->addFilter(new TwigFilter('bar', 'twig_tests_filter_dummy', ['needs_environment' => true])); - $environment->addFilter(new TwigFilter('barbar', 'twig_tests_filter_barbar', ['needs_context' => true, 'is_variadic' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = $this->createFilter($expr, 'upper'); - $node = $this->createFilter($node, 'number_format', [new ConstantExpression(2, 1), new ConstantExpression('.', 1), new ConstantExpression(',', 1)]); - - $tests[] = [$node, 'twig_number_format_filter($this->env, twig_upper_filter($this->env, "foo"), 2, ".", ",")']; - - // named arguments - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'format' => new ConstantExpression('d/m/Y H:i:s P', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, "d/m/Y H:i:s P", "America/Chicago")']; - - // skip an optional argument - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, null, "America/Chicago")']; - - // underscores vs camelCase for named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createFilter($string, 'reverse', [ - 'preserve_keys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - $node = $this->createFilter($string, 'reverse', [ - 'preserveKeys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - - // filter as an anonymous function - $node = $this->createFilter(new ConstantExpression('foo', 1), 'anonymous'); - $tests[] = [$node, 'call_user_func_array($this->env->getFilter(\'anonymous\')->getCallable(), ["foo"])']; - - // needs environment - $node = $this->createFilter($string, 'bar'); - $tests[] = [$node, 'twig_tests_filter_dummy($this->env, "abc")', $environment]; - - $node = $this->createFilter($string, 'bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_filter_dummy($this->env, "abc", "bar")', $environment]; - - // arbitrary named arguments - $node = $this->createFilter($string, 'barbar'); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc")', $environment]; - - $node = $this->createFilter($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFilter($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", null, "bar")', $environment]; - - $node = $this->createFilter($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" at line 1. - */ - public function testCompileWithWrongNamedArgumentName() - { - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'foobar' => new ConstantExpression('America/Chicago', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Value for argument "from" is required for filter "replace" at line 1. - */ - public function testCompileWithMissingNamedArgument() - { - $value = new ConstantExpression(0, 1); - $node = $this->createFilter($value, 'replace', [ - 'to' => new ConstantExpression('foo', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - protected function createFilter($node, $name, array $arguments = []) - { - $name = new ConstantExpression($name, 1); - $arguments = new Node($arguments); - - return new FilterExpression($node, $name, $arguments, 1); - } - - protected function getEnvironment() - { - $env = new Environment(new ArrayLoader([])); - $env->addFilter(new TwigFilter('anonymous', function () {})); - - return $env; - } -} - -function twig_tests_filter_dummy() -{ -} - -function twig_tests_filter_barbar($context, $string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php deleted file mode 100644 index a747481d676..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php +++ /dev/null @@ -1,120 +0,0 @@ -assertEquals($name, $node->getAttribute('name')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $environment->addFunction(new TwigFunction('foo', 'twig_tests_function_dummy', [])); - $environment->addFunction(new TwigFunction('bar', 'twig_tests_function_dummy', ['needs_environment' => true])); - $environment->addFunction(new TwigFunction('foofoo', 'twig_tests_function_dummy', ['needs_context' => true])); - $environment->addFunction(new TwigFunction('foobar', 'twig_tests_function_dummy', ['needs_environment' => true, 'needs_context' => true])); - $environment->addFunction(new TwigFunction('barbar', 'twig_tests_function_barbar', ['is_variadic' => true])); - - $tests = []; - - $node = $this->createFunction('foo'); - $tests[] = [$node, 'twig_tests_function_dummy()', $environment]; - - $node = $this->createFunction('foo', [new ConstantExpression('bar', 1), new ConstantExpression('foobar', 1)]); - $tests[] = [$node, 'twig_tests_function_dummy("bar", "foobar")', $environment]; - - $node = $this->createFunction('bar'); - $tests[] = [$node, 'twig_tests_function_dummy($this->env)', $environment]; - - $node = $this->createFunction('bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_dummy($this->env, "bar")', $environment]; - - $node = $this->createFunction('foofoo'); - $tests[] = [$node, 'twig_tests_function_dummy($context)', $environment]; - - $node = $this->createFunction('foofoo', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_dummy($context, "bar")', $environment]; - - $node = $this->createFunction('foobar'); - $tests[] = [$node, 'twig_tests_function_dummy($this->env, $context)', $environment]; - - $node = $this->createFunction('foobar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_dummy($this->env, $context, "bar")', $environment]; - - // named arguments - $node = $this->createFunction('date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'date' => new ConstantExpression(0, 1), - ]); - $tests[] = [$node, 'twig_date_converter($this->env, 0, "America/Chicago")']; - - // arbitrary named arguments - $node = $this->createFunction('barbar'); - $tests[] = [$node, 'twig_tests_function_barbar()', $environment]; - - $node = $this->createFunction('barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_barbar(null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFunction('barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_barbar(null, "bar")', $environment]; - - $node = $this->createFunction('barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_function_barbar("1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - // function as an anonymous function - $node = $this->createFunction('anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getFunction(\'anonymous\')->getCallable(), ["foo"])']; - - return $tests; - } - - protected function createFunction($name, array $arguments = []) - { - return new FunctionExpression($name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - $env = new Environment(new ArrayLoader([])); - $env->addFunction(new TwigFunction('anonymous', function () {})); - - return $env; - } -} - -function twig_tests_function_dummy() -{ -} - -function twig_tests_function_barbar($arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php deleted file mode 100644 index e02d25b47d7..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ /dev/null @@ -1,58 +0,0 @@ -addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($attr, $node->getNode('attribute')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals(Template::ARRAY_CALL, $node->getAttribute('type')); - } - - public function getTests() - { - $tests = []; - - $expr = new NameExpression('foo', 1); - $attr = new ConstantExpression('bar', 1); - $args = new ArrayExpression([], 1); - $node = new GetAttrExpression($expr, $attr, $args, Template::ANY_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [], "any", false, false, false, 1)', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))]; - - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - $tests[] = [$node, '(($__internal_%s = // line 1'."\n". - '($context["foo"] ?? null)) && is_array($__internal_%s) || $__internal_%s instanceof ArrayAccess ? ($__internal_%s["bar"] ?? null) : null)', null, true, ]; - - $args = new ArrayExpression([], 1); - $args->addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::METHOD_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [0 => %s, 1 => "bar"], "method", false, false, false, 1)', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php deleted file mode 100644 index fc41a766994..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new NameExpression('foo', 1); - $self = new NameExpression('_self', 1); - $context = new NameExpression('_context', 1); - - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => true]); - $env1 = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => false]); - - $output = '(isset($context["foo"]) || array_key_exists("foo", $context) ? $context["foo"] : (function () { throw new RuntimeError(\'Variable "foo" does not exist.\', 1, $this->source); })())'; - - return [ - [$node, "// line 1\n".$output, $env], - [$node, $this->getVariableGetter('foo', 1), $env1], - [$self, "// line 1\n\$this->getTemplateName()"], - [$context, "// line 1\n\$context"], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php deleted file mode 100644 index 8574d109428..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new ParentExpression('foo', 1), '$this->renderParentBlock("foo", $context, $blocks)']; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php deleted file mode 100644 index 6e761c05d78..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php +++ /dev/null @@ -1,89 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals($name, $node->getAttribute('name')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $environment->addTest(new TwigTest('barbar', 'twig_tests_test_barbar', ['is_variadic' => true, 'need_context' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new NullTest($expr, 'null', new Node([]), 1); - $tests[] = [$node, '(null === "foo")']; - - // test as an anonymous function - $node = $this->createTest(new ConstantExpression('foo', 1), 'anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), ["foo", "foo"])']; - - // arbitrary named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createTest($string, 'barbar'); - $tests[] = [$node, 'twig_tests_test_barbar("abc")', $environment]; - - $node = $this->createTest($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createTest($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", null, "bar")', $environment]; - - $node = $this->createTest($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - protected function createTest($node, $name, array $arguments = []) - { - return new TestExpression($node, $name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - $env = new Environment(new ArrayLoader([])); - $env->addTest(new TwigTest('anonymous', function () {})); - - return $env; - } -} - -function twig_tests_test_barbar($string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php deleted file mode 100644 index 6c976ad4ca8..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NegUnary($node, 1); - - return [ - [$node, '-1'], - [new NegUnary($node, 1), '- -1'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php deleted file mode 100644 index 493a37e5504..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NotUnary($node, 1); - - return [ - [$node, '!1'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php deleted file mode 100644 index 015446d4378..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new PosUnary($node, 1); - - return [ - [$node, '+1'], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php deleted file mode 100644 index 47aefac4fb2..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php +++ /dev/null @@ -1,200 +0,0 @@ -setAttribute('with_loop', false); - - $this->assertEquals($keyTarget, $node->getNode('key_target')); - $this->assertEquals($valueTarget, $node->getNode('value_target')); - $this->assertEquals($seq, $node->getNode('seq')); - $this->assertTrue($node->getAttribute('ifexpr')); - $this->assertInstanceOf(IfNode::class, $node->getNode('body')); - $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $keyTarget = new AssignNameExpression('key', 1); - $valueTarget = new AssignNameExpression('item', 1); - $seq = new NameExpression('items', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - - $tests[] = [$node, <<getVariableGetter('items')}); -foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = new ConstantExpression(true, 1); - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - if (true) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['_iterated'] = false; -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - \$context['_iterated'] = true; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -if (!\$context['_iterated']) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php deleted file mode 100644 index 82a69593190..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php +++ /dev/null @@ -1,95 +0,0 @@ -assertEquals($t, $node->getNode('tests')); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - new ConstantExpression(false, 1), - new PrintNode(new NameExpression('bar', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} elseif (false) { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} else { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php deleted file mode 100644 index f811bfb4cdf..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php +++ /dev/null @@ -1,45 +0,0 @@ -assertEquals($macro, $node->getNode('expr')); - $this->assertEquals($var, $node->getNode('var')); - } - - public function getTests() - { - $tests = []; - - $macro = new ConstantExpression('foo.twig', 1); - $var = new AssignNameExpression('macro', 1); - $node = new ImportNode($macro, $var, 1); - - $tests[] = [$node, <<macros["macro"] = \$this->loadTemplate("foo.twig", null, 1)->unwrap(); -EOF - ]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php deleted file mode 100644 index ae8ff074c1c..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ /dev/null @@ -1,93 +0,0 @@ -assertFalse($node->hasNode('variables')); - $this->assertEquals($expr, $node->getNode('expr')); - $this->assertFalse($node->getAttribute('only')); - - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, true, false, 1); - $this->assertEquals($vars, $node->getNode('variables')); - $this->assertTrue($node->getAttribute('only')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo.twig', 1); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(\$context); -EOF - ]; - - $expr = new ConditionalExpression( - new ConstantExpression(true, 1), - new ConstantExpression('foo', 1), - new ConstantExpression('foo', 1), - 0 - ); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<loadTemplate(((true) ? ("foo") : ("foo")), null, 1)->display(\$context); -EOF - ]; - - $expr = new ConstantExpression('foo.twig', 1); - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, false, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(twig_array_merge(\$context, ["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(twig_to_array(["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, true, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1); -} catch (LoaderError \$e) { - // ignore missing template -} -if (\$__internal_%s) { - \$__internal_%s->display(twig_to_array(["foo" => true])); -} -EOF - , null, true]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php deleted file mode 100644 index afa68adf433..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($arguments, $node->getNode('arguments')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $arguments = new Node([ - 'foo' => new ConstantExpression(null, 1), - 'bar' => new ConstantExpression('Foo', 1), - ], [], 1); - $node = new MacroNode('foo', $body, $arguments, 1); - - return [ - [$node, <<macros; - \$context = \$this->env->mergeGlobals([ - "foo" => \$__foo__, - "bar" => \$__bar__, - "varargs" => \$__varargs__, - ]); - - \$blocks = []; - - ob_start(function () { return ''; }); - try { - echo "foo"; - - return ('' === \$tmp = ob_get_contents()) ? '' : new Markup(\$tmp, \$this->env->getCharset()); - } finally { - ob_end_clean(); - } -} -EOF - ], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php deleted file mode 100644 index 812b1ef0b48..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php +++ /dev/null @@ -1,274 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($blocks, $node->getNode('blocks')); - $this->assertEquals($macros, $node->getNode('macros')); - $this->assertEquals($parent, $node->getNode('parent')); - $this->assertEquals($source->getName(), $node->getTemplateName()); - } - - public function getTests() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - - $tests = []; - - $body = new TextNode('foo', 1); - $extends = null; - $blocks = new Node(); - $macros = new Node(); - $traits = new Node(); - $source = new Source('{{ foo }}', 'foo.twig'); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<source = \$this->getSourceContext(); - - \$this->parent = false; - - \$this->blocks = [ - ]; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - \$macros = \$this->macros; - // line 1 - echo "foo"; - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function getDebugInfo() - { - return array ( 37 => 1,); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $import = new ImportNode(new ConstantExpression('foo.twig', 1), new AssignNameExpression('macro', 1), 2); - - $body = new Node([$import]); - $extends = new ConstantExpression('layout.twig', 1); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<source = \$this->getSourceContext(); - - \$this->blocks = [ - ]; - } - - protected function doGetParent(array \$context) - { - // line 1 - return "layout.twig"; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - \$macros = \$this->macros; - // line 2 - \$macros["macro"] = \$this->macros["macro"] = \$this->loadTemplate("foo.twig", "foo.twig", 2)->unwrap(); - // line 1 - \$this->parent = \$this->loadTemplate("layout.twig", "foo.twig", 1); - \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 1, 41 => 2, 34 => 1,); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $set = new SetNode(false, new Node([new AssignNameExpression('foo', 4)]), new Node([new ConstantExpression('foo', 4)]), 4); - $body = new Node([$set]); - $extends = new ConditionalExpression( - new ConstantExpression(true, 2), - new ConstantExpression('foo', 2), - new ConstantExpression('foo', 2), - 2 - ); - - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['debug' => true]); - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<source = \$this->getSourceContext(); - - \$this->blocks = [ - ]; - } - - protected function doGetParent(array \$context) - { - // line 2 - return \$this->loadTemplate(((true) ? ("foo") : ("foo")), "foo.twig", 2); - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - \$macros = \$this->macros; - // line 4 - \$context["foo"] = "foo"; - // line 2 - \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 43 => 2, 41 => 4, 34 => 2,); - } - - public function getSourceContext() - { - return new Source("{{ foo }}", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php deleted file mode 100644 index efb5ebafcbd..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new PrintNode(new ConstantExpression('foo', 1), 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php deleted file mode 100644 index 7dd3e08f0b1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php +++ /dev/null @@ -1,47 +0,0 @@ -assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $tests = []; - - $body = new TextNode('foo', 1); - $node = new SandboxNode($body, 1); - - $tests[] = [$node, <<sandbox->isSandboxed()) { - \$this->sandbox->enableSandbox(); -} -echo "foo"; -if (!\$alreadySandboxed) { - \$this->sandbox->disableSandbox(); -} -EOF - ]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php deleted file mode 100644 index ff4e43e477f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php +++ /dev/null @@ -1,78 +0,0 @@ -assertEquals($names, $node->getNode('names')); - $this->assertEquals($values, $node->getNode('values')); - $this->assertFalse($node->getAttribute('capture')); - } - - public function getTests() - { - $tests = []; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new TextNode('foo', 1); - $node = new SetNode(true, $names, $values, 1); - $tests[] = [$node, <<env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1), new AssignNameExpression('bar', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1), new NameExpression('bar', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<getVariableGetter('bar')}]; -EOF - ]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php deleted file mode 100644 index 13f400fd34f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php +++ /dev/null @@ -1,42 +0,0 @@ -
    foo
    ', 1)]); - $node = new SpacelessNode($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $body = new Node([new TextNode('
    foo
    ', 1)]); - $node = new SpacelessNode($body, 1); - - return [ - [$node, <<
    foo
    "; -echo trim(preg_replace('/>\s+<', ob_get_clean())); -EOF - ], - ]; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php deleted file mode 100644 index 6735083ce2d..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals('foo', $node->getAttribute('data')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new TextNode('foo', 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php deleted file mode 100644 index 6f8fd5c18d1..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ /dev/null @@ -1,114 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{{ block("foo") }}', 'index'))); - - $node = $stream->getNode('body')->getNode(0); - - $this->assertInstanceOf(BlockReferenceExpression::class, $node); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderParentBlockOptimizer() - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index'))); - - $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); - - $this->assertInstanceOf(ParentExpression::class, $node); - $this->assertTrue($node->getAttribute('output')); - } - - /** - * @dataProvider getTestsForForOptimizer - */ - public function testForOptimizer($template, $expected) - { - $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['cache' => false]); - - $stream = $env->parse($env->tokenize(new Source($template, 'index'))); - - foreach ($expected as $target => $withLoop) { - $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); - } - } - - public function getTestsForForOptimizer() - { - return [ - ['{% for i in foo %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ loop.index }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% include "foo" %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% include "foo" only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{{ include("foo") }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', ['i' => true]], - ]; - } - - public function checkForConfiguration(Node $node, $target, $withLoop) - { - foreach ($node as $n) { - if ($n instanceof ForNode) { - if ($target === $n->getNode('value_target')->getAttribute('name')) { - return $withLoop == $n->getAttribute('with_loop'); - } - } - - $ret = $this->checkForConfiguration($n, $target, $withLoop); - if (null !== $ret) { - return $ret; - } - } - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/ParserTest.php deleted file mode 100644 index 81bbeea5651..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/ParserTest.php +++ /dev/null @@ -1,211 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock())); - $parser->parse($stream); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" tag at line 1. - */ - public function testUnknownTagWithoutSuggestions() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foobar', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ]); - $parser = new Parser(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $parser->parse($stream); - } - - /** - * @dataProvider getFilterBodyNodesData - */ - public function testFilterBodyNodes($input, $expected) - { - $parser = $this->getParser(); - $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); - - $this->assertEquals($expected, $m->invoke($parser, $input)); - } - - public function getFilterBodyNodesData() - { - return [ - [ - new Node([new TextNode(' ', 1)]), - new Node([]), - ], - [ - $input = new Node([new SetNode(false, new Node(), new Node(), 1)]), - $input, - ], - [ - $input = new Node([new SetNode(true, new Node(), new Node([new Node([new TextNode('foo', 1)])]), 1)]), - $input, - ], - ]; - } - - /** - * @dataProvider getFilterBodyNodesDataThrowsException - * @expectedException \Twig\Error\SyntaxError - */ - public function testFilterBodyNodesThrowsException($input) - { - $parser = $this->getParser(); - - $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); - - $m->invoke($parser, $input); - } - - public function getFilterBodyNodesDataThrowsException() - { - return [ - [new TextNode('foo', 1)], - [new Node([new Node([new TextNode('foo', 1)])])], - ]; - } - - /** - * @dataProvider getFilterBodyNodesWithBOMData - */ - public function testFilterBodyNodesWithBOM($emptyNode) - { - $parser = $this->getParser(); - - $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); - $this->assertNull($m->invoke($parser, new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyNode, 1))); - } - - public function getFilterBodyNodesWithBOMData() - { - return [ - [' '], - ["\t"], - ["\n"], - ["\n\t\n "], - ]; - } - - public function testParseIsReentrant() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - $twig->addTokenParser(new TestTokenParser()); - - $parser = new Parser($twig); - - $parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'test', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::VAR_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foo', 1), - new Token(Token::VAR_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->assertNull($parser->getParent()); - } - - public function testGetVarName() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - - $twig->parse($twig->tokenize(new Source(<<addToAssertionCount(1); - } - - protected function getParser() - { - $parser = new Parser(new Environment($this->getMockBuilder(LoaderInterface::class)->getMock())); - $parser->setParent(new Node()); - - $p = new \ReflectionProperty($parser, 'stream'); - $p->setAccessible(true); - $p->setValue($parser, new TokenStream([])); - - return $parser; - } -} - -class TestTokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - // simulate the parsing of another template right in the middle of the parsing of the current template - $this->parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'extends', 1), - new Token(Token::STRING_TYPE, 'base', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new Node([]); - } - - public function getTag() - { - return 'test'; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php deleted file mode 100644 index 508f79ca52a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php +++ /dev/null @@ -1,105 +0,0 @@ -getIndexProfile( - [ - $this->getEmbeddedBlockProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - $this->getMacroProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - ] - ), - ]; - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - return $profile; - } - - private function getIndexProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 1, 'template', 'index.twig', $subProfiles); - } - - private function getEmbeddedBlockProfile(array $subProfiles = []) - { - return $this->generateProfile('body', 0.0001, 'block', 'embedded.twig', $subProfiles); - } - - private function getEmbeddedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'embedded.twig', $subProfiles); - } - - private function getIncludedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'included.twig', $subProfiles); - } - - private function getMacroProfile(array $subProfiles = []) - { - return $this->generateProfile('foo', 0.0001, 'macro', 'index.twig', $subProfiles); - } - - /** - * @param string $name - * @param float $duration - * @param bool $isTemplate - * @param string $type - * @param string $templateName - * @param array $subProfiles - * - * @return Profile - */ - private function generateProfile($name, $duration, $type, $templateName, array $subProfiles = []) - { - $profile = new Profile($templateName, $type, $name); - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - $starts = new \ReflectionProperty($profile, 'starts'); - $starts->setAccessible(true); - $starts->setValue($profile, [ - 'wt' => 0, - 'mu' => 0, - 'pmu' => 0, - ]); - $ends = new \ReflectionProperty($profile, 'ends'); - $ends->setAccessible(true); - $ends->setValue($profile, [ - 'wt' => $duration, - 'mu' => 0, - 'pmu' => 0, - ]); - - return $profile; - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php deleted file mode 100644 index 26ef2dad2ac..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertStringMatchesFormat(<<index.twig//1 %d %d %d -index.twig==>embedded.twig::block(body)//1 %d %d 0 -index.twig==>embedded.twig//2 %d %d %d -embedded.twig==>included.twig//2 %d %d %d -index.twig==>index.twig::macro(foo)//1 %d %d %d -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php deleted file mode 100644 index e04bbcf2b52..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertStringMatchesFormat(<<main %d.%dms/%d% -└ index.twig %d.%dms/%d% - └ embedded.twig::block(body) - └ embedded.twig - │ └ included.twig - └ index.twig::macro(foo) - └ embedded.twig - └ included.twig - -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php deleted file mode 100644 index e36d0ad6004..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertStringMatchesFormat(<<dump($this->getProfile())); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php deleted file mode 100644 index 18e2a5b564f..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php +++ /dev/null @@ -1,112 +0,0 @@ -assertEquals('template', $profile->getTemplate()); - $this->assertEquals('type', $profile->getType()); - $this->assertEquals('name', $profile->getName()); - } - - public function testIsRoot() - { - $profile = new Profile('template', Profile::ROOT); - $this->assertTrue($profile->isRoot()); - - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertFalse($profile->isRoot()); - } - - public function testIsTemplate() - { - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertTrue($profile->isTemplate()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isTemplate()); - } - - public function testIsBlock() - { - $profile = new Profile('template', Profile::BLOCK); - $this->assertTrue($profile->isBlock()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isBlock()); - } - - public function testIsMacro() - { - $profile = new Profile('template', Profile::MACRO); - $this->assertTrue($profile->isMacro()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isMacro()); - } - - public function testGetAddProfile() - { - $profile = new Profile(); - $profile->addProfile($a = new Profile()); - $profile->addProfile($b = new Profile()); - - $this->assertSame([$a, $b], $profile->getProfiles()); - $this->assertSame([$a, $b], iterator_to_array($profile)); - } - - public function testGetDuration() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - - $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration())); - } - - public function testSerialize() - { - $profile = new Profile('template', 'type', 'name'); - $profile1 = new Profile('template1', 'type1', 'name1'); - $profile->addProfile($profile1); - $profile->leave(); - $profile1->leave(); - - $profile2 = unserialize(serialize($profile)); - $profiles = $profile->getProfiles(); - $this->assertCount(1, $profiles); - $profile3 = $profiles[0]; - - $this->assertEquals($profile->getTemplate(), $profile2->getTemplate()); - $this->assertEquals($profile->getType(), $profile2->getType()); - $this->assertEquals($profile->getName(), $profile2->getName()); - $this->assertEquals($profile->getDuration(), $profile2->getDuration()); - - $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate()); - $this->assertEquals($profile1->getType(), $profile3->getType()); - $this->assertEquals($profile1->getName(), $profile3->getName()); - } - - public function testReset() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - $profile->reset(); - - $this->assertEquals(0, $profile->getDuration()); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateTest.php deleted file mode 100644 index 3427da63f9e..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ /dev/null @@ -1,746 +0,0 @@ -getMockForAbstractClass(Template::class, [], '', false); - $template->displayBlock('foo', [], ['foo' => [new \stdClass(), 'foo']]); - } - - /** - * @dataProvider getAttributeExceptions - */ - public function testGetAttributeExceptions($template, $message) - { - $templates = ['index' => $template]; - $env = new Environment(new ArrayLoader($templates), ['strict_variables' => true]); - $template = $env->load('index'); - - $context = [ - 'string' => 'foo', - 'null' => null, - 'empty_array' => [], - 'array' => ['foo' => 'foo'], - 'array_access' => new Twig_TemplateArrayAccessObject(), - 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(), - 'object' => new \stdClass(), - ]; - - try { - $template->render($context); - $this->fail('Accessing an invalid attribute should throw an exception.'); - } catch (RuntimeError $e) { - $this->assertSame(sprintf($message, 'index'), $e->getMessage()); - } - } - - public function getAttributeExceptions() - { - return [ - ['{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null["a"] }}', 'Impossible to access a key ("a") on a null variable in "%s" at line 1.'], - ['{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1.'], - ['{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1.'], - ['{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1.'], - ['{{ array.a() }}', 'Impossible to invoke a method ("a") on an array in "%s" at line 1.'], - ['{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access.a }}', 'Neither the property "a" nor one of the methods "a()", "geta()"/"isa()"/"hasa()" or "__call()" exist and have public access in class "Twig_TemplateArrayAccessObject" in "%s" at line 1.'], - ['{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Neither the property "missing_method" nor one of the methods "missing_method()", "getmissing_method()"/"ismissing_method()"/"hasmissing_method()" or "__call()" exist and have public access in class "Twig_TemplateArrayAccessObject" in "%s" at line 1.'], - ['{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.'], - ['{{ object["a"] }}', 'Impossible to access a key "a" on an object of class "stdClass" that does not implement ArrayAccess interface in "%s" at line 1.'], - ]; - } - - /** - * @dataProvider getGetAttributeWithSandbox - */ - public function testGetAttributeWithSandbox($object, $item, $allowed) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $policy = new SecurityPolicy([], [], [/*method*/], [/*prop*/], []); - $twig->addExtension(new SandboxExtension($policy, !$allowed)); - $template = new Twig_TemplateTest($twig); - - try { - twig_get_attribute($twig, $template->getSourceContext(), $object, $item, [], 'any', false, false, true); - - if (!$allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - } catch (SecurityError $e) { - if ($allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - - $this->assertContains('is not allowed', $e->getMessage()); - } - } - - public function getGetAttributeWithSandbox() - { - return [ - [new Twig_TemplatePropertyObject(), 'defined', false], - [new Twig_TemplatePropertyObject(), 'defined', true], - [new Twig_TemplateMethodObject(), 'defined', false], - [new Twig_TemplateMethodObject(), 'defined', true], - ]; - } - - /** - * @expectedException \Twig\Error\RuntimeError - * @expectedExceptionMessage Block "unknown" on template "index.twig" does not exist in "index.twig". - */ - public function testRenderBlockWithUndefinedBlock() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig, 'index.twig'); - try { - $template->renderBlock('unknown', []); - } catch (\Exception $e) { - ob_end_clean(); - - throw $e; - } - } - - /** - * @expectedException \Twig\Error\RuntimeError - * @expectedExceptionMessage Block "unknown" on template "index.twig" does not exist in "index.twig". - */ - public function testDisplayBlockWithUndefinedBlock() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig, 'index.twig'); - $template->displayBlock('unknown', []); - } - - /** - * @expectedException \Twig\Error\RuntimeError - * @expectedExceptionMessage Block "foo" should not call parent() in "index.twig" as the block does not exist in the parent template "parent.twig" - */ - public function testDisplayBlockWithUndefinedParentBlock() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig, 'parent.twig'); - $template->displayBlock('foo', [], ['foo' => [new Twig_TemplateTest($twig, 'index.twig'), 'block_foo']], false); - } - - public function testGetAttributeOnArrayWithConfusableKey() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig); - - $array = ['Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros']; - - $this->assertSame('Zero', $array[false]); - $this->assertSame('One', $array[true]); - $this->assertSame('One', $array[1.5]); - $this->assertSame('One', $array['1']); - $this->assertSame('MinusOne', $array[-1.5]); - $this->assertSame('FloatButString', $array['1.5']); - $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); - $this->assertSame('EmptyString', $array[null]); - - $this->assertSame('Zero', twig_get_attribute($twig, $template->getSourceContext(), $array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', twig_get_attribute($twig, $template->getSourceContext(), $array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', twig_get_attribute($twig, $template->getSourceContext(), $array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('One', twig_get_attribute($twig, $template->getSourceContext(), $array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('MinusOne', twig_get_attribute($twig, $template->getSourceContext(), $array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('FloatButString', twig_get_attribute($twig, $template->getSourceContext(), $array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('IntegerButStringWithLeadingZeros', twig_get_attribute($twig, $template->getSourceContext(), $array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('EmptyString', twig_get_attribute($twig, $template->getSourceContext(), $array, null), 'null is treated as "" when accessing an array (equals PHP behavior)'); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttribute($defined, $value, $object, $item, $arguments, $type) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig); - - $this->assertEquals($value, twig_get_attribute($twig, $template->getSourceContext(), $object, $item, $arguments, $type)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $exceptionMessage = null) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => true]); - $template = new Twig_TemplateTest($twig); - - if ($defined) { - $this->assertEquals($value, twig_get_attribute($twig, $template->getSourceContext(), $object, $item, $arguments, $type)); - } else { - if (method_exists($this, 'expectException')) { - $this->expectException(RuntimeError::class); - if (null !== $exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); - } - } else { - $this->setExpectedException(RuntimeError::class, $exceptionMessage); - } - $this->assertEquals($value, twig_get_attribute($twig, $template->getSourceContext(), $object, $item, $arguments, $type)); - } - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig); - - $this->assertEquals($defined, twig_get_attribute($twig, $template->getSourceContext(), $object, $item, $arguments, $type, true)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type) - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => true]); - $template = new Twig_TemplateTest($twig); - - $this->assertEquals($defined, twig_get_attribute($twig, $template->getSourceContext(), $object, $item, $arguments, $type, true)); - } - - public function testGetAttributeCallExceptions() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock()); - $template = new Twig_TemplateTest($twig); - - $object = new Twig_TemplateMagicMethodExceptionObject(); - - $this->assertNull(twig_get_attribute($twig, $template->getSourceContext(), $object, 'foo')); - } - - public function getGetAttributeTests() - { - $array = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - '09' => '09', - '+4' => '+4', - ]; - - $objectArray = new Twig_TemplateArrayAccessObject(); - $arrayObject = new \ArrayObject($array); - $stdObject = (object) $array; - $magicPropertyObject = new Twig_TemplateMagicPropertyObject(); - $propertyObject = new Twig_TemplatePropertyObject(); - $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator(); - $propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess(); - $propertyObject3 = new Twig_TemplatePropertyObjectDefinedWithUndefinedValue(); - $methodObject = new Twig_TemplateMethodObject(); - $magicMethodObject = new Twig_TemplateMagicMethodObject(); - - $anyType = Template::ANY_CALL; - $methodType = Template::METHOD_CALL; - $arrayType = Template::ARRAY_CALL; - - $basicTests = [ - // array(defined, value, property to fetch) - [true, 'defined', 'defined'], - [false, null, 'undefined'], - [false, null, 'protected'], - [true, 0, 'zero'], - [true, 1, 1], - [true, 1, 1.0], - [true, null, 'null'], - [true, true, 'bar'], - [true, true, 'foo'], - [true, 'baz', 'baz'], - [true, 'baf', 'baf'], - [true, '09', '09'], - [true, '+4', '+4'], - ]; - $testObjects = [ - // array(object, type of fetch) - [$array, $arrayType], - [$objectArray, $arrayType], - [$arrayObject, $anyType], - [$stdObject, $anyType], - [$magicPropertyObject, $anyType], - [$methodObject, $methodType], - [$methodObject, $anyType], - [$propertyObject, $anyType], - [$propertyObject1, $anyType], - [$propertyObject2, $anyType], - ]; - - $tests = []; - foreach ($testObjects as $testObject) { - foreach ($basicTests as $test) { - // properties cannot be numbers - if (($testObject[0] instanceof \stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { - continue; - } - - if ('+4' === $test[2] && $methodObject === $testObject[0]) { - continue; - } - - $tests[] = [$test[0], $test[1], $testObject[0], $test[2], [], $testObject[1]]; - } - } - - // additional properties tests - $tests = array_merge($tests, [ - [true, null, $propertyObject3, 'foo', [], $anyType], - ]); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'defined', $methodObject, 'defined', [], $methodType], - [true, 'defined', $methodObject, 'DEFINED', [], $methodType], - [true, 'defined', $methodObject, 'getDefined', [], $methodType], - [true, 'defined', $methodObject, 'GETDEFINED', [], $methodType], - [true, 'static', $methodObject, 'static', [], $methodType], - [true, 'static', $methodObject, 'getStatic', [], $methodType], - - [true, '__call_undefined', $magicMethodObject, 'undefined', [], $methodType], - [true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', [], $methodType], - ]); - - // add the same tests for the any type - foreach ($tests as $test) { - if ($anyType !== $test[5]) { - $test[5] = $anyType; - $tests[] = $test; - } - } - - $methodAndPropObject = new Twig_TemplateMethodAndPropObject(); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'a', $methodAndPropObject, 'a', [], $anyType], - [true, 'a', $methodAndPropObject, 'a', [], $methodType], - [false, null, $methodAndPropObject, 'a', [], $arrayType], - - [true, 'b_prop', $methodAndPropObject, 'b', [], $anyType], - [true, 'b', $methodAndPropObject, 'B', [], $anyType], - [true, 'b', $methodAndPropObject, 'b', [], $methodType], - [true, 'b', $methodAndPropObject, 'B', [], $methodType], - [false, null, $methodAndPropObject, 'b', [], $arrayType], - - [false, null, $methodAndPropObject, 'c', [], $anyType], - [false, null, $methodAndPropObject, 'c', [], $methodType], - [false, null, $methodAndPropObject, 'c', [], $arrayType], - ]); - - $arrayAccess = new Twig_TemplateArrayAccess(); - $tests = array_merge($tests, [ - [true, ['foo' => 'bar'], $arrayAccess, 'vars', [], $anyType], - ]); - - // tests when input is not an array or object - $tests = array_merge($tests, [ - [false, null, 42, 'a', [], $anyType, 'Impossible to access an attribute ("a") on a integer variable ("42") in "index.twig".'], - [false, null, 'string', 'a', [], $anyType, 'Impossible to access an attribute ("a") on a string variable ("string") in "index.twig".'], - [false, null, [], 'a', [], $anyType, 'Key "a" does not exist as the array is empty in "index.twig".'], - ]); - - return $tests; - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testGetIsMethods() - { - $twig = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => true]); - $getIsObject = new Twig_TemplateGetIsMethods(); - $template = new Twig_TemplateTest($twig, 'index.twig'); - // first time should not create a cache for "get" - $this->assertNull(twig_get_attribute($twig, $template->getSourceContext(), $getIsObject, 'get')); - // 0 should be in the method cache now, so this should fail - $this->assertNull(twig_get_attribute($twig, $template->getSourceContext(), $getIsObject, 0)); - } -} - -class Twig_TemplateTest extends Template -{ - private $name; - - public function __construct(Environment $env, $name = 'index.twig') - { - parent::__construct($env); - $this->name = $name; - } - - public function getZero() - { - return 0; - } - - public function getEmpty() - { - return ''; - } - - public function getString() - { - return 'some_string'; - } - - public function getTrue() - { - return true; - } - - public function getTemplateName() - { - return $this->name; - } - - public function getDebugInfo() - { - return []; - } - - protected function doGetParent(array $context) - { - return false; - } - - protected function doDisplay(array $context, array $blocks = []) - { - } - - public function block_name($context, array $blocks = []) - { - } -} - -class Twig_TemplateArrayAccessObject implements \ArrayAccess -{ - protected $protected = 'protected'; - - public $attributes = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - '09' => '09', - '+4' => '+4', - ]; - - public function offsetExists($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function offsetGet($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } - - public function offsetSet($name, $value) - { - } - - public function offsetUnset($name) - { - } -} - -class Twig_TemplateMagicPropertyObject -{ - public $defined = 'defined'; - - public $attributes = [ - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - '09' => '09', - '+4' => '+4', - ]; - - protected $protected = 'protected'; - - public function __isset($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function __get($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } -} - -class Twig_TemplateMagicPropertyObjectWithException -{ - public function __isset($key) - { - throw new \Exception('Hey! Don\'t try to isset me!'); - } -} - -class Twig_TemplatePropertyObject -{ - public $defined = 'defined'; - public $zero = 0; - public $null = null; - public $bar = true; - public $foo = true; - public $baz = 'baz'; - public $baf = 'baf'; - - protected $protected = 'protected'; -} - -class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator(['foo', 'bar']); - } -} - -class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements \ArrayAccess -{ - private $data = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - ]; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->data); - } - - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a'; - } - - public function offsetSet($offset, $value) - { - } - - public function offsetUnset($offset) - { - } -} - -class Twig_TemplatePropertyObjectDefinedWithUndefinedValue -{ - public $foo; - - public function __construct() - { - $this->foo = @$notExist; - } -} - -class Twig_TemplateMethodObject -{ - public function getDefined() - { - return 'defined'; - } - - public function get1() - { - return 1; - } - - public function get09() - { - return '09'; - } - - public function getZero() - { - return 0; - } - - public function getNull() - { - } - - public function isBar() - { - return true; - } - - public function hasFoo() - { - return true; - } - - public function hasBaz() - { - return 'should never be returned (has)'; - } - - public function isBaz() - { - return 'should never be returned (is)'; - } - - public function getBaz() - { - return 'Baz'; - } - - public function baz() - { - return 'baz'; - } - - public function hasBaf() - { - return 'should never be returned (has)'; - } - - public function isBaf() - { - return 'baf'; - } - - protected function getProtected() - { - return 'protected'; - } - - public static function getStatic() - { - return 'static'; - } -} - -class Twig_TemplateGetIsMethods -{ - public function get() - { - } - - public function is() - { - } -} - -class Twig_TemplateMethodAndPropObject -{ - private $a = 'a_prop'; - - public function getA() - { - return 'a'; - } - - public $b = 'b_prop'; - - public function getB() - { - return 'b'; - } - - private $c = 'c_prop'; - - private function getC() - { - return 'c'; - } -} - -class Twig_TemplateArrayAccess implements \ArrayAccess -{ - public $vars = [ - 'foo' => 'bar', - ]; - private $children = []; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->children); - } - - public function offsetGet($offset) - { - return $this->children[$offset]; - } - - public function offsetSet($offset, $value) - { - $this->children[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->children[$offset]); - } -} - -class Twig_TemplateMagicMethodObject -{ - public function __call($method, $arguments) - { - return '__call_'.$method; - } -} - -class Twig_TemplateMagicMethodExceptionObject -{ - public function __call($method, $arguments) - { - throw new \BadMethodCallException(sprintf('Unknown method "%s".', $method)); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php deleted file mode 100644 index 74618406c77..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php +++ /dev/null @@ -1,68 +0,0 @@ - '{% block foo %}{% endblock %}', - 'index_with_use' => '{% use "imported" %}{% block foo %}{% endblock %}', - 'index_with_extends' => '{% extends "extended" %}{% block foo %}{% endblock %}', - 'imported' => '{% block imported %}{% endblock %}', - 'extended' => '{% block extended %}{% endblock %}', - ])); - - $wrapper = $twig->load('index'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertFalse($wrapper->hasBlock('bar')); - $this->assertEquals(['foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_use'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('imported')); - $this->assertEquals(['imported', 'foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_extends'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('extended')); - $this->assertEquals(['foo', 'extended'], $wrapper->getBlockNames()); - } - - public function testRenderBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - $this->assertEquals('FOOBAR', $wrapper->renderBlock('foo', ['foo' => 'FOO'])); - } - - public function testDisplayBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - - ob_start(); - $wrapper->displayBlock('foo', ['foo' => 'FOO']); - - $this->assertEquals('FOOBAR', ob_get_clean()); - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php deleted file mode 100644 index c8052b21de4..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +++ /dev/null @@ -1,73 +0,0 @@ -isEOF()) { - $token = $stream->next(); - - $repr[] = $token->getValue(); - } - $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unexpected end of template - */ - public function testEndOfTemplateNext() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->next(); - } - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unexpected end of template - */ - public function testEndOfTemplateLook() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->look(); - $stream->next(); - } - } -} diff --git a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php b/system/backend/php/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php deleted file mode 100644 index 46b778ae59a..00000000000 --- a/system/backend/php/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php +++ /dev/null @@ -1,47 +0,0 @@ -getMockBuilder(LoaderInterface::class)->getMock()); - $twig->addFunction(new TwigFunction('deprec', [$this, 'deprec'], ['deprecated' => true])); - - $collector = new DeprecationCollector($twig); - $deprecations = $collector->collect(new Twig_Tests_Util_Iterator()); - - $this->assertEquals(['Twig Function "deprec" is deprecated in deprec.twig at line 1.'], $deprecations); - } - - public function deprec() - { - } -} - -class Twig_Tests_Util_Iterator implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator([ - 'ok.twig' => '{{ foo }}', - 'deprec.twig' => '{{ deprec("foo") }}', - ]); - } -}