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
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
namespace Symfony\Component\VarDumper\Caster;
|
|
13
13
|
|
|
14
|
+
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
|
14
15
|
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
|
|
15
16
|
use Symfony\Component\VarDumper\Cloner\Stub;
|
|
16
17
|
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
|
@@ -20,13 +21,15 @@ use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
|
|
20
21
|
*
|
|
21
22
|
* @author Nicolas Grekas <p@tchwork.com>
|
|
22
23
|
*
|
|
23
|
-
* @final
|
|
24
|
+
* @final
|
|
25
|
+
*
|
|
26
|
+
* @internal since Symfony 7.3
|
|
24
27
|
*/
|
|
25
28
|
class ExceptionCaster
|
|
26
29
|
{
|
|
27
|
-
public static $srcContext = 1;
|
|
28
|
-
public static $traceArgs = true;
|
|
29
|
-
public static $errorTypes = [
|
|
30
|
+
public static int $srcContext = 1;
|
|
31
|
+
public static bool $traceArgs = true;
|
|
32
|
+
public static array $errorTypes = [
|
|
30
33
|
\E_DEPRECATED => 'E_DEPRECATED',
|
|
31
34
|
\E_USER_DEPRECATED => 'E_USER_DEPRECATED',
|
|
32
35
|
\E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
|
|
@@ -41,22 +44,22 @@ class ExceptionCaster
|
|
|
41
44
|
\E_USER_ERROR => 'E_USER_ERROR',
|
|
42
45
|
\E_USER_WARNING => 'E_USER_WARNING',
|
|
43
46
|
\E_USER_NOTICE => 'E_USER_NOTICE',
|
|
44
|
-
|
|
47
|
+
2048 => 'E_STRICT',
|
|
45
48
|
];
|
|
46
49
|
|
|
47
|
-
private static $framesCache = [];
|
|
50
|
+
private static array $framesCache = [];
|
|
48
51
|
|
|
49
|
-
public static function castError(\Error $e, array $a, Stub $stub, $isNested, $filter = 0)
|
|
52
|
+
public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
50
53
|
{
|
|
51
54
|
return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
public static function castException(\Exception $e, array $a, Stub $stub, $isNested, $filter = 0)
|
|
57
|
+
public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
55
58
|
{
|
|
56
59
|
return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
public static function castErrorException(\ErrorException $e, array $a, Stub $stub, $isNested)
|
|
62
|
+
public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested): array
|
|
60
63
|
{
|
|
61
64
|
if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) {
|
|
62
65
|
$a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
|
|
@@ -65,7 +68,7 @@ class ExceptionCaster
|
|
|
65
68
|
return $a;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, $isNested)
|
|
71
|
+
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested): array
|
|
69
72
|
{
|
|
70
73
|
$trace = Caster::PREFIX_VIRTUAL.'trace';
|
|
71
74
|
$prefix = Caster::PREFIX_PROTECTED;
|
|
@@ -83,7 +86,7 @@ class ExceptionCaster
|
|
|
83
86
|
return $a;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, $isNested)
|
|
89
|
+
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested): array
|
|
87
90
|
{
|
|
88
91
|
$sPrefix = "\0".SilencedErrorContext::class."\0";
|
|
89
92
|
|
|
@@ -110,7 +113,7 @@ class ExceptionCaster
|
|
|
110
113
|
return $a;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $isNested)
|
|
116
|
+
public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested): array
|
|
114
117
|
{
|
|
115
118
|
if (!$isNested) {
|
|
116
119
|
return $a;
|
|
@@ -138,10 +141,10 @@ class ExceptionCaster
|
|
|
138
141
|
|
|
139
142
|
$frame = new FrameStub(
|
|
140
143
|
[
|
|
141
|
-
'object' =>
|
|
142
|
-
'class' =>
|
|
143
|
-
'type' =>
|
|
144
|
-
'function' =>
|
|
144
|
+
'object' => $f['object'] ?? null,
|
|
145
|
+
'class' => $f['class'] ?? null,
|
|
146
|
+
'type' => $f['type'] ?? null,
|
|
147
|
+
'function' => $f['function'] ?? null,
|
|
145
148
|
] + $frames[$i - 1],
|
|
146
149
|
false,
|
|
147
150
|
true
|
|
@@ -149,7 +152,7 @@ class ExceptionCaster
|
|
|
149
152
|
$f = self::castFrameStub($frame, [], $frame, true);
|
|
150
153
|
if (isset($f[$prefix.'src'])) {
|
|
151
154
|
foreach ($f[$prefix.'src']->value as $label => $frame) {
|
|
152
|
-
if (
|
|
155
|
+
if (str_starts_with($label, "\0~collapse=0")) {
|
|
153
156
|
if ($collapse) {
|
|
154
157
|
$label = substr_replace($label, '1', 11, 1);
|
|
155
158
|
} else {
|
|
@@ -160,7 +163,7 @@ class ExceptionCaster
|
|
|
160
163
|
}
|
|
161
164
|
$f = $frames[$i - 1];
|
|
162
165
|
if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) {
|
|
163
|
-
$frame->value['arguments'] = new ArgsStub($f['args'],
|
|
166
|
+
$frame->value['arguments'] = new ArgsStub($f['args'], $f['function'] ?? null, $f['class'] ?? null);
|
|
164
167
|
}
|
|
165
168
|
} elseif ('???' !== $lastCall) {
|
|
166
169
|
$label = new ClassStub($lastCall);
|
|
@@ -173,7 +176,7 @@ class ExceptionCaster
|
|
|
173
176
|
} else {
|
|
174
177
|
$label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall;
|
|
175
178
|
}
|
|
176
|
-
$a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
|
|
179
|
+
$a[substr_replace($label, \sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
|
|
177
180
|
|
|
178
181
|
$lastCall = $call;
|
|
179
182
|
}
|
|
@@ -184,7 +187,7 @@ class ExceptionCaster
|
|
|
184
187
|
return $a;
|
|
185
188
|
}
|
|
186
189
|
|
|
187
|
-
public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $isNested)
|
|
190
|
+
public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested): array
|
|
188
191
|
{
|
|
189
192
|
if (!$isNested) {
|
|
190
193
|
return $a;
|
|
@@ -209,23 +212,29 @@ class ExceptionCaster
|
|
|
209
212
|
$srcKey = $f['file'];
|
|
210
213
|
$ellipsis = new LinkStub($srcKey, 0);
|
|
211
214
|
$srcAttr = 'collapse='.(int) $ellipsis->inVendor;
|
|
212
|
-
$ellipsisTail =
|
|
213
|
-
$ellipsis =
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
if (!empty($f['class']) &&
|
|
217
|
-
$template =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
$
|
|
215
|
+
$ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0;
|
|
216
|
+
$ellipsis = $ellipsis->attr['ellipsis'] ?? 0;
|
|
217
|
+
|
|
218
|
+
if (is_file($f['file']) && 0 <= self::$srcContext) {
|
|
219
|
+
if (!empty($f['class']) && is_subclass_of($f['class'], 'Twig\Template')) {
|
|
220
|
+
$template = null;
|
|
221
|
+
if (isset($f['object'])) {
|
|
222
|
+
$template = $f['object'];
|
|
223
|
+
} elseif ((new \ReflectionClass($f['class']))->isInstantiable()) {
|
|
224
|
+
$template = unserialize(\sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
|
|
225
|
+
}
|
|
226
|
+
if (null !== $template) {
|
|
227
|
+
$ellipsis = 0;
|
|
228
|
+
$templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : '');
|
|
229
|
+
$templateInfo = $template->getDebugInfo();
|
|
230
|
+
if (isset($templateInfo[$f['line']])) {
|
|
231
|
+
if (!method_exists($template, 'getSourceContext') || !is_file($templatePath = $template->getSourceContext()->getPath())) {
|
|
232
|
+
$templatePath = null;
|
|
233
|
+
}
|
|
234
|
+
if ($templateSrc) {
|
|
235
|
+
$src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f);
|
|
236
|
+
$srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']];
|
|
237
|
+
}
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
240
|
}
|
|
@@ -236,7 +245,7 @@ class ExceptionCaster
|
|
|
236
245
|
$ellipsis += 1 + \strlen($f['line']);
|
|
237
246
|
}
|
|
238
247
|
}
|
|
239
|
-
$srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
|
|
248
|
+
$srcAttr .= \sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
|
|
240
249
|
} else {
|
|
241
250
|
$srcAttr .= '&separator=:';
|
|
242
251
|
}
|
|
@@ -261,6 +270,16 @@ class ExceptionCaster
|
|
|
261
270
|
return $a;
|
|
262
271
|
}
|
|
263
272
|
|
|
273
|
+
public static function castFlattenException(FlattenException $e, array $a, Stub $stub, bool $isNested): array
|
|
274
|
+
{
|
|
275
|
+
if ($isNested) {
|
|
276
|
+
$k = \sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString');
|
|
277
|
+
$a[$k] = new CutStub($a[$k]);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return $a;
|
|
281
|
+
}
|
|
282
|
+
|
|
264
283
|
private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array
|
|
265
284
|
{
|
|
266
285
|
if (isset($a[$xPrefix.'trace'])) {
|
|
@@ -279,12 +298,10 @@ class ExceptionCaster
|
|
|
279
298
|
if (empty($a[$xPrefix.'previous'])) {
|
|
280
299
|
unset($a[$xPrefix.'previous']);
|
|
281
300
|
}
|
|
282
|
-
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message']
|
|
301
|
+
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message']);
|
|
283
302
|
|
|
284
|
-
if (isset($a[Caster::PREFIX_PROTECTED.'message']) &&
|
|
285
|
-
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/',
|
|
286
|
-
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
|
|
287
|
-
}, $a[Caster::PREFIX_PROTECTED.'message']);
|
|
303
|
+
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) {
|
|
304
|
+
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $a[Caster::PREFIX_PROTECTED.'message']);
|
|
288
305
|
}
|
|
289
306
|
|
|
290
307
|
if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
|
|
@@ -312,7 +329,7 @@ class ExceptionCaster
|
|
|
312
329
|
$src = [];
|
|
313
330
|
|
|
314
331
|
for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) {
|
|
315
|
-
$src[] = (
|
|
332
|
+
$src[] = ($srcLines[$i] ?? '')."\n";
|
|
316
333
|
}
|
|
317
334
|
|
|
318
335
|
if ($frame['function'] ?? false) {
|
|
@@ -331,7 +348,7 @@ class ExceptionCaster
|
|
|
331
348
|
$stub->attr['file'] = $f;
|
|
332
349
|
$stub->attr['line'] = $caller->getStartLine();
|
|
333
350
|
}
|
|
334
|
-
} catch (\ReflectionException
|
|
351
|
+
} catch (\ReflectionException) {
|
|
335
352
|
// ignore fake class/function
|
|
336
353
|
}
|
|
337
354
|
|
|
@@ -346,9 +363,7 @@ class ExceptionCaster
|
|
|
346
363
|
$pad = null;
|
|
347
364
|
for ($i = $srcContext << 1; $i >= 0; --$i) {
|
|
348
365
|
if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) {
|
|
349
|
-
|
|
350
|
-
$pad = $c;
|
|
351
|
-
}
|
|
366
|
+
$pad ??= $c;
|
|
352
367
|
if ((' ' !== $c && "\t" !== $c) || $pad !== $c) {
|
|
353
368
|
break;
|
|
354
369
|
}
|
|
@@ -374,7 +389,7 @@ class ExceptionCaster
|
|
|
374
389
|
}
|
|
375
390
|
}
|
|
376
391
|
$c->attr['lang'] = $lang;
|
|
377
|
-
$srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
|
392
|
+
$srcLines[\sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
|
378
393
|
}
|
|
379
394
|
|
|
380
395
|
return new EnumStub($srcLines);
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* This file is part of the Symfony package.
|
|
5
|
+
*
|
|
6
|
+
* (c) Fabien Potencier <fabien@symfony.com>
|
|
7
|
+
*
|
|
8
|
+
* For the full copyright and license information, please view the LICENSE
|
|
9
|
+
* file that was distributed with this source code.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
namespace Symfony\Component\VarDumper\Caster;
|
|
13
|
+
|
|
14
|
+
use FFI\CData;
|
|
15
|
+
use FFI\CType;
|
|
16
|
+
use Symfony\Component\VarDumper\Cloner\Stub;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Casts FFI extension classes to array representation.
|
|
20
|
+
*
|
|
21
|
+
* @author Nesmeyanov Kirill <nesk@xakep.ru>
|
|
22
|
+
*/
|
|
23
|
+
final class FFICaster
|
|
24
|
+
{
|
|
25
|
+
/**
|
|
26
|
+
* In case of "char*" contains a string, the length of which depends on
|
|
27
|
+
* some other parameter, then during the generation of the string it is
|
|
28
|
+
* possible to go beyond the allowable memory area.
|
|
29
|
+
*
|
|
30
|
+
* This restriction serves to ensure that processing does not take
|
|
31
|
+
* up the entire allowable PHP memory limit.
|
|
32
|
+
*/
|
|
33
|
+
private const MAX_STRING_LENGTH = 255;
|
|
34
|
+
|
|
35
|
+
public static function castCTypeOrCData(CData|CType $data, array $args, Stub $stub): array
|
|
36
|
+
{
|
|
37
|
+
if ($data instanceof CType) {
|
|
38
|
+
$type = $data;
|
|
39
|
+
$data = null;
|
|
40
|
+
} else {
|
|
41
|
+
$type = \FFI::typeof($data);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
$stub->class = \sprintf('%s<%s> size %d align %d', ($data ?? $type)::class, $type->getName(), $type->getSize(), $type->getAlignment());
|
|
45
|
+
|
|
46
|
+
return match ($type->getKind()) {
|
|
47
|
+
CType::TYPE_FLOAT,
|
|
48
|
+
CType::TYPE_DOUBLE,
|
|
49
|
+
\defined('\FFI\CType::TYPE_LONGDOUBLE') ? CType::TYPE_LONGDOUBLE : -1,
|
|
50
|
+
CType::TYPE_UINT8,
|
|
51
|
+
CType::TYPE_SINT8,
|
|
52
|
+
CType::TYPE_UINT16,
|
|
53
|
+
CType::TYPE_SINT16,
|
|
54
|
+
CType::TYPE_UINT32,
|
|
55
|
+
CType::TYPE_SINT32,
|
|
56
|
+
CType::TYPE_UINT64,
|
|
57
|
+
CType::TYPE_SINT64,
|
|
58
|
+
CType::TYPE_BOOL,
|
|
59
|
+
CType::TYPE_CHAR,
|
|
60
|
+
CType::TYPE_ENUM => null !== $data ? [Caster::PREFIX_VIRTUAL.'cdata' => $data->cdata] : [],
|
|
61
|
+
CType::TYPE_POINTER => self::castFFIPointer($stub, $type, $data),
|
|
62
|
+
CType::TYPE_STRUCT => self::castFFIStructLike($type, $data),
|
|
63
|
+
CType::TYPE_FUNC => self::castFFIFunction($stub, $type),
|
|
64
|
+
default => $args,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private static function castFFIFunction(Stub $stub, CType $type): array
|
|
69
|
+
{
|
|
70
|
+
$arguments = [];
|
|
71
|
+
|
|
72
|
+
for ($i = 0, $count = $type->getFuncParameterCount(); $i < $count; ++$i) {
|
|
73
|
+
$param = $type->getFuncParameterType($i);
|
|
74
|
+
|
|
75
|
+
$arguments[] = $param->getName();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
$abi = match ($type->getFuncABI()) {
|
|
79
|
+
CType::ABI_DEFAULT,
|
|
80
|
+
CType::ABI_CDECL => '[cdecl]',
|
|
81
|
+
CType::ABI_FASTCALL => '[fastcall]',
|
|
82
|
+
CType::ABI_THISCALL => '[thiscall]',
|
|
83
|
+
CType::ABI_STDCALL => '[stdcall]',
|
|
84
|
+
CType::ABI_PASCAL => '[pascal]',
|
|
85
|
+
CType::ABI_REGISTER => '[register]',
|
|
86
|
+
CType::ABI_MS => '[ms]',
|
|
87
|
+
CType::ABI_SYSV => '[sysv]',
|
|
88
|
+
CType::ABI_VECTORCALL => '[vectorcall]',
|
|
89
|
+
default => '[unknown abi]',
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
$returnType = $type->getFuncReturnType();
|
|
93
|
+
|
|
94
|
+
$stub->class = $abi.' callable('.implode(', ', $arguments).'): '
|
|
95
|
+
.$returnType->getName();
|
|
96
|
+
|
|
97
|
+
return [Caster::PREFIX_VIRTUAL.'returnType' => $returnType];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private static function castFFIPointer(Stub $stub, CType $type, ?CData $data = null): array
|
|
101
|
+
{
|
|
102
|
+
$ptr = $type->getPointerType();
|
|
103
|
+
|
|
104
|
+
if (null === $data) {
|
|
105
|
+
return [Caster::PREFIX_VIRTUAL.'0' => $ptr];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return match ($ptr->getKind()) {
|
|
109
|
+
CType::TYPE_CHAR => [Caster::PREFIX_VIRTUAL.'cdata' => self::castFFIStringValue($data)],
|
|
110
|
+
CType::TYPE_FUNC => self::castFFIFunction($stub, $ptr),
|
|
111
|
+
default => [Caster::PREFIX_VIRTUAL.'cdata' => $data[0]],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private static function castFFIStringValue(CData $data): string|CutStub
|
|
116
|
+
{
|
|
117
|
+
$result = [];
|
|
118
|
+
$ffi = \FFI::cdef(<<<C
|
|
119
|
+
size_t zend_get_page_size(void);
|
|
120
|
+
C);
|
|
121
|
+
|
|
122
|
+
$pageSize = $ffi->zend_get_page_size();
|
|
123
|
+
|
|
124
|
+
// get cdata address
|
|
125
|
+
$start = $ffi->cast('uintptr_t', $ffi->cast('char*', $data))->cdata;
|
|
126
|
+
// accessing memory in the same page as $start is safe
|
|
127
|
+
$max = min(self::MAX_STRING_LENGTH, ($start | ($pageSize - 1)) - $start);
|
|
128
|
+
|
|
129
|
+
for ($i = 0; $i < $max; ++$i) {
|
|
130
|
+
$result[$i] = $data[$i];
|
|
131
|
+
|
|
132
|
+
if ("\0" === $data[$i]) {
|
|
133
|
+
return implode('', $result);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
$string = implode('', $result);
|
|
138
|
+
$stub = new CutStub($string);
|
|
139
|
+
$stub->cut = -1;
|
|
140
|
+
$stub->value = $string;
|
|
141
|
+
|
|
142
|
+
return $stub;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private static function castFFIStructLike(CType $type, ?CData $data = null): array
|
|
146
|
+
{
|
|
147
|
+
$isUnion = ($type->getAttributes() & CType::ATTR_UNION) === CType::ATTR_UNION;
|
|
148
|
+
|
|
149
|
+
$result = [];
|
|
150
|
+
|
|
151
|
+
foreach ($type->getStructFieldNames() as $name) {
|
|
152
|
+
$field = $type->getStructFieldType($name);
|
|
153
|
+
|
|
154
|
+
// Retrieving the value of a field from a union containing
|
|
155
|
+
// a pointer is not a safe operation, because may contain
|
|
156
|
+
// incorrect data.
|
|
157
|
+
$isUnsafe = $isUnion && CType::TYPE_POINTER === $field->getKind();
|
|
158
|
+
|
|
159
|
+
if ($isUnsafe) {
|
|
160
|
+
$result[Caster::PREFIX_VIRTUAL.$name.'?'] = $field;
|
|
161
|
+
} elseif (null === $data) {
|
|
162
|
+
$result[Caster::PREFIX_VIRTUAL.$name] = $field;
|
|
163
|
+
} else {
|
|
164
|
+
$fieldName = $data->{$name} instanceof CData ? '' : $field->getName().' ';
|
|
165
|
+
$result[Caster::PREFIX_VIRTUAL.$fieldName.$name] = $data->{$name};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return $result;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* This file is part of the Symfony package.
|
|
5
|
+
*
|
|
6
|
+
* (c) Fabien Potencier <fabien@symfony.com>
|
|
7
|
+
*
|
|
8
|
+
* For the full copyright and license information, please view the LICENSE
|
|
9
|
+
* file that was distributed with this source code.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
namespace Symfony\Component\VarDumper\Caster;
|
|
13
|
+
|
|
14
|
+
use Symfony\Component\VarDumper\Cloner\Stub;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Casts Fiber related classes to array representation.
|
|
18
|
+
*
|
|
19
|
+
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
|
20
|
+
*/
|
|
21
|
+
final class FiberCaster
|
|
22
|
+
{
|
|
23
|
+
public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
24
|
+
{
|
|
25
|
+
$prefix = Caster::PREFIX_VIRTUAL;
|
|
26
|
+
|
|
27
|
+
if ($fiber->isTerminated()) {
|
|
28
|
+
$status = 'terminated';
|
|
29
|
+
} elseif ($fiber->isRunning()) {
|
|
30
|
+
$status = 'running';
|
|
31
|
+
} elseif ($fiber->isSuspended()) {
|
|
32
|
+
$status = 'suspended';
|
|
33
|
+
} elseif ($fiber->isStarted()) {
|
|
34
|
+
$status = 'started';
|
|
35
|
+
} else {
|
|
36
|
+
$status = 'not started';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$a[$prefix.'status'] = $status;
|
|
40
|
+
|
|
41
|
+
return $a;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -18,13 +18,11 @@ namespace Symfony\Component\VarDumper\Caster;
|
|
|
18
18
|
*/
|
|
19
19
|
class FrameStub extends EnumStub
|
|
20
20
|
{
|
|
21
|
-
public
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
$
|
|
27
|
-
$this->keepArgs = $keepArgs;
|
|
28
|
-
$this->inTraceStub = $inTraceStub;
|
|
21
|
+
public function __construct(
|
|
22
|
+
array $frame,
|
|
23
|
+
public bool $keepArgs = true,
|
|
24
|
+
public bool $inTraceStub = false,
|
|
25
|
+
) {
|
|
26
|
+
parent::__construct($frame);
|
|
29
27
|
}
|
|
30
28
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* This file is part of the Symfony package.
|
|
5
|
+
*
|
|
6
|
+
* (c) Fabien Potencier <fabien@symfony.com>
|
|
7
|
+
*
|
|
8
|
+
* For the full copyright and license information, please view the LICENSE
|
|
9
|
+
* file that was distributed with this source code.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
namespace Symfony\Component\VarDumper\Caster;
|
|
13
|
+
|
|
14
|
+
use Symfony\Component\VarDumper\Cloner\Stub;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @author Nicolas Grekas <p@tchwork.com>
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
final class GdCaster
|
|
22
|
+
{
|
|
23
|
+
public static function castGd(\GdImage $gd, array $a, Stub $stub, bool $isNested): array
|
|
24
|
+
{
|
|
25
|
+
$a[Caster::PREFIX_VIRTUAL.'size'] = imagesx($gd).'x'.imagesy($gd);
|
|
26
|
+
$a[Caster::PREFIX_VIRTUAL.'trueColor'] = imageistruecolor($gd);
|
|
27
|
+
|
|
28
|
+
return $a;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -19,11 +19,13 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
|
|
19
19
|
* @author Hamza Amrouche <hamza.simperfit@gmail.com>
|
|
20
20
|
* @author Nicolas Grekas <p@tchwork.com>
|
|
21
21
|
*
|
|
22
|
-
* @final
|
|
22
|
+
* @final
|
|
23
|
+
*
|
|
24
|
+
* @internal since Symfony 7.3
|
|
23
25
|
*/
|
|
24
26
|
class GmpCaster
|
|
25
27
|
{
|
|
26
|
-
public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array
|
|
28
|
+
public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array
|
|
27
29
|
{
|
|
28
30
|
$a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp));
|
|
29
31
|
|
|
@@ -16,7 +16,7 @@ namespace Symfony\Component\VarDumper\Caster;
|
|
|
16
16
|
*/
|
|
17
17
|
class ImgStub extends ConstStub
|
|
18
18
|
{
|
|
19
|
-
public function __construct(string $data, string $contentType, string $size)
|
|
19
|
+
public function __construct(string $data, string $contentType, string $size = '')
|
|
20
20
|
{
|
|
21
21
|
$this->value = '';
|
|
22
22
|
$this->attr['img-data'] = $data;
|
|
@@ -17,11 +17,13 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
|
|
17
17
|
* @author Nicolas Grekas <p@tchwork.com>
|
|
18
18
|
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
|
19
19
|
*
|
|
20
|
-
* @final
|
|
20
|
+
* @final
|
|
21
|
+
*
|
|
22
|
+
* @internal since Symfony 7.3
|
|
21
23
|
*/
|
|
22
24
|
class IntlCaster
|
|
23
25
|
{
|
|
24
|
-
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested)
|
|
26
|
+
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested): array
|
|
25
27
|
{
|
|
26
28
|
$a += [
|
|
27
29
|
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
|
@@ -31,7 +33,7 @@ class IntlCaster
|
|
|
31
33
|
return self::castError($c, $a);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
|
|
36
|
+
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
35
37
|
{
|
|
36
38
|
$a += [
|
|
37
39
|
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
|
@@ -102,13 +104,13 @@ class IntlCaster
|
|
|
102
104
|
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
|
|
103
105
|
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
|
|
104
106
|
]
|
|
105
|
-
|
|
107
|
+
),
|
|
106
108
|
];
|
|
107
109
|
|
|
108
110
|
return self::castError($c, $a);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
|
-
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested)
|
|
113
|
+
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested): array
|
|
112
114
|
{
|
|
113
115
|
$a += [
|
|
114
116
|
Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(),
|
|
@@ -125,7 +127,7 @@ class IntlCaster
|
|
|
125
127
|
return self::castError($c, $a);
|
|
126
128
|
}
|
|
127
129
|
|
|
128
|
-
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0)
|
|
130
|
+
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
129
131
|
{
|
|
130
132
|
$a += [
|
|
131
133
|
Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
|
|
@@ -142,7 +144,7 @@ class IntlCaster
|
|
|
142
144
|
return self::castError($c, $a);
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
|
|
147
|
+
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array
|
|
146
148
|
{
|
|
147
149
|
$a += [
|
|
148
150
|
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
|
@@ -158,7 +160,7 @@ class IntlCaster
|
|
|
158
160
|
return self::castError($c, $a);
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
private static function castError($c, array $a): array
|
|
163
|
+
private static function castError(object $c, array $a): array
|
|
162
164
|
{
|
|
163
165
|
if ($errorCode = $c->getErrorCode()) {
|
|
164
166
|
$a += [
|