gulp-phug 1.3.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/index.js +38 -10
- package/package.json +4 -4
- package/support/bootstrap.php +6 -0
- package/support/composer.json +1 -1
- package/support/composer.lock +94 -179
- package/support/vendor/autoload.php +15 -0
- package/support/vendor/bin/phug +119 -0
- package/support/vendor/bin/var-dump-server +119 -0
- package/support/vendor/composer/ClassLoader.php +166 -32
- package/support/vendor/composer/InstalledVersions.php +387 -329
- package/support/vendor/composer/autoload_classmap.php +1 -5
- package/support/vendor/composer/autoload_files.php +2 -3
- package/support/vendor/composer/autoload_namespaces.php +1 -1
- package/support/vendor/composer/autoload_psr4.php +3 -4
- package/support/vendor/composer/autoload_real.php +12 -37
- package/support/vendor/composer/autoload_static.php +6 -17
- package/support/vendor/composer/installed.json +99 -186
- package/support/vendor/composer/installed.php +129 -151
- package/support/vendor/composer/platform_check.php +15 -4
- package/support/vendor/phug/phug/.github/workflows/coverage.yml +61 -0
- package/support/vendor/phug/phug/.github/workflows/multi-tester.yml +48 -0
- package/support/vendor/phug/phug/.github/workflows/split.yml +41 -0
- package/support/vendor/phug/phug/.github/workflows/style.yml +48 -0
- package/support/vendor/phug/phug/.github/workflows/tests.yml +48 -0
- package/support/vendor/phug/phug/.multi-tester.yml +47 -17
- package/support/vendor/phug/phug/composer.json +27 -18
- package/support/vendor/phug/phug/phpcs.xml +4 -0
- package/support/vendor/phug/phug/phpunit.xml +2 -0
- package/support/vendor/phug/phug/phug +1 -1
- package/support/vendor/phug/phug/release.php +8 -0
- package/support/vendor/phug/phug/src/Phug/Ast/Ast/Node.php +9 -3
- package/support/vendor/phug/phug/src/Phug/Ast/composer.json +2 -3
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/AbstractNodeCompiler.php +4 -4
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/Element/BlockElement.php +4 -4
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentListNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php +10 -2
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AttributeListNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/BlockNodeCompiler.php +3 -3
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CaseNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CodeNodeCompiler.php +2 -2
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CommentNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ConditionalNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DoNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DoctypeNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DocumentNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/EachNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ElementNodeCompiler.php +7 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ExpressionNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/FilterNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ForNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ImportNodeCompiler.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/KeywordNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/MixinCallNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/MixinNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/TextNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/VariableNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/WhenNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/WhileNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/YieldNodeCompiler.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompilerInterface.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Compiler/Compiler.php +2 -2
- package/support/vendor/phug/phug/src/Phug/Compiler/CompilerInterface.php +2 -2
- package/support/vendor/phug/phug/src/Phug/Compiler/composer.json +10 -7
- package/support/vendor/phug/phug/src/Phug/DependencyInjection/DependencyInjection.php +1 -1
- package/support/vendor/phug/phug/src/Phug/DependencyInjection/composer.json +3 -4
- package/support/vendor/phug/phug/src/Phug/Event/Event/ListenerQueue.php +3 -0
- package/support/vendor/phug/phug/src/Phug/Event/EventManagerTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Event/composer.json +2 -3
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/AbstractElement.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/AbstractFormat.php +17 -14
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/AssignmentContainerInterface.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AbstractAssignmentContainerElement.php +11 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AbstractMarkupElement.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AbstractValueElement.php +3 -3
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AnonymousBlockElement.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AssignmentElement.php +13 -8
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AttributeElement.php +7 -4
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/CodeElement.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/KeywordElement.php +3 -3
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/MarkupElement.php +13 -11
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/MixinCallElement.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/MixinElement.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/VariableElement.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Event/FormatEvent.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/HtmlFormat.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/XhtmlFormat.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/XmlFormat.php +214 -21
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/FormatInterface.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Partial/AssignmentHelpersTrait.php +7 -4
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Partial/HandleVariable.php +4 -4
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Partial/MagicAccessorTrait.php +1 -7
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Partial/PatternTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/Formatter.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Formatter/composer.json +5 -6
- package/support/vendor/phug/phug/src/Phug/Invoker/Invoker.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Invoker/composer.json +9 -6
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/AbstractToken.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Partial/IndentStyleTrait.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/AssignmentScanner.php +8 -2
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/AttributeScanner.php +24 -12
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/ConditionalScanner.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/FilterScanner.php +6 -10
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/IndentationScanner.php +2 -2
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/KeywordScanner.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/MultilineScanner.php +6 -12
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/Partial/TrailingOutdentHandlerTrait.php +26 -0
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/TextScanner.php +3 -3
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/State.php +9 -9
- package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/TokenInterface.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Lexer/composer.json +4 -5
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Event/NodeEvent.php +3 -2
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/AssignmentNode.php +5 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/AttributeNode.php +4 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/ElementNode.php +5 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/FilterNode.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/MixinCallNode.php +5 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node/MixinNode.php +5 -1
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/State.php +4 -4
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AbstractTokenHandler.php +87 -0
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AssignmentTokenHandler.php +6 -21
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AttributeEndTokenHandler.php +5 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AttributeStartTokenHandler.php +7 -23
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AttributeTokenHandler.php +21 -19
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/AutoCloseTokenHandler.php +5 -17
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/BlockTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ClassTokenHandler.php +7 -34
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/CodeTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ConditionalTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/DoTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/EachTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ExpansionTokenHandler.php +5 -11
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ExpressionTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/FilterTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/IdTokenHandler.php +7 -33
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/ImportTokenHandler.php +14 -20
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/IndentTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/InterpolationEndTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/InterpolationStartTokenHandler.php +29 -30
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/KeywordTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/MixinCallTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/NewLineTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/OutdentTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/Partial/StaticAttributeTrait.php +36 -0
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/TagInterpolationEndTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/TagInterpolationStartTokenHandler.php +7 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/TagTokenHandler.php +6 -21
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/TextTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/WhenTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser/TokenHandler/YieldTokenHandler.php +4 -10
- package/support/vendor/phug/phug/src/Phug/Parser/Parser.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Parser/ParserException.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Parser/composer.json +5 -6
- package/support/vendor/phug/phug/src/Phug/Phug/Phug/Cli.php +5 -5
- package/support/vendor/phug/phug/src/Phug/Phug/Phug/Partial/ExtensionsTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Phug/Phug/Partial/FacadeOptionsTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Phug/Phug/Partial/PluginEnablerTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Phug/Phug/Phug.php +14 -5
- package/support/vendor/phug/phug/src/Phug/Phug/composer.json +9 -6
- package/support/vendor/phug/phug/src/Phug/Reader/Reader.php +13 -13
- package/support/vendor/phug/phug/src/Phug/Reader/composer.json +6 -2
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Adapter/FileAdapter.php +21 -4
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Adapter/Stream/Template.php +5 -0
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Adapter/StreamAdapter.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/CacheInterface.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Partial/AdapterTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Partial/Debug/DebuggerTrait.php +56 -10
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Partial/RendererOptionsTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Profiler/Dump.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Profiler/LinkDump.php +2 -2
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Profiler/ProfilerModule.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Task/TasksGroup.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Renderer/composer.json +10 -6
- package/support/vendor/phug/phug/src/Phug/Util/CompatibilityUtil/TestCaseTyped.php +67 -0
- package/support/vendor/phug/phug/src/Phug/Util/CompatibilityUtil/TestCaseUntyped.php +67 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/AttributesInterface.php +16 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/AttributesOrderInterface.php +17 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/AttributesStorage.php +44 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/Collection.php +2 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/OrderableInterface.php +22 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/OrderedValue.php +25 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/AttributeTrait.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/AttributesOrderTrait.php +19 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/ModuleContainerTrait.php +3 -3
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/OptionTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/OrderTrait.php +27 -0
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/StaticMemberTrait.php +1 -1
- package/support/vendor/phug/phug/src/Phug/Util/Util/Partial/ValueTrait.php +5 -3
- package/support/vendor/phug/phug/src/Phug/Util/Util/SandBox.php +2 -1
- package/support/vendor/phug/phug/src/Phug/Util/Util/TestCase.php +47 -4
- package/support/vendor/phug/phug/src/Phug/Util/composer.json +7 -8
- package/support/vendor/symfony/deprecation-contracts/CHANGELOG.md +5 -0
- package/support/vendor/symfony/{polyfill-php72 → deprecation-contracts}/LICENSE +1 -1
- package/support/vendor/symfony/deprecation-contracts/README.md +26 -0
- package/support/vendor/symfony/{polyfill-php72 → deprecation-contracts}/composer.json +9 -9
- package/support/vendor/symfony/deprecation-contracts/function.php +27 -0
- package/support/vendor/symfony/polyfill-mbstring/LICENSE +1 -1
- package/support/vendor/symfony/polyfill-mbstring/Mbstring.php +256 -57
- package/support/vendor/symfony/polyfill-mbstring/README.md +1 -1
- package/support/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -0
- package/support/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1 -1
- package/support/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +102 -27
- package/support/vendor/symfony/polyfill-mbstring/bootstrap.php +33 -8
- package/support/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -0
- package/support/vendor/symfony/polyfill-mbstring/composer.json +5 -4
- package/support/vendor/symfony/var-dumper/CHANGELOG.md +63 -0
- package/support/vendor/symfony/var-dumper/Caster/AddressInfoCaster.php +82 -0
- package/support/vendor/symfony/var-dumper/Caster/AmqpCaster.php +12 -10
- package/support/vendor/symfony/var-dumper/Caster/ArgsStub.php +6 -7
- package/support/vendor/symfony/var-dumper/Caster/Caster.php +59 -31
- package/support/vendor/symfony/var-dumper/Caster/ClassStub.php +7 -9
- package/support/vendor/symfony/var-dumper/Caster/ConstStub.php +20 -4
- package/support/vendor/symfony/var-dumper/Caster/CurlCaster.php +31 -0
- package/support/vendor/symfony/var-dumper/Caster/CutArrayStub.php +1 -1
- package/support/vendor/symfony/var-dumper/Caster/CutStub.php +2 -2
- package/support/vendor/symfony/var-dumper/Caster/DOMCaster.php +61 -156
- package/support/vendor/symfony/var-dumper/Caster/DateCaster.php +27 -26
- package/support/vendor/symfony/var-dumper/Caster/DoctrineCaster.php +6 -4
- package/support/vendor/symfony/var-dumper/Caster/DsCaster.php +1 -1
- package/support/vendor/symfony/var-dumper/Caster/DsPairStub.php +1 -1
- package/support/vendor/symfony/var-dumper/Caster/EnumStub.php +4 -5
- package/support/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +64 -49
- package/support/vendor/symfony/var-dumper/Caster/FFICaster.php +171 -0
- package/support/vendor/symfony/var-dumper/Caster/FiberCaster.php +43 -0
- package/support/vendor/symfony/var-dumper/Caster/FrameStub.php +6 -8
- package/support/vendor/symfony/var-dumper/Caster/GdCaster.php +30 -0
- package/support/vendor/symfony/var-dumper/Caster/GmpCaster.php +4 -2
- package/support/vendor/symfony/var-dumper/Caster/ImagineCaster.php +2 -0
- package/support/vendor/symfony/var-dumper/Caster/ImgStub.php +1 -1
- package/support/vendor/symfony/var-dumper/Caster/IntlCaster.php +10 -8
- package/support/vendor/symfony/var-dumper/Caster/LinkStub.php +14 -17
- package/support/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +10 -8
- package/support/vendor/symfony/var-dumper/Caster/MysqliCaster.php +33 -0
- package/support/vendor/symfony/var-dumper/Caster/OpenSSLCaster.php +69 -0
- package/support/vendor/symfony/var-dumper/Caster/PdoCaster.php +8 -6
- package/support/vendor/symfony/var-dumper/Caster/PgSqlCaster.php +21 -19
- package/support/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php +4 -2
- package/support/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +188 -0
- package/support/vendor/symfony/var-dumper/Caster/RedisCaster.php +31 -31
- package/support/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +100 -44
- package/support/vendor/symfony/var-dumper/Caster/ResourceCaster.php +33 -46
- package/support/vendor/symfony/var-dumper/Caster/ScalarStub.php +27 -0
- package/support/vendor/symfony/var-dumper/Caster/SocketCaster.php +64 -0
- package/support/vendor/symfony/var-dumper/Caster/SplCaster.php +57 -44
- package/support/vendor/symfony/var-dumper/Caster/SqliteCaster.php +32 -0
- package/support/vendor/symfony/var-dumper/Caster/StubCaster.php +15 -5
- package/support/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +66 -10
- package/support/vendor/symfony/var-dumper/Caster/TraceStub.php +7 -11
- package/support/vendor/symfony/var-dumper/Caster/UninitializedStub.php +25 -0
- package/support/vendor/symfony/var-dumper/Caster/UuidCaster.php +2 -0
- package/support/vendor/symfony/var-dumper/Caster/VirtualStub.php +21 -0
- package/support/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +25 -10
- package/support/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php +7 -5
- package/support/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +103 -72
- package/support/vendor/symfony/var-dumper/Cloner/ClonerInterface.php +1 -5
- package/support/vendor/symfony/var-dumper/Cloner/Cursor.php +21 -21
- package/support/vendor/symfony/var-dumper/Cloner/Data.php +51 -77
- package/support/vendor/symfony/var-dumper/Cloner/DumperInterface.php +11 -14
- package/support/vendor/symfony/var-dumper/Cloner/Stub.php +40 -31
- package/support/vendor/symfony/var-dumper/Cloner/VarCloner.php +21 -104
- package/support/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php +9 -19
- package/support/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php +10 -11
- package/support/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +27 -15
- package/support/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +68 -48
- package/support/vendor/symfony/var-dumper/Dumper/CliDumper.php +126 -113
- package/support/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php +1 -1
- package/support/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php +0 -3
- package/support/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php +5 -6
- package/support/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +10 -15
- package/support/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php +8 -11
- package/support/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php +3 -0
- package/support/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +122 -146
- package/support/vendor/symfony/var-dumper/Dumper/ServerDumper.php +10 -10
- package/support/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php +1 -1
- package/support/vendor/symfony/var-dumper/LICENSE +1 -1
- package/support/vendor/symfony/var-dumper/README.md +6 -6
- package/support/vendor/symfony/var-dumper/Resources/bin/var-dump-server +4 -0
- package/support/vendor/symfony/var-dumper/Resources/functions/dump.php +35 -10
- package/support/vendor/symfony/var-dumper/Server/Connection.php +16 -14
- package/support/vendor/symfony/var-dumper/Server/DumpServer.php +16 -14
- package/support/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +9 -9
- package/support/vendor/symfony/var-dumper/VarDumper.php +69 -17
- package/support/vendor/symfony/var-dumper/composer.json +10 -16
- package/support/vendor/symfony/polyfill-php72/Php72.php +0 -217
- package/support/vendor/symfony/polyfill-php72/README.md +0 -28
- package/support/vendor/symfony/polyfill-php72/bootstrap.php +0 -57
- package/support/vendor/symfony/polyfill-php80/LICENSE +0 -19
- package/support/vendor/symfony/polyfill-php80/Php80.php +0 -105
- package/support/vendor/symfony/polyfill-php80/README.md +0 -24
- package/support/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +0 -22
- package/support/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +0 -11
- package/support/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +0 -5
- package/support/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +0 -5
- package/support/vendor/symfony/polyfill-php80/bootstrap.php +0 -42
- package/support/vendor/symfony/polyfill-php80/composer.json +0 -40
|
@@ -30,7 +30,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
30
30
|
$expression = preg_replace('/
|
|
31
31
|
"(?:\\\\[\\S\\s]|[^"\\\\])*"|
|
|
32
32
|
\'(?:\\\\[\\S\\s]|[^\'\\\\])*\'
|
|
33
|
-
/x', '0', $expression);
|
|
33
|
+
/x', '0', (string) $expression);
|
|
34
34
|
$expression = preg_replace('/\\s*(
|
|
35
35
|
(\\[([^\\[\\]]+|(?1))*\\]) |
|
|
36
36
|
(\\(([^\\(\\)]+|(?1))*\\)) |
|
|
@@ -42,6 +42,8 @@ class AttributeScanner implements ScannerInterface
|
|
|
42
42
|
|
|
43
43
|
private function isTruncatedExpression(Reader $reader, &$expression)
|
|
44
44
|
{
|
|
45
|
+
$expression = (string) $expression;
|
|
46
|
+
|
|
45
47
|
if (mb_substr($expression, -3) === 'new' || mb_substr($expression, -5) === 'clone') {
|
|
46
48
|
$expression .= $reader->getLastPeekResult();
|
|
47
49
|
$reader->consume();
|
|
@@ -101,7 +103,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
101
103
|
$this->isTruncatedValue($expression);
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
private function getAttributeValue(Reader $reader, array $chars = null)
|
|
106
|
+
private function getAttributeValue(Reader $reader, ?array $chars = null)
|
|
105
107
|
{
|
|
106
108
|
$chars = $chars ?: [
|
|
107
109
|
' ', "\t", "\n", ',', ')', '//',
|
|
@@ -118,13 +120,15 @@ class AttributeScanner implements ScannerInterface
|
|
|
118
120
|
return $expression;
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
private function readAttributeValue(Reader $reader, AttributeToken $token)
|
|
123
|
+
private function readAttributeValue(Reader $reader, AttributeToken $token, $expression = '')
|
|
122
124
|
{
|
|
123
|
-
$expression
|
|
125
|
+
$expression .= $this->getAttributeValue($reader);
|
|
126
|
+
|
|
124
127
|
while ($this->isTruncatedExpression($reader, $expression)) {
|
|
125
128
|
$this->skipComments($reader);
|
|
126
129
|
$expression .= $this->getAttributeValue($reader);
|
|
127
130
|
}
|
|
131
|
+
|
|
128
132
|
$token->setValue($expression);
|
|
129
133
|
|
|
130
134
|
//Ignore a comma if found
|
|
@@ -210,7 +214,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
210
214
|
$token->escape();
|
|
211
215
|
$token->check();
|
|
212
216
|
|
|
213
|
-
if ($
|
|
217
|
+
if ($reader->peekString('...')) {
|
|
214
218
|
$token->setIsVariadic(true);
|
|
215
219
|
$reader->consume();
|
|
216
220
|
}
|
|
@@ -218,9 +222,17 @@ class AttributeScanner implements ScannerInterface
|
|
|
218
222
|
return $token;
|
|
219
223
|
}
|
|
220
224
|
|
|
221
|
-
private function seedAttributeToken(State $state, AttributeToken $token, $expression)
|
|
225
|
+
private function seedAttributeToken(State $state, AttributeToken $token, $expression, array $options)
|
|
222
226
|
{
|
|
223
227
|
$reader = $state->getReader();
|
|
228
|
+
$allowName = isset($options['allow_name']) ? $options['allow_name'] : true;
|
|
229
|
+
|
|
230
|
+
if (!$allowName) {
|
|
231
|
+
$this->readAttributeValue($reader, $token, $expression);
|
|
232
|
+
$this->skipComments($reader);
|
|
233
|
+
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
224
236
|
|
|
225
237
|
$token->setName($expression);
|
|
226
238
|
|
|
@@ -252,7 +264,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
252
264
|
}
|
|
253
265
|
}
|
|
254
266
|
|
|
255
|
-
private function scanParenthesesContent(State $state)
|
|
267
|
+
private function scanParenthesesContent(State $state, array $options)
|
|
256
268
|
{
|
|
257
269
|
$reader = $state->getReader();
|
|
258
270
|
|
|
@@ -263,7 +275,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
263
275
|
continue;
|
|
264
276
|
}
|
|
265
277
|
|
|
266
|
-
$this->seedAttributeToken($state, $token, $expression);
|
|
278
|
+
$this->seedAttributeToken($state, $token, $expression, $options);
|
|
267
279
|
|
|
268
280
|
yield $token;
|
|
269
281
|
|
|
@@ -275,7 +287,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
275
287
|
}
|
|
276
288
|
}
|
|
277
289
|
|
|
278
|
-
private function scanParentheses(State $state)
|
|
290
|
+
private function scanParentheses(State $state, array $options)
|
|
279
291
|
{
|
|
280
292
|
$reader = $state->getReader();
|
|
281
293
|
|
|
@@ -283,7 +295,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
283
295
|
return;
|
|
284
296
|
}
|
|
285
297
|
|
|
286
|
-
foreach ($this->scanParenthesesContent($state) as $token) {
|
|
298
|
+
foreach ($this->scanParenthesesContent($state, $options) as $token) {
|
|
287
299
|
yield $token;
|
|
288
300
|
}
|
|
289
301
|
|
|
@@ -294,7 +306,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
294
306
|
}
|
|
295
307
|
}
|
|
296
308
|
|
|
297
|
-
public function scan(State $state)
|
|
309
|
+
public function scan(State $state, array $options = [])
|
|
298
310
|
{
|
|
299
311
|
$reader = $state->getReader();
|
|
300
312
|
|
|
@@ -307,7 +319,7 @@ class AttributeScanner implements ScannerInterface
|
|
|
307
319
|
$reader->consume();
|
|
308
320
|
yield $state->endToken($start);
|
|
309
321
|
|
|
310
|
-
foreach ($this->scanParentheses($state) as $token) {
|
|
322
|
+
foreach ($this->scanParentheses($state, $options) as $token) {
|
|
311
323
|
yield $token;
|
|
312
324
|
}
|
|
313
325
|
|
|
@@ -26,7 +26,7 @@ class ConditionalScanner extends ControlStatementScanner
|
|
|
26
26
|
//Make sure spaces are replaced from `elseif`/`else if` to make a final keyword, "elseif"
|
|
27
27
|
$token->setName(preg_replace('/[ \t]/', '', $token->getName()));
|
|
28
28
|
|
|
29
|
-
if ($token->getName() === 'else' && !in_array($token->getSubject(), ['', false, null])) {
|
|
29
|
+
if ($token->getName() === 'else' && !in_array($token->getSubject(), ['', false, null], true)) {
|
|
30
30
|
$state->throwException(
|
|
31
31
|
'The `else`-conditional statement can\'t have a subject'
|
|
32
32
|
);
|
|
@@ -7,16 +7,18 @@
|
|
|
7
7
|
namespace Phug\Lexer\Scanner;
|
|
8
8
|
|
|
9
9
|
use Phug\Lexer\Analyzer\LineAnalyzer;
|
|
10
|
+
use Phug\Lexer\Scanner\Partial\TrailingOutdentHandlerTrait;
|
|
10
11
|
use Phug\Lexer\ScannerInterface;
|
|
11
12
|
use Phug\Lexer\State;
|
|
12
13
|
use Phug\Lexer\Token\FilterToken;
|
|
13
14
|
use Phug\Lexer\Token\IndentToken;
|
|
14
15
|
use Phug\Lexer\Token\NewLineToken;
|
|
15
|
-
use Phug\Lexer\Token\OutdentToken;
|
|
16
16
|
use Phug\Lexer\Token\TextToken;
|
|
17
17
|
|
|
18
18
|
class FilterScanner implements ScannerInterface
|
|
19
19
|
{
|
|
20
|
+
use TrailingOutdentHandlerTrait;
|
|
21
|
+
|
|
20
22
|
public function scan(State $state)
|
|
21
23
|
{
|
|
22
24
|
$reader = $state->getReader();
|
|
@@ -55,7 +57,7 @@ class FilterScanner implements ScannerInterface
|
|
|
55
57
|
$token = $state->createToken(TextToken::class);
|
|
56
58
|
if ($maxIndent > 0 && $maxIndent < INF) {
|
|
57
59
|
foreach ($lines as &$line) {
|
|
58
|
-
$line = mb_substr($line, $maxIndent)
|
|
60
|
+
$line = mb_substr((string) $line, $maxIndent);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
$token->setValue(implode("\n", $lines));
|
|
@@ -66,14 +68,8 @@ class FilterScanner implements ScannerInterface
|
|
|
66
68
|
$token->getSourceLocation()->setOffsetLength(1); //Let it have at least 1 length for debugging
|
|
67
69
|
yield $token;
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
yield $
|
|
71
|
-
|
|
72
|
-
$state->setLevel($analyzer->getNewLevel())->indent($analyzer->getLevel() + 1);
|
|
73
|
-
|
|
74
|
-
while ($state->nextOutdent() !== false) {
|
|
75
|
-
yield $state->createToken(OutdentToken::class);
|
|
76
|
-
}
|
|
71
|
+
foreach ($this->yieldTrailingOutdent($analyzer, $state) as $token) {
|
|
72
|
+
yield $token;
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
}
|
|
@@ -53,7 +53,7 @@ class IndentationScanner implements ScannerInterface
|
|
|
53
53
|
return $indentChar;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
public function getIndentLevel(State $state, $maxLevel = INF, callable $getIndentChar = null)
|
|
56
|
+
public function getIndentLevel(State $state, $maxLevel = INF, ?callable $getIndentChar = null)
|
|
57
57
|
{
|
|
58
58
|
if ($maxLevel <= 0) {
|
|
59
59
|
return 0;
|
|
@@ -98,7 +98,7 @@ class IndentationScanner implements ScannerInterface
|
|
|
98
98
|
$newLevel = $this->getIndentLevel($state, INF, function () use (&$indent) {
|
|
99
99
|
$char = null;
|
|
100
100
|
|
|
101
|
-
if (mb_strlen($indent)) {
|
|
101
|
+
if ($indent !== null && mb_strlen($indent)) {
|
|
102
102
|
$char = mb_substr($indent, 0, 1);
|
|
103
103
|
$indent = mb_substr($indent, 1);
|
|
104
104
|
}
|
|
@@ -24,7 +24,7 @@ class KeywordScanner implements ScannerInterface
|
|
|
24
24
|
)) {
|
|
25
25
|
$name = $reader->getMatch('name');
|
|
26
26
|
|
|
27
|
-
if (in_array($name, $keywords)) {
|
|
27
|
+
if (in_array($name, $keywords, true)) {
|
|
28
28
|
$value = $reader->getMatch('value');
|
|
29
29
|
if (mb_substr($value, 0, 1) === ' ') {
|
|
30
30
|
$value = mb_substr($value, 1);
|
|
@@ -7,19 +7,21 @@
|
|
|
7
7
|
namespace Phug\Lexer\Scanner;
|
|
8
8
|
|
|
9
9
|
use Phug\Lexer\Analyzer\LineAnalyzer;
|
|
10
|
+
use Phug\Lexer\Scanner\Partial\TrailingOutdentHandlerTrait;
|
|
10
11
|
use Phug\Lexer\ScannerInterface;
|
|
11
12
|
use Phug\Lexer\State;
|
|
12
13
|
use Phug\Lexer\Token\IndentToken;
|
|
13
14
|
use Phug\Lexer\Token\InterpolationEndToken;
|
|
14
15
|
use Phug\Lexer\Token\InterpolationStartToken;
|
|
15
16
|
use Phug\Lexer\Token\NewLineToken;
|
|
16
|
-
use Phug\Lexer\Token\OutdentToken;
|
|
17
17
|
use Phug\Lexer\Token\TagInterpolationEndToken;
|
|
18
18
|
use Phug\Lexer\Token\TagInterpolationStartToken;
|
|
19
19
|
use Phug\Lexer\Token\TextToken;
|
|
20
20
|
|
|
21
21
|
class MultilineScanner implements ScannerInterface
|
|
22
22
|
{
|
|
23
|
+
use TrailingOutdentHandlerTrait;
|
|
24
|
+
|
|
23
25
|
protected function unEscapedToken(State $state, $buffer)
|
|
24
26
|
{
|
|
25
27
|
/** @var TextToken $token */
|
|
@@ -83,8 +85,6 @@ class MultilineScanner implements ScannerInterface
|
|
|
83
85
|
|
|
84
86
|
private function yieldLines(State $state, array $lines, LineAnalyzer $analyzer)
|
|
85
87
|
{
|
|
86
|
-
$reader = $state->getReader();
|
|
87
|
-
|
|
88
88
|
yield $state->createToken(IndentToken::class);
|
|
89
89
|
|
|
90
90
|
$maxIndent = $analyzer->getMaxIndent();
|
|
@@ -92,7 +92,7 @@ class MultilineScanner implements ScannerInterface
|
|
|
92
92
|
if ($maxIndent > 0 && $maxIndent < INF) {
|
|
93
93
|
foreach ($lines as &$line) {
|
|
94
94
|
if (count($line) && is_string($line[0])) {
|
|
95
|
-
$line[0] = mb_substr($line[0], $maxIndent)
|
|
95
|
+
$line[0] = mb_substr((string) $line[0], $maxIndent);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -101,14 +101,8 @@ class MultilineScanner implements ScannerInterface
|
|
|
101
101
|
yield $token;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
yield $
|
|
106
|
-
|
|
107
|
-
$state->setLevel($analyzer->getNewLevel())->indent($analyzer->getLevel() + 1);
|
|
108
|
-
|
|
109
|
-
while ($state->nextOutdent() !== false) {
|
|
110
|
-
yield $state->createToken(OutdentToken::class);
|
|
111
|
-
}
|
|
104
|
+
foreach ($this->yieldTrailingOutdent($analyzer, $state) as $token) {
|
|
105
|
+
yield $token;
|
|
112
106
|
}
|
|
113
107
|
}
|
|
114
108
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Phug\Lexer\Scanner\Partial;
|
|
4
|
+
|
|
5
|
+
use Phug\Lexer\Analyzer\LineAnalyzer;
|
|
6
|
+
use Phug\Lexer\State;
|
|
7
|
+
use Phug\Lexer\Token\NewLineToken;
|
|
8
|
+
use Phug\Lexer\Token\OutdentToken;
|
|
9
|
+
|
|
10
|
+
trait TrailingOutdentHandlerTrait
|
|
11
|
+
{
|
|
12
|
+
private function yieldTrailingOutdent(LineAnalyzer $analyzer, State $state)
|
|
13
|
+
{
|
|
14
|
+
$reader = $state->getReader();
|
|
15
|
+
|
|
16
|
+
if ($reader->hasLength()) {
|
|
17
|
+
yield $state->createToken(NewLineToken::class);
|
|
18
|
+
|
|
19
|
+
$state->setLevel($analyzer->getNewLevel())->indent($analyzer->getLevel() + 1);
|
|
20
|
+
|
|
21
|
+
while ($state->nextOutdent() !== false) {
|
|
22
|
+
yield $state->createToken(OutdentToken::class);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -19,7 +19,7 @@ class TextScanner implements ScannerInterface
|
|
|
19
19
|
|
|
20
20
|
private function isTextStartToTrim(State $state, $text)
|
|
21
21
|
{
|
|
22
|
-
return in_array(mb_substr($text, 0, 1), [' ', "\t"]) && !$state->isAfterInterpolation();
|
|
22
|
+
return in_array(mb_substr((string) $text, 0, 1), [' ', "\t"], true) && !$state->isAfterInterpolation();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
private function leftTrimValueIfNotAfterInterpolation(State $state, TextToken $token)
|
|
@@ -27,7 +27,7 @@ class TextScanner implements ScannerInterface
|
|
|
27
27
|
$text = $token->getValue();
|
|
28
28
|
|
|
29
29
|
if ($this->isTextStartToTrim($state, $text)) {
|
|
30
|
-
$token->setValue(mb_substr($text, 1)
|
|
30
|
+
$token->setValue(mb_substr((string) $text, 1));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -87,7 +87,7 @@ class TextScanner implements ScannerInterface
|
|
|
87
87
|
$text = mb_substr($text, 1);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
$text = preg_replace('/\\\\([#!]\\[
|
|
90
|
+
$text = preg_replace('/\\\\([#!]\\[|#{)/', '$1', $text);
|
|
91
91
|
$token->setValue($text);
|
|
92
92
|
|
|
93
93
|
yield $state->endToken($token);
|
|
@@ -230,20 +230,20 @@ class State implements OptionInterface
|
|
|
230
230
|
* use the `loopScan`-method
|
|
231
231
|
*
|
|
232
232
|
* @param array|string $scanners the scanners to run
|
|
233
|
+
* @param array $options options to be passed for the scanner
|
|
233
234
|
*
|
|
234
235
|
* @throws LexerException
|
|
235
236
|
*
|
|
236
237
|
* @return iterable the generator yielding all tokens found
|
|
237
238
|
*/
|
|
238
|
-
public function scan($scanners)
|
|
239
|
+
public function scan($scanners, array $options = [])
|
|
239
240
|
{
|
|
240
241
|
$scanners = $this->filterScanners($scanners);
|
|
241
242
|
|
|
242
|
-
foreach ($scanners as $
|
|
243
|
-
|
|
243
|
+
foreach ($scanners as $scanner) {
|
|
244
244
|
/** @var ScannerInterface $scanner */
|
|
245
245
|
$success = false;
|
|
246
|
-
foreach ($scanner->scan($this) as $token) {
|
|
246
|
+
foreach ($scanner->scan($this, $options) as $token) {
|
|
247
247
|
if (!($token instanceof TokenInterface)) {
|
|
248
248
|
$this->throwException(
|
|
249
249
|
'Scanner '.get_class($scanner).' generated a result that is not a '.TokenInterface::class
|
|
@@ -266,7 +266,7 @@ class State implements OptionInterface
|
|
|
266
266
|
* If the second argument is true, it will throw an exception if none of the scanners
|
|
267
267
|
* produced any valid tokens. The reading also stops when the end of the input as been reached.
|
|
268
268
|
*
|
|
269
|
-
* @param
|
|
269
|
+
* @param $scanners
|
|
270
270
|
* @param bool $required
|
|
271
271
|
*
|
|
272
272
|
* @throws LexerException
|
|
@@ -329,7 +329,7 @@ class State implements OptionInterface
|
|
|
329
329
|
return new $className(
|
|
330
330
|
$this->createCurrentSourceLocation(),
|
|
331
331
|
$this->level,
|
|
332
|
-
str_repeat($this->getIndentStyle(), $this->getIndentWidth())
|
|
332
|
+
str_repeat((string) $this->getIndentStyle(), (int) $this->getIndentWidth())
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
335
|
|
|
@@ -345,9 +345,9 @@ class State implements OptionInterface
|
|
|
345
345
|
* in scanners as you can simply return it's value without having to check for it to be null.
|
|
346
346
|
*
|
|
347
347
|
*
|
|
348
|
-
* @param $className
|
|
349
|
-
* @param $pattern
|
|
350
|
-
* @param null
|
|
348
|
+
* @param class-string $className
|
|
349
|
+
* @param string $pattern
|
|
350
|
+
* @param string|null $modifiers
|
|
351
351
|
*
|
|
352
352
|
* @return iterable
|
|
353
353
|
*/
|
|
@@ -6,7 +6,7 @@ use Phug\Util\SourceLocationInterface;
|
|
|
6
6
|
|
|
7
7
|
interface TokenInterface
|
|
8
8
|
{
|
|
9
|
-
public function __construct(SourceLocationInterface $sourceLocation = null, $level = null, $indentation = null);
|
|
9
|
+
public function __construct(?SourceLocationInterface $sourceLocation = null, $level = null, $indentation = null);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @return SourceLocationInterface|null
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"email": "torben@talesoft.codes"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"name": "
|
|
15
|
-
"email": "jade-php@selfbuild.fr",
|
|
14
|
+
"name": "kylekatarnls",
|
|
16
15
|
"homepage": "http://github.com/kylekatarnls"
|
|
17
16
|
}
|
|
18
17
|
],
|
|
@@ -25,8 +24,8 @@
|
|
|
25
24
|
"minimum-stability": "dev",
|
|
26
25
|
"require": {
|
|
27
26
|
"php": ">=5.5.0",
|
|
28
|
-
"phug/reader": "^0.2.0 || ^1.0",
|
|
29
|
-
"phug/util": "^1.5"
|
|
27
|
+
"phug/reader": "^0.2.0 || ^1.0 || ^2.0",
|
|
28
|
+
"phug/util": "^1.5 || ^2.0"
|
|
30
29
|
},
|
|
31
30
|
"autoload": {
|
|
32
31
|
"psr-4": {
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
},
|
|
36
35
|
"extra": {
|
|
37
36
|
"branch-alias": {
|
|
38
|
-
"dev-master": "
|
|
37
|
+
"dev-master": "2.x-dev"
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
}
|
|
@@ -4,6 +4,7 @@ namespace Phug\Parser\Event;
|
|
|
4
4
|
|
|
5
5
|
use Phug\Event;
|
|
6
6
|
use Phug\Parser\NodeInterface;
|
|
7
|
+
use Phug\ParserEvent;
|
|
7
8
|
|
|
8
9
|
class NodeEvent extends Event
|
|
9
10
|
{
|
|
@@ -12,8 +13,8 @@ class NodeEvent extends Event
|
|
|
12
13
|
/**
|
|
13
14
|
* NodeEvent constructor.
|
|
14
15
|
*
|
|
15
|
-
* @param $name
|
|
16
|
-
* @param NodeInterface
|
|
16
|
+
* @param ParserEvent::* $name
|
|
17
|
+
* @param NodeInterface $node
|
|
17
18
|
*/
|
|
18
19
|
public function __construct($name, NodeInterface $node)
|
|
19
20
|
{
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\AttributesInterface;
|
|
7
|
+
use Phug\Util\OrderableInterface;
|
|
6
8
|
use Phug\Util\Partial\AttributeTrait;
|
|
7
9
|
use Phug\Util\Partial\NameTrait;
|
|
10
|
+
use Phug\Util\Partial\OrderTrait;
|
|
8
11
|
|
|
9
|
-
class AssignmentNode extends Node
|
|
12
|
+
class AssignmentNode extends Node implements AttributesInterface, OrderableInterface
|
|
10
13
|
{
|
|
11
14
|
use NameTrait;
|
|
12
15
|
use AttributeTrait;
|
|
16
|
+
use OrderTrait;
|
|
13
17
|
}
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\OrderableInterface;
|
|
6
7
|
use Phug\Util\Partial\CheckTrait;
|
|
7
8
|
use Phug\Util\Partial\EscapeTrait;
|
|
8
9
|
use Phug\Util\Partial\NameTrait;
|
|
10
|
+
use Phug\Util\Partial\OrderTrait;
|
|
9
11
|
use Phug\Util\Partial\ValueTrait;
|
|
10
12
|
use Phug\Util\Partial\VariadicTrait;
|
|
11
13
|
|
|
12
|
-
class AttributeNode extends Node
|
|
14
|
+
class AttributeNode extends Node implements OrderableInterface
|
|
13
15
|
{
|
|
14
16
|
use NameTrait;
|
|
15
17
|
use ValueTrait;
|
|
16
18
|
use EscapeTrait;
|
|
17
19
|
use CheckTrait;
|
|
18
20
|
use VariadicTrait;
|
|
21
|
+
use OrderTrait;
|
|
19
22
|
}
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\AttributesInterface;
|
|
7
|
+
use Phug\Util\AttributesOrderInterface;
|
|
6
8
|
use Phug\Util\Partial\AssignmentTrait;
|
|
9
|
+
use Phug\Util\Partial\AttributesOrderTrait;
|
|
7
10
|
use Phug\Util\Partial\AttributeTrait;
|
|
8
11
|
use Phug\Util\Partial\NameTrait;
|
|
9
12
|
|
|
10
|
-
class ElementNode extends Node
|
|
13
|
+
class ElementNode extends Node implements AttributesInterface, AttributesOrderInterface
|
|
11
14
|
{
|
|
12
15
|
use NameTrait;
|
|
13
16
|
use AttributeTrait;
|
|
14
17
|
use AssignmentTrait;
|
|
18
|
+
use AttributesOrderTrait;
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* @var bool
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\AttributesInterface;
|
|
6
7
|
use Phug\Util\Partial\AttributeTrait;
|
|
7
8
|
use Phug\Util\Partial\NameTrait;
|
|
8
9
|
|
|
9
|
-
class FilterNode extends Node
|
|
10
|
+
class FilterNode extends Node implements AttributesInterface
|
|
10
11
|
{
|
|
11
12
|
use NameTrait;
|
|
12
13
|
use AttributeTrait;
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\AttributesInterface;
|
|
7
|
+
use Phug\Util\AttributesOrderInterface;
|
|
6
8
|
use Phug\Util\Partial\AssignmentTrait;
|
|
9
|
+
use Phug\Util\Partial\AttributesOrderTrait;
|
|
7
10
|
use Phug\Util\Partial\AttributeTrait;
|
|
8
11
|
use Phug\Util\Partial\NameTrait;
|
|
9
12
|
|
|
10
|
-
class MixinCallNode extends Node
|
|
13
|
+
class MixinCallNode extends Node implements AttributesInterface, AttributesOrderInterface
|
|
11
14
|
{
|
|
12
15
|
use NameTrait;
|
|
13
16
|
use AttributeTrait;
|
|
14
17
|
use AssignmentTrait;
|
|
18
|
+
use AttributesOrderTrait;
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* @var bool
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
namespace Phug\Parser\Node;
|
|
4
4
|
|
|
5
5
|
use Phug\Parser\Node;
|
|
6
|
+
use Phug\Util\AttributesInterface;
|
|
7
|
+
use Phug\Util\AttributesOrderInterface;
|
|
6
8
|
use Phug\Util\Partial\AssignmentTrait;
|
|
9
|
+
use Phug\Util\Partial\AttributesOrderTrait;
|
|
7
10
|
use Phug\Util\Partial\AttributeTrait;
|
|
8
11
|
use Phug\Util\Partial\NameTrait;
|
|
9
12
|
|
|
10
|
-
class MixinNode extends Node
|
|
13
|
+
class MixinNode extends Node implements AttributesInterface, AttributesOrderInterface
|
|
11
14
|
{
|
|
12
15
|
use NameTrait;
|
|
13
16
|
use AttributeTrait;
|
|
14
17
|
use AssignmentTrait;
|
|
18
|
+
use AttributesOrderTrait;
|
|
15
19
|
}
|
|
@@ -34,11 +34,11 @@ class Node extends AstNode implements NodeInterface
|
|
|
34
34
|
* @param TokenInterface $token the token that created the node
|
|
35
35
|
*/
|
|
36
36
|
public function __construct(
|
|
37
|
-
TokenInterface $token = null,
|
|
38
|
-
SourceLocationInterface $sourceLocation = null,
|
|
37
|
+
?TokenInterface $token = null,
|
|
38
|
+
?SourceLocationInterface $sourceLocation = null,
|
|
39
39
|
$level = null,
|
|
40
|
-
NodeInterface $parent = null,
|
|
41
|
-
array $children = null
|
|
40
|
+
?NodeInterface $parent = null,
|
|
41
|
+
?array $children = null
|
|
42
42
|
) {
|
|
43
43
|
parent::__construct($parent, $children);
|
|
44
44
|
|
|
@@ -77,7 +77,7 @@ class Node extends AstNode implements NodeInterface
|
|
|
77
77
|
*
|
|
78
78
|
* @return $this
|
|
79
79
|
*/
|
|
80
|
-
public function setOuterNode(NodeInterface $node = null)
|
|
80
|
+
public function setOuterNode(?NodeInterface $node = null)
|
|
81
81
|
{
|
|
82
82
|
$this->outerNode = $node;
|
|
83
83
|
|
|
@@ -101,7 +101,7 @@ class State implements OptionInterface, EventManagerInterface
|
|
|
101
101
|
*/
|
|
102
102
|
private $interpolationNodes;
|
|
103
103
|
|
|
104
|
-
public function __construct(Parser $parser, \Iterator $tokens, array $options = null)
|
|
104
|
+
public function __construct(Parser $parser, \Iterator $tokens, ?array $options = null)
|
|
105
105
|
{
|
|
106
106
|
$this->parser = $parser;
|
|
107
107
|
$this->level = 0;
|
|
@@ -329,7 +329,7 @@ class State implements OptionInterface, EventManagerInterface
|
|
|
329
329
|
*
|
|
330
330
|
* @return $this
|
|
331
331
|
*/
|
|
332
|
-
public function handleToken(TokenInterface $token = null)
|
|
332
|
+
public function handleToken(?TokenInterface $token = null)
|
|
333
333
|
{
|
|
334
334
|
$token = $token ?: $this->getToken();
|
|
335
335
|
$className = get_class($token);
|
|
@@ -534,7 +534,7 @@ class State implements OptionInterface, EventManagerInterface
|
|
|
534
534
|
*
|
|
535
535
|
* @return Node The newly created node
|
|
536
536
|
*/
|
|
537
|
-
public function createNode($className, TokenInterface $token = null)
|
|
537
|
+
public function createNode($className, ?TokenInterface $token = null)
|
|
538
538
|
{
|
|
539
539
|
if (!is_subclass_of($className, Node::class)) {
|
|
540
540
|
throw new \InvalidArgumentException(
|
|
@@ -630,7 +630,7 @@ class State implements OptionInterface, EventManagerInterface
|
|
|
630
630
|
*
|
|
631
631
|
* @throws ParserException
|
|
632
632
|
*/
|
|
633
|
-
public function throwException($message, $code = 0, TokenInterface $relatedToken = null, $previous = null)
|
|
633
|
+
public function throwException($message, $code = 0, ?TokenInterface $relatedToken = null, $previous = null)
|
|
634
634
|
{
|
|
635
635
|
$lexer = $this->parser->getLexer();
|
|
636
636
|
//This will basically check for a source location for this Node. The process is like:
|