From 91afc8e679ce6e5af8c8dd22466da9469c6a02e3 Mon Sep 17 00:00:00 2001 From: Alexander Kovac Date: Mon, 26 Feb 2024 13:31:32 +0100 Subject: [PATCH 01/21] tested integration git submodul in IDE --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 671bb84..b933d01 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,7 @@ Date: Wed, 28 Feb 2024 13:29:03 +0100 Subject: [PATCH 02/21] Creating the PaypalPayment Gateway class --- src/PayPalPayment.php | 211 + vendor/bin/php-parse | 119 + vendor/bin/phpunit | 122 + vendor/bin/yaml-lint | 119 + vendor/claviska/simpleimage/composer.lock | 209 + .../simpleimage/src/claviska/SimpleImage.php | 2385 +++++++ vendor/composer/autoload_files.php | 18 + vendor/composer/semver/phpstan-baseline.neon | 11 + vendor/composer/semver/src/Comparator.php | 113 + .../composer/semver/src/CompilingMatcher.php | 94 + .../composer/semver/src/Constraint/Bound.php | 122 + .../semver/src/Constraint/Constraint.php | 435 ++ .../src/Constraint/ConstraintInterface.php | 75 + .../src/Constraint/MatchAllConstraint.php | 85 + .../src/Constraint/MatchNoneConstraint.php | 83 + .../semver/src/Constraint/MultiConstraint.php | 325 + vendor/composer/semver/src/Interval.php | 98 + vendor/composer/semver/src/Intervals.php | 478 ++ vendor/composer/semver/src/Semver.php | 129 + vendor/composer/semver/src/VersionParser.php | 586 ++ .../Exception/ExceptionInterface.php | 14 + .../Exception/InvalidArgumentException.php | 52 + .../Exception/UnexpectedValueException.php | 61 + .../Doctrine/Instantiator/Instantiator.php | 255 + .../Instantiator/InstantiatorInterface.php | 24 + .../src/Whoops/Exception/ErrorException.php | 17 + .../whoops/src/Whoops/Exception/Formatter.php | 77 + .../whoops/src/Whoops/Exception/Frame.php | 311 + .../src/Whoops/Exception/FrameCollection.php | 219 + .../whoops/src/Whoops/Exception/Inspector.php | 341 + .../src/Whoops/Handler/CallbackHandler.php | 52 + .../whoops/src/Whoops/Handler/Handler.php | 95 + .../src/Whoops/Handler/HandlerInterface.php | 36 + .../Whoops/Handler/JsonResponseHandler.php | 90 + .../src/Whoops/Handler/PlainTextHandler.php | 359 + .../src/Whoops/Handler/PrettyPageHandler.php | 832 +++ .../src/Whoops/Handler/XmlResponseHandler.php | 108 + .../src/Whoops/Inspector/InspectorFactory.php | 21 + .../Inspector/InspectorFactoryInterface.php | 16 + .../Whoops/Inspector/InspectorInterface.php | 71 + .../whoops/src/Whoops/Resources/css/prism.css | 5 + .../src/Whoops/Resources/css/whoops.base.css | 560 ++ .../src/Whoops/Resources/js/clipboard.min.js | 7 + .../whoops/src/Whoops/Resources/js/prism.js | 8 + .../src/Whoops/Resources/js/whoops.base.js | 188 + .../src/Whoops/Resources/js/zepto.min.js | 2 + .../Resources/views/env_details.html.php | 42 + .../Resources/views/frame_code.html.php | 67 + .../Resources/views/frame_list.html.php | 17 + .../Resources/views/frames_container.html.php | 3 + .../views/frames_description.html.php | 14 + .../Whoops/Resources/views/header.html.php | 96 + .../Resources/views/header_outer.html.php | 3 + .../Whoops/Resources/views/layout.html.php | 34 + .../Resources/views/panel_details.html.php | 2 + .../views/panel_details_outer.html.php | 3 + .../Resources/views/panel_left.html.php | 4 + .../Resources/views/panel_left_outer.html.php | 3 + vendor/filp/whoops/src/Whoops/Run.php | 597 ++ .../filp/whoops/src/Whoops/RunInterface.php | 158 + .../src/Whoops/Util/HtmlDumperOutput.php | 36 + vendor/filp/whoops/src/Whoops/Util/Misc.php | 77 + .../whoops/src/Whoops/Util/SystemFacade.php | 144 + .../whoops/src/Whoops/Util/TemplateHelper.php | 349 + .../laminas/laminas-escaper/src/Escaper.php | 424 ++ .../src/Exception/ExceptionInterface.php | 11 + .../Exception/InvalidArgumentException.php | 13 + .../src/Exception/RuntimeException.php | 13 + vendor/league/color-extractor/src/Color.php | 51 + .../color-extractor/src/ColorExtractor.php | 282 + vendor/league/color-extractor/src/Palette.php | 180 + .../Michelf/SmartyPants.inc.php | 9 + .../php-smartypants/Michelf/SmartyPants.php | 560 ++ .../Michelf/SmartyPantsTypographer.inc.php | 10 + .../Michelf/SmartyPantsTypographer.php | 486 ++ vendor/michelf/php-smartypants/Readme.php | 36 + .../deep-copy/src/DeepCopy/DeepCopy.php | 308 + .../src/DeepCopy/Exception/CloneException.php | 9 + .../DeepCopy/Exception/PropertyException.php | 9 + .../src/DeepCopy/Filter/ChainableFilter.php | 24 + .../Doctrine/DoctrineCollectionFilter.php | 33 + .../DoctrineEmptyCollectionFilter.php | 28 + .../Filter/Doctrine/DoctrineProxyFilter.php | 22 + .../deep-copy/src/DeepCopy/Filter/Filter.php | 18 + .../src/DeepCopy/Filter/KeepFilter.php | 16 + .../src/DeepCopy/Filter/ReplaceFilter.php | 39 + .../src/DeepCopy/Filter/SetNullFilter.php | 24 + .../Matcher/Doctrine/DoctrineProxyMatcher.php | 22 + .../src/DeepCopy/Matcher/Matcher.php | 14 + .../src/DeepCopy/Matcher/PropertyMatcher.php | 39 + .../DeepCopy/Matcher/PropertyNameMatcher.php | 32 + .../DeepCopy/Matcher/PropertyTypeMatcher.php | 52 + .../DeepCopy/Reflection/ReflectionHelper.php | 78 + .../TypeFilter/Date/DateIntervalFilter.php | 33 + .../src/DeepCopy/TypeFilter/ReplaceFilter.php | 30 + .../DeepCopy/TypeFilter/ShallowCopyFilter.php | 17 + .../TypeFilter/Spl/ArrayObjectFilter.php | 36 + .../TypeFilter/Spl/SplDoublyLinkedList.php | 10 + .../Spl/SplDoublyLinkedListFilter.php | 51 + .../src/DeepCopy/TypeFilter/TypeFilter.php | 13 + .../src/DeepCopy/TypeMatcher/TypeMatcher.php | 29 + .../deep-copy/src/DeepCopy/deep_copy.php | 20 + vendor/nikic/php-parser/bin/php-parse | 206 + .../php-parser/lib/PhpParser/Builder.php | 12 + .../lib/PhpParser/Builder/ClassConst.php | 150 + .../lib/PhpParser/Builder/Class_.php | 151 + .../lib/PhpParser/Builder/Declaration.php | 50 + .../lib/PhpParser/Builder/EnumCase.php | 87 + .../lib/PhpParser/Builder/Enum_.php | 116 + .../lib/PhpParser/Builder/FunctionLike.php | 73 + .../lib/PhpParser/Builder/Function_.php | 67 + .../lib/PhpParser/Builder/Interface_.php | 94 + .../lib/PhpParser/Builder/Method.php | 147 + .../lib/PhpParser/Builder/Namespace_.php | 45 + .../lib/PhpParser/Builder/Param.php | 149 + .../lib/PhpParser/Builder/Property.php | 161 + .../lib/PhpParser/Builder/TraitUse.php | 65 + .../PhpParser/Builder/TraitUseAdaptation.php | 145 + .../lib/PhpParser/Builder/Trait_.php | 83 + .../php-parser/lib/PhpParser/Builder/Use_.php | 49 + .../lib/PhpParser/BuilderFactory.php | 375 ++ .../lib/PhpParser/BuilderHelpers.php | 333 + .../php-parser/lib/PhpParser/Comment.php | 207 + .../php-parser/lib/PhpParser/Comment/Doc.php | 6 + .../ConstExprEvaluationException.php | 6 + .../lib/PhpParser/ConstExprEvaluator.php | 234 + .../nikic/php-parser/lib/PhpParser/Error.php | 171 + .../php-parser/lib/PhpParser/ErrorHandler.php | 12 + .../lib/PhpParser/ErrorHandler/Collecting.php | 43 + .../lib/PhpParser/ErrorHandler/Throwing.php | 17 + .../lib/PhpParser/Internal/DiffElem.php | 31 + .../lib/PhpParser/Internal/Differ.php | 178 + .../Internal/PrintableNewAnonClassNode.php | 71 + .../lib/PhpParser/Internal/TokenPolyfill.php | 237 + .../lib/PhpParser/Internal/TokenStream.php | 271 + .../php-parser/lib/PhpParser/JsonDecoder.php | 108 + .../nikic/php-parser/lib/PhpParser/Lexer.php | 116 + .../lib/PhpParser/Lexer/Emulative.php | 226 + .../Lexer/TokenEmulator/AttributeEmulator.php | 49 + .../Lexer/TokenEmulator/EnumTokenEmulator.php | 26 + .../TokenEmulator/ExplicitOctalEmulator.php | 45 + .../Lexer/TokenEmulator/KeywordEmulator.php | 56 + .../TokenEmulator/MatchTokenEmulator.php | 19 + .../TokenEmulator/NullsafeTokenEmulator.php | 60 + .../ReadonlyFunctionTokenEmulator.php | 31 + .../TokenEmulator/ReadonlyTokenEmulator.php | 31 + .../Lexer/TokenEmulator/ReverseEmulator.php | 37 + .../Lexer/TokenEmulator/TokenEmulator.php | 30 + .../php-parser/lib/PhpParser/Modifiers.php | 69 + .../php-parser/lib/PhpParser/NameContext.php | 284 + .../nikic/php-parser/lib/PhpParser/Node.php | 146 + .../php-parser/lib/PhpParser/Node/Arg.php | 44 + .../lib/PhpParser/Node/ArrayItem.php | 43 + .../lib/PhpParser/Node/Attribute.php | 33 + .../lib/PhpParser/Node/AttributeGroup.php | 27 + .../lib/PhpParser/Node/ClosureUse.php | 36 + .../lib/PhpParser/Node/ComplexType.php | 13 + .../php-parser/lib/PhpParser/Node/Const_.php | 36 + .../lib/PhpParser/Node/DeclareItem.php | 37 + .../php-parser/lib/PhpParser/Node/Expr.php | 8 + .../lib/PhpParser/Node/Expr/ArrayDimFetch.php | 33 + .../lib/PhpParser/Node/Expr/ArrayItem.php | 3 + .../lib/PhpParser/Node/Expr/Array_.php | 34 + .../lib/PhpParser/Node/Expr/ArrowFunction.php | 84 + .../lib/PhpParser/Node/Expr/Assign.php | 33 + .../lib/PhpParser/Node/Expr/AssignOp.php | 29 + .../Node/Expr/AssignOp/BitwiseAnd.php | 11 + .../Node/Expr/AssignOp/BitwiseOr.php | 11 + .../Node/Expr/AssignOp/BitwiseXor.php | 11 + .../PhpParser/Node/Expr/AssignOp/Coalesce.php | 11 + .../PhpParser/Node/Expr/AssignOp/Concat.php | 11 + .../lib/PhpParser/Node/Expr/AssignOp/Div.php | 11 + .../PhpParser/Node/Expr/AssignOp/Minus.php | 11 + .../lib/PhpParser/Node/Expr/AssignOp/Mod.php | 11 + .../lib/PhpParser/Node/Expr/AssignOp/Mul.php | 11 + .../lib/PhpParser/Node/Expr/AssignOp/Plus.php | 11 + .../lib/PhpParser/Node/Expr/AssignOp/Pow.php | 11 + .../Node/Expr/AssignOp/ShiftLeft.php | 11 + .../Node/Expr/AssignOp/ShiftRight.php | 11 + .../lib/PhpParser/Node/Expr/AssignRef.php | 33 + .../lib/PhpParser/Node/Expr/BinaryOp.php | 37 + .../Node/Expr/BinaryOp/BitwiseAnd.php | 15 + .../Node/Expr/BinaryOp/BitwiseOr.php | 15 + .../Node/Expr/BinaryOp/BitwiseXor.php | 15 + .../Node/Expr/BinaryOp/BooleanAnd.php | 15 + .../Node/Expr/BinaryOp/BooleanOr.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Coalesce.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Concat.php | 15 + .../lib/PhpParser/Node/Expr/BinaryOp/Div.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Equal.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Greater.php | 15 + .../Node/Expr/BinaryOp/GreaterOrEqual.php | 15 + .../Node/Expr/BinaryOp/Identical.php | 15 + .../Node/Expr/BinaryOp/LogicalAnd.php | 15 + .../Node/Expr/BinaryOp/LogicalOr.php | 15 + .../Node/Expr/BinaryOp/LogicalXor.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Minus.php | 15 + .../lib/PhpParser/Node/Expr/BinaryOp/Mod.php | 15 + .../lib/PhpParser/Node/Expr/BinaryOp/Mul.php | 15 + .../PhpParser/Node/Expr/BinaryOp/NotEqual.php | 15 + .../Node/Expr/BinaryOp/NotIdentical.php | 15 + .../lib/PhpParser/Node/Expr/BinaryOp/Plus.php | 15 + .../lib/PhpParser/Node/Expr/BinaryOp/Pow.php | 15 + .../Node/Expr/BinaryOp/ShiftLeft.php | 15 + .../Node/Expr/BinaryOp/ShiftRight.php | 15 + .../PhpParser/Node/Expr/BinaryOp/Smaller.php | 15 + .../Node/Expr/BinaryOp/SmallerOrEqual.php | 15 + .../Node/Expr/BinaryOp/Spaceship.php | 15 + .../lib/PhpParser/Node/Expr/BitwiseNot.php | 29 + .../lib/PhpParser/Node/Expr/BooleanNot.php | 29 + .../lib/PhpParser/Node/Expr/CallLike.php | 35 + .../lib/PhpParser/Node/Expr/Cast.php | 25 + .../lib/PhpParser/Node/Expr/Cast/Array_.php | 11 + .../lib/PhpParser/Node/Expr/Cast/Bool_.php | 11 + .../lib/PhpParser/Node/Expr/Cast/Double.php | 16 + .../lib/PhpParser/Node/Expr/Cast/Int_.php | 11 + .../lib/PhpParser/Node/Expr/Cast/Object_.php | 11 + .../lib/PhpParser/Node/Expr/Cast/String_.php | 11 + .../lib/PhpParser/Node/Expr/Cast/Unset_.php | 11 + .../PhpParser/Node/Expr/ClassConstFetch.php | 36 + .../lib/PhpParser/Node/Expr/Clone_.php | 29 + .../lib/PhpParser/Node/Expr/Closure.php | 86 + .../lib/PhpParser/Node/Expr/ClosureUse.php | 3 + .../lib/PhpParser/Node/Expr/ConstFetch.php | 30 + .../lib/PhpParser/Node/Expr/Empty_.php | 29 + .../lib/PhpParser/Node/Expr/Error.php | 30 + .../lib/PhpParser/Node/Expr/ErrorSuppress.php | 29 + .../lib/PhpParser/Node/Expr/Eval_.php | 29 + .../lib/PhpParser/Node/Expr/Exit_.php | 33 + .../lib/PhpParser/Node/Expr/FuncCall.php | 38 + .../lib/PhpParser/Node/Expr/Include_.php | 38 + .../lib/PhpParser/Node/Expr/Instanceof_.php | 35 + .../lib/PhpParser/Node/Expr/Isset_.php | 29 + .../lib/PhpParser/Node/Expr/List_.php | 34 + .../lib/PhpParser/Node/Expr/Match_.php | 32 + .../lib/PhpParser/Node/Expr/MethodCall.php | 45 + .../lib/PhpParser/Node/Expr/New_.php | 40 + .../Node/Expr/NullsafeMethodCall.php | 45 + .../Node/Expr/NullsafePropertyFetch.php | 35 + .../lib/PhpParser/Node/Expr/PostDec.php | 29 + .../lib/PhpParser/Node/Expr/PostInc.php | 29 + .../lib/PhpParser/Node/Expr/PreDec.php | 29 + .../lib/PhpParser/Node/Expr/PreInc.php | 29 + .../lib/PhpParser/Node/Expr/Print_.php | 29 + .../lib/PhpParser/Node/Expr/PropertyFetch.php | 35 + .../lib/PhpParser/Node/Expr/ShellExec.php | 30 + .../lib/PhpParser/Node/Expr/StaticCall.php | 45 + .../Node/Expr/StaticPropertyFetch.php | 36 + .../lib/PhpParser/Node/Expr/Ternary.php | 37 + .../lib/PhpParser/Node/Expr/Throw_.php | 29 + .../lib/PhpParser/Node/Expr/UnaryMinus.php | 29 + .../lib/PhpParser/Node/Expr/UnaryPlus.php | 29 + .../lib/PhpParser/Node/Expr/Variable.php | 29 + .../lib/PhpParser/Node/Expr/YieldFrom.php | 29 + .../lib/PhpParser/Node/Expr/Yield_.php | 33 + .../lib/PhpParser/Node/FunctionLike.php | 40 + .../lib/PhpParser/Node/Identifier.php | 75 + .../PhpParser/Node/InterpolatedStringPart.php | 32 + .../lib/PhpParser/Node/IntersectionType.php | 27 + .../lib/PhpParser/Node/MatchArm.php | 30 + .../php-parser/lib/PhpParser/Node/Name.php | 269 + .../PhpParser/Node/Name/FullyQualified.php | 49 + .../lib/PhpParser/Node/Name/Relative.php | 49 + .../lib/PhpParser/Node/NullableType.php | 29 + .../php-parser/lib/PhpParser/Node/Param.php | 84 + .../lib/PhpParser/Node/PropertyItem.php | 37 + .../php-parser/lib/PhpParser/Node/Scalar.php | 6 + .../lib/PhpParser/Node/Scalar/DNumber.php | 3 + .../lib/PhpParser/Node/Scalar/Encapsed.php | 3 + .../Node/Scalar/EncapsedStringPart.php | 3 + .../lib/PhpParser/Node/Scalar/Float_.php | 78 + .../lib/PhpParser/Node/Scalar/Int_.php | 82 + .../Node/Scalar/InterpolatedString.php | 34 + .../lib/PhpParser/Node/Scalar/LNumber.php | 3 + .../lib/PhpParser/Node/Scalar/MagicConst.php | 27 + .../Node/Scalar/MagicConst/Class_.php | 15 + .../PhpParser/Node/Scalar/MagicConst/Dir.php | 15 + .../PhpParser/Node/Scalar/MagicConst/File.php | 15 + .../Node/Scalar/MagicConst/Function_.php | 15 + .../PhpParser/Node/Scalar/MagicConst/Line.php | 15 + .../Node/Scalar/MagicConst/Method.php | 15 + .../Node/Scalar/MagicConst/Namespace_.php | 15 + .../Node/Scalar/MagicConst/Trait_.php | 15 + .../lib/PhpParser/Node/Scalar/String_.php | 161 + .../lib/PhpParser/Node/StaticVar.php | 39 + .../php-parser/lib/PhpParser/Node/Stmt.php | 8 + .../lib/PhpParser/Node/Stmt/Block.php | 29 + .../lib/PhpParser/Node/Stmt/Break_.php | 29 + .../lib/PhpParser/Node/Stmt/Case_.php | 33 + .../lib/PhpParser/Node/Stmt/Catch_.php | 40 + .../lib/PhpParser/Node/Stmt/ClassConst.php | 77 + .../lib/PhpParser/Node/Stmt/ClassLike.php | 109 + .../lib/PhpParser/Node/Stmt/ClassMethod.php | 154 + .../lib/PhpParser/Node/Stmt/Class_.php | 94 + .../lib/PhpParser/Node/Stmt/Const_.php | 29 + .../lib/PhpParser/Node/Stmt/Continue_.php | 29 + .../PhpParser/Node/Stmt/DeclareDeclare.php | 3 + .../lib/PhpParser/Node/Stmt/Declare_.php | 34 + .../lib/PhpParser/Node/Stmt/Do_.php | 33 + .../lib/PhpParser/Node/Stmt/Echo_.php | 29 + .../lib/PhpParser/Node/Stmt/ElseIf_.php | 33 + .../lib/PhpParser/Node/Stmt/Else_.php | 29 + .../lib/PhpParser/Node/Stmt/EnumCase.php | 36 + .../lib/PhpParser/Node/Stmt/Enum_.php | 44 + .../lib/PhpParser/Node/Stmt/Expression.php | 32 + .../lib/PhpParser/Node/Stmt/Finally_.php | 29 + .../lib/PhpParser/Node/Stmt/For_.php | 47 + .../lib/PhpParser/Node/Stmt/Foreach_.php | 50 + .../lib/PhpParser/Node/Stmt/Function_.php | 81 + .../lib/PhpParser/Node/Stmt/Global_.php | 29 + .../lib/PhpParser/Node/Stmt/Goto_.php | 30 + .../lib/PhpParser/Node/Stmt/GroupUse.php | 41 + .../lib/PhpParser/Node/Stmt/HaltCompiler.php | 29 + .../lib/PhpParser/Node/Stmt/If_.php | 46 + .../lib/PhpParser/Node/Stmt/InlineHTML.php | 29 + .../lib/PhpParser/Node/Stmt/Interface_.php | 40 + .../lib/PhpParser/Node/Stmt/Label.php | 30 + .../lib/PhpParser/Node/Stmt/Namespace_.php | 37 + .../lib/PhpParser/Node/Stmt/Nop.php | 16 + .../lib/PhpParser/Node/Stmt/Property.php | 82 + .../PhpParser/Node/Stmt/PropertyProperty.php | 3 + .../lib/PhpParser/Node/Stmt/Return_.php | 29 + .../lib/PhpParser/Node/Stmt/StaticVar.php | 3 + .../lib/PhpParser/Node/Stmt/Static_.php | 30 + .../lib/PhpParser/Node/Stmt/Switch_.php | 33 + .../lib/PhpParser/Node/Stmt/TraitUse.php | 33 + .../Node/Stmt/TraitUseAdaptation.php | 12 + .../Node/Stmt/TraitUseAdaptation/Alias.php | 37 + .../Stmt/TraitUseAdaptation/Precedence.php | 33 + .../lib/PhpParser/Node/Stmt/Trait_.php | 34 + .../lib/PhpParser/Node/Stmt/TryCatch.php | 37 + .../lib/PhpParser/Node/Stmt/Unset_.php | 29 + .../lib/PhpParser/Node/Stmt/UseUse.php | 3 + .../lib/PhpParser/Node/Stmt/Use_.php | 47 + .../lib/PhpParser/Node/Stmt/While_.php | 33 + .../lib/PhpParser/Node/UnionType.php | 27 + .../php-parser/lib/PhpParser/Node/UseItem.php | 55 + .../lib/PhpParser/Node/VarLikeIdentifier.php | 16 + .../PhpParser/Node/VariadicPlaceholder.php | 27 + .../php-parser/lib/PhpParser/NodeAbstract.php | 178 + .../php-parser/lib/PhpParser/NodeDumper.php | 290 + .../php-parser/lib/PhpParser/NodeFinder.php | 90 + .../lib/PhpParser/NodeTraverser.php | 278 + .../lib/PhpParser/NodeTraverserInterface.php | 26 + .../php-parser/lib/PhpParser/NodeVisitor.php | 124 + .../PhpParser/NodeVisitor/CloningVisitor.php | 19 + .../NodeVisitor/CommentAnnotatingVisitor.php | 82 + .../PhpParser/NodeVisitor/FindingVisitor.php | 47 + .../NodeVisitor/FirstFindingVisitor.php | 49 + .../PhpParser/NodeVisitor/NameResolver.php | 262 + .../NodeVisitor/NodeConnectingVisitor.php | 51 + .../NodeVisitor/ParentConnectingVisitor.php | 38 + .../lib/PhpParser/NodeVisitorAbstract.php | 24 + .../nikic/php-parser/lib/PhpParser/Parser.php | 24 + .../php-parser/lib/PhpParser/Parser/Php7.php | 2699 ++++++++ .../php-parser/lib/PhpParser/Parser/Php8.php | 2717 ++++++++ .../lib/PhpParser/ParserAbstract.php | 1241 ++++ .../lib/PhpParser/ParserFactory.php | 42 + .../php-parser/lib/PhpParser/PhpVersion.php | 164 + .../lib/PhpParser/PrettyPrinter.php | 51 + .../lib/PhpParser/PrettyPrinter/Standard.php | 1177 ++++ .../lib/PhpParser/PrettyPrinterAbstract.php | 1655 +++++ .../nikic/php-parser/lib/PhpParser/Token.php | 18 + .../lib/PhpParser/compatibility_tokens.php | 63 + vendor/phar-io/manifest/composer.lock | 70 + .../manifest/src/ManifestDocumentMapper.php | 150 + .../phar-io/manifest/src/ManifestLoader.php | 44 + .../manifest/src/ManifestSerializer.php | 168 + .../exceptions/ElementCollectionException.php | 13 + .../manifest/src/exceptions/Exception.php | 13 + .../InvalidApplicationNameException.php | 14 + .../src/exceptions/InvalidEmailException.php | 13 + .../src/exceptions/InvalidUrlException.php | 13 + .../exceptions/ManifestDocumentException.php | 5 + .../ManifestDocumentLoadingException.php | 45 + .../ManifestDocumentMapperException.php | 5 + .../exceptions/ManifestElementException.php | 5 + .../exceptions/ManifestLoaderException.php | 5 + .../manifest/src/values/Application.php | 16 + .../manifest/src/values/ApplicationName.php | 37 + vendor/phar-io/manifest/src/values/Author.php | 39 + .../manifest/src/values/AuthorCollection.php | 34 + .../src/values/AuthorCollectionIterator.php | 42 + .../manifest/src/values/BundledComponent.php | 33 + .../src/values/BundledComponentCollection.php | 34 + .../BundledComponentCollectionIterator.php | 42 + .../src/values/CopyrightInformation.php | 31 + vendor/phar-io/manifest/src/values/Email.php | 31 + .../phar-io/manifest/src/values/Extension.php | 46 + .../phar-io/manifest/src/values/Library.php | 16 + .../phar-io/manifest/src/values/License.php | 31 + .../phar-io/manifest/src/values/Manifest.php | 92 + .../src/values/PhpExtensionRequirement.php | 23 + .../src/values/PhpVersionRequirement.php | 25 + .../manifest/src/values/Requirement.php | 13 + .../src/values/RequirementCollection.php | 34 + .../values/RequirementCollectionIterator.php | 42 + vendor/phar-io/manifest/src/values/Type.php | 41 + vendor/phar-io/manifest/src/values/Url.php | 36 + .../manifest/src/xml/AuthorElement.php | 20 + .../src/xml/AuthorElementCollection.php | 18 + .../manifest/src/xml/BundlesElement.php | 18 + .../manifest/src/xml/ComponentElement.php | 20 + .../src/xml/ComponentElementCollection.php | 18 + .../manifest/src/xml/ContainsElement.php | 30 + .../manifest/src/xml/CopyrightElement.php | 24 + .../manifest/src/xml/ElementCollection.php | 61 + .../phar-io/manifest/src/xml/ExtElement.php | 16 + .../manifest/src/xml/ExtElementCollection.php | 18 + .../manifest/src/xml/ExtensionElement.php | 20 + .../manifest/src/xml/LicenseElement.php | 20 + .../manifest/src/xml/ManifestDocument.php | 103 + .../manifest/src/xml/ManifestElement.php | 66 + .../phar-io/manifest/src/xml/PhpElement.php | 26 + .../manifest/src/xml/RequiresElement.php | 18 + vendor/phar-io/version/src/BuildMetaData.php | 28 + .../phar-io/version/src/PreReleaseSuffix.php | 82 + vendor/phar-io/version/src/Version.php | 208 + .../version/src/VersionConstraintParser.php | 115 + .../version/src/VersionConstraintValue.php | 88 + vendor/phar-io/version/src/VersionNumber.php | 28 + .../constraints/AbstractVersionConstraint.php | 23 + .../constraints/AndVersionConstraintGroup.php | 34 + .../src/constraints/AnyVersionConstraint.php | 20 + .../constraints/ExactVersionConstraint.php | 22 + .../GreaterThanOrEqualToVersionConstraint.php | 26 + .../constraints/OrVersionConstraintGroup.php | 35 + ...SpecificMajorAndMinorVersionConstraint.php | 33 + .../SpecificMajorVersionConstraint.php | 25 + .../src/constraints/VersionConstraint.php | 16 + .../version/src/exceptions/Exception.php | 15 + .../InvalidPreReleaseSuffixException.php | 5 + .../exceptions/InvalidVersionException.php | 5 + .../exceptions/NoBuildMetaDataException.php | 5 + .../NoPreReleaseSuffixException.php | 5 + .../UnsupportedVersionConstraintException.php | 13 + vendor/phpmailer/phpmailer/COMMITMENT | 46 + .../phpmailer/phpmailer/get_oauth_token.php | 182 + .../phpmailer/language/phpmailer.lang-af.php | 26 + .../phpmailer/language/phpmailer.lang-ar.php | 27 + .../phpmailer/language/phpmailer.lang-az.php | 27 + .../phpmailer/language/phpmailer.lang-ba.php | 27 + .../phpmailer/language/phpmailer.lang-be.php | 27 + .../phpmailer/language/phpmailer.lang-bg.php | 27 + .../phpmailer/language/phpmailer.lang-ca.php | 27 + .../phpmailer/language/phpmailer.lang-cs.php | 28 + .../phpmailer/language/phpmailer.lang-da.php | 35 + .../phpmailer/language/phpmailer.lang-de.php | 28 + .../phpmailer/language/phpmailer.lang-el.php | 33 + .../phpmailer/language/phpmailer.lang-eo.php | 26 + .../phpmailer/language/phpmailer.lang-es.php | 31 + .../phpmailer/language/phpmailer.lang-et.php | 28 + .../phpmailer/language/phpmailer.lang-fa.php | 28 + .../phpmailer/language/phpmailer.lang-fi.php | 27 + .../phpmailer/language/phpmailer.lang-fo.php | 27 + .../phpmailer/language/phpmailer.lang-fr.php | 37 + .../phpmailer/language/phpmailer.lang-gl.php | 27 + .../phpmailer/language/phpmailer.lang-he.php | 27 + .../phpmailer/language/phpmailer.lang-hi.php | 35 + .../phpmailer/language/phpmailer.lang-hr.php | 27 + .../phpmailer/language/phpmailer.lang-hu.php | 27 + .../phpmailer/language/phpmailer.lang-hy.php | 27 + .../phpmailer/language/phpmailer.lang-id.php | 31 + .../phpmailer/language/phpmailer.lang-it.php | 28 + .../phpmailer/language/phpmailer.lang-ja.php | 29 + .../phpmailer/language/phpmailer.lang-ka.php | 27 + .../phpmailer/language/phpmailer.lang-ko.php | 27 + .../phpmailer/language/phpmailer.lang-lt.php | 27 + .../phpmailer/language/phpmailer.lang-lv.php | 27 + .../phpmailer/language/phpmailer.lang-mg.php | 27 + .../phpmailer/language/phpmailer.lang-mn.php | 27 + .../phpmailer/language/phpmailer.lang-ms.php | 27 + .../phpmailer/language/phpmailer.lang-nb.php | 33 + .../phpmailer/language/phpmailer.lang-nl.php | 34 + .../phpmailer/language/phpmailer.lang-pl.php | 26 + .../phpmailer/language/phpmailer.lang-pt.php | 27 + .../language/phpmailer.lang-pt_br.php | 38 + .../phpmailer/language/phpmailer.lang-ro.php | 33 + .../phpmailer/language/phpmailer.lang-ru.php | 28 + .../phpmailer/language/phpmailer.lang-si.php | 34 + .../phpmailer/language/phpmailer.lang-sk.php | 30 + .../phpmailer/language/phpmailer.lang-sl.php | 36 + .../phpmailer/language/phpmailer.lang-sr.php | 28 + .../language/phpmailer.lang-sr_latn.php | 28 + .../phpmailer/language/phpmailer.lang-sv.php | 27 + .../phpmailer/language/phpmailer.lang-tl.php | 28 + .../phpmailer/language/phpmailer.lang-tr.php | 31 + .../phpmailer/language/phpmailer.lang-uk.php | 28 + .../phpmailer/language/phpmailer.lang-vi.php | 27 + .../phpmailer/language/phpmailer.lang-zh.php | 29 + .../language/phpmailer.lang-zh_cn.php | 36 + .../phpmailer/src/DSNConfigurator.php | 245 + vendor/phpmailer/phpmailer/src/Exception.php | 40 + vendor/phpmailer/phpmailer/src/OAuth.php | 139 + .../phpmailer/src/OAuthTokenProvider.php | 44 + vendor/phpmailer/phpmailer/src/PHPMailer.php | 5126 +++++++++++++++ vendor/phpmailer/phpmailer/src/POP3.php | 467 ++ vendor/phpmailer/phpmailer/src/SMTP.php | 1466 +++++ .../php-code-coverage/src/CodeCoverage.php | 709 ++ .../php-code-coverage/src/Driver/Driver.php | 167 + .../src/Driver/PcovDriver.php | 75 + .../src/Driver/PhpdbgDriver.php | 93 + .../php-code-coverage/src/Driver/Selector.php | 79 + .../src/Driver/Xdebug2Driver.php | 128 + .../src/Driver/Xdebug3Driver.php | 119 + ...chAndPathCoverageNotSupportedException.php | 16 + ...DeadCodeDetectionNotSupportedException.php | 16 + .../DirectoryCouldNotBeCreatedException.php | 17 + .../src/Exception/Exception.php | 16 + .../Exception/InvalidArgumentException.php | 14 + ...NoCodeCoverageDriverAvailableException.php | 20 + ...hPathCoverageSupportAvailableException.php | 20 + .../src/Exception/ParserException.php | 16 + .../PathExistsButIsNotDirectoryException.php | 22 + .../Exception/PcovNotAvailableException.php | 21 + .../Exception/PhpdbgNotAvailableException.php | 21 + .../src/Exception/ReflectionException.php | 16 + .../ReportAlreadyFinalizedException.php | 20 + ...ticAnalysisCacheNotConfiguredException.php | 16 + .../src/Exception/TestIdMissingException.php | 20 + .../UnintentionallyCoveredCodeException.php | 43 + .../WriteOperationFailedException.php | 22 + .../Exception/WrongXdebugVersionException.php | 17 + .../Exception/Xdebug2NotEnabledException.php | 21 + .../Exception/Xdebug3NotEnabledException.php | 21 + .../Exception/XdebugNotAvailableException.php | 21 + .../src/Exception/XmlException.php | 16 + .../phpunit/php-code-coverage/src/Filter.php | 118 + .../src/Node/AbstractNode.php | 253 + .../php-code-coverage/src/Node/Builder.php | 264 + .../php-code-coverage/src/Node/CrapIndex.php | 50 + .../php-code-coverage/src/Node/Directory.php | 440 ++ .../php-code-coverage/src/Node/File.php | 651 ++ .../php-code-coverage/src/Node/Iterator.php | 90 + .../src/ProcessedCodeCoverageData.php | 255 + .../src/RawCodeCoverageData.php | 274 + .../php-code-coverage/src/Report/Clover.php | 258 + .../src/Report/Cobertura.php | 309 + .../php-code-coverage/src/Report/Crap4j.php | 156 + .../src/Report/Html/Facade.php | 147 + .../src/Report/Html/Renderer.php | 314 + .../src/Report/Html/Renderer/Dashboard.php | 288 + .../src/Report/Html/Renderer/Directory.php | 113 + .../src/Report/Html/Renderer/File.php | 1162 ++++ .../Renderer/Template/css/bootstrap.min.css | 7 + .../Html/Renderer/Template/css/custom.css | 0 .../Html/Renderer/Template/css/nv.d3.min.css | 1 + .../Html/Renderer/Template/css/octicons.css | 5 + .../Html/Renderer/Template/css/style.css | 158 + .../Renderer/Template/icons/file-code.svg | 1 + .../Template/icons/file-directory.svg | 1 + .../Renderer/Template/js/bootstrap.min.js | 7 + .../Html/Renderer/Template/js/d3.min.js | 5 + .../Report/Html/Renderer/Template/js/file.js | 62 + .../Html/Renderer/Template/js/jquery.min.js | 2 + .../Html/Renderer/Template/js/nv.d3.min.js | 8 + .../Html/Renderer/Template/js/popper.min.js | 5 + .../php-code-coverage/src/Report/PHP.php | 41 + .../php-code-coverage/src/Report/Text.php | 341 + .../src/Report/Xml/BuildInformation.php | 88 + .../src/Report/Xml/Coverage.php | 74 + .../src/Report/Xml/Directory.php | 17 + .../src/Report/Xml/Facade.php | 315 + .../php-code-coverage/src/Report/Xml/File.php | 87 + .../src/Report/Xml/Method.php | 61 + .../php-code-coverage/src/Report/Xml/Node.php | 93 + .../src/Report/Xml/Project.php | 90 + .../src/Report/Xml/Report.php | 99 + .../src/Report/Xml/Source.php | 42 + .../src/Report/Xml/Tests.php | 50 + .../src/Report/Xml/Totals.php | 146 + .../php-code-coverage/src/Report/Xml/Unit.php | 78 + .../src/StaticAnalysis/CacheWarmer.php | 32 + .../StaticAnalysis/CachingFileAnalyser.php | 209 + .../StaticAnalysis/CodeUnitFindingVisitor.php | 345 + .../ExecutableLinesFindingVisitor.php | 390 ++ .../src/StaticAnalysis/FileAnalyser.php | 31 + .../IgnoredLinesFindingVisitor.php | 119 + .../StaticAnalysis/ParsingFileAnalyser.php | 249 + .../php-code-coverage/src/Util/Filesystem.php | 37 + .../php-code-coverage/src/Util/Percentage.php | 66 + .../phpunit/php-code-coverage/src/Version.php | 30 + .../phpunit/php-file-iterator/src/Facade.php | 115 + .../phpunit/php-file-iterator/src/Factory.php | 91 + .../php-file-iterator/src/Iterator.php | 119 + vendor/phpunit/php-invoker/src/Invoker.php | 69 + .../php-invoker/src/exceptions/Exception.php | 16 + ...cessControlExtensionNotLoadedException.php | 16 + .../src/exceptions/TimeoutException.php | 16 + .../php-text-template/src/Template.php | 107 + .../src/exceptions/Exception.php | 16 + .../exceptions/InvalidArgumentException.php | 14 + .../src/exceptions/RuntimeException.php | 16 + vendor/phpunit/php-timer/src/Duration.php | 109 + .../php-timer/src/ResourceUsageFormatter.php | 73 + vendor/phpunit/php-timer/src/Timer.php | 40 + .../php-timer/src/exceptions/Exception.php | 16 + .../src/exceptions/NoActiveTimerException.php | 16 + ...nceStartOfRequestNotAvailableException.php | 16 + vendor/phpunit/phpunit/composer.lock | 1659 +++++ vendor/phpunit/phpunit/phpunit | 107 + vendor/phpunit/phpunit/phpunit.xsd | 330 + vendor/phpunit/phpunit/schema/8.5.xsd | 319 + vendor/phpunit/phpunit/schema/9.0.xsd | 315 + vendor/phpunit/phpunit/schema/9.1.xsd | 317 + vendor/phpunit/phpunit/schema/9.2.xsd | 317 + vendor/phpunit/phpunit/schema/9.3.xsd | 327 + vendor/phpunit/phpunit/schema/9.4.xsd | 328 + vendor/phpunit/phpunit/schema/9.5.xsd | 330 + vendor/phpunit/phpunit/src/Exception.php | 19 + .../phpunit/phpunit/src/Framework/Assert.php | 2963 +++++++++ .../src/Framework/Assert/Functions.php | 3078 +++++++++ .../Framework/Constraint/Boolean/IsFalse.php | 35 + .../Framework/Constraint/Boolean/IsTrue.php | 35 + .../src/Framework/Constraint/Callback.php | 52 + .../Constraint/Cardinality/Count.php | 142 + .../Constraint/Cardinality/GreaterThan.php | 50 + .../Constraint/Cardinality/IsEmpty.php | 70 + .../Constraint/Cardinality/LessThan.php | 50 + .../Constraint/Cardinality/SameSize.php | 21 + .../src/Framework/Constraint/Constraint.php | 269 + .../Framework/Constraint/Equality/IsEqual.php | 136 + .../Equality/IsEqualCanonicalizing.php | 108 + .../Equality/IsEqualIgnoringCase.php | 108 + .../Constraint/Equality/IsEqualWithDelta.php | 100 + .../Constraint/Exception/Exception.php | 85 + .../Constraint/Exception/ExceptionCode.php | 67 + .../Constraint/Exception/ExceptionMessage.php | 78 + .../ExceptionMessageRegularExpression.php | 74 + .../Constraint/Filesystem/DirectoryExists.php | 54 + .../Constraint/Filesystem/FileExists.php | 54 + .../Constraint/Filesystem/IsReadable.php | 54 + .../Constraint/Filesystem/IsWritable.php | 54 + .../src/Framework/Constraint/IsAnything.php | 51 + .../src/Framework/Constraint/IsIdentical.php | 126 + .../src/Framework/Constraint/JsonMatches.php | 108 + .../JsonMatchesErrorMessageProvider.php | 78 + .../Framework/Constraint/Math/IsFinite.php | 37 + .../Framework/Constraint/Math/IsInfinite.php | 37 + .../src/Framework/Constraint/Math/IsNan.php | 37 + .../Constraint/Object/ClassHasAttribute.php | 90 + .../Object/ClassHasStaticAttribute.php | 61 + .../Constraint/Object/ObjectEquals.php | 151 + .../Constraint/Object/ObjectHasAttribute.php | 31 + .../Constraint/Object/ObjectHasProperty.php | 84 + .../Constraint/Operator/BinaryOperator.php | 148 + .../Constraint/Operator/LogicalAnd.php | 51 + .../Constraint/Operator/LogicalNot.php | 143 + .../Constraint/Operator/LogicalOr.php | 51 + .../Constraint/Operator/LogicalXor.php | 63 + .../Constraint/Operator/Operator.php | 55 + .../Constraint/Operator/UnaryOperator.php | 140 + .../Framework/Constraint/String/IsJson.php | 77 + .../Constraint/String/RegularExpression.php | 51 + .../Constraint/String/StringContains.php | 85 + .../Constraint/String/StringEndsWith.php | 48 + .../String/StringMatchesFormatDescription.php | 109 + .../Constraint/String/StringStartsWith.php | 52 + .../Constraint/Traversable/ArrayHasKey.php | 77 + .../Traversable/TraversableContains.php | 63 + .../Traversable/TraversableContainsEqual.php | 40 + .../TraversableContainsIdentical.php | 39 + .../Traversable/TraversableContainsOnly.php | 91 + .../Constraint/Type/IsInstanceOf.php | 87 + .../src/Framework/Constraint/Type/IsNull.php | 35 + .../src/Framework/Constraint/Type/IsType.php | 210 + .../src/Framework/DataProviderTestSuite.php | 75 + .../src/Framework/Error/Deprecated.php | 17 + .../phpunit/src/Framework/Error/Error.php | 26 + .../phpunit/src/Framework/Error/Notice.php | 17 + .../phpunit/src/Framework/Error/Warning.php | 17 + .../phpunit/src/Framework/ErrorTestCase.php | 66 + .../ActualValueIsNotAnObjectException.php | 32 + .../Exception/AssertionFailedError.php | 24 + .../Exception/CodeCoverageException.php | 17 + ...hodDoesNotAcceptParameterTypeException.php | 38 + ...dDoesNotDeclareBoolReturnTypeException.php | 37 + ...NotDeclareExactlyOneParameterException.php | 37 + ...odDoesNotDeclareParameterTypeException.php | 37 + .../ComparisonMethodDoesNotExistException.php | 37 + .../CoveredCodeNotExecutedException.php | 17 + .../phpunit/src/Framework/Exception/Error.php | 24 + .../src/Framework/Exception/Exception.php | 81 + .../Exception/ExpectationFailedException.php | 42 + .../Exception/IncompleteTestError.php | 17 + .../Exception/InvalidArgumentException.php | 46 + .../InvalidCoversTargetException.php | 17 + .../InvalidDataProviderException.php | 17 + .../MissingCoversAnnotationException.php | 17 + .../Exception/NoChildTestSuiteException.php | 17 + .../src/Framework/Exception/OutputError.php | 17 + .../Exception/PHPTAssertionFailedError.php | 32 + .../Framework/Exception/RiskyTestError.php | 17 + .../Framework/Exception/SkippedTestError.php | 17 + .../Exception/SkippedTestSuiteError.php | 17 + .../Framework/Exception/SyntheticError.php | 61 + .../Exception/SyntheticSkippedError.php | 17 + .../UnintentionallyCoveredCodeError.php | 17 + .../src/Framework/Exception/Warning.php | 24 + .../src/Framework/ExceptionWrapper.php | 138 + .../Framework/ExecutionOrderDependency.php | 206 + .../phpunit/src/Framework/IncompleteTest.php | 19 + .../src/Framework/IncompleteTestCase.php | 66 + .../InvalidParameterGroupException.php | 17 + .../src/Framework/MockObject/Api/Api.php | 97 + .../src/Framework/MockObject/Api/Method.php | 30 + .../Framework/MockObject/Builder/Identity.php | 25 + .../MockObject/Builder/InvocationMocker.php | 308 + .../MockObject/Builder/InvocationStubber.php | 65 + .../MockObject/Builder/MethodNameMatch.php | 26 + .../MockObject/Builder/ParametersMatch.php | 58 + .../src/Framework/MockObject/Builder/Stub.php | 24 + .../MockObject/ConfigurableMethod.php | 53 + .../Exception/BadMethodCallException.php | 17 + .../CannotUseAddMethodsException.php | 29 + .../CannotUseOnlyMethodsException.php | 29 + .../Exception/ClassAlreadyExistsException.php | 28 + .../Exception/ClassIsFinalException.php | 28 + .../Exception/ClassIsReadonlyException.php | 28 + ...ableMethodsAlreadyInitializedException.php | 17 + .../Exception/DuplicateMethodException.php | 35 + .../MockObject/Exception/Exception.php | 19 + .../IncompatibleReturnValueException.php | 36 + .../Exception/InvalidMethodNameException.php | 28 + .../MatchBuilderNotFoundException.php | 28 + .../MatcherAlreadyRegisteredException.php | 28 + .../MethodCannotBeConfiguredException.php | 28 + .../MethodNameAlreadyConfiguredException.php | 21 + .../MethodNameNotConfiguredException.php | 21 + ...odParametersAlreadyConfiguredException.php | 21 + ...ConstructorInvocationRequiredException.php | 21 + .../Exception/ReflectionException.php | 19 + .../ReturnValueNotConfiguredException.php | 29 + .../MockObject/Exception/RuntimeException.php | 17 + .../SoapExtensionNotAvailableException.php | 23 + .../Exception/UnknownClassException.php | 28 + .../Exception/UnknownTraitException.php | 28 + .../Exception/UnknownTypeException.php | 28 + .../src/Framework/MockObject/Generator.php | 1160 ++++ .../MockObject/Generator/deprecation.tpl | 2 + .../MockObject/Generator/intersection.tpl | 5 + .../MockObject/Generator/mocked_class.tpl | 6 + .../MockObject/Generator/mocked_method.tpl | 22 + .../Generator/mocked_method_never_or_void.tpl | 20 + .../Generator/mocked_static_method.tpl | 5 + .../MockObject/Generator/proxied_method.tpl | 22 + .../proxied_method_never_or_void.tpl | 22 + .../MockObject/Generator/trait_class.tpl | 6 + .../MockObject/Generator/wsdl_class.tpl | 9 + .../MockObject/Generator/wsdl_method.tpl | 4 + .../src/Framework/MockObject/Invocation.php | 301 + .../MockObject/InvocationHandler.php | 186 + .../src/Framework/MockObject/Matcher.php | 274 + .../MockObject/MethodNameConstraint.php | 48 + .../src/Framework/MockObject/MockBuilder.php | 517 ++ .../src/Framework/MockObject/MockClass.php | 69 + .../src/Framework/MockObject/MockMethod.php | 380 ++ .../Framework/MockObject/MockMethodSet.php | 45 + .../src/Framework/MockObject/MockObject.php | 27 + .../src/Framework/MockObject/MockTrait.php | 54 + .../src/Framework/MockObject/MockType.php | 21 + .../MockObject/Rule/AnyInvokedCount.php | 36 + .../MockObject/Rule/AnyParameters.php | 31 + .../MockObject/Rule/ConsecutiveParameters.php | 132 + .../MockObject/Rule/InvocationOrder.php | 47 + .../MockObject/Rule/InvokedAtIndex.php | 76 + .../MockObject/Rule/InvokedAtLeastCount.php | 64 + .../MockObject/Rule/InvokedAtLeastOnce.php | 50 + .../MockObject/Rule/InvokedAtMostCount.php | 64 + .../MockObject/Rule/InvokedCount.php | 102 + .../Framework/MockObject/Rule/MethodName.php | 68 + .../Framework/MockObject/Rule/Parameters.php | 160 + .../MockObject/Rule/ParametersRule.php | 28 + .../phpunit/src/Framework/MockObject/Stub.php | 26 + .../MockObject/Stub/ConsecutiveCalls.php | 57 + .../Framework/MockObject/Stub/Exception.php | 46 + .../MockObject/Stub/ReturnArgument.php | 41 + .../MockObject/Stub/ReturnCallback.php | 59 + .../MockObject/Stub/ReturnReference.php | 45 + .../Framework/MockObject/Stub/ReturnSelf.php | 32 + .../Framework/MockObject/Stub/ReturnStub.php | 45 + .../MockObject/Stub/ReturnValueMap.php | 53 + .../src/Framework/MockObject/Stub/Stub.php | 27 + .../src/Framework/MockObject/Verifiable.php | 26 + .../phpunit/src/Framework/Reorderable.php | 28 + .../phpunit/src/Framework/SelfDescribing.php | 21 + .../phpunit/src/Framework/SkippedTest.php | 19 + .../phpunit/src/Framework/SkippedTestCase.php | 66 + vendor/phpunit/phpunit/src/Framework/Test.php | 23 + .../phpunit/src/Framework/TestBuilder.php | 239 + .../phpunit/src/Framework/TestCase.php | 2673 ++++++++ .../phpunit/src/Framework/TestFailure.php | 155 + .../phpunit/src/Framework/TestListener.php | 45 + .../TestListenerDefaultImplementation.php | 60 + .../phpunit/src/Framework/TestResult.php | 1323 ++++ .../phpunit/src/Framework/TestSuite.php | 921 +++ .../src/Framework/TestSuiteIterator.php | 85 + .../phpunit/src/Framework/WarningTestCase.php | 66 + .../phpunit/src/Runner/BaseTestRunner.php | 161 + .../src/Runner/DefaultTestResultCache.php | 158 + .../phpunit/phpunit/src/Runner/Exception.php | 19 + .../src/Runner/Extension/ExtensionHandler.php | 118 + .../src/Runner/Extension/PharLoader.php | 98 + .../Filter/ExcludeGroupFilterIterator.php | 23 + .../phpunit/src/Runner/Filter/Factory.php | 61 + .../src/Runner/Filter/GroupFilterIterator.php | 58 + .../Filter/IncludeGroupFilterIterator.php | 23 + .../src/Runner/Filter/NameFilterIterator.php | 136 + .../Runner/Hook/AfterIncompleteTestHook.php | 24 + .../src/Runner/Hook/AfterLastTestHook.php | 24 + .../src/Runner/Hook/AfterRiskyTestHook.php | 24 + .../src/Runner/Hook/AfterSkippedTestHook.php | 24 + .../Runner/Hook/AfterSuccessfulTestHook.php | 24 + .../src/Runner/Hook/AfterTestErrorHook.php | 24 + .../src/Runner/Hook/AfterTestFailureHook.php | 24 + .../phpunit/src/Runner/Hook/AfterTestHook.php | 30 + .../src/Runner/Hook/AfterTestWarningHook.php | 24 + .../src/Runner/Hook/BeforeFirstTestHook.php | 24 + .../src/Runner/Hook/BeforeTestHook.php | 24 + .../phpunit/phpunit/src/Runner/Hook/Hook.php | 23 + .../phpunit/src/Runner/Hook/TestHook.php | 23 + .../src/Runner/Hook/TestListenerAdapter.php | 141 + .../src/Runner/NullTestResultCache.php | 42 + .../phpunit/src/Runner/PhptTestCase.php | 864 +++ .../src/Runner/ResultCacheExtension.php | 110 + .../src/Runner/StandardTestSuiteLoader.php | 152 + .../phpunit/src/Runner/TestResultCache.php | 28 + .../phpunit/src/Runner/TestSuiteLoader.php | 24 + .../phpunit/src/Runner/TestSuiteSorter.php | 394 ++ vendor/phpunit/phpunit/src/Runner/Version.php | 76 + .../src/TextUI/CliArguments/Builder.php | 886 +++ .../src/TextUI/CliArguments/Configuration.php | 2108 ++++++ .../src/TextUI/CliArguments/Exception.php | 19 + .../src/TextUI/CliArguments/Mapper.php | 365 ++ vendor/phpunit/phpunit/src/TextUI/Command.php | 1041 +++ .../src/TextUI/DefaultResultPrinter.php | 585 ++ .../src/TextUI/Exception/Exception.php | 19 + .../TextUI/Exception/ReflectionException.php | 19 + .../src/TextUI/Exception/RuntimeException.php | 17 + .../TestDirectoryNotFoundException.php | 29 + .../Exception/TestFileNotFoundException.php | 29 + vendor/phpunit/phpunit/src/TextUI/Help.php | 281 + .../phpunit/src/TextUI/ResultPrinter.php | 23 + .../phpunit/phpunit/src/TextUI/TestRunner.php | 1262 ++++ .../phpunit/src/TextUI/TestSuiteMapper.php | 103 + .../CodeCoverage/CodeCoverage.php | 363 ++ .../CodeCoverage/Filter/Directory.php | 66 + .../Filter/DirectoryCollection.php | 60 + .../Filter/DirectoryCollectionIterator.php | 68 + .../CodeCoverage/FilterMapper.php | 45 + .../CodeCoverage/Report/Clover.php | 35 + .../CodeCoverage/Report/Cobertura.php | 35 + .../CodeCoverage/Report/Crap4j.php | 46 + .../CodeCoverage/Report/Html.php | 57 + .../CodeCoverage/Report/Php.php | 35 + .../CodeCoverage/Report/Text.php | 57 + .../CodeCoverage/Report/Xml.php | 35 + .../TextUI/XmlConfiguration/Configuration.php | 152 + .../src/TextUI/XmlConfiguration/Exception.php | 19 + .../XmlConfiguration/Filesystem/Directory.php | 33 + .../Filesystem/DirectoryCollection.php | 65 + .../DirectoryCollectionIterator.php | 68 + .../XmlConfiguration/Filesystem/File.php | 33 + .../Filesystem/FileCollection.php | 65 + .../Filesystem/FileCollectionIterator.php | 68 + .../src/TextUI/XmlConfiguration/Generator.php | 73 + .../TextUI/XmlConfiguration/Group/Group.php | 33 + .../Group/GroupCollection.php | 72 + .../Group/GroupCollectionIterator.php | 68 + .../TextUI/XmlConfiguration/Group/Groups.php | 54 + .../src/TextUI/XmlConfiguration/Loader.php | 1273 ++++ .../TextUI/XmlConfiguration/Logging/Junit.php | 35 + .../XmlConfiguration/Logging/Logging.php | 147 + .../XmlConfiguration/Logging/TeamCity.php | 35 + .../XmlConfiguration/Logging/TestDox/Html.php | 35 + .../XmlConfiguration/Logging/TestDox/Text.php | 35 + .../XmlConfiguration/Logging/TestDox/Xml.php | 35 + .../TextUI/XmlConfiguration/Logging/Text.php | 35 + .../Migration/MigrationBuilder.php | 62 + .../Migration/MigrationBuilderException.php | 19 + .../Migration/MigrationException.php | 19 + .../Migration/Migrations/ConvertLogTypes.php | 53 + .../Migrations/CoverageCloverToReport.php | 31 + .../Migrations/CoverageCrap4jToReport.php | 33 + .../Migrations/CoverageHtmlToReport.php | 33 + .../Migrations/CoveragePhpToReport.php | 31 + .../Migrations/CoverageTextToReport.php | 33 + .../Migrations/CoverageXmlToReport.php | 31 + .../Migrations/IntroduceCoverageElement.php | 28 + .../Migrations/LogToReportMigration.php | 79 + .../Migration/Migrations/Migration.php | 20 + ...ttributesFromFilterWhitelistToCoverage.php | 51 + .../MoveAttributesFromRootToCoverage.php | 47 + .../MoveWhitelistExcludesToCoverage.php | 72 + .../MoveWhitelistIncludesToCoverage.php | 53 + .../Migrations/RemoveCacheTokensAttribute.php | 27 + .../Migrations/RemoveEmptyFilter.php | 54 + .../Migration/Migrations/RemoveLogTypes.php | 40 + .../Migrations/UpdateSchemaLocationTo93.php | 27 + .../XmlConfiguration/Migration/Migrator.php | 57 + .../TextUI/XmlConfiguration/PHP/Constant.php | 44 + .../PHP/ConstantCollection.php | 60 + .../PHP/ConstantCollectionIterator.php | 68 + .../XmlConfiguration/PHP/IniSetting.php | 44 + .../PHP/IniSettingCollection.php | 60 + .../PHP/IniSettingCollectionIterator.php | 68 + .../src/TextUI/XmlConfiguration/PHP/Php.php | 143 + .../XmlConfiguration/PHP/PhpHandler.php | 121 + .../TextUI/XmlConfiguration/PHP/Variable.php | 55 + .../PHP/VariableCollection.php | 60 + .../PHP/VariableCollectionIterator.php | 68 + .../XmlConfiguration/PHPUnit/Extension.php | 73 + .../PHPUnit/ExtensionCollection.php | 53 + .../PHPUnit/ExtensionCollectionIterator.php | 68 + .../XmlConfiguration/PHPUnit/PHPUnit.php | 715 ++ .../TestSuite/TestDirectory.php | 79 + .../TestSuite/TestDirectoryCollection.php | 65 + .../TestDirectoryCollectionIterator.php | 68 + .../XmlConfiguration/TestSuite/TestFile.php | 57 + .../TestSuite/TestFileCollection.php | 65 + .../TestSuite/TestFileCollectionIterator.php | 68 + .../XmlConfiguration/TestSuite/TestSuite.php | 66 + .../TestSuite/TestSuiteCollection.php | 65 + .../TestSuite/TestSuiteCollectionIterator.php | 68 + .../phpunit/src/Util/Annotation/DocBlock.php | 546 ++ .../phpunit/src/Util/Annotation/Registry.php | 95 + vendor/phpunit/phpunit/src/Util/Blacklist.php | 41 + vendor/phpunit/phpunit/src/Util/Cloner.php | 34 + vendor/phpunit/phpunit/src/Util/Color.php | 159 + .../phpunit/phpunit/src/Util/ErrorHandler.php | 156 + vendor/phpunit/phpunit/src/Util/Exception.php | 19 + .../phpunit/phpunit/src/Util/ExcludeList.php | 240 + .../phpunit/phpunit/src/Util/FileLoader.php | 84 + .../phpunit/phpunit/src/Util/Filesystem.php | 41 + vendor/phpunit/phpunit/src/Util/Filter.php | 115 + .../phpunit/phpunit/src/Util/GlobalState.php | 287 + .../src/Util/InvalidDataSetException.php | 19 + vendor/phpunit/phpunit/src/Util/Json.php | 98 + vendor/phpunit/phpunit/src/Util/Log/JUnit.php | 424 ++ .../phpunit/phpunit/src/Util/Log/TeamCity.php | 383 ++ .../src/Util/PHP/AbstractPhpProcess.php | 426 ++ .../src/Util/PHP/DefaultPhpProcess.php | 236 + .../src/Util/PHP/Template/PhptTestCase.tpl | 57 + .../src/Util/PHP/Template/TestCaseClass.tpl | 123 + .../src/Util/PHP/Template/TestCaseMethod.tpl | 126 + .../src/Util/PHP/WindowsPhpProcess.php | 52 + vendor/phpunit/phpunit/src/Util/Printer.php | 116 + .../phpunit/phpunit/src/Util/Reflection.php | 63 + .../phpunit/src/Util/RegularExpression.php | 31 + vendor/phpunit/phpunit/src/Util/Test.php | 783 +++ .../src/Util/TestDox/CliTestDoxPrinter.php | 380 ++ .../src/Util/TestDox/HtmlResultPrinter.php | 159 + .../src/Util/TestDox/NamePrettifier.php | 312 + .../src/Util/TestDox/ResultPrinter.php | 343 + .../src/Util/TestDox/TestDoxPrinter.php | 388 ++ .../src/Util/TestDox/TextResultPrinter.php | 52 + .../src/Util/TestDox/XmlResultPrinter.php | 261 + .../phpunit/src/Util/TextTestListRenderer.php | 54 + vendor/phpunit/phpunit/src/Util/Type.php | 39 + .../src/Util/VersionComparisonOperator.php | 58 + .../src/Util/XdebugFilterScriptGenerator.php | 81 + vendor/phpunit/phpunit/src/Util/Xml.php | 193 + .../phpunit/src/Util/Xml/Exception.php | 19 + .../Util/Xml/FailedSchemaDetectionResult.php | 19 + .../phpunit/phpunit/src/Util/Xml/Loader.php | 117 + .../src/Util/Xml/SchemaDetectionResult.php | 34 + .../phpunit/src/Util/Xml/SchemaDetector.php | 41 + .../phpunit/src/Util/Xml/SchemaFinder.php | 80 + .../phpunit/src/Util/Xml/SnapshotNodeList.php | 51 + .../Xml/SuccessfulSchemaDetectionResult.php | 47 + .../phpunit/src/Util/Xml/ValidationResult.php | 69 + .../phpunit/src/Util/Xml/Validator.php | 35 + .../phpunit/src/Util/XmlTestListRenderer.php | 91 + vendor/psr/log/src/AbstractLogger.php | 15 + .../psr/log/src/InvalidArgumentException.php | 7 + vendor/psr/log/src/LogLevel.php | 18 + vendor/psr/log/src/LoggerAwareInterface.php | 18 + vendor/psr/log/src/LoggerAwareTrait.php | 26 + vendor/psr/log/src/LoggerInterface.php | 125 + vendor/psr/log/src/LoggerTrait.php | 142 + vendor/psr/log/src/NullLogger.php | 30 + vendor/sebastian/cli-parser/src/Parser.php | 204 + .../exceptions/AmbiguousOptionException.php | 26 + .../cli-parser/src/exceptions/Exception.php | 16 + .../OptionDoesNotAllowArgumentException.php | 26 + ...RequiredOptionArgumentMissingException.php | 26 + .../src/exceptions/UnknownOptionException.php | 26 + .../code-unit-reverse-lookup/src/Wizard.php | 125 + .../code-unit/src/ClassMethodUnit.php | 24 + vendor/sebastian/code-unit/src/ClassUnit.php | 24 + vendor/sebastian/code-unit/src/CodeUnit.php | 445 ++ .../code-unit/src/CodeUnitCollection.php | 84 + .../src/CodeUnitCollectionIterator.php | 55 + .../sebastian/code-unit/src/FunctionUnit.php | 24 + .../code-unit/src/InterfaceMethodUnit.php | 24 + .../sebastian/code-unit/src/InterfaceUnit.php | 24 + vendor/sebastian/code-unit/src/Mapper.php | 414 ++ .../code-unit/src/TraitMethodUnit.php | 24 + vendor/sebastian/code-unit/src/TraitUnit.php | 24 + .../code-unit/src/exceptions/Exception.php | 16 + .../exceptions/InvalidCodeUnitException.php | 16 + .../src/exceptions/NoTraitException.php | 16 + .../src/exceptions/ReflectionException.php | 16 + .../comparator/src/ArrayComparator.php | 141 + .../sebastian/comparator/src/Comparator.php | 61 + .../comparator/src/ComparisonFailure.php | 129 + .../comparator/src/DOMNodeComparator.php | 93 + .../comparator/src/DateTimeComparator.php | 95 + .../comparator/src/DoubleComparator.php | 61 + .../comparator/src/ExceptionComparator.php | 54 + vendor/sebastian/comparator/src/Factory.php | 141 + .../comparator/src/MockObjectComparator.php | 48 + .../comparator/src/NumericComparator.php | 84 + .../comparator/src/ObjectComparator.php | 112 + .../comparator/src/ResourceComparator.php | 54 + .../comparator/src/ScalarComparator.php | 99 + .../src/SplObjectStorageComparator.php | 71 + .../comparator/src/TypeComparator.php | 62 + .../comparator/src/exceptions/Exception.php | 16 + .../src/exceptions/RuntimeException.php | 14 + .../sebastian/complexity/src/Calculator.php | 81 + .../complexity/src/Complexity/Complexity.php | 42 + .../src/Complexity/ComplexityCollection.php | 72 + .../ComplexityCollectionIterator.php | 55 + .../complexity/src/Exception/Exception.php | 16 + .../src/Exception/RuntimeException.php | 14 + .../Visitor/ComplexityCalculatingVisitor.php | 109 + ...CyclomaticComplexityCalculatingVisitor.php | 59 + vendor/sebastian/diff/src/Chunk.php | 89 + vendor/sebastian/diff/src/Diff.php | 64 + vendor/sebastian/diff/src/Differ.php | 327 + .../src/Exception/ConfigurationException.php | 38 + .../diff/src/Exception/Exception.php | 16 + .../Exception/InvalidArgumentException.php | 14 + vendor/sebastian/diff/src/Line.php | 45 + .../LongestCommonSubsequenceCalculator.php | 18 + ...ientLongestCommonSubsequenceCalculator.php | 93 + .../src/Output/AbstractChunkOutputBuilder.php | 52 + .../diff/src/Output/DiffOnlyOutputBuilder.php | 72 + .../src/Output/DiffOutputBuilderInterface.php | 19 + .../Output/StrictUnifiedDiffOutputBuilder.php | 338 + .../src/Output/UnifiedDiffOutputBuilder.php | 272 + vendor/sebastian/diff/src/Parser.php | 110 + ...ientLongestCommonSubsequenceCalculator.php | 82 + vendor/sebastian/environment/src/Console.php | 187 + .../environment/src/OperatingSystem.php | 53 + vendor/sebastian/environment/src/Runtime.php | 321 + vendor/sebastian/exporter/src/Exporter.php | 346 + .../global-state/src/CodeExporter.php | 109 + .../global-state/src/ExcludeList.php | 119 + .../sebastian/global-state/src/Restorer.php | 143 + .../sebastian/global-state/src/Snapshot.php | 443 ++ .../global-state/src/exceptions/Exception.php | 16 + .../src/exceptions/RuntimeException.php | 14 + .../sebastian/lines-of-code/src/Counter.php | 84 + .../lines-of-code/src/Exception/Exception.php | 16 + .../Exception/IllogicalValuesException.php | 16 + .../src/Exception/NegativeValueException.php | 16 + .../src/Exception/RuntimeException.php | 14 + .../lines-of-code/src/LineCountingVisitor.php | 82 + .../lines-of-code/src/LinesOfCode.php | 98 + .../object-enumerator/src/Enumerator.php | 88 + .../object-enumerator/src/Exception.php | 16 + .../src/InvalidArgumentException.php | 14 + .../object-reflector/src/Exception.php | 16 + .../src/InvalidArgumentException.php | 14 + .../object-reflector/src/ObjectReflector.php | 51 + .../recursion-context/src/Context.php | 191 + .../recursion-context/src/Exception.php | 16 + .../src/InvalidArgumentException.php | 14 + .../resource-operations/build/generate.php | 65 + .../src/ResourceOperations.php | 2232 +++++++ vendor/sebastian/type/src/Parameter.php | 42 + .../sebastian/type/src/ReflectionMapper.php | 184 + vendor/sebastian/type/src/TypeName.php | 83 + .../type/src/exception/Exception.php | 16 + .../type/src/exception/RuntimeException.php | 14 + .../sebastian/type/src/type/CallableType.php | 212 + vendor/sebastian/type/src/type/FalseType.php | 42 + .../type/src/type/GenericObjectType.php | 54 + .../type/src/type/IntersectionType.php | 126 + .../sebastian/type/src/type/IterableType.php | 84 + vendor/sebastian/type/src/type/MixedType.php | 41 + vendor/sebastian/type/src/type/NeverType.php | 36 + vendor/sebastian/type/src/type/NullType.php | 41 + vendor/sebastian/type/src/type/ObjectType.php | 74 + vendor/sebastian/type/src/type/SimpleType.php | 104 + vendor/sebastian/type/src/type/StaticType.php | 68 + vendor/sebastian/type/src/type/TrueType.php | 42 + vendor/sebastian/type/src/type/Type.php | 226 + vendor/sebastian/type/src/type/UnionType.php | 138 + .../sebastian/type/src/type/UnknownType.php | 41 + vendor/sebastian/type/src/type/VoidType.php | 36 + vendor/sebastian/version/src/Version.php | 97 + .../deprecation-contracts/function.php | 27 + vendor/symfony/polyfill-ctype/Ctype.php | 232 + vendor/symfony/polyfill-ctype/bootstrap.php | 50 + vendor/symfony/polyfill-ctype/bootstrap80.php | 46 + vendor/symfony/polyfill-intl-idn/Idn.php | 923 +++ vendor/symfony/polyfill-intl-idn/Info.php | 23 + .../Resources/unidata/DisallowedRanges.php | 384 ++ .../Resources/unidata/Regex.php | 33 + .../Resources/unidata/deviation.php | 8 + .../Resources/unidata/disallowed.php | 2638 ++++++++ .../unidata/disallowed_STD3_mapped.php | 308 + .../unidata/disallowed_STD3_valid.php | 71 + .../Resources/unidata/ignored.php | 273 + .../Resources/unidata/mapped.php | 5778 +++++++++++++++++ .../Resources/unidata/virama.php | 65 + .../symfony/polyfill-intl-idn/bootstrap.php | 145 + .../symfony/polyfill-intl-idn/bootstrap80.php | 125 + .../polyfill-intl-normalizer/Normalizer.php | 310 + .../Resources/stubs/Normalizer.php | 17 + .../unidata/canonicalComposition.php | 945 +++ .../unidata/canonicalDecomposition.php | 2065 ++++++ .../Resources/unidata/combiningClass.php | 876 +++ .../unidata/compatibilityDecomposition.php | 3695 +++++++++++ .../polyfill-intl-normalizer/bootstrap.php | 23 + .../polyfill-intl-normalizer/bootstrap80.php | 19 + vendor/symfony/polyfill-mbstring/Mbstring.php | 947 +++ .../Resources/unidata/caseFolding.php | 119 + .../Resources/unidata/lowerCase.php | 1397 ++++ .../Resources/unidata/titleCaseRegexp.php | 5 + .../Resources/unidata/upperCase.php | 1489 +++++ .../symfony/polyfill-mbstring/bootstrap.php | 151 + .../symfony/polyfill-mbstring/bootstrap80.php | 147 + vendor/symfony/yaml/Command/LintCommand.php | 289 + vendor/symfony/yaml/Dumper.php | 176 + vendor/symfony/yaml/Escaper.php | 95 + .../symfony/yaml/Exception/DumpException.php | 21 + .../yaml/Exception/ExceptionInterface.php | 21 + .../symfony/yaml/Exception/ParseException.php | 132 + .../yaml/Exception/RuntimeException.php | 21 + vendor/symfony/yaml/Inline.php | 815 +++ vendor/symfony/yaml/Parser.php | 1305 ++++ vendor/symfony/yaml/Resources/bin/yaml-lint | 49 + vendor/symfony/yaml/Tag/TaggedValue.php | 38 + vendor/symfony/yaml/Unescaper.php | 132 + vendor/symfony/yaml/Yaml.php | 100 + vendor/theseer/tokenizer/composer.lock | 22 + vendor/theseer/tokenizer/src/Exception.php | 5 + vendor/theseer/tokenizer/src/NamespaceUri.php | 25 + .../tokenizer/src/NamespaceUriException.php | 5 + vendor/theseer/tokenizer/src/Token.php | 35 + .../theseer/tokenizer/src/TokenCollection.php | 93 + .../src/TokenCollectionException.php | 5 + vendor/theseer/tokenizer/src/Tokenizer.php | 149 + .../theseer/tokenizer/src/XMLSerializer.php | 79 + 1148 files changed, 150869 insertions(+) create mode 100644 src/PayPalPayment.php create mode 100755 vendor/bin/php-parse create mode 100755 vendor/bin/phpunit create mode 100755 vendor/bin/yaml-lint create mode 100644 vendor/claviska/simpleimage/composer.lock create mode 100644 vendor/claviska/simpleimage/src/claviska/SimpleImage.php create mode 100644 vendor/composer/autoload_files.php create mode 100644 vendor/composer/semver/phpstan-baseline.neon create mode 100644 vendor/composer/semver/src/Comparator.php create mode 100644 vendor/composer/semver/src/CompilingMatcher.php create mode 100644 vendor/composer/semver/src/Constraint/Bound.php create mode 100644 vendor/composer/semver/src/Constraint/Constraint.php create mode 100644 vendor/composer/semver/src/Constraint/ConstraintInterface.php create mode 100644 vendor/composer/semver/src/Constraint/MatchAllConstraint.php create mode 100644 vendor/composer/semver/src/Constraint/MatchNoneConstraint.php create mode 100644 vendor/composer/semver/src/Constraint/MultiConstraint.php create mode 100644 vendor/composer/semver/src/Interval.php create mode 100644 vendor/composer/semver/src/Intervals.php create mode 100644 vendor/composer/semver/src/Semver.php create mode 100644 vendor/composer/semver/src/VersionParser.php create mode 100644 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php create mode 100644 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php create mode 100644 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php create mode 100644 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php create mode 100644 vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php create mode 100644 vendor/filp/whoops/src/Whoops/Exception/ErrorException.php create mode 100644 vendor/filp/whoops/src/Whoops/Exception/Formatter.php create mode 100644 vendor/filp/whoops/src/Whoops/Exception/Frame.php create mode 100644 vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php create mode 100644 vendor/filp/whoops/src/Whoops/Exception/Inspector.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/CallbackHandler.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/Handler.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php create mode 100644 vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php create mode 100644 vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php create mode 100644 vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php create mode 100644 vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/css/prism.css create mode 100644 vendor/filp/whoops/src/Whoops/Resources/css/whoops.base.css create mode 100644 vendor/filp/whoops/src/Whoops/Resources/js/clipboard.min.js create mode 100644 vendor/filp/whoops/src/Whoops/Resources/js/prism.js create mode 100644 vendor/filp/whoops/src/Whoops/Resources/js/whoops.base.js create mode 100644 vendor/filp/whoops/src/Whoops/Resources/js/zepto.min.js create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/env_details.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/frame_list.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/frames_container.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/frames_description.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/header.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/header_outer.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php create mode 100644 vendor/filp/whoops/src/Whoops/Run.php create mode 100644 vendor/filp/whoops/src/Whoops/RunInterface.php create mode 100644 vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php create mode 100644 vendor/filp/whoops/src/Whoops/Util/Misc.php create mode 100644 vendor/filp/whoops/src/Whoops/Util/SystemFacade.php create mode 100644 vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php create mode 100644 vendor/laminas/laminas-escaper/src/Escaper.php create mode 100644 vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php create mode 100644 vendor/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php create mode 100644 vendor/laminas/laminas-escaper/src/Exception/RuntimeException.php create mode 100644 vendor/league/color-extractor/src/Color.php create mode 100644 vendor/league/color-extractor/src/ColorExtractor.php create mode 100644 vendor/league/color-extractor/src/Palette.php create mode 100644 vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php create mode 100644 vendor/michelf/php-smartypants/Michelf/SmartyPants.php create mode 100644 vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php create mode 100644 vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php create mode 100644 vendor/michelf/php-smartypants/Readme.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php create mode 100755 vendor/nikic/php-parser/bin/php-parse create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Comment.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Error.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Modifiers.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NameContext.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Name.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Param.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Parser.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/Token.php create mode 100644 vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php create mode 100644 vendor/phar-io/manifest/composer.lock create mode 100644 vendor/phar-io/manifest/src/ManifestDocumentMapper.php create mode 100644 vendor/phar-io/manifest/src/ManifestLoader.php create mode 100644 vendor/phar-io/manifest/src/ManifestSerializer.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/Exception.php create mode 100644 vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ManifestElementException.php create mode 100644 vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php create mode 100644 vendor/phar-io/manifest/src/values/Application.php create mode 100644 vendor/phar-io/manifest/src/values/ApplicationName.php create mode 100644 vendor/phar-io/manifest/src/values/Author.php create mode 100644 vendor/phar-io/manifest/src/values/AuthorCollection.php create mode 100644 vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php create mode 100644 vendor/phar-io/manifest/src/values/BundledComponent.php create mode 100644 vendor/phar-io/manifest/src/values/BundledComponentCollection.php create mode 100644 vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php create mode 100644 vendor/phar-io/manifest/src/values/CopyrightInformation.php create mode 100644 vendor/phar-io/manifest/src/values/Email.php create mode 100644 vendor/phar-io/manifest/src/values/Extension.php create mode 100644 vendor/phar-io/manifest/src/values/Library.php create mode 100644 vendor/phar-io/manifest/src/values/License.php create mode 100644 vendor/phar-io/manifest/src/values/Manifest.php create mode 100644 vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php create mode 100644 vendor/phar-io/manifest/src/values/PhpVersionRequirement.php create mode 100644 vendor/phar-io/manifest/src/values/Requirement.php create mode 100644 vendor/phar-io/manifest/src/values/RequirementCollection.php create mode 100644 vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php create mode 100644 vendor/phar-io/manifest/src/values/Type.php create mode 100644 vendor/phar-io/manifest/src/values/Url.php create mode 100644 vendor/phar-io/manifest/src/xml/AuthorElement.php create mode 100644 vendor/phar-io/manifest/src/xml/AuthorElementCollection.php create mode 100644 vendor/phar-io/manifest/src/xml/BundlesElement.php create mode 100644 vendor/phar-io/manifest/src/xml/ComponentElement.php create mode 100644 vendor/phar-io/manifest/src/xml/ComponentElementCollection.php create mode 100644 vendor/phar-io/manifest/src/xml/ContainsElement.php create mode 100644 vendor/phar-io/manifest/src/xml/CopyrightElement.php create mode 100644 vendor/phar-io/manifest/src/xml/ElementCollection.php create mode 100644 vendor/phar-io/manifest/src/xml/ExtElement.php create mode 100644 vendor/phar-io/manifest/src/xml/ExtElementCollection.php create mode 100644 vendor/phar-io/manifest/src/xml/ExtensionElement.php create mode 100644 vendor/phar-io/manifest/src/xml/LicenseElement.php create mode 100644 vendor/phar-io/manifest/src/xml/ManifestDocument.php create mode 100644 vendor/phar-io/manifest/src/xml/ManifestElement.php create mode 100644 vendor/phar-io/manifest/src/xml/PhpElement.php create mode 100644 vendor/phar-io/manifest/src/xml/RequiresElement.php create mode 100644 vendor/phar-io/version/src/BuildMetaData.php create mode 100644 vendor/phar-io/version/src/PreReleaseSuffix.php create mode 100644 vendor/phar-io/version/src/Version.php create mode 100644 vendor/phar-io/version/src/VersionConstraintParser.php create mode 100644 vendor/phar-io/version/src/VersionConstraintValue.php create mode 100644 vendor/phar-io/version/src/VersionNumber.php create mode 100644 vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php create mode 100644 vendor/phar-io/version/src/constraints/AnyVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/ExactVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php create mode 100644 vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php create mode 100644 vendor/phar-io/version/src/constraints/VersionConstraint.php create mode 100644 vendor/phar-io/version/src/exceptions/Exception.php create mode 100644 vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php create mode 100644 vendor/phar-io/version/src/exceptions/InvalidVersionException.php create mode 100644 vendor/phar-io/version/src/exceptions/NoBuildMetaDataException.php create mode 100644 vendor/phar-io/version/src/exceptions/NoPreReleaseSuffixException.php create mode 100644 vendor/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php create mode 100644 vendor/phpmailer/phpmailer/COMMITMENT create mode 100644 vendor/phpmailer/phpmailer/get_oauth_token.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php create mode 100644 vendor/phpmailer/phpmailer/src/DSNConfigurator.php create mode 100644 vendor/phpmailer/phpmailer/src/Exception.php create mode 100644 vendor/phpmailer/phpmailer/src/OAuth.php create mode 100644 vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php create mode 100644 vendor/phpmailer/phpmailer/src/PHPMailer.php create mode 100644 vendor/phpmailer/phpmailer/src/POP3.php create mode 100644 vendor/phpmailer/phpmailer/src/SMTP.php create mode 100644 vendor/phpunit/php-code-coverage/src/CodeCoverage.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/Driver.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/Selector.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php create mode 100644 vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/Exception.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/ParserException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/ReflectionException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Exception/XmlException.php create mode 100644 vendor/phpunit/php-code-coverage/src/Filter.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/Builder.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/Directory.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/File.php create mode 100644 vendor/phpunit/php-code-coverage/src/Node/Iterator.php create mode 100644 vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php create mode 100644 vendor/phpunit/php-code-coverage/src/RawCodeCoverageData.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Clover.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Cobertura.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Crap4j.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/custom.css create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/d3.min.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/nv.d3.min.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js create mode 100644 vendor/phpunit/php-code-coverage/src/Report/PHP.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Text.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/File.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php create mode 100644 vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php create mode 100644 vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php create mode 100644 vendor/phpunit/php-code-coverage/src/Util/Filesystem.php create mode 100644 vendor/phpunit/php-code-coverage/src/Util/Percentage.php create mode 100644 vendor/phpunit/php-code-coverage/src/Version.php create mode 100644 vendor/phpunit/php-file-iterator/src/Facade.php create mode 100644 vendor/phpunit/php-file-iterator/src/Factory.php create mode 100644 vendor/phpunit/php-file-iterator/src/Iterator.php create mode 100644 vendor/phpunit/php-invoker/src/Invoker.php create mode 100644 vendor/phpunit/php-invoker/src/exceptions/Exception.php create mode 100644 vendor/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.php create mode 100644 vendor/phpunit/php-invoker/src/exceptions/TimeoutException.php create mode 100644 vendor/phpunit/php-text-template/src/Template.php create mode 100644 vendor/phpunit/php-text-template/src/exceptions/Exception.php create mode 100644 vendor/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php create mode 100644 vendor/phpunit/php-text-template/src/exceptions/RuntimeException.php create mode 100644 vendor/phpunit/php-timer/src/Duration.php create mode 100644 vendor/phpunit/php-timer/src/ResourceUsageFormatter.php create mode 100644 vendor/phpunit/php-timer/src/Timer.php create mode 100644 vendor/phpunit/php-timer/src/exceptions/Exception.php create mode 100644 vendor/phpunit/php-timer/src/exceptions/NoActiveTimerException.php create mode 100644 vendor/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.php create mode 100644 vendor/phpunit/phpunit/composer.lock create mode 100755 vendor/phpunit/phpunit/phpunit create mode 100644 vendor/phpunit/phpunit/phpunit.xsd create mode 100644 vendor/phpunit/phpunit/schema/8.5.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.0.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.1.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.2.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.3.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.4.xsd create mode 100644 vendor/phpunit/phpunit/schema/9.5.xsd create mode 100644 vendor/phpunit/phpunit/src/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Assert.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Assert/Functions.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php create mode 100644 vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Error/Error.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Error/Notice.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Error/Warning.php create mode 100644 vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/Error.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Exception/Warning.php create mode 100644 vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php create mode 100644 vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php create mode 100644 vendor/phpunit/phpunit/src/Framework/IncompleteTest.php create mode 100644 vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php create mode 100644 vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php create mode 100644 vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Reorderable.php create mode 100644 vendor/phpunit/phpunit/src/Framework/SelfDescribing.php create mode 100644 vendor/phpunit/phpunit/src/Framework/SkippedTest.php create mode 100644 vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php create mode 100644 vendor/phpunit/phpunit/src/Framework/Test.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestBuilder.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestCase.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestFailure.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestListener.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestResult.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestSuite.php create mode 100644 vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php create mode 100644 vendor/phpunit/phpunit/src/Framework/WarningTestCase.php create mode 100644 vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php create mode 100644 vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Filter/Factory.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/Hook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php create mode 100644 vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php create mode 100644 vendor/phpunit/phpunit/src/Runner/PhptTestCase.php create mode 100644 vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php create mode 100644 vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php create mode 100644 vendor/phpunit/phpunit/src/Runner/TestResultCache.php create mode 100644 vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php create mode 100644 vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php create mode 100644 vendor/phpunit/phpunit/src/Runner/Version.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/CliArguments/Exception.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Command.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/Help.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/TestRunner.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php create mode 100644 vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php create mode 100644 vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php create mode 100644 vendor/phpunit/phpunit/src/Util/Annotation/Registry.php create mode 100644 vendor/phpunit/phpunit/src/Util/Blacklist.php create mode 100644 vendor/phpunit/phpunit/src/Util/Cloner.php create mode 100644 vendor/phpunit/phpunit/src/Util/Color.php create mode 100644 vendor/phpunit/phpunit/src/Util/ErrorHandler.php create mode 100644 vendor/phpunit/phpunit/src/Util/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Util/ExcludeList.php create mode 100644 vendor/phpunit/phpunit/src/Util/FileLoader.php create mode 100644 vendor/phpunit/phpunit/src/Util/Filesystem.php create mode 100644 vendor/phpunit/phpunit/src/Util/Filter.php create mode 100644 vendor/phpunit/phpunit/src/Util/GlobalState.php create mode 100644 vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php create mode 100644 vendor/phpunit/phpunit/src/Util/Json.php create mode 100644 vendor/phpunit/phpunit/src/Util/Log/JUnit.php create mode 100644 vendor/phpunit/phpunit/src/Util/Log/TeamCity.php create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl create mode 100644 vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php create mode 100644 vendor/phpunit/phpunit/src/Util/Printer.php create mode 100644 vendor/phpunit/phpunit/src/Util/Reflection.php create mode 100644 vendor/phpunit/phpunit/src/Util/RegularExpression.php create mode 100644 vendor/phpunit/phpunit/src/Util/Test.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php create mode 100644 vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php create mode 100644 vendor/phpunit/phpunit/src/Util/Type.php create mode 100644 vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php create mode 100644 vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/Exception.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/Loader.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php create mode 100644 vendor/phpunit/phpunit/src/Util/Xml/Validator.php create mode 100644 vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php create mode 100644 vendor/psr/log/src/AbstractLogger.php create mode 100644 vendor/psr/log/src/InvalidArgumentException.php create mode 100644 vendor/psr/log/src/LogLevel.php create mode 100644 vendor/psr/log/src/LoggerAwareInterface.php create mode 100644 vendor/psr/log/src/LoggerAwareTrait.php create mode 100644 vendor/psr/log/src/LoggerInterface.php create mode 100644 vendor/psr/log/src/LoggerTrait.php create mode 100644 vendor/psr/log/src/NullLogger.php create mode 100644 vendor/sebastian/cli-parser/src/Parser.php create mode 100644 vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php create mode 100644 vendor/sebastian/cli-parser/src/exceptions/Exception.php create mode 100644 vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php create mode 100644 vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php create mode 100644 vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php create mode 100644 vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php create mode 100644 vendor/sebastian/code-unit/src/ClassMethodUnit.php create mode 100644 vendor/sebastian/code-unit/src/ClassUnit.php create mode 100644 vendor/sebastian/code-unit/src/CodeUnit.php create mode 100644 vendor/sebastian/code-unit/src/CodeUnitCollection.php create mode 100644 vendor/sebastian/code-unit/src/CodeUnitCollectionIterator.php create mode 100644 vendor/sebastian/code-unit/src/FunctionUnit.php create mode 100644 vendor/sebastian/code-unit/src/InterfaceMethodUnit.php create mode 100644 vendor/sebastian/code-unit/src/InterfaceUnit.php create mode 100644 vendor/sebastian/code-unit/src/Mapper.php create mode 100644 vendor/sebastian/code-unit/src/TraitMethodUnit.php create mode 100644 vendor/sebastian/code-unit/src/TraitUnit.php create mode 100644 vendor/sebastian/code-unit/src/exceptions/Exception.php create mode 100644 vendor/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.php create mode 100644 vendor/sebastian/code-unit/src/exceptions/NoTraitException.php create mode 100644 vendor/sebastian/code-unit/src/exceptions/ReflectionException.php create mode 100644 vendor/sebastian/comparator/src/ArrayComparator.php create mode 100644 vendor/sebastian/comparator/src/Comparator.php create mode 100644 vendor/sebastian/comparator/src/ComparisonFailure.php create mode 100644 vendor/sebastian/comparator/src/DOMNodeComparator.php create mode 100644 vendor/sebastian/comparator/src/DateTimeComparator.php create mode 100644 vendor/sebastian/comparator/src/DoubleComparator.php create mode 100644 vendor/sebastian/comparator/src/ExceptionComparator.php create mode 100644 vendor/sebastian/comparator/src/Factory.php create mode 100644 vendor/sebastian/comparator/src/MockObjectComparator.php create mode 100644 vendor/sebastian/comparator/src/NumericComparator.php create mode 100644 vendor/sebastian/comparator/src/ObjectComparator.php create mode 100644 vendor/sebastian/comparator/src/ResourceComparator.php create mode 100644 vendor/sebastian/comparator/src/ScalarComparator.php create mode 100644 vendor/sebastian/comparator/src/SplObjectStorageComparator.php create mode 100644 vendor/sebastian/comparator/src/TypeComparator.php create mode 100644 vendor/sebastian/comparator/src/exceptions/Exception.php create mode 100644 vendor/sebastian/comparator/src/exceptions/RuntimeException.php create mode 100644 vendor/sebastian/complexity/src/Calculator.php create mode 100644 vendor/sebastian/complexity/src/Complexity/Complexity.php create mode 100644 vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php create mode 100644 vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php create mode 100644 vendor/sebastian/complexity/src/Exception/Exception.php create mode 100644 vendor/sebastian/complexity/src/Exception/RuntimeException.php create mode 100644 vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php create mode 100644 vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php create mode 100644 vendor/sebastian/diff/src/Chunk.php create mode 100644 vendor/sebastian/diff/src/Diff.php create mode 100644 vendor/sebastian/diff/src/Differ.php create mode 100644 vendor/sebastian/diff/src/Exception/ConfigurationException.php create mode 100644 vendor/sebastian/diff/src/Exception/Exception.php create mode 100644 vendor/sebastian/diff/src/Exception/InvalidArgumentException.php create mode 100644 vendor/sebastian/diff/src/Line.php create mode 100644 vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php create mode 100644 vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php create mode 100644 vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php create mode 100644 vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php create mode 100644 vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php create mode 100644 vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php create mode 100644 vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php create mode 100644 vendor/sebastian/diff/src/Parser.php create mode 100644 vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php create mode 100644 vendor/sebastian/environment/src/Console.php create mode 100644 vendor/sebastian/environment/src/OperatingSystem.php create mode 100644 vendor/sebastian/environment/src/Runtime.php create mode 100644 vendor/sebastian/exporter/src/Exporter.php create mode 100644 vendor/sebastian/global-state/src/CodeExporter.php create mode 100644 vendor/sebastian/global-state/src/ExcludeList.php create mode 100644 vendor/sebastian/global-state/src/Restorer.php create mode 100644 vendor/sebastian/global-state/src/Snapshot.php create mode 100644 vendor/sebastian/global-state/src/exceptions/Exception.php create mode 100644 vendor/sebastian/global-state/src/exceptions/RuntimeException.php create mode 100644 vendor/sebastian/lines-of-code/src/Counter.php create mode 100644 vendor/sebastian/lines-of-code/src/Exception/Exception.php create mode 100644 vendor/sebastian/lines-of-code/src/Exception/IllogicalValuesException.php create mode 100644 vendor/sebastian/lines-of-code/src/Exception/NegativeValueException.php create mode 100644 vendor/sebastian/lines-of-code/src/Exception/RuntimeException.php create mode 100644 vendor/sebastian/lines-of-code/src/LineCountingVisitor.php create mode 100644 vendor/sebastian/lines-of-code/src/LinesOfCode.php create mode 100644 vendor/sebastian/object-enumerator/src/Enumerator.php create mode 100644 vendor/sebastian/object-enumerator/src/Exception.php create mode 100644 vendor/sebastian/object-enumerator/src/InvalidArgumentException.php create mode 100644 vendor/sebastian/object-reflector/src/Exception.php create mode 100644 vendor/sebastian/object-reflector/src/InvalidArgumentException.php create mode 100644 vendor/sebastian/object-reflector/src/ObjectReflector.php create mode 100644 vendor/sebastian/recursion-context/src/Context.php create mode 100644 vendor/sebastian/recursion-context/src/Exception.php create mode 100644 vendor/sebastian/recursion-context/src/InvalidArgumentException.php create mode 100755 vendor/sebastian/resource-operations/build/generate.php create mode 100644 vendor/sebastian/resource-operations/src/ResourceOperations.php create mode 100644 vendor/sebastian/type/src/Parameter.php create mode 100644 vendor/sebastian/type/src/ReflectionMapper.php create mode 100644 vendor/sebastian/type/src/TypeName.php create mode 100644 vendor/sebastian/type/src/exception/Exception.php create mode 100644 vendor/sebastian/type/src/exception/RuntimeException.php create mode 100644 vendor/sebastian/type/src/type/CallableType.php create mode 100644 vendor/sebastian/type/src/type/FalseType.php create mode 100644 vendor/sebastian/type/src/type/GenericObjectType.php create mode 100644 vendor/sebastian/type/src/type/IntersectionType.php create mode 100644 vendor/sebastian/type/src/type/IterableType.php create mode 100644 vendor/sebastian/type/src/type/MixedType.php create mode 100644 vendor/sebastian/type/src/type/NeverType.php create mode 100644 vendor/sebastian/type/src/type/NullType.php create mode 100644 vendor/sebastian/type/src/type/ObjectType.php create mode 100644 vendor/sebastian/type/src/type/SimpleType.php create mode 100644 vendor/sebastian/type/src/type/StaticType.php create mode 100644 vendor/sebastian/type/src/type/TrueType.php create mode 100644 vendor/sebastian/type/src/type/Type.php create mode 100644 vendor/sebastian/type/src/type/UnionType.php create mode 100644 vendor/sebastian/type/src/type/UnknownType.php create mode 100644 vendor/sebastian/type/src/type/VoidType.php create mode 100644 vendor/sebastian/version/src/Version.php create mode 100644 vendor/symfony/deprecation-contracts/function.php create mode 100644 vendor/symfony/polyfill-ctype/Ctype.php create mode 100644 vendor/symfony/polyfill-ctype/bootstrap.php create mode 100644 vendor/symfony/polyfill-ctype/bootstrap80.php create mode 100644 vendor/symfony/polyfill-intl-idn/Idn.php create mode 100644 vendor/symfony/polyfill-intl-idn/Info.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php create mode 100644 vendor/symfony/polyfill-intl-idn/bootstrap.php create mode 100644 vendor/symfony/polyfill-intl-idn/bootstrap80.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Normalizer.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap80.php create mode 100644 vendor/symfony/polyfill-mbstring/Mbstring.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php create mode 100644 vendor/symfony/polyfill-mbstring/bootstrap.php create mode 100644 vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 vendor/symfony/yaml/Command/LintCommand.php create mode 100644 vendor/symfony/yaml/Dumper.php create mode 100644 vendor/symfony/yaml/Escaper.php create mode 100644 vendor/symfony/yaml/Exception/DumpException.php create mode 100644 vendor/symfony/yaml/Exception/ExceptionInterface.php create mode 100644 vendor/symfony/yaml/Exception/ParseException.php create mode 100644 vendor/symfony/yaml/Exception/RuntimeException.php create mode 100644 vendor/symfony/yaml/Inline.php create mode 100644 vendor/symfony/yaml/Parser.php create mode 100755 vendor/symfony/yaml/Resources/bin/yaml-lint create mode 100644 vendor/symfony/yaml/Tag/TaggedValue.php create mode 100644 vendor/symfony/yaml/Unescaper.php create mode 100644 vendor/symfony/yaml/Yaml.php create mode 100644 vendor/theseer/tokenizer/composer.lock create mode 100644 vendor/theseer/tokenizer/src/Exception.php create mode 100644 vendor/theseer/tokenizer/src/NamespaceUri.php create mode 100644 vendor/theseer/tokenizer/src/NamespaceUriException.php create mode 100644 vendor/theseer/tokenizer/src/Token.php create mode 100644 vendor/theseer/tokenizer/src/TokenCollection.php create mode 100644 vendor/theseer/tokenizer/src/TokenCollectionException.php create mode 100644 vendor/theseer/tokenizer/src/Tokenizer.php create mode 100644 vendor/theseer/tokenizer/src/XMLSerializer.php diff --git a/src/PayPalPayment.php b/src/PayPalPayment.php new file mode 100644 index 0000000..b03a64c --- /dev/null +++ b/src/PayPalPayment.php @@ -0,0 +1,211 @@ + + * @license https://wagnerwagner.de Copyright + * @link https://wagnerwagner.de + */ +class PayPalPayment +{ + private static function request(string $endpoint, string $data, array $auth = [], array $requestoptions = []): \Kirby\Http\Remote + { + + if (option('ww.merx.production') === true) { + $baseUrl = option('ww.merx.paypal.live.url'); + } else { + $baseUrl = option('ww.merx.paypal.sandbox.url'); + } + + $endpoint = $baseUrl.$endpoint; + $options = [ + 'method' => 'POST', + 'headers' => [ + 'Content-Type' => 'application/x-www-form-urlencoded' + ], + 'data' => $data, + ]; + $options = array_replace_recursive( + $options, + $auth, + $requestoptions + ); + file_put_contents('test.txt',print_r($options,true)."\n", FILE_APPEND); + $requestClient = Remote::request( + $endpoint, + $options + ); + return $requestClient; + } + + /** + * create a authorization token + * + * @author Alexander Kovac + * @license https://wagnerwagner.de Copyright + * + * @return array contains the auth-informations provided by paypal + */ + private static function getAccessTokken(): array + { + /** + * Rquest Example + * curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token"\ + * -u "CLIENT_ID:CLIENT_SECRET"\ + * -H "Content-Type: application/x-www-form-urlencoded"\ + * -d "grant_type=client_credentials" + */ + if (option('ww.merx.production') === true) { + $auth = option('ww.merx.paypal.live.clientID').':'.option('ww.merx.paypal.live.secret'); + } else { + $auth = option('ww.merx.paypal.sandbox.clientID').':'.option('ww.merx.paypal.sandbox.secret'); + } + $endpoint = '/v1/oauth2/token'; + $token = self::request( + $endpoint, + 'grant_type=client_credentials', + [ + 'basicAuth' => $auth, + ], + ); + kirby()->session()->set('ww.merx.auth', $token->json()); + return $token->json(); + } + + /** + * create an order, send it to paypal and return the result as array to initializePayment of the Gateway + * + * @param \OrderPage $orderPage + * + * @author Alexander Kovac + * @license https://wagnerwagner.de Copyright + * + * @return array with the orderinformations provided by paypal. + */ + public static function createPayPalPayment(OrderPage $orderPage): array + { + /** + * Request Example + * curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \ + * -H 'Content-Type: application/json' \ + * -H 'PayPal-Request-Id: 7b92603e-77ed-4896-8e78-5dea2050476a' \ + * -H 'Authorization: Bearer 6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ + * -d '{ + * "intent": "CAPTURE", + * "purchase_units": [ + * { + * "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b", + * "amount": { + * "currency_code": "USD", + * "value": "100.00" + * } + * } + * ], + * "payment_source": { + * "paypal": { + * "experience_context": { + * "payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED", + * "brand_name": "EXAMPLE INC", + * "locale": "en-US", + * "landing_page": "LOGIN", + * "shipping_preference": "SET_PROVIDED_ADDRESS", + * "user_action": "PAY_NOW", + * "return_url": "https://example.com/returnUrl", + * "cancel_url": "https://example.com/cancelUrl" + * } + * } + * } + * }' + */ + $siteTitle = (string)site()->title(); + $access = self::getAccessTokken(); + + if (option('ww.merx.paypal.purchaseUnits')) { + $purchaseUnits = option('ww.merx.paypal.purchaseUnits')(); + } else { + $purchaseUnits = [ + [ + "description" => $siteTitle, + "amount" => [ + "value" => number_format($orderPage->cart()->getSum(), 2, '.', ''), + "currency_code" => option('ww.merx.currency'), + ], + ], + ]; + } + $applicationContext = array_merge([ + 'cancel_url' => url(option('ww.merx.successPage')), + 'return_url' => url(option('ww.merx.successPage')), + 'user_action' => 'PAY_NOW', + 'shipping_preference' => 'NO_SHIPPING', + 'brand_name' => $siteTitle, + ], option('ww.merx.paypal.applicationContext', [])); + + $data = [ + 'intent' => 'CAPTURE', + 'purchase_units' => $purchaseUnits, + 'payment_source' => [ + 'paypal' => [ + 'experience_context' => $applicationContext + ] + ] + ]; + $endpoint = '/v2/checkout/orders'; + $paypalOrder = self::request( + $endpoint, + json_encode($data), + [], + ['headers' => [ + 'Content-Type' => 'application/json', + 'Authorization' => $access['token_type'].' '.$access['access_token'], + ]] + ); + return $paypalOrder->json(); + } + + /** + * capture the payment for given order. + * + * @param string $orderId + * + * @author Alexander Kovac + * @license https://wagnerwagner.de Copyright + * + * @return array with the capture informations provided by paypal + */ + public static function executePayPalPayment(string $orderId) : array + { + /** + * Request Example + * curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T/capture \ + * -H 'PayPal-Request-Id: 7b92603e-77ed-4896-8e78-5dea2050476a' \ + * -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' + * + */ + $access = kirby()->session()->get('ww.merx.auth'); + $endpoint = "/v2/checkout/orders/$orderId/capture"; + $response = self::request( + $endpoint, + '', + [], + [ + 'method' => 'POST', + 'headers' => + [ + 'Content-Type' => 'application/json', + 'Authorization' => $access['token_type'].' '.$access['access_token'], + ] + ] + ); + return $response->json(); + } +} diff --git a/vendor/bin/php-parse b/vendor/bin/php-parse new file mode 100755 index 0000000..61566e6 --- /dev/null +++ b/vendor/bin/php-parse @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); + } +} + +return include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit new file mode 100755 index 0000000..b5b530a --- /dev/null +++ b/vendor/bin/phpunit @@ -0,0 +1,122 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = 'phpvfscomposer://'.$this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data); + $data = str_replace('__FILE__', var_export($this->realpath, true), $data); + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); + } +} + +return include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/vendor/bin/yaml-lint b/vendor/bin/yaml-lint new file mode 100755 index 0000000..388092f --- /dev/null +++ b/vendor/bin/yaml-lint @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); + } +} + +return include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/vendor/claviska/simpleimage/composer.lock b/vendor/claviska/simpleimage/composer.lock new file mode 100644 index 0000000..d95667b --- /dev/null +++ b/vendor/claviska/simpleimage/composer.lock @@ -0,0 +1,209 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "eb94dc95686ec297093755af85d5e7dd", + "packages": [ + { + "name": "league/color-extractor", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/color-extractor.git", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "php": "^7.3 || ^8.0" + }, + "replace": { + "matthecat/colorextractor": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\ColorExtractor\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathieu Lechat", + "email": "math.lechat@gmail.com", + "homepage": "http://matthecat.com", + "role": "Developer" + } + ], + "description": "Extract colors from an image as a human would do.", + "homepage": "https://github.com/thephpleague/color-extractor", + "keywords": [ + "color", + "extract", + "human", + "image", + "palette" + ], + "support": { + "issues": "https://github.com/thephpleague/color-extractor/issues", + "source": "https://github.com/thephpleague/color-extractor/tree/0.4.0" + }, + "time": "2022-09-24T15:57:16+00:00" + } + ], + "packages-dev": [ + { + "name": "laravel/pint", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "e0a8cef58b74662f27355be9cdea0e726bbac362" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/e0a8cef58b74662f27355be9cdea0e726bbac362", + "reference": "e0a8cef58b74662f27355be9cdea0e726bbac362", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14.4", + "illuminate/view": "^9.51.0", + "laravel-zero/framework": "^9.2.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.4.0", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^1.22.4" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2023-02-14T16:31:02+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2ffec7db373d8da4973d1d62add872db5cd22dd", + "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.10.2" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2023-02-23T14:36:46+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=8.0", + "ext-gd": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/vendor/claviska/simpleimage/src/claviska/SimpleImage.php b/vendor/claviska/simpleimage/src/claviska/SimpleImage.php new file mode 100644 index 0000000..98a8232 --- /dev/null +++ b/vendor/claviska/simpleimage/src/claviska/SimpleImage.php @@ -0,0 +1,2385 @@ +. +// +// Copyright A Beautiful Site, LLC. +// +// Source: https://github.com/claviska/SimpleImage +// +// Licensed under the MIT license +// + +namespace claviska; + +use Exception; +use GdImage; +use League\ColorExtractor\Color; +use League\ColorExtractor\ColorExtractor; +use League\ColorExtractor\Palette; + +/** + * A PHP class that makes working with images as simple as possible. + */ +class SimpleImage +{ + public const + ERR_FILE_NOT_FOUND = 1; + + public const + ERR_FONT_FILE = 2; + + public const + ERR_FREETYPE_NOT_ENABLED = 3; + + public const + ERR_GD_NOT_ENABLED = 4; + + public const + ERR_INVALID_COLOR = 5; + + public const + ERR_INVALID_DATA_URI = 6; + + public const + ERR_INVALID_IMAGE = 7; + + public const + ERR_LIB_NOT_LOADED = 8; + + public const + ERR_UNSUPPORTED_FORMAT = 9; + + public const + ERR_WEBP_NOT_ENABLED = 10; + + public const + ERR_WRITE = 11; + + public const + ERR_INVALID_FLAG = 12; + + protected array $flags; + + protected $image = null; + + protected string $mimeType; + + protected null|array|false $exif = null; + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Magic methods + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Creates a new SimpleImage object. + * + * @param string $image An image file or a data URI to load. + * @param array $flags Optional override of default flags. + * + * @throws Exception Thrown if the GD library is not found; file|URI or image data is invalid. + */ + public function __construct(string $image = '', array $flags = []) + { + // Check for the required GD extension + if (extension_loaded('gd')) { + // Ignore JPEG warnings that cause imagecreatefromjpeg() to fail + ini_set('gd.jpeg_ignore_warning', '1'); + } else { + throw new Exception('Required extension GD is not loaded.', self::ERR_GD_NOT_ENABLED); + } + + // Associative array of flags. + $this->flags = [ + 'sslVerify' => true, // Skip SSL peer validation + ]; + + // Override default flag values. + foreach ($flags as $flag => $value) { + $this->setFlag($flag, $value); + } + + // Load an image through the constructor + if (preg_match('/^data:(.*?);/', $image)) { + $this->fromDataUri($image); + } elseif ($image) { + $this->fromFile($image); + } + } + + /** + * Destroys the image resource. + */ + public function __destruct() + { + if ($this->image instanceof GdImage) { + imagedestroy($this->image); + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Helper functions + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Set flag value. + * + * @param string $flag Name of the flag to set. + * @param bool $value State of the flag. + * + * @throws Exception Thrown if flag does not exist (no default value). + */ + public function setFlag(string $flag, bool $value): void + { + // Throw if flag does not exist + if (! in_array($flag, array_keys($this->flags))) { + throw new Exception('Invalid flag.', self::ERR_INVALID_FLAG); + } + + // Set flag value by name + $this->flags[$flag] = $value; + } + + /** + * Get flag value. + * + * @param string $flag Name of the flag to get. + */ + public function getFlag(string $flag): ?bool + { + return in_array($flag, array_keys($this->flags)) ? $this->flags[$flag] : null; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Loaders + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Loads an image from a data URI. + * + * @param string $uri A data URI. + * @return SimpleImage + * + * @throws Exception Thrown if URI or image data is invalid. + */ + public function fromDataUri(string $uri): static + { + // Basic formatting check + preg_match('/^data:(.*?);/', $uri, $matches); + if (! count($matches)) { + throw new Exception('Invalid data URI.', self::ERR_INVALID_DATA_URI); + } + + // Determine mime type + $this->mimeType = $matches[1]; + if (! preg_match('/^image\/(gif|jpeg|png)$/', $this->mimeType)) { + throw new Exception( + 'Unsupported format: '.$this->mimeType, + self::ERR_UNSUPPORTED_FORMAT + ); + } + + // Get image data + $uri = base64_decode(strval(preg_replace('/^data:(.*?);base64,/', '', $uri))); + $this->image = imagecreatefromstring($uri); + if (! $this->image) { + throw new Exception('Invalid image data.', self::ERR_INVALID_IMAGE); + } + + return $this; + } + + /** + * Loads an image from a file. + * + * @param string $file The image file to load. + * @return SimpleImage + * + * @throws Exception Thrown if file or image data is invalid. + */ + public function fromFile(string $file): static + { + // Set fopen options. + $sslVerify = $this->getFlag('sslVerify'); // Don't perform peer validation when true + $opts = [ + 'ssl' => [ + 'verify_peer' => $sslVerify, + 'verify_peer_name' => $sslVerify, + ], + ]; + + // Check if the file exists and is readable. + $file = @file_get_contents($file, false, stream_context_create($opts)); + if ($file === false) { + throw new Exception("File not found: $file", self::ERR_FILE_NOT_FOUND); + } + + // Create image object from string + $this->image = imagecreatefromstring($file); + + // Get image info + $info = @getimagesizefromstring($file); + if ($info === false) { + throw new Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE); + } + $this->mimeType = $info['mime']; + + if (! $this->image) { + throw new Exception('Unsupported format: '.$this->mimeType, self::ERR_UNSUPPORTED_FORMAT); + } + + switch($this->mimeType) { + case 'image/gif': + // Copy the gif over to a true color image to preserve its transparency. This is a + // workaround to prevent imagepalettetotruecolor() from borking transparency. + $width = imagesx($this->image); + $height = imagesx($this->image); + + $gif = imagecreatetruecolor((int) $width, (int) $height); + $alpha = imagecolorallocatealpha($gif, 0, 0, 0, 127); + imagecolortransparent($gif, $alpha ?: null); + imagefill($gif, 0, 0, $alpha); + + imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height); + imagedestroy($gif); + break; + case 'image/jpeg': + // Load exif data from JPEG images + if (function_exists('exif_read_data')) { + $this->exif = @exif_read_data('data://image/jpeg;base64,'.base64_encode($file)); + } + break; + } + + // Convert pallete images to true color images + imagepalettetotruecolor($this->image); + + return $this; + } + + /** + * Creates a new image. + * + * @param int $width The width of the image. + * @param int $height The height of the image. + * @param string|array $color Optional fill color for the new image (default 'transparent'). + * @return SimpleImage + * + * @throws Exception + */ + public function fromNew(int $width, int $height, string|array $color = 'transparent'): static + { + $this->image = imagecreatetruecolor($width, $height); + + // Use PNG for dynamically created images because it's lossless and supports transparency + $this->mimeType = 'image/png'; + + // Fill the image with color + $this->fill($color); + + return $this; + } + + /** + * Creates a new image from a string. + * + * @param string $string The raw image data as a string. + * @return SimpleImage + * + * @throws Exception + * + * @example + * $string = file_get_contents('image.jpg'); + */ + public function fromString(string $string): SimpleImage|static + { + return $this->fromFile('data://;base64,'.base64_encode($string)); + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Savers + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Generates an image. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return array Returns an array containing the image data and mime type ['data' => '', 'mimeType' => '']. + * + * @throws Exception Thrown when WEBP support is not enabled or unsupported format. + */ + protected function generate(string $mimeType = null, array|int $options = []): array + { + // Format defaults to the original mime type + $mimeType = $mimeType ?: $this->mimeType; + + $quality = null; + // allow $options to be an int for backwards compatibility to v3 + if (is_int($options)) { + $quality = $options; + $options = []; + } + + // get quality if passed as an option + if (is_array($options) && array_key_exists('quality', $options)) { + $quality = intval($options['quality']); + } + + // Ensure quality is a valid integer + if ($quality === null) { + $quality = 100; + } + $quality = (int) round(self::keepWithin((int) $quality, 0, 100)); + + $alpha = true; + // get alpha if passed as an option + if (is_array($options) && array_key_exists('alpha', $options)) { + $alpha = boolval($options['alpha']); + } + + $interlace = null; // keep the same + // get interlace if passed as an option + if (is_array($options) && array_key_exists('interlace', $options)) { + $interlace = boolval($options['interlace']); + } + + // get raw stream from image* functions in providing no path + $file = null; + + // Capture output + ob_start(); + + // Generate the image + switch($mimeType) { + case 'image/gif': + imagesavealpha($this->image, $alpha); + imagegif($this->image, $file); + break; + case 'image/jpeg': + imageinterlace($this->image, $interlace); + imagejpeg($this->image, $file, $quality); + break; + case 'image/png': + $filters = -1; // imagepng default + // get filters if passed as an option + if (is_array($options) && array_key_exists('filters', $options)) { + $filters = intval($options['filters']); + } + // compression param is called quality in imagepng but that would be + // misleading in context of SimpleImage + $compression = -1; // defaults to zlib default which is 6 + // get compression if passed as an option + if (is_array($options) && array_key_exists('compression', $options)) { + $compression = intval($options['compression']); + } + if ($compression !== -1) { + $compression = (int) round(self::keepWithin($compression, 0, 10)); + } + imagesavealpha($this->image, $alpha); + imagepng($this->image, $file, $compression, $filters); + break; + case 'image/webp': + // Not all versions of PHP will have webp support enabled + if (! function_exists('imagewebp')) { + throw new Exception( + 'WEBP support is not enabled in your version of PHP.', + self::ERR_WEBP_NOT_ENABLED + ); + } + // useless but recommended, see https://www.php.net/manual/en/function.imagesavealpha.php + imagesavealpha($this->image, $alpha); + imagewebp($this->image, $file, $quality); + break; + case 'image/bmp': + case 'image/x-ms-bmp': + case 'image/x-windows-bmp': + // Not all versions of PHP support bmp + if (! function_exists('imagebmp')) { + throw new Exception( + 'BMP support is not available in your version of PHP.', + self::ERR_UNSUPPORTED_FORMAT + ); + } + $compression = true; // imagebmp default + // get compression if passed as an option + if (is_array($options) && array_key_exists('compression', $options)) { + $compression = is_int($options['compression']) ? + $options['compression'] > 0 : boolval($options['compression']); + } + imageinterlace($this->image, $interlace); + imagebmp($this->image, $file, $compression); + break; + case 'image/avif': + // Not all versions of PHP support avif + if (! function_exists('imageavif')) { + throw new Exception( + 'AVIF support is not available in your version of PHP.', + self::ERR_UNSUPPORTED_FORMAT + ); + } + $speed = -1; // imageavif default + // get speed if passed as an option + if (is_array($options) && array_key_exists('speed', $options)) { + $speed = intval($options['speed']); + $speed = self::keepWithin($speed, 0, 10); + } + // useless but recommended, see https://www.php.net/manual/en/function.imagesavealpha.php + imagesavealpha($this->image, $alpha); + imageavif($this->image, $file, $quality, $speed); + break; + default: + throw new Exception('Unsupported format: '.$mimeType, self::ERR_UNSUPPORTED_FORMAT); + } + + // Stop capturing + $data = ob_get_contents(); + ob_end_clean(); + + return [ + 'data' => $data, + 'mimeType' => $mimeType, + ]; + } + + /** + * Generates a data URI. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return string Returns a string containing a data URI. + * + * @throws Exception + */ + public function toDataUri(string $mimeType = null, array|int $options = 100): string + { + $image = $this->generate($mimeType, $options); + + return 'data:'.$image['mimeType'].';base64,'.base64_encode($image['data']); + } + + /** + * Forces the image to be downloaded to the clients machine. Must be called before any output is sent to the screen. + * + * @param string $filename The filename (without path) to send to the client (e.g. 'image.jpeg'). + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception + */ + public function toDownload(string $filename, string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); + + // Set download headers + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Content-Description: File Transfer'); + header('Content-Length: '.strlen($image['data'])); + header('Content-Transfer-Encoding: Binary'); + header('Content-Type: application/octet-stream'); + header("Content-Disposition: attachment; filename=\"$filename\""); + + echo $image['data']; + + return $this; + } + + /** + * Writes the image to a file. + * + * @param string $file The image format to output as a mime type (defaults to the original mime type). + * @param string|null $mimeType Image quality as a percentage (default 100). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception Thrown if failed write to file. + */ + public function toFile(string $file, string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); + + // Save the image to file + if (! file_put_contents($file, $image['data'])) { + throw new Exception("Failed to write image to file: $file", self::ERR_WRITE); + } + + return $this; + } + + /** + * Outputs the image to the screen. Must be called before any output is sent to the screen. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception + */ + public function toScreen(string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); + + // Output the image to stdout + header('Content-Type: '.$image['mimeType']); + echo $image['data']; + + return $this; + } + + /** + * Generates an image string. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * + * @throws Exception + */ + public function toString(string $mimeType = null, array|int $options = 100): string + { + return $this->generate($mimeType, $options)['data']; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Utilities + ////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Ensures a numeric value is always within the min and max range. + * + * @param int|float $value A numeric value to test. + * @param int|float $min The minimum allowed value. + * @param int|float $max The maximum allowed value. + */ + protected static function keepWithin(int|float $value, int|float $min, int|float $max): int|float + { + if ($value < $min) { + return $min; + } + if ($value > $max) { + return $max; + } + + return $value; + } + + /** + * Gets the image's current aspect ratio. + * + * @return float|int Returns the aspect ratio as a float. + */ + public function getAspectRatio(): float|int + { + return $this->getWidth() / $this->getHeight(); + } + + /** + * Gets the image's exif data. + * + * @return array|null Returns an array of exif data or null if no data is available. + */ + public function getExif(): ?array + { + // returns null if exif value is falsy: null, false or empty array. + return $this->exif ?: null; + } + + /** + * Gets the image's current height. + */ + public function getHeight(): int + { + return (int) imagesy($this->image); + } + + /** + * Gets the mime type of the loaded image. + */ + public function getMimeType(): string + { + return $this->mimeType; + } + + /** + * Gets the image's current orientation. + * + * @return string One of the values: 'landscape', 'portrait', or 'square' + */ + public function getOrientation(): string + { + $width = $this->getWidth(); + $height = $this->getHeight(); + + if ($width > $height) { + return 'landscape'; + } + if ($width < $height) { + return 'portrait'; + } + + return 'square'; + } + + /** + * Gets the resolution of the image + * + * @return array|bool The resolution as an array of integers: [96, 96] + */ + public function getResolution(): bool|array + { + return imageresolution($this->image); + } + + /** + * Gets the image's current width. + */ + public function getWidth(): int + { + return (int) imagesx($this->image); + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Manipulation + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Same as PHP's imagecopymerge, but works with transparent images. Used internally for overlay. + * + * @param GdImage $dstIm Destination image. + * @param GdImage $srcIm Source image. + * @param int $dstX x-coordinate of destination point. + * @param int $dstY y-coordinate of destination point. + * @param int $srcX x-coordinate of source point. + * @param int $srcY y-coordinate of source point. + * @param int $srcW Source width. + * @param int $srcH Source height. + * @return bool true if success. + */ + protected static function imageCopyMergeAlpha(GdImage $dstIm, GdImage $srcIm, int $dstX, int $dstY, int $srcX, int $srcY, int $srcW, int $srcH, int $pct): bool + { + // Are we merging with transparency? + if ($pct < 100) { + // Disable alpha blending and "colorize" the image using a transparent color + imagealphablending($srcIm, false); + imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, round(127 * ((100 - $pct) / 100))); + } + + imagecopy($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH); + + return true; + } + + /** + * Rotates an image so the orientation will be correct based on its exif data. It is safe to call + * this method on images that don't have exif data (no changes will be made). + * + * @return SimpleImage + * + * @throws Exception + */ + public function autoOrient(): static + { + $exif = $this->getExif(); + + if (! $exif || ! isset($exif['Orientation'])) { + return $this; + } + + switch($exif['Orientation']) { + case 1: // Do nothing! + break; + case 2: // Flip horizontally + $this->flip('x'); + break; + case 3: // Rotate 180 degrees + $this->rotate(180); + break; + case 4: // Flip vertically + $this->flip('y'); + break; + case 5: // Rotate 90 degrees clockwise and flip vertically + $this->flip('y')->rotate(90); + break; + case 6: // Rotate 90 clockwise + $this->rotate(90); + break; + case 7: // Rotate 90 clockwise and flip horizontally + $this->flip('x')->rotate(90); + break; + case 8: // Rotate 90 counterclockwise + $this->rotate(-90); + break; + } + + return $this; + } + + /** + * Proportionally resize the image to fit inside a specific width and height. + * + * @param int $maxWidth The maximum width the image can be. + * @param int $maxHeight The maximum height the image can be. + * @return SimpleImage + */ + public function bestFit(int $maxWidth, int $maxHeight): static + { + // If the image already fits, there's nothing to do + if ($this->getWidth() <= $maxWidth && $this->getHeight() <= $maxHeight) { + return $this; + } + + // Calculate max width or height based on orientation + if ($this->getOrientation() === 'portrait') { + $height = $maxHeight; + $width = (int) round($maxHeight * $this->getAspectRatio()); + } else { + $width = $maxWidth; + $height = (int) round($maxWidth / $this->getAspectRatio()); + } + + // Reduce to max width + if ($width > $maxWidth) { + $width = $maxWidth; + $height = (int) round($width / $this->getAspectRatio()); + } + + // Reduce to max height + if ($height > $maxHeight) { + $height = $maxHeight; + $width = (int) round($height * $this->getAspectRatio()); + } + + return $this->resize($width, $height); + } + + /** + * Crop the image. + * + * @param int|float $x1 Top left x coordinate. + * @param int|float $y1 Top left y coordinate. + * @param int|float $x2 Bottom right x coordinate. + * @param int|float $y2 Bottom right x coordinate. + * @return SimpleImage + */ + public function crop(int|float $x1, int|float $y1, int|float $x2, int|float $y2): static + { + // Keep crop within image dimensions + $x1 = self::keepWithin($x1, 0, $this->getWidth()); + $x2 = self::keepWithin($x2, 0, $this->getWidth()); + $y1 = self::keepWithin($y1, 0, $this->getHeight()); + $y2 = self::keepWithin($y2, 0, $this->getHeight()); + + // Avoid using native imagecrop() because of a bug with PNG transparency + $dstW = abs($x2 - $x1); + $dstH = abs($y2 - $y1); + $newImage = imagecreatetruecolor((int) $dstW, (int) $dstH); + $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); + imagecolortransparent($newImage, $transparentColor ?: null); + imagefill($newImage, 0, 0, $transparentColor); + + // Crop it + imagecopyresampled( + $newImage, + $this->image, + 0, + 0, + (int) round(min($x1, $x2)), + (int) round(min($y1, $y2)), + (int) $dstW, + (int) $dstH, + (int) $dstW, + (int) $dstH + ); + + // Swap out the new image + $this->image = $newImage; + + return $this; + } + + /** + * Applies a duotone filter to the image. + * + * @param string|array $lightColor The lightest color in the duotone. + * @param string|array $darkColor The darkest color in the duotone. + * @return SimpleImage + * + * @throws Exception + */ + public function duotone(string|array $lightColor, string|array $darkColor): static + { + $lightColor = self::normalizeColor($lightColor); + $darkColor = self::normalizeColor($darkColor); + + // Calculate averages between light and dark colors + $redAvg = $lightColor['red'] - $darkColor['red']; + $greenAvg = $lightColor['green'] - $darkColor['green']; + $blueAvg = $lightColor['blue'] - $darkColor['blue']; + + // Create a matrix of all possible duotone colors based on gray values + $pixels = []; + for ($i = 0; $i <= 255; $i++) { + $grayAvg = $i / 255; + $pixels['red'][$i] = $darkColor['red'] + $grayAvg * $redAvg; + $pixels['green'][$i] = $darkColor['green'] + $grayAvg * $greenAvg; + $pixels['blue'][$i] = $darkColor['blue'] + $grayAvg * $blueAvg; + } + + // Apply the filter pixel by pixel + for ($x = 0; $x < $this->getWidth(); $x++) { + for ($y = 0; $y < $this->getHeight(); $y++) { + $rgb = $this->getColorAt($x, $y); + $gray = min(255, round(0.299 * $rgb['red'] + 0.114 * $rgb['blue'] + 0.587 * $rgb['green'])); + $this->dot($x, $y, [ + 'red' => $pixels['red'][$gray], + 'green' => $pixels['green'][$gray], + 'blue' => $pixels['blue'][$gray], + ]); + } + } + + return $this; + } + + /** + * Proportionally resize the image to a specific width. + * + * @param int $width The width to resize the image to. + * @return SimpleImage + * + *@deprecated + * This method was deprecated in version 3.2.2 and will be removed in version 4.0. + * Please use `resize(null, $height)` instead. + */ + public function fitToWidth(int $width): static + { + return $this->resize($width); + } + + /** + * Flip the image horizontally or vertically. + * + * @param string $direction The direction to flip: x|y|both. + * @return SimpleImage + */ + public function flip(string $direction): static + { + match ($direction) { + 'x' => imageflip($this->image, IMG_FLIP_HORIZONTAL), + 'y' => imageflip($this->image, IMG_FLIP_VERTICAL), + 'both' => imageflip($this->image, IMG_FLIP_BOTH), + default => $this, + }; + + return $this; + } + + /** + * Reduces the image to a maximum number of colors. + * + * @param int $max The maximum number of colors to use. + * @param bool $dither Whether or not to use a dithering effect (default true). + * @return SimpleImage + */ + public function maxColors(int $max, bool $dither = true): static + { + imagetruecolortopalette($this->image, $dither, max(1, $max)); + + return $this; + } + + /** + * Place an image on top of the current image. + * + * @param string|SimpleImage $overlay The image to overlay. This can be a filename, a data URI, or a SimpleImage object. + * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * @param float|int $opacity The opacity level of the overlay 0-1 (default 1). + * @param int $xOffset Horizontal offset in pixels (default 0). + * @param int $yOffset Vertical offset in pixels (default 0). + * @param bool $calculateOffsetFromEdge Calculate Offset referring to the edges of the image (default false). + * @return SimpleImage + * + * @throws Exception + */ + public function overlay(string|SimpleImage $overlay, string $anchor = 'center', float|int $opacity = 1, int $xOffset = 0, int $yOffset = 0, bool $calculateOffsetFromEdge = false): static + { + // Load overlay image + if (! ($overlay instanceof SimpleImage)) { + $overlay = new SimpleImage($overlay); + } + + // Convert opacity + $opacity = (int) round(self::keepWithin($opacity, 0, 1) * 100); + + // Get available space + $spaceX = $this->getWidth() - $overlay->getWidth(); + $spaceY = $this->getHeight() - $overlay->getHeight(); + + // Set default center + $x = (int) round(($spaceX / 2) + ($calculateOffsetFromEdge ? 0 : $xOffset)); + $y = (int) round(($spaceY / 2) + ($calculateOffsetFromEdge ? 0 : $yOffset)); + + // Determine if top|bottom + if (str_contains($anchor, 'top')) { + $y = $yOffset; + } elseif (str_contains($anchor, 'bottom')) { + $y = $spaceY + ($calculateOffsetFromEdge ? -$yOffset : $yOffset); + } + + // Determine if left|right + if (str_contains($anchor, 'left')) { + $x = $xOffset; + } elseif (str_contains($anchor, 'right')) { + $x = $spaceX + ($calculateOffsetFromEdge ? -$xOffset : $xOffset); + } + + // Perform the overlay + self::imageCopyMergeAlpha( + $this->image, + $overlay->image, + $x, $y, + 0, 0, + $overlay->getWidth(), + $overlay->getHeight(), + $opacity + ); + + return $this; + } + + /** + * Resize an image to the specified dimensions. If only one dimension is specified, the image will be resized proportionally. + * + * @param int|null $width The new image width. + * @param int|null $height The new image height. + * @return SimpleImage + */ + public function resize(int $width = null, int $height = null): static + { + // No dimensions specified + if (! $width && ! $height) { + return $this; + } + + // Resize to width + if ($width && ! $height) { + $height = (int) round($width / $this->getAspectRatio()); + } + + // Resize to height + if (! $width && $height) { + $width = (int) round($height * $this->getAspectRatio()); + } + + // If the dimensions are the same, there's no need to resize + if ($this->getWidth() === $width && $this->getHeight() === $height) { + return $this; + } + + // We can't use imagescale because it doesn't seem to preserve transparency properly. The + // workaround is to create a new truecolor image, allocate a transparent color, and copy the + // image over to it using imagecopyresampled. + $newImage = imagecreatetruecolor($width, $height); + $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); + imagecolortransparent($newImage, $transparentColor); + imagefill($newImage, 0, 0, $transparentColor); + imagecopyresampled( + $newImage, + $this->image, + 0, 0, 0, 0, + $width, + $height, + $this->getWidth(), + $this->getHeight() + ); + + // Swap out the new image + $this->image = $newImage; + + return $this; + } + + /** + * Sets an image's resolution, as per https://www.php.net/manual/en/function.imageresolution.php + * + * @param int $res_x The horizontal resolution in DPI. + * @param int|null $res_y The vertical resolution in DPI + * @return SimpleImage + */ + public function resolution(int $res_x, int $res_y = null): static + { + if (is_null($res_y)) { + imageresolution($this->image, $res_x); + } else { + imageresolution($this->image, $res_x, $res_y); + } + + return $this; + } + + /** + * Rotates the image. + * + * @param int $angle The angle of rotation (-360 - 360). + * @param string|array $backgroundColor The background color to use for the uncovered zone area after rotation (default 'transparent'). + * @return SimpleImage + * + * @throws Exception + */ + public function rotate(int $angle, string|array $backgroundColor = 'transparent'): static + { + // Rotate the image on a canvas with the desired background color + $backgroundColor = $this->allocateColor($backgroundColor); + + $this->image = imagerotate( + $this->image, + -(self::keepWithin($angle, -360, 360)), + $backgroundColor + ); + imagecolortransparent($this->image, imagecolorallocatealpha($this->image, 0, 0, 0, 127)); + + return $this; + } + + /** + * Adds text to the image. + * + * @param string $text The desired text. + * @param array $options + * An array of options. + * - fontFile* (string) - The TrueType (or compatible) font file to use. + * - size (integer) - The size of the font in pixels (default 12). + * - color (string|array) - The text color (default black). + * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * - xOffset (integer) - The horizontal offset in pixels (default 0). + * - yOffset (integer) - The vertical offset in pixels (default 0). + * - shadow (array) - Text shadow params. + * - x* (integer) - Horizontal offset in pixels. + * - y* (integer) - Vertical offset in pixels. + * - color* (string|array) - The text shadow color. + * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). + * - $baselineAlign (bool) - Align the text font with the baseline. (default true). + * @param array|null $boundary + * If passed, this variable will contain an array with coordinates that surround the text: [x1, y1, x2, y2, width, height]. + * This can be used for calculating the text's position after it gets added to the image. + * @return SimpleImage + * + * @throws Exception + */ + public function text(string $text, array $options, array &$boundary = null): static + { + // Check for freetype support + if (! function_exists('imagettftext')) { + throw new Exception( + 'Freetype support is not enabled in your version of PHP.', + self::ERR_FREETYPE_NOT_ENABLED + ); + } + + // Default options + $options = array_merge([ + 'fontFile' => null, + 'size' => 12, + 'color' => 'black', + 'anchor' => 'center', + 'xOffset' => 0, + 'yOffset' => 0, + 'shadow' => null, + 'calculateOffsetFromEdge' => false, + 'baselineAlign' => true, + ], $options); + + // Extract and normalize options + $fontFile = $options['fontFile']; + $size = ($options['size'] / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) + $color = $this->allocateColor($options['color']); + $anchor = $options['anchor']; + $xOffset = $options['xOffset']; + $yOffset = $options['yOffset']; + $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; + $baselineAlign = $options['baselineAlign']; + $angle = 0; + + // Calculate the bounding box dimensions + // + // Since imagettfbox() returns a bounding box from the text's baseline, we can end up with + // different heights for different strings of the same font size. For example, 'type' will often + // be taller than 'text' because the former has a descending letter. + // + // To compensate for this, we created a temporary bounding box to measure the maximum height + // that the font used can occupy. Based on this, we can adjust the text vertically so that it + // appears inside the box with a good consistency. + // + // See: https://github.com/claviska/SimpleImage/issues/165 + // + + $boxText = imagettfbbox($size, $angle, $fontFile, $text); + if (! $boxText) { + throw new Exception("Unable to load font file: $fontFile", self::ERR_FONT_FILE); + } + + $boxWidth = abs($boxText[4] - $boxText[0]); + $boxHeight = abs($boxText[5] - $boxText[1]); + + // Calculate Offset referring to the edges of the image. + // Just invert the value for bottom|right; + if ($calculateOffsetFromEdge) { + if (str_contains($anchor, 'bottom')) { + $yOffset *= -1; + } + if (str_contains($anchor, 'right')) { + $xOffset *= -1; + } + } + + // Align the text font with the baseline. + // I use $yOffset to inject the vertical alignment correction value. + if ($baselineAlign) { + // Create a temporary box to obtain the maximum height that this font can use. + $boxFull = imagettfbbox($size, $angle, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + // Based on the maximum height, the text is aligned. + if (str_contains($anchor, 'bottom')) { + $yOffset -= $boxFull[1]; + } elseif (str_contains($anchor, 'top')) { + $yOffset += abs($boxFull[5]) - $boxHeight; + } else { // center + $boxFullHeight = abs($boxFull[1]) + abs($boxFull[5]); + $yOffset += ($boxFullHeight / 2) - ($boxHeight / 2) - abs($boxFull[1]); + } + } else { + // Prevents fonts rendered outside the box boundary from being cut. + // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. + $yOffset -= $boxText[1]; + } + + // Prevents fonts rendered outside the box boundary from being cut. + // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. + $xOffset -= $boxText[0]; + + // Determine position + switch($anchor) { + case 'top left': + $x = $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'top right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'top': + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'bottom left': + $x = $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'bottom right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'bottom': + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'left': + $x = $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + case 'right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + default: // center + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + } + $x = (int) round($x); + $y = (int) round($y); + + // Pass the boundary back by reference + $boundary = [ + 'x1' => $x + $boxText[0], + 'y1' => $y + $boxText[1] - $boxHeight, // $y is the baseline, not the top! + 'x2' => $x + $boxWidth + $boxText[0], + 'y2' => $y + $boxText[1], + 'width' => $boxWidth, + 'height' => $boxHeight, + ]; + + // Text shadow + if (is_array($options['shadow'])) { + imagettftext( + $this->image, + $size, + $angle, + $x + $options['shadow']['x'], + $y + $options['shadow']['y'], + $this->allocateColor($options['shadow']['color']), + $fontFile, + $text + ); + } + + // Draw the text + imagettftext($this->image, $size, $angle, $x, $y, $color, $fontFile, $text); + + return $this; + } + + /** + * Adds text with a line break to the image. + * + * @param string $text The desired text. + * @param array $options + * An array of options. + * - fontFile* (string) - The TrueType (or compatible) font file to use. + * - size (integer) - The size of the font in pixels (default 12). + * - color (string|array) - The text color (default black). + * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * - xOffset (integer) - The horizontal offset in pixels (default 0). Has no effect when anchor is 'center'. + * - yOffset (integer) - The vertical offset in pixels (default 0). Has no effect when anchor is 'center'. + * - shadow (array) - Text shadow params. + * - x* (integer) - Horizontal offset in pixels. + * - y* (integer) - Vertical offset in pixels. + * - color* (string|array) - The text shadow color. + * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). + * - width (int) - Width of text box (default image width). + * - align (string) - How to align text: 'left', 'right', 'center', 'justify' (default 'left'). + * - leading (float) - Increase/decrease spacing between lines of text (default 0). + * - opacity (float) - The opacity level of the text 0-1 (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function textBox(string $text, array $options): static + { + // default width of image + $maxWidth = $this->getWidth(); + // Default options + $options = array_merge([ + 'fontFile' => null, + 'size' => 12, + 'color' => 'black', + 'anchor' => 'center', + 'xOffset' => 0, + 'yOffset' => 0, + 'shadow' => null, + 'calculateOffsetFromEdge' => false, + 'width' => $maxWidth, + 'align' => 'left', + 'leading' => 0, + 'opacity' => 1, + ], $options); + + // Extract and normalize options + $fontFile = $options['fontFile']; + $fontSize = $fontSizePx = $options['size']; + $fontSize = ($fontSize / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) + $color = $options['color']; + $anchor = $options['anchor']; + $xOffset = $options['xOffset']; + $yOffset = $options['yOffset']; + $shadow = $options['shadow']; + $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; + $maxWidth = intval($options['width']); + $leading = $options['leading']; + $leading = self::keepWithin($leading, ($fontSizePx * -1), $leading); + $opacity = $options['opacity']; + + $align = $options['align']; + if ($align == 'right') { + $align = 'top right'; + } elseif ($align == 'center') { + $align = 'top'; + } elseif ($align == 'justify') { + $align = 'justify'; + } else { + $align = 'top left'; + } + + [$lines, $isLastLine, $lastLineHeight] = self::textSeparateLines($text, $fontFile, $fontSize, $maxWidth); + + $maxHeight = (int) round(((is_countable($lines) ? count($lines) : 0) - 1) * ($fontSizePx * 1.2 + $leading) + $lastLineHeight); + + $imageText = new SimpleImage(); + $imageText->fromNew($maxWidth, $maxHeight); + + // Align left/center/right + if ($align != 'justify') { + foreach ($lines as $key => $line) { + if ($align == 'top') { + $line = trim($line); + } // If is justify = 'center' + $imageText->text($line, ['fontFile' => $fontFile, 'size' => $fontSizePx, 'color' => $color, 'anchor' => $align, 'xOffset' => 0, 'yOffset' => $key * ($fontSizePx * 1.2 + $leading), 'shadow' => $shadow, 'calculateOffsetFromEdge' => true]); + } + + // Justify + } else { + foreach ($lines as $keyLine => $line) { + // Check if there are spaces at the beginning of the sentence + $spaces = 0; + if (preg_match("/^\s+/", $line, $match)) { + // Count spaces + $spaces = strlen($match[0]); + $line = ltrim($line); + } + + // Separate words + $words = preg_split("/\s+/", $line); + // Include spaces with the first word + $words[0] = str_repeat(' ', $spaces).$words[0]; + + // Calculates the space occupied by all words + $wordsSize = []; + foreach ($words as $key => $word) { + $wordBox = imagettfbbox($fontSize, 0, $fontFile, $word); + $wordWidth = abs($wordBox[4] - $wordBox[0]); + $wordsSize[$key] = $wordWidth; + } + $wordsSizeTotal = array_sum($wordsSize); + + // Calculates the required space between words + $countWords = count($words); + $wordSpacing = 0; + if ($countWords > 1) { + $wordSpacing = ($maxWidth - $wordsSizeTotal) / ($countWords - 1); + $wordSpacing = round($wordSpacing, 3); + } + + $xOffsetJustify = 0; + foreach ($words as $key => $word) { + if ($isLastLine[$keyLine]) { + if ($key < (count($words) - 1)) { + continue; + } + $word = $line; + } + $imageText->text($word, ['fontFile' => $fontFile, 'size' => $fontSizePx, 'color' => $color, 'anchor' => 'top left', 'xOffset' => $xOffsetJustify, 'yOffset' => $keyLine * ($fontSizePx * 1.2 + $leading), 'shadow' => $shadow, 'calculateOffsetFromEdge' => true] + ); + // Calculate offset for next word + $xOffsetJustify += $wordsSize[$key] + $wordSpacing; + } + } + } + + $this->overlay($imageText, $anchor, $opacity, $xOffset, $yOffset, $calculateOffsetFromEdge); + + return $this; + } + + /** + * Receives a text and breaks into LINES. + */ + private function textSeparateLines(string $text, string $fontFile, float $fontSize, int $maxWidth): array + { + $lines = []; + $words = self::textSeparateWords($text); + $countWords = count($words) - 1; + $lines[0] = ''; + $lineKey = 0; + $isLastLine = []; + for ($i = 0; $i < $countWords; $i++) { + $word = $words[$i]; + $isLastLine[$lineKey] = false; + if ($word === PHP_EOL) { + $isLastLine[$lineKey] = true; + $lineKey++; + $lines[$lineKey] = ''; + + continue; + } + $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey].$word); + if (abs($lineBox[4] - $lineBox[0]) < $maxWidth) { + $lines[$lineKey] .= $word.' '; + } else { + $lineKey++; + $lines[$lineKey] = $word.' '; + } + } + $isLastLine[$lineKey] = true; + // Exclude space of right + $lines = array_map('rtrim', $lines); + // Calculate height of last line + $boxFull = imagettfbbox($fontSize, 0, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey]); + // Height of last line = ascender of $boxFull + descender of $lineBox + $lastLineHeight = abs($lineBox[1]) + abs($boxFull[5]); + + return [$lines, $isLastLine, $lastLineHeight]; + } + + /** + * Receives a text and breaks into WORD / SPACE / NEW LINE. + */ + private function textSeparateWords(string $text): array + { + // Normalizes line break + $text = strval(preg_replace('/(\r\n|\n|\r)/', PHP_EOL, $text)); + $text = explode(PHP_EOL, $text); + $newText = []; + foreach ($text as $line) { + $newText = array_merge($newText, explode(' ', $line), [PHP_EOL]); + } + + return $newText; + } + + /** + * Creates a thumbnail image. This function attempts to get the image as close to the provided + * dimensions as possible, then crops the remaining overflow to force the desired size. Useful + * for generating thumbnail images. + * + * @param int $width The thumbnail width. + * @param int $height The thumbnail height. + * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * @return SimpleImage + */ + public function thumbnail(int $width, int $height, string $anchor = 'center'): SimpleImage|static + { + // Determine aspect ratios + $currentRatio = $this->getHeight() / $this->getWidth(); + $targetRatio = $height / $width; + + // Fit to height/width + if ($targetRatio > $currentRatio) { + $this->resize(null, $height); + } else { + $this->resize($width); + } + + switch($anchor) { + case 'top': + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = 0; + $y2 = $height; + break; + case 'bottom': + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + case 'left': + $x1 = 0; + $x2 = $width; + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + case 'right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + case 'top left': + $x1 = 0; + $x2 = $width; + $y1 = 0; + $y2 = $height; + break; + case 'top right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = 0; + $y2 = $height; + break; + case 'bottom left': + $x1 = 0; + $x2 = $width; + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + case 'bottom right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + default: + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + } + + // Return the cropped thumbnail image + return $this->crop($x1, $y1, $x2, $y2); + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Drawing + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Draws an arc. + * + * @param int $x The x coordinate of the arc's center. + * @param int $y The y coordinate of the arc's center. + * @param int $width The width of the arc. + * @param int $height The height of the arc. + * @param int $start The start of the arc in degrees. + * @param int $end The end of the arc in degrees. + * @param string|array $color The arc color. + * @param int|string $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function arc(int $x, int $y, int $width, int $height, int $start, int $end, string|array $color, int|string $thickness = 1): static + { + // Allocate the color + $tempColor = $this->allocateColor($color); + imagesetthickness($this->image, 1); + + // Draw an arc + if ($thickness === 'filled') { + imagefilledarc($this->image, $x, $y, $width, $height, $start, $end, $tempColor, IMG_ARC_PIE); + } elseif ($thickness === 1) { + imagearc($this->image, $x, $y, $width, $height, $start, $end, $tempColor); + } else { + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); + + // Draw a large ellipse filled with $color (+$thickness pixels) + $tempColor = $tempImage->allocateColor($color); + imagefilledarc($tempImage->image, $x, $y, $width + $thickness, $height + $thickness, $start, $end, $tempColor, IMG_ARC_PIE); + + // Draw a smaller ellipse filled with red|blue (-$thickness pixels) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $tempColor = $tempImage->allocateColor($tempColor); + imagefilledarc($tempImage->image, $x, $y, $width - $thickness, $height - $thickness, $start, $end, $tempColor, IMG_ARC_PIE); + + // Replace the color of the smaller ellipse with 'transparent' + $tempImage->excludeInsideColor($x, $y, $color); + + // Apply the temp image + $this->overlay($tempImage); + } + + return $this; + } + + /** + * Draws a border around the image. + * + * @param string|array $color The border color. + * @param int $thickness The thickness of the border (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function border(string|array $color, int $thickness = 1): static + { + $x1 = -1; + $y1 = 0; + $x2 = $this->getWidth(); + $y2 = $this->getHeight() - 1; + + $color = $this->allocateColor($color); + imagesetthickness($this->image, $thickness * 2); + imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); + + return $this; + } + + /** + * Draws a single pixel dot. + * + * @param int $x The x coordinate of the dot. + * @param int $y The y coordinate of the dot. + * @param string|array $color The dot color. + * @return SimpleImage + * + * @throws Exception + */ + public function dot(int $x, int $y, string|array $color): static + { + $color = $this->allocateColor($color); + imagesetpixel($this->image, $x, $y, $color); + + return $this; + } + + /** + * Draws an ellipse. + * + * @param int $x The x coordinate of the center. + * @param int $y The y coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param string|array $color The ellipse color. + * @param int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function ellipse(int $x, int $y, int $width, int $height, string|array $color, int|array $thickness = 1): static + { + // Allocate the color + $tempColor = $this->allocateColor($color); + imagesetthickness($this->image, 1); + + // Draw an ellipse + if ($thickness == 'filled') { + imagefilledellipse($this->image, $x, $y, $width, $height, $tempColor); + } elseif ($thickness === 1) { + imageellipse($this->image, $x, $y, $width, $height, $tempColor); + } else { + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); + + // Draw a large ellipse filled with $color (+$thickness pixels) + $tempColor = $tempImage->allocateColor($color); + imagefilledellipse($tempImage->image, $x, $y, $width + $thickness, $height + $thickness, $tempColor); + + // Draw a smaller ellipse filled with red|blue (-$thickness pixels) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $tempColor = $tempImage->allocateColor($tempColor); + imagefilledellipse($tempImage->image, $x, $y, $width - $thickness, $height - $thickness, $tempColor); + + // Replace the color of the smaller ellipse with 'transparent' + $tempImage->excludeInsideColor($x, $y, $color); + + // Apply the temp image + $this->overlay($tempImage); + } + + return $this; + } + + /** + * Fills the image with a solid color. + * + * @param string|array $color The fill color. + * @return SimpleImage + * + * @throws Exception + */ + public function fill(string|array $color): static + { + // Draw a filled rectangle over the entire image + $this->rectangle(0, 0, $this->getWidth(), $this->getHeight(), 'white', 'filled'); + + // Now flood it with the appropriate color + $color = $this->allocateColor($color); + imagefill($this->image, 0, 0, $color); + + return $this; + } + + /** + * Draws a line. + * + * @param int $x1 The x coordinate for the first point. + * @param int $y1 The y coordinate for the first point. + * @param int $x2 The x coordinate for the second point. + * @param int $y2 The y coordinate for the second point. + * @param string|array $color The line color. + * @param int $thickness The line thickness (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function line(int $x1, int $y1, int $x2, int $y2, string|array $color, int $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); + + // Draw a line + imagesetthickness($this->image, $thickness); + imageline($this->image, $x1, $y1, $x2, $y2, $color); + + return $this; + } + + /** + * Draws a polygon. + * + * @param array $vertices + * The polygon's vertices in an array of x/y arrays. + * Example: + * [ + * ['x' => x1, 'y' => y1], + * ['x' => x2, 'y' => y2], + * ['x' => xN, 'y' => yN] + * ] + * @param string|array $color The polygon color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function polygon(array $vertices, string|array $color, string|int|array $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); + + // Convert [['x' => x1, 'y' => x1], ['x' => x1, 'y' => y2], ...] to [x1, y1, x2, y2, ...] + $points = []; + foreach ($vertices as $vals) { + $points[] = $vals['x']; + $points[] = $vals['y']; + } + + // Draw a polygon + if ($thickness == 'filled') { + imagesetthickness($this->image, 1); + imagefilledpolygon($this->image, $points, count($vertices), $color); + } else { + imagesetthickness($this->image, $thickness); + imagepolygon($this->image, $points, count($vertices), $color); + } + + return $this; + } + + /** + * Draws a rectangle. + * + * @param int $x1 The upper left x coordinate. + * @param int $y1 The upper left y coordinate. + * @param int $x2 The bottom right x coordinate. + * @param int $y2 The bottom right y coordinate. + * @param string|array $color The rectangle color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function rectangle(int $x1, int $y1, int $x2, int $y2, string|array $color, string|int|array $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); + + // Draw a rectangle + if ($thickness == 'filled') { + imagesetthickness($this->image, 1); + imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); + } else { + imagesetthickness($this->image, $thickness); + imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); + } + + return $this; + } + + /** + * Draws a rounded rectangle. + * + * @param int $x1 The upper left x coordinate. + * @param int $y1 The upper left y coordinate. + * @param int $x2 The bottom right x coordinate. + * @param int $y2 The bottom right y coordinate. + * @param int $radius The border radius in pixels. + * @param string|array $color The rectangle color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function roundedRectangle(int $x1, int $y1, int $x2, int $y2, int $radius, string|array $color, string|int|array $thickness = 1): static + { + if ($thickness == 'filled') { + // Draw the filled rectangle without edges + $this->rectangle($x1 + $radius + 1, $y1, $x2 - $radius - 1, $y2, $color, 'filled'); + $this->rectangle($x1, $y1 + $radius + 1, $x1 + $radius, $y2 - $radius - 1, $color, 'filled'); + $this->rectangle($x2 - $radius, $y1 + $radius + 1, $x2, $y2 - $radius - 1, $color, 'filled'); + + // Fill in the edges with arcs + $this->arc($x1 + $radius, $y1 + $radius, $radius * 2, $radius * 2, 180, 270, $color, 'filled'); + $this->arc($x2 - $radius, $y1 + $radius, $radius * 2, $radius * 2, 270, 360, $color, 'filled'); + $this->arc($x1 + $radius, $y2 - $radius, $radius * 2, $radius * 2, 90, 180, $color, 'filled'); + $this->arc($x2 - $radius, $y2 - $radius, $radius * 2, $radius * 2, 360, 90, $color, 'filled'); + } else { + $offset = $thickness / 2; + $x1 -= $offset; + $x2 += $offset; + $y1 -= $offset; + $y2 += $offset; + $radius = self::keepWithin($radius, 0, min(($x2 - $x1) / 2, ($y2 - $y1) / 2) - 1); + $radius = (int) floor($radius); + $thickness = self::keepWithin($thickness, 1, min(($x2 - $x1) / 2, ($y2 - $y1) / 2)); + + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); + + // Draw a large rectangle filled with $color + $tempImage->roundedRectangle($x1, $y1, $x2, $y2, $radius, $color, 'filled'); + + // Draw a smaller rectangle filled with red|blue (-$thickness pixels on each side) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $radius = $radius - $thickness; + $radius = self::keepWithin($radius, 0, $radius); + $tempImage->roundedRectangle( + $x1 + $thickness, + $y1 + $thickness, + $x2 - $thickness, + $y2 - $thickness, + $radius, + $tempColor, + 'filled' + ); + + // Replace the color of the smaller rectangle with 'transparent' + $tempImage->excludeInsideColor(($x2 + $x1) / 2, ($y2 + $y1) / 2, $color); + + // Apply the temp image + $this->overlay($tempImage); + } + + return $this; + } + + /** + * Exclude inside color. + * Used for roundedRectangle(), ellipse() and arc() + * + * @param int $x certer x of rectangle. + * @param int $y certer y of rectangle. + * @param string|array $borderColor The color of border. + * + * @throws Exception + */ + private function excludeInsideColor(int $x, int $y, string|array $borderColor): static + { + $borderColor = $this->allocateColor($borderColor); + $transparent = $this->allocateColor('transparent'); + imagefilltoborder($this->image, $x, $y, $borderColor, $transparent); + + return $this; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Filters + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Applies the blur filter. + * + * @param string $type The blur algorithm to use: 'selective', 'gaussian' (default 'gaussian'). + * @param int $passes The number of time to apply the filter, enhancing the effect (default 1). + * @return SimpleImage + */ + public function blur(string $type = 'selective', int $passes = 1): static + { + $filter = $type === 'gaussian' ? IMG_FILTER_GAUSSIAN_BLUR : IMG_FILTER_SELECTIVE_BLUR; + + for ($i = 0; $i < $passes; $i++) { + imagefilter($this->image, $filter); + } + + return $this; + } + + /** + * Applies the brightness filter to brighten the image. + * + * @param int $percentage Percentage to brighten the image (0 - 100). + * @return SimpleImage + */ + public function brighten(int $percentage): static + { + $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); + + imagefilter($this->image, IMG_FILTER_BRIGHTNESS, $percentage); + + return $this; + } + + /** + * Applies the colorize filter. + * + * @param string|array $color The filter color. + * @return SimpleImage + * + * @throws Exception + */ + public function colorize(string|array $color): static + { + $color = self::normalizeColor($color); + + imagefilter( + $this->image, + IMG_FILTER_COLORIZE, + $color['red'], + $color['green'], + $color['blue'], + 127 - ($color['alpha'] * 127) + ); + + return $this; + } + + /** + * Applies the contrast filter. + * + * @param int $percentage Percentage to adjust (-100 - 100). + * @return SimpleImage + */ + public function contrast(int $percentage): static + { + imagefilter($this->image, IMG_FILTER_CONTRAST, self::keepWithin($percentage, -100, 100)); + + return $this; + } + + /** + * Applies the brightness filter to darken the image. + * + * @param int $percentage Percentage to darken the image (0 - 100). + * @return SimpleImage + */ + public function darken(int $percentage): static + { + $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); + + imagefilter($this->image, IMG_FILTER_BRIGHTNESS, -$percentage); + + return $this; + } + + /** + * Applies the desaturate (grayscale) filter. + * + * @return SimpleImage + */ + public function desaturate(): static + { + imagefilter($this->image, IMG_FILTER_GRAYSCALE); + + return $this; + } + + /** + * Applies the edge detect filter. + * + * @return SimpleImage + */ + public function edgeDetect(): static + { + imagefilter($this->image, IMG_FILTER_EDGEDETECT); + + return $this; + } + + /** + * Applies the emboss filter. + * + * @return SimpleImage + */ + public function emboss(): static + { + imagefilter($this->image, IMG_FILTER_EMBOSS); + + return $this; + } + + /** + * Inverts the image's colors. + * + * @return SimpleImage + */ + public function invert(): static + { + imagefilter($this->image, IMG_FILTER_NEGATE); + + return $this; + } + + /** + * Changes the image's opacity level. + * + * @param float $opacity The desired opacity level (0 - 1). + * @return SimpleImage + * + * @throws Exception + */ + public function opacity(float $opacity): static + { + // Create a transparent image + $newImage = new SimpleImage(); + $newImage->fromNew($this->getWidth(), $this->getHeight()); + + // Copy the current image (with opacity) onto the transparent image + self::imageCopyMergeAlpha( + $newImage->image, + $this->image, + 0, 0, + 0, 0, + $this->getWidth(), + $this->getHeight(), + (int) round(self::keepWithin($opacity, 0, 1) * 100) + ); + + return $this; + } + + /** + * Applies the pixelate filter. + * + * @param int $size The size of the blocks in pixels (default 10). + * @return SimpleImage + */ + public function pixelate(int $size = 10): static + { + imagefilter($this->image, IMG_FILTER_PIXELATE, $size, true); + + return $this; + } + + /** + * Simulates a sepia effect by desaturating the image and applying a sepia tone. + * + * @return SimpleImage + */ + public function sepia(): static + { + imagefilter($this->image, IMG_FILTER_GRAYSCALE); + imagefilter($this->image, IMG_FILTER_COLORIZE, 70, 35, 0); + + return $this; + } + + /** + * Sharpens the image. + * + * @param int $amount Sharpening amount (default 50). + * @return SimpleImage + */ + public function sharpen(int $amount = 50): static + { + // Normalize amount + $amount = max(1, min(100, $amount)) / 100; + + $sharpen = [ + [-1, -1, -1], + [-1, 8 / $amount, -1], + [-1, -1, -1], + ]; + $divisor = array_sum(array_map('array_sum', $sharpen)); + + imageconvolution($this->image, $sharpen, $divisor, 0); + + return $this; + } + + /** + * Applies the mean remove filter to produce a sketch effect. + * + * @return SimpleImage + */ + public function sketch(): static + { + imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL); + + return $this; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Color utilities + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Converts a "friendly color" into a color identifier for use with GD's image functions. + * + * @param string|array $color The color to allocate. + * + * @throws Exception + */ + protected function allocateColor(string|array $color): int + { + $color = self::normalizeColor($color); + + // Was this color already allocated? + $index = imagecolorexactalpha( + $this->image, + $color['red'], + $color['green'], + $color['blue'], + (int) (127 - ($color['alpha'] * 127)) + ); + if ($index > -1) { + // Yes, return this color index + return $index; + } + + // Allocate a new color index + return imagecolorallocatealpha( + $this->image, + $color['red'], + $color['green'], + $color['blue'], + 127 - ($color['alpha'] * 127) + ); + } + + /** + * Adjusts a color by increasing/decreasing red/green/blue/alpha values independently. + * + * @param string|array $color The color to adjust. + * @param int $red Red adjustment (-255 - 255). + * @param int $green Green adjustment (-255 - 255). + * @param int $blue Blue adjustment (-255 - 255). + * @param int $alpha Alpha adjustment (-1 - 1). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function adjustColor(string|array $color, int $red, int $green, int $blue, int $alpha): array + { + // Normalize to RGBA + $color = self::normalizeColor($color); + + // Adjust each channel + return self::normalizeColor([ + 'red' => $color['red'] + $red, + 'green' => $color['green'] + $green, + 'blue' => $color['blue'] + $blue, + 'alpha' => $color['alpha'] + $alpha, + ]); + } + + /** + * Darkens a color. + * + * @param string|array $color The color to darken. + * @param int $amount Amount to darken (0 - 255). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function darkenColor(string|array $color, int $amount): array + { + return self::adjustColor($color, -$amount, -$amount, -$amount, 0); + } + + /** + * Extracts colors from an image like a human would do.™ This method requires the third-party + * library \League\ColorExtractor. If you're using Composer, it will be installed for you + * automatically. + * + * @param int $count The max number of colors to extract (default 5). + * @param string|array|null $backgroundColor + * By default any pixel with alpha value greater than zero will + * be discarded. This is because transparent colors are not perceived as is. For example, fully + * transparent black would be seen white on a white background. So if you want to take + * transparency into account, you have to specify a default background color. + * @return int[] An array of RGBA colors arrays. + * + * @throws Exception Thrown if library \League\ColorExtractor is missing. + */ + public function extractColors(int $count = 5, string|array $backgroundColor = null): array + { + // Check for required library + if (! class_exists('\\'.ColorExtractor::class)) { + throw new Exception( + 'Required library \League\ColorExtractor is missing.', + self::ERR_LIB_NOT_LOADED + ); + } + + // Convert background color to an integer value + if ($backgroundColor) { + $backgroundColor = self::normalizeColor($backgroundColor); + $backgroundColor = Color::fromRgbToInt([ + 'r' => $backgroundColor['red'], + 'g' => $backgroundColor['green'], + 'b' => $backgroundColor['blue'], + ]); + } + + // Extract colors from the image + $palette = Palette::fromGD($this->image, $backgroundColor); + $extractor = new ColorExtractor($palette); + $colors = $extractor->extract($count); + + // Convert colors to an RGBA color array + foreach ($colors as $key => $value) { + $colors[$key] = self::normalizeColor(Color::fromIntToHex($value)); + } + + return $colors; + } + + /** + * Gets the RGBA value of a single pixel. + * + * @param int $x The horizontal position of the pixel. + * @param int $y The vertical position of the pixel. + * @return bool|int[] An RGBA color array or false if the x/y position is off the canvas. + */ + public function getColorAt(int $x, int $y): array|bool + { + // Coordinates must be on the canvas + if ($x < 0 || $x > $this->getWidth() || $y < 0 || $y > $this->getHeight()) { + return false; + } + + // Get the color of this pixel and convert it to RGBA + $color = imagecolorat($this->image, $x, $y); + $rgba = imagecolorsforindex($this->image, $color); + $rgba['alpha'] = 127 - ($color >> 24) & 0xFF; + + return $rgba; + } + + /** + * Lightens a color. + * + * @param string|array $color The color to lighten. + * @param int $amount Amount to lighten (0 - 255). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function lightenColor(string|array $color, int $amount): array + { + return self::adjustColor($color, $amount, $amount, $amount, 0); + } + + /** + * Normalizes a hex or array color value to a well-formatted RGBA array. + * + * @param string|array $color + * A CSS color name, hex string, or an array [red, green, blue, alpha]. + * You can pipe alpha transparency through hex strings and color names. For example: + * #fff|0.50 <-- 50% white + * red|0.25 <-- 25% red + * @return array [red, green, blue, alpha]. + * + * @throws Exception Thrown if color value is invalid. + */ + public static function normalizeColor(string|array $color): array + { + // 140 CSS color names and hex values + $cssColors = [ + 'aliceblue' => '#f0f8ff', 'antiquewhite' => '#faebd7', 'aqua' => '#00ffff', + 'aquamarine' => '#7fffd4', 'azure' => '#f0ffff', 'beige' => '#f5f5dc', 'bisque' => '#ffe4c4', + 'black' => '#000000', 'blanchedalmond' => '#ffebcd', 'blue' => '#0000ff', + 'blueviolet' => '#8a2be2', 'brown' => '#a52a2a', 'burlywood' => '#deb887', + 'cadetblue' => '#5f9ea0', 'chartreuse' => '#7fff00', 'chocolate' => '#d2691e', + 'coral' => '#ff7f50', 'cornflowerblue' => '#6495ed', 'cornsilk' => '#fff8dc', + 'crimson' => '#dc143c', 'cyan' => '#00ffff', 'darkblue' => '#00008b', 'darkcyan' => '#008b8b', + 'darkgoldenrod' => '#b8860b', 'darkgray' => '#a9a9a9', 'darkgrey' => '#a9a9a9', + 'darkgreen' => '#006400', 'darkkhaki' => '#bdb76b', 'darkmagenta' => '#8b008b', + 'darkolivegreen' => '#556b2f', 'darkorange' => '#ff8c00', 'darkorchid' => '#9932cc', + 'darkred' => '#8b0000', 'darksalmon' => '#e9967a', 'darkseagreen' => '#8fbc8f', + 'darkslateblue' => '#483d8b', 'darkslategray' => '#2f4f4f', 'darkslategrey' => '#2f4f4f', + 'darkturquoise' => '#00ced1', 'darkviolet' => '#9400d3', 'deeppink' => '#ff1493', + 'deepskyblue' => '#00bfff', 'dimgray' => '#696969', 'dimgrey' => '#696969', + 'dodgerblue' => '#1e90ff', 'firebrick' => '#b22222', 'floralwhite' => '#fffaf0', + 'forestgreen' => '#228b22', 'fuchsia' => '#ff00ff', 'gainsboro' => '#dcdcdc', + 'ghostwhite' => '#f8f8ff', 'gold' => '#ffd700', 'goldenrod' => '#daa520', 'gray' => '#808080', + 'grey' => '#808080', 'green' => '#008000', 'greenyellow' => '#adff2f', + 'honeydew' => '#f0fff0', 'hotpink' => '#ff69b4', 'indianred ' => '#cd5c5c', + 'indigo ' => '#4b0082', 'ivory' => '#fffff0', 'khaki' => '#f0e68c', 'lavender' => '#e6e6fa', + 'lavenderblush' => '#fff0f5', 'lawngreen' => '#7cfc00', 'lemonchiffon' => '#fffacd', + 'lightblue' => '#add8e6', 'lightcoral' => '#f08080', 'lightcyan' => '#e0ffff', + 'lightgoldenrodyellow' => '#fafad2', 'lightgray' => '#d3d3d3', 'lightgrey' => '#d3d3d3', + 'lightgreen' => '#90ee90', 'lightpink' => '#ffb6c1', 'lightsalmon' => '#ffa07a', + 'lightseagreen' => '#20b2aa', 'lightskyblue' => '#87cefa', 'lightslategray' => '#778899', + 'lightslategrey' => '#778899', 'lightsteelblue' => '#b0c4de', 'lightyellow' => '#ffffe0', + 'lime' => '#00ff00', 'limegreen' => '#32cd32', 'linen' => '#faf0e6', 'magenta' => '#ff00ff', + 'maroon' => '#800000', 'mediumaquamarine' => '#66cdaa', 'mediumblue' => '#0000cd', + 'mediumorchid' => '#ba55d3', 'mediumpurple' => '#9370db', 'mediumseagreen' => '#3cb371', + 'mediumslateblue' => '#7b68ee', 'mediumspringgreen' => '#00fa9a', + 'mediumturquoise' => '#48d1cc', 'mediumvioletred' => '#c71585', 'midnightblue' => '#191970', + 'mintcream' => '#f5fffa', 'mistyrose' => '#ffe4e1', 'moccasin' => '#ffe4b5', + 'navajowhite' => '#ffdead', 'navy' => '#000080', 'oldlace' => '#fdf5e6', 'olive' => '#808000', + 'olivedrab' => '#6b8e23', 'orange' => '#ffa500', 'orangered' => '#ff4500', + 'orchid' => '#da70d6', 'palegoldenrod' => '#eee8aa', 'palegreen' => '#98fb98', + 'paleturquoise' => '#afeeee', 'palevioletred' => '#db7093', 'papayawhip' => '#ffefd5', + 'peachpuff' => '#ffdab9', 'peru' => '#cd853f', 'pink' => '#ffc0cb', 'plum' => '#dda0dd', + 'powderblue' => '#b0e0e6', 'purple' => '#800080', 'rebeccapurple' => '#663399', + 'red' => '#ff0000', 'rosybrown' => '#bc8f8f', 'royalblue' => '#4169e1', + 'saddlebrown' => '#8b4513', 'salmon' => '#fa8072', 'sandybrown' => '#f4a460', + 'seagreen' => '#2e8b57', 'seashell' => '#fff5ee', 'sienna' => '#a0522d', + 'silver' => '#c0c0c0', 'skyblue' => '#87ceeb', 'slateblue' => '#6a5acd', + 'slategray' => '#708090', 'slategrey' => '#708090', 'snow' => '#fffafa', + 'springgreen' => '#00ff7f', 'steelblue' => '#4682b4', 'tan' => '#d2b48c', 'teal' => '#008080', + 'thistle' => '#d8bfd8', 'tomato' => '#ff6347', 'turquoise' => '#40e0d0', + 'violet' => '#ee82ee', 'wheat' => '#f5deb3', 'white' => '#ffffff', 'whitesmoke' => '#f5f5f5', + 'yellow' => '#ffff00', 'yellowgreen' => '#9acd32', + ]; + + // Parse alpha from '#fff|.5' and 'white|.5' + if (is_string($color) && strstr($color, '|')) { + $color = explode('|', $color); + $alpha = (float) $color[1]; + $color = trim($color[0]); + } else { + $alpha = 1; + } + + // Translate CSS color names to hex values + if (is_string($color) && array_key_exists(strtolower($color), $cssColors)) { + $color = $cssColors[strtolower($color)]; + } + + // Translate transparent keyword to a transparent color + if ($color === 'transparent') { + $color = ['red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0]; + } + + // Convert hex values to RGBA + if (is_string($color)) { + // Remove # + $hex = strval(preg_replace('/^#/', '', $color)); + + // Support short and standard hex codes + if (strlen($hex) === 3) { + [$red, $green, $blue] = [ + $hex[0].$hex[0], + $hex[1].$hex[1], + $hex[2].$hex[2], + ]; + } elseif (strlen($hex) === 6) { + [$red, $green, $blue] = [ + $hex[0].$hex[1], + $hex[2].$hex[3], + $hex[4].$hex[5], + ]; + } else { + throw new Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); + } + + // Turn color into an array + $color = [ + 'red' => hexdec($red), + 'green' => hexdec($green), + 'blue' => hexdec($blue), + 'alpha' => $alpha, + ]; + } + + // Enforce color value ranges + if (is_array($color)) { + // RGB default to 0 + $color['red'] ??= 0; + $color['green'] ??= 0; + $color['blue'] ??= 0; + + // Alpha defaults to 1 + $color['alpha'] ??= 1; + + return [ + 'red' => (int) self::keepWithin((int) $color['red'], 0, 255), + 'green' => (int) self::keepWithin((int) $color['green'], 0, 255), + 'blue' => (int) self::keepWithin((int) $color['blue'], 0, 255), + 'alpha' => self::keepWithin($color['alpha'], 0, 1), + ]; + } + + throw new Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); + } +} diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 0000000..469e540 --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,18 @@ + $vendorDir . '/symfony/deprecation-contracts/function.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + 'f864ae44e8154e5ff6f4eec32f46d37f' => $baseDir . '/kirby/config/setup.php', + '87988fc7b1c1f093da22a1a3de972f3a' => $baseDir . '/kirby/config/helpers.php', + 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', +); diff --git a/vendor/composer/semver/phpstan-baseline.neon b/vendor/composer/semver/phpstan-baseline.neon new file mode 100644 index 0000000..933cf20 --- /dev/null +++ b/vendor/composer/semver/phpstan-baseline.neon @@ -0,0 +1,11 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#1 \\$operator of class Composer\\\\Semver\\\\Constraint\\\\Constraint constructor expects '\\!\\='\\|'\\<'\\|'\\<\\='\\|'\\<\\>'\\|'\\='\\|'\\=\\='\\|'\\>'\\|'\\>\\=', non\\-falsy\\-string given\\.$#" + count: 1 + path: src/VersionParser.php + + - + message: "#^Strict comparison using \\=\\=\\= between null and non\\-empty\\-string will always evaluate to false\\.$#" + count: 2 + path: src/VersionParser.php diff --git a/vendor/composer/semver/src/Comparator.php b/vendor/composer/semver/src/Comparator.php new file mode 100644 index 0000000..38f483a --- /dev/null +++ b/vendor/composer/semver/src/Comparator.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\Constraint; + +class Comparator +{ + /** + * Evaluates the expression: $version1 > $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function greaterThan($version1, $version2) + { + return self::compare($version1, '>', $version2); + } + + /** + * Evaluates the expression: $version1 >= $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function greaterThanOrEqualTo($version1, $version2) + { + return self::compare($version1, '>=', $version2); + } + + /** + * Evaluates the expression: $version1 < $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function lessThan($version1, $version2) + { + return self::compare($version1, '<', $version2); + } + + /** + * Evaluates the expression: $version1 <= $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function lessThanOrEqualTo($version1, $version2) + { + return self::compare($version1, '<=', $version2); + } + + /** + * Evaluates the expression: $version1 == $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function equalTo($version1, $version2) + { + return self::compare($version1, '==', $version2); + } + + /** + * Evaluates the expression: $version1 != $version2. + * + * @param string $version1 + * @param string $version2 + * + * @return bool + */ + public static function notEqualTo($version1, $version2) + { + return self::compare($version1, '!=', $version2); + } + + /** + * Evaluates the expression: $version1 $operator $version2. + * + * @param string $version1 + * @param string $operator + * @param string $version2 + * + * @return bool + * + * @phpstan-param Constraint::STR_OP_* $operator + */ + public static function compare($version1, $operator, $version2) + { + $constraint = new Constraint($operator, $version2); + + return $constraint->matchSpecific(new Constraint('==', $version1), true); + } +} diff --git a/vendor/composer/semver/src/CompilingMatcher.php b/vendor/composer/semver/src/CompilingMatcher.php new file mode 100644 index 0000000..45bce70 --- /dev/null +++ b/vendor/composer/semver/src/CompilingMatcher.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; + +/** + * Helper class to evaluate constraint by compiling and reusing the code to evaluate + */ +class CompilingMatcher +{ + /** + * @var array + * @phpstan-var array + */ + private static $compiledCheckerCache = array(); + /** + * @var array + * @phpstan-var array + */ + private static $resultCache = array(); + + /** @var bool */ + private static $enabled; + + /** + * @phpstan-var array + */ + private static $transOpInt = array( + Constraint::OP_EQ => Constraint::STR_OP_EQ, + Constraint::OP_LT => Constraint::STR_OP_LT, + Constraint::OP_LE => Constraint::STR_OP_LE, + Constraint::OP_GT => Constraint::STR_OP_GT, + Constraint::OP_GE => Constraint::STR_OP_GE, + Constraint::OP_NE => Constraint::STR_OP_NE, + ); + + /** + * Clears the memoization cache once you are done + * + * @return void + */ + public static function clear() + { + self::$resultCache = array(); + self::$compiledCheckerCache = array(); + } + + /** + * Evaluates the expression: $constraint match $operator $version + * + * @param ConstraintInterface $constraint + * @param int $operator + * @phpstan-param Constraint::OP_* $operator + * @param string $version + * + * @return mixed + */ + public static function match(ConstraintInterface $constraint, $operator, $version) + { + $resultCacheKey = $operator.$constraint.';'.$version; + + if (isset(self::$resultCache[$resultCacheKey])) { + return self::$resultCache[$resultCacheKey]; + } + + if (self::$enabled === null) { + self::$enabled = !\in_array('eval', explode(',', (string) ini_get('disable_functions')), true); + } + if (!self::$enabled) { + return self::$resultCache[$resultCacheKey] = $constraint->matches(new Constraint(self::$transOpInt[$operator], $version)); + } + + $cacheKey = $operator.$constraint; + if (!isset(self::$compiledCheckerCache[$cacheKey])) { + $code = $constraint->compile($operator); + self::$compiledCheckerCache[$cacheKey] = $function = eval('return function($v, $b){return '.$code.';};'); + } else { + $function = self::$compiledCheckerCache[$cacheKey]; + } + + return self::$resultCache[$resultCacheKey] = $function($version, strpos($version, 'dev-') === 0); + } +} diff --git a/vendor/composer/semver/src/Constraint/Bound.php b/vendor/composer/semver/src/Constraint/Bound.php new file mode 100644 index 0000000..7effb11 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/Bound.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +class Bound +{ + /** + * @var string + */ + private $version; + + /** + * @var bool + */ + private $isInclusive; + + /** + * @param string $version + * @param bool $isInclusive + */ + public function __construct($version, $isInclusive) + { + $this->version = $version; + $this->isInclusive = $isInclusive; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return bool + */ + public function isInclusive() + { + return $this->isInclusive; + } + + /** + * @return bool + */ + public function isZero() + { + return $this->getVersion() === '0.0.0.0-dev' && $this->isInclusive(); + } + + /** + * @return bool + */ + public function isPositiveInfinity() + { + return $this->getVersion() === PHP_INT_MAX.'.0.0.0' && !$this->isInclusive(); + } + + /** + * Compares a bound to another with a given operator. + * + * @param Bound $other + * @param string $operator + * + * @return bool + */ + public function compareTo(Bound $other, $operator) + { + if (!\in_array($operator, array('<', '>'), true)) { + throw new \InvalidArgumentException('Does not support any other operator other than > or <.'); + } + + // If they are the same it doesn't matter + if ($this == $other) { + return false; + } + + $compareResult = version_compare($this->getVersion(), $other->getVersion()); + + // Not the same version means we don't need to check if the bounds are inclusive or not + if (0 !== $compareResult) { + return (('>' === $operator) ? 1 : -1) === $compareResult; + } + + // Question we're answering here is "am I higher than $other?" + return '>' === $operator ? $other->isInclusive() : !$other->isInclusive(); + } + + public function __toString() + { + return sprintf( + '%s [%s]', + $this->getVersion(), + $this->isInclusive() ? 'inclusive' : 'exclusive' + ); + } + + /** + * @return self + */ + public static function zero() + { + return new Bound('0.0.0.0-dev', true); + } + + /** + * @return self + */ + public static function positiveInfinity() + { + return new Bound(PHP_INT_MAX.'.0.0.0', false); + } +} diff --git a/vendor/composer/semver/src/Constraint/Constraint.php b/vendor/composer/semver/src/Constraint/Constraint.php new file mode 100644 index 0000000..dc39482 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/Constraint.php @@ -0,0 +1,435 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +/** + * Defines a constraint. + */ +class Constraint implements ConstraintInterface +{ + /* operator integer values */ + const OP_EQ = 0; + const OP_LT = 1; + const OP_LE = 2; + const OP_GT = 3; + const OP_GE = 4; + const OP_NE = 5; + + /* operator string values */ + const STR_OP_EQ = '=='; + const STR_OP_EQ_ALT = '='; + const STR_OP_LT = '<'; + const STR_OP_LE = '<='; + const STR_OP_GT = '>'; + const STR_OP_GE = '>='; + const STR_OP_NE = '!='; + const STR_OP_NE_ALT = '<>'; + + /** + * Operator to integer translation table. + * + * @var array + * @phpstan-var array + */ + private static $transOpStr = array( + '=' => self::OP_EQ, + '==' => self::OP_EQ, + '<' => self::OP_LT, + '<=' => self::OP_LE, + '>' => self::OP_GT, + '>=' => self::OP_GE, + '<>' => self::OP_NE, + '!=' => self::OP_NE, + ); + + /** + * Integer to operator translation table. + * + * @var array + * @phpstan-var array + */ + private static $transOpInt = array( + self::OP_EQ => '==', + self::OP_LT => '<', + self::OP_LE => '<=', + self::OP_GT => '>', + self::OP_GE => '>=', + self::OP_NE => '!=', + ); + + /** + * @var int + * @phpstan-var self::OP_* + */ + protected $operator; + + /** @var string */ + protected $version; + + /** @var string|null */ + protected $prettyString; + + /** @var Bound */ + protected $lowerBound; + + /** @var Bound */ + protected $upperBound; + + /** + * Sets operator and version to compare with. + * + * @param string $operator + * @param string $version + * + * @throws \InvalidArgumentException if invalid operator is given. + * + * @phpstan-param self::STR_OP_* $operator + */ + public function __construct($operator, $version) + { + if (!isset(self::$transOpStr[$operator])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid operator "%s" given, expected one of: %s', + $operator, + implode(', ', self::getSupportedOperators()) + )); + } + + $this->operator = self::$transOpStr[$operator]; + $this->version = $version; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + * + * @phpstan-return self::STR_OP_* + */ + public function getOperator() + { + return self::$transOpInt[$this->operator]; + } + + /** + * @param ConstraintInterface $provider + * + * @return bool + */ + public function matches(ConstraintInterface $provider) + { + if ($provider instanceof self) { + return $this->matchSpecific($provider); + } + + // turn matching around to find a match + return $provider->matches($this); + } + + /** + * {@inheritDoc} + */ + public function setPrettyString($prettyString) + { + $this->prettyString = $prettyString; + } + + /** + * {@inheritDoc} + */ + public function getPrettyString() + { + if ($this->prettyString) { + return $this->prettyString; + } + + return $this->__toString(); + } + + /** + * Get all supported comparison operators. + * + * @return array + * + * @phpstan-return list + */ + public static function getSupportedOperators() + { + return array_keys(self::$transOpStr); + } + + /** + * @param string $operator + * @return int + * + * @phpstan-param self::STR_OP_* $operator + * @phpstan-return self::OP_* + */ + public static function getOperatorConstant($operator) + { + return self::$transOpStr[$operator]; + } + + /** + * @param string $a + * @param string $b + * @param string $operator + * @param bool $compareBranches + * + * @throws \InvalidArgumentException if invalid operator is given. + * + * @return bool + * + * @phpstan-param self::STR_OP_* $operator + */ + public function versionCompare($a, $b, $operator, $compareBranches = false) + { + if (!isset(self::$transOpStr[$operator])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid operator "%s" given, expected one of: %s', + $operator, + implode(', ', self::getSupportedOperators()) + )); + } + + $aIsBranch = strpos($a, 'dev-') === 0; + $bIsBranch = strpos($b, 'dev-') === 0; + + if ($operator === '!=' && ($aIsBranch || $bIsBranch)) { + return $a !== $b; + } + + if ($aIsBranch && $bIsBranch) { + return $operator === '==' && $a === $b; + } + + // when branches are not comparable, we make sure dev branches never match anything + if (!$compareBranches && ($aIsBranch || $bIsBranch)) { + return false; + } + + return \version_compare($a, $b, $operator); + } + + /** + * {@inheritDoc} + */ + public function compile($otherOperator) + { + if (strpos($this->version, 'dev-') === 0) { + if (self::OP_EQ === $this->operator) { + if (self::OP_EQ === $otherOperator) { + return sprintf('$b && $v === %s', \var_export($this->version, true)); + } + if (self::OP_NE === $otherOperator) { + return sprintf('!$b || $v !== %s', \var_export($this->version, true)); + } + return 'false'; + } + + if (self::OP_NE === $this->operator) { + if (self::OP_EQ === $otherOperator) { + return sprintf('!$b || $v !== %s', \var_export($this->version, true)); + } + if (self::OP_NE === $otherOperator) { + return 'true'; + } + return '!$b'; + } + + return 'false'; + } + + if (self::OP_EQ === $this->operator) { + if (self::OP_EQ === $otherOperator) { + return sprintf('\version_compare($v, %s, \'==\')', \var_export($this->version, true)); + } + if (self::OP_NE === $otherOperator) { + return sprintf('$b || \version_compare($v, %s, \'!=\')', \var_export($this->version, true)); + } + + return sprintf('!$b && \version_compare(%s, $v, \'%s\')', \var_export($this->version, true), self::$transOpInt[$otherOperator]); + } + + if (self::OP_NE === $this->operator) { + if (self::OP_EQ === $otherOperator) { + return sprintf('$b || (!$b && \version_compare($v, %s, \'!=\'))', \var_export($this->version, true)); + } + + if (self::OP_NE === $otherOperator) { + return 'true'; + } + return '!$b'; + } + + if (self::OP_LT === $this->operator || self::OP_LE === $this->operator) { + if (self::OP_LT === $otherOperator || self::OP_LE === $otherOperator) { + return '!$b'; + } + } else { // $this->operator must be self::OP_GT || self::OP_GE here + if (self::OP_GT === $otherOperator || self::OP_GE === $otherOperator) { + return '!$b'; + } + } + + if (self::OP_NE === $otherOperator) { + return 'true'; + } + + $codeComparison = sprintf('\version_compare($v, %s, \'%s\')', \var_export($this->version, true), self::$transOpInt[$this->operator]); + if ($this->operator === self::OP_LE) { + if ($otherOperator === self::OP_GT) { + return sprintf('!$b && \version_compare($v, %s, \'!=\') && ', \var_export($this->version, true)) . $codeComparison; + } + } elseif ($this->operator === self::OP_GE) { + if ($otherOperator === self::OP_LT) { + return sprintf('!$b && \version_compare($v, %s, \'!=\') && ', \var_export($this->version, true)) . $codeComparison; + } + } + + return sprintf('!$b && %s', $codeComparison); + } + + /** + * @param Constraint $provider + * @param bool $compareBranches + * + * @return bool + */ + public function matchSpecific(Constraint $provider, $compareBranches = false) + { + $noEqualOp = str_replace('=', '', self::$transOpInt[$this->operator]); + $providerNoEqualOp = str_replace('=', '', self::$transOpInt[$provider->operator]); + + $isEqualOp = self::OP_EQ === $this->operator; + $isNonEqualOp = self::OP_NE === $this->operator; + $isProviderEqualOp = self::OP_EQ === $provider->operator; + $isProviderNonEqualOp = self::OP_NE === $provider->operator; + + // '!=' operator is match when other operator is not '==' operator or version is not match + // these kinds of comparisons always have a solution + if ($isNonEqualOp || $isProviderNonEqualOp) { + if ($isNonEqualOp && !$isProviderNonEqualOp && !$isProviderEqualOp && strpos($provider->version, 'dev-') === 0) { + return false; + } + + if ($isProviderNonEqualOp && !$isNonEqualOp && !$isEqualOp && strpos($this->version, 'dev-') === 0) { + return false; + } + + if (!$isEqualOp && !$isProviderEqualOp) { + return true; + } + return $this->versionCompare($provider->version, $this->version, '!=', $compareBranches); + } + + // an example for the condition is <= 2.0 & < 1.0 + // these kinds of comparisons always have a solution + if ($this->operator !== self::OP_EQ && $noEqualOp === $providerNoEqualOp) { + return !(strpos($this->version, 'dev-') === 0 || strpos($provider->version, 'dev-') === 0); + } + + $version1 = $isEqualOp ? $this->version : $provider->version; + $version2 = $isEqualOp ? $provider->version : $this->version; + $operator = $isEqualOp ? $provider->operator : $this->operator; + + if ($this->versionCompare($version1, $version2, self::$transOpInt[$operator], $compareBranches)) { + // special case, e.g. require >= 1.0 and provide < 1.0 + // 1.0 >= 1.0 but 1.0 is outside of the provided interval + + return !(self::$transOpInt[$provider->operator] === $providerNoEqualOp + && self::$transOpInt[$this->operator] !== $noEqualOp + && \version_compare($provider->version, $this->version, '==')); + } + + return false; + } + + /** + * @return string + */ + public function __toString() + { + return self::$transOpInt[$this->operator] . ' ' . $this->version; + } + + /** + * {@inheritDoc} + */ + public function getLowerBound() + { + $this->extractBounds(); + + return $this->lowerBound; + } + + /** + * {@inheritDoc} + */ + public function getUpperBound() + { + $this->extractBounds(); + + return $this->upperBound; + } + + /** + * @return void + */ + private function extractBounds() + { + if (null !== $this->lowerBound) { + return; + } + + // Branches + if (strpos($this->version, 'dev-') === 0) { + $this->lowerBound = Bound::zero(); + $this->upperBound = Bound::positiveInfinity(); + + return; + } + + switch ($this->operator) { + case self::OP_EQ: + $this->lowerBound = new Bound($this->version, true); + $this->upperBound = new Bound($this->version, true); + break; + case self::OP_LT: + $this->lowerBound = Bound::zero(); + $this->upperBound = new Bound($this->version, false); + break; + case self::OP_LE: + $this->lowerBound = Bound::zero(); + $this->upperBound = new Bound($this->version, true); + break; + case self::OP_GT: + $this->lowerBound = new Bound($this->version, false); + $this->upperBound = Bound::positiveInfinity(); + break; + case self::OP_GE: + $this->lowerBound = new Bound($this->version, true); + $this->upperBound = Bound::positiveInfinity(); + break; + case self::OP_NE: + $this->lowerBound = Bound::zero(); + $this->upperBound = Bound::positiveInfinity(); + break; + } + } +} diff --git a/vendor/composer/semver/src/Constraint/ConstraintInterface.php b/vendor/composer/semver/src/Constraint/ConstraintInterface.php new file mode 100644 index 0000000..389b935 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/ConstraintInterface.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +/** + * DO NOT IMPLEMENT this interface. It is only meant for usage as a type hint + * in libraries relying on composer/semver but creating your own constraint class + * that implements this interface is not a supported use case and will cause the + * composer/semver components to return unexpected results. + */ +interface ConstraintInterface +{ + /** + * Checks whether the given constraint intersects in any way with this constraint + * + * @param ConstraintInterface $provider + * + * @return bool + */ + public function matches(ConstraintInterface $provider); + + /** + * Provides a compiled version of the constraint for the given operator + * The compiled version must be a PHP expression. + * Executor of compile version must provide 2 variables: + * - $v = the string version to compare with + * - $b = whether or not the version is a non-comparable branch (starts with "dev-") + * + * @see Constraint::OP_* for the list of available operators. + * @example return '!$b && version_compare($v, '1.0', '>')'; + * + * @param int $otherOperator one Constraint::OP_* + * + * @return string + * + * @phpstan-param Constraint::OP_* $otherOperator + */ + public function compile($otherOperator); + + /** + * @return Bound + */ + public function getUpperBound(); + + /** + * @return Bound + */ + public function getLowerBound(); + + /** + * @return string + */ + public function getPrettyString(); + + /** + * @param string|null $prettyString + * + * @return void + */ + public function setPrettyString($prettyString); + + /** + * @return string + */ + public function __toString(); +} diff --git a/vendor/composer/semver/src/Constraint/MatchAllConstraint.php b/vendor/composer/semver/src/Constraint/MatchAllConstraint.php new file mode 100644 index 0000000..5e51af9 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/MatchAllConstraint.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +/** + * Defines the absence of a constraint. + * + * This constraint matches everything. + */ +class MatchAllConstraint implements ConstraintInterface +{ + /** @var string|null */ + protected $prettyString; + + /** + * @param ConstraintInterface $provider + * + * @return bool + */ + public function matches(ConstraintInterface $provider) + { + return true; + } + + /** + * {@inheritDoc} + */ + public function compile($otherOperator) + { + return 'true'; + } + + /** + * {@inheritDoc} + */ + public function setPrettyString($prettyString) + { + $this->prettyString = $prettyString; + } + + /** + * {@inheritDoc} + */ + public function getPrettyString() + { + if ($this->prettyString) { + return $this->prettyString; + } + + return (string) $this; + } + + /** + * {@inheritDoc} + */ + public function __toString() + { + return '*'; + } + + /** + * {@inheritDoc} + */ + public function getUpperBound() + { + return Bound::positiveInfinity(); + } + + /** + * {@inheritDoc} + */ + public function getLowerBound() + { + return Bound::zero(); + } +} diff --git a/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php b/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php new file mode 100644 index 0000000..dadcf62 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/MatchNoneConstraint.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +/** + * Blackhole of constraints, nothing escapes it + */ +class MatchNoneConstraint implements ConstraintInterface +{ + /** @var string|null */ + protected $prettyString; + + /** + * @param ConstraintInterface $provider + * + * @return bool + */ + public function matches(ConstraintInterface $provider) + { + return false; + } + + /** + * {@inheritDoc} + */ + public function compile($otherOperator) + { + return 'false'; + } + + /** + * {@inheritDoc} + */ + public function setPrettyString($prettyString) + { + $this->prettyString = $prettyString; + } + + /** + * {@inheritDoc} + */ + public function getPrettyString() + { + if ($this->prettyString) { + return $this->prettyString; + } + + return (string) $this; + } + + /** + * {@inheritDoc} + */ + public function __toString() + { + return '[]'; + } + + /** + * {@inheritDoc} + */ + public function getUpperBound() + { + return new Bound('0.0.0.0-dev', false); + } + + /** + * {@inheritDoc} + */ + public function getLowerBound() + { + return new Bound('0.0.0.0-dev', false); + } +} diff --git a/vendor/composer/semver/src/Constraint/MultiConstraint.php b/vendor/composer/semver/src/Constraint/MultiConstraint.php new file mode 100644 index 0000000..1f4c006 --- /dev/null +++ b/vendor/composer/semver/src/Constraint/MultiConstraint.php @@ -0,0 +1,325 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver\Constraint; + +/** + * Defines a conjunctive or disjunctive set of constraints. + */ +class MultiConstraint implements ConstraintInterface +{ + /** + * @var ConstraintInterface[] + * @phpstan-var non-empty-array + */ + protected $constraints; + + /** @var string|null */ + protected $prettyString; + + /** @var string|null */ + protected $string; + + /** @var bool */ + protected $conjunctive; + + /** @var Bound|null */ + protected $lowerBound; + + /** @var Bound|null */ + protected $upperBound; + + /** + * @param ConstraintInterface[] $constraints A set of constraints + * @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive + * + * @throws \InvalidArgumentException If less than 2 constraints are passed + */ + public function __construct(array $constraints, $conjunctive = true) + { + if (\count($constraints) < 2) { + throw new \InvalidArgumentException( + 'Must provide at least two constraints for a MultiConstraint. Use '. + 'the regular Constraint class for one constraint only or MatchAllConstraint for none. You may use '. + 'MultiConstraint::create() which optimizes and handles those cases automatically.' + ); + } + + $this->constraints = $constraints; + $this->conjunctive = $conjunctive; + } + + /** + * @return ConstraintInterface[] + */ + public function getConstraints() + { + return $this->constraints; + } + + /** + * @return bool + */ + public function isConjunctive() + { + return $this->conjunctive; + } + + /** + * @return bool + */ + public function isDisjunctive() + { + return !$this->conjunctive; + } + + /** + * {@inheritDoc} + */ + public function compile($otherOperator) + { + $parts = array(); + foreach ($this->constraints as $constraint) { + $code = $constraint->compile($otherOperator); + if ($code === 'true') { + if (!$this->conjunctive) { + return 'true'; + } + } elseif ($code === 'false') { + if ($this->conjunctive) { + return 'false'; + } + } else { + $parts[] = '('.$code.')'; + } + } + + if (!$parts) { + return $this->conjunctive ? 'true' : 'false'; + } + + return $this->conjunctive ? implode('&&', $parts) : implode('||', $parts); + } + + /** + * @param ConstraintInterface $provider + * + * @return bool + */ + public function matches(ConstraintInterface $provider) + { + if (false === $this->conjunctive) { + foreach ($this->constraints as $constraint) { + if ($provider->matches($constraint)) { + return true; + } + } + + return false; + } + + // when matching a conjunctive and a disjunctive multi constraint we have to iterate over the disjunctive one + // otherwise we'd return true if different parts of the disjunctive constraint match the conjunctive one + // which would lead to incorrect results, e.g. [>1 and <2] would match [<1 or >2] although they do not intersect + if ($provider instanceof MultiConstraint && $provider->isDisjunctive()) { + return $provider->matches($this); + } + + foreach ($this->constraints as $constraint) { + if (!$provider->matches($constraint)) { + return false; + } + } + + return true; + } + + /** + * {@inheritDoc} + */ + public function setPrettyString($prettyString) + { + $this->prettyString = $prettyString; + } + + /** + * {@inheritDoc} + */ + public function getPrettyString() + { + if ($this->prettyString) { + return $this->prettyString; + } + + return (string) $this; + } + + /** + * {@inheritDoc} + */ + public function __toString() + { + if ($this->string !== null) { + return $this->string; + } + + $constraints = array(); + foreach ($this->constraints as $constraint) { + $constraints[] = (string) $constraint; + } + + return $this->string = '[' . implode($this->conjunctive ? ' ' : ' || ', $constraints) . ']'; + } + + /** + * {@inheritDoc} + */ + public function getLowerBound() + { + $this->extractBounds(); + + if (null === $this->lowerBound) { + throw new \LogicException('extractBounds should have populated the lowerBound property'); + } + + return $this->lowerBound; + } + + /** + * {@inheritDoc} + */ + public function getUpperBound() + { + $this->extractBounds(); + + if (null === $this->upperBound) { + throw new \LogicException('extractBounds should have populated the upperBound property'); + } + + return $this->upperBound; + } + + /** + * Tries to optimize the constraints as much as possible, meaning + * reducing/collapsing congruent constraints etc. + * Does not necessarily return a MultiConstraint instance if + * things can be reduced to a simple constraint + * + * @param ConstraintInterface[] $constraints A set of constraints + * @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive + * + * @return ConstraintInterface + */ + public static function create(array $constraints, $conjunctive = true) + { + if (0 === \count($constraints)) { + return new MatchAllConstraint(); + } + + if (1 === \count($constraints)) { + return $constraints[0]; + } + + $optimized = self::optimizeConstraints($constraints, $conjunctive); + if ($optimized !== null) { + list($constraints, $conjunctive) = $optimized; + if (\count($constraints) === 1) { + return $constraints[0]; + } + } + + return new self($constraints, $conjunctive); + } + + /** + * @param ConstraintInterface[] $constraints + * @param bool $conjunctive + * @return ?array + * + * @phpstan-return array{0: list, 1: bool}|null + */ + private static function optimizeConstraints(array $constraints, $conjunctive) + { + // parse the two OR groups and if they are contiguous we collapse + // them into one constraint + // [>= 1 < 2] || [>= 2 < 3] || [>= 3 < 4] => [>= 1 < 4] + if (!$conjunctive) { + $left = $constraints[0]; + $mergedConstraints = array(); + $optimized = false; + for ($i = 1, $l = \count($constraints); $i < $l; $i++) { + $right = $constraints[$i]; + if ( + $left instanceof self + && $left->conjunctive + && $right instanceof self + && $right->conjunctive + && \count($left->constraints) === 2 + && \count($right->constraints) === 2 + && ($left0 = (string) $left->constraints[0]) + && $left0[0] === '>' && $left0[1] === '=' + && ($left1 = (string) $left->constraints[1]) + && $left1[0] === '<' + && ($right0 = (string) $right->constraints[0]) + && $right0[0] === '>' && $right0[1] === '=' + && ($right1 = (string) $right->constraints[1]) + && $right1[0] === '<' + && substr($left1, 2) === substr($right0, 3) + ) { + $optimized = true; + $left = new MultiConstraint( + array( + $left->constraints[0], + $right->constraints[1], + ), + true); + } else { + $mergedConstraints[] = $left; + $left = $right; + } + } + if ($optimized) { + $mergedConstraints[] = $left; + return array($mergedConstraints, false); + } + } + + // TODO: Here's the place to put more optimizations + + return null; + } + + /** + * @return void + */ + private function extractBounds() + { + if (null !== $this->lowerBound) { + return; + } + + foreach ($this->constraints as $constraint) { + if (null === $this->lowerBound || null === $this->upperBound) { + $this->lowerBound = $constraint->getLowerBound(); + $this->upperBound = $constraint->getUpperBound(); + continue; + } + + if ($constraint->getLowerBound()->compareTo($this->lowerBound, $this->isConjunctive() ? '>' : '<')) { + $this->lowerBound = $constraint->getLowerBound(); + } + + if ($constraint->getUpperBound()->compareTo($this->upperBound, $this->isConjunctive() ? '<' : '>')) { + $this->upperBound = $constraint->getUpperBound(); + } + } + } +} diff --git a/vendor/composer/semver/src/Interval.php b/vendor/composer/semver/src/Interval.php new file mode 100644 index 0000000..43d5a4f --- /dev/null +++ b/vendor/composer/semver/src/Interval.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\Constraint; + +class Interval +{ + /** @var Constraint */ + private $start; + /** @var Constraint */ + private $end; + + public function __construct(Constraint $start, Constraint $end) + { + $this->start = $start; + $this->end = $end; + } + + /** + * @return Constraint + */ + public function getStart() + { + return $this->start; + } + + /** + * @return Constraint + */ + public function getEnd() + { + return $this->end; + } + + /** + * @return Constraint + */ + public static function fromZero() + { + static $zero; + + if (null === $zero) { + $zero = new Constraint('>=', '0.0.0.0-dev'); + } + + return $zero; + } + + /** + * @return Constraint + */ + public static function untilPositiveInfinity() + { + static $positiveInfinity; + + if (null === $positiveInfinity) { + $positiveInfinity = new Constraint('<', PHP_INT_MAX.'.0.0.0'); + } + + return $positiveInfinity; + } + + /** + * @return self + */ + public static function any() + { + return new self(self::fromZero(), self::untilPositiveInfinity()); + } + + /** + * @return array{'names': string[], 'exclude': bool} + */ + public static function anyDev() + { + // any == exclude nothing + return array('names' => array(), 'exclude' => true); + } + + /** + * @return array{'names': string[], 'exclude': bool} + */ + public static function noDev() + { + // nothing == no names included + return array('names' => array(), 'exclude' => false); + } +} diff --git a/vendor/composer/semver/src/Intervals.php b/vendor/composer/semver/src/Intervals.php new file mode 100644 index 0000000..d889d0a --- /dev/null +++ b/vendor/composer/semver/src/Intervals.php @@ -0,0 +1,478 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; +use Composer\Semver\Constraint\MatchAllConstraint; +use Composer\Semver\Constraint\MatchNoneConstraint; +use Composer\Semver\Constraint\MultiConstraint; + +/** + * Helper class generating intervals from constraints + * + * This contains utilities for: + * + * - compacting an existing constraint which can be used to combine several into one + * by creating a MultiConstraint out of the many constraints you have. + * + * - checking whether one subset is a subset of another. + * + * Note: You should call clear to free memoization memory usage when you are done using this class + */ +class Intervals +{ + /** + * @phpstan-var array + */ + private static $intervalsCache = array(); + + /** + * @phpstan-var array + */ + private static $opSortOrder = array( + '>=' => -3, + '<' => -2, + '>' => 2, + '<=' => 3, + ); + + /** + * Clears the memoization cache once you are done + * + * @return void + */ + public static function clear() + { + self::$intervalsCache = array(); + } + + /** + * Checks whether $candidate is a subset of $constraint + * + * @return bool + */ + public static function isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint) + { + if ($constraint instanceof MatchAllConstraint) { + return true; + } + + if ($candidate instanceof MatchNoneConstraint || $constraint instanceof MatchNoneConstraint) { + return false; + } + + $intersectionIntervals = self::get(new MultiConstraint(array($candidate, $constraint), true)); + $candidateIntervals = self::get($candidate); + if (\count($intersectionIntervals['numeric']) !== \count($candidateIntervals['numeric'])) { + return false; + } + + foreach ($intersectionIntervals['numeric'] as $index => $interval) { + if (!isset($candidateIntervals['numeric'][$index])) { + return false; + } + + if ((string) $candidateIntervals['numeric'][$index]->getStart() !== (string) $interval->getStart()) { + return false; + } + + if ((string) $candidateIntervals['numeric'][$index]->getEnd() !== (string) $interval->getEnd()) { + return false; + } + } + + if ($intersectionIntervals['branches']['exclude'] !== $candidateIntervals['branches']['exclude']) { + return false; + } + if (\count($intersectionIntervals['branches']['names']) !== \count($candidateIntervals['branches']['names'])) { + return false; + } + foreach ($intersectionIntervals['branches']['names'] as $index => $name) { + if ($name !== $candidateIntervals['branches']['names'][$index]) { + return false; + } + } + + return true; + } + + /** + * Checks whether $a and $b have any intersection, equivalent to $a->matches($b) + * + * @return bool + */ + public static function haveIntersections(ConstraintInterface $a, ConstraintInterface $b) + { + if ($a instanceof MatchAllConstraint || $b instanceof MatchAllConstraint) { + return true; + } + + if ($a instanceof MatchNoneConstraint || $b instanceof MatchNoneConstraint) { + return false; + } + + $intersectionIntervals = self::generateIntervals(new MultiConstraint(array($a, $b), true), true); + + return \count($intersectionIntervals['numeric']) > 0 || $intersectionIntervals['branches']['exclude'] || \count($intersectionIntervals['branches']['names']) > 0; + } + + /** + * Attempts to optimize a MultiConstraint + * + * When merging MultiConstraints together they can get very large, this will + * compact it by looking at the real intervals covered by all the constraints + * and then creates a new constraint containing only the smallest amount of rules + * to match the same intervals. + * + * @return ConstraintInterface + */ + public static function compactConstraint(ConstraintInterface $constraint) + { + if (!$constraint instanceof MultiConstraint) { + return $constraint; + } + + $intervals = self::generateIntervals($constraint); + $constraints = array(); + $hasNumericMatchAll = false; + + if (\count($intervals['numeric']) === 1 && (string) $intervals['numeric'][0]->getStart() === (string) Interval::fromZero() && (string) $intervals['numeric'][0]->getEnd() === (string) Interval::untilPositiveInfinity()) { + $constraints[] = $intervals['numeric'][0]->getStart(); + $hasNumericMatchAll = true; + } else { + $unEqualConstraints = array(); + for ($i = 0, $count = \count($intervals['numeric']); $i < $count; $i++) { + $interval = $intervals['numeric'][$i]; + + // if current interval ends with < N and next interval begins with > N we can swap this out for != N + // but this needs to happen as a conjunctive expression together with the start of the current interval + // and end of next interval, so [>=M, N, [>=M, !=N, getEnd()->getOperator() === '<' && $i+1 < $count) { + $nextInterval = $intervals['numeric'][$i+1]; + if ($interval->getEnd()->getVersion() === $nextInterval->getStart()->getVersion() && $nextInterval->getStart()->getOperator() === '>') { + // only add a start if we didn't already do so, can be skipped if we're looking at second + // interval in [>=M, N, P, =M, !=N] already and we only want to add !=P right now + if (\count($unEqualConstraints) === 0 && (string) $interval->getStart() !== (string) Interval::fromZero()) { + $unEqualConstraints[] = $interval->getStart(); + } + $unEqualConstraints[] = new Constraint('!=', $interval->getEnd()->getVersion()); + continue; + } + } + + if (\count($unEqualConstraints) > 0) { + // this is where the end of the following interval of a != constraint is added as explained above + if ((string) $interval->getEnd() !== (string) Interval::untilPositiveInfinity()) { + $unEqualConstraints[] = $interval->getEnd(); + } + + // count is 1 if entire constraint is just one != expression + if (\count($unEqualConstraints) > 1) { + $constraints[] = new MultiConstraint($unEqualConstraints, true); + } else { + $constraints[] = $unEqualConstraints[0]; + } + + $unEqualConstraints = array(); + continue; + } + + // convert back >= x - <= x intervals to == x + if ($interval->getStart()->getVersion() === $interval->getEnd()->getVersion() && $interval->getStart()->getOperator() === '>=' && $interval->getEnd()->getOperator() === '<=') { + $constraints[] = new Constraint('==', $interval->getStart()->getVersion()); + continue; + } + + if ((string) $interval->getStart() === (string) Interval::fromZero()) { + $constraints[] = $interval->getEnd(); + } elseif ((string) $interval->getEnd() === (string) Interval::untilPositiveInfinity()) { + $constraints[] = $interval->getStart(); + } else { + $constraints[] = new MultiConstraint(array($interval->getStart(), $interval->getEnd()), true); + } + } + } + + $devConstraints = array(); + + if (0 === \count($intervals['branches']['names'])) { + if ($intervals['branches']['exclude']) { + if ($hasNumericMatchAll) { + return new MatchAllConstraint; + } + // otherwise constraint should contain a != operator and already cover this + } + } else { + foreach ($intervals['branches']['names'] as $branchName) { + if ($intervals['branches']['exclude']) { + $devConstraints[] = new Constraint('!=', $branchName); + } else { + $devConstraints[] = new Constraint('==', $branchName); + } + } + + // excluded branches, e.g. != dev-foo are conjunctive with the interval, so + // > 2.0 != dev-foo must return a conjunctive constraint + if ($intervals['branches']['exclude']) { + if (\count($constraints) > 1) { + return new MultiConstraint(array_merge( + array(new MultiConstraint($constraints, false)), + $devConstraints + ), true); + } + + if (\count($constraints) === 1 && (string)$constraints[0] === (string)Interval::fromZero()) { + if (\count($devConstraints) > 1) { + return new MultiConstraint($devConstraints, true); + } + return $devConstraints[0]; + } + + return new MultiConstraint(array_merge($constraints, $devConstraints), true); + } + + // otherwise devConstraints contains a list of == operators for branches which are disjunctive with the + // rest of the constraint + $constraints = array_merge($constraints, $devConstraints); + } + + if (\count($constraints) > 1) { + return new MultiConstraint($constraints, false); + } + + if (\count($constraints) === 1) { + return $constraints[0]; + } + + return new MatchNoneConstraint; + } + + /** + * Creates an array of numeric intervals and branch constraints representing a given constraint + * + * if the returned numeric array is empty it means the constraint matches nothing in the numeric range (0 - +inf) + * if the returned branches array is empty it means no dev-* versions are matched + * if a constraint matches all possible dev-* versions, branches will contain Interval::anyDev() + * + * @return array + * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} + */ + public static function get(ConstraintInterface $constraint) + { + $key = (string) $constraint; + + if (!isset(self::$intervalsCache[$key])) { + self::$intervalsCache[$key] = self::generateIntervals($constraint); + } + + return self::$intervalsCache[$key]; + } + + /** + * @param bool $stopOnFirstValidInterval + * + * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} + */ + private static function generateIntervals(ConstraintInterface $constraint, $stopOnFirstValidInterval = false) + { + if ($constraint instanceof MatchAllConstraint) { + return array('numeric' => array(new Interval(Interval::fromZero(), Interval::untilPositiveInfinity())), 'branches' => Interval::anyDev()); + } + + if ($constraint instanceof MatchNoneConstraint) { + return array('numeric' => array(), 'branches' => array('names' => array(), 'exclude' => false)); + } + + if ($constraint instanceof Constraint) { + return self::generateSingleConstraintIntervals($constraint); + } + + if (!$constraint instanceof MultiConstraint) { + throw new \UnexpectedValueException('The constraint passed in should be an MatchAllConstraint, Constraint or MultiConstraint instance, got '.\get_class($constraint).'.'); + } + + $constraints = $constraint->getConstraints(); + + $numericGroups = array(); + $constraintBranches = array(); + foreach ($constraints as $c) { + $res = self::get($c); + $numericGroups[] = $res['numeric']; + $constraintBranches[] = $res['branches']; + } + + if ($constraint->isDisjunctive()) { + $branches = Interval::noDev(); + foreach ($constraintBranches as $b) { + if ($b['exclude']) { + if ($branches['exclude']) { + // disjunctive constraint, so only exclude what's excluded in all constraints + // !=a,!=b || !=b,!=c => !=b + $branches['names'] = array_intersect($branches['names'], $b['names']); + } else { + // disjunctive constraint so exclude all names which are not explicitly included in the alternative + // (==b || ==c) || !=a,!=b => !=a + $branches['exclude'] = true; + $branches['names'] = array_diff($b['names'], $branches['names']); + } + } else { + if ($branches['exclude']) { + // disjunctive constraint so exclude all names which are not explicitly included in the alternative + // !=a,!=b || (==b || ==c) => !=a + $branches['names'] = array_diff($branches['names'], $b['names']); + } else { + // disjunctive constraint, so just add all the other branches + // (==a || ==b) || ==c => ==a || ==b || ==c + $branches['names'] = array_merge($branches['names'], $b['names']); + } + } + } + } else { + $branches = Interval::anyDev(); + foreach ($constraintBranches as $b) { + if ($b['exclude']) { + if ($branches['exclude']) { + // conjunctive, so just add all branch names to be excluded + // !=a && !=b => !=a,!=b + $branches['names'] = array_merge($branches['names'], $b['names']); + } else { + // conjunctive, so only keep included names which are not excluded + // (==a||==c) && !=a,!=b => ==c + $branches['names'] = array_diff($branches['names'], $b['names']); + } + } else { + if ($branches['exclude']) { + // conjunctive, so only keep included names which are not excluded + // !=a,!=b && (==a||==c) => ==c + $branches['names'] = array_diff($b['names'], $branches['names']); + $branches['exclude'] = false; + } else { + // conjunctive, so only keep names that are included in both + // (==a||==b) && (==a||==c) => ==a + $branches['names'] = array_intersect($branches['names'], $b['names']); + } + } + } + } + + $branches['names'] = array_unique($branches['names']); + + if (\count($numericGroups) === 1) { + return array('numeric' => $numericGroups[0], 'branches' => $branches); + } + + $borders = array(); + foreach ($numericGroups as $group) { + foreach ($group as $interval) { + $borders[] = array('version' => $interval->getStart()->getVersion(), 'operator' => $interval->getStart()->getOperator(), 'side' => 'start'); + $borders[] = array('version' => $interval->getEnd()->getVersion(), 'operator' => $interval->getEnd()->getOperator(), 'side' => 'end'); + } + } + + $opSortOrder = self::$opSortOrder; + usort($borders, function ($a, $b) use ($opSortOrder) { + $order = version_compare($a['version'], $b['version']); + if ($order === 0) { + return $opSortOrder[$a['operator']] - $opSortOrder[$b['operator']]; + } + + return $order; + }); + + $activeIntervals = 0; + $intervals = array(); + $index = 0; + $activationThreshold = $constraint->isConjunctive() ? \count($numericGroups) : 1; + $start = null; + foreach ($borders as $border) { + if ($border['side'] === 'start') { + $activeIntervals++; + } else { + $activeIntervals--; + } + if (!$start && $activeIntervals >= $activationThreshold) { + $start = new Constraint($border['operator'], $border['version']); + } elseif ($start && $activeIntervals < $activationThreshold) { + // filter out invalid intervals like > x - <= x, or >= x - < x + if ( + version_compare($start->getVersion(), $border['version'], '=') + && ( + ($start->getOperator() === '>' && $border['operator'] === '<=') + || ($start->getOperator() === '>=' && $border['operator'] === '<') + ) + ) { + unset($intervals[$index]); + } else { + $intervals[$index] = new Interval($start, new Constraint($border['operator'], $border['version'])); + $index++; + + if ($stopOnFirstValidInterval) { + break; + } + } + + $start = null; + } + } + + return array('numeric' => $intervals, 'branches' => $branches); + } + + /** + * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}} + */ + private static function generateSingleConstraintIntervals(Constraint $constraint) + { + $op = $constraint->getOperator(); + + // handle branch constraints first + if (strpos($constraint->getVersion(), 'dev-') === 0) { + $intervals = array(); + $branches = array('names' => array(), 'exclude' => false); + + // != dev-foo means any numeric version may match, we treat >/< like != they are not really defined for branches + if ($op === '!=') { + $intervals[] = new Interval(Interval::fromZero(), Interval::untilPositiveInfinity()); + $branches = array('names' => array($constraint->getVersion()), 'exclude' => true); + } elseif ($op === '==') { + $branches['names'][] = $constraint->getVersion(); + } + + return array( + 'numeric' => $intervals, + 'branches' => $branches, + ); + } + + if ($op[0] === '>') { // > & >= + return array('numeric' => array(new Interval($constraint, Interval::untilPositiveInfinity())), 'branches' => Interval::noDev()); + } + if ($op[0] === '<') { // < & <= + return array('numeric' => array(new Interval(Interval::fromZero(), $constraint)), 'branches' => Interval::noDev()); + } + if ($op === '!=') { + // convert !=x to intervals of 0 - x - +inf + dev* + return array('numeric' => array( + new Interval(Interval::fromZero(), new Constraint('<', $constraint->getVersion())), + new Interval(new Constraint('>', $constraint->getVersion()), Interval::untilPositiveInfinity()), + ), 'branches' => Interval::anyDev()); + } + + // convert ==x to an interval of >=x - <=x + return array('numeric' => array( + new Interval(new Constraint('>=', $constraint->getVersion()), new Constraint('<=', $constraint->getVersion())), + ), 'branches' => Interval::noDev()); + } +} diff --git a/vendor/composer/semver/src/Semver.php b/vendor/composer/semver/src/Semver.php new file mode 100644 index 0000000..4d6de3c --- /dev/null +++ b/vendor/composer/semver/src/Semver.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\Constraint; + +class Semver +{ + const SORT_ASC = 1; + const SORT_DESC = -1; + + /** @var VersionParser */ + private static $versionParser; + + /** + * Determine if given version satisfies given constraints. + * + * @param string $version + * @param string $constraints + * + * @return bool + */ + public static function satisfies($version, $constraints) + { + if (null === self::$versionParser) { + self::$versionParser = new VersionParser(); + } + + $versionParser = self::$versionParser; + $provider = new Constraint('==', $versionParser->normalize($version)); + $parsedConstraints = $versionParser->parseConstraints($constraints); + + return $parsedConstraints->matches($provider); + } + + /** + * Return all versions that satisfy given constraints. + * + * @param string[] $versions + * @param string $constraints + * + * @return string[] + */ + public static function satisfiedBy(array $versions, $constraints) + { + $versions = array_filter($versions, function ($version) use ($constraints) { + return Semver::satisfies($version, $constraints); + }); + + return array_values($versions); + } + + /** + * Sort given array of versions. + * + * @param string[] $versions + * + * @return string[] + */ + public static function sort(array $versions) + { + return self::usort($versions, self::SORT_ASC); + } + + /** + * Sort given array of versions in reverse. + * + * @param string[] $versions + * + * @return string[] + */ + public static function rsort(array $versions) + { + return self::usort($versions, self::SORT_DESC); + } + + /** + * @param string[] $versions + * @param int $direction + * + * @return string[] + */ + private static function usort(array $versions, $direction) + { + if (null === self::$versionParser) { + self::$versionParser = new VersionParser(); + } + + $versionParser = self::$versionParser; + $normalized = array(); + + // Normalize outside of usort() scope for minor performance increase. + // Creates an array of arrays: [[normalized, key], ...] + foreach ($versions as $key => $version) { + $normalizedVersion = $versionParser->normalize($version); + $normalizedVersion = $versionParser->normalizeDefaultBranch($normalizedVersion); + $normalized[] = array($normalizedVersion, $key); + } + + usort($normalized, function (array $left, array $right) use ($direction) { + if ($left[0] === $right[0]) { + return 0; + } + + if (Comparator::lessThan($left[0], $right[0])) { + return -$direction; + } + + return $direction; + }); + + // Recreate input array, using the original indexes which are now in sorted order. + $sorted = array(); + foreach ($normalized as $item) { + $sorted[] = $versions[$item[1]]; + } + + return $sorted; + } +} diff --git a/vendor/composer/semver/src/VersionParser.php b/vendor/composer/semver/src/VersionParser.php new file mode 100644 index 0000000..9318629 --- /dev/null +++ b/vendor/composer/semver/src/VersionParser.php @@ -0,0 +1,586 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\Semver; + +use Composer\Semver\Constraint\ConstraintInterface; +use Composer\Semver\Constraint\MatchAllConstraint; +use Composer\Semver\Constraint\MultiConstraint; +use Composer\Semver\Constraint\Constraint; + +/** + * Version parser. + * + * @author Jordi Boggiano + */ +class VersionParser +{ + /** + * Regex to match pre-release data (sort of). + * + * Due to backwards compatibility: + * - Instead of enforcing hyphen, an underscore, dot or nothing at all are also accepted. + * - Only stabilities as recognized by Composer are allowed to precede a numerical identifier. + * - Numerical-only pre-release identifiers are not supported, see tests. + * + * |--------------| + * [major].[minor].[patch] -[pre-release] +[build-metadata] + * + * @var string + */ + private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?'; + + /** @var string */ + private static $stabilitiesRegex = 'stable|RC|beta|alpha|dev'; + + /** + * Returns the stability of a version. + * + * @param string $version + * + * @return string + * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' + */ + public static function parseStability($version) + { + $version = (string) preg_replace('{#.+$}', '', (string) $version); + + if (strpos($version, 'dev-') === 0 || '-dev' === substr($version, -4)) { + return 'dev'; + } + + preg_match('{' . self::$modifierRegex . '(?:\+.*)?$}i', strtolower($version), $match); + + if (!empty($match[3])) { + return 'dev'; + } + + if (!empty($match[1])) { + if ('beta' === $match[1] || 'b' === $match[1]) { + return 'beta'; + } + if ('alpha' === $match[1] || 'a' === $match[1]) { + return 'alpha'; + } + if ('rc' === $match[1]) { + return 'RC'; + } + } + + return 'stable'; + } + + /** + * @param string $stability + * + * @return string + */ + public static function normalizeStability($stability) + { + $stability = strtolower((string) $stability); + + return $stability === 'rc' ? 'RC' : $stability; + } + + /** + * Normalizes a version string to be able to perform comparisons on it. + * + * @param string $version + * @param ?string $fullVersion optional complete version string to give more context + * + * @throws \UnexpectedValueException + * + * @return string + */ + public function normalize($version, $fullVersion = null) + { + $version = trim((string) $version); + $origVersion = $version; + if (null === $fullVersion) { + $fullVersion = $version; + } + + // strip off aliasing + if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) { + $version = $match[1]; + } + + // strip off stability flag + if (preg_match('{@(?:' . self::$stabilitiesRegex . ')$}i', $version, $match)) { + $version = substr($version, 0, strlen($version) - strlen($match[0])); + } + + // normalize master/trunk/default branches to dev-name for BC with 1.x as these used to be valid constraints + if (\in_array($version, array('master', 'trunk', 'default'), true)) { + $version = 'dev-' . $version; + } + + // if requirement is branch-like, use full name + if (stripos($version, 'dev-') === 0) { + return 'dev-' . substr($version, 4); + } + + // strip off build metadata + if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) { + $version = $match[1]; + } + + // match classical versioning + if (preg_match('{^v?(\d{1,5}+)(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) { + $version = $matches[1] + . (!empty($matches[2]) ? $matches[2] : '.0') + . (!empty($matches[3]) ? $matches[3] : '.0') + . (!empty($matches[4]) ? $matches[4] : '.0'); + $index = 5; + // match date(time) based versioning + } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3}){0,2})' . self::$modifierRegex . '$}i', $version, $matches)) { + $version = (string) preg_replace('{\D}', '.', $matches[1]); + $index = 2; + } + + // add version modifiers if a version was matched + if (isset($index)) { + if (!empty($matches[$index])) { + if ('stable' === $matches[$index]) { + return $version; + } + $version .= '-' . $this->expandStability($matches[$index]) . (isset($matches[$index + 1]) && '' !== $matches[$index + 1] ? ltrim($matches[$index + 1], '.-') : ''); + } + + if (!empty($matches[$index + 2])) { + $version .= '-dev'; + } + + return $version; + } + + // match dev branches + if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) { + try { + $normalized = $this->normalizeBranch($match[1]); + // a branch ending with -dev is only valid if it is numeric + // if it gets prefixed with dev- it means the branch name should + // have had a dev- prefix already when passed to normalize + if (strpos($normalized, 'dev-') === false) { + return $normalized; + } + } catch (\Exception $e) { + } + } + + $extraMessage = ''; + if (preg_match('{ +as +' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))?$}', $fullVersion)) { + $extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version'; + } elseif (preg_match('{^' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))? +as +}', $fullVersion)) { + $extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-'; + } + + throw new \UnexpectedValueException('Invalid version string "' . $origVersion . '"' . $extraMessage); + } + + /** + * Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison. + * + * @param string $branch Branch name (e.g. 2.1.x-dev) + * + * @return string|false Numeric prefix if present (e.g. 2.1.) or false + */ + public function parseNumericAliasPrefix($branch) + { + if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', (string) $branch, $matches)) { + return $matches['version'] . '.'; + } + + return false; + } + + /** + * Normalizes a branch name to be able to perform comparisons on it. + * + * @param string $name + * + * @return string + */ + public function normalizeBranch($name) + { + $name = trim((string) $name); + + if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) { + $version = ''; + for ($i = 1; $i < 5; ++$i) { + $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x'; + } + + return str_replace('x', '9999999', $version) . '-dev'; + } + + return 'dev-' . $name; + } + + /** + * Normalizes a default branch name (i.e. master on git) to 9999999-dev. + * + * @param string $name + * + * @return string + * + * @deprecated No need to use this anymore in theory, Composer 2 does not normalize any branch names to 9999999-dev anymore + */ + public function normalizeDefaultBranch($name) + { + if ($name === 'dev-master' || $name === 'dev-default' || $name === 'dev-trunk') { + return '9999999-dev'; + } + + return (string) $name; + } + + /** + * Parses a constraint string into MultiConstraint and/or Constraint objects. + * + * @param string $constraints + * + * @return ConstraintInterface + */ + public function parseConstraints($constraints) + { + $prettyConstraint = (string) $constraints; + + $orConstraints = preg_split('{\s*\|\|?\s*}', trim((string) $constraints)); + if (false === $orConstraints) { + throw new \RuntimeException('Failed to preg_split string: '.$constraints); + } + $orGroups = array(); + + foreach ($orConstraints as $orConstraint) { + $andConstraints = preg_split('{(?< ,]) *(? 1) { + $constraintObjects = array(); + foreach ($andConstraints as $andConstraint) { + foreach ($this->parseConstraint($andConstraint) as $parsedAndConstraint) { + $constraintObjects[] = $parsedAndConstraint; + } + } + } else { + $constraintObjects = $this->parseConstraint($andConstraints[0]); + } + + if (1 === \count($constraintObjects)) { + $constraint = $constraintObjects[0]; + } else { + $constraint = new MultiConstraint($constraintObjects); + } + + $orGroups[] = $constraint; + } + + $parsedConstraint = MultiConstraint::create($orGroups, false); + + $parsedConstraint->setPrettyString($prettyConstraint); + + return $parsedConstraint; + } + + /** + * @param string $constraint + * + * @throws \UnexpectedValueException + * + * @return array + * + * @phpstan-return non-empty-array + */ + private function parseConstraint($constraint) + { + // strip off aliasing + if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $constraint, $match)) { + $constraint = $match[1]; + } + + // strip @stability flags, and keep it for later use + if (preg_match('{^([^,\s]*?)@(' . self::$stabilitiesRegex . ')$}i', $constraint, $match)) { + $constraint = '' !== $match[1] ? $match[1] : '*'; + if ($match[2] !== 'stable') { + $stabilityModifier = $match[2]; + } + } + + // get rid of #refs as those are used by composer only + if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraint, $match)) { + $constraint = $match[1]; + } + + if (preg_match('{^(v)?[xX*](\.[xX*])*$}i', $constraint, $match)) { + if (!empty($match[1]) || !empty($match[2])) { + return array(new Constraint('>=', '0.0.0.0-dev')); + } + + return array(new MatchAllConstraint()); + } + + $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?(?:' . self::$modifierRegex . '|\.([xX*][.-]?dev))(?:\+[^\s]+)?'; + + // Tilde Range + // + // Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous + // version, to ensure that unstable instances of the current version are allowed. However, if a stability + // suffix is added to the constraint, then a >= match on the current version is used instead. + if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) { + if (strpos($constraint, '~>') === 0) { + throw new \UnexpectedValueException( + 'Could not parse version constraint ' . $constraint . ': ' . + 'Invalid operator "~>", you probably meant to use the "~" operator' + ); + } + + // Work out which position in the version we are operating at + if (isset($matches[4]) && '' !== $matches[4] && null !== $matches[4]) { + $position = 4; + } elseif (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { + $position = 3; + } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { + $position = 2; + } else { + $position = 1; + } + + // when matching 2.x-dev or 3.0.x-dev we have to shift the second or third number, despite no second/third number matching above + if (!empty($matches[8])) { + $position++; + } + + // Calculate the stability suffix + $stabilitySuffix = ''; + if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) { + $stabilitySuffix .= '-dev'; + } + + $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); + $lowerBound = new Constraint('>=', $lowVersion); + + // For upper bound, we increment the position of one more significance, + // but highPosition = 0 would be illegal + $highPosition = max(1, $position - 1); + $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev'; + $upperBound = new Constraint('<', $highVersion); + + return array( + $lowerBound, + $upperBound, + ); + } + + // Caret Range + // + // Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. + // In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for + // versions 0.X >=0.1.0, and no updates for versions 0.0.X + if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) { + // Work out which position in the version we are operating at + if ('0' !== $matches[1] || '' === $matches[2] || null === $matches[2]) { + $position = 1; + } elseif ('0' !== $matches[2] || '' === $matches[3] || null === $matches[3]) { + $position = 2; + } else { + $position = 3; + } + + // Calculate the stability suffix + $stabilitySuffix = ''; + if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) { + $stabilitySuffix .= '-dev'; + } + + $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1)); + $lowerBound = new Constraint('>=', $lowVersion); + + // For upper bound, we increment the position of one more significance, + // but highPosition = 0 would be illegal + $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; + $upperBound = new Constraint('<', $highVersion); + + return array( + $lowerBound, + $upperBound, + ); + } + + // X Range + // + // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple. + // A partial version range is treated as an X-Range, so the special character is in fact optional. + if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) { + if (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) { + $position = 3; + } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) { + $position = 2; + } else { + $position = 1; + } + + $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev'; + $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; + + if ($lowVersion === '0.0.0.0-dev') { + return array(new Constraint('<', $highVersion)); + } + + return array( + new Constraint('>=', $lowVersion), + new Constraint('<', $highVersion), + ); + } + + // Hyphen Range + // + // Specifies an inclusive set. If a partial version is provided as the first version in the inclusive range, + // then the missing pieces are replaced with zeroes. If a partial version is provided as the second version in + // the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but + // nothing that would be greater than the provided tuple parts. + if (preg_match('{^(?P' . $versionRegex . ') +- +(?P' . $versionRegex . ')($)}i', $constraint, $matches)) { + // Calculate the stability suffix + $lowStabilitySuffix = ''; + if (empty($matches[6]) && empty($matches[8]) && empty($matches[9])) { + $lowStabilitySuffix = '-dev'; + } + + $lowVersion = $this->normalize($matches['from']); + $lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix); + + $empty = function ($x) { + return ($x === 0 || $x === '0') ? false : empty($x); + }; + + if ((!$empty($matches[12]) && !$empty($matches[13])) || !empty($matches[15]) || !empty($matches[17]) || !empty($matches[18])) { + $highVersion = $this->normalize($matches['to']); + $upperBound = new Constraint('<=', $highVersion); + } else { + $highMatch = array('', $matches[11], $matches[12], $matches[13], $matches[14]); + + // validate to version + $this->normalize($matches['to']); + + $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[12]) ? 1 : 2, 1) . '-dev'; + $upperBound = new Constraint('<', $highVersion); + } + + return array( + $lowerBound, + $upperBound, + ); + } + + // Basic Comparators + if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) { + try { + try { + $version = $this->normalize($matches[2]); + } catch (\UnexpectedValueException $e) { + // recover from an invalid constraint like foobar-dev which should be dev-foobar + // except if the constraint uses a known operator, in which case it must be a parse error + if (substr($matches[2], -4) === '-dev' && preg_match('{^[0-9a-zA-Z-./]+$}', $matches[2])) { + $version = $this->normalize('dev-'.substr($matches[2], 0, -4)); + } else { + throw $e; + } + } + + $op = $matches[1] ?: '='; + + if ($op !== '==' && $op !== '=' && !empty($stabilityModifier) && self::parseStability($version) === 'stable') { + $version .= '-' . $stabilityModifier; + } elseif ('<' === $op || '>=' === $op) { + if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) { + if (strpos($matches[2], 'dev-') !== 0) { + $version .= '-dev'; + } + } + } + + return array(new Constraint($matches[1] ?: '=', $version)); + } catch (\Exception $e) { + } + } + + $message = 'Could not parse version constraint ' . $constraint; + if (isset($e)) { + $message .= ': ' . $e->getMessage(); + } + + throw new \UnexpectedValueException($message); + } + + /** + * Increment, decrement, or simply pad a version number. + * + * Support function for {@link parseConstraint()} + * + * @param array $matches Array with version parts in array indexes 1,2,3,4 + * @param int $position 1,2,3,4 - which segment of the version to increment/decrement + * @param int $increment + * @param string $pad The string to pad version parts after $position + * + * @return string|null The new version + * + * @phpstan-param string[] $matches + */ + private function manipulateVersionString(array $matches, $position, $increment = 0, $pad = '0') + { + for ($i = 4; $i > 0; --$i) { + if ($i > $position) { + $matches[$i] = $pad; + } elseif ($i === $position && $increment) { + $matches[$i] += $increment; + // If $matches[$i] was 0, carry the decrement + if ($matches[$i] < 0) { + $matches[$i] = $pad; + --$position; + + // Return null on a carry overflow + if ($i === 1) { + return null; + } + } + } + } + + return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4]; + } + + /** + * Expand shorthand stability string to long version. + * + * @param string $stability + * + * @return string + */ + private function expandStability($stability) + { + $stability = strtolower($stability); + + switch ($stability) { + case 'a': + return 'alpha'; + case 'b': + return 'beta'; + case 'p': + case 'pl': + return 'patch'; + case 'rc': + return 'RC'; + default: + return $stability; + } + } +} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php new file mode 100644 index 0000000..1e59192 --- /dev/null +++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php @@ -0,0 +1,14 @@ + $reflectionClass + * + * @template T of object + */ + public static function fromAbstractClass(ReflectionClass $reflectionClass): self + { + return new self(sprintf( + 'The provided class "%s" is abstract, and cannot be instantiated', + $reflectionClass->getName(), + )); + } + + public static function fromEnum(string $className): self + { + return new self(sprintf( + 'The provided class "%s" is an enum, and cannot be instantiated', + $className, + )); + } +} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php new file mode 100644 index 0000000..4f70ded --- /dev/null +++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php @@ -0,0 +1,61 @@ + $reflectionClass + * + * @template T of object + */ + public static function fromSerializationTriggeredException( + ReflectionClass $reflectionClass, + Exception $exception, + ): self { + return new self( + sprintf( + 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization', + $reflectionClass->getName(), + ), + 0, + $exception, + ); + } + + /** + * @phpstan-param ReflectionClass $reflectionClass + * + * @template T of object + */ + public static function fromUncleanUnSerialization( + ReflectionClass $reflectionClass, + string $errorString, + int $errorCode, + string $errorFile, + int $errorLine, + ): self { + return new self( + sprintf( + 'Could not produce an instance of "%s" via un-serialization, since an error was triggered ' + . 'in file "%s" at line "%d"', + $reflectionClass->getName(), + $errorFile, + $errorLine, + ), + 0, + new Exception($errorString, $errorCode), + ); + } +} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php new file mode 100644 index 0000000..f803f89 --- /dev/null +++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php @@ -0,0 +1,255 @@ + $className + * + * @phpstan-return T + * + * @throws ExceptionInterface + * + * @template T of object + */ + public function instantiate(string $className): object + { + if (isset(self::$cachedCloneables[$className])) { + /** @phpstan-var T */ + $cachedCloneable = self::$cachedCloneables[$className]; + + return clone $cachedCloneable; + } + + if (isset(self::$cachedInstantiators[$className])) { + $factory = self::$cachedInstantiators[$className]; + + return $factory(); + } + + return $this->buildAndCacheFromFactory($className); + } + + /** + * Builds the requested object and caches it in static properties for performance + * + * @phpstan-param class-string $className + * + * @phpstan-return T + * + * @template T of object + */ + private function buildAndCacheFromFactory(string $className): object + { + $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className); + $instance = $factory(); + + if ($this->isSafeToClone(new ReflectionClass($instance))) { + self::$cachedCloneables[$className] = clone $instance; + } + + return $instance; + } + + /** + * Builds a callable capable of instantiating the given $className without + * invoking its constructor. + * + * @phpstan-param class-string $className + * + * @phpstan-return callable(): T + * + * @throws InvalidArgumentException + * @throws UnexpectedValueException + * @throws ReflectionException + * + * @template T of object + */ + private function buildFactory(string $className): callable + { + $reflectionClass = $this->getReflectionClass($className); + + if ($this->isInstantiableViaReflection($reflectionClass)) { + return [$reflectionClass, 'newInstanceWithoutConstructor']; + } + + $serializedString = sprintf( + '%s:%d:"%s":0:{}', + is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER, + strlen($className), + $className, + ); + + $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); + + return static fn () => unserialize($serializedString); + } + + /** + * @phpstan-param class-string $className + * + * @phpstan-return ReflectionClass + * + * @throws InvalidArgumentException + * @throws ReflectionException + * + * @template T of object + */ + private function getReflectionClass(string $className): ReflectionClass + { + if (! class_exists($className)) { + throw InvalidArgumentException::fromNonExistingClass($className); + } + + if (enum_exists($className, false)) { + throw InvalidArgumentException::fromEnum($className); + } + + $reflection = new ReflectionClass($className); + + if ($reflection->isAbstract()) { + throw InvalidArgumentException::fromAbstractClass($reflection); + } + + return $reflection; + } + + /** + * @phpstan-param ReflectionClass $reflectionClass + * + * @throws UnexpectedValueException + * + * @template T of object + */ + private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString): void + { + set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, &$error): bool { + $error = UnexpectedValueException::fromUncleanUnSerialization( + $reflectionClass, + $message, + $code, + $file, + $line, + ); + + return true; + }); + + try { + $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); + } finally { + restore_error_handler(); + } + + if ($error) { + throw $error; + } + } + + /** + * @phpstan-param ReflectionClass $reflectionClass + * + * @throws UnexpectedValueException + * + * @template T of object + */ + private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString): void + { + try { + unserialize($serializedString); + } catch (Exception $exception) { + throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception); + } + } + + /** + * @phpstan-param ReflectionClass $reflectionClass + * + * @template T of object + */ + private function isInstantiableViaReflection(ReflectionClass $reflectionClass): bool + { + return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); + } + + /** + * Verifies whether the given class is to be considered internal + * + * @phpstan-param ReflectionClass $reflectionClass + * + * @template T of object + */ + private function hasInternalAncestors(ReflectionClass $reflectionClass): bool + { + do { + if ($reflectionClass->isInternal()) { + return true; + } + + $reflectionClass = $reflectionClass->getParentClass(); + } while ($reflectionClass); + + return false; + } + + /** + * Checks if a class is cloneable + * + * Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects. + * + * @phpstan-param ReflectionClass $reflectionClass + * + * @template T of object + */ + private function isSafeToClone(ReflectionClass $reflectionClass): bool + { + return $reflectionClass->isCloneable() + && ! $reflectionClass->hasMethod('__clone') + && ! $reflectionClass->isSubclassOf(ArrayIterator::class); + } +} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php new file mode 100644 index 0000000..c6ebe35 --- /dev/null +++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php @@ -0,0 +1,24 @@ + $className + * + * @phpstan-return T + * + * @throws ExceptionInterface + * + * @template T of object + */ + public function instantiate(string $className): object; +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/ErrorException.php b/vendor/filp/whoops/src/Whoops/Exception/ErrorException.php new file mode 100644 index 0000000..d74e823 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/ErrorException.php @@ -0,0 +1,17 @@ + + */ + +namespace Whoops\Exception; + +use ErrorException as BaseErrorException; + +/** + * Wraps ErrorException; mostly used for typing (at least now) + * to easily cleanup the stack trace of redundant info. + */ +class ErrorException extends BaseErrorException +{ +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/Formatter.php b/vendor/filp/whoops/src/Whoops/Exception/Formatter.php new file mode 100644 index 0000000..a041530 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/Formatter.php @@ -0,0 +1,77 @@ + + */ + +namespace Whoops\Exception; + +use Whoops\Inspector\InspectorInterface; + +class Formatter +{ + /** + * Returns all basic information about the exception in a simple array + * for further convertion to other languages + * @param InspectorInterface $inspector + * @param bool $shouldAddTrace + * @param array $frameFilters + * @return array + */ + public static function formatExceptionAsDataArray(InspectorInterface $inspector, $shouldAddTrace, array $frameFilters = []) + { + $exception = $inspector->getException(); + $response = [ + 'type' => get_class($exception), + 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), + 'file' => $exception->getFile(), + 'line' => $exception->getLine(), + ]; + + if ($shouldAddTrace) { + $frames = $inspector->getFrames($frameFilters); + $frameData = []; + + foreach ($frames as $frame) { + /** @var Frame $frame */ + $frameData[] = [ + 'file' => $frame->getFile(), + 'line' => $frame->getLine(), + 'function' => $frame->getFunction(), + 'class' => $frame->getClass(), + 'args' => $frame->getArgs(), + ]; + } + + $response['trace'] = $frameData; + } + + return $response; + } + + public static function formatExceptionPlain(InspectorInterface $inspector) + { + $message = $inspector->getException()->getMessage(); + $frames = $inspector->getFrames(); + + $plain = $inspector->getExceptionName(); + $plain .= ' thrown with message "'; + $plain .= $message; + $plain .= '"'."\n\n"; + + $plain .= "Stacktrace:\n"; + foreach ($frames as $i => $frame) { + $plain .= "#". (count($frames) - $i - 1). " "; + $plain .= $frame->getClass() ?: ''; + $plain .= $frame->getClass() && $frame->getFunction() ? ":" : ""; + $plain .= $frame->getFunction() ?: ''; + $plain .= ' in '; + $plain .= ($frame->getFile() ?: '<#unknown>'); + $plain .= ':'; + $plain .= (int) $frame->getLine(). "\n"; + } + + return $plain; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/Frame.php b/vendor/filp/whoops/src/Whoops/Exception/Frame.php new file mode 100644 index 0000000..469070e --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/Frame.php @@ -0,0 +1,311 @@ + + */ + +namespace Whoops\Exception; + +use InvalidArgumentException; +use Serializable; + +class Frame implements Serializable +{ + /** + * @var array + */ + protected $frame; + + /** + * @var string + */ + protected $fileContentsCache; + + /** + * @var array[] + */ + protected $comments = []; + + /** + * @var bool + */ + protected $application; + + public function __construct(array $frame) + { + $this->frame = $frame; + } + + /** + * @param bool $shortened + * @return string|null + */ + public function getFile($shortened = false) + { + if (empty($this->frame['file'])) { + return null; + } + + $file = $this->frame['file']; + + // Check if this frame occurred within an eval(). + // @todo: This can be made more reliable by checking if we've entered + // eval() in a previous trace, but will need some more work on the upper + // trace collector(s). + if (preg_match('/^(.*)\((\d+)\) : (?:eval\(\)\'d|assert) code$/', $file, $matches)) { + $file = $this->frame['file'] = $matches[1]; + $this->frame['line'] = (int) $matches[2]; + } + + if ($shortened && is_string($file)) { + // Replace the part of the path that all frames have in common, and add 'soft hyphens' for smoother line-breaks. + $dirname = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); + if ($dirname !== '/') { + $file = str_replace($dirname, "…", $file); + } + $file = str_replace("/", "/­", $file); + } + + return $file; + } + + /** + * @return int|null + */ + public function getLine() + { + return isset($this->frame['line']) ? $this->frame['line'] : null; + } + + /** + * @return string|null + */ + public function getClass() + { + return isset($this->frame['class']) ? $this->frame['class'] : null; + } + + /** + * @return string|null + */ + public function getFunction() + { + return isset($this->frame['function']) ? $this->frame['function'] : null; + } + + /** + * @return array + */ + public function getArgs() + { + return isset($this->frame['args']) ? (array) $this->frame['args'] : []; + } + + /** + * Returns the full contents of the file for this frame, + * if it's known. + * @return string|null + */ + public function getFileContents() + { + if ($this->fileContentsCache === null && $filePath = $this->getFile()) { + // Leave the stage early when 'Unknown' or '[internal]' is passed + // this would otherwise raise an exception when + // open_basedir is enabled. + if ($filePath === "Unknown" || $filePath === '[internal]') { + return null; + } + + try { + $this->fileContentsCache = file_get_contents($filePath); + } catch (ErrorException $exception) { + // Internal file paths of PHP extensions cannot be opened + } + } + + return $this->fileContentsCache; + } + + /** + * Adds a comment to this frame, that can be received and + * used by other handlers. For example, the PrettyPage handler + * can attach these comments under the code for each frame. + * + * An interesting use for this would be, for example, code analysis + * & annotations. + * + * @param string $comment + * @param string $context Optional string identifying the origin of the comment + */ + public function addComment($comment, $context = 'global') + { + $this->comments[] = [ + 'comment' => $comment, + 'context' => $context, + ]; + } + + /** + * Returns all comments for this frame. Optionally allows + * a filter to only retrieve comments from a specific + * context. + * + * @param string $filter + * @return array[] + */ + public function getComments($filter = null) + { + $comments = $this->comments; + + if ($filter !== null) { + $comments = array_filter($comments, function ($c) use ($filter) { + return $c['context'] == $filter; + }); + } + + return $comments; + } + + /** + * Returns the array containing the raw frame data from which + * this Frame object was built + * + * @return array + */ + public function getRawFrame() + { + return $this->frame; + } + + /** + * Returns the contents of the file for this frame as an + * array of lines, and optionally as a clamped range of lines. + * + * NOTE: lines are 0-indexed + * + * @example + * Get all lines for this file + * $frame->getFileLines(); // => array( 0 => ' '...', ...) + * @example + * Get one line for this file, starting at line 10 (zero-indexed, remember!) + * $frame->getFileLines(9, 1); // array( 9 => '...' ) + * + * @throws InvalidArgumentException if $length is less than or equal to 0 + * @param int $start + * @param int $length + * @return string[]|null + */ + public function getFileLines($start = 0, $length = null) + { + if (null !== ($contents = $this->getFileContents())) { + $lines = explode("\n", $contents); + + // Get a subset of lines from $start to $end + if ($length !== null) { + $start = (int) $start; + $length = (int) $length; + if ($start < 0) { + $start = 0; + } + + if ($length <= 0) { + throw new InvalidArgumentException( + "\$length($length) cannot be lower or equal to 0" + ); + } + + $lines = array_slice($lines, $start, $length, true); + } + + return $lines; + } + } + + /** + * Implements the Serializable interface, with special + * steps to also save the existing comments. + * + * @see Serializable::serialize + * @return string + */ + public function serialize() + { + $frame = $this->frame; + if (!empty($this->comments)) { + $frame['_comments'] = $this->comments; + } + + return serialize($frame); + } + + public function __serialize() + { + $frame = $this->frame; + if (!empty($this->comments)) { + $frame['_comments'] = $this->comments; + } + return $frame; + } + + /** + * Unserializes the frame data, while also preserving + * any existing comment data. + * + * @see Serializable::unserialize + * @param string $serializedFrame + */ + public function unserialize($serializedFrame) + { + $frame = unserialize($serializedFrame); + + if (!empty($frame['_comments'])) { + $this->comments = $frame['_comments']; + unset($frame['_comments']); + } + + $this->frame = $frame; + } + + public function __unserialize($frame) + { + if (!empty($frame['_comments'])) { + $this->comments = $frame['_comments']; + unset($frame['_comments']); + } + + $this->frame = $frame; + } + + /** + * Compares Frame against one another + * @param Frame $frame + * @return bool + */ + public function equals(Frame $frame) + { + if (!$this->getFile() || $this->getFile() === 'Unknown' || !$this->getLine()) { + return false; + } + return $frame->getFile() === $this->getFile() && $frame->getLine() === $this->getLine(); + } + + /** + * Returns whether this frame belongs to the application or not. + * + * @return boolean + */ + public function isApplication() + { + return $this->application; + } + + /** + * Mark as an frame belonging to the application. + * + * @param boolean $application + */ + public function setApplication($application) + { + $this->application = $application; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php b/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php new file mode 100644 index 0000000..922c035 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php @@ -0,0 +1,219 @@ + + */ + +namespace Whoops\Exception; + +use ArrayAccess; +use ArrayIterator; +use Countable; +use IteratorAggregate; +use ReturnTypeWillChange; +use Serializable; +use UnexpectedValueException; + +/** + * Exposes a fluent interface for dealing with an ordered list + * of stack-trace frames. + */ +class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, Countable +{ + /** + * @var array[] + */ + private $frames; + + public function __construct(array $frames) + { + $this->frames = array_map(function ($frame) { + return new Frame($frame); + }, $frames); + } + + /** + * Filters frames using a callable, returns the same FrameCollection + * + * @param callable $callable + * @return FrameCollection + */ + public function filter($callable) + { + $this->frames = array_values(array_filter($this->frames, $callable)); + return $this; + } + + /** + * Map the collection of frames + * + * @param callable $callable + * @return FrameCollection + */ + public function map($callable) + { + // Contain the map within a higher-order callable + // that enforces type-correctness for the $callable + $this->frames = array_map(function ($frame) use ($callable) { + $frame = call_user_func($callable, $frame); + + if (!$frame instanceof Frame) { + throw new UnexpectedValueException( + "Callable to " . __CLASS__ . "::map must return a Frame object" + ); + } + + return $frame; + }, $this->frames); + + return $this; + } + + /** + * Returns an array with all frames, does not affect + * the internal array. + * + * @todo If this gets any more complex than this, + * have getIterator use this method. + * @see FrameCollection::getIterator + * @return array + */ + public function getArray() + { + return $this->frames; + } + + /** + * @see IteratorAggregate::getIterator + * @return ArrayIterator + */ + #[ReturnTypeWillChange] + public function getIterator() + { + return new ArrayIterator($this->frames); + } + + /** + * @see ArrayAccess::offsetExists + * @param int $offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->frames[$offset]); + } + + /** + * @see ArrayAccess::offsetGet + * @param int $offset + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->frames[$offset]; + } + + /** + * @see ArrayAccess::offsetSet + * @param int $offset + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + throw new \Exception(__CLASS__ . ' is read only'); + } + + /** + * @see ArrayAccess::offsetUnset + * @param int $offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset) + { + throw new \Exception(__CLASS__ . ' is read only'); + } + + /** + * @see Countable::count + * @return int + */ + #[ReturnTypeWillChange] + public function count() + { + return count($this->frames); + } + + /** + * Count the frames that belongs to the application. + * + * @return int + */ + public function countIsApplication() + { + return count(array_filter($this->frames, function (Frame $f) { + return $f->isApplication(); + })); + } + + /** + * @see Serializable::serialize + * @return string + */ + #[ReturnTypeWillChange] + public function serialize() + { + return serialize($this->frames); + } + + /** + * @see Serializable::unserialize + * @param string $serializedFrames + */ + #[ReturnTypeWillChange] + public function unserialize($serializedFrames) + { + $this->frames = unserialize($serializedFrames); + } + + public function __serialize() + { + return $this->frames; + } + + public function __unserialize(array $serializedFrames) + { + $this->frames = $serializedFrames; + } + + /** + * @param Frame[] $frames Array of Frame instances, usually from $e->getPrevious() + */ + public function prependFrames(array $frames) + { + $this->frames = array_merge($frames, $this->frames); + } + + /** + * Gets the innermost part of stack trace that is not the same as that of outer exception + * + * @param FrameCollection $parentFrames Outer exception frames to compare tail against + * @return Frame[] + */ + public function topDiff(FrameCollection $parentFrames) + { + $diff = $this->frames; + + $parentFrames = $parentFrames->getArray(); + $p = count($parentFrames)-1; + + for ($i = count($diff)-1; $i >= 0 && $p >= 0; $i--) { + /** @var Frame $tailFrame */ + $tailFrame = $diff[$i]; + if ($tailFrame->equals($parentFrames[$p])) { + unset($diff[$i]); + } + $p--; + } + return $diff; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/Inspector.php b/vendor/filp/whoops/src/Whoops/Exception/Inspector.php new file mode 100644 index 0000000..a183563 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/Inspector.php @@ -0,0 +1,341 @@ + + */ + +namespace Whoops\Exception; + +use Whoops\Inspector\InspectorFactory; +use Whoops\Inspector\InspectorInterface; +use Whoops\Util\Misc; + +class Inspector implements InspectorInterface +{ + /** + * @var \Throwable + */ + private $exception; + + /** + * @var \Whoops\Exception\FrameCollection + */ + private $frames; + + /** + * @var \Whoops\Exception\Inspector + */ + private $previousExceptionInspector; + + /** + * @var \Throwable[] + */ + private $previousExceptions; + + /** + * @var \Whoops\Inspector\InspectorFactoryInterface|null + */ + protected $inspectorFactory; + + /** + * @param \Throwable $exception The exception to inspect + * @param \Whoops\Inspector\InspectorFactoryInterface $factory + */ + public function __construct($exception, $factory = null) + { + $this->exception = $exception; + $this->inspectorFactory = $factory ?: new InspectorFactory(); + } + + /** + * @return \Throwable + */ + public function getException() + { + return $this->exception; + } + + /** + * @return string + */ + public function getExceptionName() + { + return get_class($this->exception); + } + + /** + * @return string + */ + public function getExceptionMessage() + { + return $this->extractDocrefUrl($this->exception->getMessage())['message']; + } + + /** + * @return string[] + */ + public function getPreviousExceptionMessages() + { + return array_map(function ($prev) { + /** @var \Throwable $prev */ + return $this->extractDocrefUrl($prev->getMessage())['message']; + }, $this->getPreviousExceptions()); + } + + /** + * @return int[] + */ + public function getPreviousExceptionCodes() + { + return array_map(function ($prev) { + /** @var \Throwable $prev */ + return $prev->getCode(); + }, $this->getPreviousExceptions()); + } + + /** + * Returns a url to the php-manual related to the underlying error - when available. + * + * @return string|null + */ + public function getExceptionDocrefUrl() + { + return $this->extractDocrefUrl($this->exception->getMessage())['url']; + } + + private function extractDocrefUrl($message) + { + $docref = [ + 'message' => $message, + 'url' => null, + ]; + + // php embbeds urls to the manual into the Exception message with the following ini-settings defined + // http://php.net/manual/en/errorfunc.configuration.php#ini.docref-root + if (!ini_get('html_errors') || !ini_get('docref_root')) { + return $docref; + } + + $pattern = "/\[(?:[^<]+)<\/a>\]/"; + if (preg_match($pattern, $message, $matches)) { + // -> strip those automatically generated links from the exception message + $docref['message'] = preg_replace($pattern, '', $message, 1); + $docref['url'] = $matches[1]; + } + + return $docref; + } + + /** + * Does the wrapped Exception has a previous Exception? + * @return bool + */ + public function hasPreviousException() + { + return $this->previousExceptionInspector || $this->exception->getPrevious(); + } + + /** + * Returns an Inspector for a previous Exception, if any. + * @todo Clean this up a bit, cache stuff a bit better. + * @return Inspector + */ + public function getPreviousExceptionInspector() + { + if ($this->previousExceptionInspector === null) { + $previousException = $this->exception->getPrevious(); + + if ($previousException) { + $this->previousExceptionInspector = $this->inspectorFactory->create($previousException); + } + } + + return $this->previousExceptionInspector; + } + + + /** + * Returns an array of all previous exceptions for this inspector's exception + * @return \Throwable[] + */ + public function getPreviousExceptions() + { + if ($this->previousExceptions === null) { + $this->previousExceptions = []; + + $prev = $this->exception->getPrevious(); + while ($prev !== null) { + $this->previousExceptions[] = $prev; + $prev = $prev->getPrevious(); + } + } + + return $this->previousExceptions; + } + + /** + * Returns an iterator for the inspected exception's + * frames. + * + * @param array $frameFilters + * + * @return \Whoops\Exception\FrameCollection + */ + public function getFrames(array $frameFilters = []) + { + if ($this->frames === null) { + $frames = $this->getTrace($this->exception); + + // Fill empty line/file info for call_user_func_array usages (PHP Bug #44428) + foreach ($frames as $k => $frame) { + if (empty($frame['file'])) { + // Default values when file and line are missing + $file = '[internal]'; + $line = 0; + + $next_frame = !empty($frames[$k + 1]) ? $frames[$k + 1] : []; + + if ($this->isValidNextFrame($next_frame)) { + $file = $next_frame['file']; + $line = $next_frame['line']; + } + + $frames[$k]['file'] = $file; + $frames[$k]['line'] = $line; + } + } + + // Find latest non-error handling frame index ($i) used to remove error handling frames + $i = 0; + foreach ($frames as $k => $frame) { + if ($frame['file'] == $this->exception->getFile() && $frame['line'] == $this->exception->getLine()) { + $i = $k; + } + } + + // Remove error handling frames + if ($i > 0) { + array_splice($frames, 0, $i); + } + + $firstFrame = $this->getFrameFromException($this->exception); + array_unshift($frames, $firstFrame); + + $this->frames = new FrameCollection($frames); + + if ($previousInspector = $this->getPreviousExceptionInspector()) { + // Keep outer frame on top of the inner one + $outerFrames = $this->frames; + $newFrames = clone $previousInspector->getFrames(); + // I assume it will always be set, but let's be safe + if (isset($newFrames[0])) { + $newFrames[0]->addComment( + $previousInspector->getExceptionMessage(), + 'Exception message:' + ); + } + $newFrames->prependFrames($outerFrames->topDiff($newFrames)); + $this->frames = $newFrames; + } + + // Apply frame filters callbacks on the frames stack + if (!empty($frameFilters)) { + foreach ($frameFilters as $filterCallback) { + $this->frames->filter($filterCallback); + } + } + } + + return $this->frames; + } + + /** + * Gets the backtrace from an exception. + * + * If xdebug is installed + * + * @param \Throwable $e + * @return array + */ + protected function getTrace($e) + { + $traces = $e->getTrace(); + + // Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default + if (!$e instanceof \ErrorException) { + return $traces; + } + + if (!Misc::isLevelFatal($e->getSeverity())) { + return $traces; + } + + if (!extension_loaded('xdebug') || !function_exists('xdebug_is_enabled') || !xdebug_is_enabled()) { + return $traces; + } + + // Use xdebug to get the full stack trace and remove the shutdown handler stack trace + $stack = array_reverse(xdebug_get_function_stack()); + $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $traces = array_diff_key($stack, $trace); + + return $traces; + } + + /** + * Given an exception, generates an array in the format + * generated by Exception::getTrace() + * @param \Throwable $exception + * @return array + */ + protected function getFrameFromException($exception) + { + return [ + 'file' => $exception->getFile(), + 'line' => $exception->getLine(), + 'class' => get_class($exception), + 'args' => [ + $exception->getMessage(), + ], + ]; + } + + /** + * Given an error, generates an array in the format + * generated by ErrorException + * @param ErrorException $exception + * @return array + */ + protected function getFrameFromError(ErrorException $exception) + { + return [ + 'file' => $exception->getFile(), + 'line' => $exception->getLine(), + 'class' => null, + 'args' => [], + ]; + } + + /** + * Determine if the frame can be used to fill in previous frame's missing info + * happens for call_user_func and call_user_func_array usages (PHP Bug #44428) + * + * @return bool + */ + protected function isValidNextFrame(array $frame) + { + if (empty($frame['file'])) { + return false; + } + + if (empty($frame['line'])) { + return false; + } + + if (empty($frame['function']) || !stristr($frame['function'], 'call_user_func')) { + return false; + } + + return true; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/CallbackHandler.php b/vendor/filp/whoops/src/Whoops/Handler/CallbackHandler.php new file mode 100644 index 0000000..cc46e70 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/CallbackHandler.php @@ -0,0 +1,52 @@ + + */ + +namespace Whoops\Handler; + +use InvalidArgumentException; + +/** + * Wrapper for Closures passed as handlers. Can be used + * directly, or will be instantiated automagically by Whoops\Run + * if passed to Run::pushHandler + */ +class CallbackHandler extends Handler +{ + /** + * @var callable + */ + protected $callable; + + /** + * @throws InvalidArgumentException If argument is not callable + * @param callable $callable + */ + public function __construct($callable) + { + if (!is_callable($callable)) { + throw new InvalidArgumentException( + 'Argument to ' . __METHOD__ . ' must be valid callable' + ); + } + + $this->callable = $callable; + } + + /** + * @return int|null + */ + public function handle() + { + $exception = $this->getException(); + $inspector = $this->getInspector(); + $run = $this->getRun(); + $callable = $this->callable; + + // invoke the callable directly, to get simpler stacktraces (in comparison to call_user_func). + // this assumes that $callable is a properly typed php-callable, which we check in __construct(). + return $callable($exception, $inspector, $run); + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/Handler.php b/vendor/filp/whoops/src/Whoops/Handler/Handler.php new file mode 100644 index 0000000..21435fc --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/Handler.php @@ -0,0 +1,95 @@ + + */ + +namespace Whoops\Handler; + +use Whoops\Inspector\InspectorInterface; +use Whoops\RunInterface; + +/** + * Abstract implementation of a Handler. + */ +abstract class Handler implements HandlerInterface +{ + /* + Return constants that can be returned from Handler::handle + to message the handler walker. + */ + const DONE = 0x10; // returning this is optional, only exists for + // semantic purposes + /** + * The Handler has handled the Throwable in some way, and wishes to skip any other Handler. + * Execution will continue. + */ + const LAST_HANDLER = 0x20; + /** + * The Handler has handled the Throwable in some way, and wishes to quit/stop execution + */ + const QUIT = 0x30; + + /** + * @var RunInterface + */ + private $run; + + /** + * @var InspectorInterface $inspector + */ + private $inspector; + + /** + * @var \Throwable $exception + */ + private $exception; + + /** + * @param RunInterface $run + */ + public function setRun(RunInterface $run) + { + $this->run = $run; + } + + /** + * @return RunInterface + */ + protected function getRun() + { + return $this->run; + } + + /** + * @param InspectorInterface $inspector + */ + public function setInspector(InspectorInterface $inspector) + { + $this->inspector = $inspector; + } + + /** + * @return InspectorInterface + */ + protected function getInspector() + { + return $this->inspector; + } + + /** + * @param \Throwable $exception + */ + public function setException($exception) + { + $this->exception = $exception; + } + + /** + * @return \Throwable + */ + protected function getException() + { + return $this->exception; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php b/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php new file mode 100644 index 0000000..2deae98 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php @@ -0,0 +1,36 @@ + + */ + +namespace Whoops\Handler; + +use Whoops\Inspector\InspectorInterface; +use Whoops\RunInterface; + +interface HandlerInterface +{ + /** + * @return int|null A handler may return nothing, or a Handler::HANDLE_* constant + */ + public function handle(); + + /** + * @param RunInterface $run + * @return void + */ + public function setRun(RunInterface $run); + + /** + * @param \Throwable $exception + * @return void + */ + public function setException($exception); + + /** + * @param InspectorInterface $inspector + * @return void + */ + public function setInspector(InspectorInterface $inspector); +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php b/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php new file mode 100644 index 0000000..9051b36 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php @@ -0,0 +1,90 @@ + + */ + +namespace Whoops\Handler; + +use Whoops\Exception\Formatter; + +/** + * Catches an exception and converts it to a JSON + * response. Additionally can also return exception + * frames for consumption by an API. + */ +class JsonResponseHandler extends Handler +{ + /** + * @var bool + */ + private $returnFrames = false; + + /** + * @var bool + */ + private $jsonApi = false; + + /** + * Returns errors[[]] instead of error[] to be in compliance with the json:api spec + * @param bool $jsonApi Default is false + * @return static + */ + public function setJsonApi($jsonApi = false) + { + $this->jsonApi = (bool) $jsonApi; + return $this; + } + + /** + * @param bool|null $returnFrames + * @return bool|static + */ + public function addTraceToOutput($returnFrames = null) + { + if (func_num_args() == 0) { + return $this->returnFrames; + } + + $this->returnFrames = (bool) $returnFrames; + return $this; + } + + /** + * @return int + */ + public function handle() + { + if ($this->jsonApi === true) { + $response = [ + 'errors' => [ + Formatter::formatExceptionAsDataArray( + $this->getInspector(), + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() + ), + ] + ]; + } else { + $response = [ + 'error' => Formatter::formatExceptionAsDataArray( + $this->getInspector(), + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() + ), + ]; + } + + echo json_encode($response, defined('JSON_PARTIAL_OUTPUT_ON_ERROR') ? JSON_PARTIAL_OUTPUT_ON_ERROR : 0); + + return Handler::QUIT; + } + + /** + * @return string + */ + public function contentType() + { + return 'application/json'; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php new file mode 100644 index 0000000..ea38b76 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php @@ -0,0 +1,359 @@ + +* Plaintext handler for command line and logs. +* @author Pierre-Yves Landuré +*/ + +namespace Whoops\Handler; + +use InvalidArgumentException; +use Psr\Log\LoggerInterface; +use Whoops\Exception\Frame; + +/** +* Handler outputing plaintext error messages. Can be used +* directly, or will be instantiated automagically by Whoops\Run +* if passed to Run::pushHandler +*/ +class PlainTextHandler extends Handler +{ + const VAR_DUMP_PREFIX = ' | '; + + /** + * @var \Psr\Log\LoggerInterface + */ + protected $logger; + + /** + * @var callable + */ + protected $dumper; + + /** + * @var bool + */ + private $addTraceToOutput = true; + + /** + * @var bool|integer + */ + private $addTraceFunctionArgsToOutput = false; + + /** + * @var integer + */ + private $traceFunctionArgsOutputLimit = 1024; + + /** + * @var bool + */ + private $addPreviousToOutput = true; + + /** + * @var bool + */ + private $loggerOnly = false; + + /** + * Constructor. + * @throws InvalidArgumentException If argument is not null or a LoggerInterface + * @param \Psr\Log\LoggerInterface|null $logger + */ + public function __construct($logger = null) + { + $this->setLogger($logger); + } + + /** + * Set the output logger interface. + * @throws InvalidArgumentException If argument is not null or a LoggerInterface + * @param \Psr\Log\LoggerInterface|null $logger + */ + public function setLogger($logger = null) + { + if (! (is_null($logger) + || $logger instanceof LoggerInterface)) { + throw new InvalidArgumentException( + 'Argument to ' . __METHOD__ . + " must be a valid Logger Interface (aka. Monolog), " . + get_class($logger) . ' given.' + ); + } + + $this->logger = $logger; + } + + /** + * @return \Psr\Log\LoggerInterface|null + */ + public function getLogger() + { + return $this->logger; + } + + /** + * Set var dumper callback function. + * + * @param callable $dumper + * @return static + */ + public function setDumper(callable $dumper) + { + $this->dumper = $dumper; + return $this; + } + + /** + * Add error trace to output. + * @param bool|null $addTraceToOutput + * @return bool|static + */ + public function addTraceToOutput($addTraceToOutput = null) + { + if (func_num_args() == 0) { + return $this->addTraceToOutput; + } + + $this->addTraceToOutput = (bool) $addTraceToOutput; + return $this; + } + + /** + * Add previous exceptions to output. + * @param bool|null $addPreviousToOutput + * @return bool|static + */ + public function addPreviousToOutput($addPreviousToOutput = null) + { + if (func_num_args() == 0) { + return $this->addPreviousToOutput; + } + + $this->addPreviousToOutput = (bool) $addPreviousToOutput; + return $this; + } + + /** + * Add error trace function arguments to output. + * Set to True for all frame args, or integer for the n first frame args. + * @param bool|integer|null $addTraceFunctionArgsToOutput + * @return static|bool|integer + */ + public function addTraceFunctionArgsToOutput($addTraceFunctionArgsToOutput = null) + { + if (func_num_args() == 0) { + return $this->addTraceFunctionArgsToOutput; + } + + if (! is_integer($addTraceFunctionArgsToOutput)) { + $this->addTraceFunctionArgsToOutput = (bool) $addTraceFunctionArgsToOutput; + } else { + $this->addTraceFunctionArgsToOutput = $addTraceFunctionArgsToOutput; + } + return $this; + } + + /** + * Set the size limit in bytes of frame arguments var_dump output. + * If the limit is reached, the var_dump output is discarded. + * Prevent memory limit errors. + * @var integer + * @return static + */ + public function setTraceFunctionArgsOutputLimit($traceFunctionArgsOutputLimit) + { + $this->traceFunctionArgsOutputLimit = (integer) $traceFunctionArgsOutputLimit; + return $this; + } + + /** + * Create plain text response and return it as a string + * @return string + */ + public function generateResponse() + { + $exception = $this->getException(); + $message = $this->getExceptionOutput($exception); + + if ($this->addPreviousToOutput) { + $previous = $exception->getPrevious(); + while ($previous) { + $message .= "\n\nCaused by\n" . $this->getExceptionOutput($previous); + $previous = $previous->getPrevious(); + } + } + + + return $message . $this->getTraceOutput() . "\n"; + } + + /** + * Get the size limit in bytes of frame arguments var_dump output. + * If the limit is reached, the var_dump output is discarded. + * Prevent memory limit errors. + * @return integer + */ + public function getTraceFunctionArgsOutputLimit() + { + return $this->traceFunctionArgsOutputLimit; + } + + /** + * Only output to logger. + * @param bool|null $loggerOnly + * @return static|bool + */ + public function loggerOnly($loggerOnly = null) + { + if (func_num_args() == 0) { + return $this->loggerOnly; + } + + $this->loggerOnly = (bool) $loggerOnly; + return $this; + } + + /** + * Test if handler can output to stdout. + * @return bool + */ + private function canOutput() + { + return !$this->loggerOnly(); + } + + /** + * Get the frame args var_dump. + * @param \Whoops\Exception\Frame $frame [description] + * @param integer $line [description] + * @return string + */ + private function getFrameArgsOutput(Frame $frame, $line) + { + if ($this->addTraceFunctionArgsToOutput() === false + || $this->addTraceFunctionArgsToOutput() < $line) { + return ''; + } + + // Dump the arguments: + ob_start(); + $this->dump($frame->getArgs()); + if (ob_get_length() > $this->getTraceFunctionArgsOutputLimit()) { + // The argument var_dump is to big. + // Discarded to limit memory usage. + ob_clean(); + return sprintf( + "\n%sArguments dump length greater than %d Bytes. Discarded.", + self::VAR_DUMP_PREFIX, + $this->getTraceFunctionArgsOutputLimit() + ); + } + + return sprintf( + "\n%s", + preg_replace('/^/m', self::VAR_DUMP_PREFIX, ob_get_clean()) + ); + } + + /** + * Dump variable. + * + * @param mixed $var + * @return void + */ + protected function dump($var) + { + if ($this->dumper) { + call_user_func($this->dumper, $var); + } else { + var_dump($var); + } + } + + /** + * Get the exception trace as plain text. + * @return string + */ + private function getTraceOutput() + { + if (! $this->addTraceToOutput()) { + return ''; + } + $inspector = $this->getInspector(); + $frames = $inspector->getFrames($this->getRun()->getFrameFilters()); + + $response = "\nStack trace:"; + + $line = 1; + foreach ($frames as $frame) { + /** @var Frame $frame */ + $class = $frame->getClass(); + + $template = "\n%3d. %s->%s() %s:%d%s"; + if (! $class) { + // Remove method arrow (->) from output. + $template = "\n%3d. %s%s() %s:%d%s"; + } + + $response .= sprintf( + $template, + $line, + $class, + $frame->getFunction(), + $frame->getFile(), + $frame->getLine(), + $this->getFrameArgsOutput($frame, $line) + ); + + $line++; + } + + return $response; + } + + /** + * Get the exception as plain text. + * @param \Throwable $exception + * @return string + */ + private function getExceptionOutput($exception) + { + return sprintf( + "%s: %s in file %s on line %d", + get_class($exception), + $exception->getMessage(), + $exception->getFile(), + $exception->getLine() + ); + } + + /** + * @return int + */ + public function handle() + { + $response = $this->generateResponse(); + + if ($this->getLogger()) { + $this->getLogger()->error($response); + } + + if (! $this->canOutput()) { + return Handler::DONE; + } + + echo $response; + + return Handler::QUIT; + } + + /** + * @return string + */ + public function contentType() + { + return 'text/plain'; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php new file mode 100644 index 0000000..167407e --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php @@ -0,0 +1,832 @@ + + */ + +namespace Whoops\Handler; + +use InvalidArgumentException; +use RuntimeException; +use Symfony\Component\VarDumper\Cloner\AbstractCloner; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use UnexpectedValueException; +use Whoops\Exception\Formatter; +use Whoops\Util\Misc; +use Whoops\Util\TemplateHelper; + +class PrettyPageHandler extends Handler +{ + const EDITOR_SUBLIME = "sublime"; + const EDITOR_TEXTMATE = "textmate"; + const EDITOR_EMACS = "emacs"; + const EDITOR_MACVIM = "macvim"; + const EDITOR_PHPSTORM = "phpstorm"; + const EDITOR_IDEA = "idea"; + const EDITOR_VSCODE = "vscode"; + const EDITOR_ATOM = "atom"; + const EDITOR_ESPRESSO = "espresso"; + const EDITOR_XDEBUG = "xdebug"; + const EDITOR_NETBEANS = "netbeans"; + + /** + * Search paths to be scanned for resources. + * + * Stored in the reverse order they're declared. + * + * @var array + */ + private $searchPaths = []; + + /** + * Fast lookup cache for known resource locations. + * + * @var array + */ + private $resourceCache = []; + + /** + * The name of the custom css file. + * + * @var string|null + */ + private $customCss = null; + + /** + * The name of the custom js file. + * + * @var string|null + */ + private $customJs = null; + + /** + * @var array[] + */ + private $extraTables = []; + + /** + * @var bool + */ + private $handleUnconditionally = false; + + /** + * @var string + */ + private $pageTitle = "Whoops! There was an error."; + + /** + * @var array[] + */ + private $applicationPaths; + + /** + * @var array[] + */ + private $blacklist = [ + '_GET' => [], + '_POST' => [], + '_FILES' => [], + '_COOKIE' => [], + '_SESSION' => [], + '_SERVER' => [], + '_ENV' => [], + ]; + + /** + * An identifier for a known IDE/text editor. + * + * Either a string, or a calalble that resolves a string, that can be used + * to open a given file in an editor. If the string contains the special + * substrings %file or %line, they will be replaced with the correct data. + * + * @example + * "txmt://open?url=%file&line=%line" + * + * @var callable|string $editor + */ + protected $editor; + + /** + * A list of known editor strings. + * + * @var array + */ + protected $editors = [ + "sublime" => "subl://open?url=file://%file&line=%line", + "textmate" => "txmt://open?url=file://%file&line=%line", + "emacs" => "emacs://open?url=file://%file&line=%line", + "macvim" => "mvim://open/?url=file://%file&line=%line", + "phpstorm" => "phpstorm://open?file=%file&line=%line", + "idea" => "idea://open?file=%file&line=%line", + "vscode" => "vscode://file/%file:%line", + "atom" => "atom://core/open/file?filename=%file&line=%line", + "espresso" => "x-espresso://open?filepath=%file&lines=%line", + "netbeans" => "netbeans://open/?f=%file:%line", + ]; + + /** + * @var TemplateHelper + */ + protected $templateHelper; + + /** + * Constructor. + * + * @return void + */ + public function __construct() + { + if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) { + // Register editor using xdebug's file_link_format option. + $this->editors['xdebug'] = function ($file, $line) { + return str_replace(['%f', '%l'], [$file, $line], ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')); + }; + + // If xdebug is available, use it as default editor. + $this->setEditor('xdebug'); + } + + // Add the default, local resource search path: + $this->searchPaths[] = __DIR__ . "/../Resources"; + + // blacklist php provided auth based values + $this->blacklist('_SERVER', 'PHP_AUTH_PW'); + + $this->templateHelper = new TemplateHelper(); + + if (class_exists('Symfony\Component\VarDumper\Cloner\VarCloner')) { + $cloner = new VarCloner(); + // Only dump object internals if a custom caster exists for performance reasons + // https://github.com/filp/whoops/pull/404 + $cloner->addCasters(['*' => function ($obj, $a, $stub, $isNested, $filter = 0) { + $class = $stub->class; + $classes = [$class => $class] + class_parents($obj) + class_implements($obj); + + foreach ($classes as $class) { + if (isset(AbstractCloner::$defaultCasters[$class])) { + return $a; + } + } + + // Remove all internals + return []; + }]); + $this->templateHelper->setCloner($cloner); + } + } + + /** + * @return int|null + * + * @throws \Exception + */ + public function handle() + { + if (!$this->handleUnconditionally()) { + // Check conditions for outputting HTML: + // @todo: Make this more robust + if (PHP_SAPI === 'cli') { + // Help users who have been relying on an internal test value + // fix their code to the proper method + if (isset($_ENV['whoops-test'])) { + throw new \Exception( + 'Use handleUnconditionally instead of whoops-test' + .' environment variable' + ); + } + + return Handler::DONE; + } + } + + $templateFile = $this->getResource("views/layout.html.php"); + $cssFile = $this->getResource("css/whoops.base.css"); + $zeptoFile = $this->getResource("js/zepto.min.js"); + $prismJs = $this->getResource("js/prism.js"); + $prismCss = $this->getResource("css/prism.css"); + $clipboard = $this->getResource("js/clipboard.min.js"); + $jsFile = $this->getResource("js/whoops.base.js"); + + if ($this->customCss) { + $customCssFile = $this->getResource($this->customCss); + } + + if ($this->customJs) { + $customJsFile = $this->getResource($this->customJs); + } + + $inspector = $this->getInspector(); + $frames = $this->getExceptionFrames(); + $code = $this->getExceptionCode(); + + // List of variables that will be passed to the layout template. + $vars = [ + "page_title" => $this->getPageTitle(), + + // @todo: Asset compiler + "stylesheet" => file_get_contents($cssFile), + "zepto" => file_get_contents($zeptoFile), + "prismJs" => file_get_contents($prismJs), + "prismCss" => file_get_contents($prismCss), + "clipboard" => file_get_contents($clipboard), + "javascript" => file_get_contents($jsFile), + + // Template paths: + "header" => $this->getResource("views/header.html.php"), + "header_outer" => $this->getResource("views/header_outer.html.php"), + "frame_list" => $this->getResource("views/frame_list.html.php"), + "frames_description" => $this->getResource("views/frames_description.html.php"), + "frames_container" => $this->getResource("views/frames_container.html.php"), + "panel_details" => $this->getResource("views/panel_details.html.php"), + "panel_details_outer" => $this->getResource("views/panel_details_outer.html.php"), + "panel_left" => $this->getResource("views/panel_left.html.php"), + "panel_left_outer" => $this->getResource("views/panel_left_outer.html.php"), + "frame_code" => $this->getResource("views/frame_code.html.php"), + "env_details" => $this->getResource("views/env_details.html.php"), + + "title" => $this->getPageTitle(), + "name" => explode("\\", $inspector->getExceptionName()), + "message" => $inspector->getExceptionMessage(), + "previousMessages" => $inspector->getPreviousExceptionMessages(), + "docref_url" => $inspector->getExceptionDocrefUrl(), + "code" => $code, + "previousCodes" => $inspector->getPreviousExceptionCodes(), + "plain_exception" => Formatter::formatExceptionPlain($inspector), + "frames" => $frames, + "has_frames" => !!count($frames), + "handler" => $this, + "handlers" => $this->getRun()->getHandlers(), + + "active_frames_tab" => count($frames) && $frames->offsetGet(0)->isApplication() ? 'application' : 'all', + "has_frames_tabs" => $this->getApplicationPaths(), + + "tables" => [ + "GET Data" => $this->masked($_GET, '_GET'), + "POST Data" => $this->masked($_POST, '_POST'), + "Files" => isset($_FILES) ? $this->masked($_FILES, '_FILES') : [], + "Cookies" => $this->masked($_COOKIE, '_COOKIE'), + "Session" => isset($_SESSION) ? $this->masked($_SESSION, '_SESSION') : [], + "Server/Request Data" => $this->masked($_SERVER, '_SERVER'), + "Environment Variables" => $this->masked($_ENV, '_ENV'), + ], + ]; + + if (isset($customCssFile)) { + $vars["stylesheet"] .= file_get_contents($customCssFile); + } + + if (isset($customJsFile)) { + $vars["javascript"] .= file_get_contents($customJsFile); + } + + // Add extra entries list of data tables: + // @todo: Consolidate addDataTable and addDataTableCallback + $extraTables = array_map(function ($table) use ($inspector) { + return $table instanceof \Closure ? $table($inspector) : $table; + }, $this->getDataTables()); + $vars["tables"] = array_merge($extraTables, $vars["tables"]); + + $plainTextHandler = new PlainTextHandler(); + $plainTextHandler->setRun($this->getRun()); + $plainTextHandler->setException($this->getException()); + $plainTextHandler->setInspector($this->getInspector()); + $vars["preface"] = ""; + + $this->templateHelper->setVariables($vars); + $this->templateHelper->render($templateFile); + + return Handler::QUIT; + } + + /** + * Get the stack trace frames of the exception currently being handled. + * + * @return \Whoops\Exception\FrameCollection + */ + protected function getExceptionFrames() + { + $frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters()); + + if ($this->getApplicationPaths()) { + foreach ($frames as $frame) { + foreach ($this->getApplicationPaths() as $path) { + if (strpos($frame->getFile(), $path) === 0) { + $frame->setApplication(true); + break; + } + } + } + } + + return $frames; + } + + /** + * Get the code of the exception currently being handled. + * + * @return string + */ + protected function getExceptionCode() + { + $exception = $this->getException(); + + $code = $exception->getCode(); + if ($exception instanceof \ErrorException) { + // ErrorExceptions wrap the php-error types within the 'severity' property + $code = Misc::translateErrorCode($exception->getSeverity()); + } + + return (string) $code; + } + + /** + * @return string + */ + public function contentType() + { + return 'text/html'; + } + + /** + * Adds an entry to the list of tables displayed in the template. + * + * The expected data is a simple associative array. Any nested arrays + * will be flattened with `print_r`. + * + * @param string $label + * + * @return static + */ + public function addDataTable($label, array $data) + { + $this->extraTables[$label] = $data; + return $this; + } + + /** + * Lazily adds an entry to the list of tables displayed in the table. + * + * The supplied callback argument will be called when the error is + * rendered, it should produce a simple associative array. Any nested + * arrays will be flattened with `print_r`. + * + * @param string $label + * @param callable $callback Callable returning an associative array + * + * @throws InvalidArgumentException If $callback is not callable + * + * @return static + */ + public function addDataTableCallback($label, /* callable */ $callback) + { + if (!is_callable($callback)) { + throw new InvalidArgumentException('Expecting callback argument to be callable'); + } + + $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { + try { + $result = call_user_func($callback, $inspector); + + // Only return the result if it can be iterated over by foreach(). + return is_array($result) || $result instanceof \Traversable ? $result : []; + } catch (\Exception $e) { + // Don't allow failure to break the rendering of the original exception. + return []; + } + }; + + return $this; + } + + /** + * Returns all the extra data tables registered with this handler. + * + * Optionally accepts a 'label' parameter, to only return the data table + * under that label. + * + * @param string|null $label + * + * @return array[]|callable + */ + public function getDataTables($label = null) + { + if ($label !== null) { + return isset($this->extraTables[$label]) ? + $this->extraTables[$label] : []; + } + + return $this->extraTables; + } + + /** + * Set whether to handle unconditionally. + * + * Allows to disable all attempts to dynamically decide whether to handle + * or return prematurely. Set this to ensure that the handler will perform, + * no matter what. + * + * @param bool|null $value + * + * @return bool|static + */ + public function handleUnconditionally($value = null) + { + if (func_num_args() == 0) { + return $this->handleUnconditionally; + } + + $this->handleUnconditionally = (bool) $value; + return $this; + } + + /** + * Adds an editor resolver. + * + * Either a string, or a closure that resolves a string, that can be used + * to open a given file in an editor. If the string contains the special + * substrings %file or %line, they will be replaced with the correct data. + * + * @example + * $run->addEditor('macvim', "mvim://open?url=file://%file&line=%line") + * @example + * $run->addEditor('remove-it', function($file, $line) { + * unlink($file); + * return "http://stackoverflow.com"; + * }); + * + * @param string $identifier + * @param string|callable $resolver + * + * @return static + */ + public function addEditor($identifier, $resolver) + { + $this->editors[$identifier] = $resolver; + return $this; + } + + /** + * Set the editor to use to open referenced files. + * + * Pass either the name of a configured editor, or a closure that directly + * resolves an editor string. + * + * @example + * $run->setEditor(function($file, $line) { return "file:///{$file}"; }); + * @example + * $run->setEditor('sublime'); + * + * @param string|callable $editor + * + * @throws InvalidArgumentException If invalid argument identifier provided + * + * @return static + */ + public function setEditor($editor) + { + if (!is_callable($editor) && !isset($this->editors[$editor])) { + throw new InvalidArgumentException( + "Unknown editor identifier: $editor. Known editors:" . + implode(",", array_keys($this->editors)) + ); + } + + $this->editor = $editor; + return $this; + } + + /** + * Get the editor href for a given file and line, if available. + * + * @param string $filePath + * @param int $line + * + * @throws InvalidArgumentException If editor resolver does not return a string + * + * @return string|bool + */ + public function getEditorHref($filePath, $line) + { + $editor = $this->getEditor($filePath, $line); + + if (empty($editor)) { + return false; + } + + // Check that the editor is a string, and replace the + // %line and %file placeholders: + if (!isset($editor['url']) || !is_string($editor['url'])) { + throw new UnexpectedValueException( + __METHOD__ . " should always resolve to a string or a valid editor array; got something else instead." + ); + } + + $editor['url'] = str_replace("%line", rawurlencode($line), $editor['url']); + $editor['url'] = str_replace("%file", rawurlencode($filePath), $editor['url']); + + return $editor['url']; + } + + /** + * Determine if the editor link should act as an Ajax request. + * + * @param string $filePath + * @param int $line + * + * @throws UnexpectedValueException If editor resolver does not return a boolean + * + * @return bool + */ + public function getEditorAjax($filePath, $line) + { + $editor = $this->getEditor($filePath, $line); + + // Check that the ajax is a bool + if (!isset($editor['ajax']) || !is_bool($editor['ajax'])) { + throw new UnexpectedValueException( + __METHOD__ . " should always resolve to a bool; got something else instead." + ); + } + return $editor['ajax']; + } + + /** + * Determines both the editor and if ajax should be used. + * + * @param string $filePath + * @param int $line + * + * @return array + */ + protected function getEditor($filePath, $line) + { + if (!$this->editor || (!is_string($this->editor) && !is_callable($this->editor))) { + return []; + } + + if (is_string($this->editor) && isset($this->editors[$this->editor]) && !is_callable($this->editors[$this->editor])) { + return [ + 'ajax' => false, + 'url' => $this->editors[$this->editor], + ]; + } + + if (is_callable($this->editor) || (isset($this->editors[$this->editor]) && is_callable($this->editors[$this->editor]))) { + if (is_callable($this->editor)) { + $callback = call_user_func($this->editor, $filePath, $line); + } else { + $callback = call_user_func($this->editors[$this->editor], $filePath, $line); + } + + if (empty($callback)) { + return []; + } + + if (is_string($callback)) { + return [ + 'ajax' => false, + 'url' => $callback, + ]; + } + + return [ + 'ajax' => isset($callback['ajax']) ? $callback['ajax'] : false, + 'url' => isset($callback['url']) ? $callback['url'] : $callback, + ]; + } + + return []; + } + + /** + * Set the page title. + * + * @param string $title + * + * @return static + */ + public function setPageTitle($title) + { + $this->pageTitle = (string) $title; + return $this; + } + + /** + * Get the page title. + * + * @return string + */ + public function getPageTitle() + { + return $this->pageTitle; + } + + /** + * Adds a path to the list of paths to be searched for resources. + * + * @param string $path + * + * @throws InvalidArgumentException If $path is not a valid directory + * + * @return static + */ + public function addResourcePath($path) + { + if (!is_dir($path)) { + throw new InvalidArgumentException( + "'$path' is not a valid directory" + ); + } + + array_unshift($this->searchPaths, $path); + return $this; + } + + /** + * Adds a custom css file to be loaded. + * + * @param string|null $name + * + * @return static + */ + public function addCustomCss($name) + { + $this->customCss = $name; + return $this; + } + + /** + * Adds a custom js file to be loaded. + * + * @param string|null $name + * + * @return static + */ + public function addCustomJs($name) + { + $this->customJs = $name; + return $this; + } + + /** + * @return array + */ + public function getResourcePaths() + { + return $this->searchPaths; + } + + /** + * Finds a resource, by its relative path, in all available search paths. + * + * The search is performed starting at the last search path, and all the + * way back to the first, enabling a cascading-type system of overrides for + * all resources. + * + * @param string $resource + * + * @throws RuntimeException If resource cannot be found in any of the available paths + * + * @return string + */ + protected function getResource($resource) + { + // If the resource was found before, we can speed things up + // by caching its absolute, resolved path: + if (isset($this->resourceCache[$resource])) { + return $this->resourceCache[$resource]; + } + + // Search through available search paths, until we find the + // resource we're after: + foreach ($this->searchPaths as $path) { + $fullPath = $path . "/$resource"; + + if (is_file($fullPath)) { + // Cache the result: + $this->resourceCache[$resource] = $fullPath; + return $fullPath; + } + } + + // If we got this far, nothing was found. + throw new RuntimeException( + "Could not find resource '$resource' in any resource paths." + . "(searched: " . join(", ", $this->searchPaths). ")" + ); + } + + /** + * @deprecated + * + * @return string + */ + public function getResourcesPath() + { + $allPaths = $this->getResourcePaths(); + + // Compat: return only the first path added + return end($allPaths) ?: null; + } + + /** + * @deprecated + * + * @param string $resourcesPath + * + * @return static + */ + public function setResourcesPath($resourcesPath) + { + $this->addResourcePath($resourcesPath); + return $this; + } + + /** + * Return the application paths. + * + * @return array + */ + public function getApplicationPaths() + { + return $this->applicationPaths; + } + + /** + * Set the application paths. + * + * @return void + */ + public function setApplicationPaths(array $applicationPaths) + { + $this->applicationPaths = $applicationPaths; + } + + /** + * Set the application root path. + * + * @param string $applicationRootPath + * + * @return void + */ + public function setApplicationRootPath($applicationRootPath) + { + $this->templateHelper->setApplicationRootPath($applicationRootPath); + } + + /** + * blacklist a sensitive value within one of the superglobal arrays. + * Alias for the hideSuperglobalKey method. + * + * @param string $superGlobalName The name of the superglobal array, e.g. '_GET' + * @param string $key The key within the superglobal + * @see hideSuperglobalKey + * + * @return static + */ + public function blacklist($superGlobalName, $key) + { + $this->blacklist[$superGlobalName][] = $key; + return $this; + } + + /** + * Hide a sensitive value within one of the superglobal arrays. + * + * @param string $superGlobalName The name of the superglobal array, e.g. '_GET' + * @param string $key The key within the superglobal + * @return static + */ + public function hideSuperglobalKey($superGlobalName, $key) + { + return $this->blacklist($superGlobalName, $key); + } + + /** + * Checks all values within the given superGlobal array. + * + * Blacklisted values will be replaced by a equal length string containing + * only '*' characters for string values. + * Non-string values will be replaced with a fixed asterisk count. + * We intentionally dont rely on $GLOBALS as it depends on the 'auto_globals_jit' php.ini setting. + * + * @param array|\ArrayAccess $superGlobal One of the superglobal arrays + * @param string $superGlobalName The name of the superglobal array, e.g. '_GET' + * + * @return array $values without sensitive data + */ + private function masked($superGlobal, $superGlobalName) + { + $blacklisted = $this->blacklist[$superGlobalName]; + + $values = $superGlobal; + + foreach ($blacklisted as $key) { + if (isset($superGlobal[$key])) { + $values[$key] = str_repeat('*', is_string($superGlobal[$key]) ? strlen($superGlobal[$key]) : 3); + } + } + + return $values; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php b/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php new file mode 100644 index 0000000..dcfd551 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php @@ -0,0 +1,108 @@ + + */ + +namespace Whoops\Handler; + +use SimpleXMLElement; +use Whoops\Exception\Formatter; + +/** + * Catches an exception and converts it to an XML + * response. Additionally can also return exception + * frames for consumption by an API. + */ +class XmlResponseHandler extends Handler +{ + /** + * @var bool + */ + private $returnFrames = false; + + /** + * @param bool|null $returnFrames + * @return bool|static + */ + public function addTraceToOutput($returnFrames = null) + { + if (func_num_args() == 0) { + return $this->returnFrames; + } + + $this->returnFrames = (bool) $returnFrames; + return $this; + } + + /** + * @return int + */ + public function handle() + { + $response = [ + 'error' => Formatter::formatExceptionAsDataArray( + $this->getInspector(), + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() + ), + ]; + + echo self::toXml($response); + + return Handler::QUIT; + } + + /** + * @return string + */ + public function contentType() + { + return 'application/xml'; + } + + /** + * @param SimpleXMLElement $node Node to append data to, will be modified in place + * @param array|\Traversable $data + * @return SimpleXMLElement The modified node, for chaining + */ + private static function addDataToNode(\SimpleXMLElement $node, $data) + { + assert(is_array($data) || $data instanceof Traversable); + + foreach ($data as $key => $value) { + if (is_numeric($key)) { + // Convert the key to a valid string + $key = "unknownNode_". (string) $key; + } + + // Delete any char not allowed in XML element names + $key = preg_replace('/[^a-z0-9\-\_\.\:]/i', '', $key); + + if (is_array($value)) { + $child = $node->addChild($key); + self::addDataToNode($child, $value); + } else { + $value = str_replace('&', '&', print_r($value, true)); + $node->addChild($key, $value); + } + } + + return $node; + } + + /** + * The main function for converting to an XML document. + * + * @param array|\Traversable $data + * @return string XML + */ + private static function toXml($data) + { + assert(is_array($data) || $data instanceof Traversable); + + $node = simplexml_load_string(""); + + return self::addDataToNode($node, $data)->asXML(); + } +} diff --git a/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php b/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php new file mode 100644 index 0000000..ee19898 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php @@ -0,0 +1,21 @@ + + */ + +namespace Whoops\Inspector; + +use Whoops\Exception\Inspector; + +class InspectorFactory implements InspectorFactoryInterface +{ + /** + * @param \Throwable $exception + * @return InspectorInterface + */ + public function create($exception) + { + return new Inspector($exception, $this); + } +} diff --git a/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php b/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php new file mode 100644 index 0000000..e3907cf --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php @@ -0,0 +1,16 @@ + + */ + +namespace Whoops\Inspector; + +interface InspectorFactoryInterface +{ + /** + * @param \Throwable $exception + * @return InspectorInterface + */ + public function create($exception); +} diff --git a/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php b/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php new file mode 100644 index 0000000..6893517 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php @@ -0,0 +1,71 @@ + + */ + +namespace Whoops\Inspector; + +interface InspectorInterface +{ + /** + * @return \Throwable + */ + public function getException(); + + /** + * @return string + */ + public function getExceptionName(); + + /** + * @return string + */ + public function getExceptionMessage(); + + /** + * @return string[] + */ + public function getPreviousExceptionMessages(); + + /** + * @return int[] + */ + public function getPreviousExceptionCodes(); + + /** + * Returns a url to the php-manual related to the underlying error - when available. + * + * @return string|null + */ + public function getExceptionDocrefUrl(); + + /** + * Does the wrapped Exception has a previous Exception? + * @return bool + */ + public function hasPreviousException(); + + /** + * Returns an Inspector for a previous Exception, if any. + * @todo Clean this up a bit, cache stuff a bit better. + * @return InspectorInterface + */ + public function getPreviousExceptionInspector(); + + /** + * Returns an array of all previous exceptions for this inspector's exception + * @return \Throwable[] + */ + public function getPreviousExceptions(); + + /** + * Returns an iterator for the inspected exception's + * frames. + * + * @param array $frameFilters + * + * @return \Whoops\Exception\FrameCollection + */ + public function getFrames(array $frameFilters = []); +} diff --git a/vendor/filp/whoops/src/Whoops/Resources/css/prism.css b/vendor/filp/whoops/src/Whoops/Resources/css/prism.css new file mode 100644 index 0000000..a03db53 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/css/prism.css @@ -0,0 +1,5 @@ +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+markup-templating+php&plugins=line-highlight+line-numbers */ +code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green} +pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)} +pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right} diff --git a/vendor/filp/whoops/src/Whoops/Resources/css/whoops.base.css b/vendor/filp/whoops/src/Whoops/Resources/css/whoops.base.css new file mode 100644 index 0000000..edd5cd8 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/css/whoops.base.css @@ -0,0 +1,560 @@ +body { + font: 12px "Helvetica Neue", helvetica, arial, sans-serif; + color: #131313; + background: #eeeeee; + padding:0; + margin: 0; + max-height: 100%; + + text-rendering: optimizeLegibility; +} + a { + text-decoration: none; + } + +.Whoops.container { + position: relative; + z-index: 9999999999; +} + +.panel { + overflow-y: scroll; + height: 100%; + position: fixed; + margin: 0; + left: 0; + top: 0; +} + +.branding { + position: absolute; + top: 10px; + right: 20px; + color: #777777; + font-size: 10px; + z-index: 100; +} + .branding a { + color: #e95353; + } + +header { + color: white; + box-sizing: border-box; + background-color: #2a2a2a; + padding: 35px 40px; + max-height: 180px; + overflow: hidden; + transition: 0.5s; +} + + header.header-expand { + max-height: 1000px; + } + + .exc-title { + margin: 0; + color: #bebebe; + font-size: 14px; + } + .exc-title-primary, .exc-title-secondary { + color: #e95353; + } + + .exc-message { + font-size: 20px; + word-wrap: break-word; + margin: 4px 0 0 0; + color: white; + } + .exc-message span { + display: block; + } + .exc-message-empty-notice { + color: #a29d9d; + font-weight: 300; + } + +.prev-exc-title { + margin: 10px 0; +} + +.prev-exc-title + ul { + margin: 0; + padding: 0 0 0 20px; + line-height: 12px; +} + +.prev-exc-title + ul li { + font: 12px "Helvetica Neue", helvetica, arial, sans-serif; +} + +.prev-exc-title + ul li .prev-exc-code { + display: inline-block; + color: #bebebe; +} + +.details-container { + left: 30%; + width: 70%; + background: #fafafa; +} + .details { + padding: 5px; + } + + .details-heading { + color: #4288CE; + font-weight: 300; + padding-bottom: 10px; + margin-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, .1); + } + + .details pre.sf-dump { + white-space: pre; + word-wrap: inherit; + } + + .details pre.sf-dump, + .details pre.sf-dump .sf-dump-num, + .details pre.sf-dump .sf-dump-const, + .details pre.sf-dump .sf-dump-str, + .details pre.sf-dump .sf-dump-note, + .details pre.sf-dump .sf-dump-ref, + .details pre.sf-dump .sf-dump-public, + .details pre.sf-dump .sf-dump-protected, + .details pre.sf-dump .sf-dump-private, + .details pre.sf-dump .sf-dump-meta, + .details pre.sf-dump .sf-dump-key, + .details pre.sf-dump .sf-dump-index { + color: #463C54; + } + +.left-panel { + width: 30%; + background: #ded8d8; +} + + .frames-description { + background: rgba(0, 0, 0, .05); + padding: 8px 15px; + color: #a29d9d; + font-size: 11px; + } + + .frames-description.frames-description-application { + text-align: center; + font-size: 12px; + } + .frames-container.frames-container-application .frame:not(.frame-application) { + display: none; + } + + .frames-tab { + color: #a29d9d; + display: inline-block; + padding: 4px 8px; + margin: 0 2px; + border-radius: 3px; + } + + .frames-tab.frames-tab-active { + background-color: #2a2a2a; + color: #bebebe; + } + + .frame { + padding: 14px; + cursor: pointer; + transition: all 0.1s ease; + background: #eeeeee; + } + .frame:not(:last-child) { + border-bottom: 1px solid rgba(0, 0, 0, .05); + } + + .frame.active { + box-shadow: inset -5px 0 0 0 #4288CE; + color: #4288CE; + } + + .frame:not(.active):hover { + background: #BEE9EA; + } + + .frame-method-info { + margin-bottom: 10px; + } + + .frame-class, .frame-function, .frame-index { + font-size: 14px; + } + + .frame-index { + float: left; + } + + .frame-method-info { + margin-left: 24px; + } + + .frame-index { + font-size: 11px; + color: #a29d9d; + background-color: rgba(0, 0, 0, .05); + height: 18px; + width: 18px; + line-height: 18px; + border-radius: 5px; + padding: 0 1px 0 1px; + text-align: center; + display: inline-block; + } + + .frame-application .frame-index { + background-color: #2a2a2a; + color: #bebebe; + } + + .frame-file { + font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace; + color: #a29d9d; + } + + .frame-file .editor-link { + color: #a29d9d; + } + + .frame-line { + font-weight: bold; + } + + .frame-line:before { + content: ":"; + } + + .frame-code { + padding: 5px; + background: #303030; + display: none; + } + + .frame-code.active { + display: block; + } + + .frame-code .frame-file { + color: #a29d9d; + padding: 12px 6px; + + border-bottom: none; + } + + .code-block { + padding: 10px; + margin: 0; + border-radius: 6px; + box-shadow: 0 3px 0 rgba(0, 0, 0, .05), + 0 10px 30px rgba(0, 0, 0, .05), + inset 0 0 1px 0 rgba(255, 255, 255, .07); + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + } + + .linenums { + margin: 0; + margin-left: 10px; + } + + .frame-comments { + border-top: none; + margin-top: 15px; + + font-size: 12px; + } + + .frame-comments.empty { + } + + .frame-comments.empty:before { + content: "No comments for this stack frame."; + font-weight: 300; + color: #a29d9d; + } + + .frame-comment { + padding: 10px; + color: #e3e3e3; + border-radius: 6px; + background-color: rgba(255, 255, 255, .05); + } + + .frame-comment a { + font-weight: bold; + text-decoration: underline; + color: #c6c6c6; + } + + .frame-comment:not(:last-child) { + border-bottom: 1px dotted rgba(0, 0, 0, .3); + } + + .frame-comment-context { + font-size: 10px; + color: white; + } + +.delimiter { + display: inline-block; +} + +.data-table-container label { + font-size: 16px; + color: #303030; + font-weight: bold; + margin: 10px 0; + + display: block; + + margin-bottom: 5px; + padding-bottom: 5px; +} + .data-table { + width: 100%; + margin-bottom: 10px; + } + + .data-table tbody { + font: 13px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace; + } + + .data-table thead { + display: none; + } + + .data-table tr { + padding: 5px 0; + } + + .data-table td:first-child { + width: 20%; + min-width: 130px; + overflow: hidden; + font-weight: bold; + color: #463C54; + padding-right: 5px; + + } + + .data-table td:last-child { + width: 80%; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; + } + + .data-table span.empty { + color: rgba(0, 0, 0, .3); + font-weight: 300; + } + .data-table label.empty { + display: inline; + } + +.handler { + padding: 4px 0; + font: 14px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace; +} + +#plain-exception { + display: none; +} + +.rightButton { + cursor: pointer; + border: 0; + opacity: .8; + background: none; + + color: rgba(255, 255, 255, 0.1); + box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1); + + border-radius: 3px; + + outline: none !important; +} + + .rightButton:hover { + box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3); + color: rgba(255, 255, 255, 0.3); + } + +/* inspired by githubs kbd styles */ +kbd { + -moz-border-bottom-colors: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + background-color: #fcfcfc; + border-color: #ccc #ccc #bbb; + border-image: none; + border-style: solid; + border-width: 1px; + color: #555; + display: inline-block; + font-size: 11px; + line-height: 10px; + padding: 3px 5px; + vertical-align: middle; +} + + +/* == Media queries */ + +/* Expand the spacing in the details section */ +@media (min-width: 1000px) { + .details, .frame-code { + padding: 20px 40px; + } + + .details-container { + left: 32%; + width: 68%; + } + + .frames-container { + margin: 5px; + } + + .left-panel { + width: 32%; + } +} + +/* Stack panels */ +@media (max-width: 600px) { + .panel { + position: static; + width: 100%; + } +} + +/* Stack details tables */ +@media (max-width: 400px) { + .data-table, + .data-table tbody, + .data-table tbody tr, + .data-table tbody td { + display: block; + width: 100%; + } + + .data-table tbody tr:first-child { + padding-top: 0; + } + + .data-table tbody td:first-child, + .data-table tbody td:last-child { + padding-left: 0; + padding-right: 0; + } + + .data-table tbody td:last-child { + padding-top: 3px; + } +} + +.tooltipped { + position: relative +} +.tooltipped:after { + position: absolute; + z-index: 1000000; + display: none; + padding: 5px 8px; + color: #fff; + text-align: center; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-wrap: break-word; + white-space: pre; + pointer-events: none; + content: attr(aria-label); + background: rgba(0, 0, 0, 0.8); + border-radius: 3px; + -webkit-font-smoothing: subpixel-antialiased +} +.tooltipped:before { + position: absolute; + z-index: 1000001; + display: none; + width: 0; + height: 0; + color: rgba(0, 0, 0, 0.8); + pointer-events: none; + content: ""; + border: 5px solid transparent +} +.tooltipped:hover:before, +.tooltipped:hover:after, +.tooltipped:active:before, +.tooltipped:active:after, +.tooltipped:focus:before, +.tooltipped:focus:after { + display: inline-block; + text-decoration: none +} +.tooltipped-s:after { + top: 100%; + right: 50%; + margin-top: 5px +} +.tooltipped-s:before { + top: auto; + right: 50%; + bottom: -5px; + margin-right: -5px; + border-bottom-color: rgba(0, 0, 0, 0.8) +} + +pre.sf-dump { + padding: 0px !important; + margin: 0px !important; +} + +.search-for-help { + width: 85%; + padding: 0; + margin: 10px 0; + list-style-type: none; + display: inline-block; +} + .search-for-help li { + display: inline-block; + margin-right: 5px; + } + .search-for-help li:last-child { + margin-right: 0; + } + .search-for-help li a { + + } + .search-for-help li a i { + width: 16px; + height: 16px; + overflow: hidden; + display: block; + } + .search-for-help li a svg { + fill: #fff; + } + .search-for-help li a svg path { + background-size: contain; + } diff --git a/vendor/filp/whoops/src/Whoops/Resources/js/clipboard.min.js b/vendor/filp/whoops/src/Whoops/Resources/js/clipboard.min.js new file mode 100644 index 0000000..36a75a4 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/js/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v1.5.3 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;ar;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],o=[];if(r&&e)for(var i=0,a=r.length;a>i;i++)r[i].fn!==e&&r[i].fn._!==e&&o.push(r[i]);return o.length?n[t]=o:delete n[t],this}},e.exports=r},{}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var i=function(){function t(t,e){for(var n=0;n=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; +!function(e){function n(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,a,r,o){if(t.language===a){var c=t.tokenStack=[];t.code=t.code.replace(r,(function(e){if("function"==typeof o&&!o(e))return e;for(var r,i=c.length;-1!==t.code.indexOf(r=n(a,i));)++i;return c[i]=e,r})),t.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(t,a){if(t.language===a&&t.tokenStack){t.grammar=e.languages[a];var r=0,o=Object.keys(t.tokenStack);!function c(i){for(var u=0;u=o.length);u++){var g=i[u];if("string"==typeof g||g.content&&"string"==typeof g.content){var l=o[r],s=t.tokenStack[l],f="string"==typeof g?g:g.content,p=n(a,l),k=f.indexOf(p);if(k>-1){++r;var m=f.substring(0,k),d=new e.Token(a,e.tokenize(s,t.grammar),"language-"+a,s),h=f.substring(k+p.length),v=[];m&&v.push.apply(v,c([m])),v.push(d),h&&v.push.apply(v,c([h])),"string"==typeof g?i.splice.apply(i,[u,1].concat(v)):g.content=v}}else g.content&&c(g.content)}return i}(t.tokens)}}}})}(Prism); +!function(e){var a=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:a,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];e.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:a,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(a){/<\?/.test(a.code)&&e.languages["markup-templating"].buildPlaceholders(a,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"php")}))}(Prism); +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",i="linkable-line-numbers",n=/\n(?!$)/g,r=!0;Prism.plugins.lineHighlight={highlightLines:function(o,u,c){var h=(u="string"==typeof u?u:o.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),d=+o.getAttribute("data-line-offset")||0,f=(function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML=" 
 ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}()?parseInt:parseFloat)(getComputedStyle(o).lineHeight),p=Prism.util.isActive(o,t),g=o.querySelector("code"),m=p?o:g||o,v=[],y=g.textContent.match(n),b=y?y.length+1:1,A=g&&m!=g?function(e,t){var i=getComputedStyle(e),n=getComputedStyle(t);function r(e){return+e.substr(0,e.length-2)}return t.offsetTop+r(n.borderTopWidth)+r(n.paddingTop)-r(i.paddingTop)}(o,g):0;h.forEach((function(e){var t=e.split("-"),i=+t[0],n=+t[1]||i;if(!((n=Math.min(b+d,n))i&&r.setAttribute("data-end",String(n)),r.style.top=(i-d-1)*f+A+"px",r.textContent=new Array(n-i+2).join(" \n")}));v.push((function(){r.style.width=o.scrollWidth+"px"})),v.push((function(){m.appendChild(r)}))}}));var P=o.id;if(p&&Prism.util.isActive(o,i)&&P){l(o,i)||v.push((function(){o.classList.add(i)}));var E=parseInt(o.getAttribute("data-start")||"1");s(".line-numbers-rows > span",o).forEach((function(e,t){var i=t+E;e.onclick=function(){var e=P+"."+i;r=!1,location.hash=e,setTimeout((function(){r=!0}),1)}}))}return function(){v.forEach(a)}}};var o=0;Prism.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var i=0;s(".line-highlight",t).forEach((function(e){i+=e.textContent.length,e.parentNode.removeChild(e)})),i&&/^(?: \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}})),Prism.hooks.add("complete",(function e(i){var n=i.element.parentElement;if(u(n)){clearTimeout(o);var r=Prism.plugins.lineNumbers,s=i.plugins&&i.plugins.lineNumbers;l(n,t)&&r&&!s?Prism.hooks.add("line-numbers",e):(Prism.plugins.lineHighlight.highlightLines(n)(),o=setTimeout(c,1))}})),window.addEventListener("hashchange",c),window.addEventListener("resize",(function(){s("pre").filter(u).map((function(e){return Prism.plugins.lineHighlight.highlightLines(e)})).forEach(a)}))}function s(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function l(e,t){return e.classList.contains(t)}function a(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&Prism.util.isActive(e,i)))}function c(){var e=location.hash.slice(1);s(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var i=e.slice(0,e.lastIndexOf(".")),n=document.getElementById(i);n&&(n.hasAttribute("data-line")||n.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(n,t,"temporary ")(),r&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(); +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e="line-numbers",n=/\n(?!$)/g,t=Prism.plugins.lineNumbers={getLine:function(n,t){if("PRE"===n.tagName&&n.classList.contains(e)){var i=n.querySelector(".line-numbers-rows");if(i){var r=parseInt(n.getAttribute("data-start"),10)||1,s=r+(i.children.length-1);ts&&(t=s);var l=t-r;return i.children[l]}}},resize:function(e){r([e])},assumeViewportIndependence:!0},i=void 0;window.addEventListener("resize",(function(){t.assumeViewportIndependence&&i===window.innerWidth||(i=window.innerWidth,r(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers"))))})),Prism.hooks.add("complete",(function(t){if(t.code){var i=t.element,s=i.parentNode;if(s&&/pre/i.test(s.nodeName)&&!i.querySelector(".line-numbers-rows")&&Prism.util.isActive(i,e)){i.classList.remove(e),s.classList.add(e);var l,o=t.code.match(n),a=o?o.length+1:1,u=new Array(a+1).join("");(l=document.createElement("span")).setAttribute("aria-hidden","true"),l.className="line-numbers-rows",l.innerHTML=u,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),t.element.appendChild(l),r([s]),Prism.hooks.run("line-numbers",t)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function r(e){if(0!=(e=e.filter((function(e){var n,t=(n=e,n?window.getComputedStyle?getComputedStyle(n):n.currentStyle||null:null)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var t=e.map((function(e){var t=e.querySelector("code"),i=e.querySelector(".line-numbers-rows");if(t&&i){var r=e.querySelector(".line-numbers-sizer"),s=t.textContent.split(n);r||((r=document.createElement("span")).className="line-numbers-sizer",t.appendChild(r)),r.innerHTML="0",r.style.display="block";var l=r.getBoundingClientRect().height;return r.innerHTML="",{element:e,lines:s,lineHeights:[],oneLinerHeight:l,sizer:r}}})).filter(Boolean);t.forEach((function(e){var n=e.sizer,t=e.lines,i=e.lineHeights,r=e.oneLinerHeight;i[t.length-1]=void 0,t.forEach((function(e,t){if(e&&e.length>1){var s=n.appendChild(document.createElement("span"));s.style.display="block",s.textContent=e}else i[t]=r}))})),t.forEach((function(e){for(var n=e.sizer,t=e.lineHeights,i=0,r=0;r= 145) { + $header.addClass('header-expand'); + } + }); + $header.on('mouseleave', function () { + $header.removeClass('header-expand'); + }); + + /* + * add prettyprint classes to our current active codeblock + * run prettyPrint() to highlight the active code + * scroll to the line when prettyprint is done + * highlight the current line + */ + var renderCurrentCodeblock = function(id) { + Prism.highlightAllUnder(document.querySelector('.frame-code-container .frame-code.active')); + highlightCurrentLine(); + } + + /* + * Highlight the active and neighboring lines for the current frame + * Adjust the offset to make sure that line is veritcally centered + */ + + var highlightCurrentLine = function() { + // We show more code than needed, purely for proper syntax highlighting + // Let’s hide a big chunk of that code and then scroll the remaining block + $activeFrame.find('.code-block').first().css({ + maxHeight: 345, + overflow: 'hidden', + }); + + var line = $activeFrame.find('.code-block .line-highlight').first()[0]; + line.scrollIntoView(); + line.parentElement.scrollTop -= 180; + + $container.scrollTop(0); + } + + /* + * click handler for loading codeblocks + */ + + $frameContainer.on('click', '.frame', function() { + + var $this = $(this); + var id = /frame\-line\-([\d]*)/.exec($this.attr('id'))[1]; + var $codeFrame = $('#frame-code-' + id); + + if ($codeFrame) { + + $activeLine.removeClass('active'); + $activeFrame.removeClass('active'); + + $this.addClass('active'); + $codeFrame.addClass('active'); + + $activeLine = $this; + $activeFrame = $codeFrame; + + renderCurrentCodeblock(id); + + } + + }); + + var clipboard = new Clipboard('.clipboard'); + var showTooltip = function(elem, msg) { + elem.classList.add('tooltipped', 'tooltipped-s'); + elem.setAttribute('aria-label', msg); + }; + + clipboard.on('success', function(e) { + e.clearSelection(); + + showTooltip(e.trigger, 'Copied!'); + }); + + clipboard.on('error', function(e) { + showTooltip(e.trigger, fallbackMessage(e.action)); + }); + + var btn = document.querySelector('.clipboard'); + + btn.addEventListener('mouseleave', function(e) { + e.currentTarget.classList.remove('tooltipped', 'tooltipped-s'); + e.currentTarget.removeAttribute('aria-label'); + }); + + function fallbackMessage(action) { + var actionMsg = ''; + var actionKey = (action === 'cut' ? 'X' : 'C'); + + if (/Mac/i.test(navigator.userAgent)) { + actionMsg = 'Press ⌘-' + actionKey + ' to ' + action; + } else { + actionMsg = 'Press Ctrl-' + actionKey + ' to ' + action; + } + + return actionMsg; + } + + function scrollIntoView($node, $parent) { + var nodeOffset = $node.offset(); + var nodeTop = nodeOffset.top; + var nodeBottom = nodeTop + nodeOffset.height; + var parentScrollTop = $parent.scrollTop(); + var parentHeight = $parent.height(); + + if (nodeTop < 0) { + $parent.scrollTop(parentScrollTop + nodeTop); + } else if (nodeBottom > parentHeight) { + $parent.scrollTop(parentScrollTop + nodeBottom - parentHeight); + } + } + + $(document).on('keydown', function(e) { + var applicationFrames = $frameContainer.hasClass('frames-container-application'), + frameClass = applicationFrames ? '.frame.frame-application' : '.frame'; + + if(e.ctrlKey || e.which === 74 || e.which === 75) { + // CTRL+Arrow-UP/k and Arrow-Down/j support: + // 1) select the next/prev element + // 2) make sure the newly selected element is within the view-scope + // 3) focus the (right) container, so arrow-up/down (without ctrl) scroll the details + if (e.which === 38 /* arrow up */ || e.which === 75 /* k */) { + $activeLine.prev(frameClass).click(); + scrollIntoView($activeLine, $leftPanel); + $container.focus(); + e.preventDefault(); + } else if (e.which === 40 /* arrow down */ || e.which === 74 /* j */) { + $activeLine.next(frameClass).click(); + scrollIntoView($activeLine, $leftPanel); + $container.focus(); + e.preventDefault(); + } + } else if (e.which == 78 /* n */) { + if ($appFramesTab.length) { + setActiveFramesTab($('.frames-tab:not(.frames-tab-active)')); + } + } + }); + + // Avoid to quit the page with some protocol (e.g. IntelliJ Platform REST API) + $ajaxEditors.on('click', function(e){ + e.preventDefault(); + $.get(this.href); + }); + + // Symfony VarDumper: Close the by default expanded objects + $('.sf-dump-expanded') + .removeClass('sf-dump-expanded') + .addClass('sf-dump-compact'); + $('.sf-dump-toggle span').html('▶'); + + // Make the given frames-tab active + function setActiveFramesTab($tab) { + $tab.addClass('frames-tab-active'); + + if ($tab.attr('id') == 'application-frames-tab') { + $frameContainer.addClass('frames-container-application'); + $allFramesTab.removeClass('frames-tab-active'); + } else { + $frameContainer.removeClass('frames-container-application'); + $appFramesTab.removeClass('frames-tab-active'); + } + } + + $('a.frames-tab').on('click', function(e) { + e.preventDefault(); + setActiveFramesTab($(this)); + }); + + // Render late enough for highlightCurrentLine to be ready + renderCurrentCodeblock(); +}); diff --git a/vendor/filp/whoops/src/Whoops/Resources/js/zepto.min.js b/vendor/filp/whoops/src/Whoops/Resources/js/zepto.min.js new file mode 100644 index 0000000..0b2f97a --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/js/zepto.min.js @@ -0,0 +1,2 @@ +/* Zepto v1.1.3 - zepto event ajax form ie - zeptojs.com/license */ +var Zepto=function(){function L(t){return null==t?String(t):j[T.call(t)]||"object"}function Z(t){return"function"==L(t)}function $(t){return null!=t&&t==t.window}function _(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function D(t){return"object"==L(t)}function R(t){return D(t)&&!$(t)&&Object.getPrototypeOf(t)==Object.prototype}function M(t){return"number"==typeof t.length}function k(t){return s.call(t,function(t){return null!=t})}function z(t){return t.length>0?n.fn.concat.apply([],t):t}function F(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function q(t){return t in f?f[t]:f[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function H(t,e){return"number"!=typeof e||c[F(t)]?e:e+"px"}function I(t){var e,n;return u[t]||(e=a.createElement(t),a.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),u[t]=n),u[t]}function V(t){return"children"in t?o.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function U(n,i,r){for(e in i)r&&(R(i[e])||A(i[e]))?(R(i[e])&&!R(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),U(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function B(t,e){return null==e?n(t):n(t).filter(e)}function J(t,e,n,i){return Z(e)?e.call(t,n,i):e}function X(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function W(e,n){var i=e.className,r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function Y(t){var e;try{return t?"true"==t||("false"==t?!1:"null"==t?null:/^0/.test(t)||isNaN(e=Number(t))?/^[\[\{]/.test(t)?n.parseJSON(t):t:e):t}catch(i){return t}}function G(t,e){e(t);for(var n in t.childNodes)G(t.childNodes[n],e)}var t,e,n,i,C,N,r=[],o=r.slice,s=r.filter,a=window.document,u={},f={},c={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,h=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,p=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,d=/^(?:body|html)$/i,m=/([A-Z])/g,g=["val","css","html","text","data","width","height","offset"],v=["after","prepend","before","append"],y=a.createElement("table"),x=a.createElement("tr"),b={tr:a.createElement("tbody"),tbody:y,thead:y,tfoot:y,td:x,th:x,"*":a.createElement("div")},w=/complete|loaded|interactive/,E=/^[\w-]*$/,j={},T=j.toString,S={},O=a.createElement("div"),P={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},A=Array.isArray||function(t){return t instanceof Array};return S.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~S.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},S.fragment=function(e,i,r){var s,u,f;return h.test(e)&&(s=n(a.createElement(RegExp.$1))),s||(e.replace&&(e=e.replace(p,"<$1>")),i===t&&(i=l.test(e)&&RegExp.$1),i in b||(i="*"),f=b[i],f.innerHTML=""+e,s=n.each(o.call(f.childNodes),function(){f.removeChild(this)})),R(r)&&(u=n(s),n.each(r,function(t,e){g.indexOf(t)>-1?u[t](e):u.attr(t,e)})),s},S.Z=function(t,e){return t=t||[],t.__proto__=n.fn,t.selector=e||"",t},S.isZ=function(t){return t instanceof S.Z},S.init=function(e,i){var r;if(!e)return S.Z();if("string"==typeof e)if(e=e.trim(),"<"==e[0]&&l.test(e))r=S.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=S.qsa(a,e)}else{if(Z(e))return n(a).ready(e);if(S.isZ(e))return e;if(A(e))r=k(e);else if(D(e))r=[e],e=null;else if(l.test(e))r=S.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=S.qsa(a,e)}}return S.Z(r,e)},n=function(t,e){return S.init(t,e)},n.extend=function(t){var e,n=o.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){U(t,n,e)}),t},S.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],s=i||r?e.slice(1):e,a=E.test(s);return _(t)&&a&&i?(n=t.getElementById(s))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:o.call(a&&!i?r?t.getElementsByClassName(s):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=function(t,e){return t!==e&&t.contains(e)},n.type=L,n.isFunction=Z,n.isWindow=$,n.isArray=A,n.isPlainObject=R,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=C,n.trim=function(t){return null==t?"":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.map=function(t,e){var n,r,o,i=[];if(M(t))for(r=0;r=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return Z(t)?this.not(this.not(t)):n(s.call(this,function(e){return S.matches(e,t)}))},add:function(t,e){return n(N(this.concat(n(t,e))))},is:function(t){return this.length>0&&S.matches(this[0],t)},not:function(e){var i=[];if(Z(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r="string"==typeof e?this.filter(e):M(e)&&Z(e.item)?o.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return D(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!D(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!D(t)?t:n(t)},find:function(t){var e,i=this;return e="object"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(S.qsa(this[0],t)):this.map(function(){return S.qsa(this,t)})},closest:function(t,e){var i=this[0],r=!1;for("object"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:S.matches(i,t));)i=i!==e&&!_(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!_(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return B(e,t)},parent:function(t){return B(N(this.pluck("parentNode")),t)},children:function(t){return B(this.map(function(){return V(this)}),t)},contents:function(){return this.map(function(){return o.call(this.childNodes)})},siblings:function(t){return B(this.map(function(t,e){return s.call(V(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=Z(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=Z(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?"none"==i.css("display"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return n(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0===arguments.length?this.length>0?this[0].innerHTML:null:this.each(function(e){var i=this.innerHTML;n(this).empty().append(J(this,t,e,i))})},text:function(e){return 0===arguments.length?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=e===t?"":""+e})},attr:function(n,i){var r;return"string"==typeof n&&i===t?0==this.length||1!==this[0].nodeType?t:"value"==n&&"INPUT"==this[0].nodeName?this.val():!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:this.each(function(t){if(1===this.nodeType)if(D(n))for(e in n)X(this,e,n[e]);else X(this,n,J(this,i,t,this.getAttribute(n)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&X(this,t)})},prop:function(e,n){return e=P[e]||e,n===t?this[0]&&this[0][e]:this.each(function(t){this[e]=J(this,n,t,this[e])})},data:function(e,n){var i=this.attr("data-"+e.replace(m,"-$1").toLowerCase(),n);return null!==i?Y(i):t},val:function(t){return 0===arguments.length?this[0]&&(this[0].multiple?n(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(e){this.value=J(this,t,e,this.value)})},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=J(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(0==this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r=this[0],o=getComputedStyle(r,"");if(!r)return;if("string"==typeof t)return r.style[C(t)]||o.getPropertyValue(t);if(A(t)){var s={};return n.each(A(t)?t:[t],function(t,e){s[e]=r.style[C(e)]||o.getPropertyValue(e)}),s}}var a="";if("string"==L(t))i||0===i?a=F(t)+":"+H(t,i):this.each(function(){this.style.removeProperty(F(t))});else for(e in t)t[e]||0===t[e]?a+=F(e)+":"+H(e,t[e])+";":this.each(function(){this.style.removeProperty(F(e))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(W(t))},q(t)):!1},addClass:function(t){return t?this.each(function(e){i=[];var r=W(this),o=J(this,t,e,r);o.split(/\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&W(this,r+(r?" ":"")+i.join(" "))}):this},removeClass:function(e){return this.each(function(n){return e===t?W(this,""):(i=W(this),J(this,e,n,i).split(/\s+/g).forEach(function(t){i=i.replace(q(t)," ")}),void W(this,i.trim()))})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=J(this,e,r,W(this));s.split(/\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=d.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css("margin-top"))||0,i.left-=parseFloat(n(t).css("margin-left"))||0,r.top+=parseFloat(n(e[0]).css("border-top-width"))||0,r.left+=parseFloat(n(e[0]).css("border-left-width"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||a.body;t&&!d.test(t.nodeName)&&"static"==n(t).css("position");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,["width","height"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?$(s)?s["inner"+i]:_(s)?s.documentElement["scroll"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,J(this,r,t,s[e]()))})}}),v.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=L(e),"object"==t||"array"==t||null==e?e:S.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,a){o=i?a:a.parentNode,a=0==e?a.nextSibling:1==e?a.firstChild:2==e?a:null,r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();G(o.insertBefore(t,a),function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+"To":"insert"+(e?"Before":"After")]=function(e){return n(e)[t](this),this}}),S.Z.prototype=n.fn,S.uniq=N,S.deserializeValue=Y,n.zepto=S,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function d(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\s/).forEach(function(i){if("ready"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=j(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),"addEventListener"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||"").split(/\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],"removeEventListener"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function j(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=x,r&&r.apply(i,arguments)},e[n]=b}),(i.defaultPrevented!==n?i.defaultPrevented:"returnValue"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=x)),e}function T(t){var e,i={originalEvent:t};for(e in t)w.test(e)||t[e]===n||(i[e]=t[e]);return j(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return"string"==typeof t},s={},a={},u="onfocusin"in window,f={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){if(r(e)){var i=function(){return e.apply(n,arguments)};return i._zid=l(e),i}if(o(n))return t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var x=function(){return!0},b=function(){return!1},w=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(r(a)||a===!1)&&(u=a,a=n),u===!1&&(u=b),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(T(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=b),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):j(e),e._args=n,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=T(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.trigger(e)}}),["focus","blur"].forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.each(function(){try{this[e]()}catch(t){}}),this}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),j(n)}}(Zepto),function(t){function l(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function h(t,e,i,r){return t.global?l(e||n,i,r):void 0}function p(e){e.global&&0===t.active++&&h(e,null,"ajaxStart")}function d(e){e.global&&!--t.active&&h(e,null,"ajaxStop")}function m(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||h(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void h(e,n,"ajaxSend",[t,e])}function g(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),h(n,r,"ajaxSuccess",[e,n,t]),y(o,e,n)}function v(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),h(i,o,"ajaxError",[n,i,t||e]),y(e,n,i)}function y(t,e,n){var i=n.context;n.complete.call(i,e,t),h(n,i,"ajaxComplete",[e,n]),d(n)}function x(){}function b(t){return t&&(t=t.split(";",2)[0]),t&&(t==f?"html":t==u?"json":s.test(t)?"script":a.test(t)&&"xml")||"text"}function w(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function E(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=w(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function S(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(a||"object"==o||"array"==o?n:"")+"]"),!r&&s?e.add(u.name,u.value):"array"==o||!i&&"object"==o?S(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i,a=/^(?:text|application)\/xml/i,u="application/json",f="text/html",c=/^\s*$/;t.active=0,t.ajaxJSONP=function(i,r){if(!("type"in i))return t.ajax(i);var f,h,o=i.jsonpCallback,s=(t.isFunction(o)?o():o)||"jsonp"+ ++e,a=n.createElement("script"),u=window[s],c=function(e){t(a).triggerHandler("error",e||"abort")},l={abort:c};return r&&r.promise(l),t(a).on("load error",function(e,n){clearTimeout(h),t(a).off().remove(),"error"!=e.type&&f?g(f[0],l,i,r):v(null,n||"error",l,i,r),window[s]=u,f&&t.isFunction(u)&&u(f[0]),u=f=void 0}),m(l,i)===!1?(c("abort"),l):(window[s]=function(){f=arguments},a.src=i.url.replace(/\?(.+)=\?/,"?$1="+s),n.head.appendChild(a),i.timeout>0&&(h=setTimeout(function(){c("timeout")},i.timeout)),l)},t.ajaxSettings={type:"GET",beforeSend:x,success:x,error:x,complete:x,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:u,xml:"application/xml, text/xml",html:f,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var n=t.extend({},e||{}),o=t.Deferred&&t.Deferred();for(i in t.ajaxSettings)void 0===n[i]&&(n[i]=t.ajaxSettings[i]);p(n),n.crossDomain||(n.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(n.url)&&RegExp.$2!=window.location.host),n.url||(n.url=window.location.toString()),E(n),n.cache===!1&&(n.url=w(n.url,"_="+Date.now()));var s=n.dataType,a=/\?.+=\?/.test(n.url);if("jsonp"==s||a)return a||(n.url=w(n.url,n.jsonp?n.jsonp+"=?":n.jsonp===!1?"":"callback=?")),t.ajaxJSONP(n,o);var j,u=n.accepts[s],f={},l=function(t,e){f[t.toLowerCase()]=[t,e]},h=/^([\w-]+:)\/\//.test(n.url)?RegExp.$1:window.location.protocol,d=n.xhr(),y=d.setRequestHeader;if(o&&o.promise(d),n.crossDomain||l("X-Requested-With","XMLHttpRequest"),l("Accept",u||"*/*"),(u=n.mimeType||u)&&(u.indexOf(",")>-1&&(u=u.split(",",2)[0]),d.overrideMimeType&&d.overrideMimeType(u)),(n.contentType||n.contentType!==!1&&n.data&&"GET"!=n.type.toUpperCase())&&l("Content-Type",n.contentType||"application/x-www-form-urlencoded"),n.headers)for(r in n.headers)l(r,n.headers[r]);if(d.setRequestHeader=l,d.onreadystatechange=function(){if(4==d.readyState){d.onreadystatechange=x,clearTimeout(j);var e,i=!1;if(d.status>=200&&d.status<300||304==d.status||0==d.status&&"file:"==h){s=s||b(n.mimeType||d.getResponseHeader("content-type")),e=d.responseText;try{"script"==s?(1,eval)(e):"xml"==s?e=d.responseXML:"json"==s&&(e=c.test(e)?null:t.parseJSON(e))}catch(r){i=r}i?v(i,"parsererror",d,n,o):g(e,d,n,o)}else v(d.statusText||null,d.status?"error":"abort",d,n,o)}},m(d,n)===!1)return d.abort(),v(null,"abort",d,n,o),d;if(n.xhrFields)for(r in n.xhrFields)d[r]=n.xhrFields[r];var T="async"in n?n.async:!0;d.open(n.type,n.url,T,n.username,n.password);for(r in f)y.apply(d,f[r]);return n.timeout>0&&(j=setTimeout(function(){d.onreadystatechange=x,d.abort(),v(null,"timeout",d,n,o)},n.timeout)),d.send(n.data?n.data:null),d},t.get=function(){return t.ajax(j.apply(null,arguments))},t.post=function(){var e=j.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=j.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var a,r=this,s=e.split(/\s/),u=j(e,n,i),f=u.success;return s.length>1&&(u.url=s[0],a=s[1]),u.success=function(e){r.html(a?t("
").html(e.replace(o,"")).find(a):e),f&&f.apply(r,arguments)},t.ajax(u),this};var T=encodeURIComponent;t.param=function(t,e){var n=[];return n.add=function(t,e){this.push(T(t)+"="+T(e))},S(n,t,e),n.join("&").replace(/%20/g,"+")}}(Zepto),function(t){t.fn.serializeArray=function(){var n,e=[];return t([].slice.call(this.get(0).elements)).each(function(){n=t(this);var i=n.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=i&&"reset"!=i&&"button"!=i&&("radio"!=i&&"checkbox"!=i||this.checked)&&e.push({name:n.attr("name"),value:n.val()})}),e},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(e)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(t){"__proto__"in{}||t.extend(t.zepto,{Z:function(e,n){return e=e||[],t.extend(e,t.fn),e.selector=n||"",e.__Z=!0,e},isZ:function(e){return"array"===t.type(e)&&"__Z"in e}});try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;window.getComputedStyle=function(t){try{return n(t)}catch(e){return null}}}}(Zepto); diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/env_details.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/env_details.html.php new file mode 100644 index 0000000..30fcb9c --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/env_details.html.php @@ -0,0 +1,42 @@ + +
+

Environment & details:

+ +
+ $data): ?> +
+ + + + + + + + + + $value): ?> + + + + + +
KeyValue
escape($k) ?>dump($value) ?>
+ + + empty + +
+ +
+ + +
+ + $h): ?> +
+ . escape(get_class($h)) ?> +
+ +
+ +
diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php new file mode 100644 index 0000000..fd3d930 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php @@ -0,0 +1,67 @@ + +
+ $frame): ?> + getLine(); ?> +
+ + getFileLines($line - 20, 40); + + // getFileLines can return null if there is no source code + if ($range): + $range = array_map(function ($line) { return empty($line) ? ' ' : $line;}, $range); + $start = key($range) + 1; + $code = join("\n", $range); + ?> +
escape($code) ?>
+ + + + + dumpArgs($frame); ?> + +
+ Arguments +
+
+ +
+ + + getComments(); + ?> +
+ $comment): ?> + +
+ escape($context) ?> + escapeButPreserveUris($comment) ?> +
+ +
+ +
+ +
diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/frame_list.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/frame_list.html.php new file mode 100644 index 0000000..a4bc338 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/frame_list.html.php @@ -0,0 +1,17 @@ + + $frame): ?> +
+ +
+ breakOnDelimiter('\\', $tpl->escape($frame->getClass() ?: '')) ?> + breakOnDelimiter('\\', $tpl->escape($frame->getFunction() ?: '')) ?> +
+ +
+ getFile() ? $tpl->breakOnDelimiter('/', $tpl->shorten($tpl->escape($frame->getFile()))) : '<#unknown>' ?>getLine() ?> +
+
+"> + render($frame_list) ?> +
\ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/frames_description.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/frames_description.html.php new file mode 100644 index 0000000..5d32f71 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/frames_description.html.php @@ -0,0 +1,14 @@ + diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/header.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/header.html.php new file mode 100644 index 0000000..2f2d90f --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/header.html.php @@ -0,0 +1,96 @@ +
+
+ $nameSection): ?> + + escape($nameSection) ?> + + escape($nameSection) . ' \\' ?> + + + + (escape($code) ?>) + +
+ +
+ + escape($message) ?> + + + +
+ Previous exceptions +
+ +
    + $previousMessage): ?> +
  • + escape($previousMessage) ?> + () +
  • + +
+ + + + + + No message + + + + + escape($plain_exception) ?> + + +
+
diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/header_outer.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/header_outer.html.php new file mode 100644 index 0000000..f682cbb --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/header_outer.html.php @@ -0,0 +1,3 @@ +
+ render($header) ?> +
diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php new file mode 100644 index 0000000..7ad15ea --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php @@ -0,0 +1,34 @@ + + + + + + + + <?php echo $tpl->escape($page_title) ?> + + + + + + +
+
+ + render($panel_left_outer) ?> + + render($panel_details_outer) ?> + +
+
+ + + + + + + diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php new file mode 100644 index 0000000..a85e451 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php @@ -0,0 +1,2 @@ +render($frame_code) ?> +render($env_details) ?> \ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php new file mode 100644 index 0000000..8162d8c --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php @@ -0,0 +1,3 @@ +
+ render($panel_details) ?> +
\ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php new file mode 100644 index 0000000..7e652e4 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php @@ -0,0 +1,4 @@ +render($header_outer); +$tpl->render($frames_description); +$tpl->render($frames_container); diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php new file mode 100644 index 0000000..77b575c --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php @@ -0,0 +1,3 @@ +
+ render($panel_left) ?> +
\ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Run.php b/vendor/filp/whoops/src/Whoops/Run.php new file mode 100644 index 0000000..0862768 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Run.php @@ -0,0 +1,597 @@ + + */ + +namespace Whoops; + +use InvalidArgumentException; +use Throwable; +use Whoops\Exception\ErrorException; +use Whoops\Handler\CallbackHandler; +use Whoops\Handler\Handler; +use Whoops\Handler\HandlerInterface; +use Whoops\Inspector\CallableInspectorFactory; +use Whoops\Inspector\InspectorFactory; +use Whoops\Inspector\InspectorFactoryInterface; +use Whoops\Inspector\InspectorInterface; +use Whoops\Util\Misc; +use Whoops\Util\SystemFacade; + +final class Run implements RunInterface +{ + /** + * @var bool + */ + private $isRegistered; + + /** + * @var bool + */ + private $allowQuit = true; + + /** + * @var bool + */ + private $sendOutput = true; + + /** + * @var integer|false + */ + private $sendHttpCode = 500; + + /** + * @var integer|false + */ + private $sendExitCode = 1; + + /** + * @var HandlerInterface[] + */ + private $handlerStack = []; + + /** + * @var array + * @psalm-var list + */ + private $silencedPatterns = []; + + /** + * @var SystemFacade + */ + private $system; + + /** + * In certain scenarios, like in shutdown handler, we can not throw exceptions. + * + * @var bool + */ + private $canThrowExceptions = true; + + /** + * The inspector factory to create inspectors. + * + * @var InspectorFactoryInterface + */ + private $inspectorFactory; + + /** + * @var array + */ + private $frameFilters = []; + + public function __construct(SystemFacade $system = null) + { + $this->system = $system ?: new SystemFacade; + $this->inspectorFactory = new InspectorFactory(); + } + + /** + * Explicitly request your handler runs as the last of all currently registered handlers. + * + * @param callable|HandlerInterface $handler + * + * @return Run + */ + public function appendHandler($handler) + { + array_unshift($this->handlerStack, $this->resolveHandler($handler)); + return $this; + } + + /** + * Explicitly request your handler runs as the first of all currently registered handlers. + * + * @param callable|HandlerInterface $handler + * + * @return Run + */ + public function prependHandler($handler) + { + return $this->pushHandler($handler); + } + + /** + * Register your handler as the last of all currently registered handlers (to be executed first). + * Prefer using appendHandler and prependHandler for clarity. + * + * @param callable|HandlerInterface $handler + * + * @return Run + * + * @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface. + */ + public function pushHandler($handler) + { + $this->handlerStack[] = $this->resolveHandler($handler); + return $this; + } + + /** + * Removes and returns the last handler pushed to the handler stack. + * + * @see Run::removeFirstHandler(), Run::removeLastHandler() + * + * @return HandlerInterface|null + */ + public function popHandler() + { + return array_pop($this->handlerStack); + } + + /** + * Removes the first handler. + * + * @return void + */ + public function removeFirstHandler() + { + array_pop($this->handlerStack); + } + + /** + * Removes the last handler. + * + * @return void + */ + public function removeLastHandler() + { + array_shift($this->handlerStack); + } + + /** + * Returns an array with all handlers, in the order they were added to the stack. + * + * @return array + */ + public function getHandlers() + { + return $this->handlerStack; + } + + /** + * Clears all handlers in the handlerStack, including the default PrettyPage handler. + * + * @return Run + */ + public function clearHandlers() + { + $this->handlerStack = []; + return $this; + } + + public function getFrameFilters() + { + return $this->frameFilters; + } + + public function clearFrameFilters() + { + $this->frameFilters = []; + return $this; + } + + /** + * Registers this instance as an error handler. + * + * @return Run + */ + public function register() + { + if (!$this->isRegistered) { + // Workaround PHP bug 42098 + // https://bugs.php.net/bug.php?id=42098 + class_exists("\\Whoops\\Exception\\ErrorException"); + class_exists("\\Whoops\\Exception\\FrameCollection"); + class_exists("\\Whoops\\Exception\\Frame"); + class_exists("\\Whoops\\Exception\\Inspector"); + class_exists("\\Whoops\\Inspector\\InspectorFactory"); + + $this->system->setErrorHandler([$this, self::ERROR_HANDLER]); + $this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]); + $this->system->registerShutdownFunction([$this, self::SHUTDOWN_HANDLER]); + + $this->isRegistered = true; + } + + return $this; + } + + /** + * Unregisters all handlers registered by this Whoops\Run instance. + * + * @return Run + */ + public function unregister() + { + if ($this->isRegistered) { + $this->system->restoreExceptionHandler(); + $this->system->restoreErrorHandler(); + + $this->isRegistered = false; + } + + return $this; + } + + /** + * Should Whoops allow Handlers to force the script to quit? + * + * @param bool|int $exit + * + * @return bool + */ + public function allowQuit($exit = null) + { + if (func_num_args() == 0) { + return $this->allowQuit; + } + + return $this->allowQuit = (bool) $exit; + } + + /** + * Silence particular errors in particular files. + * + * @param array|string $patterns List or a single regex pattern to match. + * @param int $levels Defaults to E_STRICT | E_DEPRECATED. + * + * @return Run + */ + public function silenceErrorsInPaths($patterns, $levels = 10240) + { + $this->silencedPatterns = array_merge( + $this->silencedPatterns, + array_map( + function ($pattern) use ($levels) { + return [ + "pattern" => $pattern, + "levels" => $levels, + ]; + }, + (array) $patterns + ) + ); + + return $this; + } + + /** + * Returns an array with silent errors in path configuration. + * + * @return array + */ + public function getSilenceErrorsInPaths() + { + return $this->silencedPatterns; + } + + /** + * Should Whoops send HTTP error code to the browser if possible? + * Whoops will by default send HTTP code 500, but you may wish to + * use 502, 503, or another 5xx family code. + * + * @param bool|int $code + * + * @return int|false + * + * @throws InvalidArgumentException + */ + public function sendHttpCode($code = null) + { + if (func_num_args() == 0) { + return $this->sendHttpCode; + } + + if (!$code) { + return $this->sendHttpCode = false; + } + + if ($code === true) { + $code = 500; + } + + if ($code < 400 || 600 <= $code) { + throw new InvalidArgumentException( + "Invalid status code '$code', must be 4xx or 5xx" + ); + } + + return $this->sendHttpCode = $code; + } + + /** + * Should Whoops exit with a specific code on the CLI if possible? + * Whoops will exit with 1 by default, but you can specify something else. + * + * @param int $code + * + * @return int + * + * @throws InvalidArgumentException + */ + public function sendExitCode($code = null) + { + if (func_num_args() == 0) { + return $this->sendExitCode; + } + + if ($code < 0 || 255 <= $code) { + throw new InvalidArgumentException( + "Invalid status code '$code', must be between 0 and 254" + ); + } + + return $this->sendExitCode = (int) $code; + } + + /** + * Should Whoops push output directly to the client? + * If this is false, output will be returned by handleException. + * + * @param bool|int $send + * + * @return bool + */ + public function writeToOutput($send = null) + { + if (func_num_args() == 0) { + return $this->sendOutput; + } + + return $this->sendOutput = (bool) $send; + } + + /** + * Handles an exception, ultimately generating a Whoops error page. + * + * @param Throwable $exception + * + * @return string Output generated by handlers. + */ + public function handleException($exception) + { + // Walk the registered handlers in the reverse order + // they were registered, and pass off the exception + $inspector = $this->getInspector($exception); + + // Capture output produced while handling the exception, + // we might want to send it straight away to the client, + // or return it silently. + $this->system->startOutputBuffering(); + + // Just in case there are no handlers: + $handlerResponse = null; + $handlerContentType = null; + + try { + foreach (array_reverse($this->handlerStack) as $handler) { + $handler->setRun($this); + $handler->setInspector($inspector); + $handler->setException($exception); + + // The HandlerInterface does not require an Exception passed to handle() + // and neither of our bundled handlers use it. + // However, 3rd party handlers may have already relied on this parameter, + // and removing it would be possibly breaking for users. + $handlerResponse = $handler->handle($exception); + + // Collect the content type for possible sending in the headers. + $handlerContentType = method_exists($handler, 'contentType') ? $handler->contentType() : null; + + if (in_array($handlerResponse, [Handler::LAST_HANDLER, Handler::QUIT])) { + // The Handler has handled the exception in some way, and + // wishes to quit execution (Handler::QUIT), or skip any + // other handlers (Handler::LAST_HANDLER). If $this->allowQuit + // is false, Handler::QUIT behaves like Handler::LAST_HANDLER + break; + } + } + + $willQuit = $handlerResponse == Handler::QUIT && $this->allowQuit(); + } finally { + $output = $this->system->cleanOutputBuffer(); + } + + // If we're allowed to, send output generated by handlers directly + // to the output, otherwise, and if the script doesn't quit, return + // it so that it may be used by the caller + if ($this->writeToOutput()) { + // @todo Might be able to clean this up a bit better + if ($willQuit) { + // Cleanup all other output buffers before sending our output: + while ($this->system->getOutputBufferLevel() > 0) { + $this->system->endOutputBuffering(); + } + + // Send any headers if needed: + if (Misc::canSendHeaders() && $handlerContentType) { + header("Content-Type: {$handlerContentType}"); + } + } + + $this->writeToOutputNow($output); + } + + if ($willQuit) { + // HHVM fix for https://github.com/facebook/hhvm/issues/4055 + $this->system->flushOutputBuffer(); + + $this->system->stopExecution( + $this->sendExitCode() + ); + } + + return $output; + } + + /** + * Converts generic PHP errors to \ErrorException instances, before passing them off to be handled. + * + * This method MUST be compatible with set_error_handler. + * + * @param int $level + * @param string $message + * @param string|null $file + * @param int|null $line + * + * @return bool + * + * @throws ErrorException + */ + public function handleError($level, $message, $file = null, $line = null) + { + if ($level & $this->system->getErrorReportingLevel()) { + foreach ($this->silencedPatterns as $entry) { + $pathMatches = (bool) preg_match($entry["pattern"], $file); + $levelMatches = $level & $entry["levels"]; + if ($pathMatches && $levelMatches) { + // Ignore the error, abort handling + // See https://github.com/filp/whoops/issues/418 + return true; + } + } + + // XXX we pass $level for the "code" param only for BC reasons. + // see https://github.com/filp/whoops/issues/267 + $exception = new ErrorException($message, /*code*/ $level, /*severity*/ $level, $file, $line); + if ($this->canThrowExceptions) { + throw $exception; + } else { + $this->handleException($exception); + } + // Do not propagate errors which were already handled by Whoops. + return true; + } + + // Propagate error to the next handler, allows error_get_last() to + // work on silenced errors. + return false; + } + + /** + * Special case to deal with Fatal errors and the like. + * + * @return void + */ + public function handleShutdown() + { + // If we reached this step, we are in shutdown handler. + // An exception thrown in a shutdown handler will not be propagated + // to the exception handler. Pass that information along. + $this->canThrowExceptions = false; + + $error = $this->system->getLastError(); + if ($error && Misc::isLevelFatal($error['type'])) { + // If there was a fatal error, + // it was not handled in handleError yet. + $this->allowQuit = false; + $this->handleError( + $error['type'], + $error['message'], + $error['file'], + $error['line'] + ); + } + } + + + /** + * @param InspectorFactoryInterface $factory + * + * @return void + */ + public function setInspectorFactory(InspectorFactoryInterface $factory) + { + $this->inspectorFactory = $factory; + } + + public function addFrameFilter($filterCallback) + { + if (!is_callable($filterCallback)) { + throw new \InvalidArgumentException(sprintf( + "A frame filter must be of type callable, %s type given.", + gettype($filterCallback) + )); + } + + $this->frameFilters[] = $filterCallback; + return $this; + } + + /** + * @param Throwable $exception + * + * @return InspectorInterface + */ + private function getInspector($exception) + { + return $this->inspectorFactory->create($exception); + } + + /** + * Resolves the giving handler. + * + * @param callable|HandlerInterface $handler + * + * @return HandlerInterface + * + * @throws InvalidArgumentException + */ + private function resolveHandler($handler) + { + if (is_callable($handler)) { + $handler = new CallbackHandler($handler); + } + + if (!$handler instanceof HandlerInterface) { + throw new InvalidArgumentException( + "Handler must be a callable, or instance of " + . "Whoops\\Handler\\HandlerInterface" + ); + } + + return $handler; + } + + /** + * Echo something to the browser. + * + * @param string $output + * + * @return Run + */ + private function writeToOutputNow($output) + { + if ($this->sendHttpCode() && Misc::canSendHeaders()) { + $this->system->setHttpResponseCode( + $this->sendHttpCode() + ); + } + + echo $output; + + return $this; + } +} diff --git a/vendor/filp/whoops/src/Whoops/RunInterface.php b/vendor/filp/whoops/src/Whoops/RunInterface.php new file mode 100644 index 0000000..0ef3e3f --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/RunInterface.php @@ -0,0 +1,158 @@ + + */ + +namespace Whoops; + +use InvalidArgumentException; +use Whoops\Exception\ErrorException; +use Whoops\Handler\HandlerInterface; + +interface RunInterface +{ + const EXCEPTION_HANDLER = "handleException"; + const ERROR_HANDLER = "handleError"; + const SHUTDOWN_HANDLER = "handleShutdown"; + + /** + * Pushes a handler to the end of the stack + * + * @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface + * @param Callable|HandlerInterface $handler + * @return Run + */ + public function pushHandler($handler); + + /** + * Removes the last handler in the stack and returns it. + * Returns null if there"s nothing else to pop. + * + * @return null|HandlerInterface + */ + public function popHandler(); + + /** + * Returns an array with all handlers, in the + * order they were added to the stack. + * + * @return array + */ + public function getHandlers(); + + /** + * Clears all handlers in the handlerStack, including + * the default PrettyPage handler. + * + * @return Run + */ + public function clearHandlers(); + + /** + * @return array + */ + public function getFrameFilters(); + + /** + * @return Run + */ + public function clearFrameFilters(); + + /** + * Registers this instance as an error handler. + * + * @return Run + */ + public function register(); + + /** + * Unregisters all handlers registered by this Whoops\Run instance + * + * @return Run + */ + public function unregister(); + + /** + * Should Whoops allow Handlers to force the script to quit? + * + * @param bool|int $exit + * @return bool + */ + public function allowQuit($exit = null); + + /** + * Silence particular errors in particular files + * + * @param array|string $patterns List or a single regex pattern to match + * @param int $levels Defaults to E_STRICT | E_DEPRECATED + * @return \Whoops\Run + */ + public function silenceErrorsInPaths($patterns, $levels = 10240); + + /** + * Should Whoops send HTTP error code to the browser if possible? + * Whoops will by default send HTTP code 500, but you may wish to + * use 502, 503, or another 5xx family code. + * + * @param bool|int $code + * @return int|false + */ + public function sendHttpCode($code = null); + + /** + * Should Whoops exit with a specific code on the CLI if possible? + * Whoops will exit with 1 by default, but you can specify something else. + * + * @param int $code + * @return int + */ + public function sendExitCode($code = null); + + /** + * Should Whoops push output directly to the client? + * If this is false, output will be returned by handleException + * + * @param bool|int $send + * @return bool + */ + public function writeToOutput($send = null); + + /** + * Handles an exception, ultimately generating a Whoops error + * page. + * + * @param \Throwable $exception + * @return string Output generated by handlers + */ + public function handleException($exception); + + /** + * Converts generic PHP errors to \ErrorException + * instances, before passing them off to be handled. + * + * This method MUST be compatible with set_error_handler. + * + * @param int $level + * @param string $message + * @param string $file + * @param int $line + * + * @return bool + * @throws ErrorException + */ + public function handleError($level, $message, $file = null, $line = null); + + /** + * Special case to deal with Fatal errors and the like. + */ + public function handleShutdown(); + + /** + * Registers a filter callback in the frame filters stack. + * + * @param callable $filterCallback + * @return \Whoops\Run + */ + public function addFrameFilter($filterCallback); +} diff --git a/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php b/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php new file mode 100644 index 0000000..8c828fd --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php @@ -0,0 +1,36 @@ + + */ + +namespace Whoops\Util; + +/** + * Used as output callable for Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() + * + * @see TemplateHelper::dump() + */ +class HtmlDumperOutput +{ + private $output; + + public function __invoke($line, $depth) + { + // A negative depth means "end of dump" + if ($depth >= 0) { + // Adds a two spaces indentation to the line + $this->output .= str_repeat(' ', $depth) . $line . "\n"; + } + } + + public function getOutput() + { + return $this->output; + } + + public function clear() + { + $this->output = null; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Util/Misc.php b/vendor/filp/whoops/src/Whoops/Util/Misc.php new file mode 100644 index 0000000..001a687 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Util/Misc.php @@ -0,0 +1,77 @@ + + */ + +namespace Whoops\Util; + +class Misc +{ + /** + * Can we at this point in time send HTTP headers? + * + * Currently this checks if we are even serving an HTTP request, + * as opposed to running from a command line. + * + * If we are serving an HTTP request, we check if it's not too late. + * + * @return bool + */ + public static function canSendHeaders() + { + return isset($_SERVER["REQUEST_URI"]) && !headers_sent(); + } + + public static function isAjaxRequest() + { + return ( + !empty($_SERVER['HTTP_X_REQUESTED_WITH']) + && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); + } + + /** + * Check, if possible, that this execution was triggered by a command line. + * @return bool + */ + public static function isCommandLine() + { + return PHP_SAPI == 'cli'; + } + + /** + * Translate ErrorException code into the represented constant. + * + * @param int $error_code + * @return string + */ + public static function translateErrorCode($error_code) + { + $constants = get_defined_constants(true); + if (array_key_exists('Core', $constants)) { + foreach ($constants['Core'] as $constant => $value) { + if (substr($constant, 0, 2) == 'E_' && $value == $error_code) { + return $constant; + } + } + } + return "E_UNKNOWN"; + } + + /** + * Determine if an error level is fatal (halts execution) + * + * @param int $level + * @return bool + */ + public static function isLevelFatal($level) + { + $errors = E_ERROR; + $errors |= E_PARSE; + $errors |= E_CORE_ERROR; + $errors |= E_CORE_WARNING; + $errors |= E_COMPILE_ERROR; + $errors |= E_COMPILE_WARNING; + return ($level & $errors) > 0; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php b/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php new file mode 100644 index 0000000..9eb0acf --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php @@ -0,0 +1,144 @@ + + */ + +namespace Whoops\Util; + +class SystemFacade +{ + /** + * Turns on output buffering. + * + * @return bool + */ + public function startOutputBuffering() + { + return ob_start(); + } + + /** + * @param callable $handler + * @param int $types + * + * @return callable|null + */ + public function setErrorHandler(callable $handler, $types = 'use-php-defaults') + { + // Since PHP 5.4 the constant E_ALL contains all errors (even E_STRICT) + if ($types === 'use-php-defaults') { + $types = E_ALL; + } + return set_error_handler($handler, $types); + } + + /** + * @param callable $handler + * + * @return callable|null + */ + public function setExceptionHandler(callable $handler) + { + return set_exception_handler($handler); + } + + /** + * @return void + */ + public function restoreExceptionHandler() + { + restore_exception_handler(); + } + + /** + * @return void + */ + public function restoreErrorHandler() + { + restore_error_handler(); + } + + /** + * @param callable $function + * + * @return void + */ + public function registerShutdownFunction(callable $function) + { + register_shutdown_function($function); + } + + /** + * @return string|false + */ + public function cleanOutputBuffer() + { + return ob_get_clean(); + } + + /** + * @return int + */ + public function getOutputBufferLevel() + { + return ob_get_level(); + } + + /** + * @return bool + */ + public function endOutputBuffering() + { + return ob_end_clean(); + } + + /** + * @return void + */ + public function flushOutputBuffer() + { + flush(); + } + + /** + * @return int + */ + public function getErrorReportingLevel() + { + return error_reporting(); + } + + /** + * @return array|null + */ + public function getLastError() + { + return error_get_last(); + } + + /** + * @param int $httpCode + * + * @return int + */ + public function setHttpResponseCode($httpCode) + { + if (!headers_sent()) { + // Ensure that no 'location' header is present as otherwise this + // will override the HTTP code being set here, and mask the + // expected error page. + header_remove('location'); + } + + return http_response_code($httpCode); + } + + /** + * @param int $exitStatus + */ + public function stopExecution($exitStatus) + { + exit($exitStatus); + } +} diff --git a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php new file mode 100644 index 0000000..8e4df32 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php @@ -0,0 +1,349 @@ + + */ + +namespace Whoops\Util; + +use Symfony\Component\VarDumper\Caster\Caster; +use Symfony\Component\VarDumper\Cloner\AbstractCloner; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; +use Whoops\Exception\Frame; + +/** + * Exposes useful tools for working with/in templates + */ +class TemplateHelper +{ + /** + * An array of variables to be passed to all templates + * @var array + */ + private $variables = []; + + /** + * @var HtmlDumper + */ + private $htmlDumper; + + /** + * @var HtmlDumperOutput + */ + private $htmlDumperOutput; + + /** + * @var AbstractCloner + */ + private $cloner; + + /** + * @var string + */ + private $applicationRootPath; + + public function __construct() + { + // root path for ordinary composer projects + $this->applicationRootPath = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); + } + + /** + * Escapes a string for output in an HTML document + * + * @param string $raw + * @return string + */ + public function escape($raw) + { + $flags = ENT_QUOTES; + + // HHVM has all constants defined, but only ENT_IGNORE + // works at the moment + if (defined("ENT_SUBSTITUTE") && !defined("HHVM_VERSION")) { + $flags |= ENT_SUBSTITUTE; + } else { + // This is for 5.3. + // The documentation warns of a potential security issue, + // but it seems it does not apply in our case, because + // we do not blacklist anything anywhere. + $flags |= ENT_IGNORE; + } + + $raw = str_replace(chr(9), ' ', $raw); + + return htmlspecialchars($raw, $flags, "UTF-8"); + } + + /** + * Escapes a string for output in an HTML document, but preserves + * URIs within it, and converts them to clickable anchor elements. + * + * @param string $raw + * @return string + */ + public function escapeButPreserveUris($raw) + { + $escaped = $this->escape($raw); + return preg_replace( + "@([A-z]+?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@", + "$1", + $escaped + ); + } + + /** + * Makes sure that the given string breaks on the delimiter. + * + * @param string $delimiter + * @param string $s + * @return string + */ + public function breakOnDelimiter($delimiter, $s) + { + $parts = explode($delimiter, $s); + foreach ($parts as &$part) { + $part = '' . $part . ''; + } + + return implode($delimiter, $parts); + } + + /** + * Replace the part of the path that all files have in common. + * + * @param string $path + * @return string + */ + public function shorten($path) + { + if ($this->applicationRootPath != "/") { + $path = str_replace($this->applicationRootPath, '…', $path); + } + + return $path; + } + + private function getDumper() + { + if (!$this->htmlDumper && class_exists('Symfony\Component\VarDumper\Cloner\VarCloner')) { + $this->htmlDumperOutput = new HtmlDumperOutput(); + // re-use the same var-dumper instance, so it won't re-render the global styles/scripts on each dump. + $this->htmlDumper = new HtmlDumper($this->htmlDumperOutput); + + $styles = [ + 'default' => 'color:#FFFFFF; line-height:normal; font:12px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace !important; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: normal', + 'num' => 'color:#BCD42A', + 'const' => 'color: #4bb1b1;', + 'str' => 'color:#BCD42A', + 'note' => 'color:#ef7c61', + 'ref' => 'color:#A0A0A0', + 'public' => 'color:#FFFFFF', + 'protected' => 'color:#FFFFFF', + 'private' => 'color:#FFFFFF', + 'meta' => 'color:#FFFFFF', + 'key' => 'color:#BCD42A', + 'index' => 'color:#ef7c61', + ]; + $this->htmlDumper->setStyles($styles); + } + + return $this->htmlDumper; + } + + /** + * Format the given value into a human readable string. + * + * @param mixed $value + * @return string + */ + public function dump($value) + { + $dumper = $this->getDumper(); + + if ($dumper) { + // re-use the same DumpOutput instance, so it won't re-render the global styles/scripts on each dump. + // exclude verbose information (e.g. exception stack traces) + if (class_exists('Symfony\Component\VarDumper\Caster\Caster')) { + $cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); + // Symfony VarDumper 2.6 Caster class dont exist. + } else { + $cloneVar = $this->getCloner()->cloneVar($value); + } + + $dumper->dump( + $cloneVar, + $this->htmlDumperOutput + ); + + $output = $this->htmlDumperOutput->getOutput(); + $this->htmlDumperOutput->clear(); + + return $output; + } + + return htmlspecialchars(print_r($value, true)); + } + + /** + * Format the args of the given Frame as a human readable html string + * + * @param Frame $frame + * @return string the rendered html + */ + public function dumpArgs(Frame $frame) + { + // we support frame args only when the optional dumper is available + if (!$this->getDumper()) { + return ''; + } + + $html = ''; + $numFrames = count($frame->getArgs()); + + if ($numFrames > 0) { + $html = '
    '; + foreach ($frame->getArgs() as $j => $frameArg) { + $html .= '
  1. '. $this->dump($frameArg) .'
  2. '; + } + $html .= '
'; + } + + return $html; + } + + /** + * Convert a string to a slug version of itself + * + * @param string $original + * @return string + */ + public function slug($original) + { + $slug = str_replace(" ", "-", $original); + $slug = preg_replace('/[^\w\d\-\_]/i', '', $slug); + return strtolower($slug); + } + + /** + * Given a template path, render it within its own scope. This + * method also accepts an array of additional variables to be + * passed to the template. + * + * @param string $template + */ + public function render($template, array $additionalVariables = null) + { + $variables = $this->getVariables(); + + // Pass the helper to the template: + $variables["tpl"] = $this; + + if ($additionalVariables !== null) { + $variables = array_replace($variables, $additionalVariables); + } + + call_user_func(function () { + extract(func_get_arg(1)); + require func_get_arg(0); + }, $template, $variables); + } + + /** + * Sets the variables to be passed to all templates rendered + * by this template helper. + */ + public function setVariables(array $variables) + { + $this->variables = $variables; + } + + /** + * Sets a single template variable, by its name: + * + * @param string $variableName + * @param mixed $variableValue + */ + public function setVariable($variableName, $variableValue) + { + $this->variables[$variableName] = $variableValue; + } + + /** + * Gets a single template variable, by its name, or + * $defaultValue if the variable does not exist + * + * @param string $variableName + * @param mixed $defaultValue + * @return mixed + */ + public function getVariable($variableName, $defaultValue = null) + { + return isset($this->variables[$variableName]) ? + $this->variables[$variableName] : $defaultValue; + } + + /** + * Unsets a single template variable, by its name + * + * @param string $variableName + */ + public function delVariable($variableName) + { + unset($this->variables[$variableName]); + } + + /** + * Returns all variables for this helper + * + * @return array + */ + public function getVariables() + { + return $this->variables; + } + + /** + * Set the cloner used for dumping variables. + * + * @param AbstractCloner $cloner + */ + public function setCloner($cloner) + { + $this->cloner = $cloner; + } + + /** + * Get the cloner used for dumping variables. + * + * @return AbstractCloner + */ + public function getCloner() + { + if (!$this->cloner) { + $this->cloner = new VarCloner(); + } + return $this->cloner; + } + + /** + * Set the application root path. + * + * @param string $applicationRootPath + */ + public function setApplicationRootPath($applicationRootPath) + { + $this->applicationRootPath = $applicationRootPath; + } + + /** + * Return the application root path. + * + * @return string + */ + public function getApplicationRootPath() + { + return $this->applicationRootPath; + } +} diff --git a/vendor/laminas/laminas-escaper/src/Escaper.php b/vendor/laminas/laminas-escaper/src/Escaper.php new file mode 100644 index 0000000..c4964cb --- /dev/null +++ b/vendor/laminas/laminas-escaper/src/Escaper.php @@ -0,0 +1,424 @@ + + */ + protected static $htmlNamedEntityMap = [ + 34 => 'quot', // quotation mark + 38 => 'amp', // ampersand + 60 => 'lt', // less-than sign + 62 => 'gt', // greater-than sign + ]; + + /** + * Current encoding for escaping. If not UTF-8, we convert strings from this encoding + * pre-escaping and back to this encoding post-escaping. + * + * @var string + */ + protected $encoding = 'utf-8'; + + /** + * Holds the value of the special flags passed as second parameter to + * htmlspecialchars(). + * + * @var int + */ + protected $htmlSpecialCharsFlags; + + /** + * Static Matcher which escapes characters for HTML Attribute contexts + * + * @var callable + * @psalm-var callable(array):string + */ + protected $htmlAttrMatcher; + + /** + * Static Matcher which escapes characters for Javascript contexts + * + * @var callable + * @psalm-var callable(array):string + */ + protected $jsMatcher; + + /** + * Static Matcher which escapes characters for CSS Attribute contexts + * + * @var callable + * @psalm-var callable(array):string + */ + protected $cssMatcher; + + /** + * List of all encoding supported by this class + * + * @var array + */ + protected $supportedEncodings = [ + 'iso-8859-1', + 'iso8859-1', + 'iso-8859-5', + 'iso8859-5', + 'iso-8859-15', + 'iso8859-15', + 'utf-8', + 'cp866', + 'ibm866', + '866', + 'cp1251', + 'windows-1251', + 'win-1251', + '1251', + 'cp1252', + 'windows-1252', + '1252', + 'koi8-r', + 'koi8-ru', + 'koi8r', + 'big5', + '950', + 'gb2312', + '936', + 'big5-hkscs', + 'shift_jis', + 'sjis', + 'sjis-win', + 'cp932', + '932', + 'euc-jp', + 'eucjp', + 'eucjp-win', + 'macroman', + ]; + + /** + * Constructor: Single parameter allows setting of global encoding for use by + * the current object. + * + * @throws Exception\InvalidArgumentException + */ + public function __construct(?string $encoding = null) + { + if ($encoding !== null) { + if ($encoding === '') { + throw new Exception\InvalidArgumentException( + static::class . ' constructor parameter does not allow a blank value' + ); + } + + $encoding = strtolower($encoding); + if (! in_array($encoding, $this->supportedEncodings)) { + throw new Exception\InvalidArgumentException( + 'Value of \'' . $encoding . '\' passed to ' . static::class + . ' constructor parameter is invalid. Provide an encoding supported by htmlspecialchars()' + ); + } + + $this->encoding = $encoding; + } + + // We take advantage of ENT_SUBSTITUTE flag to correctly deal with invalid UTF-8 sequences. + $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; + + // set matcher callbacks + $this->htmlAttrMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->htmlAttrMatcher($matches); + }; + $this->jsMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->jsMatcher($matches); + }; + $this->cssMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->cssMatcher($matches); + }; + } + + /** + * Return the encoding that all output/input is expected to be encoded in. + * + * @return string + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Escape a string for the HTML Body context where there are very few characters + * of special meaning. Internally this will use htmlspecialchars(). + * + * @return string + */ + public function escapeHtml(string $string) + { + return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding); + } + + /** + * Escape a string for the HTML Attribute context. We use an extended set of characters + * to escape that are not covered by htmlspecialchars() to cover cases where an attribute + * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE). + * + * @return string + */ + public function escapeHtmlAttr(string $string) + { + $string = $this->toUtf8($string); + if ($string === '' || ctype_digit($string)) { + return $string; + } + + $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string); + return $this->fromUtf8($result); + } + + /** + * Escape a string for the Javascript context. This does not use json_encode(). An extended + * set of characters are escaped beyond ECMAScript's rules for Javascript literal string + * escaping in order to prevent misinterpretation of Javascript as HTML leading to the + * injection of special characters and entities. The escaping used should be tolerant + * of cases where HTML escaping was not applied on top of Javascript escaping correctly. + * Backslash escaping is not used as it still leaves the escaped character as-is and so + * is not useful in a HTML context. + * + * @return string + */ + public function escapeJs(string $string) + { + $string = $this->toUtf8($string); + if ($string === '' || ctype_digit($string)) { + return $string; + } + + $result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string); + return $this->fromUtf8($result); + } + + /** + * Escape a string for the URI or Parameter contexts. This should not be used to escape + * an entire URI - only a subcomponent being inserted. The function is a simple proxy + * to rawurlencode() which now implements RFC 3986 since PHP 5.3 completely. + * + * @return string + */ + public function escapeUrl(string $string) + { + return rawurlencode($string); + } + + /** + * Escape a string for the CSS context. CSS escaping can be applied to any string being + * inserted into CSS and escapes everything except alphanumerics. + * + * @return string + */ + public function escapeCss(string $string) + { + $string = $this->toUtf8($string); + if ($string === '' || ctype_digit($string)) { + return $string; + } + + $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string); + return $this->fromUtf8($result); + } + + /** + * Callback function for preg_replace_callback that applies HTML Attribute + * escaping to all matches. + * + * @param array $matches + * @return string + */ + protected function htmlAttrMatcher($matches) + { + $chr = $matches[0]; + $ord = ord($chr); + + /** + * The following replaces characters undefined in HTML with the + * hex entity for the Unicode replacement character. + */ + if ( + ($ord <= 0x1f && $chr !== "\t" && $chr !== "\n" && $chr !== "\r") + || ($ord >= 0x7f && $ord <= 0x9f) + ) { + return '�'; + } + + /** + * Check if the current character to escape has a name entity we should + * replace it with while grabbing the integer value of the character. + */ + if (strlen($chr) > 1) { + $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8'); + } + + $hex = bin2hex($chr); + $ord = hexdec($hex); + if (isset(static::$htmlNamedEntityMap[$ord])) { + return '&' . static::$htmlNamedEntityMap[$ord] . ';'; + } + + /** + * Per OWASP recommendations, we'll use upper hex entities + * for any other characters where a named entity does not exist. + */ + if ($ord > 255) { + return sprintf('&#x%04X;', $ord); + } + return sprintf('&#x%02X;', $ord); + } + + /** + * Callback function for preg_replace_callback that applies Javascript + * escaping to all matches. + * + * @param array $matches + * @return string + */ + protected function jsMatcher($matches) + { + $chr = $matches[0]; + if (strlen($chr) === 1) { + return sprintf('\\x%02X', ord($chr)); + } + $chr = $this->convertEncoding($chr, 'UTF-16BE', 'UTF-8'); + $hex = strtoupper(bin2hex($chr)); + if (strlen($hex) <= 4) { + return sprintf('\\u%04s', $hex); + } + $highSurrogate = substr($hex, 0, 4); + $lowSurrogate = substr($hex, 4, 4); + return sprintf('\\u%04s\\u%04s', $highSurrogate, $lowSurrogate); + } + + /** + * Callback function for preg_replace_callback that applies CSS + * escaping to all matches. + * + * @param array $matches + * @return string + */ + protected function cssMatcher($matches) + { + $chr = $matches[0]; + if (strlen($chr) === 1) { + $ord = ord($chr); + } else { + $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8'); + $ord = hexdec(bin2hex($chr)); + } + return sprintf('\\%X ', $ord); + } + + /** + * Converts a string to UTF-8 from the base encoding. The base encoding is set via this + * + * @param string $string + * @throws Exception\RuntimeException + * @return string + */ + protected function toUtf8($string) + { + if ($this->getEncoding() === 'utf-8') { + $result = $string; + } else { + $result = $this->convertEncoding($string, 'UTF-8', $this->getEncoding()); + } + + if (! $this->isUtf8($result)) { + throw new Exception\RuntimeException( + sprintf('String to be escaped was not valid UTF-8 or could not be converted: %s', $result) + ); + } + + return $result; + } + + /** + * Converts a string from UTF-8 to the base encoding. The base encoding is set via this + * + * @param string $string + * @return string + */ + protected function fromUtf8($string) + { + if ($this->getEncoding() === 'utf-8') { + return $string; + } + + return $this->convertEncoding($string, $this->getEncoding(), 'UTF-8'); + } + + /** + * Checks if a given string appears to be valid UTF-8 or not. + * + * @param string $string + * @return bool + */ + protected function isUtf8($string) + { + return $string === '' || preg_match('/^./su', $string); + } + + /** + * Encoding conversion helper which wraps mb_convert_encoding + * + * @param string $string + * @param string $to + * @param array|string $from + * @return string + */ + protected function convertEncoding($string, $to, $from) + { + $result = mb_convert_encoding($string, $to, $from); + + if ($result === false) { + return ''; // return non-fatal blank string on encoding errors from users + } + + return $result; + } +} diff --git a/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php b/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php new file mode 100644 index 0000000..8f5fd89 --- /dev/null +++ b/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php @@ -0,0 +1,11 @@ + $color >> 16 & 0xFF, + 'g' => $color >> 8 & 0xFF, + 'b' => $color & 0xFF, + ]; + } + + /** + * @param array $components + * + * @return int + */ + public static function fromRgbToInt(array $components) + { + return ($components['r'] * 65536) + ($components['g'] * 256) + ($components['b']); + } +} diff --git a/vendor/league/color-extractor/src/ColorExtractor.php b/vendor/league/color-extractor/src/ColorExtractor.php new file mode 100644 index 0000000..364a3bd --- /dev/null +++ b/vendor/league/color-extractor/src/ColorExtractor.php @@ -0,0 +1,282 @@ +palette = $palette; + } + + /** + * @param int $colorCount + * + * @return array + */ + public function extract($colorCount = 1) + { + if ($colorCount === 0) { + return []; + } + + if (!$this->isInitialized()) { + $this->initialize(); + } + + return self::mergeColors($this->sortedColors, $colorCount, 100 / $colorCount); + } + + /** + * @return bool + */ + protected function isInitialized() + { + return $this->sortedColors !== null; + } + + protected function initialize() + { + $queue = new \SplPriorityQueue(); + $this->sortedColors = new \SplFixedArray(count($this->palette)); + + $i = 0; + foreach ($this->palette as $color => $count) { + $labColor = self::intColorToLab($color); + $queue->insert( + $color, + (sqrt($labColor['a'] * $labColor['a'] + $labColor['b'] * $labColor['b']) ?: 1) * + (1 - $labColor['L'] / 200) * + sqrt($count) + ); + ++$i; + } + + $i = 0; + while ($queue->valid()) { + $this->sortedColors[$i] = $queue->current(); + $queue->next(); + ++$i; + } + } + + /** + * @param \SplFixedArray $colors + * @param int $limit + * @param int $maxDelta + * + * @return array + */ + protected static function mergeColors(\SplFixedArray $colors, $limit, $maxDelta) + { + $limit = min(count($colors), $limit); + if ($limit === 0) { + return []; + } + if ($limit === 1) { + return [$colors[0]]; + } + $labCache = new \SplFixedArray($limit - 1); + $mergedColors = []; + + foreach ($colors as $color) { + $hasColorBeenMerged = false; + + $colorLab = self::intColorToLab($color); + + foreach ($mergedColors as $i => $mergedColor) { + if (self::ciede2000DeltaE($colorLab, $labCache[$i]) < $maxDelta) { + $hasColorBeenMerged = true; + break; + } + } + + if ($hasColorBeenMerged) { + continue; + } + + $mergedColorCount = count($mergedColors); + $mergedColors[] = $color; + + if ($mergedColorCount + 1 == $limit) { + break; + } + + $labCache[$mergedColorCount] = $colorLab; + } + + return $mergedColors; + } + + /** + * @param array $firstLabColor + * @param array $secondLabColor + * + * @return float + */ + protected static function ciede2000DeltaE($firstLabColor, $secondLabColor) + { + $C1 = sqrt(pow($firstLabColor['a'], 2) + pow($firstLabColor['b'], 2)); + $C2 = sqrt(pow($secondLabColor['a'], 2) + pow($secondLabColor['b'], 2)); + $Cb = ($C1 + $C2) / 2; + + $G = .5 * (1 - sqrt(pow($Cb, 7) / (pow($Cb, 7) + pow(25, 7)))); + + $a1p = (1 + $G) * $firstLabColor['a']; + $a2p = (1 + $G) * $secondLabColor['a']; + + $C1p = sqrt(pow($a1p, 2) + pow($firstLabColor['b'], 2)); + $C2p = sqrt(pow($a2p, 2) + pow($secondLabColor['b'], 2)); + + $h1p = $a1p == 0 && $firstLabColor['b'] == 0 ? 0 : atan2($firstLabColor['b'], $a1p); + $h2p = $a2p == 0 && $secondLabColor['b'] == 0 ? 0 : atan2($secondLabColor['b'], $a2p); + + $LpDelta = $secondLabColor['L'] - $firstLabColor['L']; + $CpDelta = $C2p - $C1p; + + if ($C1p * $C2p == 0) { + $hpDelta = 0; + } elseif (abs($h2p - $h1p) <= 180) { + $hpDelta = $h2p - $h1p; + } elseif ($h2p - $h1p > 180) { + $hpDelta = $h2p - $h1p - 360; + } else { + $hpDelta = $h2p - $h1p + 360; + } + + $HpDelta = 2 * sqrt($C1p * $C2p) * sin($hpDelta / 2); + + $Lbp = ($firstLabColor['L'] + $secondLabColor['L']) / 2; + $Cbp = ($C1p + $C2p) / 2; + + if ($C1p * $C2p == 0) { + $hbp = $h1p + $h2p; + } elseif (abs($h1p - $h2p) <= 180) { + $hbp = ($h1p + $h2p) / 2; + } elseif ($h1p + $h2p < 360) { + $hbp = ($h1p + $h2p + 360) / 2; + } else { + $hbp = ($h1p + $h2p - 360) / 2; + } + + $T = 1 - .17 * cos($hbp - 30) + .24 * cos(2 * $hbp) + .32 * cos(3 * $hbp + 6) - .2 * cos(4 * $hbp - 63); + + $sigmaDelta = 30 * exp(-pow(($hbp - 275) / 25, 2)); + + $Rc = 2 * sqrt(pow($Cbp, 7) / (pow($Cbp, 7) + pow(25, 7))); + + $Sl = 1 + ((.015 * pow($Lbp - 50, 2)) / sqrt(20 + pow($Lbp - 50, 2))); + $Sc = 1 + .045 * $Cbp; + $Sh = 1 + .015 * $Cbp * $T; + + $Rt = -sin(2 * $sigmaDelta) * $Rc; + + return sqrt( + pow($LpDelta / $Sl, 2) + + pow($CpDelta / $Sc, 2) + + pow($HpDelta / $Sh, 2) + + $Rt * ($CpDelta / $Sc) * ($HpDelta / $Sh) + ); + } + + /** + * @param int $color + * + * @return array + */ + protected static function intColorToLab($color) + { + return self::xyzToLab( + self::srgbToXyz( + self::rgbToSrgb( + [ + 'R' => ($color >> 16) & 0xFF, + 'G' => ($color >> 8) & 0xFF, + 'B' => $color & 0xFF, + ] + ) + ) + ); + } + + /** + * @param int $value + * + * @return float + */ + protected static function rgbToSrgbStep($value) + { + $value /= 255; + + return $value <= .03928 ? + $value / 12.92 : + pow(($value + .055) / 1.055, 2.4); + } + + /** + * @param array $rgb + * + * @return array + */ + protected static function rgbToSrgb($rgb) + { + return [ + 'R' => self::rgbToSrgbStep($rgb['R']), + 'G' => self::rgbToSrgbStep($rgb['G']), + 'B' => self::rgbToSrgbStep($rgb['B']), + ]; + } + + /** + * @param array $rgb + * + * @return array + */ + protected static function srgbToXyz($rgb) + { + return [ + 'X' => (.4124564 * $rgb['R']) + (.3575761 * $rgb['G']) + (.1804375 * $rgb['B']), + 'Y' => (.2126729 * $rgb['R']) + (.7151522 * $rgb['G']) + (.0721750 * $rgb['B']), + 'Z' => (.0193339 * $rgb['R']) + (.1191920 * $rgb['G']) + (.9503041 * $rgb['B']), + ]; + } + + /** + * @param float $value + * + * @return float + */ + protected static function xyzToLabStep($value) + { + return $value > 216 / 24389 ? pow($value, 1 / 3) : 841 * $value / 108 + 4 / 29; + } + + /** + * @param array $xyz + * + * @return array + */ + protected static function xyzToLab($xyz) + { + //http://en.wikipedia.org/wiki/Illuminant_D65#Definition + $Xn = .95047; + $Yn = 1; + $Zn = 1.08883; + + // http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions + return [ + 'L' => 116 * self::xyzToLabStep($xyz['Y'] / $Yn) - 16, + 'a' => 500 * (self::xyzToLabStep($xyz['X'] / $Xn) - self::xyzToLabStep($xyz['Y'] / $Yn)), + 'b' => 200 * (self::xyzToLabStep($xyz['Y'] / $Yn) - self::xyzToLabStep($xyz['Z'] / $Zn)), + ]; + } +} diff --git a/vendor/league/color-extractor/src/Palette.php b/vendor/league/color-extractor/src/Palette.php new file mode 100644 index 0000000..5c5266f --- /dev/null +++ b/vendor/league/color-extractor/src/Palette.php @@ -0,0 +1,180 @@ +colors); + } + + /** + * @return \Traversable + */ + public function getIterator(): \Traversable + { + return new \ArrayIterator($this->colors); + } + + /** + * @return int + */ + public function getColorCount($color) + { + if (!array_key_exists($color, $this->colors)) { + return 0; + } + + return $this->colors[$color]; + } + + /** + * @param int $limit = null + * + * @return array + */ + public function getMostUsedColors($limit = null) + { + return array_slice($this->colors, 0, $limit, true); + } + + /** + * @param string $filename + * @param int|null $backgroundColor + * + * @return Palette + * + * @throws \InvalidArgumentException + */ + public static function fromFilename($filename, $backgroundColor = null) + { + if (!is_readable($filename)) { + throw new \InvalidArgumentException('Filename must be a valid path and should be readable'); + } + + return self::fromContents(file_get_contents($filename), $backgroundColor); + } + + /** + * @param string $url + * @param int|null $backgroundColor + * + * @return Palette + * + * @throws \RuntimeException + */ + public static function fromUrl($url, $backgroundColor = null) + { + if (!function_exists('curl_init')){ + return self::fromContents(file_get_contents($url)); + } + + $ch = curl_init(); + try { + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $contents = curl_exec($ch); + if ($contents === false) { + throw new \RuntimeException('Failed to fetch image from URL'); + } + } finally { + curl_close($ch); + } + + return self::fromContents($contents, $backgroundColor); + } + + /** + * Create instance with file contents + * + * @param string $contents + * @param int|null $backgroundColor + * + * @return Palette + */ + public static function fromContents($contents, $backgroundColor = null) { + $image = imagecreatefromstring($contents); + $palette = self::fromGD($image, $backgroundColor); + imagedestroy($image); + + return $palette; + } + + /** + * @param \GDImage|resource $image + * @param int|null $backgroundColor + * + * @return Palette + * + * @throws \InvalidArgumentException + */ + public static function fromGD($image, ?int $backgroundColor = null) + { + if (!$image instanceof \GDImage && (!is_resource($image) || get_resource_type($image) !== 'gd')) { + throw new \InvalidArgumentException('Image must be a gd resource'); + } + if ($backgroundColor !== null && (!is_numeric($backgroundColor) || $backgroundColor < 0 || $backgroundColor > 16777215)) { + throw new \InvalidArgumentException(sprintf('"%s" does not represent a valid color', $backgroundColor)); + } + + $palette = new self(); + + $areColorsIndexed = !imageistruecolor($image); + $imageWidth = imagesx($image); + $imageHeight = imagesy($image); + $palette->colors = []; + + $backgroundColorRed = ($backgroundColor >> 16) & 0xFF; + $backgroundColorGreen = ($backgroundColor >> 8) & 0xFF; + $backgroundColorBlue = $backgroundColor & 0xFF; + + for ($x = 0; $x < $imageWidth; ++$x) { + for ($y = 0; $y < $imageHeight; ++$y) { + $color = imagecolorat($image, $x, $y); + if ($areColorsIndexed) { + $colorComponents = imagecolorsforindex($image, $color); + $color = ($colorComponents['alpha'] * 16777216) + + ($colorComponents['red'] * 65536) + + ($colorComponents['green'] * 256) + + ($colorComponents['blue']); + } + + if ($alpha = $color >> 24) { + if ($backgroundColor === null) { + continue; + } + + $alpha /= 127; + $color = (int) (($color >> 16 & 0xFF) * (1 - $alpha) + $backgroundColorRed * $alpha) * 65536 + + (int) (($color >> 8 & 0xFF) * (1 - $alpha) + $backgroundColorGreen * $alpha) * 256 + + (int) (($color & 0xFF) * (1 - $alpha) + $backgroundColorBlue * $alpha); + } + + isset($palette->colors[$color]) ? + $palette->colors[$color] += 1 : + $palette->colors[$color] = 1; + } + } + + arsort($palette->colors); + + return $palette; + } + + protected function __construct() + { + $this->colors = []; + } +} diff --git a/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php b/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php new file mode 100644 index 0000000..b4ee661 --- /dev/null +++ b/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php @@ -0,0 +1,9 @@ + +# +# Original SmartyPants +# Copyright (c) 2003-2004 John Gruber +# +# +namespace Michelf; + + +# +# SmartyPants Parser Class +# + +class SmartyPants { + + ### Version ### + + const SMARTYPANTSLIB_VERSION = "1.8.1"; + + + ### Presets + + # SmartyPants does nothing at all + const ATTR_DO_NOTHING = 0; + # "--" for em-dashes; no en-dash support + const ATTR_EM_DASH = 1; + # "---" for em-dashes; "--" for en-dashes + const ATTR_LONG_EM_DASH_SHORT_EN = 2; + # "--" for em-dashes; "---" for en-dashes + const ATTR_SHORT_EM_DASH_LONG_EN = 3; + # "--" for em-dashes; "---" for en-dashes + const ATTR_STUPEFY = -1; + + # The default preset: ATTR_EM_DASH + const ATTR_DEFAULT = SmartyPants::ATTR_EM_DASH; + + + ### Standard Function Interface ### + + public static function defaultTransform($text, $attr = SmartyPants::ATTR_DEFAULT) { + # + # Initialize the parser and return the result of its transform method. + # This will work fine for derived classes too. + # + # Take parser class on which this function was called. + $parser_class = \get_called_class(); + + # try to take parser from the static parser list + static $parser_list; + $parser =& $parser_list[$parser_class][$attr]; + + # create the parser if not already set + if (!$parser) + $parser = new $parser_class($attr); + + # Transform text using parser. + return $parser->transform($text); + } + + + ### Configuration Variables ### + + # Partial regex for matching tags to skip + public $tags_to_skip = 'pre|code|kbd|script|style|math'; + + # Options to specify which transformations to make: + public $do_nothing = 0; # disable all transforms + public $do_quotes = 0; + public $do_backticks = 0; # 1 => double only, 2 => double & single + public $do_dashes = 0; # 1, 2, or 3 for the three modes described above + public $do_ellipses = 0; + public $do_stupefy = 0; + public $convert_quot = 0; # should we translate " entities into normal quotes? + + # Smart quote characters: + # Opening and closing smart double-quotes. + public $smart_doublequote_open = '“'; + public $smart_doublequote_close = '”'; + public $smart_singlequote_open = '‘'; + public $smart_singlequote_close = '’'; # Also apostrophe. + + # ``Backtick quotes'' + public $backtick_doublequote_open = '“'; // replacement for `` + public $backtick_doublequote_close = '”'; // replacement for '' + public $backtick_singlequote_open = '‘'; // replacement for ` + public $backtick_singlequote_close = '’'; // replacement for ' (also apostrophe) + + # Other punctuation + public $em_dash = '—'; + public $en_dash = '–'; + public $ellipsis = '…'; + + ### Parser Implementation ### + + public function __construct($attr = SmartyPants::ATTR_DEFAULT) { + # + # Initialize a parser with certain attributes. + # + # Parser attributes: + # 0 : do nothing + # 1 : set all + # 2 : set all, using old school en- and em- dash shortcuts + # 3 : set all, using inverted old school en and em- dash shortcuts + # + # q : quotes + # b : backtick quotes (``double'' only) + # B : backtick quotes (``double'' and `single') + # d : dashes + # D : old school dashes + # i : inverted old school dashes + # e : ellipses + # w : convert " entities to " for Dreamweaver users + # + if ($attr == "0") { + $this->do_nothing = 1; + } + else if ($attr == "1") { + # Do everything, turn all options on. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 1; + $this->do_ellipses = 1; + } + else if ($attr == "2") { + # Do everything, turn all options on, use old school dash shorthand. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 2; + $this->do_ellipses = 1; + } + else if ($attr == "3") { + # Do everything, turn all options on, use inverted old school dash shorthand. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 3; + $this->do_ellipses = 1; + } + else if ($attr == "-1") { + # Special "stupefy" mode. + $this->do_stupefy = 1; + } + else { + $chars = preg_split('//', $attr); + foreach ($chars as $c){ + if ($c == "q") { $this->do_quotes = 1; } + else if ($c == "b") { $this->do_backticks = 1; } + else if ($c == "B") { $this->do_backticks = 2; } + else if ($c == "d") { $this->do_dashes = 1; } + else if ($c == "D") { $this->do_dashes = 2; } + else if ($c == "i") { $this->do_dashes = 3; } + else if ($c == "e") { $this->do_ellipses = 1; } + else if ($c == "w") { $this->convert_quot = 1; } + else { + # Unknown attribute option, ignore. + } + } + } + } + + public function transform($text) { + + if ($this->do_nothing) { + return $text; + } + + $tokens = $this->tokenizeHTML($text); + $result = ''; + $in_pre = 0; # Keep track of when we're inside
 or  tags.
+
+		$prev_token_last_char = ""; # This is a cheat, used to get some context
+									# for one-character tokens that consist of 
+									# just a quote char. What we do is remember
+									# the last character of the previous text
+									# token, to use as context to curl single-
+									# character quote tokens correctly.
+
+		foreach ($tokens as $cur_token) {
+			if ($cur_token[0] == "tag") {
+				# Don't mess with quotes inside tags.
+				$result .= $cur_token[1];
+				if (preg_match('@<(/?)(?:'.$this->tags_to_skip.')[\s>]@', $cur_token[1], $matches)) {
+					$in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
+				}
+			} else {
+				$t = $cur_token[1];
+				$last_char = substr($t, -1); # Remember last char of this token before processing.
+				if (! $in_pre) {
+					$t = $this->educate($t, $prev_token_last_char);
+				}
+				$prev_token_last_char = $last_char;
+				$result .= $t;
+			}
+		}
+
+		return $result;
+	}
+
+
+	function decodeEntitiesInConfiguration() {
+	#
+	#   Utility function that converts entities in configuration variables to
+	#   UTF-8 characters.
+	#
+		$output_config_vars = array(
+			'smart_doublequote_open',
+			'smart_doublequote_close',
+			'smart_singlequote_open',
+			'smart_singlequote_close',
+			'backtick_doublequote_open',
+			'backtick_doublequote_close',
+			'backtick_singlequote_open',
+			'backtick_singlequote_close',
+			'em_dash',
+			'en_dash',
+			'ellipsis',
+		);
+		foreach ($output_config_vars as $var) {
+			$this->$var = html_entity_decode($this->$var);
+		}
+	}
+
+
+	protected function educate($t, $prev_token_last_char) {
+		$t = $this->processEscapes($t);
+
+		if ($this->convert_quot) {
+			$t = preg_replace('/"/', '"', $t);
+		}
+
+		if ($this->do_dashes) {
+			if ($this->do_dashes == 1) $t = $this->educateDashes($t);
+			if ($this->do_dashes == 2) $t = $this->educateDashesOldSchool($t);
+			if ($this->do_dashes == 3) $t = $this->educateDashesOldSchoolInverted($t);
+		}
+
+		if ($this->do_ellipses) $t = $this->educateEllipses($t);
+
+		# Note: backticks need to be processed before quotes.
+		if ($this->do_backticks) {
+			$t = $this->educateBackticks($t);
+			if ($this->do_backticks == 2) $t = $this->educateSingleBackticks($t);
+		}
+
+		if ($this->do_quotes) {
+			if ($t == "'") {
+				# Special case: single-character ' token
+				if (preg_match('/\S/', $prev_token_last_char)) {
+					$t = $this->smart_singlequote_close;
+				}
+				else {
+					$t = $this->smart_singlequote_open;
+				}
+			}
+			else if ($t == '"') {
+				# Special case: single-character " token
+				if (preg_match('/\S/', $prev_token_last_char)) {
+					$t = $this->smart_doublequote_close;
+				}
+				else {
+					$t = $this->smart_doublequote_open;
+				}
+			}
+			else {
+				# Normal case:
+				$t = $this->educateQuotes($t);
+			}
+		}
+
+		if ($this->do_stupefy) $t = $this->stupefyEntities($t);
+		
+		return $t;
+	}
+
+
+	protected function educateQuotes($_) {
+	#
+	#   Parameter:  String.
+	#
+	#   Returns:    The string, with "educated" curly quote HTML entities.
+	#
+	#   Example input:  "Isn't this fun?"
+	#   Example output: “Isn’t this fun?”
+	#
+		$dq_open  = $this->smart_doublequote_open;
+		$dq_close = $this->smart_doublequote_close;
+		$sq_open  = $this->smart_singlequote_open;
+		$sq_close = $this->smart_singlequote_close;
+	
+		# Make our own "punctuation" character class, because the POSIX-style
+		# [:PUNCT:] is only available in Perl 5.6 or later:
+		$punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]";
+
+		# Special case if the very first character is a quote
+		# followed by punctuation at a non-word-break. Close the quotes by brute force:
+		$_ = preg_replace(
+			array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"),
+			array($sq_close,                 $dq_close), $_);
+
+		# Special case for double sets of quotes, e.g.:
+		#   

He said, "'Quoted' words in a larger quote."

+ $_ = preg_replace( + array("/\"'(?=\w)/", "/'\"(?=\w)/"), + array($dq_open.$sq_open, $sq_open.$dq_open), $_); + + # Special case for decade abbreviations (the '80s): + $_ = preg_replace("/'(?=\\d{2}s)/", $sq_close, $_); + + $close_class = '[^\ \t\r\n\[\{\(\-]'; + $dec_dashes = '&\#8211;|&\#8212;'; + + # Get most opening single quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + ' # the quote + (?=\\w) # followed by a word character + }x", '\1'.$sq_open, $_); + # Single closing quotes: + $_ = preg_replace("{ + ($close_class)? + ' + (?(1)| # If $1 captured, then do nothing; + (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace + ) # char or an 's' at a word ending position. This + # is a special case to handle something like: + # \"Custer's Last Stand.\" + }xi", '\1'.$sq_close, $_); + + # Any remaining single quotes should be opening ones: + $_ = str_replace("'", $sq_open, $_); + + + # Get most opening double quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + \" # the quote + (?=\\w) # followed by a word character + }x", '\1'.$dq_open, $_); + + # Double closing quotes: + $_ = preg_replace("{ + ($close_class)? + \" + (?(1)|(?=\\s)) # If $1 captured, then do nothing; + # if not, then make sure the next char is whitespace. + }x", '\1'.$dq_close, $_); + + # Any remaining quotes should be opening ones. + $_ = str_replace('"', $dq_open, $_); + + return $_; + } + + + protected function educateBackticks($_) { + # + # Parameter: String. + # Returns: The string, with ``backticks'' -style double quotes + # translated into HTML curly quote entities. + # + # Example input: ``Isn't this fun?'' + # Example output: “Isn't this fun?” + # + + $_ = str_replace(array("``", "''",), + array($this->backtick_doublequote_open, + $this->backtick_doublequote_close), $_); + return $_; + } + + + protected function educateSingleBackticks($_) { + # + # Parameter: String. + # Returns: The string, with `backticks' -style single quotes + # translated into HTML curly quote entities. + # + # Example input: `Isn't this fun?' + # Example output: ‘Isn’t this fun?’ + # + + $_ = str_replace(array("`", "'",), + array($this->backtick_singlequote_open, + $this->backtick_singlequote_close), $_); + return $_; + } + + + protected function educateDashes($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an em-dash HTML entity. + # + + $_ = str_replace('--', $this->em_dash, $_); + return $_; + } + + + protected function educateDashesOldSchool($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an en-dash HTML entity, and each "---" translated to + # an em-dash HTML entity. + # + + # em en + $_ = str_replace(array("---", "--",), + array($this->em_dash, $this->en_dash), $_); + return $_; + } + + + protected function educateDashesOldSchoolInverted($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an em-dash HTML entity, and each "---" translated to + # an en-dash HTML entity. Two reasons why: First, unlike the + # en- and em-dash syntax supported by + # EducateDashesOldSchool(), it's compatible with existing + # entries written before SmartyPants 1.1, back when "--" was + # only used for em-dashes. Second, em-dashes are more + # common than en-dashes, and so it sort of makes sense that + # the shortcut should be shorter to type. (Thanks to Aaron + # Swartz for the idea.) + # + + # en em + $_ = str_replace(array("---", "--",), + array($this->en_dash, $this->em_dash), $_); + return $_; + } + + + protected function educateEllipses($_) { + # + # Parameter: String. + # Returns: The string, with each instance of "..." translated to + # an ellipsis HTML entity. Also converts the case where + # there are spaces between the dots. + # + # Example input: Huh...? + # Example output: Huh…? + # + + $_ = str_replace(array("...", ". . .",), $this->ellipsis, $_); + return $_; + } + + + protected function stupefyEntities($_) { + # + # Parameter: String. + # Returns: The string, with each SmartyPants HTML entity translated to + # its ASCII counterpart. + # + # Example input: “Hello — world.” + # Example output: "Hello -- world." + # + + # en-dash em-dash + $_ = str_replace(array('–', '—'), + array('-', '--'), $_); + + # single quote open close + $_ = str_replace(array('‘', '’'), "'", $_); + + # double quote open close + $_ = str_replace(array('“', '”'), '"', $_); + + $_ = str_replace('…', '...', $_); # ellipsis + + return $_; + } + + + protected function processEscapes($_) { + # + # Parameter: String. + # Returns: The string, with after processing the following backslash + # escape sequences. This is useful if you want to force a "dumb" + # quote or other character to appear. + # + # Escape Value + # ------ ----- + # \\ \ + # \" " + # \' ' + # \. . + # \- - + # \` ` + # + $_ = str_replace( + array('\\\\', '\"', "\'", '\.', '\-', '\`'), + array('\', '"', ''', '.', '-', '`'), $_); + + return $_; + } + + + protected function tokenizeHTML($str) { + # + # Parameter: String containing HTML markup. + # Returns: An array of the tokens comprising the input + # string. Each token is either a tag (possibly with nested, + # tags contained therein, such as , or a + # run of text between tags. Each element of the array is a + # two-element array; the first is either 'tag' or 'text'; + # the second is the actual value. + # + # + # Regular expression derived from the _tokenize() subroutine in + # Brad Choate's MTRegex plugin. + # + # + $index = 0; + $tokens = array(); + + $match = '(?s:)|'. # comment + '(?s:<\?.*?\?>)|'. # processing instruction + # regular tags + '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)'; + + $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE); + + foreach ($parts as $part) { + if (++$index % 2 && $part != '') + $tokens[] = array('text', $part); + else + $tokens[] = array('tag', $part); + } + return $tokens; + } + +} diff --git a/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php b/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php new file mode 100644 index 0000000..9b3d274 --- /dev/null +++ b/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php @@ -0,0 +1,10 @@ + +# +# Original SmartyPants +# Copyright (c) 2003-2004 John Gruber +# +# +namespace Michelf; + + +# +# SmartyPants Typographer Parser Class +# +class SmartyPantsTypographer extends \Michelf\SmartyPants { + + ### Configuration Variables ### + + # Options to specify which transformations to make: + public $do_comma_quotes = 0; + public $do_guillemets = 0; + public $do_geresh_gershayim = 0; + public $do_space_emdash = 0; + public $do_space_endash = 0; + public $do_space_colon = 0; + public $do_space_semicolon = 0; + public $do_space_marks = 0; + public $do_space_frenchquote = 0; + public $do_space_thousand = 0; + public $do_space_unit = 0; + + # Quote characters for replacing ASCII approximations + public $doublequote_low = "„"; // replacement for ,, + public $guillemet_leftpointing = "«"; // replacement for << + public $guillemet_rightpointing = "»"; // replacement for >> + public $geresh = "׳"; + public $gershayim = "״"; + + # Space characters for different places: + # Space around em-dashes. "He_—_or she_—_should change that." + public $space_emdash = " "; + # Space around en-dashes. "He_–_or she_–_should change that." + public $space_endash = " "; + # Space before a colon. "He said_: here it is." + public $space_colon = " "; + # Space before a semicolon. "That's what I said_; that's what he said." + public $space_semicolon = " "; + # Space before a question mark and an exclamation mark: "¡_Holà_! What_?" + public $space_marks = " "; + # Space inside french quotes. "Voici la «_chose_» qui m'a attaqué." + public $space_frenchquote = " "; + # Space as thousand separator. "On compte 10_000 maisons sur cette liste." + public $space_thousand = " "; + # Space before a unit abreviation. "This 12_kg of matter costs 10_$." + public $space_unit = " "; + + + # Expression of a space (breakable or not): + public $space = '(?: | | |�*160;|�*[aA]0;)'; + + + ### Parser Implementation ### + + public function __construct($attr = SmartyPants::ATTR_DEFAULT) { + # + # Initialize a SmartyPantsTypographer_Parser with certain attributes. + # + # Parser attributes: + # 0 : do nothing + # 1 : set all, except dash spacing + # 2 : set all, except dash spacing, using old school en- and em- dash shortcuts + # 3 : set all, except dash spacing, using inverted old school en and em- dash shortcuts + # + # Punctuation: + # q -> quotes + # b -> backtick quotes (``double'' only) + # B -> backtick quotes (``double'' and `single') + # c -> comma quotes (,,double`` only) + # g -> guillemets (<> only) + # d -> dashes + # D -> old school dashes + # i -> inverted old school dashes + # e -> ellipses + # w -> convert " entities to " for Dreamweaver users + # + # Spacing: + # : -> colon spacing +- + # ; -> semicolon spacing +- + # m -> question and exclamation marks spacing +- + # h -> em-dash spacing +- + # H -> en-dash spacing +- + # f -> french quote spacing +- + # t -> thousand separator spacing - + # u -> unit spacing +- + # (you can add a plus sign after some of these options denoted by + to + # add the space when it is not already present, or you can add a minus + # sign to completly remove any space present) + # + # Initialize inherited SmartyPants parser. + parent::__construct($attr); + + if ($attr == "1" || $attr == "2" || $attr == "3") { + # Do everything, turn all options on. + $this->do_comma_quotes = 1; + $this->do_guillemets = 1; + $this->do_geresh_gershayim = 1; + $this->do_space_emdash = 1; + $this->do_space_endash = 1; + $this->do_space_colon = 1; + $this->do_space_semicolon = 1; + $this->do_space_marks = 1; + $this->do_space_frenchquote = 1; + $this->do_space_thousand = 1; + $this->do_space_unit = 1; + } + else if ($attr == "-1") { + # Special "stupefy" mode. + $this->do_stupefy = 1; + } + else { + $chars = preg_split('//', $attr); + foreach ($chars as $c){ + if ($c == "c") { $current =& $this->do_comma_quotes; } + else if ($c == "g") { $current =& $this->do_guillemets; } + else if ($c == "G") { $current =& $this->do_geresh_gershayim; } + else if ($c == ":") { $current =& $this->do_space_colon; } + else if ($c == ";") { $current =& $this->do_space_semicolon; } + else if ($c == "m") { $current =& $this->do_space_marks; } + else if ($c == "h") { $current =& $this->do_space_emdash; } + else if ($c == "H") { $current =& $this->do_space_endash; } + else if ($c == "f") { $current =& $this->do_space_frenchquote; } + else if ($c == "t") { $current =& $this->do_space_thousand; } + else if ($c == "u") { $current =& $this->do_space_unit; } + else if ($c == "+") { + $current = 2; + unset($current); + } + else if ($c == "-") { + $current = -1; + unset($current); + } + else { + # Unknown attribute option, ignore. + } + $current = 1; + } + } + } + + + function decodeEntitiesInConfiguration() { + parent::decodeEntitiesInConfiguration(); + $output_config_vars = array( + 'doublequote_low', + 'guillemet_leftpointing', + 'guillemet_rightpointing', + 'space_emdash', + 'space_endash', + 'space_colon', + 'space_semicolon', + 'space_marks', + 'space_frenchquote', + 'space_thousand', + 'space_unit', + ); + foreach ($output_config_vars as $var) { + $this->$var = html_entity_decode($this->$var); + } + } + + + function educate($t, $prev_token_last_char) { + # must happen before regular smart quotes + if ($this->do_geresh_gershayim) $t = $this->educateGereshGershayim($t); + + $t = parent::educate($t, $prev_token_last_char); + + if ($this->do_comma_quotes) $t = $this->educateCommaQuotes($t); + if ($this->do_guillemets) $t = $this->educateGuillemets($t); + + if ($this->do_space_emdash) $t = $this->spaceEmDash($t); + if ($this->do_space_endash) $t = $this->spaceEnDash($t); + if ($this->do_space_colon) $t = $this->spaceColon($t); + if ($this->do_space_semicolon) $t = $this->spaceSemicolon($t); + if ($this->do_space_marks) $t = $this->spaceMarks($t); + if ($this->do_space_frenchquote) $t = $this->spaceFrenchQuotes($t); + if ($this->do_space_thousand) $t = $this->spaceThousandSeparator($t); + if ($this->do_space_unit) $t = $this->spaceUnit($t); + + return $t; + } + + + protected function educateCommaQuotes($_) { + # + # Parameter: String. + # Returns: The string, with ,,comma,, -style double quotes + # translated into HTML curly quote entities. + # + # Example input: ,,Isn't this fun?,, + # Example output: „Isn't this fun?„ + # + # Note: this is meant to be used alongside with backtick quotes; there is + # no language that use only lower quotations alone mark like in the example. + # + $_ = str_replace(",,", $this->doublequote_low, $_); + return $_; + } + + + protected function educateGuillemets($_) { + # + # Parameter: String. + # Returns: The string, with << guillemets >> -style quotes + # translated into HTML guillemets entities. + # + # Example input: << Isn't this fun? >> + # Example output: „ Isn't this fun? „ + # + $_ = preg_replace("/(?:<|<){2}/", $this->guillemet_leftpointing, $_); + $_ = preg_replace("/(?:>|>){2}/", $this->guillemet_rightpointing, $_); + return $_; + } + + + protected function educateGereshGershayim($_) { + # + # Parameter: String, UTF-8 encoded. + # Returns: The string, where simple a or double quote surrounded by + # two hebrew characters is replaced into a typographic + # geresh or gershayim punctuation mark. + # + # Example input: צה"ל / צ'ארלס + # Example output: צה״ל / צ׳ארלס + # + // surrounding code points can be U+0590 to U+05BF and U+05D0 to U+05F2 + // encoded in UTF-8: D6.90 to D6.BF and D7.90 to D7.B2 + $_ = preg_replace('/(?<=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])\'(?=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])/', $this->geresh, $_); + $_ = preg_replace('/(?<=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])"(?=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])/', $this->gershayim, $_); + return $_; + } + + + protected function spaceFrenchQuotes($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # inside french-style quotes, only french quotes. + # + # Example input: Quotes in « French », »German« and »Finnish» style. + # Example output: Quotes in «_French_», »German« and »Finnish» style. + # + $opt = ( $this->do_space_frenchquote == 2 ? '?' : '' ); + $chr = ( $this->do_space_frenchquote != -1 ? $this->space_frenchquote : '' ); + + # Characters allowed immediatly outside quotes. + $outside_char = $this->space . '|\s|[.,:;!?\[\](){}|@*~=+-]|¡|¿'; + + $_ = preg_replace( + "/(^|$outside_char)(«|«|›|‹)$this->space$opt/", + "\\1\\2$chr", $_); + $_ = preg_replace( + "/$this->space$opt(»|»|‹|›)($outside_char|$)/", + "$chr\\1\\2", $_); + return $_; + } + + + protected function spaceColon($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before colons. + # + # Example input: Ingredients : fun. + # Example output: Ingredients_: fun. + # + $opt = ( $this->do_space_colon == 2 ? '?' : '' ); + $chr = ( $this->do_space_colon != -1 ? $this->space_colon : '' ); + + $_ = preg_replace("/$this->space$opt(:)(\\s|$)/m", + "$chr\\1\\2", $_); + return $_; + } + + + protected function spaceSemicolon($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before semicolons. + # + # Example input: There he goes ; there she goes. + # Example output: There he goes_; there she goes. + # + $opt = ( $this->do_space_semicolon == 2 ? '?' : '' ); + $chr = ( $this->do_space_semicolon != -1 ? $this->space_semicolon : '' ); + + $_ = preg_replace("/$this->space(;)(?=\\s|$)/m", + " \\1", $_); + $_ = preg_replace("/((?:^|\\s)(?>[^&;\\s]+|&#?[a-zA-Z0-9]+;)*)". + " $opt(;)(?=\\s|$)/m", + "\\1$chr\\2", $_); + return $_; + } + + + protected function spaceMarks($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # around question and exclamation marks. + # + # Example input: ¡ Holà ! What ? + # Example output: ¡_Holà_! What_? + # + $opt = ( $this->do_space_marks == 2 ? '?' : '' ); + $chr = ( $this->do_space_marks != -1 ? $this->space_marks : '' ); + + // Regular marks. + $_ = preg_replace("/$this->space$opt([?!]+)/", "$chr\\1", $_); + + // Inverted marks. + $imarks = "(?:¡|¡|¡|&#x[Aa]1;|¿|¿|¿|&#x[Bb][Ff];)"; + $_ = preg_replace("/($imarks+)$this->space$opt/", "\\1$chr", $_); + + return $_; + } + + + protected function spaceEmDash($_) { + # + # Parameters: String, two replacement characters separated by a hyphen (`-`), + # and forcing flag. + # + # Returns: The string, with appropriates spaces replaced + # around dashes. + # + # Example input: Then — without any plan — the fun happend. + # Example output: Then_—_without any plan_—_the fun happend. + # + $opt = ( $this->do_space_emdash == 2 ? '?' : '' ); + $chr = ( $this->do_space_emdash != -1 ? $this->space_emdash : '' ); + $_ = preg_replace("/$this->space$opt(—|—)$this->space$opt/", + "$chr\\1$chr", $_); + return $_; + } + + + protected function spaceEnDash($_) { + # + # Parameters: String, two replacement characters separated by a hyphen (`-`), + # and forcing flag. + # + # Returns: The string, with appropriates spaces replaced + # around dashes. + # + # Example input: Then — without any plan — the fun happend. + # Example output: Then_—_without any plan_—_the fun happend. + # + $opt = ( $this->do_space_endash == 2 ? '?' : '' ); + $chr = ( $this->do_space_endash != -1 ? $this->space_endash : '' ); + $_ = preg_replace("/$this->space$opt(–|–)$this->space$opt/", + "$chr\\1$chr", $_); + return $_; + } + + + protected function spaceThousandSeparator($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # inside numbers (thousand separator in french). + # + # Example input: Il y a 10 000 insectes amusants dans ton jardin. + # Example output: Il y a 10_000 insectes amusants dans ton jardin. + # + $chr = ( $this->do_space_thousand != -1 ? $this->space_thousand : '' ); + $_ = preg_replace('/([0-9]) ([0-9])/', "\\1$chr\\2", $_); + return $_; + } + + + protected $units = ' + ### Metric units (with prefixes) + (?: + p | + µ | µ | &\#0*181; | &\#[xX]0*[Bb]5; | + [mcdhkMGT] + )? + (?: + [mgstAKNJWCVFSTHBL]|mol|cd|rad|Hz|Pa|Wb|lm|lx|Bq|Gy|Sv|kat| + Ω | Ohm | Ω | &\#0*937; | &\#[xX]0*3[Aa]9; + )| + ### Computers units (KB, Kb, TB, Kbps) + [kKMGT]?(?:[oBb]|[oBb]ps|flops)| + ### Money + ¢ | ¢ | &\#0*162; | &\#[xX]0*[Aa]2; | + M?(?: + £ | £ | &\#0*163; | &\#[xX]0*[Aa]3; | + ¥ | ¥ | &\#0*165; | &\#[xX]0*[Aa]5; | + € | € | &\#0*8364; | &\#[xX]0*20[Aa][Cc]; | + $ + )| + ### Other units + (?: ° | ° | &\#0*176; | &\#[xX]0*[Bb]0; ) [CF]? | + %|pt|pi|M?px|em|en|gal|lb|[NSEOW]|[NS][EOW]|ha|mbar + '; //x + + protected function spaceUnit($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before unit symbols. + # + # Example input: Get 3 mol of fun for 3 $. + # Example output: Get 3_mol of fun for 3_$. + # + $opt = ( $this->do_space_unit == 2 ? '?' : '' ); + $chr = ( $this->do_space_unit != -1 ? $this->space_unit : '' ); + + $_ = preg_replace('/ + (?:([0-9])[ ]'.$opt.') # Number followed by space. + ('.$this->units.') # Unit. + (?![a-zA-Z0-9]) # Negative lookahead for other unit characters. + /x', + "\\1$chr\\2", $_); + + return $_; + } + + + protected function spaceAbbr($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # around abbreviations. + # + # Example input: Fun i.e. something pleasant. + # Example output: Fun i.e._something pleasant. + # + $opt = ( $this->do_space_abbr == 2 ? '?' : '' ); + + $_ = preg_replace("/(^|\s)($this->abbr_after) $opt/m", + "\\1\\2$this->space_abbr", $_); + $_ = preg_replace("/( )$opt($this->abbr_sp_before)(?![a-zA-Z'])/m", + "\\1$this->space_abbr\\2", $_); + return $_; + } + + + protected function stupefyEntities($_) { + # + # Adding angle quotes and lower quotes to SmartyPants's stupefy mode. + # + $_ = parent::stupefyEntities($_); + + $_ = str_replace(array('„', '«', '»'), '"', $_); + + return $_; + } + + + protected function processEscapes($_) { + # + # Adding a few more escapes to SmartyPants's escapes: + # + # Escape Value + # ------ ----- + # \, , + # \< < + # \> > + # + $_ = parent::processEscapes($_); + + $_ = str_replace( + array('\,', '\<', '\>', '\<', '\>'), + array(',', '<', '>', '<', '>'), $_); + + return $_; + } +} diff --git a/vendor/michelf/php-smartypants/Readme.php b/vendor/michelf/php-smartypants/Readme.php new file mode 100644 index 0000000..55e840e --- /dev/null +++ b/vendor/michelf/php-smartypants/Readme.php @@ -0,0 +1,36 @@ + + + + + PHP Smartypants Lib - Readme + + + + + diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php new file mode 100644 index 0000000..6e766d8 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php @@ -0,0 +1,308 @@ + Filter, 'matcher' => Matcher] pairs. + */ + private $filters = []; + + /** + * Type Filters to apply. + * + * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs. + */ + private $typeFilters = []; + + /** + * @var bool + */ + private $skipUncloneable = false; + + /** + * @var bool + */ + private $useCloneMethod; + + /** + * @param bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used + * instead of the regular deep cloning. + */ + public function __construct($useCloneMethod = false) + { + $this->useCloneMethod = $useCloneMethod; + + $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); + $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); + $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); + } + + /** + * If enabled, will not throw an exception when coming across an uncloneable property. + * + * @param $skipUncloneable + * + * @return $this + */ + public function skipUncloneable($skipUncloneable = true) + { + $this->skipUncloneable = $skipUncloneable; + + return $this; + } + + /** + * Deep copies the given object. + * + * @param mixed $object + * + * @return mixed + */ + public function copy($object) + { + $this->hashMap = []; + + return $this->recursiveCopy($object); + } + + public function addFilter(Filter $filter, Matcher $matcher) + { + $this->filters[] = [ + 'matcher' => $matcher, + 'filter' => $filter, + ]; + } + + public function prependFilter(Filter $filter, Matcher $matcher) + { + array_unshift($this->filters, [ + 'matcher' => $matcher, + 'filter' => $filter, + ]); + } + + public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher) + { + $this->typeFilters[] = [ + 'matcher' => $matcher, + 'filter' => $filter, + ]; + } + + private function recursiveCopy($var) + { + // Matches Type Filter + if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) { + return $filter->apply($var); + } + + // Resource + if (is_resource($var)) { + return $var; + } + + // Array + if (is_array($var)) { + return $this->copyArray($var); + } + + // Scalar + if (! is_object($var)) { + return $var; + } + + // Enum + if (PHP_VERSION_ID >= 80100 && enum_exists(get_class($var))) { + return $var; + } + + // Object + return $this->copyObject($var); + } + + /** + * Copy an array + * @param array $array + * @return array + */ + private function copyArray(array $array) + { + foreach ($array as $key => $value) { + $array[$key] = $this->recursiveCopy($value); + } + + return $array; + } + + /** + * Copies an object. + * + * @param object $object + * + * @throws CloneException + * + * @return object + */ + private function copyObject($object) + { + $objectHash = spl_object_hash($object); + + if (isset($this->hashMap[$objectHash])) { + return $this->hashMap[$objectHash]; + } + + $reflectedObject = new ReflectionObject($object); + $isCloneable = $reflectedObject->isCloneable(); + + if (false === $isCloneable) { + if ($this->skipUncloneable) { + $this->hashMap[$objectHash] = $object; + + return $object; + } + + throw new CloneException( + sprintf( + 'The class "%s" is not cloneable.', + $reflectedObject->getName() + ) + ); + } + + $newObject = clone $object; + $this->hashMap[$objectHash] = $newObject; + + if ($this->useCloneMethod && $reflectedObject->hasMethod('__clone')) { + return $newObject; + } + + if ($newObject instanceof DateTimeInterface || $newObject instanceof DateTimeZone) { + return $newObject; + } + + foreach (ReflectionHelper::getProperties($reflectedObject) as $property) { + $this->copyObjectProperty($newObject, $property); + } + + return $newObject; + } + + private function copyObjectProperty($object, ReflectionProperty $property) + { + // Ignore static properties + if ($property->isStatic()) { + return; + } + + // Apply the filters + foreach ($this->filters as $item) { + /** @var Matcher $matcher */ + $matcher = $item['matcher']; + /** @var Filter $filter */ + $filter = $item['filter']; + + if ($matcher->matches($object, $property->getName())) { + $filter->apply( + $object, + $property->getName(), + function ($object) { + return $this->recursiveCopy($object); + } + ); + + if ($filter instanceof ChainableFilter) { + continue; + } + + // If a filter matches, we stop processing this property + return; + } + } + + $property->setAccessible(true); + + // Ignore uninitialized properties (for PHP >7.4) + if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { + return; + } + + $propertyValue = $property->getValue($object); + + // Copy the property + $property->setValue($object, $this->recursiveCopy($propertyValue)); + } + + /** + * Returns first filter that matches variable, `null` if no such filter found. + * + * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and + * 'matcher' with value of type {@see TypeMatcher} + * @param mixed $var + * + * @return TypeFilter|null + */ + private function getFirstMatchedTypeFilter(array $filterRecords, $var) + { + $matched = $this->first( + $filterRecords, + function (array $record) use ($var) { + /* @var TypeMatcher $matcher */ + $matcher = $record['matcher']; + + return $matcher->matches($var); + } + ); + + return isset($matched) ? $matched['filter'] : null; + } + + /** + * Returns first element that matches predicate, `null` if no such element found. + * + * @param array $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs. + * @param callable $predicate Predicate arguments are: element. + * + * @return array|null Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and 'matcher' + * with value of type {@see TypeMatcher} or `null`. + */ + private function first(array $elements, callable $predicate) + { + foreach ($elements as $element) { + if (call_user_func($predicate, $element)) { + return $element; + } + } + + return null; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php new file mode 100644 index 0000000..c046706 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php @@ -0,0 +1,9 @@ +filter = $filter; + } + + public function apply($object, $property, $objectCopier) + { + $this->filter->apply($object, $property, $objectCopier); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php new file mode 100644 index 0000000..e6d9377 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php @@ -0,0 +1,33 @@ +setAccessible(true); + $oldCollection = $reflectionProperty->getValue($object); + + $newCollection = $oldCollection->map( + function ($item) use ($objectCopier) { + return $objectCopier($item); + } + ); + + $reflectionProperty->setValue($object, $newCollection); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php new file mode 100644 index 0000000..7b33fd5 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php @@ -0,0 +1,28 @@ +setAccessible(true); + + $reflectionProperty->setValue($object, new ArrayCollection()); + } +} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php new file mode 100644 index 0000000..8bee8f7 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php @@ -0,0 +1,22 @@ +__load(); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php new file mode 100644 index 0000000..85ba18c --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php @@ -0,0 +1,18 @@ +callback = $callable; + } + + /** + * Replaces the object property by the result of the callback called with the object property. + * + * {@inheritdoc} + */ + public function apply($object, $property, $objectCopier) + { + $reflectionProperty = ReflectionHelper::getProperty($object, $property); + $reflectionProperty->setAccessible(true); + + $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); + + $reflectionProperty->setValue($object, $value); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php new file mode 100644 index 0000000..bea86b8 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php @@ -0,0 +1,24 @@ +setAccessible(true); + $reflectionProperty->setValue($object, null); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php new file mode 100644 index 0000000..c5887b1 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php @@ -0,0 +1,22 @@ +class = $class; + $this->property = $property; + } + + /** + * Matches a specific property of a specific class. + * + * {@inheritdoc} + */ + public function matches($object, $property) + { + return ($object instanceof $this->class) && $property == $this->property; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php new file mode 100644 index 0000000..c8ec0d2 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php @@ -0,0 +1,32 @@ +property = $property; + } + + /** + * Matches a property by its name. + * + * {@inheritdoc} + */ + public function matches($object, $property) + { + return $property == $this->property; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php new file mode 100644 index 0000000..c7f4690 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php @@ -0,0 +1,52 @@ +propertyType = $propertyType; + } + + /** + * {@inheritdoc} + */ + public function matches($object, $property) + { + try { + $reflectionProperty = ReflectionHelper::getProperty($object, $property); + } catch (ReflectionException $exception) { + return false; + } + + $reflectionProperty->setAccessible(true); + + // Uninitialized properties (for PHP >7.4) + if (method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) { + // null instanceof $this->propertyType + return false; + } + + return $reflectionProperty->getValue($object) instanceof $this->propertyType; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php b/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php new file mode 100644 index 0000000..742410c --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php @@ -0,0 +1,78 @@ +getProperties() does not return private properties from ancestor classes. + * + * @author muratyaman@gmail.com + * @see http://php.net/manual/en/reflectionclass.getproperties.php + * + * @param ReflectionClass $ref + * + * @return ReflectionProperty[] + */ + public static function getProperties(ReflectionClass $ref) + { + $props = $ref->getProperties(); + $propsArr = array(); + + foreach ($props as $prop) { + $propertyName = $prop->getName(); + $propsArr[$propertyName] = $prop; + } + + if ($parentClass = $ref->getParentClass()) { + $parentPropsArr = self::getProperties($parentClass); + foreach ($propsArr as $key => $property) { + $parentPropsArr[$key] = $property; + } + + return $parentPropsArr; + } + + return $propsArr; + } + + /** + * Retrieves property by name from object and all its ancestors. + * + * @param object|string $object + * @param string $name + * + * @throws PropertyException + * @throws ReflectionException + * + * @return ReflectionProperty + */ + public static function getProperty($object, $name) + { + $reflection = is_object($object) ? new ReflectionObject($object) : new ReflectionClass($object); + + if ($reflection->hasProperty($name)) { + return $reflection->getProperty($name); + } + + if ($parentClass = $reflection->getParentClass()) { + return self::getProperty($parentClass->getName(), $name); + } + + throw new PropertyException( + sprintf( + 'The class "%s" doesn\'t have a property with the given name: "%s".', + is_object($object) ? get_class($object) : $object, + $name + ) + ); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php new file mode 100644 index 0000000..becd1cf --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php @@ -0,0 +1,33 @@ + $propertyValue) { + $copy->{$propertyName} = $propertyValue; + } + + return $copy; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php new file mode 100644 index 0000000..164f8b8 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php @@ -0,0 +1,30 @@ +callback = $callable; + } + + /** + * {@inheritdoc} + */ + public function apply($element) + { + return call_user_func($this->callback, $element); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php new file mode 100644 index 0000000..a5fbd7a --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php @@ -0,0 +1,17 @@ +copier = $copier; + } + + /** + * {@inheritdoc} + */ + public function apply($arrayObject) + { + $clone = clone $arrayObject; + foreach ($arrayObject->getArrayCopy() as $k => $v) { + $clone->offsetSet($k, $this->copier->copy($v)); + } + + return $clone; + } +} + diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php new file mode 100644 index 0000000..c5644cf --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php @@ -0,0 +1,10 @@ +copier = $copier; + } + + /** + * {@inheritdoc} + */ + public function apply($element) + { + $newElement = clone $element; + + $copy = $this->createCopyClosure(); + + return $copy($newElement); + } + + private function createCopyClosure() + { + $copier = $this->copier; + + $copy = function (SplDoublyLinkedList $list) use ($copier) { + // Replace each element in the list with a deep copy of itself + for ($i = 1; $i <= $list->count(); $i++) { + $copy = $copier->recursiveCopy($list->shift()); + + $list->push($copy); + } + + return $list; + }; + + return Closure::bind($copy, null, DeepCopy::class); + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php new file mode 100644 index 0000000..5785a7d --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php @@ -0,0 +1,13 @@ +type = $type; + } + + /** + * @param mixed $element + * + * @return boolean + */ + public function matches($element) + { + return is_object($element) ? is_a($element, $this->type) : gettype($element) === $this->type; + } +} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php b/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php new file mode 100644 index 0000000..55dcc92 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php @@ -0,0 +1,20 @@ +copy($value); + } +} diff --git a/vendor/nikic/php-parser/bin/php-parse b/vendor/nikic/php-parser/bin/php-parse new file mode 100755 index 0000000..fc44f23 --- /dev/null +++ b/vendor/nikic/php-parser/bin/php-parse @@ -0,0 +1,206 @@ +#!/usr/bin/env php +createForVersion($attributes['version']); +$dumper = new PhpParser\NodeDumper([ + 'dumpComments' => true, + 'dumpPositions' => $attributes['with-positions'], +]); +$prettyPrinter = new PhpParser\PrettyPrinter\Standard; + +$traverser = new PhpParser\NodeTraverser(); +$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); + +foreach ($files as $file) { + if ($file === '-') { + $code = file_get_contents('php://stdin'); + fwrite(STDERR, "====> Stdin:\n"); + } else if (strpos($file, ' Code $code\n"); + } else { + if (!file_exists($file)) { + fwrite(STDERR, "File $file does not exist.\n"); + exit(1); + } + + $code = file_get_contents($file); + fwrite(STDERR, "====> File $file:\n"); + } + + if ($attributes['with-recovery']) { + $errorHandler = new PhpParser\ErrorHandler\Collecting; + $stmts = $parser->parse($code, $errorHandler); + foreach ($errorHandler->getErrors() as $error) { + $message = formatErrorMessage($error, $code, $attributes['with-column-info']); + fwrite(STDERR, $message . "\n"); + } + if (null === $stmts) { + continue; + } + } else { + try { + $stmts = $parser->parse($code); + } catch (PhpParser\Error $error) { + $message = formatErrorMessage($error, $code, $attributes['with-column-info']); + fwrite(STDERR, $message . "\n"); + exit(1); + } + } + + foreach ($operations as $operation) { + if ('dump' === $operation) { + fwrite(STDERR, "==> Node dump:\n"); + echo $dumper->dump($stmts, $code), "\n"; + } elseif ('pretty-print' === $operation) { + fwrite(STDERR, "==> Pretty print:\n"); + echo $prettyPrinter->prettyPrintFile($stmts), "\n"; + } elseif ('json-dump' === $operation) { + fwrite(STDERR, "==> JSON dump:\n"); + echo json_encode($stmts, JSON_PRETTY_PRINT), "\n"; + } elseif ('var-dump' === $operation) { + fwrite(STDERR, "==> var_dump():\n"); + var_dump($stmts); + } elseif ('resolve-names' === $operation) { + fwrite(STDERR, "==> Resolved names.\n"); + $stmts = $traverser->traverse($stmts); + } + } +} + +function formatErrorMessage(PhpParser\Error $e, $code, $withColumnInfo) { + if ($withColumnInfo && $e->hasColumnInfo()) { + return $e->getMessageWithColumnInfo($code); + } else { + return $e->getMessage(); + } +} + +function showHelp($error = '') { + if ($error) { + fwrite(STDERR, $error . "\n\n"); + } + fwrite($error ? STDERR : STDOUT, <<<'OUTPUT' +Usage: php-parse [operations] file1.php [file2.php ...] + or: php-parse [operations] " false, + 'with-positions' => false, + 'with-recovery' => false, + 'version' => PhpParser\PhpVersion::getNewestSupported(), + ]; + + array_shift($args); + $parseOptions = true; + foreach ($args as $arg) { + if (!$parseOptions) { + $files[] = $arg; + continue; + } + + switch ($arg) { + case '--dump': + case '-d': + $operations[] = 'dump'; + break; + case '--pretty-print': + case '-p': + $operations[] = 'pretty-print'; + break; + case '--json-dump': + case '-j': + $operations[] = 'json-dump'; + break; + case '--var-dump': + $operations[] = 'var-dump'; + break; + case '--resolve-names': + case '-N'; + $operations[] = 'resolve-names'; + break; + case '--with-column-info': + case '-c'; + $attributes['with-column-info'] = true; + break; + case '--with-positions': + case '-P': + $attributes['with-positions'] = true; + break; + case '--with-recovery': + case '-r': + $attributes['with-recovery'] = true; + break; + case '--help': + case '-h'; + showHelp(); + break; + case '--': + $parseOptions = false; + break; + default: + if (preg_match('/^--version=(.*)$/', $arg, $matches)) { + $attributes['version'] = PhpParser\PhpVersion::fromString($matches[1]); + } elseif ($arg[0] === '-' && \strlen($arg[0]) > 1) { + showHelp("Invalid operation $arg."); + } else { + $files[] = $arg; + } + } + } + + return [$operations, $files, $attributes]; +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder.php b/vendor/nikic/php-parser/lib/PhpParser/Builder.php new file mode 100644 index 0000000..d6aa124 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder.php @@ -0,0 +1,12 @@ + */ + protected array $attributes = []; + /** @var list */ + protected array $constants = []; + + /** @var list */ + protected array $attributeGroups = []; + /** @var Identifier|Node\Name|Node\ComplexType|null */ + protected ?Node $type = null; + + /** + * Creates a class constant builder + * + * @param string|Identifier $name Name + * @param Node\Expr|bool|null|int|float|string|array $value Value + */ + public function __construct($name, $value) { + $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; + } + + /** + * Add another constant to const group + * + * @param string|Identifier $name Name + * @param Node\Expr|bool|null|int|float|string|array $value Value + * + * @return $this The builder instance (for fluid interface) + */ + public function addConst($name, $value) { + $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value)); + + return $this; + } + + /** + * Makes the constant public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); + + return $this; + } + + /** + * Makes the constant protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); + + return $this; + } + + /** + * Makes the constant private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); + + return $this; + } + + /** + * Makes the constant final. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeFinal() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); + + return $this; + } + + /** + * Sets doc comment for the constant. + * + * @param PhpParser\Comment\Doc|string $docComment Doc comment to set + * + * @return $this The builder instance (for fluid interface) + */ + public function setDocComment($docComment) { + $this->attributes = [ + 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] + ]; + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Sets the constant type. + * + * @param string|Node\Name|Identifier|Node\ComplexType $type + * + * @return $this + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + + return $this; + } + + /** + * Returns the built class node. + * + * @return Stmt\ClassConst The built constant node + */ + public function getNode(): PhpParser\Node { + return new Stmt\ClassConst( + $this->constants, + $this->flags, + $this->attributes, + $this->attributeGroups, + $this->type + ); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php new file mode 100644 index 0000000..6f39431 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php @@ -0,0 +1,151 @@ + */ + protected array $implements = []; + protected int $flags = 0; + /** @var list */ + protected array $uses = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $properties = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates a class builder. + * + * @param string $name Name of the class + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Extends a class. + * + * @param Name|string $class Name of class to extend + * + * @return $this The builder instance (for fluid interface) + */ + public function extend($class) { + $this->extends = BuilderHelpers::normalizeName($class); + + return $this; + } + + /** + * Implements one or more interfaces. + * + * @param Name|string ...$interfaces Names of interfaces to implement + * + * @return $this The builder instance (for fluid interface) + */ + public function implement(...$interfaces) { + foreach ($interfaces as $interface) { + $this->implements[] = BuilderHelpers::normalizeName($interface); + } + + return $this; + } + + /** + * Makes the class abstract. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeAbstract() { + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::ABSTRACT); + + return $this; + } + + /** + * Makes the class final. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeFinal() { + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::FINAL); + + return $this; + } + + /** + * Makes the class readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::READONLY); + + return $this; + } + + /** + * Adds a statement. + * + * @param Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $stmt = BuilderHelpers::normalizeNode($stmt); + + if ($stmt instanceof Stmt\Property) { + $this->properties[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + $this->methods[] = $stmt; + } elseif ($stmt instanceof Stmt\TraitUse) { + $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } else { + throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); + } + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built class node. + * + * @return Stmt\Class_ The built class node + */ + public function getNode(): PhpParser\Node { + return new Stmt\Class_($this->name, [ + 'flags' => $this->flags, + 'extends' => $this->extends, + 'implements' => $this->implements, + 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), + 'attrGroups' => $this->attributeGroups, + ], $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php new file mode 100644 index 0000000..488b721 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php @@ -0,0 +1,50 @@ + */ + protected array $attributes = []; + + /** + * Adds a statement. + * + * @param PhpParser\Node\Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + abstract public function addStmt($stmt); + + /** + * Adds multiple statements. + * + * @param (PhpParser\Node\Stmt|PhpParser\Builder)[] $stmts The statements to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmts(array $stmts) { + foreach ($stmts as $stmt) { + $this->addStmt($stmt); + } + + return $this; + } + + /** + * Sets doc comment for the declaration. + * + * @param PhpParser\Comment\Doc|string $docComment Doc comment to set + * + * @return $this The builder instance (for fluid interface) + */ + public function setDocComment($docComment) { + $this->attributes['comments'] = [ + BuilderHelpers::normalizeDocComment($docComment) + ]; + + return $this; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php new file mode 100644 index 0000000..04058bf --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php @@ -0,0 +1,87 @@ + */ + protected array $attributes = []; + + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates an enum case builder. + * + * @param string|Identifier $name Name + */ + public function __construct($name) { + $this->name = $name; + } + + /** + * Sets the value. + * + * @param Node\Expr|string|int $value + * + * @return $this + */ + public function setValue($value) { + $this->value = BuilderHelpers::normalizeValue($value); + + return $this; + } + + /** + * Sets doc comment for the constant. + * + * @param PhpParser\Comment\Doc|string $docComment Doc comment to set + * + * @return $this The builder instance (for fluid interface) + */ + public function setDocComment($docComment) { + $this->attributes = [ + 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] + ]; + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built enum case node. + * + * @return Stmt\EnumCase The built constant node + */ + public function getNode(): PhpParser\Node { + return new Stmt\EnumCase( + $this->name, + $this->value, + $this->attributeGroups, + $this->attributes + ); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php new file mode 100644 index 0000000..c00df03 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php @@ -0,0 +1,116 @@ + */ + protected array $implements = []; + /** @var list */ + protected array $uses = []; + /** @var list */ + protected array $enumCases = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates an enum builder. + * + * @param string $name Name of the enum + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Sets the scalar type. + * + * @param string|Identifier $scalarType + * + * @return $this + */ + public function setScalarType($scalarType) { + $this->scalarType = BuilderHelpers::normalizeType($scalarType); + + return $this; + } + + /** + * Implements one or more interfaces. + * + * @param Name|string ...$interfaces Names of interfaces to implement + * + * @return $this The builder instance (for fluid interface) + */ + public function implement(...$interfaces) { + foreach ($interfaces as $interface) { + $this->implements[] = BuilderHelpers::normalizeName($interface); + } + + return $this; + } + + /** + * Adds a statement. + * + * @param Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $stmt = BuilderHelpers::normalizeNode($stmt); + + if ($stmt instanceof Stmt\EnumCase) { + $this->enumCases[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + $this->methods[] = $stmt; + } elseif ($stmt instanceof Stmt\TraitUse) { + $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } else { + throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); + } + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built class node. + * + * @return Stmt\Enum_ The built enum node + */ + public function getNode(): PhpParser\Node { + return new Stmt\Enum_($this->name, [ + 'scalarType' => $this->scalarType, + 'implements' => $this->implements, + 'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods), + 'attrGroups' => $this->attributeGroups, + ], $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php new file mode 100644 index 0000000..ff79cb6 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php @@ -0,0 +1,73 @@ +returnByRef = true; + + return $this; + } + + /** + * Adds a parameter. + * + * @param Node\Param|Param $param The parameter to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addParam($param) { + $param = BuilderHelpers::normalizeNode($param); + + if (!$param instanceof Node\Param) { + throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); + } + + $this->params[] = $param; + + return $this; + } + + /** + * Adds multiple parameters. + * + * @param (Node\Param|Param)[] $params The parameters to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addParams(array $params) { + foreach ($params as $param) { + $this->addParam($param); + } + + return $this; + } + + /** + * Sets the return type for PHP 7. + * + * @param string|Node\Name|Node\Identifier|Node\ComplexType $type + * + * @return $this The builder instance (for fluid interface) + */ + public function setReturnType($type) { + $this->returnType = BuilderHelpers::normalizeType($type); + + return $this; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php new file mode 100644 index 0000000..48f5f69 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php @@ -0,0 +1,67 @@ + */ + protected array $stmts = []; + + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates a function builder. + * + * @param string $name Name of the function + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Adds a statement. + * + * @param Node|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built function node. + * + * @return Stmt\Function_ The built function node + */ + public function getNode(): Node { + return new Stmt\Function_($this->name, [ + 'byRef' => $this->returnByRef, + 'params' => $this->params, + 'returnType' => $this->returnType, + 'stmts' => $this->stmts, + 'attrGroups' => $this->attributeGroups, + ], $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php new file mode 100644 index 0000000..13dd3f7 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php @@ -0,0 +1,94 @@ + */ + protected array $extends = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates an interface builder. + * + * @param string $name Name of the interface + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Extends one or more interfaces. + * + * @param Name|string ...$interfaces Names of interfaces to extend + * + * @return $this The builder instance (for fluid interface) + */ + public function extend(...$interfaces) { + foreach ($interfaces as $interface) { + $this->extends[] = BuilderHelpers::normalizeName($interface); + } + + return $this; + } + + /** + * Adds a statement. + * + * @param Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $stmt = BuilderHelpers::normalizeNode($stmt); + + if ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + // we erase all statements in the body of an interface method + $stmt->stmts = null; + $this->methods[] = $stmt; + } else { + throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); + } + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built interface node. + * + * @return Stmt\Interface_ The built interface node + */ + public function getNode(): PhpParser\Node { + return new Stmt\Interface_($this->name, [ + 'extends' => $this->extends, + 'stmts' => array_merge($this->constants, $this->methods), + 'attrGroups' => $this->attributeGroups, + ], $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php new file mode 100644 index 0000000..8358dbe --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php @@ -0,0 +1,147 @@ +|null */ + protected ?array $stmts = []; + + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates a method builder. + * + * @param string $name Name of the method + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Makes the method public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); + + return $this; + } + + /** + * Makes the method protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); + + return $this; + } + + /** + * Makes the method private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); + + return $this; + } + + /** + * Makes the method static. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeStatic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); + + return $this; + } + + /** + * Makes the method abstract. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeAbstract() { + if (!empty($this->stmts)) { + throw new \LogicException('Cannot make method with statements abstract'); + } + + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT); + $this->stmts = null; // abstract methods don't have statements + + return $this; + } + + /** + * Makes the method final. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeFinal() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); + + return $this; + } + + /** + * Adds a statement. + * + * @param Node|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + if (null === $this->stmts) { + throw new \LogicException('Cannot add statements to an abstract method'); + } + + $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built method node. + * + * @return Stmt\ClassMethod The built method node + */ + public function getNode(): Node { + return new Stmt\ClassMethod($this->name, [ + 'flags' => $this->flags, + 'byRef' => $this->returnByRef, + 'params' => $this->params, + 'returnType' => $this->returnType, + 'stmts' => $this->stmts, + 'attrGroups' => $this->attributeGroups, + ], $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php new file mode 100644 index 0000000..80fe6f8 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php @@ -0,0 +1,45 @@ +name = null !== $name ? BuilderHelpers::normalizeName($name) : null; + } + + /** + * Adds a statement. + * + * @param Node|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); + + return $this; + } + + /** + * Returns the built node. + * + * @return Stmt\Namespace_ The built node + */ + public function getNode(): Node { + return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php new file mode 100644 index 0000000..f439e87 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @@ -0,0 +1,149 @@ + */ + protected array $attributeGroups = []; + + /** + * Creates a parameter builder. + * + * @param string $name Name of the parameter + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Sets default value for the parameter. + * + * @param mixed $value Default value to use + * + * @return $this The builder instance (for fluid interface) + */ + public function setDefault($value) { + $this->default = BuilderHelpers::normalizeValue($value); + + return $this; + } + + /** + * Sets type for the parameter. + * + * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type + * + * @return $this The builder instance (for fluid interface) + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + if ($this->type == 'void') { + throw new \LogicException('Parameter type cannot be void'); + } + + return $this; + } + + /** + * Make the parameter accept the value by reference. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeByRef() { + $this->byRef = true; + + return $this; + } + + /** + * Make the parameter variadic + * + * @return $this The builder instance (for fluid interface) + */ + public function makeVariadic() { + $this->variadic = true; + + return $this; + } + + /** + * Makes the (promoted) parameter public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); + + return $this; + } + + /** + * Makes the (promoted) parameter protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); + + return $this; + } + + /** + * Makes the (promoted) parameter private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); + + return $this; + } + + /** + * Makes the (promoted) parameter readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built parameter node. + * + * @return Node\Param The built parameter node + */ + public function getNode(): Node { + return new Node\Param( + new Node\Expr\Variable($this->name), + $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups + ); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php new file mode 100644 index 0000000..3fc96d9 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php @@ -0,0 +1,161 @@ + */ + protected array $attributes = []; + /** @var null|Identifier|Name|ComplexType */ + protected ?Node $type = null; + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates a property builder. + * + * @param string $name Name of the property + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Makes the property public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); + + return $this; + } + + /** + * Makes the property protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); + + return $this; + } + + /** + * Makes the property private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); + + return $this; + } + + /** + * Makes the property static. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeStatic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); + + return $this; + } + + /** + * Makes the property readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); + + return $this; + } + + /** + * Sets default value for the property. + * + * @param mixed $value Default value to use + * + * @return $this The builder instance (for fluid interface) + */ + public function setDefault($value) { + $this->default = BuilderHelpers::normalizeValue($value); + + return $this; + } + + /** + * Sets doc comment for the property. + * + * @param PhpParser\Comment\Doc|string $docComment Doc comment to set + * + * @return $this The builder instance (for fluid interface) + */ + public function setDocComment($docComment) { + $this->attributes = [ + 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] + ]; + + return $this; + } + + /** + * Sets the property type for PHP 7.4+. + * + * @param string|Name|Identifier|ComplexType $type + * + * @return $this + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built class node. + * + * @return Stmt\Property The built property node + */ + public function getNode(): PhpParser\Node { + return new Stmt\Property( + $this->flags !== 0 ? $this->flags : Modifiers::PUBLIC, + [ + new Node\PropertyItem($this->name, $this->default) + ], + $this->attributes, + $this->type, + $this->attributeGroups + ); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php new file mode 100644 index 0000000..cf21c82 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php @@ -0,0 +1,65 @@ +and($trait); + } + } + + /** + * Adds used trait. + * + * @param Node\Name|string $trait Trait name + * + * @return $this The builder instance (for fluid interface) + */ + public function and($trait) { + $this->traits[] = BuilderHelpers::normalizeName($trait); + return $this; + } + + /** + * Adds trait adaptation. + * + * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation + * + * @return $this The builder instance (for fluid interface) + */ + public function with($adaptation) { + $adaptation = BuilderHelpers::normalizeNode($adaptation); + + if (!$adaptation instanceof Stmt\TraitUseAdaptation) { + throw new \LogicException('Adaptation must have type TraitUseAdaptation'); + } + + $this->adaptations[] = $adaptation; + return $this; + } + + /** + * Returns the built node. + * + * @return Node The built node + */ + public function getNode(): Node { + return new Stmt\TraitUse($this->traits, $this->adaptations); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php new file mode 100644 index 0000000..fee0958 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php @@ -0,0 +1,145 @@ +type = self::TYPE_UNDEFINED; + + $this->trait = is_null($trait) ? null : BuilderHelpers::normalizeName($trait); + $this->method = BuilderHelpers::normalizeIdentifier($method); + } + + /** + * Sets alias of method. + * + * @param Node\Identifier|string $alias Alias for adapted method + * + * @return $this The builder instance (for fluid interface) + */ + public function as($alias) { + if ($this->type === self::TYPE_UNDEFINED) { + $this->type = self::TYPE_ALIAS; + } + + if ($this->type !== self::TYPE_ALIAS) { + throw new \LogicException('Cannot set alias for not alias adaptation buider'); + } + + $this->alias = BuilderHelpers::normalizeIdentifier($alias); + return $this; + } + + /** + * Sets adapted method public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->setModifier(Modifiers::PUBLIC); + return $this; + } + + /** + * Sets adapted method protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->setModifier(Modifiers::PROTECTED); + return $this; + } + + /** + * Sets adapted method private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->setModifier(Modifiers::PRIVATE); + return $this; + } + + /** + * Adds overwritten traits. + * + * @param Node\Name|string ...$traits Traits for overwrite + * + * @return $this The builder instance (for fluid interface) + */ + public function insteadof(...$traits) { + if ($this->type === self::TYPE_UNDEFINED) { + if (is_null($this->trait)) { + throw new \LogicException('Precedence adaptation must have trait'); + } + + $this->type = self::TYPE_PRECEDENCE; + } + + if ($this->type !== self::TYPE_PRECEDENCE) { + throw new \LogicException('Cannot add overwritten traits for not precedence adaptation buider'); + } + + foreach ($traits as $trait) { + $this->insteadof[] = BuilderHelpers::normalizeName($trait); + } + + return $this; + } + + protected function setModifier(int $modifier): void { + if ($this->type === self::TYPE_UNDEFINED) { + $this->type = self::TYPE_ALIAS; + } + + if ($this->type !== self::TYPE_ALIAS) { + throw new \LogicException('Cannot set access modifier for not alias adaptation buider'); + } + + if (is_null($this->modifier)) { + $this->modifier = $modifier; + } else { + throw new \LogicException('Multiple access type modifiers are not allowed'); + } + } + + /** + * Returns the built node. + * + * @return Node The built node + */ + public function getNode(): Node { + switch ($this->type) { + case self::TYPE_ALIAS: + return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias); + case self::TYPE_PRECEDENCE: + return new Stmt\TraitUseAdaptation\Precedence($this->trait, $this->method, $this->insteadof); + default: + throw new \LogicException('Type of adaptation is not defined'); + } + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php new file mode 100644 index 0000000..ffa1bd5 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php @@ -0,0 +1,83 @@ + */ + protected array $uses = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $properties = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; + + /** + * Creates an interface builder. + * + * @param string $name Name of the interface + */ + public function __construct(string $name) { + $this->name = $name; + } + + /** + * Adds a statement. + * + * @param Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ + public function addStmt($stmt) { + $stmt = BuilderHelpers::normalizeNode($stmt); + + if ($stmt instanceof Stmt\Property) { + $this->properties[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + $this->methods[] = $stmt; + } elseif ($stmt instanceof Stmt\TraitUse) { + $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } else { + throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); + } + + return $this; + } + + /** + * Adds an attribute group. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return $this The builder instance (for fluid interface) + */ + public function addAttribute($attribute) { + $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); + + return $this; + } + + /** + * Returns the built trait node. + * + * @return Stmt\Trait_ The built interface node + */ + public function getNode(): PhpParser\Node { + return new Stmt\Trait_( + $this->name, [ + 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), + 'attrGroups' => $this->attributeGroups, + ], $this->attributes + ); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php new file mode 100644 index 0000000..b82cf13 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php @@ -0,0 +1,49 @@ +name = BuilderHelpers::normalizeName($name); + $this->type = $type; + } + + /** + * Sets alias for used name. + * + * @param string $alias Alias to use (last component of full name by default) + * + * @return $this The builder instance (for fluid interface) + */ + public function as(string $alias) { + $this->alias = $alias; + return $this; + } + + /** + * Returns the built node. + * + * @return Stmt\Use_ The built node + */ + public function getNode(): Node { + return new Stmt\Use_([ + new Node\UseItem($this->name, $this->alias) + ], $this->type); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php new file mode 100644 index 0000000..b7efe5e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php @@ -0,0 +1,375 @@ +args($args) + ); + } + + /** + * Creates a namespace builder. + * + * @param null|string|Node\Name $name Name of the namespace + * + * @return Builder\Namespace_ The created namespace builder + */ + public function namespace($name): Builder\Namespace_ { + return new Builder\Namespace_($name); + } + + /** + * Creates a class builder. + * + * @param string $name Name of the class + * + * @return Builder\Class_ The created class builder + */ + public function class(string $name): Builder\Class_ { + return new Builder\Class_($name); + } + + /** + * Creates an interface builder. + * + * @param string $name Name of the interface + * + * @return Builder\Interface_ The created interface builder + */ + public function interface(string $name): Builder\Interface_ { + return new Builder\Interface_($name); + } + + /** + * Creates a trait builder. + * + * @param string $name Name of the trait + * + * @return Builder\Trait_ The created trait builder + */ + public function trait(string $name): Builder\Trait_ { + return new Builder\Trait_($name); + } + + /** + * Creates an enum builder. + * + * @param string $name Name of the enum + * + * @return Builder\Enum_ The created enum builder + */ + public function enum(string $name): Builder\Enum_ { + return new Builder\Enum_($name); + } + + /** + * Creates a trait use builder. + * + * @param Node\Name|string ...$traits Trait names + * + * @return Builder\TraitUse The created trait use builder + */ + public function useTrait(...$traits): Builder\TraitUse { + return new Builder\TraitUse(...$traits); + } + + /** + * Creates a trait use adaptation builder. + * + * @param Node\Name|string|null $trait Trait name + * @param Node\Identifier|string $method Method name + * + * @return Builder\TraitUseAdaptation The created trait use adaptation builder + */ + public function traitUseAdaptation($trait, $method = null): Builder\TraitUseAdaptation { + if ($method === null) { + $method = $trait; + $trait = null; + } + + return new Builder\TraitUseAdaptation($trait, $method); + } + + /** + * Creates a method builder. + * + * @param string $name Name of the method + * + * @return Builder\Method The created method builder + */ + public function method(string $name): Builder\Method { + return new Builder\Method($name); + } + + /** + * Creates a parameter builder. + * + * @param string $name Name of the parameter + * + * @return Builder\Param The created parameter builder + */ + public function param(string $name): Builder\Param { + return new Builder\Param($name); + } + + /** + * Creates a property builder. + * + * @param string $name Name of the property + * + * @return Builder\Property The created property builder + */ + public function property(string $name): Builder\Property { + return new Builder\Property($name); + } + + /** + * Creates a function builder. + * + * @param string $name Name of the function + * + * @return Builder\Function_ The created function builder + */ + public function function(string $name): Builder\Function_ { + return new Builder\Function_($name); + } + + /** + * Creates a namespace/class use builder. + * + * @param Node\Name|string $name Name of the entity (namespace or class) to alias + * + * @return Builder\Use_ The created use builder + */ + public function use($name): Builder\Use_ { + return new Builder\Use_($name, Use_::TYPE_NORMAL); + } + + /** + * Creates a function use builder. + * + * @param Node\Name|string $name Name of the function to alias + * + * @return Builder\Use_ The created use function builder + */ + public function useFunction($name): Builder\Use_ { + return new Builder\Use_($name, Use_::TYPE_FUNCTION); + } + + /** + * Creates a constant use builder. + * + * @param Node\Name|string $name Name of the const to alias + * + * @return Builder\Use_ The created use const builder + */ + public function useConst($name): Builder\Use_ { + return new Builder\Use_($name, Use_::TYPE_CONSTANT); + } + + /** + * Creates a class constant builder. + * + * @param string|Identifier $name Name + * @param Node\Expr|bool|null|int|float|string|array $value Value + * + * @return Builder\ClassConst The created use const builder + */ + public function classConst($name, $value): Builder\ClassConst { + return new Builder\ClassConst($name, $value); + } + + /** + * Creates an enum case builder. + * + * @param string|Identifier $name Name + * + * @return Builder\EnumCase The created use const builder + */ + public function enumCase($name): Builder\EnumCase { + return new Builder\EnumCase($name); + } + + /** + * Creates node a for a literal value. + * + * @param Expr|bool|null|int|float|string|array $value $value + */ + public function val($value): Expr { + return BuilderHelpers::normalizeValue($value); + } + + /** + * Creates variable node. + * + * @param string|Expr $name Name + */ + public function var($name): Expr\Variable { + if (!\is_string($name) && !$name instanceof Expr) { + throw new \LogicException('Variable name must be string or Expr'); + } + + return new Expr\Variable($name); + } + + /** + * Normalizes an argument list. + * + * Creates Arg nodes for all arguments and converts literal values to expressions. + * + * @param array $args List of arguments to normalize + * + * @return list + */ + public function args(array $args): array { + $normalizedArgs = []; + foreach ($args as $key => $arg) { + if (!($arg instanceof Arg)) { + $arg = new Arg(BuilderHelpers::normalizeValue($arg)); + } + if (\is_string($key)) { + $arg->name = BuilderHelpers::normalizeIdentifier($key); + } + $normalizedArgs[] = $arg; + } + return $normalizedArgs; + } + + /** + * Creates a function call node. + * + * @param string|Name|Expr $name Function name + * @param array $args Function arguments + */ + public function funcCall($name, array $args = []): Expr\FuncCall { + return new Expr\FuncCall( + BuilderHelpers::normalizeNameOrExpr($name), + $this->args($args) + ); + } + + /** + * Creates a method call node. + * + * @param Expr $var Variable the method is called on + * @param string|Identifier|Expr $name Method name + * @param array $args Method arguments + */ + public function methodCall(Expr $var, $name, array $args = []): Expr\MethodCall { + return new Expr\MethodCall( + $var, + BuilderHelpers::normalizeIdentifierOrExpr($name), + $this->args($args) + ); + } + + /** + * Creates a static method call node. + * + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Method name + * @param array $args Method arguments + */ + public function staticCall($class, $name, array $args = []): Expr\StaticCall { + return new Expr\StaticCall( + BuilderHelpers::normalizeNameOrExpr($class), + BuilderHelpers::normalizeIdentifierOrExpr($name), + $this->args($args) + ); + } + + /** + * Creates an object creation node. + * + * @param string|Name|Expr $class Class name + * @param array $args Constructor arguments + */ + public function new($class, array $args = []): Expr\New_ { + return new Expr\New_( + BuilderHelpers::normalizeNameOrExpr($class), + $this->args($args) + ); + } + + /** + * Creates a constant fetch node. + * + * @param string|Name $name Constant name + */ + public function constFetch($name): Expr\ConstFetch { + return new Expr\ConstFetch(BuilderHelpers::normalizeName($name)); + } + + /** + * Creates a property fetch node. + * + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Property name + */ + public function propertyFetch(Expr $var, $name): Expr\PropertyFetch { + return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name)); + } + + /** + * Creates a class constant fetch node. + * + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Constant name + */ + public function classConstFetch($class, $name): Expr\ClassConstFetch { + return new Expr\ClassConstFetch( + BuilderHelpers::normalizeNameOrExpr($class), + BuilderHelpers::normalizeIdentifierOrExpr($name) + ); + } + + /** + * Creates nested Concat nodes from a list of expressions. + * + * @param Expr|string ...$exprs Expressions or literal strings + */ + public function concat(...$exprs): Concat { + $numExprs = count($exprs); + if ($numExprs < 2) { + throw new \LogicException('Expected at least two expressions'); + } + + $lastConcat = $this->normalizeStringExpr($exprs[0]); + for ($i = 1; $i < $numExprs; $i++) { + $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i])); + } + return $lastConcat; + } + + /** + * @param string|Expr $expr + */ + private function normalizeStringExpr($expr): Expr { + if ($expr instanceof Expr) { + return $expr; + } + + if (\is_string($expr)) { + return new String_($expr); + } + + throw new \LogicException('Expected string or Expr'); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php new file mode 100644 index 0000000..3e41b26 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php @@ -0,0 +1,333 @@ +getNode(); + } + + if ($node instanceof Node) { + return $node; + } + + throw new \LogicException('Expected node or builder object'); + } + + /** + * Normalizes a node to a statement. + * + * Expressions are wrapped in a Stmt\Expression node. + * + * @param Node|Builder $node The node to normalize + * + * @return Stmt The normalized statement node + */ + public static function normalizeStmt($node): Stmt { + $node = self::normalizeNode($node); + if ($node instanceof Stmt) { + return $node; + } + + if ($node instanceof Expr) { + return new Stmt\Expression($node); + } + + throw new \LogicException('Expected statement or expression node'); + } + + /** + * Normalizes strings to Identifier. + * + * @param string|Identifier $name The identifier to normalize + * + * @return Identifier The normalized identifier + */ + public static function normalizeIdentifier($name): Identifier { + if ($name instanceof Identifier) { + return $name; + } + + if (\is_string($name)) { + return new Identifier($name); + } + + throw new \LogicException('Expected string or instance of Node\Identifier'); + } + + /** + * Normalizes strings to Identifier, also allowing expressions. + * + * @param string|Identifier|Expr $name The identifier to normalize + * + * @return Identifier|Expr The normalized identifier or expression + */ + public static function normalizeIdentifierOrExpr($name) { + if ($name instanceof Identifier || $name instanceof Expr) { + return $name; + } + + if (\is_string($name)) { + return new Identifier($name); + } + + throw new \LogicException('Expected string or instance of Node\Identifier or Node\Expr'); + } + + /** + * Normalizes a name: Converts string names to Name nodes. + * + * @param Name|string $name The name to normalize + * + * @return Name The normalized name + */ + public static function normalizeName($name): Name { + if ($name instanceof Name) { + return $name; + } + + if (is_string($name)) { + if (!$name) { + throw new \LogicException('Name cannot be empty'); + } + + if ($name[0] === '\\') { + return new Name\FullyQualified(substr($name, 1)); + } + + if (0 === strpos($name, 'namespace\\')) { + return new Name\Relative(substr($name, strlen('namespace\\'))); + } + + return new Name($name); + } + + throw new \LogicException('Name must be a string or an instance of Node\Name'); + } + + /** + * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. + * + * @param Expr|Name|string $name The name to normalize + * + * @return Name|Expr The normalized name or expression + */ + public static function normalizeNameOrExpr($name) { + if ($name instanceof Expr) { + return $name; + } + + if (!is_string($name) && !($name instanceof Name)) { + throw new \LogicException( + 'Name must be a string or an instance of Node\Name or Node\Expr' + ); + } + + return self::normalizeName($name); + } + + /** + * Normalizes a type: Converts plain-text type names into proper AST representation. + * + * In particular, builtin types become Identifiers, custom types become Names and nullables + * are wrapped in NullableType nodes. + * + * @param string|Name|Identifier|ComplexType $type The type to normalize + * + * @return Name|Identifier|ComplexType The normalized type + */ + public static function normalizeType($type) { + if (!is_string($type)) { + if ( + !$type instanceof Name && !$type instanceof Identifier && + !$type instanceof ComplexType + ) { + throw new \LogicException( + 'Type must be a string, or an instance of Name, Identifier or ComplexType' + ); + } + return $type; + } + + $nullable = false; + if (strlen($type) > 0 && $type[0] === '?') { + $nullable = true; + $type = substr($type, 1); + } + + $builtinTypes = [ + 'array', + 'callable', + 'bool', + 'int', + 'float', + 'string', + 'iterable', + 'void', + 'object', + 'null', + 'false', + 'mixed', + 'never', + 'true', + ]; + + $lowerType = strtolower($type); + if (in_array($lowerType, $builtinTypes)) { + $type = new Identifier($lowerType); + } else { + $type = self::normalizeName($type); + } + + $notNullableTypes = [ + 'void', 'mixed', 'never', + ]; + if ($nullable && in_array((string) $type, $notNullableTypes)) { + throw new \LogicException(sprintf('%s type cannot be nullable', $type)); + } + + return $nullable ? new NullableType($type) : $type; + } + + /** + * Normalizes a value: Converts nulls, booleans, integers, + * floats, strings and arrays into their respective nodes + * + * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize + * + * @return Expr The normalized value + */ + public static function normalizeValue($value): Expr { + if ($value instanceof Node\Expr) { + return $value; + } + + if (is_null($value)) { + return new Expr\ConstFetch( + new Name('null') + ); + } + + if (is_bool($value)) { + return new Expr\ConstFetch( + new Name($value ? 'true' : 'false') + ); + } + + if (is_int($value)) { + return new Scalar\Int_($value); + } + + if (is_float($value)) { + return new Scalar\Float_($value); + } + + if (is_string($value)) { + return new Scalar\String_($value); + } + + if (is_array($value)) { + $items = []; + $lastKey = -1; + foreach ($value as $itemKey => $itemValue) { + // for consecutive, numeric keys don't generate keys + if (null !== $lastKey && ++$lastKey === $itemKey) { + $items[] = new Node\ArrayItem( + self::normalizeValue($itemValue) + ); + } else { + $lastKey = null; + $items[] = new Node\ArrayItem( + self::normalizeValue($itemValue), + self::normalizeValue($itemKey) + ); + } + } + + return new Expr\Array_($items); + } + + throw new \LogicException('Invalid value'); + } + + /** + * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc. + * + * @param Comment\Doc|string $docComment The doc comment to normalize + * + * @return Comment\Doc The normalized doc comment + */ + public static function normalizeDocComment($docComment): Comment\Doc { + if ($docComment instanceof Comment\Doc) { + return $docComment; + } + + if (is_string($docComment)) { + return new Comment\Doc($docComment); + } + + throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc'); + } + + /** + * Normalizes a attribute: Converts attribute to the Attribute Group if needed. + * + * @param Node\Attribute|Node\AttributeGroup $attribute + * + * @return Node\AttributeGroup The Attribute Group + */ + public static function normalizeAttribute($attribute): Node\AttributeGroup { + if ($attribute instanceof Node\AttributeGroup) { + return $attribute; + } + + if (!($attribute instanceof Node\Attribute)) { + throw new \LogicException('Attribute must be an instance of PhpParser\Node\Attribute or PhpParser\Node\AttributeGroup'); + } + + return new Node\AttributeGroup([$attribute]); + } + + /** + * Adds a modifier and returns new modifier bitmask. + * + * @param int $modifiers Existing modifiers + * @param int $modifier Modifier to set + * + * @return int New modifiers + */ + public static function addModifier(int $modifiers, int $modifier): int { + Modifiers::verifyModifier($modifiers, $modifier); + return $modifiers | $modifier; + } + + /** + * Adds a modifier and returns new modifier bitmask. + * @return int New modifiers + */ + public static function addClassModifier(int $existingModifiers, int $modifierToSet): int { + Modifiers::verifyClassModifier($existingModifiers, $modifierToSet); + return $existingModifiers | $modifierToSet; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/vendor/nikic/php-parser/lib/PhpParser/Comment.php new file mode 100644 index 0000000..17dc4c7 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Comment.php @@ -0,0 +1,207 @@ +text = $text; + $this->startLine = $startLine; + $this->startFilePos = $startFilePos; + $this->startTokenPos = $startTokenPos; + $this->endLine = $endLine; + $this->endFilePos = $endFilePos; + $this->endTokenPos = $endTokenPos; + } + + /** + * Gets the comment text. + * + * @return string The comment text (including comment delimiters like /*) + */ + public function getText(): string { + return $this->text; + } + + /** + * Gets the line number the comment started on. + * + * @return int Line number (or -1 if not available) + */ + public function getStartLine(): int { + return $this->startLine; + } + + /** + * Gets the file offset the comment started on. + * + * @return int File offset (or -1 if not available) + */ + public function getStartFilePos(): int { + return $this->startFilePos; + } + + /** + * Gets the token offset the comment started on. + * + * @return int Token offset (or -1 if not available) + */ + public function getStartTokenPos(): int { + return $this->startTokenPos; + } + + /** + * Gets the line number the comment ends on. + * + * @return int Line number (or -1 if not available) + */ + public function getEndLine(): int { + return $this->endLine; + } + + /** + * Gets the file offset the comment ends on. + * + * @return int File offset (or -1 if not available) + */ + public function getEndFilePos(): int { + return $this->endFilePos; + } + + /** + * Gets the token offset the comment ends on. + * + * @return int Token offset (or -1 if not available) + */ + public function getEndTokenPos(): int { + return $this->endTokenPos; + } + + /** + * Gets the comment text. + * + * @return string The comment text (including comment delimiters like /*) + */ + public function __toString(): string { + return $this->text; + } + + /** + * Gets the reformatted comment text. + * + * "Reformatted" here means that we try to clean up the whitespace at the + * starts of the lines. This is necessary because we receive the comments + * without leading whitespace on the first line, but with leading whitespace + * on all subsequent lines. + * + * Additionally, this normalizes CRLF newlines to LF newlines. + */ + public function getReformattedText(): string { + $text = str_replace("\r\n", "\n", $this->text); + $newlinePos = strpos($text, "\n"); + if (false === $newlinePos) { + // Single line comments don't need further processing + return $text; + } + if (preg_match('(^.*(?:\n\s+\*.*)+$)', $text)) { + // Multi line comment of the type + // + // /* + // * Some text. + // * Some more text. + // */ + // + // is handled by replacing the whitespace sequences before the * by a single space + return preg_replace('(^\s+\*)m', ' *', $text); + } + if (preg_match('(^/\*\*?\s*\n)', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { + // Multi line comment of the type + // + // /* + // Some text. + // Some more text. + // */ + // + // is handled by removing the whitespace sequence on the line before the closing + // */ on all lines. So if the last line is " */", then " " is removed at the + // start of all lines. + return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text); + } + if (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { + // Multi line comment of the type + // + // /* Some text. + // Some more text. + // Indented text. + // Even more text. */ + // + // is handled by removing the difference between the shortest whitespace prefix on all + // lines and the length of the "/* " opening sequence. + $prefixLen = $this->getShortestWhitespacePrefixLen(substr($text, $newlinePos + 1)); + $removeLen = $prefixLen - strlen($matches[0]); + return preg_replace('(^\s{' . $removeLen . '})m', '', $text); + } + + // No idea how to format this comment, so simply return as is + return $text; + } + + /** + * Get length of shortest whitespace prefix (at the start of a line). + * + * If there is a line with no prefix whitespace, 0 is a valid return value. + * + * @param string $str String to check + * @return int Length in characters. Tabs count as single characters. + */ + private function getShortestWhitespacePrefixLen(string $str): int { + $lines = explode("\n", $str); + $shortestPrefixLen = \PHP_INT_MAX; + foreach ($lines as $line) { + preg_match('(^\s*)', $line, $matches); + $prefixLen = strlen($matches[0]); + if ($prefixLen < $shortestPrefixLen) { + $shortestPrefixLen = $prefixLen; + } + } + return $shortestPrefixLen; + } + + /** + * @return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} + */ + public function jsonSerialize(): array { + // Technically not a node, but we make it look like one anyway + $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment'; + return [ + 'nodeType' => $type, + 'text' => $this->text, + // TODO: Rename these to include "start". + 'line' => $this->startLine, + 'filePos' => $this->startFilePos, + 'tokenPos' => $this->startTokenPos, + 'endLine' => $this->endLine, + 'endFilePos' => $this->endFilePos, + 'endTokenPos' => $this->endTokenPos, + ]; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php b/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php new file mode 100644 index 0000000..bb3e914 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php @@ -0,0 +1,6 @@ +fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) { + throw new ConstExprEvaluationException( + "Expression of type {$expr->getType()} cannot be evaluated" + ); + }; + } + + /** + * Silently evaluates a constant expression into a PHP value. + * + * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException. + * The original source of the exception is available through getPrevious(). + * + * If some part of the expression cannot be evaluated, the fallback evaluator passed to the + * constructor will be invoked. By default, if no fallback is provided, an exception of type + * ConstExprEvaluationException is thrown. + * + * See class doc comment for caveats and limitations. + * + * @param Expr $expr Constant expression to evaluate + * @return mixed Result of evaluation + * + * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred + */ + public function evaluateSilently(Expr $expr) { + set_error_handler(function ($num, $str, $file, $line) { + throw new \ErrorException($str, 0, $num, $file, $line); + }); + + try { + return $this->evaluate($expr); + } catch (\Throwable $e) { + if (!$e instanceof ConstExprEvaluationException) { + $e = new ConstExprEvaluationException( + "An error occurred during constant expression evaluation", 0, $e); + } + throw $e; + } finally { + restore_error_handler(); + } + } + + /** + * Directly evaluates a constant expression into a PHP value. + * + * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these + * into a ConstExprEvaluationException. + * + * If some part of the expression cannot be evaluated, the fallback evaluator passed to the + * constructor will be invoked. By default, if no fallback is provided, an exception of type + * ConstExprEvaluationException is thrown. + * + * See class doc comment for caveats and limitations. + * + * @param Expr $expr Constant expression to evaluate + * @return mixed Result of evaluation + * + * @throws ConstExprEvaluationException if the expression cannot be evaluated + */ + public function evaluateDirectly(Expr $expr) { + return $this->evaluate($expr); + } + + /** @return mixed */ + private function evaluate(Expr $expr) { + if ($expr instanceof Scalar\Int_ + || $expr instanceof Scalar\Float_ + || $expr instanceof Scalar\String_ + ) { + return $expr->value; + } + + if ($expr instanceof Expr\Array_) { + return $this->evaluateArray($expr); + } + + // Unary operators + if ($expr instanceof Expr\UnaryPlus) { + return +$this->evaluate($expr->expr); + } + if ($expr instanceof Expr\UnaryMinus) { + return -$this->evaluate($expr->expr); + } + if ($expr instanceof Expr\BooleanNot) { + return !$this->evaluate($expr->expr); + } + if ($expr instanceof Expr\BitwiseNot) { + return ~$this->evaluate($expr->expr); + } + + if ($expr instanceof Expr\BinaryOp) { + return $this->evaluateBinaryOp($expr); + } + + if ($expr instanceof Expr\Ternary) { + return $this->evaluateTernary($expr); + } + + if ($expr instanceof Expr\ArrayDimFetch && null !== $expr->dim) { + return $this->evaluate($expr->var)[$this->evaluate($expr->dim)]; + } + + if ($expr instanceof Expr\ConstFetch) { + return $this->evaluateConstFetch($expr); + } + + return ($this->fallbackEvaluator)($expr); + } + + private function evaluateArray(Expr\Array_ $expr): array { + $array = []; + foreach ($expr->items as $item) { + if (null !== $item->key) { + $array[$this->evaluate($item->key)] = $this->evaluate($item->value); + } elseif ($item->unpack) { + $array = array_merge($array, $this->evaluate($item->value)); + } else { + $array[] = $this->evaluate($item->value); + } + } + return $array; + } + + /** @return mixed */ + private function evaluateTernary(Expr\Ternary $expr) { + if (null === $expr->if) { + return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else); + } + + return $this->evaluate($expr->cond) + ? $this->evaluate($expr->if) + : $this->evaluate($expr->else); + } + + /** @return mixed */ + private function evaluateBinaryOp(Expr\BinaryOp $expr) { + if ($expr instanceof Expr\BinaryOp\Coalesce + && $expr->left instanceof Expr\ArrayDimFetch + ) { + // This needs to be special cased to respect BP_VAR_IS fetch semantics + return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] + ?? $this->evaluate($expr->right); + } + + // The evaluate() calls are repeated in each branch, because some of the operators are + // short-circuiting and evaluating the RHS in advance may be illegal in that case + $l = $expr->left; + $r = $expr->right; + switch ($expr->getOperatorSigil()) { + case '&': return $this->evaluate($l) & $this->evaluate($r); + case '|': return $this->evaluate($l) | $this->evaluate($r); + case '^': return $this->evaluate($l) ^ $this->evaluate($r); + case '&&': return $this->evaluate($l) && $this->evaluate($r); + case '||': return $this->evaluate($l) || $this->evaluate($r); + case '??': return $this->evaluate($l) ?? $this->evaluate($r); + case '.': return $this->evaluate($l) . $this->evaluate($r); + case '/': return $this->evaluate($l) / $this->evaluate($r); + case '==': return $this->evaluate($l) == $this->evaluate($r); + case '>': return $this->evaluate($l) > $this->evaluate($r); + case '>=': return $this->evaluate($l) >= $this->evaluate($r); + case '===': return $this->evaluate($l) === $this->evaluate($r); + case 'and': return $this->evaluate($l) and $this->evaluate($r); + case 'or': return $this->evaluate($l) or $this->evaluate($r); + case 'xor': return $this->evaluate($l) xor $this->evaluate($r); + case '-': return $this->evaluate($l) - $this->evaluate($r); + case '%': return $this->evaluate($l) % $this->evaluate($r); + case '*': return $this->evaluate($l) * $this->evaluate($r); + case '!=': return $this->evaluate($l) != $this->evaluate($r); + case '!==': return $this->evaluate($l) !== $this->evaluate($r); + case '+': return $this->evaluate($l) + $this->evaluate($r); + case '**': return $this->evaluate($l) ** $this->evaluate($r); + case '<<': return $this->evaluate($l) << $this->evaluate($r); + case '>>': return $this->evaluate($l) >> $this->evaluate($r); + case '<': return $this->evaluate($l) < $this->evaluate($r); + case '<=': return $this->evaluate($l) <= $this->evaluate($r); + case '<=>': return $this->evaluate($l) <=> $this->evaluate($r); + } + + throw new \Exception('Should not happen'); + } + + /** @return mixed */ + private function evaluateConstFetch(Expr\ConstFetch $expr) { + $name = $expr->name->toLowerString(); + switch ($name) { + case 'null': return null; + case 'false': return false; + case 'true': return true; + } + + return ($this->fallbackEvaluator)($expr); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Error.php new file mode 100644 index 0000000..02feace --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Error.php @@ -0,0 +1,171 @@ + */ + protected array $attributes; + + /** + * Creates an Exception signifying a parse error. + * + * @param string $message Error message + * @param array $attributes Attributes of node/token where error occurred + */ + public function __construct(string $message, array $attributes = []) { + $this->rawMessage = $message; + $this->attributes = $attributes; + $this->updateMessage(); + } + + /** + * Gets the error message + * + * @return string Error message + */ + public function getRawMessage(): string { + return $this->rawMessage; + } + + /** + * Gets the line the error starts in. + * + * @return int Error start line + */ + public function getStartLine(): int { + return $this->attributes['startLine'] ?? -1; + } + + /** + * Gets the line the error ends in. + * + * @return int Error end line + */ + public function getEndLine(): int { + return $this->attributes['endLine'] ?? -1; + } + + /** + * Gets the attributes of the node/token the error occurred at. + * + * @return array + */ + public function getAttributes(): array { + return $this->attributes; + } + + /** + * Sets the attributes of the node/token the error occurred at. + * + * @param array $attributes + */ + public function setAttributes(array $attributes): void { + $this->attributes = $attributes; + $this->updateMessage(); + } + + /** + * Sets the line of the PHP file the error occurred in. + * + * @param string $message Error message + */ + public function setRawMessage(string $message): void { + $this->rawMessage = $message; + $this->updateMessage(); + } + + /** + * Sets the line the error starts in. + * + * @param int $line Error start line + */ + public function setStartLine(int $line): void { + $this->attributes['startLine'] = $line; + $this->updateMessage(); + } + + /** + * Returns whether the error has start and end column information. + * + * For column information enable the startFilePos and endFilePos in the lexer options. + */ + public function hasColumnInfo(): bool { + return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); + } + + /** + * Gets the start column (1-based) into the line where the error started. + * + * @param string $code Source code of the file + */ + public function getStartColumn(string $code): int { + if (!$this->hasColumnInfo()) { + throw new \RuntimeException('Error does not have column information'); + } + + return $this->toColumn($code, $this->attributes['startFilePos']); + } + + /** + * Gets the end column (1-based) into the line where the error ended. + * + * @param string $code Source code of the file + */ + public function getEndColumn(string $code): int { + if (!$this->hasColumnInfo()) { + throw new \RuntimeException('Error does not have column information'); + } + + return $this->toColumn($code, $this->attributes['endFilePos']); + } + + /** + * Formats message including line and column information. + * + * @param string $code Source code associated with the error, for calculation of the columns + * + * @return string Formatted message + */ + public function getMessageWithColumnInfo(string $code): string { + return sprintf( + '%s from %d:%d to %d:%d', $this->getRawMessage(), + $this->getStartLine(), $this->getStartColumn($code), + $this->getEndLine(), $this->getEndColumn($code) + ); + } + + /** + * Converts a file offset into a column. + * + * @param string $code Source code that $pos indexes into + * @param int $pos 0-based position in $code + * + * @return int 1-based column (relative to start of line) + */ + private function toColumn(string $code, int $pos): int { + if ($pos > strlen($code)) { + throw new \RuntimeException('Invalid position information'); + } + + $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); + if (false === $lineStartPos) { + $lineStartPos = -1; + } + + return $pos - $lineStartPos; + } + + /** + * Updates the exception message after a change to rawMessage or rawLine. + */ + protected function updateMessage(): void { + $this->message = $this->rawMessage; + + if (-1 === $this->getStartLine()) { + $this->message .= ' on unknown line'; + } else { + $this->message .= ' on line ' . $this->getStartLine(); + } + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php new file mode 100644 index 0000000..51ad730 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php @@ -0,0 +1,12 @@ +errors[] = $error; + } + + /** + * Get collected errors. + * + * @return Error[] + */ + public function getErrors(): array { + return $this->errors; + } + + /** + * Check whether there are any errors. + */ + public function hasErrors(): bool { + return !empty($this->errors); + } + + /** + * Reset/clear collected errors. + */ + public function clearErrors(): void { + $this->errors = []; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php new file mode 100644 index 0000000..dff33dd --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php @@ -0,0 +1,17 @@ +type = $type; + $this->old = $old; + $this->new = $new; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php new file mode 100644 index 0000000..253e175 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php @@ -0,0 +1,178 @@ +isEqual = $isEqual; + } + + /** + * Calculate diff (edit script) from $old to $new. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script) + */ + public function diff(array $old, array $new): array { + $old = \array_values($old); + $new = \array_values($new); + list($trace, $x, $y) = $this->calculateTrace($old, $new); + return $this->extractDiff($trace, $x, $y, $old, $new); + } + + /** + * Calculate diff, including "replace" operations. + * + * If a sequence of remove operations is followed by the same number of add operations, these + * will be coalesced into replace operations. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script), including replace operations + */ + public function diffWithReplacements(array $old, array $new): array { + return $this->coalesceReplacements($this->diff($old, $new)); + } + + /** + * @param T[] $old + * @param T[] $new + * @return array{array>, int, int} + */ + private function calculateTrace(array $old, array $new): array { + $n = \count($old); + $m = \count($new); + $max = $n + $m; + $v = [1 => 0]; + $trace = []; + for ($d = 0; $d <= $max; $d++) { + $trace[] = $v; + for ($k = -$d; $k <= $d; $k += 2) { + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $x = $v[$k + 1]; + } else { + $x = $v[$k - 1] + 1; + } + + $y = $x - $k; + while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) { + $x++; + $y++; + } + + $v[$k] = $x; + if ($x >= $n && $y >= $m) { + return [$trace, $x, $y]; + } + } + } + throw new \Exception('Should not happen'); + } + + /** + * @param array> $trace + * @param T[] $old + * @param T[] $new + * @return DiffElem[] + */ + private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array { + $result = []; + for ($d = \count($trace) - 1; $d >= 0; $d--) { + $v = $trace[$d]; + $k = $x - $y; + + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $prevK = $k + 1; + } else { + $prevK = $k - 1; + } + + $prevX = $v[$prevK]; + $prevY = $prevX - $prevK; + + while ($x > $prevX && $y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]); + $x--; + $y--; + } + + if ($d === 0) { + break; + } + + while ($x > $prevX) { + $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null); + $x--; + } + + while ($y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]); + $y--; + } + } + return array_reverse($result); + } + + /** + * Coalesce equal-length sequences of remove+add into a replace operation. + * + * @param DiffElem[] $diff + * @return DiffElem[] + */ + private function coalesceReplacements(array $diff): array { + $newDiff = []; + $c = \count($diff); + for ($i = 0; $i < $c; $i++) { + $diffType = $diff[$i]->type; + if ($diffType !== DiffElem::TYPE_REMOVE) { + $newDiff[] = $diff[$i]; + continue; + } + + $j = $i; + while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { + $j++; + } + + $k = $j; + while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { + $k++; + } + + if ($j - $i === $k - $j) { + $len = $j - $i; + for ($n = 0; $n < $len; $n++) { + $newDiff[] = new DiffElem( + DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new + ); + } + } else { + for (; $i < $k; $i++) { + $newDiff[] = $diff[$i]; + } + } + $i = $k - 1; + } + return $newDiff; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php new file mode 100644 index 0000000..b30a99a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php @@ -0,0 +1,71 @@ + $attributes Attributes + */ + public function __construct( + array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements, + array $stmts, array $attributes + ) { + parent::__construct($attributes); + $this->attrGroups = $attrGroups; + $this->flags = $flags; + $this->args = $args; + $this->extends = $extends; + $this->implements = $implements; + $this->stmts = $stmts; + } + + public static function fromNewNode(Expr\New_ $newNode): self { + $class = $newNode->class; + assert($class instanceof Node\Stmt\Class_); + // We don't assert that $class->name is null here, to allow consumers to assign unique names + // to anonymous classes for their own purposes. We simplify ignore the name here. + return new self( + $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, + $class->stmts, $newNode->getAttributes() + ); + } + + public function getType(): string { + return 'Expr_PrintableNewAnonClass'; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts']; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php new file mode 100644 index 0000000..36022d0 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php @@ -0,0 +1,237 @@ += 80000) { + class TokenPolyfill extends \PhpToken { + } + return; +} + +/** + * This is a polyfill for the PhpToken class introduced in PHP 8.0. We do not actually polyfill + * PhpToken, because composer might end up picking a different polyfill implementation, which does + * not meet our requirements. + * + * @internal + */ +class TokenPolyfill { + /** @var int The ID of the token. Either a T_* constant of a character code < 256. */ + public int $id; + /** @var string The textual content of the token. */ + public string $text; + /** @var int The 1-based starting line of the token (or -1 if unknown). */ + public int $line; + /** @var int The 0-based starting position of the token (or -1 if unknown). */ + public int $pos; + + /** @var array Tokens ignored by the PHP parser. */ + private const IGNORABLE_TOKENS = [ + \T_WHITESPACE => true, + \T_COMMENT => true, + \T_DOC_COMMENT => true, + \T_OPEN_TAG => true, + ]; + + /** @var array Tokens that may be part of a T_NAME_* identifier. */ + private static array $identifierTokens; + + /** + * Create a Token with the given ID and text, as well optional line and position information. + */ + final public function __construct(int $id, string $text, int $line = -1, int $pos = -1) { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $pos; + } + + /** + * Get the name of the token. For single-char tokens this will be the token character. + * Otherwise it will be a T_* style name, or null if the token ID is unknown. + */ + public function getTokenName(): ?string { + if ($this->id < 256) { + return \chr($this->id); + } + + $name = token_name($this->id); + return $name === 'UNKNOWN' ? null : $name; + } + + /** + * Check whether the token is of the given kind. The kind may be either an integer that matches + * the token ID, a string that matches the token text, or an array of integers/strings. In the + * latter case, the function returns true if any of the kinds in the array match. + * + * @param int|string|(int|string)[] $kind + */ + public function is($kind): bool { + if (\is_int($kind)) { + return $this->id === $kind; + } + if (\is_string($kind)) { + return $this->text === $kind; + } + if (\is_array($kind)) { + foreach ($kind as $entry) { + if (\is_int($entry)) { + if ($this->id === $entry) { + return true; + } + } elseif (\is_string($entry)) { + if ($this->text === $entry) { + return true; + } + } else { + throw new \TypeError( + 'Argument #1 ($kind) must only have elements of type string|int, ' . + gettype($entry) . ' given'); + } + } + return false; + } + throw new \TypeError( + 'Argument #1 ($kind) must be of type string|int|array, ' .gettype($kind) . ' given'); + } + + /** + * Check whether this token would be ignored by the PHP parser. Returns true for T_WHITESPACE, + * T_COMMENT, T_DOC_COMMENT and T_OPEN_TAG, and false for everything else. + */ + public function isIgnorable(): bool { + return isset(self::IGNORABLE_TOKENS[$this->id]); + } + + /** + * Return the textual content of the token. + */ + public function __toString(): string { + return $this->text; + } + + /** + * Tokenize the given source code and return an array of tokens. + * + * This performs certain canonicalizations to match the PHP 8.0 token format: + * * Bad characters are represented using T_BAD_CHARACTER rather than omitted. + * * T_COMMENT does not include trailing newlines, instead the newline is part of a following + * T_WHITESPACE token. + * * Namespaced names are represented using T_NAME_* tokens. + * + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array { + self::init(); + + $tokens = []; + $line = 1; + $pos = 0; + $origTokens = \token_get_all($code, $flags); + + $numTokens = \count($origTokens); + for ($i = 0; $i < $numTokens; $i++) { + $token = $origTokens[$i]; + if (\is_string($token)) { + if (\strlen($token) === 2) { + // b" and B" are tokenized as single-char tokens, even though they aren't. + $tokens[] = new static(\ord('"'), $token, $line, $pos); + $pos += 2; + } else { + $tokens[] = new static(\ord($token), $token, $line, $pos); + $pos++; + } + } else { + $id = $token[0]; + $text = $token[1]; + + // Emulate PHP 8.0 comment format, which does not include trailing whitespace anymore. + if ($id === \T_COMMENT && \substr($text, 0, 2) !== '/*' && + \preg_match('/(\r\n|\n|\r)$/D', $text, $matches) + ) { + $trailingNewline = $matches[0]; + $text = \substr($text, 0, -\strlen($trailingNewline)); + $tokens[] = new static($id, $text, $line, $pos); + $pos += \strlen($text); + + if ($i + 1 < $numTokens && $origTokens[$i + 1][0] === \T_WHITESPACE) { + // Move trailing newline into following T_WHITESPACE token, if it already exists. + $origTokens[$i + 1][1] = $trailingNewline . $origTokens[$i + 1][1]; + $origTokens[$i + 1][2]--; + } else { + // Otherwise, we need to create a new T_WHITESPACE token. + $tokens[] = new static(\T_WHITESPACE, $trailingNewline, $line, $pos); + $line++; + $pos += \strlen($trailingNewline); + } + continue; + } + + // Emulate PHP 8.0 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and + // T_STRING into a single token. + if (($id === \T_NS_SEPARATOR || isset(self::$identifierTokens[$id]))) { + $newText = $text; + $lastWasSeparator = $id === \T_NS_SEPARATOR; + for ($j = $i + 1; $j < $numTokens; $j++) { + if ($lastWasSeparator) { + if (!isset(self::$identifierTokens[$origTokens[$j][0]])) { + break; + } + $lastWasSeparator = false; + } else { + if ($origTokens[$j][0] !== \T_NS_SEPARATOR) { + break; + } + $lastWasSeparator = true; + } + $newText .= $origTokens[$j][1]; + } + if ($lastWasSeparator) { + // Trailing separator is not part of the name. + $j--; + $newText = \substr($newText, 0, -1); + } + if ($j > $i + 1) { + if ($id === \T_NS_SEPARATOR) { + $id = \T_NAME_FULLY_QUALIFIED; + } elseif ($id === \T_NAMESPACE) { + $id = \T_NAME_RELATIVE; + } else { + $id = \T_NAME_QUALIFIED; + } + $tokens[] = new static($id, $newText, $line, $pos); + $pos += \strlen($newText); + $i = $j - 1; + continue; + } + } + + $tokens[] = new static($id, $text, $line, $pos); + $line += \substr_count($text, "\n"); + $pos += \strlen($text); + } + } + return $tokens; + } + + /** Initialize private static state needed by tokenize(). */ + private static function init(): void { + if (isset(self::$identifierTokens)) { + return; + } + + // Based on semi_reserved production. + self::$identifierTokens = \array_fill_keys([ + \T_STRING, + \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, + \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, + \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, + \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, + \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, + \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, + \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, + \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, + \T_MATCH, + ], true); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php new file mode 100644 index 0000000..8fba131 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php @@ -0,0 +1,271 @@ +tokens = $tokens; + $this->indentMap = $this->calcIndentMap(); + } + + /** + * Whether the given position is immediately surrounded by parenthesis. + * + * @param int $startPos Start position + * @param int $endPos End position + */ + public function haveParens(int $startPos, int $endPos): bool { + return $this->haveTokenImmediatelyBefore($startPos, '(') + && $this->haveTokenImmediatelyAfter($endPos, ')'); + } + + /** + * Whether the given position is immediately surrounded by braces. + * + * @param int $startPos Start position + * @param int $endPos End position + */ + public function haveBraces(int $startPos, int $endPos): bool { + return ($this->haveTokenImmediatelyBefore($startPos, '{') + || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) + && $this->haveTokenImmediatelyAfter($endPos, '}'); + } + + /** + * Check whether the position is directly preceded by a certain token type. + * + * During this check whitespace and comments are skipped. + * + * @param int $pos Position before which the token should occur + * @param int|string $expectedTokenType Token to check for + * + * @return bool Whether the expected token was found + */ + public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType): bool { + $tokens = $this->tokens; + $pos--; + for (; $pos >= 0; $pos--) { + $token = $tokens[$pos]; + if ($token->is($expectedTokenType)) { + return true; + } + if (!$token->isIgnorable()) { + break; + } + } + return false; + } + + /** + * Check whether the position is directly followed by a certain token type. + * + * During this check whitespace and comments are skipped. + * + * @param int $pos Position after which the token should occur + * @param int|string $expectedTokenType Token to check for + * + * @return bool Whether the expected token was found + */ + public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType): bool { + $tokens = $this->tokens; + $pos++; + for ($c = \count($tokens); $pos < $c; $pos++) { + $token = $tokens[$pos]; + if ($token->is($expectedTokenType)) { + return true; + } + if (!$token->isIgnorable()) { + break; + } + } + return false; + } + + /** @param int|string|(int|string)[] $skipTokenType */ + public function skipLeft(int $pos, $skipTokenType): int { + $tokens = $this->tokens; + + $pos = $this->skipLeftWhitespace($pos); + if ($skipTokenType === \T_WHITESPACE) { + return $pos; + } + + if (!$tokens[$pos]->is($skipTokenType)) { + // Shouldn't happen. The skip token MUST be there + throw new \Exception('Encountered unexpected token'); + } + $pos--; + + return $this->skipLeftWhitespace($pos); + } + + /** @param int|string|(int|string)[] $skipTokenType */ + public function skipRight(int $pos, $skipTokenType): int { + $tokens = $this->tokens; + + $pos = $this->skipRightWhitespace($pos); + if ($skipTokenType === \T_WHITESPACE) { + return $pos; + } + + if (!$tokens[$pos]->is($skipTokenType)) { + // Shouldn't happen. The skip token MUST be there + throw new \Exception('Encountered unexpected token'); + } + $pos++; + + return $this->skipRightWhitespace($pos); + } + + /** + * Return first non-whitespace token position smaller or equal to passed position. + * + * @param int $pos Token position + * @return int Non-whitespace token position + */ + public function skipLeftWhitespace(int $pos): int { + $tokens = $this->tokens; + for (; $pos >= 0; $pos--) { + if (!$tokens[$pos]->isIgnorable()) { + break; + } + } + return $pos; + } + + /** + * Return first non-whitespace position greater or equal to passed position. + * + * @param int $pos Token position + * @return int Non-whitespace token position + */ + public function skipRightWhitespace(int $pos): int { + $tokens = $this->tokens; + for ($count = \count($tokens); $pos < $count; $pos++) { + if (!$tokens[$pos]->isIgnorable()) { + break; + } + } + return $pos; + } + + /** @param int|string|(int|string)[] $findTokenType */ + public function findRight(int $pos, $findTokenType): int { + $tokens = $this->tokens; + for ($count = \count($tokens); $pos < $count; $pos++) { + if ($tokens[$pos]->is($findTokenType)) { + return $pos; + } + } + return -1; + } + + /** + * Whether the given position range contains a certain token type. + * + * @param int $startPos Starting position (inclusive) + * @param int $endPos Ending position (exclusive) + * @param int|string $tokenType Token type to look for + * @return bool Whether the token occurs in the given range + */ + public function haveTokenInRange(int $startPos, int $endPos, $tokenType): bool { + $tokens = $this->tokens; + for ($pos = $startPos; $pos < $endPos; $pos++) { + if ($tokens[$pos]->is($tokenType)) { + return true; + } + } + return false; + } + + public function haveTagInRange(int $startPos, int $endPos): bool { + return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) + || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG); + } + + /** + * Get indentation before token position. + * + * @param int $pos Token position + * + * @return int Indentation depth (in spaces) + */ + public function getIndentationBefore(int $pos): int { + return $this->indentMap[$pos]; + } + + /** + * Get the code corresponding to a token offset range, optionally adjusted for indentation. + * + * @param int $from Token start position (inclusive) + * @param int $to Token end position (exclusive) + * @param int $indent By how much the code should be indented (can be negative as well) + * + * @return string Code corresponding to token range, adjusted for indentation + */ + public function getTokenCode(int $from, int $to, int $indent): string { + $tokens = $this->tokens; + $result = ''; + for ($pos = $from; $pos < $to; $pos++) { + $token = $tokens[$pos]; + $id = $token->id; + $text = $token->text; + if ($id === \T_CONSTANT_ENCAPSED_STRING || $id === \T_ENCAPSED_AND_WHITESPACE) { + $result .= $text; + } else { + // TODO Handle non-space indentation + if ($indent < 0) { + $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $text); + } elseif ($indent > 0) { + $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $text); + } else { + $result .= $text; + } + } + } + return $result; + } + + /** + * Precalculate the indentation at every token position. + * + * @return int[] Token position to indentation map + */ + private function calcIndentMap(): array { + $indentMap = []; + $indent = 0; + foreach ($this->tokens as $token) { + $indentMap[] = $indent; + + if ($token->id === \T_WHITESPACE) { + $content = $token->text; + $newlinePos = \strrpos($content, "\n"); + if (false !== $newlinePos) { + $indent = \strlen($content) - $newlinePos - 1; + } + } + } + + // Add a sentinel for one past end of the file + $indentMap[] = $indent; + + return $indentMap; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php b/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php new file mode 100644 index 0000000..7be4142 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php @@ -0,0 +1,108 @@ +[] Node type to reflection class map */ + private array $reflectionClassCache; + + /** @return mixed */ + public function decode(string $json) { + $value = json_decode($json, true); + if (json_last_error()) { + throw new \RuntimeException('JSON decoding error: ' . json_last_error_msg()); + } + + return $this->decodeRecursive($value); + } + + /** + * @param mixed $value + * @return mixed + */ + private function decodeRecursive($value) { + if (\is_array($value)) { + if (isset($value['nodeType'])) { + if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') { + return $this->decodeComment($value); + } + return $this->decodeNode($value); + } + return $this->decodeArray($value); + } + return $value; + } + + private function decodeArray(array $array): array { + $decodedArray = []; + foreach ($array as $key => $value) { + $decodedArray[$key] = $this->decodeRecursive($value); + } + return $decodedArray; + } + + private function decodeNode(array $value): Node { + $nodeType = $value['nodeType']; + if (!\is_string($nodeType)) { + throw new \RuntimeException('Node type must be a string'); + } + + $reflectionClass = $this->reflectionClassFromNodeType($nodeType); + $node = $reflectionClass->newInstanceWithoutConstructor(); + + if (isset($value['attributes'])) { + if (!\is_array($value['attributes'])) { + throw new \RuntimeException('Attributes must be an array'); + } + + $node->setAttributes($this->decodeArray($value['attributes'])); + } + + foreach ($value as $name => $subNode) { + if ($name === 'nodeType' || $name === 'attributes') { + continue; + } + + $node->$name = $this->decodeRecursive($subNode); + } + + return $node; + } + + private function decodeComment(array $value): Comment { + $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class; + if (!isset($value['text'])) { + throw new \RuntimeException('Comment must have text'); + } + + return new $className( + $value['text'], + $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, + $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1 + ); + } + + /** @return \ReflectionClass */ + private function reflectionClassFromNodeType(string $nodeType): \ReflectionClass { + if (!isset($this->reflectionClassCache[$nodeType])) { + $className = $this->classNameFromNodeType($nodeType); + $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className); + } + return $this->reflectionClassCache[$nodeType]; + } + + /** @return class-string */ + private function classNameFromNodeType(string $nodeType): string { + $className = 'PhpParser\\Node\\' . strtr($nodeType, '_', '\\'); + if (class_exists($className)) { + return $className; + } + + $className .= '_'; + if (class_exists($className)) { + return $className; + } + + throw new \RuntimeException("Unknown node type \"$nodeType\""); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php new file mode 100644 index 0000000..5e2ece9 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php @@ -0,0 +1,116 @@ +postprocessTokens($tokens, $errorHandler); + + if (false !== $scream) { + ini_set('xdebug.scream', $scream); + } + + return $tokens; + } + + private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void { + $chr = $token->text; + if ($chr === "\0") { + // PHP cuts error message after null byte, so need special case + $errorMsg = 'Unexpected null byte'; + } else { + $errorMsg = sprintf( + 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) + ); + } + + $errorHandler->handleError(new Error($errorMsg, [ + 'startLine' => $token->line, + 'endLine' => $token->line, + 'startFilePos' => $token->pos, + 'endFilePos' => $token->pos, + ])); + } + + private function isUnterminatedComment(Token $token): bool { + return $token->is([\T_COMMENT, \T_DOC_COMMENT]) + && substr($token->text, 0, 2) === '/*' + && substr($token->text, -2) !== '*/'; + } + + /** + * @param list $tokens + */ + protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void { + // This function reports errors (bad characters and unterminated comments) in the token + // array, and performs certain canonicalizations: + // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and + // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. + // * Add a sentinel token with ID 0. + + $numTokens = \count($tokens); + if ($numTokens === 0) { + // Empty input edge case: Just add the sentinel token. + $tokens[] = new Token(0, "\0", 1, 0); + return; + } + + for ($i = 0; $i < $numTokens; $i++) { + $token = $tokens[$i]; + if ($token->id === \T_BAD_CHARACTER) { + $this->handleInvalidCharacter($token, $errorHandler); + } + + if ($token->id === \ord('&')) { + $next = $i + 1; + while (isset($tokens[$next]) && $tokens[$next]->id === \T_WHITESPACE) { + $next++; + } + $followedByVarOrVarArg = isset($tokens[$next]) && + $tokens[$next]->is([\T_VARIABLE, \T_ELLIPSIS]); + $token->id = $followedByVarOrVarArg + ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; + } + } + + // Check for unterminated comment + $lastToken = $tokens[$numTokens - 1]; + if ($this->isUnterminatedComment($lastToken)) { + $errorHandler->handleError(new Error('Unterminated comment', [ + 'startLine' => $lastToken->line, + 'endLine' => $lastToken->getEndLine(), + 'startFilePos' => $lastToken->pos, + 'endFilePos' => $lastToken->getEndPos(), + ])); + } + + // Add sentinel token. + $tokens[] = new Token(0, "\0", $lastToken->getEndLine(), $lastToken->getEndPos()); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php new file mode 100644 index 0000000..934954c --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php @@ -0,0 +1,226 @@ + */ + private array $emulators = []; + + private PhpVersion $targetPhpVersion; + + private PhpVersion $hostPhpVersion; + + /** + * @param PhpVersion|null $phpVersion PHP version to emulate. Defaults to newest supported. + */ + public function __construct(?PhpVersion $phpVersion = null) { + $this->targetPhpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); + $this->hostPhpVersion = PhpVersion::getHostVersion(); + + $emulators = [ + new MatchTokenEmulator(), + new NullsafeTokenEmulator(), + new AttributeEmulator(), + new EnumTokenEmulator(), + new ReadonlyTokenEmulator(), + new ExplicitOctalEmulator(), + new ReadonlyFunctionTokenEmulator(), + ]; + + // Collect emulators that are relevant for the PHP version we're running + // and the PHP version we're targeting for emulation. + foreach ($emulators as $emulator) { + $emulatorPhpVersion = $emulator->getPhpVersion(); + if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) { + $this->emulators[] = $emulator; + } elseif ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { + $this->emulators[] = new ReverseEmulator($emulator); + } + } + } + + public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { + $emulators = array_filter($this->emulators, function ($emulator) use ($code) { + return $emulator->isEmulationNeeded($code); + }); + + if (empty($emulators)) { + // Nothing to emulate, yay + return parent::tokenize($code, $errorHandler); + } + + if ($errorHandler === null) { + $errorHandler = new ErrorHandler\Throwing(); + } + + $this->patches = []; + foreach ($emulators as $emulator) { + $code = $emulator->preprocessCode($code, $this->patches); + } + + $collector = new ErrorHandler\Collecting(); + $tokens = parent::tokenize($code, $collector); + $this->sortPatches(); + $tokens = $this->fixupTokens($tokens); + + $errors = $collector->getErrors(); + if (!empty($errors)) { + $this->fixupErrors($errors); + foreach ($errors as $error) { + $errorHandler->handleError($error); + } + } + + foreach ($emulators as $emulator) { + $tokens = $emulator->emulate($code, $tokens); + } + + return $tokens; + } + + private function isForwardEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { + return $this->hostPhpVersion->older($emulatorPhpVersion) + && $this->targetPhpVersion->newerOrEqual($emulatorPhpVersion); + } + + private function isReverseEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { + return $this->hostPhpVersion->newerOrEqual($emulatorPhpVersion) + && $this->targetPhpVersion->older($emulatorPhpVersion); + } + + private function sortPatches(): void { + // Patches may be contributed by different emulators. + // Make sure they are sorted by increasing patch position. + usort($this->patches, function ($p1, $p2) { + return $p1[0] <=> $p2[0]; + }); + } + + /** + * @param list $tokens + * @return list + */ + private function fixupTokens(array $tokens): array { + if (\count($this->patches) === 0) { + return $tokens; + } + + // Load first patch + $patchIdx = 0; + list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; + + // We use a manual loop over the tokens, because we modify the array on the fly + $posDelta = 0; + $lineDelta = 0; + for ($i = 0, $c = \count($tokens); $i < $c; $i++) { + $token = $tokens[$i]; + $pos = $token->pos; + $token->pos += $posDelta; + $token->line += $lineDelta; + $localPosDelta = 0; + $len = \strlen($token->text); + while ($patchPos >= $pos && $patchPos < $pos + $len) { + $patchTextLen = \strlen($patchText); + if ($patchType === 'remove') { + if ($patchPos === $pos && $patchTextLen === $len) { + // Remove token entirely + array_splice($tokens, $i, 1, []); + $i--; + $c--; + } else { + // Remove from token string + $token->text = substr_replace( + $token->text, '', $patchPos - $pos + $localPosDelta, $patchTextLen + ); + $localPosDelta -= $patchTextLen; + } + $lineDelta -= \substr_count($patchText, "\n"); + } elseif ($patchType === 'add') { + // Insert into the token string + $token->text = substr_replace( + $token->text, $patchText, $patchPos - $pos + $localPosDelta, 0 + ); + $localPosDelta += $patchTextLen; + $lineDelta += \substr_count($patchText, "\n"); + } elseif ($patchType === 'replace') { + // Replace inside the token string + $token->text = substr_replace( + $token->text, $patchText, $patchPos - $pos + $localPosDelta, $patchTextLen + ); + } else { + assert(false); + } + + // Fetch the next patch + $patchIdx++; + if ($patchIdx >= \count($this->patches)) { + // No more patches. However, we still need to adjust position. + $patchPos = \PHP_INT_MAX; + break; + } + + list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; + } + + $posDelta += $localPosDelta; + } + return $tokens; + } + + /** + * Fixup line and position information in errors. + * + * @param Error[] $errors + */ + private function fixupErrors(array $errors): void { + foreach ($errors as $error) { + $attrs = $error->getAttributes(); + + $posDelta = 0; + $lineDelta = 0; + foreach ($this->patches as $patch) { + list($patchPos, $patchType, $patchText) = $patch; + if ($patchPos >= $attrs['startFilePos']) { + // No longer relevant + break; + } + + if ($patchType === 'add') { + $posDelta += strlen($patchText); + $lineDelta += substr_count($patchText, "\n"); + } elseif ($patchType === 'remove') { + $posDelta -= strlen($patchText); + $lineDelta -= substr_count($patchText, "\n"); + } + } + + $attrs['startFilePos'] += $posDelta; + $attrs['endFilePos'] += $posDelta; + $attrs['startLine'] += $lineDelta; + $attrs['endLine'] += $lineDelta; + $error->setAttributes($attrs); + } + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php new file mode 100644 index 0000000..2c12f33 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php @@ -0,0 +1,49 @@ +text === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1]->text === '[') { + array_splice($tokens, $i, 2, [ + new Token(\T_ATTRIBUTE, '#[', $token->line, $token->pos), + ]); + $c--; + continue; + } + } + + return $tokens; + } + + public function reverseEmulate(string $code, array $tokens): array { + // TODO + return $tokens; + } + + public function preprocessCode(string $code, array &$patches): string { + $pos = 0; + while (false !== $pos = strpos($code, '#[', $pos)) { + // Replace #[ with %[ + $code[$pos] = '%'; + $patches[] = [$pos, 'replace', '#']; + $pos += 2; + } + return $code; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php new file mode 100644 index 0000000..5418f52 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php @@ -0,0 +1,26 @@ +id === \T_WHITESPACE + && $tokens[$pos + 2]->id === \T_STRING; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php new file mode 100644 index 0000000..9cadf42 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php @@ -0,0 +1,45 @@ +id == \T_LNUMBER && $token->text === '0' && + isset($tokens[$i + 1]) && $tokens[$i + 1]->id == \T_STRING && + preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1]->text) + ) { + $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1]->text); + array_splice($tokens, $i, 2, [ + new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos), + ]); + $c--; + } + } + return $tokens; + } + + private function resolveIntegerOrFloatToken(string $str): int { + $str = substr($str, 1); + $str = str_replace('_', '', $str); + $num = octdec($str); + return is_float($num) ? \T_DNUMBER : \T_LNUMBER; + } + + public function reverseEmulate(string $code, array $tokens): array { + // Explicit octals were not legal code previously, don't bother. + return $tokens; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php new file mode 100644 index 0000000..9803f99 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php @@ -0,0 +1,56 @@ +getKeywordString()) !== false; + } + + /** @param Token[] $tokens */ + protected function isKeywordContext(array $tokens, int $pos): bool { + $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); + return $previousNonSpaceToken === null || $previousNonSpaceToken->id !== \T_OBJECT_OPERATOR; + } + + public function emulate(string $code, array $tokens): array { + $keywordString = $this->getKeywordString(); + foreach ($tokens as $i => $token) { + if ($token->id === T_STRING && strtolower($token->text) === $keywordString + && $this->isKeywordContext($tokens, $i)) { + $token->id = $this->getKeywordToken(); + } + } + + return $tokens; + } + + /** @param Token[] $tokens */ + private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token { + for ($i = $start - 1; $i >= 0; --$i) { + if ($tokens[$i]->id === T_WHITESPACE) { + continue; + } + + return $tokens[$i]; + } + + return null; + } + + public function reverseEmulate(string $code, array $tokens): array { + $keywordToken = $this->getKeywordToken(); + foreach ($tokens as $token) { + if ($token->id === $keywordToken) { + $token->id = \T_STRING; + } + } + + return $tokens; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php new file mode 100644 index 0000000..0fa5fbc --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php @@ -0,0 +1,19 @@ +') !== false; + } + + public function emulate(string $code, array $tokens): array { + // We need to manually iterate and manage a count because we'll change + // the tokens array on the way + for ($i = 0, $c = count($tokens); $i < $c; ++$i) { + $token = $tokens[$i]; + if ($token->text === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1]->id === \T_OBJECT_OPERATOR) { + array_splice($tokens, $i, 2, [ + new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), + ]); + $c--; + continue; + } + + // Handle ?-> inside encapsed string. + if ($token->id === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) + && $tokens[$i - 1]->id === \T_VARIABLE + && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $token->text, $matches) + ) { + $replacement = [ + new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), + new Token(\T_STRING, $matches[1], $token->line, $token->pos + 3), + ]; + $matchLen = \strlen($matches[0]); + if ($matchLen !== \strlen($token->text)) { + $replacement[] = new Token( + \T_ENCAPSED_AND_WHITESPACE, + \substr($token->text, $matchLen), + $token->line, $token->pos + $matchLen + ); + } + array_splice($tokens, $i, 1, $replacement); + $c += \count($replacement) - 1; + continue; + } + } + + return $tokens; + } + + public function reverseEmulate(string $code, array $tokens): array { + // ?-> was not valid code previously, don't bother. + return $tokens; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php new file mode 100644 index 0000000..5990d7f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php @@ -0,0 +1,31 @@ +text === '(' || + ($tokens[$pos + 1]->id === \T_WHITESPACE && + isset($tokens[$pos + 2]) && + $tokens[$pos + 2]->text === '('))); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php new file mode 100644 index 0000000..851b5c4 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php @@ -0,0 +1,37 @@ +emulator = $emulator; + } + + public function getPhpVersion(): PhpVersion { + return $this->emulator->getPhpVersion(); + } + + public function isEmulationNeeded(string $code): bool { + return $this->emulator->isEmulationNeeded($code); + } + + public function emulate(string $code, array $tokens): array { + return $this->emulator->reverseEmulate($code, $tokens); + } + + public function reverseEmulate(string $code, array $tokens): array { + return $this->emulator->emulate($code, $tokens); + } + + public function preprocessCode(string $code, array &$patches): string { + return $code; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php new file mode 100644 index 0000000..fec2f19 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php @@ -0,0 +1,30 @@ + [aliasName => originalName]] */ + protected array $aliases = []; + + /** @var Name[][] Same as $aliases but preserving original case */ + protected array $origAliases = []; + + /** @var ErrorHandler Error handler */ + protected ErrorHandler $errorHandler; + + /** + * Create a name context. + * + * @param ErrorHandler $errorHandler Error handling used to report errors + */ + public function __construct(ErrorHandler $errorHandler) { + $this->errorHandler = $errorHandler; + } + + /** + * Start a new namespace. + * + * This also resets the alias table. + * + * @param Name|null $namespace Null is the global namespace + */ + public function startNamespace(?Name $namespace = null): void { + $this->namespace = $namespace; + $this->origAliases = $this->aliases = [ + Stmt\Use_::TYPE_NORMAL => [], + Stmt\Use_::TYPE_FUNCTION => [], + Stmt\Use_::TYPE_CONSTANT => [], + ]; + } + + /** + * Add an alias / import. + * + * @param Name $name Original name + * @param string $aliasName Aliased name + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* + * @param array $errorAttrs Attributes to use to report an error + */ + public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []): void { + // Constant names are case sensitive, everything else case insensitive + if ($type === Stmt\Use_::TYPE_CONSTANT) { + $aliasLookupName = $aliasName; + } else { + $aliasLookupName = strtolower($aliasName); + } + + if (isset($this->aliases[$type][$aliasLookupName])) { + $typeStringMap = [ + Stmt\Use_::TYPE_NORMAL => '', + Stmt\Use_::TYPE_FUNCTION => 'function ', + Stmt\Use_::TYPE_CONSTANT => 'const ', + ]; + + $this->errorHandler->handleError(new Error( + sprintf( + 'Cannot use %s%s as %s because the name is already in use', + $typeStringMap[$type], $name, $aliasName + ), + $errorAttrs + )); + return; + } + + $this->aliases[$type][$aliasLookupName] = $name; + $this->origAliases[$type][$aliasName] = $name; + } + + /** + * Get current namespace. + * + * @return null|Name Namespace (or null if global namespace) + */ + public function getNamespace(): ?Name { + return $this->namespace; + } + + /** + * Get resolved name. + * + * @param Name $name Name to resolve + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} + * + * @return null|Name Resolved name, or null if static resolution is not possible + */ + public function getResolvedName(Name $name, int $type): ?Name { + // don't resolve special class names + if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) { + if (!$name->isUnqualified()) { + $this->errorHandler->handleError(new Error( + sprintf("'\\%s' is an invalid class name", $name->toString()), + $name->getAttributes() + )); + } + return $name; + } + + // fully qualified names are already resolved + if ($name->isFullyQualified()) { + return $name; + } + + // Try to resolve aliases + if (null !== $resolvedName = $this->resolveAlias($name, $type)) { + return $resolvedName; + } + + if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) { + if (null === $this->namespace) { + // outside of a namespace unaliased unqualified is same as fully qualified + return new FullyQualified($name, $name->getAttributes()); + } + + // Cannot resolve statically + return null; + } + + // if no alias exists prepend current namespace + return FullyQualified::concat($this->namespace, $name, $name->getAttributes()); + } + + /** + * Get resolved class name. + * + * @param Name $name Class ame to resolve + * + * @return Name Resolved name + */ + public function getResolvedClassName(Name $name): Name { + return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL); + } + + /** + * Get possible ways of writing a fully qualified name (e.g., by making use of aliases). + * + * @param string $name Fully-qualified name (without leading namespace separator) + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* + * + * @return Name[] Possible representations of the name + */ + public function getPossibleNames(string $name, int $type): array { + $lcName = strtolower($name); + + if ($type === Stmt\Use_::TYPE_NORMAL) { + // self, parent and static must always be unqualified + if ($lcName === "self" || $lcName === "parent" || $lcName === "static") { + return [new Name($name)]; + } + } + + // Collect possible ways to write this name, starting with the fully-qualified name + $possibleNames = [new FullyQualified($name)]; + + if (null !== $nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type)) { + // Make sure there is no alias that makes the normally namespace-relative name + // into something else + if (null === $this->resolveAlias($nsRelativeName, $type)) { + $possibleNames[] = $nsRelativeName; + } + } + + // Check for relevant namespace use statements + foreach ($this->origAliases[Stmt\Use_::TYPE_NORMAL] as $alias => $orig) { + $lcOrig = $orig->toLowerString(); + if (0 === strpos($lcName, $lcOrig . '\\')) { + $possibleNames[] = new Name($alias . substr($name, strlen($lcOrig))); + } + } + + // Check for relevant type-specific use statements + foreach ($this->origAliases[$type] as $alias => $orig) { + if ($type === Stmt\Use_::TYPE_CONSTANT) { + // Constants are are complicated-sensitive + $normalizedOrig = $this->normalizeConstName($orig->toString()); + if ($normalizedOrig === $this->normalizeConstName($name)) { + $possibleNames[] = new Name($alias); + } + } else { + // Everything else is case-insensitive + if ($orig->toLowerString() === $lcName) { + $possibleNames[] = new Name($alias); + } + } + } + + return $possibleNames; + } + + /** + * Get shortest representation of this fully-qualified name. + * + * @param string $name Fully-qualified name (without leading namespace separator) + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* + * + * @return Name Shortest representation + */ + public function getShortName(string $name, int $type): Name { + $possibleNames = $this->getPossibleNames($name, $type); + + // Find shortest name + $shortestName = null; + $shortestLength = \INF; + foreach ($possibleNames as $possibleName) { + $length = strlen($possibleName->toCodeString()); + if ($length < $shortestLength) { + $shortestName = $possibleName; + $shortestLength = $length; + } + } + + return $shortestName; + } + + private function resolveAlias(Name $name, int $type): ?FullyQualified { + $firstPart = $name->getFirst(); + + if ($name->isQualified()) { + // resolve aliases for qualified names, always against class alias table + $checkName = strtolower($firstPart); + if (isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName])) { + $alias = $this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName]; + return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes()); + } + } elseif ($name->isUnqualified()) { + // constant aliases are case-sensitive, function aliases case-insensitive + $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : strtolower($firstPart); + if (isset($this->aliases[$type][$checkName])) { + // resolve unqualified aliases + return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes()); + } + } + + // No applicable aliases + return null; + } + + private function getNamespaceRelativeName(string $name, string $lcName, int $type): ?Name { + if (null === $this->namespace) { + return new Name($name); + } + + if ($type === Stmt\Use_::TYPE_CONSTANT) { + // The constants true/false/null always resolve to the global symbols, even inside a + // namespace, so they may be used without qualification + if ($lcName === "true" || $lcName === "false" || $lcName === "null") { + return new Name($name); + } + } + + $namespacePrefix = strtolower($this->namespace . '\\'); + if (0 === strpos($lcName, $namespacePrefix)) { + return new Name(substr($name, strlen($namespacePrefix))); + } + + return null; + } + + private function normalizeConstName(string $name): string { + $nsSep = strrpos($name, '\\'); + if (false === $nsSep) { + return $name; + } + + // Constants have case-insensitive namespace and case-sensitive short-name + $ns = substr($name, 0, $nsSep); + $shortName = substr($name, $nsSep + 1); + return strtolower($ns) . '\\' . $shortName; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node.php b/vendor/nikic/php-parser/lib/PhpParser/Node.php new file mode 100644 index 0000000..258e451 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node.php @@ -0,0 +1,146 @@ + + */ + public function getAttributes(): array; + + /** + * Replaces all the attributes of this node. + * + * @param array $attributes + */ + public function setAttributes(array $attributes): void; +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php new file mode 100644 index 0000000..6680efa --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php @@ -0,0 +1,44 @@ + $attributes Additional attributes + * @param Identifier|null $name Parameter name (for named parameters) + */ + public function __construct( + Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [], + ?Identifier $name = null + ) { + $this->attributes = $attributes; + $this->name = $name; + $this->value = $value; + $this->byRef = $byRef; + $this->unpack = $unpack; + } + + public function getSubNodeNames(): array { + return ['name', 'value', 'byRef', 'unpack']; + } + + public function getType(): string { + return 'Arg'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php new file mode 100644 index 0000000..fa1cff5 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php @@ -0,0 +1,43 @@ + $attributes Additional attributes + */ + public function __construct(Expr $value, ?Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { + $this->attributes = $attributes; + $this->key = $key; + $this->value = $value; + $this->byRef = $byRef; + $this->unpack = $unpack; + } + + public function getSubNodeNames(): array { + return ['key', 'value', 'byRef', 'unpack']; + } + + public function getType(): string { + return 'ArrayItem'; + } +} + +// @deprecated compatibility alias +class_alias(ArrayItem::class, Expr\ArrayItem::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php new file mode 100644 index 0000000..9d89243 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php @@ -0,0 +1,33 @@ + Attribute arguments */ + public array $args; + + /** + * @param Node\Name $name Attribute name + * @param list $args Attribute arguments + * @param array $attributes Additional node attributes + */ + public function __construct(Name $name, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['name', 'args']; + } + + public function getType(): string { + return 'Attribute'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php b/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php new file mode 100644 index 0000000..b9eb588 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php @@ -0,0 +1,27 @@ + $attributes Additional node attributes + */ + public function __construct(array $attrs, array $attributes = []) { + $this->attributes = $attributes; + $this->attrs = $attrs; + } + + public function getSubNodeNames(): array { + return ['attrs']; + } + + public function getType(): string { + return 'AttributeGroup'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php new file mode 100644 index 0000000..e313280 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php @@ -0,0 +1,36 @@ + $attributes Additional attributes + */ + public function __construct(Expr\Variable $var, bool $byRef = false, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->byRef = $byRef; + } + + public function getSubNodeNames(): array { + return ['var', 'byRef']; + } + + public function getType(): string { + return 'ClosureUse'; + } +} + +// @deprecated compatibility alias +class_alias(ClosureUse::class, Expr\ClosureUse::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php new file mode 100644 index 0000000..05a5e5e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php @@ -0,0 +1,13 @@ + $attributes Additional attributes + */ + public function __construct($name, Expr $value, array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Identifier($name) : $name; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['name', 'value']; + } + + public function getType(): string { + return 'Const'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php new file mode 100644 index 0000000..55c1fe4 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php @@ -0,0 +1,37 @@ +value pair node. + * + * @param string|Node\Identifier $key Key + * @param Node\Expr $value Value + * @param array $attributes Additional attributes + */ + public function __construct($key, Node\Expr $value, array $attributes = []) { + $this->attributes = $attributes; + $this->key = \is_string($key) ? new Node\Identifier($key) : $key; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['key', 'value']; + } + + public function getType(): string { + return 'DeclareItem'; + } +} + +// @deprecated compatibility alias +class_alias(DeclareItem::class, Stmt\DeclareDeclare::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php new file mode 100644 index 0000000..8b7dbb6 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php @@ -0,0 +1,8 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->dim = $dim; + } + + public function getSubNodeNames(): array { + return ['var', 'dim']; + } + + public function getType(): string { + return 'Expr_ArrayDimFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php new file mode 100644 index 0000000..490ac93 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(array $items = [], array $attributes = []) { + $this->attributes = $attributes; + $this->items = $items; + } + + public function getSubNodeNames(): array { + return ['items']; + } + + public function getType(): string { + return 'Expr_Array'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php new file mode 100644 index 0000000..0e98ce9 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php @@ -0,0 +1,84 @@ + false : Whether the closure is static + * 'byRef' => false : Whether to return by reference + * 'params' => array() : Parameters + * 'returnType' => null : Return type + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct(array $subNodes, array $attributes = []) { + $this->attributes = $attributes; + $this->static = $subNodes['static'] ?? false; + $this->byRef = $subNodes['byRef'] ?? false; + $this->params = $subNodes['params'] ?? []; + $this->returnType = $subNodes['returnType'] ?? null; + $this->expr = $subNodes['expr']; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; + } + + public function returnsByRef(): bool { + return $this->byRef; + } + + public function getParams(): array { + return $this->params; + } + + public function getReturnType() { + return $this->returnType; + } + + public function getAttrGroups(): array { + return $this->attrGroups; + } + + /** + * @return Node\Stmt\Return_[] + */ + public function getStmts(): array { + return [new Node\Stmt\Return_($this->expr)]; + } + + public function getType(): string { + return 'Expr_ArrowFunction'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php new file mode 100644 index 0000000..dcbf84d --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['var', 'expr']; + } + + public function getType(): string { + return 'Expr_Assign'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php new file mode 100644 index 0000000..5209a64 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['var', 'expr']; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php new file mode 100644 index 0000000..4f3623f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php @@ -0,0 +1,11 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['var', 'expr']; + } + + public function getType(): string { + return 'Expr_AssignRef'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php new file mode 100644 index 0000000..1b92bd4 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct(Expr $left, Expr $right, array $attributes = []) { + $this->attributes = $attributes; + $this->left = $left; + $this->right = $right; + } + + public function getSubNodeNames(): array { + return ['left', 'right']; + } + + /** + * Get the operator sigil for this binary operation. + * + * In the case there are multiple possible sigils for an operator, this method does not + * necessarily return the one used in the parsed code. + */ + abstract public function getOperatorSigil(): string; +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php new file mode 100644 index 0000000..5930c54 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php @@ -0,0 +1,15 @@ +'; + } + + public function getType(): string { + return 'Expr_BinaryOp_Greater'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php new file mode 100644 index 0000000..4d440b1 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php @@ -0,0 +1,15 @@ +='; + } + + public function getType(): string { + return 'Expr_BinaryOp_GreaterOrEqual'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php new file mode 100644 index 0000000..e25d17c --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php @@ -0,0 +1,15 @@ +>'; + } + + public function getType(): string { + return 'Expr_BinaryOp_ShiftRight'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php new file mode 100644 index 0000000..01e9b23 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php @@ -0,0 +1,15 @@ +'; + } + + public function getType(): string { + return 'Expr_BinaryOp_Spaceship'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php new file mode 100644 index 0000000..b7175a7 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_BitwiseNot'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php new file mode 100644 index 0000000..c66d233 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_BooleanNot'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php new file mode 100644 index 0000000..2af2245 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php @@ -0,0 +1,35 @@ + + */ + abstract public function getRawArgs(): array; + + /** + * Returns whether this call expression is actually a first class callable. + */ + public function isFirstClassCallable(): bool { + $rawArgs = $this->getRawArgs(); + return count($rawArgs) === 1 && current($rawArgs) instanceof VariadicPlaceholder; + } + + /** + * Assert that this is not a first-class callable and return only ordinary Args. + * + * @return Arg[] + */ + public function getArgs(): array { + assert(!$this->isFirstClassCallable()); + return $this->getRawArgs(); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php new file mode 100644 index 0000000..c2751de --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php @@ -0,0 +1,25 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php new file mode 100644 index 0000000..471cb82 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php @@ -0,0 +1,11 @@ + $attributes Additional attributes + */ + public function __construct(Node $class, $name, array $attributes = []) { + $this->attributes = $attributes; + $this->class = $class; + $this->name = \is_string($name) ? new Identifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['class', 'name']; + } + + public function getType(): string { + return 'Expr_ClassConstFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php new file mode 100644 index 0000000..d85bc9a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Clone'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php new file mode 100644 index 0000000..0680446 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php @@ -0,0 +1,86 @@ + false : Whether the closure is static + * 'byRef' => false : Whether to return by reference + * 'params' => array(): Parameters + * 'uses' => array(): use()s + * 'returnType' => null : Return type + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attributes groups + * @param array $attributes Additional attributes + */ + public function __construct(array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->static = $subNodes['static'] ?? false; + $this->byRef = $subNodes['byRef'] ?? false; + $this->params = $subNodes['params'] ?? []; + $this->uses = $subNodes['uses'] ?? []; + $this->returnType = $subNodes['returnType'] ?? null; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts']; + } + + public function returnsByRef(): bool { + return $this->byRef; + } + + public function getParams(): array { + return $this->params; + } + + public function getReturnType() { + return $this->returnType; + } + + /** @return Node\Stmt[] */ + public function getStmts(): array { + return $this->stmts; + } + + public function getAttrGroups(): array { + return $this->attrGroups; + } + + public function getType(): string { + return 'Expr_Closure'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php new file mode 100644 index 0000000..681ff31 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(Name $name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + } + + public function getSubNodeNames(): array { + return ['name']; + } + + public function getType(): string { + return 'Expr_ConstFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php new file mode 100644 index 0000000..d2f3050 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Empty'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php new file mode 100644 index 0000000..43010ac --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php @@ -0,0 +1,30 @@ + $attributes Additional attributes + */ + public function __construct(array $attributes = []) { + $this->attributes = $attributes; + } + + public function getSubNodeNames(): array { + return []; + } + + public function getType(): string { + return 'Expr_Error'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php new file mode 100644 index 0000000..32625a2 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_ErrorSuppress'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php new file mode 100644 index 0000000..5120b1b --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Eval'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php new file mode 100644 index 0000000..cf00246 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(?Expr $expr = null, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Exit'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php new file mode 100644 index 0000000..0b85840 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php @@ -0,0 +1,38 @@ + Arguments */ + public array $args; + + /** + * Constructs a function call node. + * + * @param Node\Name|Expr $name Function name + * @param array $args Arguments + * @param array $attributes Additional attributes + */ + public function __construct(Node $name, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['name', 'args']; + } + + public function getType(): string { + return 'Expr_FuncCall'; + } + + public function getRawArgs(): array { + return $this->args; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php new file mode 100644 index 0000000..e1187b1 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php @@ -0,0 +1,38 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, int $type, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + $this->type = $type; + } + + public function getSubNodeNames(): array { + return ['expr', 'type']; + } + + public function getType(): string { + return 'Expr_Include'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php new file mode 100644 index 0000000..a2783cb --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php @@ -0,0 +1,35 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, Node $class, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + $this->class = $class; + } + + public function getSubNodeNames(): array { + return ['expr', 'class']; + } + + public function getType(): string { + return 'Expr_Instanceof'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php new file mode 100644 index 0000000..4f80fff --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $vars, array $attributes = []) { + $this->attributes = $attributes; + $this->vars = $vars; + } + + public function getSubNodeNames(): array { + return ['vars']; + } + + public function getType(): string { + return 'Expr_Isset'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php new file mode 100644 index 0000000..496b7b3 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php @@ -0,0 +1,34 @@ + $attributes Additional attributes + */ + public function __construct(array $items, array $attributes = []) { + $this->attributes = $attributes; + $this->items = $items; + } + + public function getSubNodeNames(): array { + return ['items']; + } + + public function getType(): string { + return 'Expr_List'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php new file mode 100644 index 0000000..cd028a2 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php @@ -0,0 +1,32 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->arms = $arms; + } + + public function getSubNodeNames(): array { + return ['cond', 'arms']; + } + + public function getType(): string { + return 'Expr_Match'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php new file mode 100644 index 0000000..2703c75 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php @@ -0,0 +1,45 @@ + Arguments */ + public array $args; + + /** + * Constructs a function call node. + * + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes + */ + public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->name = \is_string($name) ? new Identifier($name) : $name; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['var', 'name', 'args']; + } + + public function getType(): string { + return 'Expr_MethodCall'; + } + + public function getRawArgs(): array { + return $this->args; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php new file mode 100644 index 0000000..eedaaa1 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php @@ -0,0 +1,40 @@ + Arguments */ + public array $args; + + /** + * Constructs a function call node. + * + * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) + * @param array $args Arguments + * @param array $attributes Additional attributes + */ + public function __construct(Node $class, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->class = $class; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['class', 'args']; + } + + public function getType(): string { + return 'Expr_New'; + } + + public function getRawArgs(): array { + return $this->args; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php new file mode 100644 index 0000000..a151f71 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php @@ -0,0 +1,45 @@ + Arguments */ + public array $args; + + /** + * Constructs a nullsafe method call node. + * + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes + */ + public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->name = \is_string($name) ? new Identifier($name) : $name; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['var', 'name', 'args']; + } + + public function getType(): string { + return 'Expr_NullsafeMethodCall'; + } + + public function getRawArgs(): array { + return $this->args; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php new file mode 100644 index 0000000..6f73a16 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php @@ -0,0 +1,35 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, $name, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->name = \is_string($name) ? new Identifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['var', 'name']; + } + + public function getType(): string { + return 'Expr_NullsafePropertyFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php new file mode 100644 index 0000000..3dca8fd --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + } + + public function getSubNodeNames(): array { + return ['var']; + } + + public function getType(): string { + return 'Expr_PostDec'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php new file mode 100644 index 0000000..bc990c3 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + } + + public function getSubNodeNames(): array { + return ['var']; + } + + public function getType(): string { + return 'Expr_PostInc'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php new file mode 100644 index 0000000..2f16873 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + } + + public function getSubNodeNames(): array { + return ['var']; + } + + public function getType(): string { + return 'Expr_PreDec'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php new file mode 100644 index 0000000..fd455f5 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + } + + public function getSubNodeNames(): array { + return ['var']; + } + + public function getType(): string { + return 'Expr_PreInc'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php new file mode 100644 index 0000000..6057476 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Print'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php new file mode 100644 index 0000000..8c416a8 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php @@ -0,0 +1,35 @@ + $attributes Additional attributes + */ + public function __construct(Expr $var, $name, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->name = \is_string($name) ? new Identifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['var', 'name']; + } + + public function getType(): string { + return 'Expr_PropertyFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php new file mode 100644 index 0000000..e400351 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php @@ -0,0 +1,30 @@ + $attributes Additional attributes + */ + public function __construct(array $parts, array $attributes = []) { + $this->attributes = $attributes; + $this->parts = $parts; + } + + public function getSubNodeNames(): array { + return ['parts']; + } + + public function getType(): string { + return 'Expr_ShellExec'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php new file mode 100644 index 0000000..707f34b --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php @@ -0,0 +1,45 @@ + Arguments */ + public array $args; + + /** + * Constructs a static method call node. + * + * @param Node\Name|Expr $class Class name + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes + */ + public function __construct(Node $class, $name, array $args = [], array $attributes = []) { + $this->attributes = $attributes; + $this->class = $class; + $this->name = \is_string($name) ? new Identifier($name) : $name; + $this->args = $args; + } + + public function getSubNodeNames(): array { + return ['class', 'name', 'args']; + } + + public function getType(): string { + return 'Expr_StaticCall'; + } + + public function getRawArgs(): array { + return $this->args; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php new file mode 100644 index 0000000..4836a65 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php @@ -0,0 +1,36 @@ + $attributes Additional attributes + */ + public function __construct(Node $class, $name, array $attributes = []) { + $this->attributes = $attributes; + $this->class = $class; + $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['class', 'name']; + } + + public function getType(): string { + return 'Expr_StaticPropertyFetch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php new file mode 100644 index 0000000..d4837e6 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->if = $if; + $this->else = $else; + } + + public function getSubNodeNames(): array { + return ['cond', 'if', 'else']; + } + + public function getType(): string { + return 'Expr_Ternary'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php new file mode 100644 index 0000000..ee49f83 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_Throw'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php new file mode 100644 index 0000000..cd06f74 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_UnaryMinus'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php new file mode 100644 index 0000000..1b44f7b --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_UnaryPlus'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php new file mode 100644 index 0000000..bab7492 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct($name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + } + + public function getSubNodeNames(): array { + return ['name']; + } + + public function getType(): string { + return 'Expr_Variable'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php new file mode 100644 index 0000000..5cff88f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Expr_YieldFrom'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php new file mode 100644 index 0000000..bd81e69 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) { + $this->attributes = $attributes; + $this->key = $key; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['key', 'value']; + } + + public function getType(): string { + return 'Expr_Yield'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php new file mode 100644 index 0000000..58f653a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php @@ -0,0 +1,40 @@ + */ + private static array $specialClassNames = [ + 'self' => true, + 'parent' => true, + 'static' => true, + ]; + + /** + * Constructs an identifier node. + * + * @param string $name Identifier as string + * @param array $attributes Additional attributes + */ + public function __construct(string $name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + } + + public function getSubNodeNames(): array { + return ['name']; + } + + /** + * Get identifier as string. + * + * @return string Identifier as string. + */ + public function toString(): string { + return $this->name; + } + + /** + * Get lowercased identifier as string. + * + * @return string Lowercased identifier as string + */ + public function toLowerString(): string { + return strtolower($this->name); + } + + /** + * Checks whether the identifier is a special class name (self, parent or static). + * + * @return bool Whether identifier is a special class name + */ + public function isSpecialClassName(): bool { + return isset(self::$specialClassNames[strtolower($this->name)]); + } + + /** + * Get identifier as string. + * + * @return string Identifier as string + */ + public function __toString(): string { + return $this->name; + } + + public function getType(): string { + return 'Identifier'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php b/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php new file mode 100644 index 0000000..576dac4 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php @@ -0,0 +1,32 @@ + $attributes Additional attributes + */ + public function __construct(string $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + public function getType(): string { + return 'InterpolatedStringPart'; + } +} + +// @deprecated compatibility alias +class_alias(InterpolatedStringPart::class, Scalar\EncapsedStringPart::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php new file mode 100644 index 0000000..3b39cf1 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php @@ -0,0 +1,27 @@ + $attributes Additional attributes + */ + public function __construct(array $types, array $attributes = []) { + $this->attributes = $attributes; + $this->types = $types; + } + + public function getSubNodeNames(): array { + return ['types']; + } + + public function getType(): string { + return 'IntersectionType'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php b/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php new file mode 100644 index 0000000..2927f02 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php @@ -0,0 +1,30 @@ + */ + public ?array $conds; + /** @var Node\Expr */ + public Expr $body; + + /** + * @param null|list $conds + */ + public function __construct(?array $conds, Node\Expr $body, array $attributes = []) { + $this->conds = $conds; + $this->body = $body; + $this->attributes = $attributes; + } + + public function getSubNodeNames(): array { + return ['conds', 'body']; + } + + public function getType(): string { + return 'MatchArm'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php new file mode 100644 index 0000000..26b863e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php @@ -0,0 +1,269 @@ + */ + private static array $specialClassNames = [ + 'self' => true, + 'parent' => true, + 'static' => true, + ]; + + /** + * Constructs a name node. + * + * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) + * @param array $attributes Additional attributes + */ + final public function __construct($name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = self::prepareName($name); + } + + public function getSubNodeNames(): array { + return ['name']; + } + + /** + * Get parts of name (split by the namespace separator). + * + * @return string[] Parts of name + */ + public function getParts(): array { + return \explode('\\', $this->name); + } + + /** + * Gets the first part of the name, i.e. everything before the first namespace separator. + * + * @return string First part of the name + */ + public function getFirst(): string { + if (false !== $pos = \strpos($this->name, '\\')) { + return \substr($this->name, 0, $pos); + } + return $this->name; + } + + /** + * Gets the last part of the name, i.e. everything after the last namespace separator. + * + * @return string Last part of the name + */ + public function getLast(): string { + if (false !== $pos = \strrpos($this->name, '\\')) { + return \substr($this->name, $pos + 1); + } + return $this->name; + } + + /** + * Checks whether the name is unqualified. (E.g. Name) + * + * @return bool Whether the name is unqualified + */ + public function isUnqualified(): bool { + return false === \strpos($this->name, '\\'); + } + + /** + * Checks whether the name is qualified. (E.g. Name\Name) + * + * @return bool Whether the name is qualified + */ + public function isQualified(): bool { + return false !== \strpos($this->name, '\\'); + } + + /** + * Checks whether the name is fully qualified. (E.g. \Name) + * + * @return bool Whether the name is fully qualified + */ + public function isFullyQualified(): bool { + return false; + } + + /** + * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) + * + * @return bool Whether the name is relative + */ + public function isRelative(): bool { + return false; + } + + /** + * Returns a string representation of the name itself, without taking the name type into + * account (e.g., not including a leading backslash for fully qualified names). + * + * @return string String representation + */ + public function toString(): string { + return $this->name; + } + + /** + * Returns a string representation of the name as it would occur in code (e.g., including + * leading backslash for fully qualified names. + * + * @return string String representation + */ + public function toCodeString(): string { + return $this->toString(); + } + + /** + * Returns lowercased string representation of the name, without taking the name type into + * account (e.g., no leading backslash for fully qualified names). + * + * @return string Lowercased string representation + */ + public function toLowerString(): string { + return strtolower($this->name); + } + + /** + * Checks whether the identifier is a special class name (self, parent or static). + * + * @return bool Whether identifier is a special class name + */ + public function isSpecialClassName(): bool { + return isset(self::$specialClassNames[strtolower($this->name)]); + } + + /** + * Returns a string representation of the name by imploding the namespace parts with the + * namespace separator. + * + * @return string String representation + */ + public function __toString(): string { + return $this->name; + } + + /** + * Gets a slice of a name (similar to array_slice). + * + * This method returns a new instance of the same type as the original and with the same + * attributes. + * + * If the slice is empty, null is returned. The null value will be correctly handled in + * concatenations using concat(). + * + * Offset and length have the same meaning as in array_slice(). + * + * @param int $offset Offset to start the slice at (may be negative) + * @param int|null $length Length of the slice (may be negative) + * + * @return static|null Sliced name + */ + public function slice(int $offset, ?int $length = null) { + if ($offset === 1 && $length === null) { + // Short-circuit the common case. + if (false !== $pos = \strpos($this->name, '\\')) { + return new static(\substr($this->name, $pos + 1)); + } + return null; + } + + $parts = \explode('\\', $this->name); + $numParts = \count($parts); + + $realOffset = $offset < 0 ? $offset + $numParts : $offset; + if ($realOffset < 0 || $realOffset > $numParts) { + throw new \OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset)); + } + + if (null === $length) { + $realLength = $numParts - $realOffset; + } else { + $realLength = $length < 0 ? $length + $numParts - $realOffset : $length; + if ($realLength < 0 || $realLength > $numParts - $realOffset) { + throw new \OutOfBoundsException(sprintf('Length %d is out of bounds', $length)); + } + } + + if ($realLength === 0) { + // Empty slice is represented as null + return null; + } + + return new static(array_slice($parts, $realOffset, $realLength), $this->attributes); + } + + /** + * Concatenate two names, yielding a new Name instance. + * + * The type of the generated instance depends on which class this method is called on, for + * example Name\FullyQualified::concat() will yield a Name\FullyQualified instance. + * + * If one of the arguments is null, a new instance of the other name will be returned. If both + * arguments are null, null will be returned. As such, writing + * Name::concat($namespace, $shortName) + * where $namespace is a Name node or null will work as expected. + * + * @param string|string[]|self|null $name1 The first name + * @param string|string[]|self|null $name2 The second name + * @param array $attributes Attributes to assign to concatenated name + * + * @return static|null Concatenated name + */ + public static function concat($name1, $name2, array $attributes = []) { + if (null === $name1 && null === $name2) { + return null; + } + if (null === $name1) { + return new static($name2, $attributes); + } + if (null === $name2) { + return new static($name1, $attributes); + } else { + return new static( + self::prepareName($name1) . '\\' . self::prepareName($name2), $attributes + ); + } + } + + /** + * Prepares a (string, array or Name node) name for use in name changing methods by converting + * it to a string. + * + * @param string|string[]|self $name Name to prepare + * + * @return string Prepared name + */ + private static function prepareName($name): string { + if (\is_string($name)) { + if ('' === $name) { + throw new \InvalidArgumentException('Name cannot be empty'); + } + + return $name; + } + if (\is_array($name)) { + if (empty($name)) { + throw new \InvalidArgumentException('Name cannot be empty'); + } + + return implode('\\', $name); + } + if ($name instanceof self) { + return $name->name; + } + + throw new \InvalidArgumentException( + 'Expected string, array of parts or Name instance' + ); + } + + public function getType(): string { + return 'Name'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php new file mode 100644 index 0000000..2118378 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php @@ -0,0 +1,49 @@ +toString(); + } + + public function getType(): string { + return 'Name_FullyQualified'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php new file mode 100644 index 0000000..0226a4e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php @@ -0,0 +1,49 @@ +toString(); + } + + public function getType(): string { + return 'Name_Relative'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php new file mode 100644 index 0000000..b99acd1 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(Node $type, array $attributes = []) { + $this->attributes = $attributes; + $this->type = $type; + } + + public function getSubNodeNames(): array { + return ['type']; + } + + public function getType(): string { + return 'NullableType'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php new file mode 100644 index 0000000..0e9ff0e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php @@ -0,0 +1,84 @@ + $attributes Additional attributes + * @param int $flags Optional visibility flags + * @param list $attrGroups PHP attribute groups + */ + public function __construct( + Expr $var, ?Expr $default = null, ?Node $type = null, + bool $byRef = false, bool $variadic = false, + array $attributes = [], + int $flags = 0, + array $attrGroups = [] + ) { + $this->attributes = $attributes; + $this->type = $type; + $this->byRef = $byRef; + $this->variadic = $variadic; + $this->var = $var; + $this->default = $default; + $this->flags = $flags; + $this->attrGroups = $attrGroups; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; + } + + public function getType(): string { + return 'Param'; + } + + /** + * Whether this parameter uses constructor property promotion. + */ + public function isPromoted(): bool { + return $this->flags !== 0; + } + + public function isPublic(): bool { + return (bool) ($this->flags & Modifiers::PUBLIC); + } + + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); + } + + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); + } + + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php new file mode 100644 index 0000000..101611e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct($name, ?Node\Expr $default = null, array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; + $this->default = $default; + } + + public function getSubNodeNames(): array { + return ['name', 'default']; + } + + public function getType(): string { + return 'PropertyItem'; + } +} + +// @deprecated compatibility alias +class_alias(PropertyItem::class, Stmt\PropertyProperty::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php new file mode 100644 index 0000000..3df2572 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php @@ -0,0 +1,6 @@ + $attributes Additional attributes + */ + public function __construct(float $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + /** + * @param mixed[] $attributes + */ + public static function fromString(string $str, array $attributes = []): Float_ { + $attributes['rawValue'] = $str; + $float = self::parse($str); + + return new Float_($float, $attributes); + } + + /** + * @internal + * + * Parses a DNUMBER token like PHP would. + * + * @param string $str A string number + * + * @return float The parsed number + */ + public static function parse(string $str): float { + $str = str_replace('_', '', $str); + + // Check whether this is one of the special integer notations. + if ('0' === $str[0]) { + // hex + if ('x' === $str[1] || 'X' === $str[1]) { + return hexdec($str); + } + + // bin + if ('b' === $str[1] || 'B' === $str[1]) { + return bindec($str); + } + + // oct, but only if the string does not contain any of '.eE'. + if (false === strpbrk($str, '.eE')) { + // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit + // (8 or 9) so that only the digits before that are used. + return octdec(substr($str, 0, strcspn($str, '89'))); + } + } + + // dec + return (float) $str; + } + + public function getType(): string { + return 'Scalar_Float'; + } +} + +// @deprecated compatibility alias +class_alias(Float_::class, DNumber::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php new file mode 100644 index 0000000..bcc257a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php @@ -0,0 +1,82 @@ + $attributes Additional attributes + */ + public function __construct(int $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + /** + * Constructs an Int node from a string number literal. + * + * @param string $str String number literal (decimal, octal, hex or binary) + * @param array $attributes Additional attributes + * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) + * + * @return Int_ The constructed LNumber, including kind attribute + */ + public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false): Int_ { + $attributes['rawValue'] = $str; + + $str = str_replace('_', '', $str); + + if ('0' !== $str[0] || '0' === $str) { + $attributes['kind'] = Int_::KIND_DEC; + return new Int_((int) $str, $attributes); + } + + if ('x' === $str[1] || 'X' === $str[1]) { + $attributes['kind'] = Int_::KIND_HEX; + return new Int_(hexdec($str), $attributes); + } + + if ('b' === $str[1] || 'B' === $str[1]) { + $attributes['kind'] = Int_::KIND_BIN; + return new Int_(bindec($str), $attributes); + } + + if (!$allowInvalidOctal && strpbrk($str, '89')) { + throw new Error('Invalid numeric literal', $attributes); + } + + // Strip optional explicit octal prefix. + if ('o' === $str[1] || 'O' === $str[1]) { + $str = substr($str, 2); + } + + // use intval instead of octdec to get proper cutting behavior with malformed numbers + $attributes['kind'] = Int_::KIND_OCT; + return new Int_(intval($str, 8), $attributes); + } + + public function getType(): string { + return 'Scalar_Int'; + } +} + +// @deprecated compatibility alias +class_alias(Int_::class, LNumber::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php new file mode 100644 index 0000000..9336dfe --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php @@ -0,0 +1,34 @@ + $attributes Additional attributes + */ + public function __construct(array $parts, array $attributes = []) { + $this->attributes = $attributes; + $this->parts = $parts; + } + + public function getSubNodeNames(): array { + return ['parts']; + } + + public function getType(): string { + return 'Scalar_InterpolatedString'; + } +} + +// @deprecated compatibility alias +class_alias(InterpolatedString::class, Encapsed::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php new file mode 100644 index 0000000..cfe8c8c --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(array $attributes = []) { + $this->attributes = $attributes; + } + + public function getSubNodeNames(): array { + return []; + } + + /** + * Get name of magic constant. + * + * @return string Name of magic constant + */ + abstract public function getName(): string; +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php new file mode 100644 index 0000000..732ed14 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php @@ -0,0 +1,15 @@ + Escaped character to its decoded value */ + protected static array $replacements = [ + '\\' => '\\', + '$' => '$', + 'n' => "\n", + 'r' => "\r", + 't' => "\t", + 'f' => "\f", + 'v' => "\v", + 'e' => "\x1B", + ]; + + /** + * Constructs a string scalar node. + * + * @param string $value Value of the string + * @param array $attributes Additional attributes + */ + public function __construct(string $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + /** + * @param array $attributes + * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes + */ + public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self { + $attributes['kind'] = ($str[0] === "'" || ($str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B'))) + ? Scalar\String_::KIND_SINGLE_QUOTED + : Scalar\String_::KIND_DOUBLE_QUOTED; + + $attributes['rawValue'] = $str; + + $string = self::parse($str, $parseUnicodeEscape); + + return new self($string, $attributes); + } + + /** + * @internal + * + * Parses a string token. + * + * @param string $str String token content + * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes + * + * @return string The parsed string + */ + public static function parse(string $str, bool $parseUnicodeEscape = true): string { + $bLength = 0; + if ('b' === $str[0] || 'B' === $str[0]) { + $bLength = 1; + } + + if ('\'' === $str[$bLength]) { + return str_replace( + ['\\\\', '\\\''], + ['\\', '\''], + substr($str, $bLength + 1, -1) + ); + } else { + return self::parseEscapeSequences( + substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape + ); + } + } + + /** + * @internal + * + * Parses escape sequences in strings (all string types apart from single quoted). + * + * @param string $str String without quotes + * @param null|string $quote Quote type + * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes + * + * @return string String with escape sequences parsed + */ + public static function parseEscapeSequences(string $str, ?string $quote, bool $parseUnicodeEscape = true): string { + if (null !== $quote) { + $str = str_replace('\\' . $quote, $quote, $str); + } + + $extra = ''; + if ($parseUnicodeEscape) { + $extra = '|u\{([0-9a-fA-F]+)\}'; + } + + return preg_replace_callback( + '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', + function ($matches) { + $str = $matches[1]; + + if (isset(self::$replacements[$str])) { + return self::$replacements[$str]; + } + if ('x' === $str[0] || 'X' === $str[0]) { + return chr(hexdec(substr($str, 1))); + } + if ('u' === $str[0]) { + $dec = hexdec($matches[2]); + // If it overflowed to float, treat as INT_MAX, it will throw an error anyway. + return self::codePointToUtf8(\is_int($dec) ? $dec : \PHP_INT_MAX); + } else { + return chr(octdec($str)); + } + }, + $str + ); + } + + /** + * Converts a Unicode code point to its UTF-8 encoded representation. + * + * @param int $num Code point + * + * @return string UTF-8 representation of code point + */ + private static function codePointToUtf8(int $num): string { + if ($num <= 0x7F) { + return chr($num); + } + if ($num <= 0x7FF) { + return chr(($num >> 6) + 0xC0) . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0xFFFF) { + return chr(($num >> 12) + 0xE0) . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0x1FFFFF) { + return chr(($num >> 18) + 0xF0) . chr((($num >> 12) & 0x3F) + 0x80) + . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); + } + throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); + } + + public function getType(): string { + return 'Scalar_String'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php new file mode 100644 index 0000000..517c0ed --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php @@ -0,0 +1,39 @@ + $attributes Additional attributes + */ + public function __construct( + Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] + ) { + $this->attributes = $attributes; + $this->var = $var; + $this->default = $default; + } + + public function getSubNodeNames(): array { + return ['var', 'default']; + } + + public function getType(): string { + return 'StaticVar'; + } +} + +// @deprecated compatibility alias +class_alias(StaticVar::class, Stmt\StaticVar::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php new file mode 100644 index 0000000..481d31a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php @@ -0,0 +1,8 @@ + $attributes Additional attributes + */ + public function __construct(array $stmts, array $attributes = []) { + $this->attributes = $attributes; + $this->stmts = $stmts; + } + + public function getType(): string { + return 'Stmt_Block'; + } + + public function getSubNodeNames(): array { + return ['stmts']; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php new file mode 100644 index 0000000..d2bcc5e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Expr $num = null, array $attributes = []) { + $this->attributes = $attributes; + $this->num = $num; + } + + public function getSubNodeNames(): array { + return ['num']; + } + + public function getType(): string { + return 'Stmt_Break'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php new file mode 100644 index 0000000..a06ca18 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Expr $cond, array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['cond', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Case'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php new file mode 100644 index 0000000..e8d39c9 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php @@ -0,0 +1,40 @@ + $attributes Additional attributes + */ + public function __construct( + array $types, ?Expr\Variable $var = null, array $stmts = [], array $attributes = [] + ) { + $this->attributes = $attributes; + $this->types = $types; + $this->var = $var; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['types', 'var', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Catch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php new file mode 100644 index 0000000..9bdce1f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @@ -0,0 +1,77 @@ + $attributes Additional attributes + * @param list $attrGroups PHP attribute groups + * @param null|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration + */ + public function __construct( + array $consts, + int $flags = 0, + array $attributes = [], + array $attrGroups = [], + ?Node $type = null + ) { + $this->attributes = $attributes; + $this->flags = $flags; + $this->consts = $consts; + $this->attrGroups = $attrGroups; + $this->type = $type; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'consts']; + } + + /** + * Whether constant is explicitly or implicitly public. + */ + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; + } + + /** + * Whether constant is protected. + */ + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); + } + + /** + * Whether constant is private. + */ + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); + } + + /** + * Whether constant is final. + */ + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); + } + + public function getType(): string { + return 'Stmt_ClassConst'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php new file mode 100644 index 0000000..fb9ba4f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php @@ -0,0 +1,109 @@ +stmts as $stmt) { + if ($stmt instanceof TraitUse) { + $traitUses[] = $stmt; + } + } + return $traitUses; + } + + /** + * @return ClassConst[] + */ + public function getConstants(): array { + $constants = []; + foreach ($this->stmts as $stmt) { + if ($stmt instanceof ClassConst) { + $constants[] = $stmt; + } + } + return $constants; + } + + /** + * @return Property[] + */ + public function getProperties(): array { + $properties = []; + foreach ($this->stmts as $stmt) { + if ($stmt instanceof Property) { + $properties[] = $stmt; + } + } + return $properties; + } + + /** + * Gets property with the given name defined directly in this class/interface/trait. + * + * @param string $name Name of the property + * + * @return Property|null Property node or null if the property does not exist + */ + public function getProperty(string $name): ?Property { + foreach ($this->stmts as $stmt) { + if ($stmt instanceof Property) { + foreach ($stmt->props as $prop) { + if ($prop instanceof PropertyItem && $name === $prop->name->toString()) { + return $stmt; + } + } + } + } + return null; + } + + /** + * Gets all methods defined directly in this class/interface/trait + * + * @return ClassMethod[] + */ + public function getMethods(): array { + $methods = []; + foreach ($this->stmts as $stmt) { + if ($stmt instanceof ClassMethod) { + $methods[] = $stmt; + } + } + return $methods; + } + + /** + * Gets method with the given name defined directly in this class/interface/trait. + * + * @param string $name Name of the method (compared case-insensitively) + * + * @return ClassMethod|null Method node or null if the method does not exist + */ + public function getMethod(string $name): ?ClassMethod { + $lowerName = strtolower($name); + foreach ($this->stmts as $stmt) { + if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) { + return $stmt; + } + } + return null; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php new file mode 100644 index 0000000..59c0519 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php @@ -0,0 +1,154 @@ + */ + private static array $magicNames = [ + '__construct' => true, + '__destruct' => true, + '__call' => true, + '__callstatic' => true, + '__get' => true, + '__set' => true, + '__isset' => true, + '__unset' => true, + '__sleep' => true, + '__wakeup' => true, + '__tostring' => true, + '__set_state' => true, + '__clone' => true, + '__invoke' => true, + '__debuginfo' => true, + '__serialize' => true, + '__unserialize' => true, + ]; + + /** + * Constructs a class method node. + * + * @param string|Node\Identifier $name Name + * @param array{ + * flags?: int, + * byRef?: bool, + * params?: Node\Param[], + * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, + * stmts?: Node\Stmt[]|null, + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'flags => 0 : Flags + * 'byRef' => false : Whether to return by reference + * 'params' => array() : Parameters + * 'returnType' => null : Return type + * 'stmts' => array() : Statements + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; + $this->byRef = $subNodes['byRef'] ?? false; + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->params = $subNodes['params'] ?? []; + $this->returnType = $subNodes['returnType'] ?? null; + $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; + } + + public function returnsByRef(): bool { + return $this->byRef; + } + + public function getParams(): array { + return $this->params; + } + + public function getReturnType() { + return $this->returnType; + } + + public function getStmts(): ?array { + return $this->stmts; + } + + public function getAttrGroups(): array { + return $this->attrGroups; + } + + /** + * Whether the method is explicitly or implicitly public. + */ + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; + } + + /** + * Whether the method is protected. + */ + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); + } + + /** + * Whether the method is private. + */ + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); + } + + /** + * Whether the method is abstract. + */ + public function isAbstract(): bool { + return (bool) ($this->flags & Modifiers::ABSTRACT); + } + + /** + * Whether the method is final. + */ + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); + } + + /** + * Whether the method is static. + */ + public function isStatic(): bool { + return (bool) ($this->flags & Modifiers::STATIC); + } + + /** + * Whether the method is magic. + */ + public function isMagic(): bool { + return isset(self::$magicNames[$this->name->toLowerString()]); + } + + public function getType(): string { + return 'Stmt_ClassMethod'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php new file mode 100644 index 0000000..3f492b7 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php @@ -0,0 +1,94 @@ + 0 : Flags + * 'extends' => null : Name of extended class + * 'implements' => array(): Names of implemented interfaces + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->extends = $subNodes['extends'] ?? null; + $this->implements = $subNodes['implements'] ?? []; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; + } + + /** + * Whether the class is explicitly abstract. + */ + public function isAbstract(): bool { + return (bool) ($this->flags & Modifiers::ABSTRACT); + } + + /** + * Whether the class is final. + */ + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); + } + + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); + } + + /** + * Whether the class is anonymous. + */ + public function isAnonymous(): bool { + return null === $this->name; + } + + public function getType(): string { + return 'Stmt_Class'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php new file mode 100644 index 0000000..f1165fd --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $consts, array $attributes = []) { + $this->attributes = $attributes; + $this->consts = $consts; + } + + public function getSubNodeNames(): array { + return ['consts']; + } + + public function getType(): string { + return 'Stmt_Const'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php new file mode 100644 index 0000000..54e979d --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Expr $num = null, array $attributes = []) { + $this->attributes = $attributes; + $this->num = $num; + } + + public function getSubNodeNames(): array { + return ['num']; + } + + public function getType(): string { + return 'Stmt_Continue'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php new file mode 100644 index 0000000..cb9e837 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(array $declares, ?array $stmts = null, array $attributes = []) { + $this->attributes = $attributes; + $this->declares = $declares; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['declares', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Declare'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php new file mode 100644 index 0000000..6124442 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['stmts', 'cond']; + } + + public function getType(): string { + return 'Stmt_Do'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php new file mode 100644 index 0000000..4d42452 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $exprs, array $attributes = []) { + $this->attributes = $attributes; + $this->exprs = $exprs; + } + + public function getSubNodeNames(): array { + return ['exprs']; + } + + public function getType(): string { + return 'Stmt_Echo'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php new file mode 100644 index 0000000..b26d59c --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['cond', 'stmts']; + } + + public function getType(): string { + return 'Stmt_ElseIf'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php new file mode 100644 index 0000000..3d2b066 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['stmts']; + } + + public function getType(): string { + return 'Stmt_Else'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php new file mode 100644 index 0000000..c071a0a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php @@ -0,0 +1,36 @@ + $attrGroups PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { + parent::__construct($attributes); + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->expr = $expr; + $this->attrGroups = $attrGroups; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'name', 'expr']; + } + + public function getType(): string { + return 'Stmt_EnumCase'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php new file mode 100644 index 0000000..7eea6a6 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php @@ -0,0 +1,44 @@ + null : Scalar type + * 'implements' => array() : Names of implemented interfaces + * 'stmts' => array() : Statements + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->scalarType = $subNodes['scalarType'] ?? null; + $this->implements = $subNodes['implements'] ?? []; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + + parent::__construct($attributes); + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Enum'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php new file mode 100644 index 0000000..89751fa --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php @@ -0,0 +1,32 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $expr, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Stmt_Expression'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php new file mode 100644 index 0000000..69ecf25 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['stmts']; + } + + public function getType(): string { + return 'Stmt_Finally'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php new file mode 100644 index 0000000..6f2fbb9 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php @@ -0,0 +1,47 @@ + array(): Init expressions + * 'cond' => array(): Loop conditions + * 'loop' => array(): Loop expressions + * 'stmts' => array(): Statements + * @param array $attributes Additional attributes + */ + public function __construct(array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->init = $subNodes['init'] ?? []; + $this->cond = $subNodes['cond'] ?? []; + $this->loop = $subNodes['loop'] ?? []; + $this->stmts = $subNodes['stmts'] ?? []; + } + + public function getSubNodeNames(): array { + return ['init', 'cond', 'loop', 'stmts']; + } + + public function getType(): string { + return 'Stmt_For'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php new file mode 100644 index 0000000..c5d9a8b --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php @@ -0,0 +1,50 @@ + null : Variable to assign key to + * 'byRef' => false : Whether to assign value by reference + * 'stmts' => array(): Statements + * @param array $attributes Additional attributes + */ + public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + $this->keyVar = $subNodes['keyVar'] ?? null; + $this->byRef = $subNodes['byRef'] ?? false; + $this->valueVar = $valueVar; + $this->stmts = $subNodes['stmts'] ?? []; + } + + public function getSubNodeNames(): array { + return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Foreach'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php new file mode 100644 index 0000000..2111bab --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php @@ -0,0 +1,81 @@ + false : Whether to return by reference + * 'params' => array(): Parameters + * 'returnType' => null : Return type + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->byRef = $subNodes['byRef'] ?? false; + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->params = $subNodes['params'] ?? []; + $this->returnType = $subNodes['returnType'] ?? null; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts']; + } + + public function returnsByRef(): bool { + return $this->byRef; + } + + public function getParams(): array { + return $this->params; + } + + public function getReturnType() { + return $this->returnType; + } + + public function getAttrGroups(): array { + return $this->attrGroups; + } + + /** @return Node\Stmt[] */ + public function getStmts(): array { + return $this->stmts; + } + + public function getType(): string { + return 'Stmt_Function'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php new file mode 100644 index 0000000..d3ab12f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $vars, array $attributes = []) { + $this->attributes = $attributes; + $this->vars = $vars; + } + + public function getSubNodeNames(): array { + return ['vars']; + } + + public function getType(): string { + return 'Stmt_Global'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php new file mode 100644 index 0000000..26a0d01 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php @@ -0,0 +1,30 @@ + $attributes Additional attributes + */ + public function __construct($name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Identifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['name']; + } + + public function getType(): string { + return 'Stmt_Goto'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php new file mode 100644 index 0000000..0ec8e9d --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php @@ -0,0 +1,41 @@ + $attributes Additional attributes + */ + public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) { + $this->attributes = $attributes; + $this->type = $type; + $this->prefix = $prefix; + $this->uses = $uses; + } + + public function getSubNodeNames(): array { + return ['type', 'prefix', 'uses']; + } + + public function getType(): string { + return 'Stmt_GroupUse'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php new file mode 100644 index 0000000..665bacd --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(string $remaining, array $attributes = []) { + $this->attributes = $attributes; + $this->remaining = $remaining; + } + + public function getSubNodeNames(): array { + return ['remaining']; + } + + public function getType(): string { + return 'Stmt_HaltCompiler'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php new file mode 100644 index 0000000..544390f --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php @@ -0,0 +1,46 @@ + array(): Statements + * 'elseifs' => array(): Elseif clauses + * 'else' => null : Else clause + * @param array $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->stmts = $subNodes['stmts'] ?? []; + $this->elseifs = $subNodes['elseifs'] ?? []; + $this->else = $subNodes['else'] ?? null; + } + + public function getSubNodeNames(): array { + return ['cond', 'stmts', 'elseifs', 'else']; + } + + public function getType(): string { + return 'Stmt_If'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php new file mode 100644 index 0000000..0515d02 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(string $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + public function getType(): string { + return 'Stmt_InlineHTML'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php new file mode 100644 index 0000000..9359064 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php @@ -0,0 +1,40 @@ + array(): Name of extended interfaces + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->extends = $subNodes['extends'] ?? []; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'name', 'extends', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Interface'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php new file mode 100644 index 0000000..658468d --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php @@ -0,0 +1,30 @@ + $attributes Additional attributes + */ + public function __construct($name, array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Identifier($name) : $name; + } + + public function getSubNodeNames(): array { + return ['name']; + } + + public function getType(): string { + return 'Stmt_Label'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php new file mode 100644 index 0000000..f5b59ad --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Name $name = null, ?array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = $name; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['name', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Namespace'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php new file mode 100644 index 0000000..3acfa46 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php @@ -0,0 +1,16 @@ + $attributes Additional attributes + * @param null|Identifier|Name|ComplexType $type Type declaration + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + */ + public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = []) { + $this->attributes = $attributes; + $this->flags = $flags; + $this->props = $props; + $this->type = $type; + $this->attrGroups = $attrGroups; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'props']; + } + + /** + * Whether the property is explicitly or implicitly public. + */ + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; + } + + /** + * Whether the property is protected. + */ + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); + } + + /** + * Whether the property is private. + */ + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); + } + + /** + * Whether the property is static. + */ + public function isStatic(): bool { + return (bool) ($this->flags & Modifiers::STATIC); + } + + /** + * Whether the property is readonly. + */ + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); + } + + public function getType(): string { + return 'Stmt_Property'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php new file mode 100644 index 0000000..4a21a88 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Expr $expr = null, array $attributes = []) { + $this->attributes = $attributes; + $this->expr = $expr; + } + + public function getSubNodeNames(): array { + return ['expr']; + } + + public function getType(): string { + return 'Stmt_Return'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php new file mode 100644 index 0000000..88452e7 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(array $vars, array $attributes = []) { + $this->attributes = $attributes; + $this->vars = $vars; + } + + public function getSubNodeNames(): array { + return ['vars']; + } + + public function getType(): string { + return 'Stmt_Static'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php new file mode 100644 index 0000000..21e5efa --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $cases, array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->cases = $cases; + } + + public function getSubNodeNames(): array { + return ['cond', 'cases']; + } + + public function getType(): string { + return 'Stmt_Switch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php new file mode 100644 index 0000000..7705a57 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(array $traits, array $adaptations = [], array $attributes = []) { + $this->attributes = $attributes; + $this->traits = $traits; + $this->adaptations = $adaptations; + } + + public function getSubNodeNames(): array { + return ['traits', 'adaptations']; + } + + public function getType(): string { + return 'Stmt_TraitUse'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php new file mode 100644 index 0000000..987bc88 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php @@ -0,0 +1,12 @@ + $attributes Additional attributes + */ + public function __construct(?Node\Name $trait, $method, ?int $newModifier, $newName, array $attributes = []) { + $this->attributes = $attributes; + $this->trait = $trait; + $this->method = \is_string($method) ? new Node\Identifier($method) : $method; + $this->newModifier = $newModifier; + $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; + } + + public function getSubNodeNames(): array { + return ['trait', 'method', 'newModifier', 'newName']; + } + + public function getType(): string { + return 'Stmt_TraitUseAdaptation_Alias'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php new file mode 100644 index 0000000..7bc4083 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = []) { + $this->attributes = $attributes; + $this->trait = $trait; + $this->method = \is_string($method) ? new Node\Identifier($method) : $method; + $this->insteadof = $insteadof; + } + + public function getSubNodeNames(): array { + return ['trait', 'method', 'insteadof']; + } + + public function getType(): string { + return 'Stmt_TraitUseAdaptation_Precedence'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php new file mode 100644 index 0000000..5f2b330 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php @@ -0,0 +1,34 @@ + array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; + $this->stmts = $subNodes['stmts'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'name', 'stmts']; + } + + public function getType(): string { + return 'Stmt_Trait'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php new file mode 100644 index 0000000..6414c46 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) { + $this->attributes = $attributes; + $this->stmts = $stmts; + $this->catches = $catches; + $this->finally = $finally; + } + + public function getSubNodeNames(): array { + return ['stmts', 'catches', 'finally']; + } + + public function getType(): string { + return 'Stmt_TryCatch'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php new file mode 100644 index 0000000..c211beb --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $vars, array $attributes = []) { + $this->attributes = $attributes; + $this->vars = $vars; + } + + public function getSubNodeNames(): array { + return ['vars']; + } + + public function getType(): string { + return 'Stmt_Unset'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php new file mode 100644 index 0000000..85830ed --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php @@ -0,0 +1,3 @@ + $attributes Additional attributes + */ + public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = []) { + $this->attributes = $attributes; + $this->type = $type; + $this->uses = $uses; + } + + public function getSubNodeNames(): array { + return ['type', 'uses']; + } + + public function getType(): string { + return 'Stmt_Use'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php new file mode 100644 index 0000000..2f7aed2 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php @@ -0,0 +1,33 @@ + $attributes Additional attributes + */ + public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { + $this->attributes = $attributes; + $this->cond = $cond; + $this->stmts = $stmts; + } + + public function getSubNodeNames(): array { + return ['cond', 'stmts']; + } + + public function getType(): string { + return 'Stmt_While'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php new file mode 100644 index 0000000..bad88d2 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php @@ -0,0 +1,27 @@ + $attributes Additional attributes + */ + public function __construct(array $types, array $attributes = []) { + $this->attributes = $attributes; + $this->types = $types; + } + + public function getSubNodeNames(): array { + return ['types']; + } + + public function getType(): string { + return 'UnionType'; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php new file mode 100644 index 0000000..a7d9fc4 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php @@ -0,0 +1,55 @@ + $attributes Additional attributes + */ + public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) { + $this->attributes = $attributes; + $this->type = $type; + $this->name = $name; + $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; + } + + public function getSubNodeNames(): array { + return ['type', 'name', 'alias']; + } + + /** + * Get alias. If not explicitly given this is the last component of the used name. + */ + public function getAlias(): Identifier { + if (null !== $this->alias) { + return $this->alias; + } + + return new Identifier($this->name->getLast()); + } + + public function getType(): string { + return 'UseItem'; + } +} + +// @deprecated compatibility alias +class_alias(UseItem::class, Stmt\UseUse::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php b/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php new file mode 100644 index 0000000..9baa6fe --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php @@ -0,0 +1,16 @@ + $attributes Additional attributes + */ + public function __construct(array $attributes = []) { + $this->attributes = $attributes; + } + + public function getType(): string { + return 'VariadicPlaceholder'; + } + + public function getSubNodeNames(): array { + return []; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php new file mode 100644 index 0000000..7c3a360 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php @@ -0,0 +1,178 @@ + Attributes */ + protected array $attributes; + + /** + * Creates a Node. + * + * @param array $attributes Array of attributes + */ + public function __construct(array $attributes = []) { + $this->attributes = $attributes; + } + + /** + * Gets line the node started in (alias of getStartLine). + * + * @return int Start line (or -1 if not available) + */ + public function getLine(): int { + return $this->attributes['startLine'] ?? -1; + } + + /** + * Gets line the node started in. + * + * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). + * + * @return int Start line (or -1 if not available) + */ + public function getStartLine(): int { + return $this->attributes['startLine'] ?? -1; + } + + /** + * Gets the line the node ended in. + * + * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). + * + * @return int End line (or -1 if not available) + */ + public function getEndLine(): int { + return $this->attributes['endLine'] ?? -1; + } + + /** + * Gets the token offset of the first token that is part of this node. + * + * The offset is an index into the array returned by Lexer::getTokens(). + * + * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default). + * + * @return int Token start position (or -1 if not available) + */ + public function getStartTokenPos(): int { + return $this->attributes['startTokenPos'] ?? -1; + } + + /** + * Gets the token offset of the last token that is part of this node. + * + * The offset is an index into the array returned by Lexer::getTokens(). + * + * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default). + * + * @return int Token end position (or -1 if not available) + */ + public function getEndTokenPos(): int { + return $this->attributes['endTokenPos'] ?? -1; + } + + /** + * Gets the file offset of the first character that is part of this node. + * + * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default). + * + * @return int File start position (or -1 if not available) + */ + public function getStartFilePos(): int { + return $this->attributes['startFilePos'] ?? -1; + } + + /** + * Gets the file offset of the last character that is part of this node. + * + * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default). + * + * @return int File end position (or -1 if not available) + */ + public function getEndFilePos(): int { + return $this->attributes['endFilePos'] ?? -1; + } + + /** + * Gets all comments directly preceding this node. + * + * The comments are also available through the "comments" attribute. + * + * @return Comment[] + */ + public function getComments(): array { + return $this->attributes['comments'] ?? []; + } + + /** + * Gets the doc comment of the node. + * + * @return null|Comment\Doc Doc comment object or null + */ + public function getDocComment(): ?Comment\Doc { + $comments = $this->getComments(); + for ($i = count($comments) - 1; $i >= 0; $i--) { + $comment = $comments[$i]; + if ($comment instanceof Comment\Doc) { + return $comment; + } + } + + return null; + } + + /** + * Sets the doc comment of the node. + * + * This will either replace an existing doc comment or add it to the comments array. + * + * @param Comment\Doc $docComment Doc comment to set + */ + public function setDocComment(Comment\Doc $docComment): void { + $comments = $this->getComments(); + for ($i = count($comments) - 1; $i >= 0; $i--) { + if ($comments[$i] instanceof Comment\Doc) { + // Replace existing doc comment. + $comments[$i] = $docComment; + $this->setAttribute('comments', $comments); + return; + } + } + + // Append new doc comment. + $comments[] = $docComment; + $this->setAttribute('comments', $comments); + } + + public function setAttribute(string $key, $value): void { + $this->attributes[$key] = $value; + } + + public function hasAttribute(string $key): bool { + return array_key_exists($key, $this->attributes); + } + + public function getAttribute(string $key, $default = null) { + if (array_key_exists($key, $this->attributes)) { + return $this->attributes[$key]; + } + + return $default; + } + + public function getAttributes(): array { + return $this->attributes; + } + + public function setAttributes(array $attributes): void { + $this->attributes = $attributes; + } + + /** + * @return array + */ + public function jsonSerialize(): array { + return ['nodeType' => $this->getType()] + get_object_vars($this); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php new file mode 100644 index 0000000..a2535de --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php @@ -0,0 +1,290 @@ + true, + 'startLine' => true, + 'endLine' => true, + 'startFilePos' => true, + 'endFilePos' => true, + 'startTokenPos' => true, + 'endTokenPos' => true, + ]; + + /** + * Constructs a NodeDumper. + * + * Supported options: + * * bool dumpComments: Whether comments should be dumped. + * * bool dumpPositions: Whether line/offset information should be dumped. To dump offset + * information, the code needs to be passed to dump(). + * * bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped. + * + * @param array $options Options (see description) + */ + public function __construct(array $options = []) { + $this->dumpComments = !empty($options['dumpComments']); + $this->dumpPositions = !empty($options['dumpPositions']); + $this->dumpOtherAttributes = !empty($options['dumpOtherAttributes']); + } + + /** + * Dumps a node or array. + * + * @param array|Node $node Node or array to dump + * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if + * the dumpPositions option is enabled and the dumping of node offsets + * is desired. + * + * @return string Dumped value + */ + public function dump($node, ?string $code = null): string { + $this->code = $code; + $this->res = ''; + $this->nl = "\n"; + $this->dumpRecursive($node, false); + return $this->res; + } + + /** @param mixed $node */ + protected function dumpRecursive($node, bool $indent = true): void { + if ($indent) { + $this->nl .= " "; + } + if ($node instanceof Node) { + $this->res .= $node->getType(); + if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) { + $this->res .= $p; + } + $this->res .= '('; + + foreach ($node->getSubNodeNames() as $key) { + $this->res .= "$this->nl " . $key . ': '; + + $value = $node->$key; + if (\is_int($value)) { + if ('flags' === $key || 'newModifier' === $key) { + $this->res .= $this->dumpFlags($value); + continue; + } + if ('type' === $key && $node instanceof Include_) { + $this->res .= $this->dumpIncludeType($value); + continue; + } + if ('type' === $key + && ($node instanceof Use_ || $node instanceof UseItem || $node instanceof GroupUse)) { + $this->res .= $this->dumpUseType($value); + continue; + } + } + $this->dumpRecursive($value); + } + + if ($this->dumpComments && $comments = $node->getComments()) { + $this->res .= "$this->nl comments: "; + $this->dumpRecursive($comments); + } + + if ($this->dumpOtherAttributes) { + foreach ($node->getAttributes() as $key => $value) { + if (isset(self::IGNORE_ATTRIBUTES[$key])) { + continue; + } + + $this->res .= "$this->nl $key: "; + if (\is_int($value)) { + if ('kind' === $key) { + if ($node instanceof Int_) { + $this->res .= $this->dumpIntKind($value); + continue; + } + if ($node instanceof String_ || $node instanceof InterpolatedString) { + $this->res .= $this->dumpStringKind($value); + continue; + } + if ($node instanceof Array_) { + $this->res .= $this->dumpArrayKind($value); + continue; + } + if ($node instanceof List_) { + $this->res .= $this->dumpListKind($value); + continue; + } + } + } + $this->dumpRecursive($value); + } + } + $this->res .= "$this->nl)"; + } elseif (\is_array($node)) { + $this->res .= 'array('; + foreach ($node as $key => $value) { + $this->res .= "$this->nl " . $key . ': '; + $this->dumpRecursive($value); + } + $this->res .= "$this->nl)"; + } elseif ($node instanceof Comment) { + $this->res .= \str_replace("\n", $this->nl, $node->getReformattedText()); + } elseif (\is_string($node)) { + $this->res .= \str_replace("\n", $this->nl, (string)$node); + } elseif (\is_int($node) || \is_float($node)) { + $this->res .= $node; + } elseif (null === $node) { + $this->res .= 'null'; + } elseif (false === $node) { + $this->res .= 'false'; + } elseif (true === $node) { + $this->res .= 'true'; + } else { + throw new \InvalidArgumentException('Can only dump nodes and arrays.'); + } + if ($indent) { + $this->nl = \substr($this->nl, 0, -4); + } + } + + protected function dumpFlags(int $flags): string { + $strs = []; + if ($flags & Modifiers::PUBLIC) { + $strs[] = 'PUBLIC'; + } + if ($flags & Modifiers::PROTECTED) { + $strs[] = 'PROTECTED'; + } + if ($flags & Modifiers::PRIVATE) { + $strs[] = 'PRIVATE'; + } + if ($flags & Modifiers::ABSTRACT) { + $strs[] = 'ABSTRACT'; + } + if ($flags & Modifiers::STATIC) { + $strs[] = 'STATIC'; + } + if ($flags & Modifiers::FINAL) { + $strs[] = 'FINAL'; + } + if ($flags & Modifiers::READONLY) { + $strs[] = 'READONLY'; + } + + if ($strs) { + return implode(' | ', $strs) . ' (' . $flags . ')'; + } else { + return (string) $flags; + } + } + + /** @param array $map */ + private function dumpEnum(int $value, array $map): string { + if (!isset($map[$value])) { + return (string) $value; + } + return $map[$value] . ' (' . $value . ')'; + } + + private function dumpIncludeType(int $type): string { + return $this->dumpEnum($type, [ + Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', + Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', + Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', + Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE', + ]); + } + + private function dumpUseType(int $type): string { + return $this->dumpEnum($type, [ + Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', + Use_::TYPE_NORMAL => 'TYPE_NORMAL', + Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', + Use_::TYPE_CONSTANT => 'TYPE_CONSTANT', + ]); + } + + private function dumpIntKind(int $kind): string { + return $this->dumpEnum($kind, [ + Int_::KIND_BIN => 'KIND_BIN', + Int_::KIND_OCT => 'KIND_OCT', + Int_::KIND_DEC => 'KIND_DEC', + Int_::KIND_HEX => 'KIND_HEX', + ]); + } + + private function dumpStringKind(int $kind): string { + return $this->dumpEnum($kind, [ + String_::KIND_SINGLE_QUOTED => 'KIND_SINGLE_QUOTED', + String_::KIND_DOUBLE_QUOTED => 'KIND_DOUBLE_QUOTED', + String_::KIND_HEREDOC => 'KIND_HEREDOC', + String_::KIND_NOWDOC => 'KIND_NOWDOC', + ]); + } + + private function dumpArrayKind(int $kind): string { + return $this->dumpEnum($kind, [ + Array_::KIND_LONG => 'KIND_LONG', + Array_::KIND_SHORT => 'KIND_SHORT', + ]); + } + + private function dumpListKind(int $kind): string { + return $this->dumpEnum($kind, [ + List_::KIND_LIST => 'KIND_LIST', + List_::KIND_ARRAY => 'KIND_ARRAY', + ]); + } + + /** + * Dump node position, if possible. + * + * @param Node $node Node for which to dump position + * + * @return string|null Dump of position, or null if position information not available + */ + protected function dumpPosition(Node $node): ?string { + if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) { + return null; + } + + $start = $node->getStartLine(); + $end = $node->getEndLine(); + if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos') + && null !== $this->code + ) { + $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos()); + $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos()); + } + return "[$start - $end]"; + } + + // Copied from Error class + private function toColumn(string $code, int $pos): int { + if ($pos > strlen($code)) { + throw new \RuntimeException('Invalid position information'); + } + + $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); + if (false === $lineStartPos) { + $lineStartPos = -1; + } + + return $pos - $lineStartPos; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php b/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php new file mode 100644 index 0000000..96c8452 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php @@ -0,0 +1,90 @@ +traverse($nodes); + + return $visitor->getFoundNodes(); + } + + /** + * Find all nodes that are instances of a certain class. + + * @template TNode as Node + * + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param class-string $class Class name + * + * @return TNode[] Found nodes (all instances of $class) + */ + public function findInstanceOf($nodes, string $class): array { + return $this->find($nodes, function ($node) use ($class) { + return $node instanceof $class; + }); + } + + /** + * Find first node satisfying a filter callback. + * + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param callable $filter Filter callback: function(Node $node) : bool + * + * @return null|Node Found node (or null if none found) + */ + public function findFirst($nodes, callable $filter): ?Node { + if ($nodes === []) { + return null; + } + + if (!is_array($nodes)) { + $nodes = [$nodes]; + } + + $visitor = new FirstFindingVisitor($filter); + + $traverser = new NodeTraverser($visitor); + $traverser->traverse($nodes); + + return $visitor->getFoundNode(); + } + + /** + * Find first node that is an instance of a certain class. + * + * @template TNode as Node + * + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param class-string $class Class name + * + * @return null|TNode Found node, which is an instance of $class (or null if none found) + */ + public function findFirstInstanceOf($nodes, string $class): ?Node { + return $this->findFirst($nodes, function ($node) use ($class) { + return $node instanceof $class; + }); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php new file mode 100644 index 0000000..f5b868a --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php @@ -0,0 +1,278 @@ + Visitors */ + protected array $visitors = []; + + /** @var bool Whether traversal should be stopped */ + protected bool $stopTraversal; + + /** + * Create a traverser with the given visitors. + * + * @param NodeVisitor ...$visitors Node visitors + */ + public function __construct(NodeVisitor ...$visitors) { + $this->visitors = $visitors; + } + + /** + * Adds a visitor. + * + * @param NodeVisitor $visitor Visitor to add + */ + public function addVisitor(NodeVisitor $visitor): void { + $this->visitors[] = $visitor; + } + + /** + * Removes an added visitor. + */ + public function removeVisitor(NodeVisitor $visitor): void { + $index = array_search($visitor, $this->visitors); + if ($index !== false) { + array_splice($this->visitors, $index, 1, []); + } + } + + /** + * Traverses an array of nodes using the registered visitors. + * + * @param Node[] $nodes Array of nodes + * + * @return Node[] Traversed array of nodes + */ + public function traverse(array $nodes): array { + $this->stopTraversal = false; + + foreach ($this->visitors as $visitor) { + if (null !== $return = $visitor->beforeTraverse($nodes)) { + $nodes = $return; + } + } + + $nodes = $this->traverseArray($nodes); + + for ($i = \count($this->visitors) - 1; $i >= 0; --$i) { + $visitor = $this->visitors[$i]; + if (null !== $return = $visitor->afterTraverse($nodes)) { + $nodes = $return; + } + } + + return $nodes; + } + + /** + * Recursively traverse a node. + * + * @param Node $node Node to traverse. + */ + protected function traverseNode(Node $node): void { + foreach ($node->getSubNodeNames() as $name) { + $subNode = $node->$name; + + if (\is_array($subNode)) { + $node->$name = $this->traverseArray($subNode); + if ($this->stopTraversal) { + break; + } + } elseif ($subNode instanceof Node) { + $traverseChildren = true; + $visitorIndex = -1; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($subNode); + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $node->$name = $return; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { + $traverseChildren = false; + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + $traverseChildren = false; + break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + continue 2; + } else { + throw new \LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + } + + if ($traverseChildren) { + $this->traverseNode($subNode); + if ($this->stopTraversal) { + break; + } + } + + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; + $return = $visitor->leaveNode($subNode); + + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $node->$name = $return; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + break; + } elseif (\is_array($return)) { + throw new \LogicException( + 'leaveNode() may only return an array ' . + 'if the parent structure is an array' + ); + } else { + throw new \LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + } + } + } + } + + /** + * Recursively traverse array (usually of nodes). + * + * @param array $nodes Array to traverse + * + * @return array Result of traversal (may be original array or changed one) + */ + protected function traverseArray(array $nodes): array { + $doNodes = []; + + foreach ($nodes as $i => $node) { + if ($node instanceof Node) { + $traverseChildren = true; + $visitorIndex = -1; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($node); + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $nodes[$i] = $node = $return; + } elseif (\is_array($return)) { + $doNodes[] = [$i, $return]; + continue 2; + } elseif (NodeVisitor::REMOVE_NODE === $return) { + $doNodes[] = [$i, []]; + continue 2; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { + $traverseChildren = false; + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + $traverseChildren = false; + break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + throw new \LogicException( + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); + } else { + throw new \LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + } + + if ($traverseChildren) { + $this->traverseNode($node); + if ($this->stopTraversal) { + break; + } + } + + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; + $return = $visitor->leaveNode($node); + + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $nodes[$i] = $node = $return; + } elseif (\is_array($return)) { + $doNodes[] = [$i, $return]; + break; + } elseif (NodeVisitor::REMOVE_NODE === $return) { + $doNodes[] = [$i, []]; + break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + throw new \LogicException( + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); + } else { + throw new \LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + } + } elseif (\is_array($node)) { + throw new \LogicException('Invalid node structure: Contains nested arrays'); + } + } + + if (!empty($doNodes)) { + while (list($i, $replace) = array_pop($doNodes)) { + array_splice($nodes, $i, 1, $replace); + } + } + + return $nodes; + } + + private function ensureReplacementReasonable(Node $old, Node $new): void { + if ($old instanceof Node\Stmt && $new instanceof Node\Expr) { + throw new \LogicException( + "Trying to replace statement ({$old->getType()}) " . + "with expression ({$new->getType()}). Are you missing a " . + "Stmt_Expression wrapper?" + ); + } + + if ($old instanceof Node\Expr && $new instanceof Node\Stmt) { + throw new \LogicException( + "Trying to replace expression ({$old->getType()}) " . + "with statement ({$new->getType()})" + ); + } + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php new file mode 100644 index 0000000..c3992b3 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php @@ -0,0 +1,26 @@ + $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * NodeVisitor::REMOVE_NODE + * => $node is removed from the parent array + * * NodeVisitor::REPLACE_WITH_NULL + * => $node is replaced with null + * * NodeVisitor::DONT_TRAVERSE_CHILDREN + * => Children of $node are not traversed. $node stays as-is + * * NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN + * => Further visitors for the current node are skipped, and its children are not + * traversed. $node stays as-is. + * * NodeVisitor::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return null|int|Node|Node[] Replacement node (or special return value) + */ + public function enterNode(Node $node); + + /** + * Called when leaving a node. + * + * Return value semantics: + * * null + * => $node stays as-is + * * NodeVisitor::REMOVE_NODE + * => $node is removed from the parent array + * * NodeVisitor::REPLACE_WITH_NULL + * => $node is replaced with null + * * NodeVisitor::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return null|int|Node|Node[] Replacement node (or special return value) + */ + public function leaveNode(Node $node); + + /** + * Called once after traversal. + * + * Return value semantics: + * * null: $nodes stays as-is + * * otherwise: $nodes is set to the return value + * + * @param Node[] $nodes Array of nodes + * + * @return null|Node[] Array of nodes + */ + public function afterTraverse(array $nodes); +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php new file mode 100644 index 0000000..cba9249 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php @@ -0,0 +1,19 @@ +setAttribute('origNode', $origNode); + return $node; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php new file mode 100644 index 0000000..5e2aed3 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php @@ -0,0 +1,82 @@ + Token positions of comments */ + private array $commentPositions = []; + + /** + * Create a comment annotation visitor. + * + * @param Token[] $tokens Token array + */ + public function __construct(array $tokens) { + $this->tokens = $tokens; + + // Collect positions of comments. We use this to avoid traversing parts of the AST where + // there are no comments. + foreach ($tokens as $i => $token) { + if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { + $this->commentPositions[] = $i; + } + } + } + + public function enterNode(Node $node) { + $nextCommentPos = current($this->commentPositions); + if ($nextCommentPos === false) { + // No more comments. + return self::STOP_TRAVERSAL; + } + + $oldPos = $this->pos; + $this->pos = $pos = $node->getStartTokenPos(); + if ($nextCommentPos > $oldPos && $nextCommentPos < $pos) { + $comments = []; + while (--$pos >= $oldPos) { + $token = $this->tokens[$pos]; + if ($token->id === \T_DOC_COMMENT) { + $comments[] = new Comment\Doc( + $token->text, $token->line, $token->pos, $pos, + $token->getEndLine(), $token->getEndPos() - 1, $pos); + continue; + } + if ($token->id === \T_COMMENT) { + $comments[] = new Comment( + $token->text, $token->line, $token->pos, $pos, + $token->getEndLine(), $token->getEndPos() - 1, $pos); + continue; + } + if ($token->id !== \T_WHITESPACE) { + break; + } + } + if (!empty($comments)) { + $node->setAttribute('comments', array_reverse($comments)); + } + + do { + $nextCommentPos = next($this->commentPositions); + } while ($nextCommentPos !== false && $nextCommentPos < $this->pos); + } + + $endPos = $node->getEndTokenPos(); + if ($nextCommentPos > $endPos) { + // Skip children if there are no comments located inside this node. + $this->pos = $endPos; + return self::DONT_TRAVERSE_CHILDREN; + } + + return null; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php new file mode 100644 index 0000000..1f3f4ba --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php @@ -0,0 +1,47 @@ +filterCallback = $filterCallback; + } + + /** + * Get found nodes satisfying the filter callback. + * + * Nodes are returned in pre-order. + * + * @return Node[] Found nodes + */ + public function getFoundNodes(): array { + return $this->foundNodes; + } + + public function beforeTraverse(array $nodes): ?array { + $this->foundNodes = []; + + return null; + } + + public function enterNode(Node $node) { + $filterCallback = $this->filterCallback; + if ($filterCallback($node)) { + $this->foundNodes[] = $node; + } + + return null; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php new file mode 100644 index 0000000..05deed5 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php @@ -0,0 +1,49 @@ +filterCallback = $filterCallback; + } + + /** + * Get found node satisfying the filter callback. + * + * Returns null if no node satisfies the filter callback. + * + * @return null|Node Found node (or null if not found) + */ + public function getFoundNode(): ?Node { + return $this->foundNode; + } + + public function beforeTraverse(array $nodes): ?array { + $this->foundNode = null; + + return null; + } + + public function enterNode(Node $node) { + $filterCallback = $this->filterCallback; + if ($filterCallback($node)) { + $this->foundNode = $node; + return NodeVisitor::STOP_TRAVERSAL; + } + + return null; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php new file mode 100644 index 0000000..ccd014e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php @@ -0,0 +1,262 @@ +nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing()); + $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; + $this->replaceNodes = $options['replaceNodes'] ?? true; + } + + /** + * Get name resolution context. + */ + public function getNameContext(): NameContext { + return $this->nameContext; + } + + public function beforeTraverse(array $nodes): ?array { + $this->nameContext->startNamespace(); + return null; + } + + public function enterNode(Node $node) { + if ($node instanceof Stmt\Namespace_) { + $this->nameContext->startNamespace($node->name); + } elseif ($node instanceof Stmt\Use_) { + foreach ($node->uses as $use) { + $this->addAlias($use, $node->type, null); + } + } elseif ($node instanceof Stmt\GroupUse) { + foreach ($node->uses as $use) { + $this->addAlias($use, $node->type, $node->prefix); + } + } elseif ($node instanceof Stmt\Class_) { + if (null !== $node->extends) { + $node->extends = $this->resolveClassName($node->extends); + } + + foreach ($node->implements as &$interface) { + $interface = $this->resolveClassName($interface); + } + + $this->resolveAttrGroups($node); + if (null !== $node->name) { + $this->addNamespacedName($node); + } else { + $node->namespacedName = null; + } + } elseif ($node instanceof Stmt\Interface_) { + foreach ($node->extends as &$interface) { + $interface = $this->resolveClassName($interface); + } + + $this->resolveAttrGroups($node); + $this->addNamespacedName($node); + } elseif ($node instanceof Stmt\Enum_) { + foreach ($node->implements as &$interface) { + $interface = $this->resolveClassName($interface); + } + + $this->resolveAttrGroups($node); + $this->addNamespacedName($node); + } elseif ($node instanceof Stmt\Trait_) { + $this->resolveAttrGroups($node); + $this->addNamespacedName($node); + } elseif ($node instanceof Stmt\Function_) { + $this->resolveSignature($node); + $this->resolveAttrGroups($node); + $this->addNamespacedName($node); + } elseif ($node instanceof Stmt\ClassMethod + || $node instanceof Expr\Closure + || $node instanceof Expr\ArrowFunction + ) { + $this->resolveSignature($node); + $this->resolveAttrGroups($node); + } elseif ($node instanceof Stmt\Property) { + if (null !== $node->type) { + $node->type = $this->resolveType($node->type); + } + $this->resolveAttrGroups($node); + } elseif ($node instanceof Stmt\Const_) { + foreach ($node->consts as $const) { + $this->addNamespacedName($const); + } + } elseif ($node instanceof Stmt\ClassConst) { + if (null !== $node->type) { + $node->type = $this->resolveType($node->type); + } + $this->resolveAttrGroups($node); + } elseif ($node instanceof Stmt\EnumCase) { + $this->resolveAttrGroups($node); + } elseif ($node instanceof Expr\StaticCall + || $node instanceof Expr\StaticPropertyFetch + || $node instanceof Expr\ClassConstFetch + || $node instanceof Expr\New_ + || $node instanceof Expr\Instanceof_ + ) { + if ($node->class instanceof Name) { + $node->class = $this->resolveClassName($node->class); + } + } elseif ($node instanceof Stmt\Catch_) { + foreach ($node->types as &$type) { + $type = $this->resolveClassName($type); + } + } elseif ($node instanceof Expr\FuncCall) { + if ($node->name instanceof Name) { + $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION); + } + } elseif ($node instanceof Expr\ConstFetch) { + $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT); + } elseif ($node instanceof Stmt\TraitUse) { + foreach ($node->traits as &$trait) { + $trait = $this->resolveClassName($trait); + } + + foreach ($node->adaptations as $adaptation) { + if (null !== $adaptation->trait) { + $adaptation->trait = $this->resolveClassName($adaptation->trait); + } + + if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) { + foreach ($adaptation->insteadof as &$insteadof) { + $insteadof = $this->resolveClassName($insteadof); + } + } + } + } + + return null; + } + + /** @param Stmt\Use_::TYPE_* $type */ + private function addAlias(Node\UseItem $use, int $type, ?Name $prefix = null): void { + // Add prefix for group uses + $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; + // Type is determined either by individual element or whole use declaration + $type |= $use->type; + + $this->nameContext->addAlias( + $name, (string) $use->getAlias(), $type, $use->getAttributes() + ); + } + + /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure|Expr\ArrowFunction $node */ + private function resolveSignature($node): void { + foreach ($node->params as $param) { + $param->type = $this->resolveType($param->type); + $this->resolveAttrGroups($param); + } + $node->returnType = $this->resolveType($node->returnType); + } + + /** + * @template T of Node\Identifier|Name|Node\ComplexType|null + * @param T $node + * @return T + */ + private function resolveType(?Node $node): ?Node { + if ($node instanceof Name) { + return $this->resolveClassName($node); + } + if ($node instanceof Node\NullableType) { + $node->type = $this->resolveType($node->type); + return $node; + } + if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { + foreach ($node->types as &$type) { + $type = $this->resolveType($type); + } + return $node; + } + return $node; + } + + /** + * Resolve name, according to name resolver options. + * + * @param Name $name Function or constant name to resolve + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* + * + * @return Name Resolved name, or original name with attribute + */ + protected function resolveName(Name $name, int $type): Name { + if (!$this->replaceNodes) { + $resolvedName = $this->nameContext->getResolvedName($name, $type); + if (null !== $resolvedName) { + $name->setAttribute('resolvedName', $resolvedName); + } else { + $name->setAttribute('namespacedName', FullyQualified::concat( + $this->nameContext->getNamespace(), $name, $name->getAttributes())); + } + return $name; + } + + if ($this->preserveOriginalNames) { + // Save the original name + $originalName = $name; + $name = clone $originalName; + $name->setAttribute('originalName', $originalName); + } + + $resolvedName = $this->nameContext->getResolvedName($name, $type); + if (null !== $resolvedName) { + return $resolvedName; + } + + // unqualified names inside a namespace cannot be resolved at compile-time + // add the namespaced version of the name as an attribute + $name->setAttribute('namespacedName', FullyQualified::concat( + $this->nameContext->getNamespace(), $name, $name->getAttributes())); + return $name; + } + + protected function resolveClassName(Name $name): Name { + return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL); + } + + protected function addNamespacedName(Node $node): void { + $node->namespacedName = Name::concat( + $this->nameContext->getNamespace(), (string) $node->name); + } + + protected function resolveAttrGroups(Node $node): void { + foreach ($node->attrGroups as $attrGroup) { + foreach ($attrGroup->attrs as $attr) { + $attr->name = $this->resolveClassName($attr->name); + } + } + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php new file mode 100644 index 0000000..38fedfd --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php @@ -0,0 +1,51 @@ +$node->getAttribute('parent')
, the previous + * node can be accessed through $node->getAttribute('previous'), + * and the next node can be accessed through $node->getAttribute('next'). + */ +final class NodeConnectingVisitor extends NodeVisitorAbstract { + /** + * @var Node[] + */ + private array $stack = []; + + /** + * @var ?Node + */ + private $previous; + + public function beforeTraverse(array $nodes) { + $this->stack = []; + $this->previous = null; + } + + public function enterNode(Node $node) { + if (!empty($this->stack)) { + $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); + } + + if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) { + $node->setAttribute('previous', $this->previous); + $this->previous->setAttribute('next', $node); + } + + $this->stack[] = $node; + } + + public function leaveNode(Node $node) { + $this->previous = $node; + + array_pop($this->stack); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php new file mode 100644 index 0000000..1e7e9e8 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php @@ -0,0 +1,38 @@ +$node->getAttribute('parent'). + */ +final class ParentConnectingVisitor extends NodeVisitorAbstract { + /** + * @var Node[] + */ + private array $stack = []; + + public function beforeTraverse(array $nodes) { + $this->stack = []; + } + + public function enterNode(Node $node) { + if (!empty($this->stack)) { + $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); + } + + $this->stack[] = $node; + } + + public function leaveNode(Node $node) { + array_pop($this->stack); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php new file mode 100644 index 0000000..6fb15cc --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php @@ -0,0 +1,24 @@ +'", + "T_IS_GREATER_OR_EQUAL", + "T_SL", + "T_SR", + "'+'", + "'-'", + "'.'", + "'*'", + "'/'", + "'%'", + "'!'", + "T_INSTANCEOF", + "'~'", + "T_INC", + "T_DEC", + "T_INT_CAST", + "T_DOUBLE_CAST", + "T_STRING_CAST", + "T_ARRAY_CAST", + "T_OBJECT_CAST", + "T_BOOL_CAST", + "T_UNSET_CAST", + "'@'", + "T_POW", + "'['", + "T_NEW", + "T_CLONE", + "T_EXIT", + "T_IF", + "T_ELSEIF", + "T_ELSE", + "T_ENDIF", + "T_LNUMBER", + "T_DNUMBER", + "T_STRING", + "T_STRING_VARNAME", + "T_VARIABLE", + "T_NUM_STRING", + "T_INLINE_HTML", + "T_ENCAPSED_AND_WHITESPACE", + "T_CONSTANT_ENCAPSED_STRING", + "T_ECHO", + "T_DO", + "T_WHILE", + "T_ENDWHILE", + "T_FOR", + "T_ENDFOR", + "T_FOREACH", + "T_ENDFOREACH", + "T_DECLARE", + "T_ENDDECLARE", + "T_AS", + "T_SWITCH", + "T_MATCH", + "T_ENDSWITCH", + "T_CASE", + "T_DEFAULT", + "T_BREAK", + "T_CONTINUE", + "T_GOTO", + "T_FUNCTION", + "T_FN", + "T_CONST", + "T_RETURN", + "T_TRY", + "T_CATCH", + "T_FINALLY", + "T_USE", + "T_INSTEADOF", + "T_GLOBAL", + "T_STATIC", + "T_ABSTRACT", + "T_FINAL", + "T_PRIVATE", + "T_PROTECTED", + "T_PUBLIC", + "T_READONLY", + "T_VAR", + "T_UNSET", + "T_ISSET", + "T_EMPTY", + "T_HALT_COMPILER", + "T_CLASS", + "T_TRAIT", + "T_INTERFACE", + "T_ENUM", + "T_EXTENDS", + "T_IMPLEMENTS", + "T_OBJECT_OPERATOR", + "T_NULLSAFE_OBJECT_OPERATOR", + "T_LIST", + "T_ARRAY", + "T_CALLABLE", + "T_CLASS_C", + "T_TRAIT_C", + "T_METHOD_C", + "T_FUNC_C", + "T_LINE", + "T_FILE", + "T_START_HEREDOC", + "T_END_HEREDOC", + "T_DOLLAR_OPEN_CURLY_BRACES", + "T_CURLY_OPEN", + "T_PAAMAYIM_NEKUDOTAYIM", + "T_NAMESPACE", + "T_NS_C", + "T_DIR", + "T_NS_SEPARATOR", + "T_ELLIPSIS", + "T_NAME_FULLY_QUALIFIED", + "T_NAME_QUALIFIED", + "T_NAME_RELATIVE", + "T_ATTRIBUTE", + "';'", + "']'", + "'('", + "')'", + "'{'", + "'}'", + "'`'", + "'\"'", + "'$'" + ); + + protected array $tokenToSymbol = array( + 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, + 161, 162, 53, 50, 8, 51, 52, 54, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, + 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 163, 35, 164, 58, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, + 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158 + ); + + protected array $action = array( + 133, 134, 135, 582, 136, 137, 0, 751, 752, 753, + 138, 38,-32766,-32766,-32766, 151,-32766,-32766,-32766,-32767, + -32767,-32767,-32767, 102, 103, 104, 105, 106, 1112, 1113, + 1114, 1111, 1110, 1109, 1115, 745, 744,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, + -32767, 1245, 837,-32766, 1322, 754,-32766,-32766,-32766,-32766, + -594,-32766,-32766,-32766, 104, 105, 106, -594, 1306, 265, + 139, 404, 758, 759, 760, 761, 990,-32766, 429,-32766, + -32766, -16,-32766, 242, 1027, 815, 762, 763, 764, 765, + 766, 767, 768, 769, 770, 771, 791, 583, 792, 793, + 794, 795, 783, 784, 345, 346, 786, 787, 772, 773, + 774, 776, 777, 778, 356, 818, 819, 820, 821, 822, + 584, 779, 780, 585, 586,-32766, 803, 801, 802, 814, + 798, 799, 835, 826, 587, 588, 797, 589, 590, 591, + 592, 593, 594, 826, 459, 460, 461, 1036, 800, 595, + 596, 941, 140, 2, 133, 134, 135, 582, 136, 137, + 1060, 751, 752, 753, 138, 38, -328, -110, -110, 1326, + 290, 23, -110,-32766,-32766,-32766, 1325, 35, -110, 1112, + 1113, 1114, 1111, 1110, 1109, 1115, 612,-32766, 129, 745, + 744, 107, 108, 109,-32766, 274,-32766,-32766,-32766,-32766, + -32766,-32766,-32766, 828, 991, -194, 145, 110, 298, 754, + 836, 75,-32766,-32766,-32766, 1351, 142, 326, 1352, -594, + 326, -594, 254, 265, 139, 404, 758, 759, 760, 761, + 82, -272, 429,-32766, 326,-32766,-32766,-32766,-32766, 815, + 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, + 791, 583, 792, 793, 794, 795, 783, 784, 345, 346, + 786, 787, 772, 773, 774, 776, 777, 778, 356, 818, + 819, 820, 821, 822, 584, 779, 780, 585, 586, 830, + 803, 801, 802, 814, 798, 799, 712, 309, 587, 588, + 797, 589, 590, 591, 592, 593, 594, -78, 83, 84, + 85, -85, 800, 595, 596, 311, 149, 775, 746, 747, + 748, 749, 750, 725, 751, 752, 753, 788, 789, 37, + -328, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 323, 274, 482,-32766,-32766, + -32766, -58,-32766,-32766,-32766, 959, 960, 127, 110, -194, + 961, 339, 754,-32766,-32766,-32766, 955, -85, 291,-32766, + 1088,-32766,-32766,-32766,-32766,-32766, 755, 756, 757, 758, + 759, 760, 761, -193,-32766, 824,-32766,-32766,-32766, -367, + 429, -367, 815, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 791, 813, 792, 793, 794, 795, 783, + 784, 785, 812, 786, 787, 772, 773, 774, 776, 777, + 778, 817, 818, 819, 820, 821, 822, 823, 779, 780, + 781, 782, -548, 803, 801, 802, 814, 798, 799, 340, + 327, 790, 796, 797, 804, 805, 807, 806, 808, 809, + 1033, 391, 606, 7,-32766, 800, 811, 810, 50, 51, + 52, 513, 53, 54, 831, 1240, 1239, 1241, 55, 56, + -110, 57, 1036, 920, 1090, -110, 1036, -110, 291, 483, + 745, 744, 305, 382, 381, -110, -110, -110, -110, -110, + -110, -110, -110, 423, 920, 283, -548, -548, 152, 290, + 380, 381, 1245, 715, 467, 468, 58, 59, 370, 21, + 423, -545, 60, 556, 61, 248, 249, 62, 63, 64, + 65, 66, 67, 68, 69, -548, 28, 267, 70, 445, + 514, 1104, 374, -342, 1272, 1273, 515, -193, 835, 154, + 832, -544, 1270, 42, 25, 516, 389, 517, 241, 518, + 920, 519, 298, 1238, 520, 521, 910, 920, 441, 44, + 45, 446, 377, 376,-32766, 46, 522, 1023, 1022, 1021, + 1024, 368, 338, 442, 1278, -545, -545, 910, 1231, 443, + 524, 525, 526, 835, 1245, 835, 1036, 716, 1341, 1236, + -545, 155, 528, 529,-32766, 1259, 1260, 1261, 1262, 1256, + 1257, 297, -551, 943, -545, -544, -544, 1263, 1258, 290, + 1035, 1240, 1239, 1241, 298, 444, 1036, 71, 1266, 841, + -544, 321, 322, 326, -153, -153, -153, 920, 1240, 1239, + 1241, 922, -550, 910, -544, 710, 943, -591,-32766, -153, + 910, -153, 357, -153, -591, -153, 862, 1033, 863, 1089, + 36, 251, 922, 737, 156, 375, 710, 717, 862, -585, + 863, -585, 75, 158, -546, 835, 959, 960, 326, 1036, + -57, 523, 920,-32766,-32766, 362, 896, 955, -110, -110, + -110, 32, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 745, 744, 656, 26, 835, + -110, -110, 720, 745, 744, -110, 33, 834, 922, 124, + 910, -110, 710, -153, 125, 922, 675, 676, 130, 710, + -32766, 150, 407, 131, 1150, 1152, 48, 144, -546, -546, + 378, 379,-32766, 383, 384, -543, 28, 159, 1238, 920, + 160, 298, 1059, -546, 75,-32766,-32766,-32766, 835,-32766, + 326,-32766, 1270,-32766, -87, 910,-32766, -546, 647, 648, + 161,-32766,-32766,-32766, -4, 920, -84,-32766,-32766, 727, + 162, 287, 163,-32766, 420, -302, -78, -73, -72, -71, + 141, 287,-32766, -70, 326, 976, 745, 744, 1231, 710, + 299, 300, -69, -68, -67, -298, -591, -66, -591, -543, + -543, -65, 528, 529, -46, 1259, 1260, 1261, 1262, 1256, + 1257, -18, 74, 148, -543, 273, 284, 1263, 1258, 126, + -543, 726, 910,-32766, 729, 919, 147, 73, -543, 1238, + 922, 690, 322, 326, 710, 279,-32766,-32766,-32766, 280, + -32766, 285,-32766, 286,-32766, 332, 288,-32766, 910, 289, + 292, 49,-32766,-32766,-32766, 293, 274, 1033,-32766,-32766, + 937, 110, -50, 685,-32766, 420, 146, 691, 826, 701, + 375, 703, 436,-32766, 1353, 20, 561, 296, 645, 1036, + 835, 959, 960, 1119, -543, -543, 523,-32766, 692, 693, + 306, 527, 955, -110, -110, -110, 132, 922, 834, -543, + 464, 710, 283, 662, 657,-32766, 1240, 1239, 1241, 678, + 304, 1238, 283, -543, 10, 301, 302, 493,-32766,-32766, + -32766, 663,-32766, 922,-32766, 679,-32766, 710, -4,-32766, + 373, 40, -508, 956,-32766,-32766,-32766, -275, 731,-32766, + -32766,-32766, 920, 303, 128, 1238,-32766, 420, 310, 0, + 567, 0,-32766,-32766,-32766,-32766,-32766, 0,-32766, 0, + -32766,-32766, 0,-32766, 0, 1277, -498, 0,-32766,-32766, + -32766,-32766, 1279, 0,-32766,-32766, 8, 1238, 24, 372, + -32766, 420, 920, 1267,-32766,-32766,-32766, 610,-32766,-32766, + -32766, 939,-32766, 298, -579,-32766, 846, 41, 734, 488, + -32766,-32766,-32766,-32766, 735, 854,-32766,-32766, 901, 1238, + 574, 1000,-32766, 420, 977, 984,-32766,-32766,-32766, 974, + -32766,-32766,-32766, 985,-32766, 910, 899,-32766, 972, 1093, + 1096, 1097,-32766,-32766,-32766, 1094, 1095, 1101,-32766,-32766, + 1292, -250, -250, -250,-32766, 420, 1310, 375, 1344, 650, + 28, 267, -578,-32766, -577, -551, -550, -549, 959, 960, + -492, 1, 835, 523, 29, 910, 1270, 30, 896, 955, + -110, -110, -110, 39, 43, 47, 72, 76, 77, 78, + 79, -249, -249, -249, 80, 81, 143, 375, 153, 157, + 897, 247, 328, 357, 358, 359, 360, 361, 959, 960, + 922, 362, 1231, 523, 710, -250, 363, 364, 896, 955, + -110, -110, -110, 365, 366, 367, 369, 529, 28, 1259, + 1260, 1261, 1262, 1256, 1257, 437, 555, 1348, -273, -272, + 835, 1263, 1258, 13, 1270, 14,-32766, 15, 16, 18, + 922, 73, 1238, 1350, 710, -249, 322, 326, 406,-32766, + -32766,-32766, 484,-32766, 485,-32766, 492,-32766, 495, 496, + -32766, 497, 498, 502, 503,-32766,-32766,-32766, 504, 511, + 1231,-32766,-32766, 572, 696, 1249, 1190,-32766, 420, 1268, + 1062, 1061, 1042, 1226, 1038, 529,-32766, 1259, 1260, 1261, + 1262, 1256, 1257, -277, -102, 12, 17, 27, 295, 1263, + 1258, 405, 603, 607, 636, 702, 1194, 1244, 1191, 73, + 34, 1323, 0, 320, 322, 326, 371, 711, 714, 718, + 719, 721, 722, 723, 724, 0, 728, 713, 0, 857, + 856, 865, 949, 992, 864, 1349, 948, 946, 947, 950, + 1222, 930, 940, 928, 982, 983, 634, 1347, 1304, 1293, + 1311, 1320, 0, 1207, 0, 1271, 0, 326 + ); + + protected array $actionCheck = array( + 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, + 12, 13, 9, 10, 11, 14, 9, 10, 11, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, + 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 1, 1, 9, 1, 57, 9, 10, 11, 137, + 1, 9, 10, 11, 50, 51, 52, 8, 1, 71, + 72, 73, 74, 75, 76, 77, 31, 30, 80, 32, + 33, 31, 30, 14, 1, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 116, 128, 129, 130, 131, + 132, 133, 82, 80, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 80, 129, 130, 131, 138, 150, 151, + 152, 1, 154, 8, 2, 3, 4, 5, 6, 7, + 162, 9, 10, 11, 12, 13, 8, 117, 118, 1, + 161, 8, 122, 9, 10, 11, 8, 8, 128, 116, + 117, 118, 119, 120, 121, 122, 51, 137, 8, 37, + 38, 53, 54, 55, 30, 57, 32, 33, 34, 35, + 36, 37, 38, 80, 159, 8, 8, 69, 158, 57, + 159, 161, 9, 10, 11, 80, 163, 167, 83, 160, + 167, 162, 8, 71, 72, 73, 74, 75, 76, 77, + 163, 162, 80, 30, 167, 32, 33, 34, 35, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 156, + 128, 129, 130, 131, 132, 133, 163, 8, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 16, 9, 10, + 11, 31, 150, 151, 152, 8, 154, 2, 3, 4, + 5, 6, 7, 163, 9, 10, 11, 12, 13, 30, + 162, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 8, 57, 31, 9, 10, + 11, 16, 9, 10, 11, 117, 118, 14, 69, 162, + 122, 8, 57, 9, 10, 11, 128, 97, 30, 30, + 1, 32, 33, 34, 35, 36, 71, 72, 73, 74, + 75, 76, 77, 8, 30, 80, 32, 33, 34, 106, + 80, 108, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 70, 128, 129, 130, 131, 132, 133, 8, + 70, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 116, 106, 1, 108, 116, 150, 151, 152, 2, 3, + 4, 5, 6, 7, 80, 155, 156, 157, 12, 13, + 101, 15, 138, 1, 164, 106, 138, 108, 30, 163, + 37, 38, 113, 106, 107, 116, 117, 118, 119, 120, + 121, 122, 123, 116, 1, 161, 134, 135, 14, 161, + 106, 107, 1, 31, 134, 135, 50, 51, 8, 101, + 116, 70, 56, 85, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 163, 70, 71, 72, 73, + 74, 123, 8, 164, 78, 79, 80, 162, 82, 14, + 156, 70, 86, 87, 88, 89, 8, 91, 97, 93, + 1, 95, 158, 80, 98, 99, 84, 1, 8, 103, + 104, 105, 106, 107, 116, 109, 110, 119, 120, 121, + 122, 115, 116, 8, 146, 134, 135, 84, 122, 8, + 124, 125, 126, 82, 1, 82, 138, 31, 85, 116, + 149, 14, 136, 137, 116, 139, 140, 141, 142, 143, + 144, 145, 161, 122, 163, 134, 135, 151, 152, 161, + 137, 155, 156, 157, 158, 8, 138, 161, 1, 8, + 149, 165, 166, 167, 75, 76, 77, 1, 155, 156, + 157, 159, 161, 84, 163, 163, 122, 1, 137, 90, + 84, 92, 161, 94, 8, 96, 106, 116, 108, 159, + 147, 148, 159, 163, 14, 106, 163, 31, 106, 160, + 108, 162, 161, 14, 70, 82, 117, 118, 167, 138, + 16, 122, 1, 9, 10, 161, 127, 128, 129, 130, + 131, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 37, 38, 75, 76, 82, + 117, 118, 31, 37, 38, 122, 14, 155, 159, 16, + 84, 128, 163, 164, 16, 159, 75, 76, 16, 163, + 137, 101, 102, 16, 59, 60, 70, 16, 134, 135, + 106, 107, 74, 106, 107, 70, 70, 16, 80, 1, + 16, 158, 1, 149, 161, 87, 88, 89, 82, 91, + 167, 93, 86, 95, 31, 84, 98, 163, 111, 112, + 16, 103, 104, 105, 0, 1, 31, 109, 110, 31, + 16, 30, 16, 115, 116, 35, 31, 31, 31, 31, + 163, 30, 124, 31, 167, 159, 37, 38, 122, 163, + 134, 135, 31, 31, 31, 35, 160, 31, 162, 134, + 135, 31, 136, 137, 31, 139, 140, 141, 142, 143, + 144, 31, 154, 31, 149, 31, 31, 151, 152, 163, + 70, 31, 84, 74, 31, 31, 31, 161, 163, 80, + 159, 80, 166, 167, 163, 35, 87, 88, 89, 35, + 91, 35, 93, 35, 95, 35, 37, 98, 84, 37, + 37, 70, 103, 104, 105, 37, 57, 116, 109, 110, + 38, 69, 31, 77, 115, 116, 70, 116, 80, 80, + 106, 92, 108, 124, 83, 97, 89, 113, 113, 138, + 82, 117, 118, 82, 134, 135, 122, 85, 137, 138, + 114, 127, 128, 129, 130, 131, 31, 159, 155, 149, + 97, 163, 161, 96, 90, 74, 155, 156, 157, 94, + 133, 80, 161, 163, 150, 134, 135, 97, 87, 88, + 89, 100, 91, 159, 93, 100, 95, 163, 164, 98, + 149, 159, 149, 128, 103, 104, 105, 162, 164, 74, + 109, 110, 1, 132, 163, 80, 115, 116, 132, -1, + 153, -1, 87, 88, 89, 124, 91, -1, 93, -1, + 95, 137, -1, 98, -1, 146, 149, -1, 103, 104, + 105, 74, 146, -1, 109, 110, 149, 80, 149, 149, + 115, 116, 1, 160, 87, 88, 89, 153, 91, 124, + 93, 154, 95, 158, 161, 98, 160, 159, 159, 102, + 103, 104, 105, 74, 159, 159, 109, 110, 159, 80, + 81, 159, 115, 116, 159, 159, 87, 88, 89, 159, + 91, 124, 93, 159, 95, 84, 159, 98, 159, 159, + 159, 159, 103, 104, 105, 159, 159, 159, 109, 110, + 160, 100, 101, 102, 115, 116, 160, 106, 160, 160, + 70, 71, 161, 124, 161, 161, 161, 161, 117, 118, + 161, 161, 82, 122, 161, 84, 86, 161, 127, 128, + 129, 130, 131, 161, 161, 161, 161, 161, 161, 161, + 161, 100, 101, 102, 161, 161, 161, 106, 161, 161, + 164, 161, 161, 161, 161, 161, 161, 161, 117, 118, + 159, 161, 122, 122, 163, 164, 161, 161, 127, 128, + 129, 130, 131, 161, 161, 161, 161, 137, 70, 139, + 140, 141, 142, 143, 144, 161, 161, 164, 162, 162, + 82, 151, 152, 162, 86, 162, 74, 162, 162, 162, + 159, 161, 80, 164, 163, 164, 166, 167, 162, 87, + 88, 89, 162, 91, 162, 93, 162, 95, 162, 162, + 98, 162, 162, 162, 162, 103, 104, 105, 162, 162, + 122, 109, 110, 162, 162, 162, 162, 115, 116, 162, + 162, 162, 162, 162, 162, 137, 124, 139, 140, 141, + 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, + 152, 162, 162, 162, 162, 162, 162, 162, 162, 161, + 163, 162, -1, 163, 166, 167, 163, 163, 163, 163, + 163, 163, 163, 163, 163, -1, 163, 163, -1, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, -1, 165, -1, 166, -1, 167 + ); + + protected array $actionBase = array( + 0, -2, 152, 549, 764, 941, 981, 751, 617, 310, + 123, 877, 556, 671, 671, 738, 671, 472, 626, 789, + 63, 305, 305, 789, 305, 493, 493, 493, 658, 658, + 658, 658, 749, 749, 897, 897, 929, 865, 831, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 51, 45, 451, 692, 1036, 1044, + 1040, 1045, 1034, 1033, 1039, 1041, 1046, 1083, 1084, 795, + 1085, 1086, 1082, 1087, 1042, 889, 1035, 1043, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 44, 343, 664, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 52, 52, + 52, 666, 666, 47, 354, 980, 203, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 665, 339, 164, 164, + 7, 7, 7, 7, 7, 50, 369, 583, -25, -25, + -25, -25, 448, 741, 501, 408, 283, 338, 394, 334, + 334, 14, 14, 531, 531, 9, 9, 531, 531, 531, + 478, 478, 478, 478, 441, 471, 552, 428, 824, 53, + 53, 53, 53, 824, 824, 824, 824, 826, 1089, 824, + 824, 824, 594, 750, 750, 781, 138, 138, 138, 750, + 540, 503, 503, 540, 238, 503, 67, 135, -78, 805, + 377, 499, -78, 362, 656, 636, 59, 743, 624, 743, + 1032, 481, 802, 802, 514, 773, 746, 878, 1064, 1049, + 821, 1080, 825, 1081, 15, 370, 745, 1031, 1031, 1031, + 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1090, 443, + 1032, 384, 1090, 1090, 1090, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 647, 384, 622, 641, 384, + 810, 443, 51, 817, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 780, 316, 51, 45, 150, 150, + 490, 83, 150, 150, 150, 150, 51, 51, 51, 51, + 624, 799, 797, 627, 834, 375, 799, 799, 799, 270, + 158, 69, 197, 740, 760, 345, 788, 788, 801, 900, + 900, 788, 798, 788, 801, 914, 788, 788, 900, 900, + 835, 180, 550, 353, 524, 565, 900, 279, 788, 788, + 788, 788, 816, 571, 788, 214, 198, 788, 788, 816, + 811, 785, 145, 777, 900, 900, 900, 816, 500, 777, + 777, 777, 839, 845, 765, 784, 337, 297, 611, 169, + 822, 784, 784, 788, 538, 765, 784, 765, 784, 837, + 784, 784, 784, 765, 784, 798, 431, 784, 721, 607, + 163, 784, 6, 915, 916, 723, 917, 912, 918, 964, + 919, 923, 1054, 899, 930, 913, 924, 965, 906, 903, + 794, 693, 698, 827, 783, 896, 792, 792, 792, 894, + 792, 792, 792, 792, 792, 792, 792, 792, 693, 823, + 830, 787, 933, 702, 707, 1011, 819, 926, 1088, 932, + 1013, 925, 772, 711, 977, 934, 774, 1050, 935, 936, + 986, 1014, 846, 1017, 963, 796, 979, 1065, 836, 945, + 1055, 792, 915, 923, 735, 913, 924, 906, 903, 770, + 766, 762, 763, 761, 752, 747, 748, 782, 1018, 893, + 833, 880, 940, 895, 693, 886, 971, 1047, 990, 992, + 1053, 803, 791, 888, 1066, 946, 952, 953, 1056, 1019, + 1057, 838, 973, 775, 994, 820, 1067, 996, 997, 999, + 1000, 1058, 1068, 1059, 891, 1060, 849, 814, 966, 807, + 1069, 1, 806, 808, 818, 955, 484, 931, 1061, 1070, + 1071, 1001, 1002, 1006, 1072, 1073, 927, 852, 975, 815, + 976, 967, 855, 856, 525, 813, 1020, 800, 804, 812, + 577, 640, 1074, 1075, 1076, 928, 790, 786, 860, 864, + 1021, 809, 1022, 1077, 649, 867, 724, 1078, 1012, 744, + 754, 281, 654, 335, 756, 779, 1063, 829, 776, 778, + 954, 754, 793, 869, 1079, 870, 871, 872, 1007, 876, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 456, 456, 456, 456, 456, 456, 305, 305, 305, 305, + 305, 456, 456, 456, 456, 456, 456, 456, 305, 305, + 0, 0, 305, 0, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 473, 473, 289, 289, 473, 289, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 0, 289, 289, 289, 289, + 289, 289, 289, 289, 473, 835, 473, 138, 138, 138, + 138, 473, 473, 473, -88, -88, 473, 238, 473, 473, + 138, 138, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 0, 0, 384, 503, 473, 798, 798, + 798, 798, 473, 473, 473, 473, 503, 503, 473, 473, + 473, 0, 0, 0, 0, 0, 0, 0, 0, 384, + 0, 0, 384, 0, 0, 798, 798, 473, 238, 835, + 168, 473, 0, 0, 0, 0, 384, 798, 384, 443, + 788, 503, 503, 788, 443, 443, 150, 51, 168, 620, + 620, 620, 620, 0, 0, 624, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 798, 0, 835, + 0, 798, 798, 798, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 798, + 0, 0, 900, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, + 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 792, 803, 0, 803, 0, 792, 792, 792, 0, 0, + 0, 0, 813, 809 + ); + + protected array $actionDefault = array( + 3,32767, 102,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 100,32767,32767,32767,32767, 597, 597, + 597, 597,32767,32767, 254, 102,32767,32767, 470, 387, + 387, 387,32767,32767, 541, 541, 541, 541, 541, 541, + 32767,32767,32767,32767,32767,32767, 470,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 100, + 32767,32767,32767, 36, 7, 8, 10, 11, 49, 17, + 324,32767,32767,32767,32767, 102,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 590,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 474, 453, + 454, 456, 457, 386, 542, 596, 327, 593, 385, 145, + 339, 329, 242, 330, 258, 475, 259, 476, 479, 480, + 215, 287, 382, 149, 150, 417, 471, 419, 469, 473, + 418, 392, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 390, 391, 472, 450, 449, + 448,32767,32767, 415, 416,32767, 420,32767,32767,32767, + 32767,32767,32767,32767, 102,32767, 389, 423, 421, 422, + 439, 440, 437, 438, 441,32767,32767,32767, 442, 443, + 444, 445, 316,32767,32767, 366, 364, 316, 111,32767, + 32767, 430, 431,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 535, 447,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 102, + 32767, 100, 537, 412, 414, 504, 425, 426, 424, 393, + 32767, 511,32767, 102,32767, 513,32767,32767,32767,32767, + 32767,32767,32767, 536,32767, 543, 543,32767, 497, 100, + 195,32767,32767, 512,32767, 195, 195,32767,32767,32767, + 32767,32767,32767,32767,32767, 604, 497, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110,32767, 195, + 110,32767,32767,32767, 100, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 190,32767, 268, 270, 102, + 558, 195,32767, 516,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 509,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 497, 435, 138,32767, 138, 543, 427, 428, 429, 499, + 543, 543, 543, 312, 289,32767,32767,32767,32767, 514, + 514, 100, 100, 100, 100, 509,32767,32767,32767,32767, + 111, 99, 99, 99, 99, 99, 103, 101,32767,32767, + 32767,32767, 223, 99,32767, 101, 101,32767,32767, 223, + 225, 212, 101, 227,32767, 562, 563, 223, 101, 227, + 227, 227, 247, 247, 486, 318, 101, 99, 101, 101, + 197, 318, 318,32767, 101, 486, 318, 486, 318, 199, + 318, 318, 318, 486, 318,32767, 101, 318, 214, 99, + 99, 318,32767,32767,32767, 499,32767,32767,32767,32767, + 32767,32767,32767, 222,32767,32767,32767,32767,32767,32767, + 32767,32767, 530,32767, 547, 560, 433, 434, 436, 545, + 458, 459, 460, 461, 462, 463, 464, 466, 592,32767, + 503,32767,32767,32767, 338,32767, 602,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 603,32767, 543,32767,32767,32767, + 32767, 432, 9, 74, 492, 42, 43, 51, 57, 520, + 521, 522, 523, 517, 518, 524, 519,32767,32767, 525, + 568,32767,32767, 544, 595,32767,32767,32767,32767,32767, + 32767, 138,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 530,32767, 136,32767,32767,32767,32767, + 32767,32767,32767,32767, 526,32767,32767,32767, 543,32767, + 32767,32767,32767, 314, 311,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767, 543,32767,32767,32767,32767,32767, 291,32767, 308, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 286,32767,32767, 381, + 499, 294, 296, 297,32767,32767,32767,32767, 360,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 152, 152, 3, 3, 341, 152, 152, 152, 341, 341, + 152, 341, 341, 341, 152, 152, 152, 152, 152, 152, + 280, 185, 262, 265, 247, 247, 152, 352, 152 + ); + + protected array $goto = array( + 196, 196, 1034, 1065, 697, 431, 661, 621, 658, 319, + 706, 425, 313, 314, 335, 576, 430, 336, 432, 638, + 654, 655, 852, 672, 673, 674, 853, 167, 167, 167, + 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, + 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, + 189, 190, 191, 192, 218, 216, 219, 536, 537, 421, + 538, 540, 541, 542, 543, 544, 545, 546, 547, 1136, + 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, + 176, 178, 215, 217, 220, 238, 243, 244, 246, 257, + 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, + 271, 281, 282, 316, 317, 318, 426, 427, 428, 581, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, + 200, 239, 188, 189, 190, 191, 192, 218, 1136, 201, + 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, + 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, + 212, 213, 214, 855, 466, 466, 278, 278, 278, 278, + 623, 623, 351, 466, 1269, 600, 1269, 1269, 1269, 1269, + 1269, 1269, 1269, 1269, 1269, 1287, 1287, 599, 1100, 1287, + 709, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 508, 700, 458, 1098, 975, 559, 552, 860, 419, 909, + 904, 905, 918, 861, 906, 858, 907, 908, 859, 848, + 827, 912, 354, 354, 354, 354, 396, 399, 560, 601, + 605, 1087, 1082, 1083, 1084, 341, 552, 559, 568, 569, + 344, 579, 602, 616, 617, 408, 409, 1232, 440, 479, + 670, 22, 671, 886, 412, 413, 414, 481, 684, 349, + 1237, 415, 1237, 1107, 1108, 347, 833, 1034, 1034, 1237, + 573, 848, 1034, 1327, 1034, 1034, 1040, 1039, 1034, 1034, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1319, + 1319, 1319, 1319, 1237, 893, 851, 893, 893, 1237, 1237, + 1237, 1237, 1233, 1234, 1237, 1237, 1237, 833, 355, 833, + 843, 996, 252, 252, 1043, 1044, 1037, 1037, 355, 355, + 681, 952, 394, 926, 1029, 1045, 1046, 927, 1235, 1295, + 1296, 942, 355, 355, 942, 913, 355, 914, 1354, 250, + 250, 250, 250, 245, 253, 548, 548, 548, 548, 554, + 604, 1285, 1285, 355, 355, 1285, 571, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 539, 539, 342, 424, + 539, 611, 539, 539, 539, 539, 539, 539, 539, 539, + 539, 566, 476, 1312, 1313, 733, 637, 639, 325, 308, + 659, 848, 343, 342, 683, 687, 1010, 695, 704, 1006, + 660, 1298, 609, 624, 627, 628, 629, 630, 651, 652, + 653, 708, 1216, 944, 1314, 1315, 1217, 1220, 945, 1221, + 1337, 1337, 686, 352, 353, 868, 553, 563, 450, 450, + 450, 553, 1309, 563, 1309, 1133, 397, 462, 1337, 1058, + 880, 1309, 1185, 867, 500, 5, 501, 6, 469, 580, + 470, 471, 507, 554, 878, 1340, 1340, 1345, 1346, 433, + 438, 550, 666, 550, 433, 682, 1321, 1321, 1321, 1321, + 550, 337, 1041, 1041, 931, 1123, 873, 665, 1052, 1048, + 1049, 619, 845, 876, 324, 275, 324, 1015, 967, 410, + 705, 577, 614, 1305, 456, 872, 403, 664, 994, 969, + 969, 969, 969, 866, 870, 456, 963, 970, 881, 869, + 1070, 1074, 631, 633, 635, 1227, 1230, 958, 615, 978, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 999, 1018, 450, 971, 1073, 732, 477, 1228, 1307, + 1307, 1073, 736, 968, 551, 1008, 1003, 882, 694, 1075, + 1071, 829, 255, 255, 980, 0, 1118, 0, 1013, 1013, + 694, 0, 0, 0, 694, 1116, 885 + ); + + protected array $gotoCheck = array( + 42, 42, 73, 127, 73, 66, 66, 56, 56, 66, + 9, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 86, 86, 26, 86, 86, 86, 27, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 15, 149, 149, 23, 23, 23, 23, + 108, 108, 97, 149, 108, 130, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 170, 170, 8, 8, 170, + 8, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 8, 8, 83, 8, 49, 76, 76, 15, 43, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 22, + 6, 15, 24, 24, 24, 24, 59, 59, 59, 59, + 59, 15, 15, 15, 15, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 82, 82, 20, 83, 84, + 82, 76, 82, 45, 82, 82, 82, 84, 82, 179, + 73, 82, 73, 144, 144, 82, 12, 73, 73, 73, + 172, 22, 73, 181, 73, 73, 118, 118, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 9, + 9, 9, 9, 73, 25, 25, 25, 25, 73, 73, + 73, 73, 20, 20, 73, 73, 73, 12, 14, 12, + 20, 103, 5, 5, 119, 119, 89, 89, 14, 14, + 89, 89, 62, 73, 89, 89, 89, 73, 20, 20, + 20, 9, 14, 14, 9, 65, 14, 65, 14, 5, + 5, 5, 5, 5, 5, 107, 107, 107, 107, 14, + 107, 171, 171, 14, 14, 171, 104, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 173, 173, 168, 13, + 173, 13, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 48, 176, 176, 176, 48, 48, 48, 169, 169, + 48, 22, 168, 168, 48, 48, 48, 48, 48, 48, + 64, 14, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 79, 79, 178, 178, 79, 79, 79, 79, + 182, 182, 14, 97, 97, 35, 9, 9, 23, 23, + 23, 9, 130, 9, 130, 150, 9, 9, 182, 114, + 35, 130, 151, 35, 155, 46, 155, 46, 9, 9, + 9, 9, 155, 14, 9, 182, 182, 9, 9, 117, + 113, 19, 120, 19, 117, 116, 130, 130, 130, 130, + 19, 29, 117, 117, 17, 17, 39, 117, 117, 117, + 117, 17, 18, 9, 24, 24, 24, 17, 93, 93, + 93, 2, 2, 130, 19, 17, 28, 17, 17, 19, + 19, 19, 19, 17, 37, 19, 19, 19, 16, 16, + 16, 16, 85, 85, 85, 17, 14, 92, 80, 16, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 50, 110, 23, 50, 130, 50, 157, 160, 130, + 130, 130, 99, 16, 50, 50, 50, 41, 7, 132, + 129, 7, 5, 5, 96, -1, 147, -1, 107, 107, + 7, -1, -1, -1, 7, 16, 16 + ); + + protected array $gotoBase = array( + 0, 0, -221, 0, 0, 311, 200, 541, 179, -10, + 0, 0, -30, 32, 11, -185, 56, 9, 173, 196, + -146, 0, -59, 163, 219, 291, 18, 22, 159, 175, + 0, 0, 0, 0, 0, 54, 0, 165, 0, 153, + 0, 106, -1, 189, 0, 230, -291, 0, -330, 186, + 519, 0, 0, 0, 0, 0, -33, 0, 0, 181, + 0, 0, 280, 0, 158, 321, -236, 0, 0, 0, + 0, 0, 0, -5, 0, 0, -140, 0, 0, 4, + 174, 44, -246, -76, -220, 33, -698, 0, 0, 37, + 0, 0, 188, 184, 0, 0, 111, -311, 0, 135, + 0, 0, 0, 276, 313, 0, 0, 317, -71, 0, + 162, 0, 0, 183, 166, 0, 182, 187, -3, 29, + 172, 0, 0, 0, 0, 0, 0, 1, 0, 176, + 167, 0, 107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -12, 0, 0, 112, 0, 130, + 190, 168, 0, 0, 0, -51, 0, 97, 0, 0, + 169, 0, 0, 0, 0, 0, 0, 0, 71, 67, + -56, 110, 241, 125, 0, 0, 82, 0, 42, 229, + 0, 242, 113, 0, 0 + ); + + protected array $gotoDefault = array( + -32768, 512, 740, 4, 741, 935, 816, 825, 597, 530, + 707, 348, 625, 422, 1303, 911, 1122, 578, 844, 1246, + 1254, 457, 847, 330, 730, 923, 894, 895, 400, 386, + 392, 398, 649, 626, 494, 879, 453, 871, 486, 874, + 452, 883, 164, 418, 510, 887, 3, 890, 557, 921, + 973, 387, 898, 388, 677, 900, 562, 902, 903, 395, + 401, 402, 1127, 570, 622, 915, 256, 564, 916, 385, + 917, 925, 390, 393, 688, 465, 505, 499, 411, 1102, + 565, 608, 646, 447, 473, 620, 632, 618, 480, 434, + 416, 329, 957, 965, 487, 463, 979, 350, 987, 738, + 1135, 640, 489, 995, 641, 1002, 1005, 531, 532, 478, + 1017, 272, 1020, 490, 19, 667, 1031, 1032, 668, 642, + 1054, 643, 669, 644, 1056, 472, 598, 1064, 454, 1072, + 1291, 455, 1076, 266, 1079, 277, 417, 435, 1085, 1086, + 9, 1092, 698, 699, 11, 276, 509, 1117, 689, 451, + 1134, 439, 1204, 1206, 558, 491, 1224, 1223, 680, 506, + 1229, 448, 1294, 449, 533, 474, 315, 534, 1338, 307, + 333, 312, 549, 294, 334, 535, 475, 1300, 1308, 331, + 31, 1328, 1339, 575, 613 + ); + + protected array $ruleToNonTerminal = array( + 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, + 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, + 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, + 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, + 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, + 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, + 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 25, 25, 50, 69, 69, 72, 72, 71, + 70, 70, 63, 75, 75, 76, 76, 77, 77, 78, + 78, 79, 79, 80, 80, 26, 26, 27, 27, 27, + 27, 27, 88, 88, 90, 90, 83, 83, 91, 91, + 92, 92, 92, 84, 84, 87, 87, 85, 85, 93, + 94, 94, 57, 57, 65, 65, 68, 68, 68, 67, + 95, 95, 96, 58, 58, 58, 58, 97, 97, 98, + 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, + 55, 55, 51, 51, 105, 53, 53, 106, 52, 52, + 54, 54, 64, 64, 64, 64, 81, 81, 109, 109, + 111, 111, 112, 112, 112, 112, 110, 110, 110, 114, + 114, 114, 114, 89, 89, 117, 117, 117, 118, 118, + 115, 115, 119, 119, 121, 121, 122, 122, 116, 123, + 123, 120, 124, 124, 124, 124, 113, 113, 82, 82, + 82, 20, 20, 20, 126, 125, 125, 127, 127, 127, + 127, 60, 128, 128, 129, 61, 131, 131, 132, 132, + 133, 133, 86, 134, 134, 134, 134, 134, 134, 134, + 139, 139, 140, 140, 141, 141, 141, 141, 141, 142, + 143, 143, 138, 138, 135, 135, 137, 137, 145, 145, + 144, 144, 144, 144, 144, 144, 144, 136, 146, 146, + 148, 147, 147, 62, 104, 149, 149, 56, 56, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 156, 150, 150, 155, 155, 158, 159, + 159, 160, 161, 162, 162, 162, 162, 19, 19, 73, + 73, 73, 73, 151, 151, 151, 151, 164, 164, 152, + 152, 154, 154, 154, 157, 157, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 171, 171, 171, 108, 173, + 173, 173, 173, 153, 153, 153, 153, 153, 153, 153, + 153, 59, 59, 167, 167, 167, 167, 174, 174, 163, + 163, 163, 175, 175, 175, 175, 175, 175, 74, 74, + 66, 66, 66, 66, 130, 130, 130, 130, 178, 177, + 166, 166, 166, 166, 166, 166, 166, 165, 165, 165, + 176, 176, 176, 176, 107, 172, 180, 180, 179, 179, + 181, 181, 181, 181, 181, 181, 181, 181, 169, 169, + 169, 169, 168, 183, 182, 182, 182, 182, 182, 182, + 182, 182, 184, 184, 184, 184 + ); + + protected array $ruleToLength = array( + 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, + 0, 1, 1, 1, 1, 4, 3, 5, 4, 3, + 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, + 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, + 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, + 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, + 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, + 2, 1, 1, 1, 1, 0, 2, 1, 3, 8, + 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, + 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, + 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, + 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, + 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, + 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, + 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, + 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, + 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, + 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, + 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, + 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, + 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, + 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, + 3, 3, 3, 4, 4, 1, 1, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, + 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, + 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, + 3, 2, 1, 2, 2, 2, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 1, 1, 0, + 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 5, 3, 3, 4, + 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, + 3, 0, 1, 1, 3, 1, 1, 1, 1, 1, + 3, 1, 1, 4, 4, 1, 4, 4, 0, 1, + 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, + 1, 4, 4, 3, 3, 3, 3, 1, 3, 1, + 1, 3, 1, 1, 4, 1, 1, 1, 3, 1, + 1, 2, 1, 3, 4, 3, 2, 0, 2, 2, + 1, 2, 1, 1, 1, 4, 3, 3, 3, 3, + 6, 3, 1, 1, 2, 1 + ); + + protected function initReduceCallbacks(): void { + $this->reduceCallbacks = [ + 0 => null, + 1 => function ($stackPos) { + $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); + }, + 2 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; + }, + 3 => function ($stackPos) { + $this->semValue = array(); + }, + 4 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 5 => null, + 6 => null, + 7 => null, + 8 => null, + 9 => null, + 10 => null, + 11 => null, + 12 => null, + 13 => null, + 14 => null, + 15 => null, + 16 => null, + 17 => null, + 18 => null, + 19 => null, + 20 => null, + 21 => null, + 22 => null, + 23 => null, + 24 => null, + 25 => null, + 26 => null, + 27 => null, + 28 => null, + 29 => null, + 30 => null, + 31 => null, + 32 => null, + 33 => null, + 34 => null, + 35 => null, + 36 => null, + 37 => null, + 38 => null, + 39 => null, + 40 => null, + 41 => null, + 42 => null, + 43 => null, + 44 => null, + 45 => null, + 46 => null, + 47 => null, + 48 => null, + 49 => null, + 50 => null, + 51 => null, + 52 => null, + 53 => null, + 54 => null, + 55 => null, + 56 => null, + 57 => null, + 58 => null, + 59 => null, + 60 => null, + 61 => null, + 62 => null, + 63 => null, + 64 => null, + 65 => null, + 66 => null, + 67 => null, + 68 => null, + 69 => null, + 70 => null, + 71 => null, + 72 => null, + 73 => null, + 74 => null, + 75 => null, + 76 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; if ($this->semValue === "emitError(new Error('Cannot use "getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); + }, + 77 => null, + 78 => null, + 79 => null, + 80 => null, + 81 => null, + 82 => null, + 83 => null, + 84 => null, + 85 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 86 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 87 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 88 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 89 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 90 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 91 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 92 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 93 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 94 => null, + 95 => function ($stackPos) { + $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 96 => function ($stackPos) { + $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 97 => function ($stackPos) { + /* nothing */ + }, + 98 => function ($stackPos) { + /* nothing */ + }, + 99 => function ($stackPos) { + /* nothing */ + }, + 100 => function ($stackPos) { + $this->emitError(new Error('A trailing comma is not allowed here', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); + }, + 101 => null, + 102 => null, + 103 => function ($stackPos) { + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 104 => function ($stackPos) { + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 105 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 106 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 107 => function ($stackPos) { + $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 108 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 109 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 110 => function ($stackPos) { + $this->semValue = []; + }, + 111 => null, + 112 => null, + 113 => null, + 114 => null, + 115 => function ($stackPos) { + $this->semValue = new Stmt\HaltCompiler($this->handleHaltCompiler(), $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 116 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); + $this->checkNamespace($this->semValue); + }, + 117 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $this->checkNamespace($this->semValue); + }, + 118 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $this->checkNamespace($this->semValue); + }, + 119 => function ($stackPos) { + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 120 => function ($stackPos) { + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 121 => null, + 122 => function ($stackPos) { + $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 123 => function ($stackPos) { + $this->semValue = Stmt\Use_::TYPE_FUNCTION; + }, + 124 => function ($stackPos) { + $this->semValue = Stmt\Use_::TYPE_CONSTANT; + }, + 125 => function ($stackPos) { + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 126 => function ($stackPos) { + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 127 => null, + 128 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 129 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 130 => null, + 131 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 132 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 133 => null, + 134 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 135 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 136 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + }, + 137 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + }, + 138 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + }, + 139 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + }, + 140 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; + }, + 141 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; + }, + 142 => null, + 143 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 144 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 145 => function ($stackPos) { + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 146 => null, + 147 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 148 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 149 => function ($stackPos) { + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 150 => function ($stackPos) { + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 151 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; + }, + 152 => function ($stackPos) { + $this->semValue = array(); + }, + 153 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 154 => null, + 155 => null, + 156 => null, + 157 => function ($stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 158 => function ($stackPos) { + $this->semValue = new Stmt\Block($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 159 => function ($stackPos) { + $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => $this->semStack[$stackPos-(7-5)], 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 160 => function ($stackPos) { + $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 161 => function ($stackPos) { + $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 162 => function ($stackPos) { + $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 163 => function ($stackPos) { + $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 164 => function ($stackPos) { + $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 165 => function ($stackPos) { + $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 166 => function ($stackPos) { + $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 167 => function ($stackPos) { + $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 168 => function ($stackPos) { + $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 169 => function ($stackPos) { + $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 170 => function ($stackPos) { + $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 171 => function ($stackPos) { + + $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('hasLeadingNewline', $this->inlineHtmlHasLeadingNewline($stackPos-(1-1))); + + }, + 172 => function ($stackPos) { + $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 173 => function ($stackPos) { + $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 174 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 175 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 176 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-4)], $this->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 177 => function ($stackPos) { + $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 178 => function ($stackPos) { + $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->checkTryCatch($this->semValue); + }, + 179 => function ($stackPos) { + $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 180 => function ($stackPos) { + $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 181 => function ($stackPos) { + $this->semValue = null; /* means: no statement */ + }, + 182 => null, + 183 => function ($stackPos) { + $this->semValue = $this->maybeCreateNop($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); + }, + 184 => function ($stackPos) { + if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; + }, + 185 => function ($stackPos) { + $this->semValue = array(); + }, + 186 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 187 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 188 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 189 => function ($stackPos) { + $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 190 => function ($stackPos) { + $this->semValue = null; + }, + 191 => function ($stackPos) { + $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 192 => null, + 193 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 194 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 195 => function ($stackPos) { + $this->semValue = false; + }, + 196 => function ($stackPos) { + $this->semValue = true; + }, + 197 => function ($stackPos) { + $this->semValue = false; + }, + 198 => function ($stackPos) { + $this->semValue = true; + }, + 199 => function ($stackPos) { + $this->semValue = false; + }, + 200 => function ($stackPos) { + $this->semValue = true; + }, + 201 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 202 => function ($stackPos) { + $this->semValue = []; + }, + 203 => null, + 204 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 205 => function ($stackPos) { + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 206 => function ($stackPos) { + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 207 => function ($stackPos) { + $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + $this->checkClass($this->semValue, $stackPos-(7-2)); + }, + 208 => function ($stackPos) { + $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + $this->checkClass($this->semValue, $stackPos-(8-3)); + }, + 209 => function ($stackPos) { + $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + $this->checkInterface($this->semValue, $stackPos-(7-3)); + }, + 210 => function ($stackPos) { + $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 211 => function ($stackPos) { + $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + $this->checkEnum($this->semValue, $stackPos-(8-3)); + }, + 212 => function ($stackPos) { + $this->semValue = null; + }, + 213 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 214 => function ($stackPos) { + $this->semValue = null; + }, + 215 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 216 => function ($stackPos) { + $this->semValue = 0; + }, + 217 => null, + 218 => null, + 219 => function ($stackPos) { + $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 220 => function ($stackPos) { + $this->semValue = Modifiers::ABSTRACT; + }, + 221 => function ($stackPos) { + $this->semValue = Modifiers::FINAL; + }, + 222 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 223 => function ($stackPos) { + $this->semValue = null; + }, + 224 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 225 => function ($stackPos) { + $this->semValue = array(); + }, + 226 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 227 => function ($stackPos) { + $this->semValue = array(); + }, + 228 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 229 => null, + 230 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 231 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 232 => null, + 233 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 234 => null, + 235 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 236 => function ($stackPos) { + if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; + }, + 237 => function ($stackPos) { + $this->semValue = null; + }, + 238 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 239 => null, + 240 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 241 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 242 => function ($stackPos) { + $this->semValue = new Node\DeclareItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 243 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 244 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-3)]; + }, + 245 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 246 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(5-3)]; + }, + 247 => function ($stackPos) { + $this->semValue = array(); + }, + 248 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 249 => function ($stackPos) { + $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 250 => function ($stackPos) { + $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 251 => null, + 252 => null, + 253 => function ($stackPos) { + $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 254 => function ($stackPos) { + $this->semValue = []; + }, + 255 => null, + 256 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 257 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 258 => function ($stackPos) { + $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 259 => function ($stackPos) { + $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 260 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 261 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 262 => function ($stackPos) { + $this->semValue = array(); + }, + 263 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 264 => function ($stackPos) { + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 265 => function ($stackPos) { + $this->semValue = array(); + }, + 266 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 267 => function ($stackPos) { + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); + }, + 268 => function ($stackPos) { + $this->semValue = null; + }, + 269 => function ($stackPos) { + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 270 => function ($stackPos) { + $this->semValue = null; + }, + 271 => function ($stackPos) { + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); + }, + 272 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + }, + 273 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + }, + 274 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + }, + 275 => function ($stackPos) { + $this->semValue = array($this->fixupArrayDestructuring($this->semStack[$stackPos-(1-1)]), false); + }, + 276 => null, + 277 => function ($stackPos) { + $this->semValue = array(); + }, + 278 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 279 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 280 => function ($stackPos) { + $this->semValue = 0; + }, + 281 => function ($stackPos) { + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 282 => function ($stackPos) { + $this->semValue = Modifiers::PUBLIC; + }, + 283 => function ($stackPos) { + $this->semValue = Modifiers::PROTECTED; + }, + 284 => function ($stackPos) { + $this->semValue = Modifiers::PRIVATE; + }, + 285 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 286 => function ($stackPos) { + $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + $this->checkParam($this->semValue); + }, + 287 => function ($stackPos) { + $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); + $this->checkParam($this->semValue); + }, + 288 => function ($stackPos) { + $this->semValue = new Node\Param(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + }, + 289 => null, + 290 => function ($stackPos) { + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 291 => function ($stackPos) { + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 292 => null, + 293 => null, + 294 => function ($stackPos) { + $this->semValue = new Node\Name('static', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 295 => function ($stackPos) { + $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); + }, + 296 => function ($stackPos) { + $this->semValue = new Node\Identifier('array', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 297 => function ($stackPos) { + $this->semValue = new Node\Identifier('callable', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 298 => null, + 299 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 300 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 301 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 302 => null, + 303 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 304 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 305 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 306 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 307 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 308 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 309 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 310 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 311 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 312 => null, + 313 => function ($stackPos) { + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 314 => function ($stackPos) { + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 315 => null, + 316 => function ($stackPos) { + $this->semValue = null; + }, + 317 => null, + 318 => function ($stackPos) { + $this->semValue = null; + }, + 319 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 320 => function ($stackPos) { + $this->semValue = null; + }, + 321 => function ($stackPos) { + $this->semValue = array(); + }, + 322 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 323 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-2)]); + }, + 324 => function ($stackPos) { + $this->semValue = new Node\VariadicPlaceholder($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 325 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 326 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 327 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 328 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 329 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 330 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(3-1)]); + }, + 331 => null, + 332 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 333 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 334 => null, + 335 => null, + 336 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 337 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 338 => function ($stackPos) { + $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 339 => function ($stackPos) { + $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 340 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } + }, + 341 => function ($stackPos) { + $this->semValue = array(); + }, + 342 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 343 => function ($stackPos) { + $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); + $this->checkProperty($this->semValue, $stackPos-(5-2)); + }, + 344 => function ($stackPos) { + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-1)]); + $this->checkClassConst($this->semValue, $stackPos-(5-2)); + }, + 345 => function ($stackPos) { + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); + $this->checkClassConst($this->semValue, $stackPos-(6-2)); + }, + 346 => function ($stackPos) { + $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + $this->checkClassMethod($this->semValue, $stackPos-(10-2)); + }, + 347 => function ($stackPos) { + $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 348 => function ($stackPos) { + $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 349 => function ($stackPos) { + $this->semValue = null; /* will be skipped */ + }, + 350 => function ($stackPos) { + $this->semValue = array(); + }, + 351 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 352 => function ($stackPos) { + $this->semValue = array(); + }, + 353 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 354 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 355 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 356 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 357 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 358 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 359 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 360 => null, + 361 => function ($stackPos) { + $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + }, + 362 => function ($stackPos) { + $this->semValue = null; + }, + 363 => null, + 364 => null, + 365 => function ($stackPos) { + $this->semValue = 0; + }, + 366 => function ($stackPos) { + $this->semValue = 0; + }, + 367 => null, + 368 => null, + 369 => function ($stackPos) { + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 370 => function ($stackPos) { + $this->semValue = Modifiers::PUBLIC; + }, + 371 => function ($stackPos) { + $this->semValue = Modifiers::PROTECTED; + }, + 372 => function ($stackPos) { + $this->semValue = Modifiers::PRIVATE; + }, + 373 => function ($stackPos) { + $this->semValue = Modifiers::STATIC; + }, + 374 => function ($stackPos) { + $this->semValue = Modifiers::ABSTRACT; + }, + 375 => function ($stackPos) { + $this->semValue = Modifiers::FINAL; + }, + 376 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 377 => null, + 378 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 379 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 380 => function ($stackPos) { + $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 381 => function ($stackPos) { + $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 382 => function ($stackPos) { + $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 383 => null, + 384 => null, + 385 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 386 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 387 => function ($stackPos) { + $this->semValue = array(); + }, + 388 => null, + 389 => null, + 390 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 391 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->fixupArrayDestructuring($this->semStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 392 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 393 => function ($stackPos) { + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 394 => function ($stackPos) { + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + if (!$this->phpVersion->allowsAssignNewByReference()) { + $this->emitError(new Error('Cannot assign new by reference', $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]))); + } + + }, + 395 => null, + 396 => null, + 397 => function ($stackPos) { + $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 398 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 399 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 400 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 401 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 402 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 403 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 404 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 405 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 406 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 407 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 408 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 409 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 410 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 411 => function ($stackPos) { + $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 412 => function ($stackPos) { + $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 413 => function ($stackPos) { + $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 414 => function ($stackPos) { + $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 415 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 416 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 417 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 418 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 419 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 420 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 421 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 422 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 423 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 424 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 425 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 426 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 427 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 428 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 429 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 430 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 431 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 432 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 433 => function ($stackPos) { + $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 434 => function ($stackPos) { + $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 435 => function ($stackPos) { + $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 436 => function ($stackPos) { + $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 437 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 438 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 439 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 440 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 441 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 442 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 443 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 444 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 445 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 446 => function ($stackPos) { + $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 447 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 448 => function ($stackPos) { + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 449 => function ($stackPos) { + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 450 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 451 => function ($stackPos) { + $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 452 => function ($stackPos) { + $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 453 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 454 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 455 => function ($stackPos) { + $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 456 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 457 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 458 => function ($stackPos) { + $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 459 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); + $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); + $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); + }, + 460 => function ($stackPos) { + $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 461 => function ($stackPos) { + $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 462 => function ($stackPos) { + $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 463 => function ($stackPos) { + $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 464 => function ($stackPos) { + $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 465 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); + $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; + $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); + }, + 466 => function ($stackPos) { + $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 467 => null, + 468 => function ($stackPos) { + $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 469 => function ($stackPos) { + $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 470 => function ($stackPos) { + $this->semValue = new Expr\Yield_(null, null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 471 => function ($stackPos) { + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 472 => function ($stackPos) { + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 473 => function ($stackPos) { + $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 474 => function ($stackPos) { + $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 475 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 476 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 477 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 478 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 479 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 480 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 481 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 482 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 483 => function ($stackPos) { + $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])), $this->semStack[$stackPos-(8-3)]); + $this->checkClass($this->semValue[0], -1); + }, + 484 => function ($stackPos) { + $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 485 => function ($stackPos) { + list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 486 => function ($stackPos) { + $this->semValue = array(); + }, + 487 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-3)]; + }, + 488 => null, + 489 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 490 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 491 => function ($stackPos) { + $this->semValue = new Node\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 492 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 493 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 494 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 495 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 496 => function ($stackPos) { + $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 497 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 498 => null, + 499 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 500 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 501 => function ($stackPos) { + $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 502 => function ($stackPos) { + $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 503 => null, + 504 => null, + 505 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 506 => function ($stackPos) { + $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 507 => null, + 508 => null, + 509 => function ($stackPos) { + $this->semValue = null; + }, + 510 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 511 => function ($stackPos) { + $this->semValue = array(); + }, + 512 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); foreach ($this->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; + }, + 513 => function ($stackPos) { + foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 514 => function ($stackPos) { + $this->semValue = array(); + }, + 515 => null, + 516 => function ($stackPos) { + $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 517 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Line($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 518 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\File($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 519 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Dir($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 520 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Class_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 521 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Trait_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 522 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Method($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 523 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Function_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 524 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Namespace_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 525 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 526 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 527 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)])), $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 528 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); + }, + 529 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); + $this->createdArrays->attach($this->semValue); + }, + 530 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->createdArrays->attach($this->semValue); + }, + 531 => function ($stackPos) { + $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->supportsUnicodeEscapes()); + }, + 532 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; + foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = new Scalar\InterpolatedString($this->semStack[$stackPos-(3-2)], $attrs); + }, + 533 => function ($stackPos) { + $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->allowsInvalidOctals()); + }, + 534 => function ($stackPos) { + $this->semValue = Scalar\Float_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 535 => null, + 536 => null, + 537 => null, + 538 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); + }, + 539 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(2-2)], $this->tokenEndStack[$stackPos-(2-2)]), true); + }, + 540 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); + }, + 541 => function ($stackPos) { + $this->semValue = null; + }, + 542 => null, + 543 => null, + 544 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 545 => null, + 546 => null, + 547 => null, + 548 => null, + 549 => null, + 550 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 551 => null, + 552 => null, + 553 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 554 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 555 => null, + 556 => function ($stackPos) { + $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 557 => function ($stackPos) { + $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 558 => function ($stackPos) { + $this->semValue = null; + }, + 559 => null, + 560 => null, + 561 => null, + 562 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 563 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 564 => null, + 565 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 566 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 567 => function ($stackPos) { + $this->semValue = new Expr\Variable(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])), $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 568 => function ($stackPos) { + $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])) : $var; + }, + 569 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 570 => null, + 571 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 572 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 573 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 574 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 575 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 576 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 577 => null, + 578 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 579 => null, + 580 => null, + 581 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 582 => null, + 583 => function ($stackPos) { + $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 584 => function ($stackPos) { + $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); $this->semValue->setAttribute('kind', Expr\List_::KIND_LIST); + $this->postprocessList($this->semValue); + }, + 585 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end]->value instanceof Expr\Error) array_pop($this->semValue); + }, + 586 => null, + 587 => function ($stackPos) { + /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ + }, + 588 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 589 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 590 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 591 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 592 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 593 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 594 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 595 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 596 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), true); + }, + 597 => function ($stackPos) { + /* Create an Error node now to remember the position. We'll later either report an error, + or convert this into a null element, depending on whether this is a creation or destructuring context. */ + $attrs = $this->createEmptyElemAttributes($this->tokenPos); + $this->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); + }, + 598 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 599 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 600 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 601 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); + }, + 602 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); $attrs['rawValue'] = $this->semStack[$stackPos-(1-1)]; $this->semValue = new Node\InterpolatedStringPart($this->semStack[$stackPos-(1-1)], $attrs); + }, + 603 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 604 => null, + 605 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 606 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 607 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 608 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 609 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 610 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 611 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 612 => function ($stackPos) { + $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 613 => function ($stackPos) { + $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 614 => function ($stackPos) { + $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 615 => null, + ]; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php new file mode 100644 index 0000000..76d52a8 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php @@ -0,0 +1,2717 @@ +'", + "T_IS_GREATER_OR_EQUAL", + "'.'", + "T_SL", + "T_SR", + "'+'", + "'-'", + "'*'", + "'/'", + "'%'", + "'!'", + "T_INSTANCEOF", + "'~'", + "T_INC", + "T_DEC", + "T_INT_CAST", + "T_DOUBLE_CAST", + "T_STRING_CAST", + "T_ARRAY_CAST", + "T_OBJECT_CAST", + "T_BOOL_CAST", + "T_UNSET_CAST", + "'@'", + "T_POW", + "'['", + "T_NEW", + "T_CLONE", + "T_EXIT", + "T_IF", + "T_ELSEIF", + "T_ELSE", + "T_ENDIF", + "T_LNUMBER", + "T_DNUMBER", + "T_STRING", + "T_STRING_VARNAME", + "T_VARIABLE", + "T_NUM_STRING", + "T_INLINE_HTML", + "T_ENCAPSED_AND_WHITESPACE", + "T_CONSTANT_ENCAPSED_STRING", + "T_ECHO", + "T_DO", + "T_WHILE", + "T_ENDWHILE", + "T_FOR", + "T_ENDFOR", + "T_FOREACH", + "T_ENDFOREACH", + "T_DECLARE", + "T_ENDDECLARE", + "T_AS", + "T_SWITCH", + "T_MATCH", + "T_ENDSWITCH", + "T_CASE", + "T_DEFAULT", + "T_BREAK", + "T_CONTINUE", + "T_GOTO", + "T_FUNCTION", + "T_FN", + "T_CONST", + "T_RETURN", + "T_TRY", + "T_CATCH", + "T_FINALLY", + "T_USE", + "T_INSTEADOF", + "T_GLOBAL", + "T_STATIC", + "T_ABSTRACT", + "T_FINAL", + "T_PRIVATE", + "T_PROTECTED", + "T_PUBLIC", + "T_READONLY", + "T_VAR", + "T_UNSET", + "T_ISSET", + "T_EMPTY", + "T_HALT_COMPILER", + "T_CLASS", + "T_TRAIT", + "T_INTERFACE", + "T_ENUM", + "T_EXTENDS", + "T_IMPLEMENTS", + "T_OBJECT_OPERATOR", + "T_NULLSAFE_OBJECT_OPERATOR", + "T_LIST", + "T_ARRAY", + "T_CALLABLE", + "T_CLASS_C", + "T_TRAIT_C", + "T_METHOD_C", + "T_FUNC_C", + "T_LINE", + "T_FILE", + "T_START_HEREDOC", + "T_END_HEREDOC", + "T_DOLLAR_OPEN_CURLY_BRACES", + "T_CURLY_OPEN", + "T_PAAMAYIM_NEKUDOTAYIM", + "T_NAMESPACE", + "T_NS_C", + "T_DIR", + "T_NS_SEPARATOR", + "T_ELLIPSIS", + "T_NAME_FULLY_QUALIFIED", + "T_NAME_QUALIFIED", + "T_NAME_RELATIVE", + "T_ATTRIBUTE", + "';'", + "']'", + "'('", + "')'", + "'{'", + "'}'", + "'`'", + "'\"'", + "'$'" + ); + + protected array $tokenToSymbol = array( + 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, + 161, 162, 53, 51, 8, 52, 48, 54, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, + 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 163, 35, 164, 58, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, + 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 45, 47, 49, 50, 57, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158 + ); + + protected array $action = array( + 133, 134, 135, 582, 136, 137, 0, 751, 752, 753, + 138, 38, 327,-32766,-32766,-32766,-32766,-32766,-32766, 837, + 826,-32767,-32767,-32767,-32767, 102, 103, 104, 1112, 1113, + 1114, 1111, 1110, 1109, 1115, 745, 744,-32766, 1027,-32766, + -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, + -32767, 1245,-32766,-32766, 1322, 754, 1112, 1113, 1114, 1111, + 1110, 1109, 1115, 459, 460, 461, 2, 990, 1306, 265, + 139, 404, 758, 759, 760, 761, 467, 468, 429, 835, + 606, -16, 1341, 23, 292, 815, 762, 763, 764, 765, + 766, 767, 768, 769, 770, 771, 791, 583, 792, 793, + 794, 795, 783, 784, 345, 346, 786, 787, 772, 773, + 774, 776, 777, 778, 356, 818, 819, 820, 821, 822, + 584, 779, 780, 585, 586, 941, 803, 801, 802, 814, + 798, 799, 835, 826, 587, 588, 797, 589, 590, 591, + 592, 593, 594, -328, 36, 251, 35, -194, 800, 595, + 596, -193, 140, -85, 133, 134, 135, 582, 136, 137, + 1060, 751, 752, 753, 138, 38, 129, -110, -110, -585, + -32766, -585, -110,-32766,-32766,-32766, 241, 836, -110, 145, + 959, 960,-32766,-32766,-32766, 961, -594,-32766, 482, 745, + 744, 955, 1036, -594,-32766, 991,-32766,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, 299, 754, + 831, 75,-32766,-32766,-32766, 291, 142, 326, 242, -85, + 326, 382, 381, 265, 139, 404, 758, 759, 760, 761, + 82, 423, 429,-32766, 326,-32766,-32766,-32766,-32766, 815, + 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, + 791, 583, 792, 793, 794, 795, 783, 784, 345, 346, + 786, 787, 772, 773, 774, 776, 777, 778, 356, 818, + 819, 820, 821, 822, 584, 779, 780, 585, 586, 254, + 803, 801, 802, 814, 798, 799, 832, 725, 587, 588, + 797, 589, 590, 591, 592, 593, 594, -328, 83, 84, + 85, -194, 800, 595, 596, -193, 149, 775, 746, 747, + 748, 749, 750, 151, 751, 752, 753, 788, 789, 37, + 483, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, -594, 274, -594,-32766,-32766, + -32766,-32766,-32766,-32766, 310, 1089, 127, 312, 110, 737, + 1326, 21, 754,-32766,-32766,-32766, -272, 1325,-32766,-32766, + 1088,-32766,-32766,-32766,-32766,-32766, 755, 756, 757, 758, + 759, 760, 761, 1104,-32766, 824,-32766,-32766, -545, 429, + 1036, 323, 815, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 791, 813, 792, 793, 794, 795, 783, + 784, 785, 812, 786, 787, 772, 773, 774, 776, 777, + 778, 817, 818, 819, 820, 821, 822, 823, 779, 780, + 781, 782, 1033, 803, 801, 802, 814, 798, 799, 745, + 744, 790, 796, 797, 804, 805, 807, 806, 808, 809, + 152,-32766, -545, -545, 1036, 800, 811, 810, 50, 51, + 52, 513, 53, 54, 1240, 1239, 1241, -545, 55, 56, + -110, 57,-32766, 1090, 920, -110, 556, -110, 292, -551, + 339, -545, 306, 103, 104, -110, -110, -110, -110, -110, + -110, -110, -110, 105, 106, 107, 108, 109, 1245, 274, + 380, 381, -591, -367, 715, -367, 340, 58, 59, -591, + 423, 110, 60, 370, 61, 248, 249, 62, 63, 64, + 65, 66, 67, 68, 69, -544, 28, 267, 70, 445, + 514,-32766, 374, -342, 1272, 1273, 515, 1278, 835, 862, + 389, 863, 1270, 42, 25, 516, 943, 517, 943, 518, + 920, 519, 299, 1036, 520, 521, 1266, 910, 441, 44, + 45, 446, 377, 376,-32766, 46, 522, 1023, 1022, 1021, + 1024, 368, 338, 391, 1238, 7, 291, 442, 1231, 835, + 524, 525, 526, 443, 1245, 357, 1036, 362, 834, -544, + -544, 154, 528, 529, 444, 1259, 1260, 1261, 1262, 1256, + 1257, 298,-32766,-32766, -544, -548, 1059, 1263, 1258, 291, + 1236, 1240, 1239, 1241, 299, 841, -550, 71, -544, 656, + 26, 321, 322, 326, -153, -153, -153, 920, 612, 675, + 676, 1035, 922, 910,-32766, 286, 710, 835, 155, -153, + 828, -153, 862, -153, 863, -153, 150, 407, 156, 1240, + 1239, 1241,-32766,-32766,-32766, 375, 1351, 716, 75, 1352, + 158, -591, 33, -591, 326, 835, 959, 960, -78, -548, + -548, 523, 920,-32766, 378, 379, 896, 955, -110, -110, + -110, 32, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 745, 744, -58, -548, -57, + -110, -110, 717, 745, 744, -110, 383, 384, 922, 1033, + 910, -110, 710, -153, 647, 648, 830, 124, 141, 125, + -32766, 1033, 326, 712, 1150, 1152, 48, 130, 131, 144, + 159, 1036,-32766, 160, 161, -543, 28, 162, 1238, 920, + 163, 299, 920, 1036, 75,-32766,-32766,-32766, 835,-32766, + 326,-32766, 1270,-32766, 282, 910,-32766, -87, -84, -78, + -73,-32766,-32766,-32766, -4, 920, 282,-32766,-32766, 720, + -72, -71, 727,-32766, 420, -70, -69, -68, -67, -66, + 287, 286,-32766, -65, -46, 922, 745, 744, 1231, 710, + 300, 301, -546, -18, 148, -302, 273, 283, 726, -543, + -543, 729, 528, 529, 920, 1259, 1260, 1261, 1262, 1256, + 1257, 919, 74, 147, -543, 288, 293, 1263, 1258, 126, + -298, 280, 910,-32766, 281, 910, 284, 73, -543, 1238, + 976, 690, 322, 326, 710, 285,-32766,-32766,-32766, 332, + -32766, 274,-32766, 294,-32766, 937, 110,-32766, 910, 685, + 835, -543,-32766,-32766,-32766, 826, -546, -546,-32766,-32766, + 146,-32766, -50, 701,-32766, 420, 703, 691, 20, 1119, + 375, -546, 436,-32766, 645, 1353, 1277, 297, 657,-32766, + 1279, 959, 960, 561, 956, -546, 523, 910, 692, 693, + 678, 527, 955, -110, -110, -110, 132, 922, 662, 663, + 922, 710, 464, -508, 710,-32766, 1240, 1239, 1241, 493, + 679, 1238, 282, 939, 10, -543, -543, 40,-32766,-32766, + -32766, 731,-32766, 922,-32766, 307,-32766, 710, -4,-32766, + -543, 305, 41, 304,-32766,-32766,-32766, 0, 0,-32766, + -32766,-32766, 920, 0, -543, 1238,-32766, 420, 311, 0, + 567, 299,-32766,-32766,-32766,-32766,-32766, -498,-32766, 897, + -32766, 0, 922,-32766, 8, 0, 710, 24,-32766,-32766, + -32766,-32766, 372, 610,-32766,-32766, 834, 1238, 734, -275, + -32766, 420, 920, 735,-32766,-32766,-32766, 854,-32766,-32766, + -32766, 901,-32766, 1000, 977,-32766, 49, 984, 974, 488, + -32766,-32766,-32766,-32766, 985, 899,-32766,-32766, 972, 1238, + 574, 1093,-32766, 420, 1096, 1097,-32766,-32766,-32766, 1094, + -32766,-32766,-32766, 1095,-32766, 910, 1101,-32766, 1267, 846, + 1292, 1310,-32766,-32766,-32766, 1344, 650, 34,-32766,-32766, + -579, -250, -250, -250,-32766, 420, -578, 375, -577, -551, + 28, 267, -550,-32766, -549, -492, 1, 29, 959, 960, + 302, 303, 835, 523, 30, 910, 1270, 39, 896, 955, + -110, -110, -110, 43, 47, 373, 72, 76, 77, 78, + 79, -249, -249, -249, 80, 81, 143, 375, 153, 128, + -273, 157, 247, 328, 357, 358, 359, 360, 959, 960, + 922, 361, 1231, 523, 710, -250, 362, 363, 896, 955, + -110, -110, -110, 364, 365, 366, 367, 529, 28, 1259, + 1260, 1261, 1262, 1256, 1257, 369, 437, 555, 1207, -272, + 835, 1263, 1258, 13, 1270, 14,-32766, 15, 16, 18, + 922, 73, 1238, 1348, 710, -249, 322, 326, 406,-32766, + -32766,-32766, 484,-32766, 485,-32766, 492,-32766, 495, 496, + -32766, 497, 498, 502, 503,-32766,-32766,-32766, 504, 511, + 1231,-32766,-32766, 572, 696, 1249, 1190,-32766, 420, 1268, + 1062, 1061, 1042, 1226, 1038, 529,-32766, 1259, 1260, 1261, + 1262, 1256, 1257, -277, -102, 12, 17, 27, 296, 1263, + 1258, 405, 603, 607, 636, 702, 1194, 1244, 1191, 73, + 320, 1323, 0, 371, 322, 326, 711, 714, 718, 719, + 721, 722, 723, 724, 728, 0, 713, 0, 1350, 857, + 856, 865, 949, 992, 864, 1349, 948, 946, 947, 950, + 1222, 930, 940, 928, 982, 983, 634, 1347, 1304, 1293, + 1311, 1320, 0, 0, 1271, 0, 326 + ); + + protected array $actionCheck = array( + 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, + 12, 13, 70, 9, 10, 11, 9, 10, 11, 1, + 80, 44, 45, 46, 47, 48, 49, 50, 116, 117, + 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 1, 9, 10, 1, 57, 116, 117, 118, 119, + 120, 121, 122, 129, 130, 131, 8, 31, 1, 71, + 72, 73, 74, 75, 76, 77, 134, 135, 80, 82, + 1, 31, 85, 8, 30, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 1, 128, 129, 130, 131, + 132, 133, 82, 80, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 8, 147, 148, 8, 8, 150, 151, + 152, 8, 154, 31, 2, 3, 4, 5, 6, 7, + 162, 9, 10, 11, 12, 13, 8, 117, 118, 160, + 116, 162, 122, 9, 10, 11, 97, 159, 128, 8, + 117, 118, 9, 10, 11, 122, 1, 137, 31, 37, + 38, 128, 138, 8, 30, 159, 32, 33, 34, 35, + 36, 37, 38, 30, 9, 32, 33, 34, 158, 57, + 80, 161, 9, 10, 11, 161, 163, 167, 14, 97, + 167, 106, 107, 71, 72, 73, 74, 75, 76, 77, + 163, 116, 80, 30, 167, 32, 33, 34, 35, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 8, + 128, 129, 130, 131, 132, 133, 156, 163, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 162, 9, 10, + 11, 162, 150, 151, 152, 162, 154, 2, 3, 4, + 5, 6, 7, 14, 9, 10, 11, 12, 13, 30, + 163, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 160, 57, 162, 9, 10, + 11, 9, 10, 11, 8, 159, 14, 8, 69, 163, + 1, 101, 57, 9, 10, 11, 162, 8, 116, 30, + 1, 32, 33, 34, 35, 36, 71, 72, 73, 74, + 75, 76, 77, 123, 30, 80, 32, 33, 70, 80, + 138, 8, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 116, 128, 129, 130, 131, 132, 133, 37, + 38, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 14, 116, 134, 135, 138, 150, 151, 152, 2, 3, + 4, 5, 6, 7, 155, 156, 157, 149, 12, 13, + 101, 15, 137, 164, 1, 106, 85, 108, 30, 161, + 8, 163, 113, 49, 50, 116, 117, 118, 119, 120, + 121, 122, 123, 51, 52, 53, 54, 55, 1, 57, + 106, 107, 1, 106, 31, 108, 8, 51, 52, 8, + 116, 69, 56, 8, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 70, 70, 71, 72, 73, + 74, 116, 8, 164, 78, 79, 80, 146, 82, 106, + 8, 108, 86, 87, 88, 89, 122, 91, 122, 93, + 1, 95, 158, 138, 98, 99, 1, 84, 8, 103, + 104, 105, 106, 107, 116, 109, 110, 119, 120, 121, + 122, 115, 116, 106, 80, 108, 161, 8, 122, 82, + 124, 125, 126, 8, 1, 161, 138, 161, 155, 134, + 135, 14, 136, 137, 8, 139, 140, 141, 142, 143, + 144, 145, 51, 52, 149, 70, 1, 151, 152, 161, + 116, 155, 156, 157, 158, 8, 161, 161, 163, 75, + 76, 165, 166, 167, 75, 76, 77, 1, 52, 75, + 76, 137, 159, 84, 137, 30, 163, 82, 14, 90, + 80, 92, 106, 94, 108, 96, 101, 102, 14, 155, + 156, 157, 9, 10, 11, 106, 80, 31, 161, 83, + 14, 160, 14, 162, 167, 82, 117, 118, 16, 134, + 135, 122, 1, 30, 106, 107, 127, 128, 129, 130, + 131, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 37, 38, 16, 163, 16, + 117, 118, 31, 37, 38, 122, 106, 107, 159, 116, + 84, 128, 163, 164, 111, 112, 156, 16, 163, 16, + 137, 116, 167, 163, 59, 60, 70, 16, 16, 16, + 16, 138, 74, 16, 16, 70, 70, 16, 80, 1, + 16, 158, 1, 138, 161, 87, 88, 89, 82, 91, + 167, 93, 86, 95, 161, 84, 98, 31, 31, 31, + 31, 103, 104, 105, 0, 1, 161, 109, 110, 31, + 31, 31, 31, 115, 116, 31, 31, 31, 31, 31, + 37, 30, 124, 31, 31, 159, 37, 38, 122, 163, + 134, 135, 70, 31, 31, 35, 31, 31, 31, 134, + 135, 31, 136, 137, 1, 139, 140, 141, 142, 143, + 144, 31, 154, 31, 149, 37, 37, 151, 152, 163, + 35, 35, 84, 74, 35, 84, 35, 161, 163, 80, + 159, 80, 166, 167, 163, 35, 87, 88, 89, 35, + 91, 57, 93, 37, 95, 38, 69, 98, 84, 77, + 82, 70, 103, 104, 105, 80, 134, 135, 109, 110, + 70, 85, 31, 80, 115, 116, 92, 116, 97, 82, + 106, 149, 108, 124, 113, 83, 146, 113, 90, 137, + 146, 117, 118, 89, 128, 163, 122, 84, 137, 138, + 94, 127, 128, 129, 130, 131, 31, 159, 96, 100, + 159, 163, 97, 149, 163, 74, 155, 156, 157, 97, + 100, 80, 161, 154, 150, 134, 135, 159, 87, 88, + 89, 164, 91, 159, 93, 114, 95, 163, 164, 98, + 149, 133, 159, 132, 103, 104, 105, -1, -1, 74, + 109, 110, 1, -1, 163, 80, 115, 116, 132, -1, + 153, 158, 87, 88, 89, 124, 91, 149, 93, 164, + 95, -1, 159, 98, 149, -1, 163, 149, 103, 104, + 105, 74, 149, 153, 109, 110, 155, 80, 159, 162, + 115, 116, 1, 159, 87, 88, 89, 159, 91, 124, + 93, 159, 95, 159, 159, 98, 70, 159, 159, 102, + 103, 104, 105, 74, 159, 159, 109, 110, 159, 80, + 81, 159, 115, 116, 159, 159, 87, 88, 89, 159, + 91, 124, 93, 159, 95, 84, 159, 98, 160, 160, + 160, 160, 103, 104, 105, 160, 160, 163, 109, 110, + 161, 100, 101, 102, 115, 116, 161, 106, 161, 161, + 70, 71, 161, 124, 161, 161, 161, 161, 117, 118, + 134, 135, 82, 122, 161, 84, 86, 161, 127, 128, + 129, 130, 131, 161, 161, 149, 161, 161, 161, 161, + 161, 100, 101, 102, 161, 161, 161, 106, 161, 163, + 162, 161, 161, 161, 161, 161, 161, 161, 117, 118, + 159, 161, 122, 122, 163, 164, 161, 161, 127, 128, + 129, 130, 131, 161, 161, 161, 161, 137, 70, 139, + 140, 141, 142, 143, 144, 161, 161, 161, 165, 162, + 82, 151, 152, 162, 86, 162, 74, 162, 162, 162, + 159, 161, 80, 164, 163, 164, 166, 167, 162, 87, + 88, 89, 162, 91, 162, 93, 162, 95, 162, 162, + 98, 162, 162, 162, 162, 103, 104, 105, 162, 162, + 122, 109, 110, 162, 162, 162, 162, 115, 116, 162, + 162, 162, 162, 162, 162, 137, 124, 139, 140, 141, + 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, + 152, 162, 162, 162, 162, 162, 162, 162, 162, 161, + 163, 162, -1, 163, 166, 167, 163, 163, 163, 163, + 163, 163, 163, 163, 163, -1, 163, -1, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, -1, -1, 166, -1, 167 + ); + + protected array $actionBase = array( + 0, -2, 152, 549, 764, 941, 981, 751, 555, 309, + 560, 864, 626, 738, 738, 741, 738, 473, 671, 783, + -60, 305, 305, 783, 305, 803, 803, 803, 658, 658, + 658, 658, 749, 749, 897, 897, 929, 865, 831, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 18, 36, 79, 648, 1036, 1044, + 1040, 1045, 1034, 1033, 1039, 1041, 1046, 1083, 1084, 782, + 1085, 1086, 1082, 1087, 1042, 876, 1035, 1043, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 195, 342, 43, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 643, 643, + 643, 666, 666, 354, 173, 980, 203, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 665, 339, 164, 164, + 7, 7, 7, 7, 7, 50, 369, 583, -23, -23, + -23, -23, 448, 605, 497, 260, 397, 434, 54, 394, + 593, 593, 316, 316, 415, 415, 316, 316, 316, 442, + 442, 252, 252, 252, 252, 318, 455, 433, 391, 742, + 53, 53, 53, 53, 742, 742, 742, 742, 734, 1088, + 742, 742, 742, 722, 781, 781, 926, 551, 551, 781, + 536, -3, -3, 536, 63, -3, 67, 576, 335, 756, + 115, 9, 335, 535, 656, 501, 185, 821, 568, 821, + 1032, 424, 776, 776, 426, 753, 729, 867, 1063, 1049, + 799, 1080, 810, 1081, -66, -58, 728, 1031, 1031, 1031, + 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1089, 402, + 1032, 130, 1089, 1089, 1089, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 603, 130, 544, 554, 130, + 804, 402, 18, 808, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 762, 157, 18, 36, 124, 124, + 196, 37, 124, 124, 124, 124, 18, 18, 18, 18, + 568, 784, 797, 600, 820, 143, 784, 784, 784, 122, + 135, 204, 139, 760, 785, 467, 775, 775, 787, 895, + 895, 775, 768, 775, 787, 913, 775, 775, 895, 895, + 793, 158, 550, 472, 524, 569, 895, 346, 775, 775, + 775, 775, 816, 575, 775, 271, 171, 775, 775, 816, + 801, 766, 58, 798, 895, 895, 895, 816, 505, 798, + 798, 798, 819, 824, 761, 765, 383, 349, 607, 138, + 807, 765, 765, 775, 532, 761, 765, 761, 765, 759, + 765, 765, 765, 761, 765, 768, 498, 765, 714, 586, + 75, 765, 6, 915, 916, 726, 917, 906, 918, 965, + 919, 923, 1053, 894, 931, 912, 924, 966, 903, 896, + 780, 701, 703, 815, 754, 893, 777, 777, 777, 888, + 777, 777, 777, 777, 777, 777, 777, 777, 701, 868, + 823, 794, 934, 711, 712, 1011, 730, 795, 963, 933, + 1013, 925, 758, 713, 977, 935, 757, 1047, 936, 940, + 986, 1014, 828, 1017, 979, 790, 1064, 1065, 869, 946, + 1054, 777, 915, 923, 727, 912, 924, 903, 896, 752, + 748, 746, 747, 745, 744, 739, 740, 763, 1018, 887, + 879, 870, 945, 891, 701, 871, 971, 874, 990, 992, + 1050, 805, 792, 875, 1066, 952, 953, 954, 1055, 1019, + 1056, 773, 973, 817, 994, 812, 1067, 996, 997, 999, + 1000, 1057, 1068, 1058, 885, 1059, 832, 788, 928, 802, + 1069, 299, 791, 800, 806, 964, 436, 932, 1060, 1070, + 1071, 1001, 1002, 1006, 1072, 1073, 927, 834, 975, 796, + 976, 967, 835, 838, 577, 779, 1020, 786, 789, 778, + 624, 634, 1074, 1075, 1076, 930, 767, 772, 839, 845, + 1021, 743, 1022, 1077, 646, 846, 717, 1078, 1012, 718, + 721, 652, 683, 681, 724, 774, 1061, 818, 811, 771, + 955, 721, 770, 849, 1079, 852, 855, 856, 1007, 860, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 456, 456, 456, 456, 456, 456, 305, 305, 305, 305, + 305, 456, 456, 456, 456, 456, 456, 456, 305, 305, + 0, 0, 305, 0, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 494, 494, 289, 289, 494, 289, 494, 494, 494, 494, + 494, 494, 494, 494, 494, 0, 289, 289, 289, 289, + 289, 289, 289, 289, 494, 793, 494, 442, 442, 442, + 442, 494, 494, 494, -88, -88, 442, 494, 63, 494, + 494, 494, 494, 494, 494, 494, 494, 494, 0, 0, + 494, 494, 494, 494, 0, 0, 130, -3, 494, 768, + 768, 768, 768, 494, 494, 494, 494, -3, -3, 494, + 494, 494, 0, 0, 0, 0, 442, 442, 0, 130, + 0, 0, 130, 0, 0, 768, 768, 494, 63, 793, + 359, 494, 0, 0, 0, 0, 130, 768, 130, 402, + 775, -3, -3, 775, 402, 402, 124, 18, 359, 545, + 545, 545, 545, 0, 0, 568, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 768, 0, 793, + 0, 768, 768, 768, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 768, + 0, 0, 895, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, + 768, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 777, 805, 0, 805, 0, 777, 777, 777, 0, 0, + 0, 0, 779, 743 + ); + + protected array $actionDefault = array( + 3,32767, 102,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 100,32767,32767,32767,32767, 597, 597, + 597, 597,32767,32767, 254, 102,32767,32767, 470, 387, + 387, 387,32767,32767, 541, 541, 541, 541, 541, 541, + 32767,32767,32767,32767,32767,32767, 470,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 100, + 32767,32767,32767, 36, 7, 8, 10, 11, 49, 17, + 324,32767,32767,32767,32767, 102,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 590,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 474, 453, + 454, 456, 457, 386, 542, 596, 327, 593, 385, 145, + 339, 329, 242, 330, 258, 475, 259, 476, 479, 480, + 215, 287, 382, 149, 150, 417, 471, 419, 469, 473, + 418, 392, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 390, 391, 472, 450, 449, + 448,32767,32767, 415, 416,32767, 420,32767,32767,32767, + 32767,32767,32767,32767, 102,32767, 389, 423, 421, 422, + 439, 440, 437, 438, 441,32767,32767,32767, 442, 443, + 444, 445, 316,32767,32767, 366, 364, 424, 316, 111, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 430, + 431,32767,32767,32767,32767, 535, 447,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 102,32767, 100, 537, 412, 414, 504, 425, 426, 393, + 32767, 511,32767, 102,32767, 513,32767,32767,32767,32767, + 32767,32767,32767, 536,32767, 543, 543,32767, 497, 100, + 195,32767,32767, 512,32767, 195, 195,32767,32767,32767, + 32767,32767,32767,32767,32767, 604, 497, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110,32767, 195, + 110,32767,32767,32767, 100, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 190,32767, 268, 270, 102, + 558, 195,32767, 516,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 509,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 497, 435, 138,32767, 138, 543, 427, 428, 429, 499, + 543, 543, 543, 312, 289,32767,32767,32767,32767, 514, + 514, 100, 100, 100, 100, 509,32767,32767,32767,32767, + 111, 99, 99, 99, 99, 99, 103, 101,32767,32767, + 32767,32767, 223, 99,32767, 101, 101,32767,32767, 223, + 225, 212, 101, 227,32767, 562, 563, 223, 101, 227, + 227, 227, 247, 247, 486, 318, 101, 99, 101, 101, + 197, 318, 318,32767, 101, 486, 318, 486, 318, 199, + 318, 318, 318, 486, 318,32767, 101, 318, 214, 99, + 99, 318,32767,32767,32767, 499,32767,32767,32767,32767, + 32767,32767,32767, 222,32767,32767,32767,32767,32767,32767, + 32767,32767, 530,32767, 547, 560, 433, 434, 436, 545, + 458, 459, 460, 461, 462, 463, 464, 466, 592,32767, + 503,32767,32767,32767, 338,32767, 602,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 603,32767, 543,32767,32767,32767, + 32767, 432, 9, 74, 492, 42, 43, 51, 57, 520, + 521, 522, 523, 517, 518, 524, 519,32767,32767, 525, + 568,32767,32767, 544, 595,32767,32767,32767,32767,32767, + 32767, 138,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 530,32767, 136,32767,32767,32767,32767, + 32767,32767,32767,32767, 526,32767,32767,32767, 543,32767, + 32767,32767,32767, 314, 311,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767, 543,32767,32767,32767,32767,32767, 291,32767, 308, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 286,32767,32767, 381, + 499, 294, 296, 297,32767,32767,32767,32767, 360,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 152, 152, 3, 3, 341, 152, 152, 152, 341, 341, + 152, 341, 341, 341, 152, 152, 152, 152, 152, 152, + 280, 185, 262, 265, 247, 247, 152, 352, 152 + ); + + protected array $goto = array( + 196, 196, 1034, 1065, 697, 431, 661, 621, 658, 319, + 706, 425, 314, 315, 335, 576, 430, 336, 432, 638, + 654, 655, 852, 672, 673, 674, 853, 167, 167, 167, + 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, + 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, + 189, 190, 191, 192, 218, 216, 219, 536, 537, 421, + 538, 540, 541, 542, 543, 544, 545, 546, 547, 1136, + 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, + 176, 178, 215, 217, 220, 238, 243, 244, 246, 257, + 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, + 271, 277, 289, 290, 317, 318, 426, 427, 428, 581, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, + 200, 239, 188, 189, 190, 191, 192, 218, 1136, 201, + 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, + 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, + 212, 213, 214, 855, 1232, 975, 279, 279, 279, 279, + 623, 623, 419, 351, 1269, 600, 1269, 1269, 1269, 1269, + 1269, 1269, 1269, 1269, 1269, 1287, 1287, 599, 1100, 1287, + 709, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 508, 700, 827, 1098, 458, 559, 552, 860, 833, 909, + 904, 905, 918, 861, 906, 858, 907, 908, 859, 1233, + 1234, 912, 500, 886, 501, 252, 252, 843, 1107, 1108, + 507, 1087, 1082, 1083, 1084, 341, 552, 559, 568, 569, + 344, 579, 602, 616, 617, 1235, 1295, 1296, 833, 440, + 833, 22, 250, 250, 250, 250, 245, 253, 694, 573, + 1237, 829, 1237, 893, 851, 893, 893, 1034, 1034, 1237, + 694, 349, 342, 1034, 694, 1034, 1034, 1034, 1034, 1034, + 1034, 1034, 1034, 1034, 848, 1327, 1034, 1034, 1034, 1034, + 1319, 1319, 1319, 1319, 1237, 343, 342, 1040, 1039, 1237, + 1237, 1237, 1237, 868, 996, 1237, 1237, 1237, 913, 355, + 914, 354, 354, 354, 354, 466, 466, 479, 880, 355, + 355, 867, 394, 926, 466, 481, 571, 927, 967, 410, + 705, 942, 355, 355, 942, 848, 355, 660, 1354, 609, + 624, 627, 628, 629, 630, 651, 652, 653, 708, 554, + 1133, 1285, 1285, 355, 355, 1285, 1058, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 539, 539, 1185, 424, + 539, 611, 539, 539, 539, 539, 539, 539, 539, 539, + 539, 566, 682, 1337, 1337, 733, 637, 639, 1043, 1044, + 659, 476, 1312, 1313, 683, 687, 1010, 695, 704, 1006, + 1337, 1298, 438, 408, 409, 631, 633, 635, 670, 5, + 671, 6, 412, 413, 414, 337, 684, 1340, 1340, 415, + 325, 309, 686, 347, 352, 353, 553, 563, 450, 450, + 450, 553, 1309, 563, 1309, 666, 397, 462, 845, 1314, + 1315, 1309, 548, 548, 548, 548, 873, 604, 469, 580, + 470, 471, 403, 554, 878, 848, 958, 1345, 1346, 577, + 614, 870, 550, 615, 550, 255, 255, 1321, 1321, 1321, + 1321, 550, 999, 1018, 477, 971, 1228, 732, 736, 881, + 869, 1070, 1074, 876, 882, 551, 1008, 1003, 1071, 1075, + 978, 980, 0, 1305, 1118, 0, 456, 0, 0, 0, + 0, 969, 969, 969, 969, 0, 0, 456, 963, 970, + 0, 0, 0, 0, 968, 0, 1230, 0, 0, 0, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 931, 1123, 450, 0, 1073, 1116, 885, 619, 1307, + 1307, 1073, 1216, 944, 1015, 433, 1217, 1220, 945, 1221, + 0, 433, 872, 0, 664, 994, 0, 1041, 1041, 0, + 866, 0, 0, 0, 665, 1052, 1048, 1049, 0, 0, + 0, 0, 1227, 324, 275, 324, 1037, 1037, 681, 952, + 0, 0, 1029, 1045, 1046, 396, 399, 560, 601, 605, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1013, 1013 + ); + + protected array $gotoCheck = array( + 42, 42, 73, 127, 73, 66, 66, 56, 56, 66, + 9, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 86, 86, 26, 86, 86, 86, 27, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 15, 20, 49, 23, 23, 23, 23, + 108, 108, 43, 97, 108, 130, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 170, 170, 8, 8, 170, + 8, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 8, 8, 6, 8, 83, 76, 76, 15, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 20, + 20, 15, 155, 45, 155, 5, 5, 20, 144, 144, + 155, 15, 15, 15, 15, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 20, 20, 20, 12, 83, + 12, 76, 5, 5, 5, 5, 5, 5, 7, 172, + 73, 7, 73, 25, 25, 25, 25, 73, 73, 73, + 7, 179, 168, 73, 7, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 22, 181, 73, 73, 73, 73, + 9, 9, 9, 9, 73, 168, 168, 118, 118, 73, + 73, 73, 73, 35, 103, 73, 73, 73, 65, 14, + 65, 24, 24, 24, 24, 149, 149, 84, 35, 14, + 14, 35, 62, 73, 149, 84, 104, 73, 93, 93, + 93, 9, 14, 14, 9, 22, 14, 64, 14, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 14, + 150, 171, 171, 14, 14, 171, 114, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 173, 173, 151, 13, + 173, 13, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 48, 116, 182, 182, 48, 48, 48, 119, 119, + 48, 176, 176, 176, 48, 48, 48, 48, 48, 48, + 182, 14, 113, 82, 82, 85, 85, 85, 82, 46, + 82, 46, 82, 82, 82, 29, 82, 182, 182, 82, + 169, 169, 14, 82, 97, 97, 9, 9, 23, 23, + 23, 9, 130, 9, 130, 120, 9, 9, 18, 178, + 178, 130, 107, 107, 107, 107, 39, 107, 9, 9, + 9, 9, 28, 14, 9, 22, 92, 9, 9, 2, + 2, 37, 19, 80, 19, 5, 5, 130, 130, 130, + 130, 19, 50, 110, 157, 50, 160, 50, 99, 16, + 16, 16, 16, 9, 41, 50, 50, 50, 129, 132, + 16, 96, -1, 130, 147, -1, 19, -1, -1, -1, + -1, 19, 19, 19, 19, -1, -1, 19, 19, 19, + -1, -1, -1, -1, 16, -1, 14, -1, -1, -1, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 17, 17, 23, -1, 130, 16, 16, 17, 130, + 130, 130, 79, 79, 17, 117, 79, 79, 79, 79, + -1, 117, 17, -1, 17, 17, -1, 117, 117, -1, + 17, -1, -1, -1, 117, 117, 117, 117, -1, -1, + -1, -1, 17, 24, 24, 24, 89, 89, 89, 89, + -1, -1, 89, 89, 89, 59, 59, 59, 59, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 107, 107 + ); + + protected array $gotoBase = array( + 0, 0, -253, 0, 0, 224, 182, 251, 179, -10, + 0, 0, -89, 32, 11, -185, 27, 66, 128, 197, + -229, 0, 5, 163, 308, 260, 18, 22, 115, 118, + 0, 0, 0, 0, 0, -68, 0, 122, 0, 123, + 0, 43, -1, 153, 0, 200, -327, 0, -330, 147, + 460, 0, 0, 0, 0, 0, -33, 0, 0, 540, + 0, 0, 280, 0, 95, 294, -236, 0, 0, 0, + 0, 0, 0, -5, 0, 0, -140, 0, 0, 134, + 119, -19, -88, -75, -152, -74, -698, 0, 0, 296, + 0, 0, 127, 23, 0, 0, 48, -310, 0, 71, + 0, 0, 0, 269, 283, 0, 0, 414, -71, 0, + 103, 0, 0, 124, 83, 0, 100, 273, 17, 104, + 144, 0, 0, 0, 0, 0, 0, 1, 0, 114, + 167, 0, 47, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -47, 0, 0, 50, 0, 281, + 105, 94, 0, 0, 0, -273, 0, 34, 0, 0, + 107, 0, 0, 0, 0, 0, 0, 0, -26, 99, + -56, 110, 230, 125, 0, 0, 90, 0, 67, 241, + 0, 254, 75, 0, 0 + ); + + protected array $gotoDefault = array( + -32768, 512, 740, 4, 741, 935, 816, 825, 597, 530, + 707, 348, 625, 422, 1303, 911, 1122, 578, 844, 1246, + 1254, 457, 847, 330, 730, 923, 894, 895, 400, 386, + 392, 398, 649, 626, 494, 879, 453, 871, 486, 874, + 452, 883, 164, 418, 510, 887, 3, 890, 557, 921, + 973, 387, 898, 388, 677, 900, 562, 902, 903, 395, + 401, 402, 1127, 570, 622, 915, 256, 564, 916, 385, + 917, 925, 390, 393, 688, 465, 505, 499, 411, 1102, + 565, 608, 646, 447, 473, 620, 632, 618, 480, 434, + 416, 329, 957, 965, 487, 463, 979, 350, 987, 738, + 1135, 640, 489, 995, 641, 1002, 1005, 531, 532, 478, + 1017, 272, 1020, 490, 19, 667, 1031, 1032, 668, 642, + 1054, 643, 669, 644, 1056, 472, 598, 1064, 454, 1072, + 1291, 455, 1076, 266, 1079, 278, 417, 435, 1085, 1086, + 9, 1092, 698, 699, 11, 276, 509, 1117, 689, 451, + 1134, 439, 1204, 1206, 558, 491, 1224, 1223, 680, 506, + 1229, 448, 1294, 449, 533, 474, 316, 534, 1338, 308, + 333, 313, 549, 295, 334, 535, 475, 1300, 1308, 331, + 31, 1328, 1339, 575, 613 + ); + + protected array $ruleToNonTerminal = array( + 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, + 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, + 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, + 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, + 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, + 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, + 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 25, 25, 50, 69, 69, 72, 72, 71, + 70, 70, 63, 75, 75, 76, 76, 77, 77, 78, + 78, 79, 79, 80, 80, 26, 26, 27, 27, 27, + 27, 27, 88, 88, 90, 90, 83, 83, 91, 91, + 92, 92, 92, 84, 84, 87, 87, 85, 85, 93, + 94, 94, 57, 57, 65, 65, 68, 68, 68, 67, + 95, 95, 96, 58, 58, 58, 58, 97, 97, 98, + 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, + 55, 55, 51, 51, 105, 53, 53, 106, 52, 52, + 54, 54, 64, 64, 64, 64, 81, 81, 109, 109, + 111, 111, 112, 112, 112, 112, 110, 110, 110, 114, + 114, 114, 114, 89, 89, 117, 117, 117, 118, 118, + 115, 115, 119, 119, 121, 121, 122, 122, 116, 123, + 123, 120, 124, 124, 124, 124, 113, 113, 82, 82, + 82, 20, 20, 20, 126, 125, 125, 127, 127, 127, + 127, 60, 128, 128, 129, 61, 131, 131, 132, 132, + 133, 133, 86, 134, 134, 134, 134, 134, 134, 134, + 139, 139, 140, 140, 141, 141, 141, 141, 141, 142, + 143, 143, 138, 138, 135, 135, 137, 137, 145, 145, + 144, 144, 144, 144, 144, 144, 144, 136, 146, 146, + 148, 147, 147, 62, 104, 149, 149, 56, 56, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 156, 150, 150, 155, 155, 158, 159, + 159, 160, 161, 162, 162, 162, 162, 19, 19, 73, + 73, 73, 73, 151, 151, 151, 151, 164, 164, 152, + 152, 154, 154, 154, 157, 157, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 171, 171, 171, 108, 173, + 173, 173, 173, 153, 153, 153, 153, 153, 153, 153, + 153, 59, 59, 167, 167, 167, 167, 174, 174, 163, + 163, 163, 175, 175, 175, 175, 175, 175, 74, 74, + 66, 66, 66, 66, 130, 130, 130, 130, 178, 177, + 166, 166, 166, 166, 166, 166, 166, 165, 165, 165, + 176, 176, 176, 176, 107, 172, 180, 180, 179, 179, + 181, 181, 181, 181, 181, 181, 181, 181, 169, 169, + 169, 169, 168, 183, 182, 182, 182, 182, 182, 182, + 182, 182, 184, 184, 184, 184 + ); + + protected array $ruleToLength = array( + 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, + 0, 1, 1, 1, 1, 4, 3, 5, 4, 3, + 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, + 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, + 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, + 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, + 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, + 2, 1, 1, 1, 1, 0, 2, 1, 3, 8, + 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, + 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, + 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, + 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, + 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, + 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, + 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, + 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, + 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, + 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, + 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, + 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, + 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, + 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, + 3, 3, 3, 4, 4, 1, 1, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, + 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, + 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, + 3, 2, 1, 2, 2, 2, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 1, 1, 0, + 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 5, 3, 3, 4, + 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, + 3, 0, 1, 1, 3, 1, 1, 1, 1, 1, + 3, 1, 1, 4, 4, 1, 4, 4, 0, 1, + 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, + 1, 4, 4, 3, 3, 3, 3, 1, 3, 1, + 1, 3, 1, 1, 4, 1, 1, 1, 3, 1, + 1, 2, 1, 3, 4, 3, 2, 0, 2, 2, + 1, 2, 1, 1, 1, 4, 3, 3, 3, 3, + 6, 3, 1, 1, 2, 1 + ); + + protected function initReduceCallbacks(): void { + $this->reduceCallbacks = [ + 0 => null, + 1 => function ($stackPos) { + $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); + }, + 2 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; + }, + 3 => function ($stackPos) { + $this->semValue = array(); + }, + 4 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 5 => null, + 6 => null, + 7 => null, + 8 => null, + 9 => null, + 10 => null, + 11 => null, + 12 => null, + 13 => null, + 14 => null, + 15 => null, + 16 => null, + 17 => null, + 18 => null, + 19 => null, + 20 => null, + 21 => null, + 22 => null, + 23 => null, + 24 => null, + 25 => null, + 26 => null, + 27 => null, + 28 => null, + 29 => null, + 30 => null, + 31 => null, + 32 => null, + 33 => null, + 34 => null, + 35 => null, + 36 => null, + 37 => null, + 38 => null, + 39 => null, + 40 => null, + 41 => null, + 42 => null, + 43 => null, + 44 => null, + 45 => null, + 46 => null, + 47 => null, + 48 => null, + 49 => null, + 50 => null, + 51 => null, + 52 => null, + 53 => null, + 54 => null, + 55 => null, + 56 => null, + 57 => null, + 58 => null, + 59 => null, + 60 => null, + 61 => null, + 62 => null, + 63 => null, + 64 => null, + 65 => null, + 66 => null, + 67 => null, + 68 => null, + 69 => null, + 70 => null, + 71 => null, + 72 => null, + 73 => null, + 74 => null, + 75 => null, + 76 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; if ($this->semValue === "emitError(new Error('Cannot use "getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); + }, + 77 => null, + 78 => null, + 79 => null, + 80 => null, + 81 => null, + 82 => null, + 83 => null, + 84 => null, + 85 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 86 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 87 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 88 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 89 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 90 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 91 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 92 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 93 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 94 => null, + 95 => function ($stackPos) { + $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 96 => function ($stackPos) { + $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 97 => function ($stackPos) { + /* nothing */ + }, + 98 => function ($stackPos) { + /* nothing */ + }, + 99 => function ($stackPos) { + /* nothing */ + }, + 100 => function ($stackPos) { + $this->emitError(new Error('A trailing comma is not allowed here', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); + }, + 101 => null, + 102 => null, + 103 => function ($stackPos) { + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 104 => function ($stackPos) { + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 105 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 106 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 107 => function ($stackPos) { + $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 108 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 109 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 110 => function ($stackPos) { + $this->semValue = []; + }, + 111 => null, + 112 => null, + 113 => null, + 114 => null, + 115 => function ($stackPos) { + $this->semValue = new Stmt\HaltCompiler($this->handleHaltCompiler(), $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 116 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); + $this->checkNamespace($this->semValue); + }, + 117 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $this->checkNamespace($this->semValue); + }, + 118 => function ($stackPos) { + $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $this->checkNamespace($this->semValue); + }, + 119 => function ($stackPos) { + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 120 => function ($stackPos) { + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 121 => null, + 122 => function ($stackPos) { + $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 123 => function ($stackPos) { + $this->semValue = Stmt\Use_::TYPE_FUNCTION; + }, + 124 => function ($stackPos) { + $this->semValue = Stmt\Use_::TYPE_CONSTANT; + }, + 125 => function ($stackPos) { + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 126 => function ($stackPos) { + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 127 => null, + 128 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 129 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 130 => null, + 131 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 132 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 133 => null, + 134 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 135 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 136 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + }, + 137 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + }, + 138 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + }, + 139 => function ($stackPos) { + $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + }, + 140 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; + }, + 141 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; + }, + 142 => null, + 143 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 144 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 145 => function ($stackPos) { + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 146 => null, + 147 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 148 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 149 => function ($stackPos) { + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 150 => function ($stackPos) { + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 151 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; + }, + 152 => function ($stackPos) { + $this->semValue = array(); + }, + 153 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 154 => null, + 155 => null, + 156 => null, + 157 => function ($stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 158 => function ($stackPos) { + $this->semValue = new Stmt\Block($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 159 => function ($stackPos) { + $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => $this->semStack[$stackPos-(7-5)], 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 160 => function ($stackPos) { + $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 161 => function ($stackPos) { + $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 162 => function ($stackPos) { + $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 163 => function ($stackPos) { + $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 164 => function ($stackPos) { + $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 165 => function ($stackPos) { + $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 166 => function ($stackPos) { + $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 167 => function ($stackPos) { + $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 168 => function ($stackPos) { + $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 169 => function ($stackPos) { + $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 170 => function ($stackPos) { + $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 171 => function ($stackPos) { + + $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + $this->semValue->setAttribute('hasLeadingNewline', $this->inlineHtmlHasLeadingNewline($stackPos-(1-1))); + + }, + 172 => function ($stackPos) { + $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 173 => function ($stackPos) { + $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 174 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 175 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 176 => function ($stackPos) { + $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-4)], $this->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 177 => function ($stackPos) { + $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 178 => function ($stackPos) { + $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->checkTryCatch($this->semValue); + }, + 179 => function ($stackPos) { + $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 180 => function ($stackPos) { + $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 181 => function ($stackPos) { + $this->semValue = null; /* means: no statement */ + }, + 182 => null, + 183 => function ($stackPos) { + $this->semValue = $this->maybeCreateNop($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); + }, + 184 => function ($stackPos) { + if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; + }, + 185 => function ($stackPos) { + $this->semValue = array(); + }, + 186 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 187 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 188 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 189 => function ($stackPos) { + $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 190 => function ($stackPos) { + $this->semValue = null; + }, + 191 => function ($stackPos) { + $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 192 => null, + 193 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 194 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 195 => function ($stackPos) { + $this->semValue = false; + }, + 196 => function ($stackPos) { + $this->semValue = true; + }, + 197 => function ($stackPos) { + $this->semValue = false; + }, + 198 => function ($stackPos) { + $this->semValue = true; + }, + 199 => function ($stackPos) { + $this->semValue = false; + }, + 200 => function ($stackPos) { + $this->semValue = true; + }, + 201 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 202 => function ($stackPos) { + $this->semValue = []; + }, + 203 => null, + 204 => function ($stackPos) { + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 205 => function ($stackPos) { + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 206 => function ($stackPos) { + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 207 => function ($stackPos) { + $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + $this->checkClass($this->semValue, $stackPos-(7-2)); + }, + 208 => function ($stackPos) { + $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + $this->checkClass($this->semValue, $stackPos-(8-3)); + }, + 209 => function ($stackPos) { + $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + $this->checkInterface($this->semValue, $stackPos-(7-3)); + }, + 210 => function ($stackPos) { + $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 211 => function ($stackPos) { + $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + $this->checkEnum($this->semValue, $stackPos-(8-3)); + }, + 212 => function ($stackPos) { + $this->semValue = null; + }, + 213 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 214 => function ($stackPos) { + $this->semValue = null; + }, + 215 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 216 => function ($stackPos) { + $this->semValue = 0; + }, + 217 => null, + 218 => null, + 219 => function ($stackPos) { + $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 220 => function ($stackPos) { + $this->semValue = Modifiers::ABSTRACT; + }, + 221 => function ($stackPos) { + $this->semValue = Modifiers::FINAL; + }, + 222 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 223 => function ($stackPos) { + $this->semValue = null; + }, + 224 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 225 => function ($stackPos) { + $this->semValue = array(); + }, + 226 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 227 => function ($stackPos) { + $this->semValue = array(); + }, + 228 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 229 => null, + 230 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 231 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 232 => null, + 233 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 234 => null, + 235 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 236 => function ($stackPos) { + if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; + }, + 237 => function ($stackPos) { + $this->semValue = null; + }, + 238 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 239 => null, + 240 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 241 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 242 => function ($stackPos) { + $this->semValue = new Node\DeclareItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 243 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 244 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-3)]; + }, + 245 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 246 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(5-3)]; + }, + 247 => function ($stackPos) { + $this->semValue = array(); + }, + 248 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 249 => function ($stackPos) { + $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 250 => function ($stackPos) { + $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 251 => null, + 252 => null, + 253 => function ($stackPos) { + $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); + }, + 254 => function ($stackPos) { + $this->semValue = []; + }, + 255 => null, + 256 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 257 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 258 => function ($stackPos) { + $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 259 => function ($stackPos) { + $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 260 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 261 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 262 => function ($stackPos) { + $this->semValue = array(); + }, + 263 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 264 => function ($stackPos) { + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 265 => function ($stackPos) { + $this->semValue = array(); + }, + 266 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 267 => function ($stackPos) { + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); + }, + 268 => function ($stackPos) { + $this->semValue = null; + }, + 269 => function ($stackPos) { + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 270 => function ($stackPos) { + $this->semValue = null; + }, + 271 => function ($stackPos) { + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); + }, + 272 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + }, + 273 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + }, + 274 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + }, + 275 => function ($stackPos) { + $this->semValue = array($this->fixupArrayDestructuring($this->semStack[$stackPos-(1-1)]), false); + }, + 276 => null, + 277 => function ($stackPos) { + $this->semValue = array(); + }, + 278 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 279 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 280 => function ($stackPos) { + $this->semValue = 0; + }, + 281 => function ($stackPos) { + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 282 => function ($stackPos) { + $this->semValue = Modifiers::PUBLIC; + }, + 283 => function ($stackPos) { + $this->semValue = Modifiers::PROTECTED; + }, + 284 => function ($stackPos) { + $this->semValue = Modifiers::PRIVATE; + }, + 285 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 286 => function ($stackPos) { + $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + $this->checkParam($this->semValue); + }, + 287 => function ($stackPos) { + $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); + $this->checkParam($this->semValue); + }, + 288 => function ($stackPos) { + $this->semValue = new Node\Param(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + }, + 289 => null, + 290 => function ($stackPos) { + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 291 => function ($stackPos) { + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 292 => null, + 293 => null, + 294 => function ($stackPos) { + $this->semValue = new Node\Name('static', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 295 => function ($stackPos) { + $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); + }, + 296 => function ($stackPos) { + $this->semValue = new Node\Identifier('array', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 297 => function ($stackPos) { + $this->semValue = new Node\Identifier('callable', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 298 => null, + 299 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 300 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 301 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 302 => null, + 303 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 304 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 305 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 306 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 307 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 308 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 309 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 310 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 311 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 312 => null, + 313 => function ($stackPos) { + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 314 => function ($stackPos) { + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 315 => null, + 316 => function ($stackPos) { + $this->semValue = null; + }, + 317 => null, + 318 => function ($stackPos) { + $this->semValue = null; + }, + 319 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 320 => function ($stackPos) { + $this->semValue = null; + }, + 321 => function ($stackPos) { + $this->semValue = array(); + }, + 322 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 323 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-2)]); + }, + 324 => function ($stackPos) { + $this->semValue = new Node\VariadicPlaceholder($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 325 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 326 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 327 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 328 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 329 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 330 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(3-1)]); + }, + 331 => null, + 332 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 333 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 334 => null, + 335 => null, + 336 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 337 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 338 => function ($stackPos) { + $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 339 => function ($stackPos) { + $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 340 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } + }, + 341 => function ($stackPos) { + $this->semValue = array(); + }, + 342 => function ($stackPos) { + $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 343 => function ($stackPos) { + $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); + $this->checkProperty($this->semValue, $stackPos-(5-2)); + }, + 344 => function ($stackPos) { + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-1)]); + $this->checkClassConst($this->semValue, $stackPos-(5-2)); + }, + 345 => function ($stackPos) { + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); + $this->checkClassConst($this->semValue, $stackPos-(6-2)); + }, + 346 => function ($stackPos) { + $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + $this->checkClassMethod($this->semValue, $stackPos-(10-2)); + }, + 347 => function ($stackPos) { + $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 348 => function ($stackPos) { + $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 349 => function ($stackPos) { + $this->semValue = null; /* will be skipped */ + }, + 350 => function ($stackPos) { + $this->semValue = array(); + }, + 351 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 352 => function ($stackPos) { + $this->semValue = array(); + }, + 353 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 354 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 355 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 356 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 357 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 358 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 359 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 360 => null, + 361 => function ($stackPos) { + $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + }, + 362 => function ($stackPos) { + $this->semValue = null; + }, + 363 => null, + 364 => null, + 365 => function ($stackPos) { + $this->semValue = 0; + }, + 366 => function ($stackPos) { + $this->semValue = 0; + }, + 367 => null, + 368 => null, + 369 => function ($stackPos) { + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 370 => function ($stackPos) { + $this->semValue = Modifiers::PUBLIC; + }, + 371 => function ($stackPos) { + $this->semValue = Modifiers::PROTECTED; + }, + 372 => function ($stackPos) { + $this->semValue = Modifiers::PRIVATE; + }, + 373 => function ($stackPos) { + $this->semValue = Modifiers::STATIC; + }, + 374 => function ($stackPos) { + $this->semValue = Modifiers::ABSTRACT; + }, + 375 => function ($stackPos) { + $this->semValue = Modifiers::FINAL; + }, + 376 => function ($stackPos) { + $this->semValue = Modifiers::READONLY; + }, + 377 => null, + 378 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 379 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 380 => function ($stackPos) { + $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 381 => function ($stackPos) { + $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 382 => function ($stackPos) { + $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 383 => null, + 384 => null, + 385 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 386 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 387 => function ($stackPos) { + $this->semValue = array(); + }, + 388 => null, + 389 => null, + 390 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 391 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->fixupArrayDestructuring($this->semStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 392 => function ($stackPos) { + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 393 => function ($stackPos) { + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 394 => function ($stackPos) { + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + if (!$this->phpVersion->allowsAssignNewByReference()) { + $this->emitError(new Error('Cannot assign new by reference', $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]))); + } + + }, + 395 => null, + 396 => null, + 397 => function ($stackPos) { + $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 398 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 399 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 400 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 401 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 402 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 403 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 404 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 405 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 406 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 407 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 408 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 409 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 410 => function ($stackPos) { + $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 411 => function ($stackPos) { + $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 412 => function ($stackPos) { + $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 413 => function ($stackPos) { + $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 414 => function ($stackPos) { + $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 415 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 416 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 417 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 418 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 419 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 420 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 421 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 422 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 423 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 424 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 425 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 426 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 427 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 428 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 429 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 430 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 431 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 432 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 433 => function ($stackPos) { + $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 434 => function ($stackPos) { + $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 435 => function ($stackPos) { + $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 436 => function ($stackPos) { + $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 437 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 438 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 439 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 440 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 441 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 442 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 443 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 444 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 445 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 446 => function ($stackPos) { + $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 447 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 448 => function ($stackPos) { + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 449 => function ($stackPos) { + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 450 => function ($stackPos) { + $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 451 => function ($stackPos) { + $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 452 => function ($stackPos) { + $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 453 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 454 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 455 => function ($stackPos) { + $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 456 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 457 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 458 => function ($stackPos) { + $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 459 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); + $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); + $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); + }, + 460 => function ($stackPos) { + $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 461 => function ($stackPos) { + $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 462 => function ($stackPos) { + $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 463 => function ($stackPos) { + $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 464 => function ($stackPos) { + $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 465 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); + $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; + $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); + }, + 466 => function ($stackPos) { + $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 467 => null, + 468 => function ($stackPos) { + $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 469 => function ($stackPos) { + $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 470 => function ($stackPos) { + $this->semValue = new Expr\Yield_(null, null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 471 => function ($stackPos) { + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 472 => function ($stackPos) { + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 473 => function ($stackPos) { + $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 474 => function ($stackPos) { + $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 475 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 476 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 477 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); + }, + 478 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 479 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 480 => function ($stackPos) { + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 481 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); + }, + 482 => function ($stackPos) { + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); + }, + 483 => function ($stackPos) { + $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])), $this->semStack[$stackPos-(8-3)]); + $this->checkClass($this->semValue[0], -1); + }, + 484 => function ($stackPos) { + $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 485 => function ($stackPos) { + list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 486 => function ($stackPos) { + $this->semValue = array(); + }, + 487 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-3)]; + }, + 488 => null, + 489 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 490 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 491 => function ($stackPos) { + $this->semValue = new Node\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 492 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 493 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 494 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 495 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 496 => function ($stackPos) { + $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 497 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 498 => null, + 499 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 500 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 501 => function ($stackPos) { + $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 502 => function ($stackPos) { + $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 503 => null, + 504 => null, + 505 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 506 => function ($stackPos) { + $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 507 => null, + 508 => null, + 509 => function ($stackPos) { + $this->semValue = null; + }, + 510 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 511 => function ($stackPos) { + $this->semValue = array(); + }, + 512 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); foreach ($this->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; + }, + 513 => function ($stackPos) { + foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 514 => function ($stackPos) { + $this->semValue = array(); + }, + 515 => null, + 516 => function ($stackPos) { + $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 517 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Line($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 518 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\File($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 519 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Dir($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 520 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Class_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 521 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Trait_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 522 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Method($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 523 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Function_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 524 => function ($stackPos) { + $this->semValue = new Scalar\MagicConst\Namespace_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 525 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 526 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); + }, + 527 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)])), $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 528 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); + }, + 529 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); + $this->createdArrays->attach($this->semValue); + }, + 530 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->createdArrays->attach($this->semValue); + }, + 531 => function ($stackPos) { + $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->supportsUnicodeEscapes()); + }, + 532 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; + foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = new Scalar\InterpolatedString($this->semStack[$stackPos-(3-2)], $attrs); + }, + 533 => function ($stackPos) { + $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->allowsInvalidOctals()); + }, + 534 => function ($stackPos) { + $this->semValue = Scalar\Float_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 535 => null, + 536 => null, + 537 => null, + 538 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); + }, + 539 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(2-2)], $this->tokenEndStack[$stackPos-(2-2)]), true); + }, + 540 => function ($stackPos) { + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); + }, + 541 => function ($stackPos) { + $this->semValue = null; + }, + 542 => null, + 543 => null, + 544 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 545 => null, + 546 => null, + 547 => null, + 548 => null, + 549 => null, + 550 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 551 => null, + 552 => null, + 553 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 554 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 555 => null, + 556 => function ($stackPos) { + $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 557 => function ($stackPos) { + $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 558 => function ($stackPos) { + $this->semValue = null; + }, + 559 => null, + 560 => null, + 561 => null, + 562 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 563 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 564 => null, + 565 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 566 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 567 => function ($stackPos) { + $this->semValue = new Expr\Variable(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])), $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 568 => function ($stackPos) { + $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])) : $var; + }, + 569 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 570 => null, + 571 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 572 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 573 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 574 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 575 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 576 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 577 => null, + 578 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 579 => null, + 580 => null, + 581 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 582 => null, + 583 => function ($stackPos) { + $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; + }, + 584 => function ($stackPos) { + $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); $this->semValue->setAttribute('kind', Expr\List_::KIND_LIST); + $this->postprocessList($this->semValue); + }, + 585 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end]->value instanceof Expr\Error) array_pop($this->semValue); + }, + 586 => null, + 587 => function ($stackPos) { + /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ + }, + 588 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 589 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 590 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 591 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 592 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 593 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 594 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 595 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 596 => function ($stackPos) { + $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), true); + }, + 597 => function ($stackPos) { + /* Create an Error node now to remember the position. We'll later either report an error, + or convert this into a null element, depending on whether this is a creation or destructuring context. */ + $attrs = $this->createEmptyElemAttributes($this->tokenPos); + $this->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); + }, + 598 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 599 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 600 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 601 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); + }, + 602 => function ($stackPos) { + $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); $attrs['rawValue'] = $this->semStack[$stackPos-(1-1)]; $this->semValue = new Node\InterpolatedStringPart($this->semStack[$stackPos-(1-1)], $attrs); + }, + 603 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 604 => null, + 605 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); + }, + 606 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 607 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 608 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 609 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); + }, + 610 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); + }, + 611 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 612 => function ($stackPos) { + $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 613 => function ($stackPos) { + $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); + }, + 614 => function ($stackPos) { + $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); + }, + 615 => null, + ]; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php new file mode 100644 index 0000000..f0b1a50 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -0,0 +1,1241 @@ + Map of PHP token IDs to drop */ + protected array $dropTokens; + /** @var int[] Map of external symbols (static::T_*) to internal symbols */ + protected array $tokenToSymbol; + /** @var string[] Map of symbols to their names */ + protected array $symbolToName; + /** @var array Names of the production rules (only necessary for debugging) */ + protected array $productions; + + /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this + * state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the + * action is defaulted, i.e. $actionDefault[$state] should be used instead. */ + protected array $actionBase; + /** @var int[] Table of actions. Indexed according to $actionBase comment. */ + protected array $action; + /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol + * then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */ + protected array $actionCheck; + /** @var int[] Map of states to their default action */ + protected array $actionDefault; + /** @var callable[] Semantic action callbacks */ + protected array $reduceCallbacks; + + /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this + * non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */ + protected array $gotoBase; + /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */ + protected array $goto; + /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal + * then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */ + protected array $gotoCheck; + /** @var int[] Map of non-terminals to the default state to goto after their reduction */ + protected array $gotoDefault; + + /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for + * determining the state to goto after reduction. */ + protected array $ruleToNonTerminal; + /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to + * be popped from the stack(s) on reduction. */ + protected array $ruleToLength; + + /* + * The following members are part of the parser state: + */ + + /** @var mixed Temporary value containing the result of last semantic action (reduction) */ + protected $semValue; + /** @var mixed[] Semantic value stack (contains values of tokens and semantic action results) */ + protected array $semStack; + /** @var int[] Token start position stack */ + protected array $tokenStartStack; + /** @var int[] Token end position stack */ + protected array $tokenEndStack; + + /** @var ErrorHandler Error handler */ + protected ErrorHandler $errorHandler; + /** @var int Error state, used to avoid error floods */ + protected int $errorState; + + /** @var \SplObjectStorage|null Array nodes created during parsing, for postprocessing of empty elements. */ + protected ?\SplObjectStorage $createdArrays; + + /** @var Token[] Tokens for the current parse */ + protected array $tokens; + /** @var int Current position in token array */ + protected int $tokenPos; + + /** + * Initialize $reduceCallbacks map. + */ + abstract protected function initReduceCallbacks(): void; + + /** + * Creates a parser instance. + * + * Options: + * * phpVersion: ?PhpVersion, + * + * @param Lexer $lexer A lexer + * @param PhpVersion $phpVersion PHP version to target, defaults to latest supported. This + * option is best-effort: Even if specified, parsing will generally assume the latest + * supported version and only adjust behavior in minor ways, for example by omitting + * errors in older versions and interpreting type hints as a name or identifier depending + * on version. + */ + public function __construct(Lexer $lexer, ?PhpVersion $phpVersion = null) { + $this->lexer = $lexer; + $this->phpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); + + $this->initReduceCallbacks(); + $this->phpTokenToSymbol = $this->createTokenMap(); + $this->dropTokens = array_fill_keys( + [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], true + ); + } + + /** + * Parses PHP code into a node tree. + * + * If a non-throwing error handler is used, the parser will continue parsing after an error + * occurred and attempt to build a partial AST. + * + * @param string $code The source code to parse + * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults + * to ErrorHandler\Throwing. + * + * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and + * the parser was unable to recover from an error). + */ + public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array { + $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing(); + $this->createdArrays = new \SplObjectStorage(); + + $this->tokens = $this->lexer->tokenize($code, $this->errorHandler); + $result = $this->doParse(); + + // Report errors for any empty elements used inside arrays. This is delayed until after the main parse, + // because we don't know a priori whether a given array expression will be used in a destructuring context + // or not. + foreach ($this->createdArrays as $node) { + foreach ($node->items as $item) { + if ($item->value instanceof Expr\Error) { + $this->errorHandler->handleError( + new Error('Cannot use empty array elements in arrays', $item->getAttributes())); + } + } + } + + // Clear out some of the interior state, so we don't hold onto unnecessary + // memory between uses of the parser + $this->tokenStartStack = []; + $this->tokenEndStack = []; + $this->semStack = []; + $this->semValue = null; + $this->createdArrays = null; + + if ($result !== null) { + $traverser = new NodeTraverser(new CommentAnnotatingVisitor($this->tokens)); + $traverser->traverse($result); + } + + return $result; + } + + public function getTokens(): array { + return $this->tokens; + } + + /** @return Stmt[]|null */ + protected function doParse(): ?array { + // We start off with no lookahead-token + $symbol = self::SYMBOL_NONE; + $tokenValue = null; + $this->tokenPos = -1; + + // Keep stack of start and end attributes + $this->tokenStartStack = []; + $this->tokenEndStack = [0]; + + // Start off in the initial state and keep a stack of previous states + $state = 0; + $stateStack = [$state]; + + // Semantic value stack (contains values of tokens and semantic action results) + $this->semStack = []; + + // Current position in the stack(s) + $stackPos = 0; + + $this->errorState = 0; + + for (;;) { + //$this->traceNewState($state, $symbol); + + if ($this->actionBase[$state] === 0) { + $rule = $this->actionDefault[$state]; + } else { + if ($symbol === self::SYMBOL_NONE) { + do { + $token = $this->tokens[++$this->tokenPos]; + $tokenId = $token->id; + } while (isset($this->dropTokens[$tokenId])); + + // Map the lexer token id to the internally used symbols. + $tokenValue = $token->text; + if (!isset($this->phpTokenToSymbol[$tokenId])) { + throw new \RangeException(sprintf( + 'The lexer returned an invalid token (id=%d, value=%s)', + $tokenId, $tokenValue + )); + } + $symbol = $this->phpTokenToSymbol[$tokenId]; + + //$this->traceRead($symbol); + } + + $idx = $this->actionBase[$state] + $symbol; + if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) + || ($state < $this->YY2TBLSTATE + && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 + && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)) + && ($action = $this->action[$idx]) !== $this->defaultAction) { + /* + * >= numNonLeafStates: shift and reduce + * > 0: shift + * = 0: accept + * < 0: reduce + * = -YYUNEXPECTED: error + */ + if ($action > 0) { + /* shift */ + //$this->traceShift($symbol); + + ++$stackPos; + $stateStack[$stackPos] = $state = $action; + $this->semStack[$stackPos] = $tokenValue; + $this->tokenStartStack[$stackPos] = $this->tokenPos; + $this->tokenEndStack[$stackPos] = $this->tokenPos; + $symbol = self::SYMBOL_NONE; + + if ($this->errorState) { + --$this->errorState; + } + + if ($action < $this->numNonLeafStates) { + continue; + } + + /* $yyn >= numNonLeafStates means shift-and-reduce */ + $rule = $action - $this->numNonLeafStates; + } else { + $rule = -$action; + } + } else { + $rule = $this->actionDefault[$state]; + } + } + + for (;;) { + if ($rule === 0) { + /* accept */ + //$this->traceAccept(); + return $this->semValue; + } + if ($rule !== $this->unexpectedTokenRule) { + /* reduce */ + //$this->traceReduce($rule); + + $ruleLength = $this->ruleToLength[$rule]; + try { + $callback = $this->reduceCallbacks[$rule]; + if ($callback !== null) { + $callback($stackPos); + } elseif ($ruleLength > 0) { + $this->semValue = $this->semStack[$stackPos - $ruleLength + 1]; + } + } catch (Error $e) { + if (-1 === $e->getStartLine()) { + $e->setStartLine($this->tokens[$this->tokenPos]->line); + } + + $this->emitError($e); + // Can't recover from this type of error + return null; + } + + /* Goto - shift nonterminal */ + $lastTokenEnd = $this->tokenEndStack[$stackPos]; + $stackPos -= $ruleLength; + $nonTerminal = $this->ruleToNonTerminal[$rule]; + $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; + if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) { + $state = $this->goto[$idx]; + } else { + $state = $this->gotoDefault[$nonTerminal]; + } + + ++$stackPos; + $stateStack[$stackPos] = $state; + $this->semStack[$stackPos] = $this->semValue; + $this->tokenEndStack[$stackPos] = $lastTokenEnd; + if ($ruleLength === 0) { + // Empty productions use the start attributes of the lookahead token. + $this->tokenStartStack[$stackPos] = $this->tokenPos; + } + } else { + /* error */ + switch ($this->errorState) { + case 0: + $msg = $this->getErrorMessage($symbol, $state); + $this->emitError(new Error($msg, $this->getAttributesForToken($this->tokenPos))); + // Break missing intentionally + // no break + case 1: + case 2: + $this->errorState = 3; + + // Pop until error-expecting state uncovered + while (!( + (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0 + && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) + || ($state < $this->YY2TBLSTATE + && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0 + && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) + ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this + if ($stackPos <= 0) { + // Could not recover from error + return null; + } + $state = $stateStack[--$stackPos]; + //$this->tracePop($state); + } + + //$this->traceShift($this->errorSymbol); + ++$stackPos; + $stateStack[$stackPos] = $state = $action; + + // We treat the error symbol as being empty, so we reset the end attributes + // to the end attributes of the last non-error symbol + $this->tokenStartStack[$stackPos] = $this->tokenPos; + $this->tokenEndStack[$stackPos] = $this->tokenEndStack[$stackPos - 1]; + break; + + case 3: + if ($symbol === 0) { + // Reached EOF without recovering from error + return null; + } + + //$this->traceDiscard($symbol); + $symbol = self::SYMBOL_NONE; + break 2; + } + } + + if ($state < $this->numNonLeafStates) { + break; + } + + /* >= numNonLeafStates means shift-and-reduce */ + $rule = $state - $this->numNonLeafStates; + } + } + + throw new \RuntimeException('Reached end of parser loop'); + } + + protected function emitError(Error $error): void { + $this->errorHandler->handleError($error); + } + + /** + * Format error message including expected tokens. + * + * @param int $symbol Unexpected symbol + * @param int $state State at time of error + * + * @return string Formatted error message + */ + protected function getErrorMessage(int $symbol, int $state): string { + $expectedString = ''; + if ($expected = $this->getExpectedTokens($state)) { + $expectedString = ', expecting ' . implode(' or ', $expected); + } + + return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString; + } + + /** + * Get limited number of expected tokens in given state. + * + * @param int $state State + * + * @return string[] Expected tokens. If too many, an empty array is returned. + */ + protected function getExpectedTokens(int $state): array { + $expected = []; + + $base = $this->actionBase[$state]; + foreach ($this->symbolToName as $symbol => $name) { + $idx = $base + $symbol; + if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol + || $state < $this->YY2TBLSTATE + && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 + && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol + ) { + if ($this->action[$idx] !== $this->unexpectedTokenRule + && $this->action[$idx] !== $this->defaultAction + && $symbol !== $this->errorSymbol + ) { + if (count($expected) === 4) { + /* Too many expected tokens */ + return []; + } + + $expected[] = $name; + } + } + } + + return $expected; + } + + /** + * Get attributes for a node with the given start and end token positions. + * + * @param int $tokenStartPos Token position the node starts at + * @param int $tokenEndPos Token position the node ends at + * @return array Attributes + */ + protected function getAttributes(int $tokenStartPos, int $tokenEndPos): array { + $startToken = $this->tokens[$tokenStartPos]; + $afterEndToken = $this->tokens[$tokenEndPos + 1]; + return [ + 'startLine' => $startToken->line, + 'startTokenPos' => $tokenStartPos, + 'startFilePos' => $startToken->pos, + 'endLine' => $afterEndToken->line, + 'endTokenPos' => $tokenEndPos, + 'endFilePos' => $afterEndToken->pos - 1, + ]; + } + + /** + * Get attributes for a single token at the given token position. + * + * @return array Attributes + */ + protected function getAttributesForToken(int $tokenPos): array { + if ($tokenPos < \count($this->tokens) - 1) { + return $this->getAttributes($tokenPos, $tokenPos); + } + + // Get attributes for the sentinel token. + $token = $this->tokens[$tokenPos]; + return [ + 'startLine' => $token->line, + 'startTokenPos' => $tokenPos, + 'startFilePos' => $token->pos, + 'endLine' => $token->line, + 'endTokenPos' => $tokenPos, + 'endFilePos' => $token->pos, + ]; + } + + /* + * Tracing functions used for debugging the parser. + */ + + /* + protected function traceNewState($state, $symbol): void { + echo '% State ' . $state + . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n"; + } + + protected function traceRead($symbol): void { + echo '% Reading ' . $this->symbolToName[$symbol] . "\n"; + } + + protected function traceShift($symbol): void { + echo '% Shift ' . $this->symbolToName[$symbol] . "\n"; + } + + protected function traceAccept(): void { + echo "% Accepted.\n"; + } + + protected function traceReduce($n): void { + echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n"; + } + + protected function tracePop($state): void { + echo '% Recovering, uncovered state ' . $state . "\n"; + } + + protected function traceDiscard($symbol): void { + echo '% Discard ' . $this->symbolToName[$symbol] . "\n"; + } + */ + + /* + * Helper functions invoked by semantic actions + */ + + /** + * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions. + * + * @param Node\Stmt[] $stmts + * @return Node\Stmt[] + */ + protected function handleNamespaces(array $stmts): array { + $hasErrored = false; + $style = $this->getNamespacingStyle($stmts); + if (null === $style) { + // not namespaced, nothing to do + return $stmts; + } + if ('brace' === $style) { + // For braced namespaces we only have to check that there are no invalid statements between the namespaces + $afterFirstNamespace = false; + foreach ($stmts as $stmt) { + if ($stmt instanceof Node\Stmt\Namespace_) { + $afterFirstNamespace = true; + } elseif (!$stmt instanceof Node\Stmt\HaltCompiler + && !$stmt instanceof Node\Stmt\Nop + && $afterFirstNamespace && !$hasErrored) { + $this->emitError(new Error( + 'No code may exist outside of namespace {}', $stmt->getAttributes())); + $hasErrored = true; // Avoid one error for every statement + } + } + return $stmts; + } else { + // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts + $resultStmts = []; + $targetStmts = &$resultStmts; + $lastNs = null; + foreach ($stmts as $stmt) { + if ($stmt instanceof Node\Stmt\Namespace_) { + if ($lastNs !== null) { + $this->fixupNamespaceAttributes($lastNs); + } + if ($stmt->stmts === null) { + $stmt->stmts = []; + $targetStmts = &$stmt->stmts; + $resultStmts[] = $stmt; + } else { + // This handles the invalid case of mixed style namespaces + $resultStmts[] = $stmt; + $targetStmts = &$resultStmts; + } + $lastNs = $stmt; + } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { + // __halt_compiler() is not moved into the namespace + $resultStmts[] = $stmt; + } else { + $targetStmts[] = $stmt; + } + } + if ($lastNs !== null) { + $this->fixupNamespaceAttributes($lastNs); + } + return $resultStmts; + } + } + + private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt): void { + // We moved the statements into the namespace node, as such the end of the namespace node + // needs to be extended to the end of the statements. + if (empty($stmt->stmts)) { + return; + } + + // We only move the builtin end attributes here. This is the best we can do with the + // knowledge we have. + $endAttributes = ['endLine', 'endFilePos', 'endTokenPos']; + $lastStmt = $stmt->stmts[count($stmt->stmts) - 1]; + foreach ($endAttributes as $endAttribute) { + if ($lastStmt->hasAttribute($endAttribute)) { + $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute)); + } + } + } + + /** @return array */ + private function getNamespaceErrorAttributes(Namespace_ $node): array { + $attrs = $node->getAttributes(); + // Adjust end attributes to only cover the "namespace" keyword, not the whole namespace. + if (isset($attrs['startLine'])) { + $attrs['endLine'] = $attrs['startLine']; + } + if (isset($attrs['startTokenPos'])) { + $attrs['endTokenPos'] = $attrs['startTokenPos']; + } + if (isset($attrs['startFilePos'])) { + $attrs['endFilePos'] = $attrs['startFilePos'] + \strlen('namespace') - 1; + } + return $attrs; + } + + /** + * Determine namespacing style (semicolon or brace) + * + * @param Node[] $stmts Top-level statements. + * + * @return null|string One of "semicolon", "brace" or null (no namespaces) + */ + private function getNamespacingStyle(array $stmts): ?string { + $style = null; + $hasNotAllowedStmts = false; + foreach ($stmts as $i => $stmt) { + if ($stmt instanceof Node\Stmt\Namespace_) { + $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace'; + if (null === $style) { + $style = $currentStyle; + if ($hasNotAllowedStmts) { + $this->emitError(new Error( + 'Namespace declaration statement has to be the very first statement in the script', + $this->getNamespaceErrorAttributes($stmt) + )); + } + } elseif ($style !== $currentStyle) { + $this->emitError(new Error( + 'Cannot mix bracketed namespace declarations with unbracketed namespace declarations', + $this->getNamespaceErrorAttributes($stmt) + )); + // Treat like semicolon style for namespace normalization + return 'semicolon'; + } + continue; + } + + /* declare(), __halt_compiler() and nops can be used before a namespace declaration */ + if ($stmt instanceof Node\Stmt\Declare_ + || $stmt instanceof Node\Stmt\HaltCompiler + || $stmt instanceof Node\Stmt\Nop) { + continue; + } + + /* There may be a hashbang line at the very start of the file */ + if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) { + continue; + } + + /* Everything else if forbidden before namespace declarations */ + $hasNotAllowedStmts = true; + } + return $style; + } + + /** @return Name|Identifier */ + protected function handleBuiltinTypes(Name $name) { + if (!$name->isUnqualified()) { + return $name; + } + + $lowerName = $name->toLowerString(); + if (!$this->phpVersion->supportsBuiltinType($lowerName)) { + return $name; + } + + return new Node\Identifier($lowerName, $name->getAttributes()); + } + + /** + * Get combined start and end attributes at a stack location + * + * @param int $stackPos Stack location + * + * @return array Combined start and end attributes + */ + protected function getAttributesAt(int $stackPos): array { + return $this->getAttributes($this->tokenStartStack[$stackPos], $this->tokenEndStack[$stackPos]); + } + + protected function getFloatCastKind(string $cast): int { + $cast = strtolower($cast); + if (strpos($cast, 'float') !== false) { + return Double::KIND_FLOAT; + } + + if (strpos($cast, 'real') !== false) { + return Double::KIND_REAL; + } + + return Double::KIND_DOUBLE; + } + + /** @param array $attributes */ + protected function parseLNumber(string $str, array $attributes, bool $allowInvalidOctal = false): Int_ { + try { + return Int_::fromString($str, $attributes, $allowInvalidOctal); + } catch (Error $error) { + $this->emitError($error); + // Use dummy value + return new Int_(0, $attributes); + } + } + + /** + * Parse a T_NUM_STRING token into either an integer or string node. + * + * @param string $str Number string + * @param array $attributes Attributes + * + * @return Int_|String_ Integer or string node. + */ + protected function parseNumString(string $str, array $attributes) { + if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) { + return new String_($str, $attributes); + } + + $num = +$str; + if (!is_int($num)) { + return new String_($str, $attributes); + } + + return new Int_($num, $attributes); + } + + /** @param array $attributes */ + protected function stripIndentation( + string $string, int $indentLen, string $indentChar, + bool $newlineAtStart, bool $newlineAtEnd, array $attributes + ): string { + if ($indentLen === 0) { + return $string; + } + + $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)'; + $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])'; + $regex = '/' . $start . '([ \t]*)(' . $end . ')?/'; + return preg_replace_callback( + $regex, + function ($matches) use ($indentLen, $indentChar, $attributes) { + $prefix = substr($matches[1], 0, $indentLen); + if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) { + $this->emitError(new Error( + 'Invalid indentation - tabs and spaces cannot be mixed', $attributes + )); + } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) { + $this->emitError(new Error( + 'Invalid body indentation level ' . + '(expecting an indentation level of at least ' . $indentLen . ')', + $attributes + )); + } + return substr($matches[0], strlen($prefix)); + }, + $string + ); + } + + /** + * @param string|(Expr|InterpolatedStringPart)[] $contents + * @param array $attributes + * @param array $endTokenAttributes + */ + protected function parseDocString( + string $startToken, $contents, string $endToken, + array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape + ): Expr { + $kind = strpos($startToken, "'") === false + ? String_::KIND_HEREDOC : String_::KIND_NOWDOC; + + $regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/'; + $result = preg_match($regex, $startToken, $matches); + assert($result === 1); + $label = $matches[1]; + + $result = preg_match('/\A[ \t]*/', $endToken, $matches); + assert($result === 1); + $indentation = $matches[0]; + + $attributes['kind'] = $kind; + $attributes['docLabel'] = $label; + $attributes['docIndentation'] = $indentation; + + $indentHasSpaces = false !== strpos($indentation, " "); + $indentHasTabs = false !== strpos($indentation, "\t"); + if ($indentHasSpaces && $indentHasTabs) { + $this->emitError(new Error( + 'Invalid indentation - tabs and spaces cannot be mixed', + $endTokenAttributes + )); + + // Proceed processing as if this doc string is not indented + $indentation = ''; + } + + $indentLen = \strlen($indentation); + $indentChar = $indentHasSpaces ? " " : "\t"; + + if (\is_string($contents)) { + if ($contents === '') { + $attributes['rawValue'] = $contents; + return new String_('', $attributes); + } + + $contents = $this->stripIndentation( + $contents, $indentLen, $indentChar, true, true, $attributes + ); + $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents); + $attributes['rawValue'] = $contents; + + if ($kind === String_::KIND_HEREDOC) { + $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape); + } + + return new String_($contents, $attributes); + } else { + assert(count($contents) > 0); + if (!$contents[0] instanceof Node\InterpolatedStringPart) { + // If there is no leading encapsed string part, pretend there is an empty one + $this->stripIndentation( + '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes() + ); + } + + $newContents = []; + foreach ($contents as $i => $part) { + if ($part instanceof Node\InterpolatedStringPart) { + $isLast = $i === \count($contents) - 1; + $part->value = $this->stripIndentation( + $part->value, $indentLen, $indentChar, + $i === 0, $isLast, $part->getAttributes() + ); + if ($isLast) { + $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value); + } + $part->setAttribute('rawValue', $part->value); + $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); + if ('' === $part->value) { + continue; + } + } + $newContents[] = $part; + } + return new InterpolatedString($newContents, $attributes); + } + } + + protected function createCommentFromToken(Token $token, int $tokenPos): Comment { + assert($token->id === \T_COMMENT || $token->id == \T_DOC_COMMENT); + return \T_DOC_COMMENT === $token->id + ? new Comment\Doc($token->text, $token->line, $token->pos, $tokenPos, + $token->getEndLine(), $token->getEndPos() - 1, $tokenPos) + : new Comment($token->text, $token->line, $token->pos, $tokenPos, + $token->getEndLine(), $token->getEndPos() - 1, $tokenPos); + } + + /** + * Get last comment before the given token position, if any + */ + protected function getCommentBeforeToken(int $tokenPos): ?Comment { + while (--$tokenPos >= 0) { + $token = $this->tokens[$tokenPos]; + if (!isset($this->dropTokens[$token->id])) { + break; + } + + if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { + return $this->createCommentFromToken($token, $tokenPos); + } + } + return null; + } + + /** + * Create a zero-length nop to capture preceding comments, if any. + */ + protected function maybeCreateZeroLengthNop(int $tokenPos): ?Nop { + $comment = $this->getCommentBeforeToken($tokenPos); + if ($comment === null) { + return null; + } + + $commentEndLine = $comment->getEndLine(); + $commentEndFilePos = $comment->getEndFilePos(); + $commentEndTokenPos = $comment->getEndTokenPos(); + $attributes = [ + 'startLine' => $commentEndLine, + 'endLine' => $commentEndLine, + 'startFilePos' => $commentEndFilePos + 1, + 'endFilePos' => $commentEndFilePos, + 'startTokenPos' => $commentEndTokenPos + 1, + 'endTokenPos' => $commentEndTokenPos, + ]; + return new Nop($attributes); + } + + protected function maybeCreateNop(int $tokenStartPos, int $tokenEndPos): ?Nop { + if ($this->getCommentBeforeToken($tokenStartPos) === null) { + return null; + } + return new Nop($this->getAttributes($tokenStartPos, $tokenEndPos)); + } + + protected function handleHaltCompiler(): string { + // Prevent the lexer from returning any further tokens. + $nextToken = $this->tokens[$this->tokenPos + 1]; + $this->tokenPos = \count($this->tokens) - 2; + + // Return text after __halt_compiler. + return $nextToken->id === \T_INLINE_HTML ? $nextToken->text : ''; + } + + protected function inlineHtmlHasLeadingNewline(int $stackPos): bool { + $tokenPos = $this->tokenStartStack[$stackPos]; + $token = $this->tokens[$tokenPos]; + assert($token->id == \T_INLINE_HTML); + if ($tokenPos > 0) { + $prevToken = $this->tokens[$tokenPos - 1]; + assert($prevToken->id == \T_CLOSE_TAG); + return false !== strpos($prevToken->text, "\n") + || false !== strpos($prevToken->text, "\r"); + } + return true; + } + + /** + * @return array + */ + protected function createEmptyElemAttributes(int $tokenPos): array { + return $this->getAttributesForToken($tokenPos); + } + + protected function fixupArrayDestructuring(Array_ $node): Expr\List_ { + $this->createdArrays->detach($node); + return new Expr\List_(array_map(function (Node\ArrayItem $item) { + if ($item->value instanceof Expr\Error) { + // We used Error as a placeholder for empty elements, which are legal for destructuring. + return null; + } + if ($item->value instanceof Array_) { + return new Node\ArrayItem( + $this->fixupArrayDestructuring($item->value), + $item->key, $item->byRef, $item->getAttributes()); + } + return $item; + }, $node->items), ['kind' => Expr\List_::KIND_ARRAY] + $node->getAttributes()); + } + + protected function postprocessList(Expr\List_ $node): void { + foreach ($node->items as $i => $item) { + if ($item->value instanceof Expr\Error) { + // We used Error as a placeholder for empty elements, which are legal for destructuring. + $node->items[$i] = null; + } + } + } + + /** @param ElseIf_|Else_ $node */ + protected function fixupAlternativeElse($node): void { + // Make sure a trailing nop statement carrying comments is part of the node. + $numStmts = \count($node->stmts); + if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) { + $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes(); + if (isset($nopAttrs['endLine'])) { + $node->setAttribute('endLine', $nopAttrs['endLine']); + } + if (isset($nopAttrs['endFilePos'])) { + $node->setAttribute('endFilePos', $nopAttrs['endFilePos']); + } + if (isset($nopAttrs['endTokenPos'])) { + $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']); + } + } + } + + protected function checkClassModifier(int $a, int $b, int $modifierPos): void { + try { + Modifiers::verifyClassModifier($a, $b); + } catch (Error $error) { + $error->setAttributes($this->getAttributesAt($modifierPos)); + $this->emitError($error); + } + } + + protected function checkModifier(int $a, int $b, int $modifierPos): void { + // Jumping through some hoops here because verifyModifier() is also used elsewhere + try { + Modifiers::verifyModifier($a, $b); + } catch (Error $error) { + $error->setAttributes($this->getAttributesAt($modifierPos)); + $this->emitError($error); + } + } + + protected function checkParam(Param $node): void { + if ($node->variadic && null !== $node->default) { + $this->emitError(new Error( + 'Variadic parameter cannot have a default value', + $node->default->getAttributes() + )); + } + } + + protected function checkTryCatch(TryCatch $node): void { + if (empty($node->catches) && null === $node->finally) { + $this->emitError(new Error( + 'Cannot use try without catch or finally', $node->getAttributes() + )); + } + } + + protected function checkNamespace(Namespace_ $node): void { + if (null !== $node->stmts) { + foreach ($node->stmts as $stmt) { + if ($stmt instanceof Namespace_) { + $this->emitError(new Error( + 'Namespace declarations cannot be nested', $stmt->getAttributes() + )); + } + } + } + } + + private function checkClassName(?Identifier $name, int $namePos): void { + if (null !== $name && $name->isSpecialClassName()) { + $this->emitError(new Error( + sprintf('Cannot use \'%s\' as class name as it is reserved', $name), + $this->getAttributesAt($namePos) + )); + } + } + + /** @param Name[] $interfaces */ + private function checkImplementedInterfaces(array $interfaces): void { + foreach ($interfaces as $interface) { + if ($interface->isSpecialClassName()) { + $this->emitError(new Error( + sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface), + $interface->getAttributes() + )); + } + } + } + + protected function checkClass(Class_ $node, int $namePos): void { + $this->checkClassName($node->name, $namePos); + + if ($node->extends && $node->extends->isSpecialClassName()) { + $this->emitError(new Error( + sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends), + $node->extends->getAttributes() + )); + } + + $this->checkImplementedInterfaces($node->implements); + } + + protected function checkInterface(Interface_ $node, int $namePos): void { + $this->checkClassName($node->name, $namePos); + $this->checkImplementedInterfaces($node->extends); + } + + protected function checkEnum(Enum_ $node, int $namePos): void { + $this->checkClassName($node->name, $namePos); + $this->checkImplementedInterfaces($node->implements); + } + + protected function checkClassMethod(ClassMethod $node, int $modifierPos): void { + if ($node->flags & Modifiers::STATIC) { + switch ($node->name->toLowerString()) { + case '__construct': + $this->emitError(new Error( + sprintf('Constructor %s() cannot be static', $node->name), + $this->getAttributesAt($modifierPos))); + break; + case '__destruct': + $this->emitError(new Error( + sprintf('Destructor %s() cannot be static', $node->name), + $this->getAttributesAt($modifierPos))); + break; + case '__clone': + $this->emitError(new Error( + sprintf('Clone method %s() cannot be static', $node->name), + $this->getAttributesAt($modifierPos))); + break; + } + } + + if ($node->flags & Modifiers::READONLY) { + $this->emitError(new Error( + sprintf('Method %s() cannot be readonly', $node->name), + $this->getAttributesAt($modifierPos))); + } + } + + protected function checkClassConst(ClassConst $node, int $modifierPos): void { + if ($node->flags & Modifiers::STATIC) { + $this->emitError(new Error( + "Cannot use 'static' as constant modifier", + $this->getAttributesAt($modifierPos))); + } + if ($node->flags & Modifiers::ABSTRACT) { + $this->emitError(new Error( + "Cannot use 'abstract' as constant modifier", + $this->getAttributesAt($modifierPos))); + } + if ($node->flags & Modifiers::READONLY) { + $this->emitError(new Error( + "Cannot use 'readonly' as constant modifier", + $this->getAttributesAt($modifierPos))); + } + } + + protected function checkProperty(Property $node, int $modifierPos): void { + if ($node->flags & Modifiers::ABSTRACT) { + $this->emitError(new Error('Properties cannot be declared abstract', + $this->getAttributesAt($modifierPos))); + } + + if ($node->flags & Modifiers::FINAL) { + $this->emitError(new Error('Properties cannot be declared final', + $this->getAttributesAt($modifierPos))); + } + } + + protected function checkUseUse(UseItem $node, int $namePos): void { + if ($node->alias && $node->alias->isSpecialClassName()) { + $this->emitError(new Error( + sprintf( + 'Cannot use %s as %s because \'%2$s\' is a special class name', + $node->name, $node->alias + ), + $this->getAttributesAt($namePos) + )); + } + } + + /** + * Creates the token map. + * + * The token map maps the PHP internal token identifiers + * to the identifiers used by the Parser. Additionally it + * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. + * + * @return array The token map + */ + protected function createTokenMap(): array { + $tokenMap = []; + + for ($i = 0; $i < 1000; ++$i) { + if ($i < 256) { + // Single-char tokens use an identity mapping. + $tokenMap[$i] = $i; + } elseif (\T_DOUBLE_COLON === $i) { + // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM + $tokenMap[$i] = static::T_PAAMAYIM_NEKUDOTAYIM; + } elseif (\T_OPEN_TAG_WITH_ECHO === $i) { + // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO + $tokenMap[$i] = static::T_ECHO; + } elseif (\T_CLOSE_TAG === $i) { + // T_CLOSE_TAG is equivalent to ';' + $tokenMap[$i] = ord(';'); + } elseif ('UNKNOWN' !== $name = token_name($i)) { + if (defined($name = static::class . '::' . $name)) { + // Other tokens can be mapped directly + $tokenMap[$i] = constant($name); + } + } + } + + // Assign tokens for which we define compatibility constants, as token_name() does not know them. + $tokenMap[\T_FN] = static::T_FN; + $tokenMap[\T_COALESCE_EQUAL] = static::T_COALESCE_EQUAL; + $tokenMap[\T_NAME_QUALIFIED] = static::T_NAME_QUALIFIED; + $tokenMap[\T_NAME_FULLY_QUALIFIED] = static::T_NAME_FULLY_QUALIFIED; + $tokenMap[\T_NAME_RELATIVE] = static::T_NAME_RELATIVE; + $tokenMap[\T_MATCH] = static::T_MATCH; + $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = static::T_NULLSAFE_OBJECT_OPERATOR; + $tokenMap[\T_ATTRIBUTE] = static::T_ATTRIBUTE; + $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = static::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; + $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = static::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; + $tokenMap[\T_ENUM] = static::T_ENUM; + $tokenMap[\T_READONLY] = static::T_READONLY; + + // We have create a map from PHP token IDs to external symbol IDs. + // Now map them to the internal symbol ID. + $fullTokenMap = []; + foreach ($tokenMap as $phpToken => $extSymbol) { + $intSymbol = $this->tokenToSymbol[$extSymbol]; + if ($intSymbol === $this->invalidSymbol) { + continue; + } + $fullTokenMap[$phpToken] = $intSymbol; + } + + return $fullTokenMap; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php new file mode 100644 index 0000000..3a7586e --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php @@ -0,0 +1,42 @@ +isHostVersion()) { + $lexer = new Lexer(); + } else { + $lexer = new Lexer\Emulative($version); + } + if ($version->id >= 80000) { + return new Php8($lexer, $version); + } + return new Php7($lexer, $version); + } + + /** + * Create a parser targeting the newest version supported by this library. Code for older + * versions will be accepted if there have been no relevant backwards-compatibility breaks in + * PHP. + */ + public function createForNewestSupportedVersion(): Parser { + return $this->createForVersion(PhpVersion::getNewestSupported()); + } + + /** + * Create a parser targeting the host PHP version, that is the PHP version we're currently + * running on. This parser will not use any token emulation. + */ + public function createForHostVersion(): Parser { + return $this->createForVersion(PhpVersion::getHostVersion()); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php b/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php new file mode 100644 index 0000000..a6fbb58 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php @@ -0,0 +1,164 @@ + 50100, + 'callable' => 50400, + 'bool' => 70000, + 'int' => 70000, + 'float' => 70000, + 'string' => 70000, + 'iterable' => 70100, + 'void' => 70100, + 'object' => 70200, + 'null' => 80000, + 'false' => 80000, + 'mixed' => 80000, + 'never' => 80100, + 'true' => 80200, + ]; + + private function __construct(int $id) { + $this->id = $id; + } + + /** + * Create a PhpVersion object from major and minor version components. + */ + public static function fromComponents(int $major, int $minor): self { + return new self($major * 10000 + $minor * 100); + } + + /** + * Get the newest PHP version supported by this library. Support for this version may be partial, + * if it is still under development. + */ + public static function getNewestSupported(): self { + return self::fromComponents(8, 2); + } + + /** + * Get the host PHP version, that is the PHP version we're currently running on. + */ + public static function getHostVersion(): self { + return self::fromComponents(\PHP_MAJOR_VERSION, \PHP_MINOR_VERSION); + } + + /** + * Parse the version from a string like "8.1". + */ + public static function fromString(string $version): self { + if (!preg_match('/^(\d+)\.(\d+)/', $version, $matches)) { + throw new \LogicException("Invalid PHP version \"$version\""); + } + return self::fromComponents((int) $matches[1], (int) $matches[2]); + } + + /** + * Check whether two versions are the same. + */ + public function equals(PhpVersion $other): bool { + return $this->id === $other->id; + } + + /** + * Check whether this version is greater than or equal to the argument. + */ + public function newerOrEqual(PhpVersion $other): bool { + return $this->id >= $other->id; + } + + /** + * Check whether this version is older than the argument. + */ + public function older(PhpVersion $other): bool { + return $this->id < $other->id; + } + + /** + * Check whether this is the host PHP version. + */ + public function isHostVersion(): bool { + return $this->equals(self::getHostVersion()); + } + + /** + * Check whether this PHP version supports the given builtin type. Type name must be lowercase. + */ + public function supportsBuiltinType(string $type): bool { + $minVersion = self::BUILTIN_TYPE_VERSIONS[$type] ?? null; + return $minVersion !== null && $this->id >= $minVersion; + } + + /** + * Whether this version supports [] array literals. + */ + public function supportsShortArraySyntax(): bool { + return $this->id >= 50400; + } + + /** + * Whether this version supports [] for destructuring. + */ + public function supportsShortArrayDestructuring(): bool { + return $this->id >= 70100; + } + + /** + * Whether this version supports flexible heredoc/nowdoc. + */ + public function supportsFlexibleHeredoc(): bool { + return $this->id >= 70300; + } + + /** + * Whether this version supports trailing commas in parameter lists. + */ + public function supportsTrailingCommaInParamList(): bool { + return $this->id >= 80000; + } + + /** + * Whether this version allows "$var =& new Obj". + */ + public function allowsAssignNewByReference(): bool { + return $this->id < 70000; + } + + /** + * Whether this version allows invalid octals like "08". + */ + public function allowsInvalidOctals(): bool { + return $this->id < 70000; + } + + /** + * Whether this version allows DEL (\x7f) to occur in identifiers. + */ + public function allowsDelInIdentifiers(): bool { + return $this->id < 70100; + } + + /** + * Whether this version supports yield in expression context without parentheses. + */ + public function supportsYieldWithoutParentheses(): bool { + return $this->id >= 70000; + } + + /** + * Whether this version supports unicode escape sequences in strings. + */ + public function supportsUnicodeEscapes(): bool { + return $this->id >= 70000; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php new file mode 100644 index 0000000..892c686 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php @@ -0,0 +1,51 @@ +pAttrGroups($node->attrGroups, true) + . $this->pModifiers($node->flags) + . ($node->type ? $this->p($node->type) . ' ' : '') + . ($node->byRef ? '&' : '') + . ($node->variadic ? '...' : '') + . $this->p($node->var) + . ($node->default ? ' = ' . $this->p($node->default) : ''); + } + + protected function pArg(Node\Arg $node): string { + return ($node->name ? $node->name->toString() . ': ' : '') + . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') + . $this->p($node->value); + } + + protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node): string { + return '...'; + } + + protected function pConst(Node\Const_ $node): string { + return $node->name . ' = ' . $this->p($node->value); + } + + protected function pNullableType(Node\NullableType $node): string { + return '?' . $this->p($node->type); + } + + protected function pUnionType(Node\UnionType $node): string { + $types = []; + foreach ($node->types as $typeNode) { + if ($typeNode instanceof Node\IntersectionType) { + $types[] = '('. $this->p($typeNode) . ')'; + continue; + } + $types[] = $this->p($typeNode); + } + return implode('|', $types); + } + + protected function pIntersectionType(Node\IntersectionType $node): string { + return $this->pImplode($node->types, '&'); + } + + protected function pIdentifier(Node\Identifier $node): string { + return $node->name; + } + + protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node): string { + return '$' . $node->name; + } + + protected function pAttribute(Node\Attribute $node): string { + return $this->p($node->name) + . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : ''); + } + + protected function pAttributeGroup(Node\AttributeGroup $node): string { + return '#[' . $this->pCommaSeparated($node->attrs) . ']'; + } + + // Names + + protected function pName(Name $node): string { + return $node->name; + } + + protected function pName_FullyQualified(Name\FullyQualified $node): string { + return '\\' . $node->name; + } + + protected function pName_Relative(Name\Relative $node): string { + return 'namespace\\' . $node->name; + } + + // Magic Constants + + protected function pScalar_MagicConst_Class(MagicConst\Class_ $node): string { + return '__CLASS__'; + } + + protected function pScalar_MagicConst_Dir(MagicConst\Dir $node): string { + return '__DIR__'; + } + + protected function pScalar_MagicConst_File(MagicConst\File $node): string { + return '__FILE__'; + } + + protected function pScalar_MagicConst_Function(MagicConst\Function_ $node): string { + return '__FUNCTION__'; + } + + protected function pScalar_MagicConst_Line(MagicConst\Line $node): string { + return '__LINE__'; + } + + protected function pScalar_MagicConst_Method(MagicConst\Method $node): string { + return '__METHOD__'; + } + + protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node): string { + return '__NAMESPACE__'; + } + + protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node): string { + return '__TRAIT__'; + } + + // Scalars + + private function indentString(string $str): string { + return str_replace("\n", $this->nl, $str); + } + + protected function pScalar_String(Scalar\String_ $node): string { + $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED); + switch ($kind) { + case Scalar\String_::KIND_NOWDOC: + $label = $node->getAttribute('docLabel'); + if ($label && !$this->containsEndLabel($node->value, $label)) { + $shouldIdent = $this->phpVersion->supportsFlexibleHeredoc(); + $nl = $shouldIdent ? $this->nl : $this->newline; + if ($node->value === '') { + return "<<<'$label'$nl$label{$this->docStringEndToken}"; + } + + // Make sure trailing \r is not combined with following \n into CRLF. + if ($node->value[strlen($node->value) - 1] !== "\r") { + $value = $shouldIdent ? $this->indentString($node->value) : $node->value; + return "<<<'$label'$nl$value$nl$label{$this->docStringEndToken}"; + } + } + /* break missing intentionally */ + // no break + case Scalar\String_::KIND_SINGLE_QUOTED: + return $this->pSingleQuotedString($node->value); + case Scalar\String_::KIND_HEREDOC: + $label = $node->getAttribute('docLabel'); + $escaped = $this->escapeString($node->value, null); + if ($label && !$this->containsEndLabel($escaped, $label)) { + $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; + if ($escaped === '') { + return "<<<$label$nl$label{$this->docStringEndToken}"; + } + + return "<<<$label$nl$escaped$nl$label{$this->docStringEndToken}"; + } + /* break missing intentionally */ + // no break + case Scalar\String_::KIND_DOUBLE_QUOTED: + return '"' . $this->escapeString($node->value, '"') . '"'; + } + throw new \Exception('Invalid string kind'); + } + + protected function pScalar_InterpolatedString(Scalar\InterpolatedString $node): string { + if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) { + $label = $node->getAttribute('docLabel'); + if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) { + $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; + if (count($node->parts) === 1 + && $node->parts[0] instanceof Node\InterpolatedStringPart + && $node->parts[0]->value === '' + ) { + return "<<<$label$nl$label{$this->docStringEndToken}"; + } + + return "<<<$label$nl" . $this->pEncapsList($node->parts, null) + . "$nl$label{$this->docStringEndToken}"; + } + } + return '"' . $this->pEncapsList($node->parts, '"') . '"'; + } + + protected function pScalar_Int(Scalar\Int_ $node): string { + if ($node->value === -\PHP_INT_MAX - 1) { + // PHP_INT_MIN cannot be represented as a literal, + // because the sign is not part of the literal + return '(-' . \PHP_INT_MAX . '-1)'; + } + + $kind = $node->getAttribute('kind', Scalar\Int_::KIND_DEC); + if (Scalar\Int_::KIND_DEC === $kind) { + return (string) $node->value; + } + + if ($node->value < 0) { + $sign = '-'; + $str = (string) -$node->value; + } else { + $sign = ''; + $str = (string) $node->value; + } + switch ($kind) { + case Scalar\Int_::KIND_BIN: + return $sign . '0b' . base_convert($str, 10, 2); + case Scalar\Int_::KIND_OCT: + return $sign . '0' . base_convert($str, 10, 8); + case Scalar\Int_::KIND_HEX: + return $sign . '0x' . base_convert($str, 10, 16); + } + throw new \Exception('Invalid number kind'); + } + + protected function pScalar_Float(Scalar\Float_ $node): string { + if (!is_finite($node->value)) { + if ($node->value === \INF) { + return '1.0E+1000'; + } + if ($node->value === -\INF) { + return '-1.0E+1000'; + } else { + return '\NAN'; + } + } + + // Try to find a short full-precision representation + $stringValue = sprintf('%.16G', $node->value); + if ($node->value !== (float) $stringValue) { + $stringValue = sprintf('%.17G', $node->value); + } + + // %G is locale dependent and there exists no locale-independent alternative. We don't want + // mess with switching locales here, so let's assume that a comma is the only non-standard + // decimal separator we may encounter... + $stringValue = str_replace(',', '.', $stringValue); + + // ensure that number is really printed as float + return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue; + } + + // Assignments + + protected function pExpr_Assign(Expr\Assign $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Assign::class, $this->p($node->var) . ' = ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignRef(Expr\AssignRef $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\AssignRef::class, $this->p($node->var) . ' =& ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Plus(AssignOp\Plus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Plus::class, $this->p($node->var) . ' += ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Minus(AssignOp\Minus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Minus::class, $this->p($node->var) . ' -= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Mul(AssignOp\Mul $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Mul::class, $this->p($node->var) . ' *= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Div(AssignOp\Div $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Div::class, $this->p($node->var) . ' /= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Concat(AssignOp\Concat $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Concat::class, $this->p($node->var) . ' .= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Mod(AssignOp\Mod $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Mod::class, $this->p($node->var) . ' %= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseAnd::class, $this->p($node->var) . ' &= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseOr::class, $this->p($node->var) . ' |= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseXor::class, $this->p($node->var) . ' ^= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\ShiftLeft::class, $this->p($node->var) . ' <<= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\ShiftRight::class, $this->p($node->var) . ' >>= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Pow(AssignOp\Pow $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Pow::class, $this->p($node->var) . ' **= ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Coalesce::class, $this->p($node->var) . ' ??= ', $node->expr, $precedence, $lhsPrecedence); + } + + // Binary expressions + + protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Div(BinaryOp\Div $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right, $precedence, $lhsPrecedence); + } + + protected function pExpr_Instanceof(Expr\Instanceof_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPostfixOp( + Expr\Instanceof_::class, $node->expr, + ' instanceof ' . $this->pNewOperand($node->class), + $precedence, $lhsPrecedence); + } + + // Unary expressions + + protected function pExpr_BooleanNot(Expr\BooleanNot $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_BitwiseNot(Expr\BitwiseNot $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_UnaryMinus(Expr\UnaryMinus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_UnaryPlus(Expr\UnaryPlus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_PreInc(Expr\PreInc $node): string { + return '++' . $this->p($node->var); + } + + protected function pExpr_PreDec(Expr\PreDec $node): string { + return '--' . $this->p($node->var); + } + + protected function pExpr_PostInc(Expr\PostInc $node): string { + return $this->p($node->var) . '++'; + } + + protected function pExpr_PostDec(Expr\PostDec $node): string { + return $this->p($node->var) . '--'; + } + + protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_YieldFrom(Expr\YieldFrom $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Print(Expr\Print_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr, $precedence, $lhsPrecedence); + } + + // Casts + + protected function pExpr_Cast_Int(Cast\Int_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_Double(Cast\Double $node, int $precedence, int $lhsPrecedence): string { + $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE); + if ($kind === Cast\Double::KIND_DOUBLE) { + $cast = '(double)'; + } elseif ($kind === Cast\Double::KIND_FLOAT) { + $cast = '(float)'; + } else { + assert($kind === Cast\Double::KIND_REAL); + $cast = '(real)'; + } + return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_String(Cast\String_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_Array(Cast\Array_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_Object(Cast\Object_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_Bool(Cast\Bool_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Cast_Unset(Cast\Unset_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr, $precedence, $lhsPrecedence); + } + + // Function calls and similar constructs + + protected function pExpr_FuncCall(Expr\FuncCall $node): string { + return $this->pCallLhs($node->name) + . '(' . $this->pMaybeMultiline($node->args) . ')'; + } + + protected function pExpr_MethodCall(Expr\MethodCall $node): string { + return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) + . '(' . $this->pMaybeMultiline($node->args) . ')'; + } + + protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node): string { + return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) + . '(' . $this->pMaybeMultiline($node->args) . ')'; + } + + protected function pExpr_StaticCall(Expr\StaticCall $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::' + . ($node->name instanceof Expr + ? ($node->name instanceof Expr\Variable + ? $this->p($node->name) + : '{' . $this->p($node->name) . '}') + : $node->name) + . '(' . $this->pMaybeMultiline($node->args) . ')'; + } + + protected function pExpr_Empty(Expr\Empty_ $node): string { + return 'empty(' . $this->p($node->expr) . ')'; + } + + protected function pExpr_Isset(Expr\Isset_ $node): string { + return 'isset(' . $this->pCommaSeparated($node->vars) . ')'; + } + + protected function pExpr_Eval(Expr\Eval_ $node): string { + return 'eval(' . $this->p($node->expr) . ')'; + } + + protected function pExpr_Include(Expr\Include_ $node, int $precedence, int $lhsPrecedence): string { + static $map = [ + Expr\Include_::TYPE_INCLUDE => 'include', + Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', + Expr\Include_::TYPE_REQUIRE => 'require', + Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once', + ]; + + return $this->pPrefixOp(Expr\Include_::class, $map[$node->type] . ' ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_List(Expr\List_ $node): string { + $syntax = $node->getAttribute('kind', + $this->phpVersion->supportsShortArrayDestructuring() ? Expr\List_::KIND_ARRAY : Expr\List_::KIND_LIST); + if ($syntax === Expr\List_::KIND_ARRAY) { + return '[' . $this->pMaybeMultiline($node->items, true) . ']'; + } else { + return 'list(' . $this->pMaybeMultiline($node->items, true) . ')'; + } + } + + // Other + + protected function pExpr_Error(Expr\Error $node): string { + throw new \LogicException('Cannot pretty-print AST with Error nodes'); + } + + protected function pExpr_Variable(Expr\Variable $node): string { + if ($node->name instanceof Expr) { + return '${' . $this->p($node->name) . '}'; + } else { + return '$' . $node->name; + } + } + + protected function pExpr_Array(Expr\Array_ $node): string { + $syntax = $node->getAttribute('kind', + $this->shortArraySyntax ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); + if ($syntax === Expr\Array_::KIND_SHORT) { + return '[' . $this->pMaybeMultiline($node->items, true) . ']'; + } else { + return 'array(' . $this->pMaybeMultiline($node->items, true) . ')'; + } + } + + protected function pKey(?Node $node): string { + if ($node === null) { + return ''; + } + + // => is not really an operator and does not typically participate in precedence resolution. + // However, there is an exception if yield expressions with keys are involved: + // [yield $a => $b] is interpreted as [(yield $a => $b)], so we need to ensure that + // [(yield $a) => $b] is printed with parentheses. We approximate this by lowering the LHS + // precedence to that of yield (which will also print unnecessary parentheses for rare low + // precedence unary operators like include). + $yieldPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; + return $this->p($node, self::MAX_PRECEDENCE, $yieldPrecedence) . ' => '; + } + + protected function pArrayItem(Node\ArrayItem $node): string { + return $this->pKey($node->key) + . ($node->byRef ? '&' : '') + . ($node->unpack ? '...' : '') + . $this->p($node->value); + } + + protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node): string { + return $this->pDereferenceLhs($node->var) + . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']'; + } + + protected function pExpr_ConstFetch(Expr\ConstFetch $node): string { + return $this->p($node->name); + } + + protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name); + } + + protected function pExpr_PropertyFetch(Expr\PropertyFetch $node): string { + return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name); + } + + protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node): string { + return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name); + } + + protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); + } + + protected function pExpr_ShellExec(Expr\ShellExec $node): string { + return '`' . $this->pEncapsList($node->parts, '`') . '`'; + } + + protected function pExpr_Closure(Expr\Closure $node): string { + return $this->pAttrGroups($node->attrGroups, true) + . $this->pStatic($node->static) + . 'function ' . ($node->byRef ? '&' : '') + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (!empty($node->uses) ? ' use (' . $this->pCommaSeparated($node->uses) . ')' : '') + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') + . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pExpr_Match(Expr\Match_ $node): string { + return 'match (' . $this->p($node->cond) . ') {' + . $this->pCommaSeparatedMultiline($node->arms, true) + . $this->nl + . '}'; + } + + protected function pMatchArm(Node\MatchArm $node): string { + $result = ''; + if ($node->conds) { + for ($i = 0, $c = \count($node->conds); $i + 1 < $c; $i++) { + $result .= $this->p($node->conds[$i]) . ', '; + } + $result .= $this->pKey($node->conds[$i]); + } else { + $result = 'default => '; + } + return $result . $this->p($node->body); + } + + protected function pExpr_ArrowFunction(Expr\ArrowFunction $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp( + Expr\ArrowFunction::class, + $this->pAttrGroups($node->attrGroups, true) + . $this->pStatic($node->static) + . 'fn' . ($node->byRef ? '&' : '') + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') + . ' => ', + $node->expr, $precedence, $lhsPrecedence); + } + + protected function pClosureUse(Node\ClosureUse $node): string { + return ($node->byRef ? '&' : '') . $this->p($node->var); + } + + protected function pExpr_New(Expr\New_ $node): string { + if ($node->class instanceof Stmt\Class_) { + $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : ''; + return 'new ' . $this->pClassCommon($node->class, $args); + } + return 'new ' . $this->pNewOperand($node->class) + . '(' . $this->pMaybeMultiline($node->args) . ')'; + } + + protected function pExpr_Clone(Expr\Clone_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Clone_::class, 'clone ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Ternary(Expr\Ternary $node, int $precedence, int $lhsPrecedence): string { + // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator. + // this is okay because the part between ? and : never needs parentheses. + return $this->pInfixOp(Expr\Ternary::class, + $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else, + $precedence, $lhsPrecedence + ); + } + + protected function pExpr_Exit(Expr\Exit_ $node): string { + $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE); + return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') + . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : ''); + } + + protected function pExpr_Throw(Expr\Throw_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Throw_::class, 'throw ', $node->expr, $precedence, $lhsPrecedence); + } + + protected function pExpr_Yield(Expr\Yield_ $node, int $precedence, int $lhsPrecedence): string { + if ($node->value === null) { + $opPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; + return $opPrecedence >= $lhsPrecedence ? '(yield)' : 'yield'; + } else { + if (!$this->phpVersion->supportsYieldWithoutParentheses()) { + return '(yield ' . $this->pKey($node->key) . $this->p($node->value) . ')'; + } + return $this->pPrefixOp( + Expr\Yield_::class, 'yield ' . $this->pKey($node->key), + $node->value, $precedence, $lhsPrecedence); + } + } + + // Declarations + + protected function pStmt_Namespace(Stmt\Namespace_ $node): string { + if ($this->canUseSemicolonNamespaces) { + return 'namespace ' . $this->p($node->name) . ';' + . $this->nl . $this->pStmts($node->stmts, false); + } else { + return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '') + . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + } + + protected function pStmt_Use(Stmt\Use_ $node): string { + return 'use ' . $this->pUseType($node->type) + . $this->pCommaSeparated($node->uses) . ';'; + } + + protected function pStmt_GroupUse(Stmt\GroupUse $node): string { + return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) + . '\{' . $this->pCommaSeparated($node->uses) . '};'; + } + + protected function pUseItem(Node\UseItem $node): string { + return $this->pUseType($node->type) . $this->p($node->name) + . (null !== $node->alias ? ' as ' . $node->alias : ''); + } + + protected function pUseType(int $type): string { + return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' + : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : ''); + } + + protected function pStmt_Interface(Stmt\Interface_ $node): string { + return $this->pAttrGroups($node->attrGroups) + . 'interface ' . $node->name + . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') + . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Enum(Stmt\Enum_ $node): string { + return $this->pAttrGroups($node->attrGroups) + . 'enum ' . $node->name + . ($node->scalarType ? ' : ' . $this->p($node->scalarType) : '') + . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') + . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Class(Stmt\Class_ $node): string { + return $this->pClassCommon($node, ' ' . $node->name); + } + + protected function pStmt_Trait(Stmt\Trait_ $node): string { + return $this->pAttrGroups($node->attrGroups) + . 'trait ' . $node->name + . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_EnumCase(Stmt\EnumCase $node): string { + return $this->pAttrGroups($node->attrGroups) + . 'case ' . $node->name + . ($node->expr ? ' = ' . $this->p($node->expr) : '') + . ';'; + } + + protected function pStmt_TraitUse(Stmt\TraitUse $node): string { + return 'use ' . $this->pCommaSeparated($node->traits) + . (empty($node->adaptations) + ? ';' + : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}'); + } + + protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node): string { + return $this->p($node->trait) . '::' . $node->method + . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';'; + } + + protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node): string { + return (null !== $node->trait ? $this->p($node->trait) . '::' : '') + . $node->method . ' as' + . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '') + . (null !== $node->newName ? ' ' . $node->newName : '') + . ';'; + } + + protected function pStmt_Property(Stmt\Property $node): string { + return $this->pAttrGroups($node->attrGroups) + . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) + . ($node->type ? $this->p($node->type) . ' ' : '') + . $this->pCommaSeparated($node->props) . ';'; + } + + protected function pPropertyItem(Node\PropertyItem $node): string { + return '$' . $node->name + . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); + } + + protected function pStmt_ClassMethod(Stmt\ClassMethod $node): string { + return $this->pAttrGroups($node->attrGroups) + . $this->pModifiers($node->flags) + . 'function ' . ($node->byRef ? '&' : '') . $node->name + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') + . (null !== $node->stmts + ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' + : ';'); + } + + protected function pStmt_ClassConst(Stmt\ClassConst $node): string { + return $this->pAttrGroups($node->attrGroups) + . $this->pModifiers($node->flags) + . 'const ' + . (null !== $node->type ? $this->p($node->type) . ' ' : '') + . $this->pCommaSeparated($node->consts) . ';'; + } + + protected function pStmt_Function(Stmt\Function_ $node): string { + return $this->pAttrGroups($node->attrGroups) + . 'function ' . ($node->byRef ? '&' : '') . $node->name + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') + . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Const(Stmt\Const_ $node): string { + return 'const ' . $this->pCommaSeparated($node->consts) . ';'; + } + + protected function pStmt_Declare(Stmt\Declare_ $node): string { + return 'declare (' . $this->pCommaSeparated($node->declares) . ')' + . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); + } + + protected function pDeclareItem(Node\DeclareItem $node): string { + return $node->key . '=' . $this->p($node->value); + } + + // Control flow + + protected function pStmt_If(Stmt\If_ $node): string { + return 'if (' . $this->p($node->cond) . ') {' + . $this->pStmts($node->stmts) . $this->nl . '}' + . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') + . (null !== $node->else ? ' ' . $this->p($node->else) : ''); + } + + protected function pStmt_ElseIf(Stmt\ElseIf_ $node): string { + return 'elseif (' . $this->p($node->cond) . ') {' + . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Else(Stmt\Else_ $node): string { + if (\count($node->stmts) === 1 && $node->stmts[0] instanceof Stmt\If_) { + // Print as "else if" rather than "else { if }" + return 'else ' . $this->p($node->stmts[0]); + } + return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_For(Stmt\For_ $node): string { + return 'for (' + . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') + . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') + . $this->pCommaSeparated($node->loop) + . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Foreach(Stmt\Foreach_ $node): string { + return 'foreach (' . $this->p($node->expr) . ' as ' + . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') + . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' + . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_While(Stmt\While_ $node): string { + return 'while (' . $this->p($node->cond) . ') {' + . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Do(Stmt\Do_ $node): string { + return 'do {' . $this->pStmts($node->stmts) . $this->nl + . '} while (' . $this->p($node->cond) . ');'; + } + + protected function pStmt_Switch(Stmt\Switch_ $node): string { + return 'switch (' . $this->p($node->cond) . ') {' + . $this->pStmts($node->cases) . $this->nl . '}'; + } + + protected function pStmt_Case(Stmt\Case_ $node): string { + return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' + . $this->pStmts($node->stmts); + } + + protected function pStmt_TryCatch(Stmt\TryCatch $node): string { + return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' + . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') + . ($node->finally !== null ? ' ' . $this->p($node->finally) : ''); + } + + protected function pStmt_Catch(Stmt\Catch_ $node): string { + return 'catch (' . $this->pImplode($node->types, '|') + . ($node->var !== null ? ' ' . $this->p($node->var) : '') + . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Finally(Stmt\Finally_ $node): string { + return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pStmt_Break(Stmt\Break_ $node): string { + return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; + } + + protected function pStmt_Continue(Stmt\Continue_ $node): string { + return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; + } + + protected function pStmt_Return(Stmt\Return_ $node): string { + return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';'; + } + + protected function pStmt_Label(Stmt\Label $node): string { + return $node->name . ':'; + } + + protected function pStmt_Goto(Stmt\Goto_ $node): string { + return 'goto ' . $node->name . ';'; + } + + // Other + + protected function pStmt_Expression(Stmt\Expression $node): string { + return $this->p($node->expr) . ';'; + } + + protected function pStmt_Echo(Stmt\Echo_ $node): string { + return 'echo ' . $this->pCommaSeparated($node->exprs) . ';'; + } + + protected function pStmt_Static(Stmt\Static_ $node): string { + return 'static ' . $this->pCommaSeparated($node->vars) . ';'; + } + + protected function pStmt_Global(Stmt\Global_ $node): string { + return 'global ' . $this->pCommaSeparated($node->vars) . ';'; + } + + protected function pStaticVar(Node\StaticVar $node): string { + return $this->p($node->var) + . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); + } + + protected function pStmt_Unset(Stmt\Unset_ $node): string { + return 'unset(' . $this->pCommaSeparated($node->vars) . ');'; + } + + protected function pStmt_InlineHTML(Stmt\InlineHTML $node): string { + $newline = $node->getAttribute('hasLeadingNewline', true) ? $this->newline : ''; + return '?>' . $newline . $node->value . 'remaining; + } + + protected function pStmt_Nop(Stmt\Nop $node): string { + return ''; + } + + protected function pStmt_Block(Stmt\Block $node): string { + return '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + // Helpers + + protected function pClassCommon(Stmt\Class_ $node, string $afterClassToken): string { + return $this->pAttrGroups($node->attrGroups, $node->name === null) + . $this->pModifiers($node->flags) + . 'class' . $afterClassToken + . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '') + . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') + . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + + protected function pObjectProperty(Node $node): string { + if ($node instanceof Expr) { + return '{' . $this->p($node) . '}'; + } else { + assert($node instanceof Node\Identifier); + return $node->name; + } + } + + /** @param (Expr|Node\InterpolatedStringPart)[] $encapsList */ + protected function pEncapsList(array $encapsList, ?string $quote): string { + $return = ''; + foreach ($encapsList as $element) { + if ($element instanceof Node\InterpolatedStringPart) { + $return .= $this->escapeString($element->value, $quote); + } else { + $return .= '{' . $this->p($element) . '}'; + } + } + + return $return; + } + + protected function pSingleQuotedString(string $string): string { + // It is idiomatic to only escape backslashes when necessary, i.e. when followed by ', \ or + // the end of the string ('Foo\Bar' instead of 'Foo\\Bar'). However, we also don't want to + // produce an odd number of backslashes, so '\\\\a' should not get rendered as '\\\a', even + // though that would be legal. + $regex = '/\'|\\\\(?=[\'\\\\]|$)|(?<=\\\\)\\\\/'; + return '\'' . preg_replace($regex, '\\\\$0', $string) . '\''; + } + + protected function escapeString(string $string, ?string $quote): string { + if (null === $quote) { + // For doc strings, don't escape newlines + $escaped = addcslashes($string, "\t\f\v$\\"); + // But do escape isolated \r. Combined with the terminating newline, it might get + // interpreted as \r\n and dropped from the string contents. + $escaped = preg_replace('/\r(?!\n)/', '\\r', $escaped); + if ($this->phpVersion->supportsFlexibleHeredoc()) { + $escaped = $this->indentString($escaped); + } + } else { + $escaped = addcslashes($string, "\n\r\t\f\v$" . $quote . "\\"); + } + + // Escape control characters and non-UTF-8 characters. + // Regex based on https://stackoverflow.com/a/11709412/385378. + $regex = '/( + [\x00-\x08\x0E-\x1F] # Control characters + | [\xC0-\xC1] # Invalid UTF-8 Bytes + | [\xF5-\xFF] # Invalid UTF-8 Bytes + | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point + | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point + | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start + | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start + | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start + | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle + | (? $part) { + if ($part instanceof Node\InterpolatedStringPart + && $this->containsEndLabel($this->escapeString($part->value, null), $label, $i === 0) + ) { + return true; + } + } + return false; + } + + protected function pDereferenceLhs(Node $node): string { + if (!$this->dereferenceLhsRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + + protected function pStaticDereferenceLhs(Node $node): string { + if (!$this->staticDereferenceLhsRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + + protected function pCallLhs(Node $node): string { + if (!$this->callLhsRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + + protected function pNewOperand(Node $node): string { + if (!$this->newOperandRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + + /** + * @param Node[] $nodes + */ + protected function hasNodeWithComments(array $nodes): bool { + foreach ($nodes as $node) { + if ($node && $node->getComments()) { + return true; + } + } + return false; + } + + /** @param Node[] $nodes */ + protected function pMaybeMultiline(array $nodes, bool $trailingComma = false): string { + if (!$this->hasNodeWithComments($nodes)) { + return $this->pCommaSeparated($nodes); + } else { + return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl; + } + } + + /** @param Node\AttributeGroup[] $nodes */ + protected function pAttrGroups(array $nodes, bool $inline = false): string { + $result = ''; + $sep = $inline ? ' ' : $this->nl; + foreach ($nodes as $node) { + $result .= $this->p($node) . $sep; + } + + return $result; + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php new file mode 100644 index 0000000..8303c42 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php @@ -0,0 +1,1655 @@ + */ + protected array $precedenceMap = [ + // [precedence, precedenceLHS, precedenceRHS] + // Where the latter two are the precedences to use for the LHS and RHS of a binary operator, + // where 1 is added to one of the sides depending on associativity. This information is not + // used for unary operators and set to -1. + Expr\Clone_::class => [-10, 0, 1], + BinaryOp\Pow::class => [ 0, 0, 1], + Expr\BitwiseNot::class => [ 10, -1, -1], + Expr\UnaryPlus::class => [ 10, -1, -1], + Expr\UnaryMinus::class => [ 10, -1, -1], + Cast\Int_::class => [ 10, -1, -1], + Cast\Double::class => [ 10, -1, -1], + Cast\String_::class => [ 10, -1, -1], + Cast\Array_::class => [ 10, -1, -1], + Cast\Object_::class => [ 10, -1, -1], + Cast\Bool_::class => [ 10, -1, -1], + Cast\Unset_::class => [ 10, -1, -1], + Expr\ErrorSuppress::class => [ 10, -1, -1], + Expr\Instanceof_::class => [ 20, -1, -1], + Expr\BooleanNot::class => [ 30, -1, -1], + BinaryOp\Mul::class => [ 40, 41, 40], + BinaryOp\Div::class => [ 40, 41, 40], + BinaryOp\Mod::class => [ 40, 41, 40], + BinaryOp\Plus::class => [ 50, 51, 50], + BinaryOp\Minus::class => [ 50, 51, 50], + BinaryOp\Concat::class => [ 50, 51, 50], + BinaryOp\ShiftLeft::class => [ 60, 61, 60], + BinaryOp\ShiftRight::class => [ 60, 61, 60], + BinaryOp\Smaller::class => [ 70, 70, 70], + BinaryOp\SmallerOrEqual::class => [ 70, 70, 70], + BinaryOp\Greater::class => [ 70, 70, 70], + BinaryOp\GreaterOrEqual::class => [ 70, 70, 70], + BinaryOp\Equal::class => [ 80, 80, 80], + BinaryOp\NotEqual::class => [ 80, 80, 80], + BinaryOp\Identical::class => [ 80, 80, 80], + BinaryOp\NotIdentical::class => [ 80, 80, 80], + BinaryOp\Spaceship::class => [ 80, 80, 80], + BinaryOp\BitwiseAnd::class => [ 90, 91, 90], + BinaryOp\BitwiseXor::class => [100, 101, 100], + BinaryOp\BitwiseOr::class => [110, 111, 110], + BinaryOp\BooleanAnd::class => [120, 121, 120], + BinaryOp\BooleanOr::class => [130, 131, 130], + BinaryOp\Coalesce::class => [140, 140, 141], + Expr\Ternary::class => [150, -1, -1], + Expr\Assign::class => [160, -1, -1], + Expr\AssignRef::class => [160, -1, -1], + AssignOp\Plus::class => [160, -1, -1], + AssignOp\Minus::class => [160, -1, -1], + AssignOp\Mul::class => [160, -1, -1], + AssignOp\Div::class => [160, -1, -1], + AssignOp\Concat::class => [160, -1, -1], + AssignOp\Mod::class => [160, -1, -1], + AssignOp\BitwiseAnd::class => [160, -1, -1], + AssignOp\BitwiseOr::class => [160, -1, -1], + AssignOp\BitwiseXor::class => [160, -1, -1], + AssignOp\ShiftLeft::class => [160, -1, -1], + AssignOp\ShiftRight::class => [160, -1, -1], + AssignOp\Pow::class => [160, -1, -1], + AssignOp\Coalesce::class => [160, -1, -1], + Expr\YieldFrom::class => [170, -1, -1], + Expr\Yield_::class => [175, -1, -1], + Expr\Print_::class => [180, -1, -1], + BinaryOp\LogicalAnd::class => [190, 191, 190], + BinaryOp\LogicalXor::class => [200, 201, 200], + BinaryOp\LogicalOr::class => [210, 211, 210], + Expr\Include_::class => [220, -1, -1], + Expr\ArrowFunction::class => [230, -1, -1], + Expr\Throw_::class => [240, -1, -1], + ]; + + /** @var int Current indentation level. */ + protected int $indentLevel; + /** @var string Newline style. Does not include current indentation. */ + protected string $newline; + /** @var string Newline including current indentation. */ + protected string $nl; + /** @var string|null Token placed at end of doc string to ensure it is followed by a newline. + * Null if flexible doc strings are used. */ + protected ?string $docStringEndToken; + /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */ + protected bool $canUseSemicolonNamespaces; + /** @var bool Whether to use short array syntax if the node specifies no preference */ + protected bool $shortArraySyntax; + /** @var PhpVersion PHP version to target */ + protected PhpVersion $phpVersion; + + /** @var TokenStream|null Original tokens for use in format-preserving pretty print */ + protected ?TokenStream $origTokens; + /** @var Internal\Differ Differ for node lists */ + protected Differ $nodeListDiffer; + /** @var array Map determining whether a certain character is a label character */ + protected array $labelCharMap; + /** + * @var array> Map from token classes and subnode names to FIXUP_* constants. + * This is used during format-preserving prints to place additional parens/braces if necessary. + */ + protected array $fixupMap; + /** + * @var array Map from "{$node->getType()}->{$subNode}" + * to ['left' => $l, 'right' => $r], where $l and $r specify the token type that needs to be stripped + * when removing this node. + */ + protected array $removalMap; + /** + * @var array Map from + * "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. + * $find is an optional token after which the insertion occurs. $extraLeft/Right + * are optionally added before/after the main insertions. + */ + protected array $insertionMap; + /** + * @var array Map From "{$class}->{$subNode}" to string that should be inserted + * between elements of this list subnode. + */ + protected array $listInsertionMap; + + /** + * @var array + */ + protected array $emptyListInsertionMap; + /** @var array Map from "{$class}->{$subNode}" to [$printFn, $token] + * where $printFn is the function to print the modifiers and $token is the token before which + * the modifiers should be reprinted. */ + protected array $modifierChangeMap; + + /** + * Creates a pretty printer instance using the given options. + * + * Supported options: + * * PhpVersion $phpVersion: The PHP version to target (default to PHP 7.4). This option + * controls compatibility of the generated code with older PHP + * versions in cases where a simple stylistic choice exists (e.g. + * array() vs []). It is safe to pretty-print an AST for a newer + * PHP version while specifying an older target (but the result will + * of course not be compatible with the older version in that case). + * * string $newline: The newline style to use. Should be "\n" (default) or "\r\n". + * * bool $shortArraySyntax: Whether to use [] instead of array() as the default array + * syntax, if the node does not specify a format. Defaults to whether + * the phpVersion support short array syntax. + * + * @param array{ + * phpVersion?: PhpVersion, newline?: string, shortArraySyntax?: bool + * } $options Dictionary of formatting options + */ + public function __construct(array $options = []) { + $this->phpVersion = $options['phpVersion'] ?? PhpVersion::fromComponents(7, 4); + + $this->newline = $options['newline'] ?? "\n"; + if ($this->newline !== "\n" && $this->newline != "\r\n") { + throw new \LogicException('Option "newline" must be one of "\n" or "\r\n"'); + } + + $this->shortArraySyntax = + $options['shortArraySyntax'] ?? $this->phpVersion->supportsShortArraySyntax(); + $this->docStringEndToken = + $this->phpVersion->supportsFlexibleHeredoc() ? null : '_DOC_STRING_END_' . mt_rand(); + } + + /** + * Reset pretty printing state. + */ + protected function resetState(): void { + $this->indentLevel = 0; + $this->nl = $this->newline; + $this->origTokens = null; + } + + /** + * Set indentation level + * + * @param int $level Level in number of spaces + */ + protected function setIndentLevel(int $level): void { + $this->indentLevel = $level; + $this->nl = $this->newline . \str_repeat(' ', $level); + } + + /** + * Increase indentation level. + */ + protected function indent(): void { + $this->indentLevel += 4; + $this->nl .= ' '; + } + + /** + * Decrease indentation level. + */ + protected function outdent(): void { + assert($this->indentLevel >= 4); + $this->indentLevel -= 4; + $this->nl = $this->newline . str_repeat(' ', $this->indentLevel); + } + + /** + * Pretty prints an array of statements. + * + * @param Node[] $stmts Array of statements + * + * @return string Pretty printed statements + */ + public function prettyPrint(array $stmts): string { + $this->resetState(); + $this->preprocessNodes($stmts); + + return ltrim($this->handleMagicTokens($this->pStmts($stmts, false))); + } + + /** + * Pretty prints an expression. + * + * @param Expr $node Expression node + * + * @return string Pretty printed node + */ + public function prettyPrintExpr(Expr $node): string { + $this->resetState(); + return $this->handleMagicTokens($this->p($node)); + } + + /** + * Pretty prints a file of statements (includes the opening newline . $this->newline; + } + + $p = "newline . $this->newline . $this->prettyPrint($stmts); + + if ($stmts[0] instanceof Stmt\InlineHTML) { + $p = preg_replace('/^<\?php\s+\?>\r?\n?/', '', $p); + } + if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) { + $p = preg_replace('/<\?php$/', '', rtrim($p)); + } + + return $p; + } + + /** + * Preprocesses the top-level nodes to initialize pretty printer state. + * + * @param Node[] $nodes Array of nodes + */ + protected function preprocessNodes(array $nodes): void { + /* We can use semicolon-namespaces unless there is a global namespace declaration */ + $this->canUseSemicolonNamespaces = true; + foreach ($nodes as $node) { + if ($node instanceof Stmt\Namespace_ && null === $node->name) { + $this->canUseSemicolonNamespaces = false; + break; + } + } + } + + /** + * Handles (and removes) doc-string-end tokens. + */ + protected function handleMagicTokens(string $str): string { + if ($this->docStringEndToken !== null) { + // Replace doc-string-end tokens with nothing or a newline + $str = str_replace( + $this->docStringEndToken . ';' . $this->newline, + ';' . $this->newline, + $str); + $str = str_replace($this->docStringEndToken, $this->newline, $str); + } + + return $str; + } + + /** + * Pretty prints an array of nodes (statements) and indents them optionally. + * + * @param Node[] $nodes Array of nodes + * @param bool $indent Whether to indent the printed nodes + * + * @return string Pretty printed statements + */ + protected function pStmts(array $nodes, bool $indent = true): string { + if ($indent) { + $this->indent(); + } + + $result = ''; + foreach ($nodes as $node) { + $comments = $node->getComments(); + if ($comments) { + $result .= $this->nl . $this->pComments($comments); + if ($node instanceof Stmt\Nop) { + continue; + } + } + + $result .= $this->nl . $this->p($node); + } + + if ($indent) { + $this->outdent(); + } + + return $result; + } + + /** + * Pretty-print an infix operation while taking precedence into account. + * + * @param string $class Node class of operator + * @param Node $leftNode Left-hand side node + * @param string $operatorString String representation of the operator + * @param Node $rightNode Right-hand side node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator + * + * @return string Pretty printed infix operation + */ + protected function pInfixOp( + string $class, Node $leftNode, string $operatorString, Node $rightNode, + int $precedence, int $lhsPrecedence + ): string { + list($opPrecedence, $newPrecedenceLHS, $newPrecedenceRHS) = $this->precedenceMap[$class]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $precedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; + } + return $prefix . $this->p($leftNode, $newPrecedenceLHS, $newPrecedenceLHS) + . $operatorString . $this->p($rightNode, $newPrecedenceRHS, $lhsPrecedence) . $suffix; + } + + /** + * Pretty-print a prefix operation while taking precedence into account. + * + * @param string $class Node class of operator + * @param string $operatorString String representation of the operator + * @param Node $node Node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator + * + * @return string Pretty printed prefix operation + */ + protected function pPrefixOp(string $class, string $operatorString, Node $node, int $precedence, int $lhsPrecedence): string { + $opPrecedence = $this->precedenceMap[$class][0]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $lhsPrecedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; + } + $printedArg = $this->p($node, $opPrecedence, $lhsPrecedence); + if (($operatorString === '+' && $printedArg[0] === '+') || + ($operatorString === '-' && $printedArg[0] === '-') + ) { + // Avoid printing +(+$a) as ++$a and similar. + $printedArg = '(' . $printedArg . ')'; + } + return $prefix . $operatorString . $printedArg . $suffix; + } + + /** + * Pretty-print a postfix operation while taking precedence into account. + * + * @param string $class Node class of operator + * @param string $operatorString String representation of the operator + * @param Node $node Node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator + * + * @return string Pretty printed postfix operation + */ + protected function pPostfixOp(string $class, Node $node, string $operatorString, int $precedence, int $lhsPrecedence): string { + $opPrecedence = $this->precedenceMap[$class][0]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $precedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; + } + if ($opPrecedence < $lhsPrecedence) { + $lhsPrecedence = $opPrecedence; + } + return $prefix . $this->p($node, $opPrecedence, $lhsPrecedence) . $operatorString . $suffix; + } + + /** + * Pretty prints an array of nodes and implodes the printed values. + * + * @param Node[] $nodes Array of Nodes to be printed + * @param string $glue Character to implode with + * + * @return string Imploded pretty printed nodes> $pre + */ + protected function pImplode(array $nodes, string $glue = ''): string { + $pNodes = []; + foreach ($nodes as $node) { + if (null === $node) { + $pNodes[] = ''; + } else { + $pNodes[] = $this->p($node); + } + } + + return implode($glue, $pNodes); + } + + /** + * Pretty prints an array of nodes and implodes the printed values with commas. + * + * @param Node[] $nodes Array of Nodes to be printed + * + * @return string Comma separated pretty printed nodes + */ + protected function pCommaSeparated(array $nodes): string { + return $this->pImplode($nodes, ', '); + } + + /** + * Pretty prints a comma-separated list of nodes in multiline style, including comments. + * + * The result includes a leading newline and one level of indentation (same as pStmts). + * + * @param Node[] $nodes Array of Nodes to be printed + * @param bool $trailingComma Whether to use a trailing comma + * + * @return string Comma separated pretty printed nodes in multiline style + */ + protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma): string { + $this->indent(); + + $result = ''; + $lastIdx = count($nodes) - 1; + foreach ($nodes as $idx => $node) { + if ($node !== null) { + $comments = $node->getComments(); + if ($comments) { + $result .= $this->nl . $this->pComments($comments); + } + + $result .= $this->nl . $this->p($node); + } else { + $result .= $this->nl; + } + if ($trailingComma || $idx !== $lastIdx) { + $result .= ','; + } + } + + $this->outdent(); + return $result; + } + + /** + * Prints reformatted text of the passed comments. + * + * @param Comment[] $comments List of comments + * + * @return string Reformatted text of comments + */ + protected function pComments(array $comments): string { + $formattedComments = []; + + foreach ($comments as $comment) { + $formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText()); + } + + return implode($this->nl, $formattedComments); + } + + /** + * Perform a format-preserving pretty print of an AST. + * + * The format preservation is best effort. For some changes to the AST the formatting will not + * be preserved (at least not locally). + * + * In order to use this method a number of prerequisites must be satisfied: + * * The startTokenPos and endTokenPos attributes in the lexer must be enabled. + * * The CloningVisitor must be run on the AST prior to modification. + * * The original tokens must be provided, using the getTokens() method on the lexer. + * + * @param Node[] $stmts Modified AST with links to original AST + * @param Node[] $origStmts Original AST with token offset information + * @param Token[] $origTokens Tokens of the original code + */ + public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string { + $this->initializeNodeListDiffer(); + $this->initializeLabelCharMap(); + $this->initializeFixupMap(); + $this->initializeRemovalMap(); + $this->initializeInsertionMap(); + $this->initializeListInsertionMap(); + $this->initializeEmptyListInsertionMap(); + $this->initializeModifierChangeMap(); + + $this->resetState(); + $this->origTokens = new TokenStream($origTokens); + + $this->preprocessNodes($stmts); + + $pos = 0; + $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null); + if (null !== $result) { + $result .= $this->origTokens->getTokenCode($pos, count($origTokens) - 1, 0); + } else { + // Fallback + // TODO Add newline . $this->pStmts($stmts, false); + } + + return $this->handleMagicTokens($result); + } + + protected function pFallback(Node $node, int $precedence, int $lhsPrecedence): string { + return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); + } + + /** + * Pretty prints a node. + * + * This method also handles formatting preservation for nodes. + * + * @param Node $node Node to be pretty printed + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator + * @param bool $parentFormatPreserved Whether parent node has preserved formatting + * + * @return string Pretty printed node + */ + protected function p( + Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE, + bool $parentFormatPreserved = false + ): string { + // No orig tokens means this is a normal pretty print without preservation of formatting + if (!$this->origTokens) { + return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); + } + + /** @var Node|null $origNode */ + $origNode = $node->getAttribute('origNode'); + if (null === $origNode) { + return $this->pFallback($node, $precedence, $lhsPrecedence); + } + + $class = \get_class($node); + \assert($class === \get_class($origNode)); + + $startPos = $origNode->getStartTokenPos(); + $endPos = $origNode->getEndTokenPos(); + \assert($startPos >= 0 && $endPos >= 0); + + $fallbackNode = $node; + if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) { + // Normalize node structure of anonymous classes + assert($origNode instanceof Expr\New_); + $node = PrintableNewAnonClassNode::fromNewNode($node); + $origNode = PrintableNewAnonClassNode::fromNewNode($origNode); + $class = PrintableNewAnonClassNode::class; + } + + // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting + // is not preserved, then we need to use the fallback code to make sure the tags are + // printed. + if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); + } + + $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos); + + $type = $node->getType(); + $fixupInfo = $this->fixupMap[$class] ?? null; + + $result = ''; + $pos = $startPos; + foreach ($node->getSubNodeNames() as $subNodeName) { + $subNode = $node->$subNodeName; + $origSubNode = $origNode->$subNodeName; + + if ((!$subNode instanceof Node && $subNode !== null) + || (!$origSubNode instanceof Node && $origSubNode !== null) + ) { + if ($subNode === $origSubNode) { + // Unchanged, can reuse old code + continue; + } + + if (is_array($subNode) && is_array($origSubNode)) { + // Array subnode changed, we might be able to reconstruct it + $listResult = $this->pArray( + $subNode, $origSubNode, $pos, $indentAdjustment, $class, $subNodeName, + $fixupInfo[$subNodeName] ?? null + ); + if (null === $listResult) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); + } + + $result .= $listResult; + continue; + } + + // Check if this is a modifier change + $key = $class . '->' . $subNodeName; + if (!isset($this->modifierChangeMap[$key])) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); + } + + [$printFn, $findToken] = $this->modifierChangeMap[$key]; + $result .= $this->$printFn($subNode); + $pos = $this->origTokens->findRight($pos, $findToken); + continue; + } + + $extraLeft = ''; + $extraRight = ''; + if ($origSubNode !== null) { + $subStartPos = $origSubNode->getStartTokenPos(); + $subEndPos = $origSubNode->getEndTokenPos(); + \assert($subStartPos >= 0 && $subEndPos >= 0); + } else { + if ($subNode === null) { + // Both null, nothing to do + continue; + } + + // A node has been inserted, check if we have insertion information for it + $key = $type . '->' . $subNodeName; + if (!isset($this->insertionMap[$key])) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); + } + + list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key]; + if (null !== $findToken) { + $subStartPos = $this->origTokens->findRight($pos, $findToken) + + (int) !$beforeToken; + } else { + $subStartPos = $pos; + } + + if (null === $extraLeft && null !== $extraRight) { + // If inserting on the right only, skipping whitespace looks better + $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos); + } + $subEndPos = $subStartPos - 1; + } + + if (null === $subNode) { + // A node has been removed, check if we have removal information for it + $key = $type . '->' . $subNodeName; + if (!isset($this->removalMap[$key])) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); + } + + // Adjust positions to account for additional tokens that must be skipped + $removalInfo = $this->removalMap[$key]; + if (isset($removalInfo['left'])) { + $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1; + } + if (isset($removalInfo['right'])) { + $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1; + } + } + + $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment); + + if (null !== $subNode) { + $result .= $extraLeft; + + $origIndentLevel = $this->indentLevel; + $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); + + // If it's the same node that was previously in this position, it certainly doesn't + // need fixup. It's important to check this here, because our fixup checks are more + // conservative than strictly necessary. + if (isset($fixupInfo[$subNodeName]) + && $subNode->getAttribute('origNode') !== $origSubNode + ) { + $fixup = $fixupInfo[$subNodeName]; + $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos); + } else { + $res = $this->p($subNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); + } + + $this->safeAppend($result, $res); + $this->setIndentLevel($origIndentLevel); + + $result .= $extraRight; + } + + $pos = $subEndPos + 1; + } + + $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment); + return $result; + } + + /** + * Perform a format-preserving pretty print of an array. + * + * @param Node[] $nodes New nodes + * @param Node[] $origNodes Original nodes + * @param int $pos Current token position (updated by reference) + * @param int $indentAdjustment Adjustment for indentation + * @param string $parentNodeClass Class of the containing node. + * @param string $subNodeName Name of array subnode. + * @param null|int $fixup Fixup information for array item nodes + * + * @return null|string Result of pretty print or null if cannot preserve formatting + */ + protected function pArray( + array $nodes, array $origNodes, int &$pos, int $indentAdjustment, + string $parentNodeClass, string $subNodeName, ?int $fixup + ): ?string { + $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes); + + $mapKey = $parentNodeClass . '->' . $subNodeName; + $insertStr = $this->listInsertionMap[$mapKey] ?? null; + $isStmtList = $subNodeName === 'stmts'; + + $beforeFirstKeepOrReplace = true; + $skipRemovedNode = false; + $delayedAdd = []; + $lastElemIndentLevel = $this->indentLevel; + + $insertNewline = false; + if ($insertStr === "\n") { + $insertStr = ''; + $insertNewline = true; + } + + if ($isStmtList && \count($origNodes) === 1 && \count($nodes) !== 1) { + $startPos = $origNodes[0]->getStartTokenPos(); + $endPos = $origNodes[0]->getEndTokenPos(); + \assert($startPos >= 0 && $endPos >= 0); + if (!$this->origTokens->haveBraces($startPos, $endPos)) { + // This was a single statement without braces, but either additional statements + // have been added, or the single statement has been removed. This requires the + // addition of braces. For now fall back. + // TODO: Try to preserve formatting + return null; + } + } + + $result = ''; + foreach ($diff as $i => $diffElem) { + $diffType = $diffElem->type; + /** @var Node|string|null $arrItem */ + $arrItem = $diffElem->new; + /** @var Node|string|null $origArrItem */ + $origArrItem = $diffElem->old; + + if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { + $beforeFirstKeepOrReplace = false; + + if ($origArrItem === null || $arrItem === null) { + // We can only handle the case where both are null + if ($origArrItem === $arrItem) { + continue; + } + return null; + } + + if (!$arrItem instanceof Node || !$origArrItem instanceof Node) { + // We can only deal with nodes. This can occur for Names, which use string arrays. + return null; + } + + $itemStartPos = $origArrItem->getStartTokenPos(); + $itemEndPos = $origArrItem->getEndTokenPos(); + \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); + + $origIndentLevel = $this->indentLevel; + $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; + $this->setIndentLevel($lastElemIndentLevel); + + $comments = $arrItem->getComments(); + $origComments = $origArrItem->getComments(); + $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos; + \assert($commentStartPos >= 0); + + if ($commentStartPos < $pos) { + // Comments may be assigned to multiple nodes if they start at the same position. + // Make sure we don't try to print them multiple times. + $commentStartPos = $itemStartPos; + } + + if ($skipRemovedNode) { + if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { + // We'd remove an opening/closing PHP tag. + // TODO: Preserve formatting. + $this->setIndentLevel($origIndentLevel); + return null; + } + } else { + $result .= $this->origTokens->getTokenCode( + $pos, $commentStartPos, $indentAdjustment); + } + + if (!empty($delayedAdd)) { + /** @var Node $delayedAddNode */ + foreach ($delayedAdd as $delayedAddNode) { + if ($insertNewline) { + $delayedAddComments = $delayedAddNode->getComments(); + if ($delayedAddComments) { + $result .= $this->pComments($delayedAddComments) . $this->nl; + } + } + + $this->safeAppend($result, $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true)); + + if ($insertNewline) { + $result .= $insertStr . $this->nl; + } else { + $result .= $insertStr; + } + } + + $delayedAdd = []; + } + + if ($comments !== $origComments) { + if ($comments) { + $result .= $this->pComments($comments) . $this->nl; + } + } else { + $result .= $this->origTokens->getTokenCode( + $commentStartPos, $itemStartPos, $indentAdjustment); + } + + // If we had to remove anything, we have done so now. + $skipRemovedNode = false; + } elseif ($diffType === DiffElem::TYPE_ADD) { + if (null === $insertStr) { + // We don't have insertion information for this list type + return null; + } + + if (!$arrItem instanceof Node) { + // We only support list insertion of nodes. + return null; + } + + // We go multiline if the original code was multiline, + // or if it's an array item with a comment above it. + // Match always uses multiline formatting. + if ($insertStr === ', ' && + ($this->isMultiline($origNodes) || $arrItem->getComments() || + $parentNodeClass === Expr\Match_::class) + ) { + $insertStr = ','; + $insertNewline = true; + } + + if ($beforeFirstKeepOrReplace) { + // Will be inserted at the next "replace" or "keep" element + $delayedAdd[] = $arrItem; + continue; + } + + $itemStartPos = $pos; + $itemEndPos = $pos - 1; + + $origIndentLevel = $this->indentLevel; + $this->setIndentLevel($lastElemIndentLevel); + + if ($insertNewline) { + $result .= $insertStr . $this->nl; + $comments = $arrItem->getComments(); + if ($comments) { + $result .= $this->pComments($comments) . $this->nl; + } + } else { + $result .= $insertStr; + } + } elseif ($diffType === DiffElem::TYPE_REMOVE) { + if (!$origArrItem instanceof Node) { + // We only support removal for nodes + return null; + } + + $itemStartPos = $origArrItem->getStartTokenPos(); + $itemEndPos = $origArrItem->getEndTokenPos(); + \assert($itemStartPos >= 0 && $itemEndPos >= 0); + + // Consider comments part of the node. + $origComments = $origArrItem->getComments(); + if ($origComments) { + $itemStartPos = $origComments[0]->getStartTokenPos(); + } + + if ($i === 0) { + // If we're removing from the start, keep the tokens before the node and drop those after it, + // instead of the other way around. + $result .= $this->origTokens->getTokenCode( + $pos, $itemStartPos, $indentAdjustment); + $skipRemovedNode = true; + } else { + if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { + // We'd remove an opening/closing PHP tag. + // TODO: Preserve formatting. + return null; + } + } + + $pos = $itemEndPos + 1; + continue; + } else { + throw new \Exception("Shouldn't happen"); + } + + if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) { + $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos); + } else { + $res = $this->p($arrItem, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); + } + $this->safeAppend($result, $res); + + $this->setIndentLevel($origIndentLevel); + $pos = $itemEndPos + 1; + } + + if ($skipRemovedNode) { + // TODO: Support removing single node. + return null; + } + + if (!empty($delayedAdd)) { + if (!isset($this->emptyListInsertionMap[$mapKey])) { + return null; + } + + list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey]; + if (null !== $findToken) { + $insertPos = $this->origTokens->findRight($pos, $findToken) + 1; + $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment); + $pos = $insertPos; + } + + $first = true; + $result .= $extraLeft; + foreach ($delayedAdd as $delayedAddNode) { + if (!$first) { + $result .= $insertStr; + if ($insertNewline) { + $result .= $this->nl; + } + } + $result .= $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); + $first = false; + } + $result .= $extraRight === "\n" ? $this->nl : $extraRight; + } + + return $result; + } + + /** + * Print node with fixups. + * + * Fixups here refer to the addition of extra parentheses, braces or other characters, that + * are required to preserve program semantics in a certain context (e.g. to maintain precedence + * or because only certain expressions are allowed in certain places). + * + * @param int $fixup Fixup type + * @param Node $subNode Subnode to print + * @param string|null $parentClass Class of parent node + * @param int $subStartPos Original start pos of subnode + * @param int $subEndPos Original end pos of subnode + * + * @return string Result of fixed-up print of subnode + */ + protected function pFixup(int $fixup, Node $subNode, ?string $parentClass, int $subStartPos, int $subEndPos): string { + switch ($fixup) { + case self::FIXUP_PREC_LEFT: + // We use a conservative approximation where lhsPrecedence == precedence. + if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { + $precedence = $this->precedenceMap[$parentClass][1]; + return $this->p($subNode, $precedence, $precedence); + } + break; + case self::FIXUP_PREC_RIGHT: + if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { + $precedence = $this->precedenceMap[$parentClass][2]; + return $this->p($subNode, $precedence, $precedence); + } + break; + case self::FIXUP_PREC_UNARY: + if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { + $precedence = $this->precedenceMap[$parentClass][0]; + return $this->p($subNode, $precedence, $precedence); + } + break; + case self::FIXUP_CALL_LHS: + if ($this->callLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_DEREF_LHS: + if ($this->dereferenceLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_STATIC_DEREF_LHS: + if ($this->staticDereferenceLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_NEW: + if ($this->newOperandRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos)) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_BRACED_NAME: + case self::FIXUP_VAR_BRACED_NAME: + if ($subNode instanceof Expr + && !$this->origTokens->haveBraces($subStartPos, $subEndPos) + ) { + return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '') + . '{' . $this->p($subNode) . '}'; + } + break; + case self::FIXUP_ENCAPSED: + if (!$subNode instanceof Node\InterpolatedStringPart + && !$this->origTokens->haveBraces($subStartPos, $subEndPos) + ) { + return '{' . $this->p($subNode) . '}'; + } + break; + default: + throw new \Exception('Cannot happen'); + } + + // Nothing special to do + return $this->p($subNode); + } + + /** + * Appends to a string, ensuring whitespace between label characters. + * + * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x". + * Without safeAppend the result would be "echox", which does not preserve semantics. + */ + protected function safeAppend(string &$str, string $append): void { + if ($str === "") { + $str = $append; + return; + } + + if ($append === "") { + return; + } + + if (!$this->labelCharMap[$append[0]] + || !$this->labelCharMap[$str[\strlen($str) - 1]]) { + $str .= $append; + } else { + $str .= " " . $append; + } + } + + /** + * Determines whether the LHS of a call must be wrapped in parenthesis. + * + * @param Node $node LHS of a call + * + * @return bool Whether parentheses are required + */ + protected function callLhsRequiresParens(Node $node): bool { + return !($node instanceof Node\Name + || $node instanceof Expr\Variable + || $node instanceof Expr\ArrayDimFetch + || $node instanceof Expr\FuncCall + || $node instanceof Expr\MethodCall + || $node instanceof Expr\NullsafeMethodCall + || $node instanceof Expr\StaticCall + || $node instanceof Expr\Array_); + } + + /** + * Determines whether the LHS of an array/object operation must be wrapped in parentheses. + * + * @param Node $node LHS of dereferencing operation + * + * @return bool Whether parentheses are required + */ + protected function dereferenceLhsRequiresParens(Node $node): bool { + // A constant can occur on the LHS of an array/object deref, but not a static deref. + return $this->staticDereferenceLhsRequiresParens($node) + && !$node instanceof Expr\ConstFetch; + } + + /** + * Determines whether the LHS of a static operation must be wrapped in parentheses. + * + * @param Node $node LHS of dereferencing operation + * + * @return bool Whether parentheses are required + */ + protected function staticDereferenceLhsRequiresParens(Node $node): bool { + return !($node instanceof Expr\Variable + || $node instanceof Node\Name + || $node instanceof Expr\ArrayDimFetch + || $node instanceof Expr\PropertyFetch + || $node instanceof Expr\NullsafePropertyFetch + || $node instanceof Expr\StaticPropertyFetch + || $node instanceof Expr\FuncCall + || $node instanceof Expr\MethodCall + || $node instanceof Expr\NullsafeMethodCall + || $node instanceof Expr\StaticCall + || $node instanceof Expr\Array_ + || $node instanceof Scalar\String_ + || $node instanceof Expr\ClassConstFetch); + } + + /** + * Determines whether an expression used in "new" or "instanceof" requires parentheses. + * + * @param Node $node New or instanceof operand + * + * @return bool Whether parentheses are required + */ + protected function newOperandRequiresParens(Node $node): bool { + if ($node instanceof Node\Name || $node instanceof Expr\Variable) { + return false; + } + if ($node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || + $node instanceof Expr\NullsafePropertyFetch + ) { + return $this->newOperandRequiresParens($node->var); + } + if ($node instanceof Expr\StaticPropertyFetch) { + return $this->newOperandRequiresParens($node->class); + } + return true; + } + + /** + * Print modifiers, including trailing whitespace. + * + * @param int $modifiers Modifier mask to print + * + * @return string Printed modifiers + */ + protected function pModifiers(int $modifiers): string { + return ($modifiers & Modifiers::FINAL ? 'final ' : '') + . ($modifiers & Modifiers::ABSTRACT ? 'abstract ' : '') + . ($modifiers & Modifiers::PUBLIC ? 'public ' : '') + . ($modifiers & Modifiers::PROTECTED ? 'protected ' : '') + . ($modifiers & Modifiers::PRIVATE ? 'private ' : '') + . ($modifiers & Modifiers::STATIC ? 'static ' : '') + . ($modifiers & Modifiers::READONLY ? 'readonly ' : ''); + } + + protected function pStatic(bool $static): string { + return $static ? 'static ' : ''; + } + + /** + * Determine whether a list of nodes uses multiline formatting. + * + * @param (Node|null)[] $nodes Node list + * + * @return bool Whether multiline formatting is used + */ + protected function isMultiline(array $nodes): bool { + if (\count($nodes) < 2) { + return false; + } + + $pos = -1; + foreach ($nodes as $node) { + if (null === $node) { + continue; + } + + $endPos = $node->getEndTokenPos() + 1; + if ($pos >= 0) { + $text = $this->origTokens->getTokenCode($pos, $endPos, 0); + if (false === strpos($text, "\n")) { + // We require that a newline is present between *every* item. If the formatting + // is inconsistent, with only some items having newlines, we don't consider it + // as multiline + return false; + } + } + $pos = $endPos; + } + + return true; + } + + /** + * Lazily initializes label char map. + * + * The label char map determines whether a certain character may occur in a label. + */ + protected function initializeLabelCharMap(): void { + if (isset($this->labelCharMap)) { + return; + } + + $this->labelCharMap = []; + for ($i = 0; $i < 256; $i++) { + $chr = chr($i); + $this->labelCharMap[$chr] = $i >= 0x80 || ctype_alnum($chr); + } + + if ($this->phpVersion->allowsDelInIdentifiers()) { + $this->labelCharMap["\x7f"] = true; + } + } + + /** + * Lazily initializes node list differ. + * + * The node list differ is used to determine differences between two array subnodes. + */ + protected function initializeNodeListDiffer(): void { + if (isset($this->nodeListDiffer)) { + return; + } + + $this->nodeListDiffer = new Internal\Differ(function ($a, $b) { + if ($a instanceof Node && $b instanceof Node) { + return $a === $b->getAttribute('origNode'); + } + // Can happen for array destructuring + return $a === null && $b === null; + }); + } + + /** + * Lazily initializes fixup map. + * + * The fixup map is used to determine whether a certain subnode of a certain node may require + * some kind of "fixup" operation, e.g. the addition of parenthesis or braces. + */ + protected function initializeFixupMap(): void { + if (isset($this->fixupMap)) { + return; + } + + $this->fixupMap = [ + Expr\Instanceof_::class => [ + 'expr' => self::FIXUP_PREC_UNARY, + 'class' => self::FIXUP_NEW, + ], + Expr\Ternary::class => [ + 'cond' => self::FIXUP_PREC_LEFT, + 'else' => self::FIXUP_PREC_RIGHT, + ], + Expr\Yield_::class => ['value' => self::FIXUP_PREC_UNARY], + + Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], + Expr\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS], + Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], + Expr\ClassConstFetch::class => [ + 'class' => self::FIXUP_STATIC_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\New_::class => ['class' => self::FIXUP_NEW], + Expr\MethodCall::class => [ + 'var' => self::FIXUP_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\NullsafeMethodCall::class => [ + 'var' => self::FIXUP_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\StaticPropertyFetch::class => [ + 'class' => self::FIXUP_STATIC_DEREF_LHS, + 'name' => self::FIXUP_VAR_BRACED_NAME, + ], + Expr\PropertyFetch::class => [ + 'var' => self::FIXUP_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\NullsafePropertyFetch::class => [ + 'var' => self::FIXUP_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Scalar\InterpolatedString::class => [ + 'parts' => self::FIXUP_ENCAPSED, + ], + ]; + + $binaryOps = [ + BinaryOp\Pow::class, BinaryOp\Mul::class, BinaryOp\Div::class, BinaryOp\Mod::class, + BinaryOp\Plus::class, BinaryOp\Minus::class, BinaryOp\Concat::class, + BinaryOp\ShiftLeft::class, BinaryOp\ShiftRight::class, BinaryOp\Smaller::class, + BinaryOp\SmallerOrEqual::class, BinaryOp\Greater::class, BinaryOp\GreaterOrEqual::class, + BinaryOp\Equal::class, BinaryOp\NotEqual::class, BinaryOp\Identical::class, + BinaryOp\NotIdentical::class, BinaryOp\Spaceship::class, BinaryOp\BitwiseAnd::class, + BinaryOp\BitwiseXor::class, BinaryOp\BitwiseOr::class, BinaryOp\BooleanAnd::class, + BinaryOp\BooleanOr::class, BinaryOp\Coalesce::class, BinaryOp\LogicalAnd::class, + BinaryOp\LogicalXor::class, BinaryOp\LogicalOr::class, + ]; + foreach ($binaryOps as $binaryOp) { + $this->fixupMap[$binaryOp] = [ + 'left' => self::FIXUP_PREC_LEFT, + 'right' => self::FIXUP_PREC_RIGHT + ]; + } + + $prefixOps = [ + Expr\Clone_::class, Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, + Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, + Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, + Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class, + Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, + AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, + AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, + AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class, + Expr\ArrowFunction::class, Expr\Throw_::class, + ]; + foreach ($prefixOps as $prefixOp) { + $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_UNARY]; + } + } + + /** + * Lazily initializes the removal map. + * + * The removal map is used to determine which additional tokens should be removed when a + * certain node is replaced by null. + */ + protected function initializeRemovalMap(): void { + if (isset($this->removalMap)) { + return; + } + + $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE]; + $stripLeft = ['left' => \T_WHITESPACE]; + $stripRight = ['right' => \T_WHITESPACE]; + $stripDoubleArrow = ['right' => \T_DOUBLE_ARROW]; + $stripColon = ['left' => ':']; + $stripEquals = ['left' => '=']; + $this->removalMap = [ + 'Expr_ArrayDimFetch->dim' => $stripBoth, + 'ArrayItem->key' => $stripDoubleArrow, + 'Expr_ArrowFunction->returnType' => $stripColon, + 'Expr_Closure->returnType' => $stripColon, + 'Expr_Exit->expr' => $stripBoth, + 'Expr_Ternary->if' => $stripBoth, + 'Expr_Yield->key' => $stripDoubleArrow, + 'Expr_Yield->value' => $stripBoth, + 'Param->type' => $stripRight, + 'Param->default' => $stripEquals, + 'Stmt_Break->num' => $stripBoth, + 'Stmt_Catch->var' => $stripLeft, + 'Stmt_ClassConst->type' => $stripRight, + 'Stmt_ClassMethod->returnType' => $stripColon, + 'Stmt_Class->extends' => ['left' => \T_EXTENDS], + 'Stmt_Enum->scalarType' => $stripColon, + 'Stmt_EnumCase->expr' => $stripEquals, + 'Expr_PrintableNewAnonClass->extends' => ['left' => \T_EXTENDS], + 'Stmt_Continue->num' => $stripBoth, + 'Stmt_Foreach->keyVar' => $stripDoubleArrow, + 'Stmt_Function->returnType' => $stripColon, + 'Stmt_If->else' => $stripLeft, + 'Stmt_Namespace->name' => $stripLeft, + 'Stmt_Property->type' => $stripRight, + 'PropertyItem->default' => $stripEquals, + 'Stmt_Return->expr' => $stripBoth, + 'Stmt_StaticVar->default' => $stripEquals, + 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, + 'Stmt_TryCatch->finally' => $stripLeft, + // 'Stmt_Case->cond': Replace with "default" + // 'Stmt_Class->name': Unclear what to do + // 'Stmt_Declare->stmts': Not a plain node + // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a plain node + ]; + } + + protected function initializeInsertionMap(): void { + if (isset($this->insertionMap)) { + return; + } + + // TODO: "yield" where both key and value are inserted doesn't work + // [$find, $beforeToken, $extraLeft, $extraRight] + $this->insertionMap = [ + 'Expr_ArrayDimFetch->dim' => ['[', false, null, null], + 'ArrayItem->key' => [null, false, null, ' => '], + 'Expr_ArrowFunction->returnType' => [')', false, ': ', null], + 'Expr_Closure->returnType' => [')', false, ': ', null], + 'Expr_Ternary->if' => ['?', false, ' ', ' '], + 'Expr_Yield->key' => [\T_YIELD, false, null, ' => '], + 'Expr_Yield->value' => [\T_YIELD, false, ' ', null], + 'Param->type' => [null, false, null, ' '], + 'Param->default' => [null, false, ' = ', null], + 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], + 'Stmt_Catch->var' => [null, false, ' ', null], + 'Stmt_ClassMethod->returnType' => [')', false, ': ', null], + 'Stmt_ClassConst->type' => [\T_CONST, false, ' ', null], + 'Stmt_Class->extends' => [null, false, ' extends ', null], + 'Stmt_Enum->scalarType' => [null, false, ' : ', null], + 'Stmt_EnumCase->expr' => [null, false, ' = ', null], + 'Expr_PrintableNewAnonClass->extends' => [null, false, ' extends ', null], + 'Stmt_Continue->num' => [\T_CONTINUE, false, ' ', null], + 'Stmt_Foreach->keyVar' => [\T_AS, false, null, ' => '], + 'Stmt_Function->returnType' => [')', false, ': ', null], + 'Stmt_If->else' => [null, false, ' ', null], + 'Stmt_Namespace->name' => [\T_NAMESPACE, false, ' ', null], + 'Stmt_Property->type' => [\T_VARIABLE, true, null, ' '], + 'PropertyItem->default' => [null, false, ' = ', null], + 'Stmt_Return->expr' => [\T_RETURN, false, ' ', null], + 'Stmt_StaticVar->default' => [null, false, ' = ', null], + //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO + 'Stmt_TryCatch->finally' => [null, false, ' ', null], + + // 'Expr_Exit->expr': Complicated due to optional () + // 'Stmt_Case->cond': Conversion from default to case + // 'Stmt_Class->name': Unclear + // 'Stmt_Declare->stmts': Not a proper node + // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a proper node + ]; + } + + protected function initializeListInsertionMap(): void { + if (isset($this->listInsertionMap)) { + return; + } + + $this->listInsertionMap = [ + // special + //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully + //'Scalar_InterpolatedString->parts' => '', + Stmt\Catch_::class . '->types' => '|', + UnionType::class . '->types' => '|', + IntersectionType::class . '->types' => '&', + Stmt\If_::class . '->elseifs' => ' ', + Stmt\TryCatch::class . '->catches' => ' ', + + // comma-separated lists + Expr\Array_::class . '->items' => ', ', + Expr\ArrowFunction::class . '->params' => ', ', + Expr\Closure::class . '->params' => ', ', + Expr\Closure::class . '->uses' => ', ', + Expr\FuncCall::class . '->args' => ', ', + Expr\Isset_::class . '->vars' => ', ', + Expr\List_::class . '->items' => ', ', + Expr\MethodCall::class . '->args' => ', ', + Expr\NullsafeMethodCall::class . '->args' => ', ', + Expr\New_::class . '->args' => ', ', + PrintableNewAnonClassNode::class . '->args' => ', ', + Expr\StaticCall::class . '->args' => ', ', + Stmt\ClassConst::class . '->consts' => ', ', + Stmt\ClassMethod::class . '->params' => ', ', + Stmt\Class_::class . '->implements' => ', ', + Stmt\Enum_::class . '->implements' => ', ', + PrintableNewAnonClassNode::class . '->implements' => ', ', + Stmt\Const_::class . '->consts' => ', ', + Stmt\Declare_::class . '->declares' => ', ', + Stmt\Echo_::class . '->exprs' => ', ', + Stmt\For_::class . '->init' => ', ', + Stmt\For_::class . '->cond' => ', ', + Stmt\For_::class . '->loop' => ', ', + Stmt\Function_::class . '->params' => ', ', + Stmt\Global_::class . '->vars' => ', ', + Stmt\GroupUse::class . '->uses' => ', ', + Stmt\Interface_::class . '->extends' => ', ', + Expr\Match_::class . '->arms' => ', ', + Stmt\Property::class . '->props' => ', ', + Stmt\StaticVar::class . '->vars' => ', ', + Stmt\TraitUse::class . '->traits' => ', ', + Stmt\TraitUseAdaptation\Precedence::class . '->insteadof' => ', ', + Stmt\Unset_::class . '->vars' => ', ', + Stmt\UseUse::class . '->uses' => ', ', + MatchArm::class . '->conds' => ', ', + AttributeGroup::class . '->attrs' => ', ', + + // statement lists + Expr\Closure::class . '->stmts' => "\n", + Stmt\Case_::class . '->stmts' => "\n", + Stmt\Catch_::class . '->stmts' => "\n", + Stmt\Class_::class . '->stmts' => "\n", + Stmt\Enum_::class . '->stmts' => "\n", + PrintableNewAnonClassNode::class . '->stmts' => "\n", + Stmt\Interface_::class . '->stmts' => "\n", + Stmt\Trait_::class . '->stmts' => "\n", + Stmt\ClassMethod::class . '->stmts' => "\n", + Stmt\Declare_::class . '->stmts' => "\n", + Stmt\Do_::class . '->stmts' => "\n", + Stmt\ElseIf_::class . '->stmts' => "\n", + Stmt\Else_::class . '->stmts' => "\n", + Stmt\Finally_::class . '->stmts' => "\n", + Stmt\Foreach_::class . '->stmts' => "\n", + Stmt\For_::class . '->stmts' => "\n", + Stmt\Function_::class . '->stmts' => "\n", + Stmt\If_::class . '->stmts' => "\n", + Stmt\Namespace_::class . '->stmts' => "\n", + Stmt\Block::class . '->stmts' => "\n", + + // Attribute groups + Stmt\Class_::class . '->attrGroups' => "\n", + Stmt\Enum_::class . '->attrGroups' => "\n", + Stmt\EnumCase::class . '->attrGroups' => "\n", + Stmt\Interface_::class . '->attrGroups' => "\n", + Stmt\Trait_::class . '->attrGroups' => "\n", + Stmt\Function_::class . '->attrGroups' => "\n", + Stmt\ClassMethod::class . '->attrGroups' => "\n", + Stmt\ClassConst::class . '->attrGroups' => "\n", + Stmt\Property::class . '->attrGroups' => "\n", + PrintableNewAnonClassNode::class . '->attrGroups' => ' ', + Expr\Closure::class . '->attrGroups' => ' ', + Expr\ArrowFunction::class . '->attrGroups' => ' ', + Param::class . '->attrGroups' => ' ', + Stmt\Switch_::class . '->cases' => "\n", + Stmt\TraitUse::class . '->adaptations' => "\n", + Stmt\TryCatch::class . '->stmts' => "\n", + Stmt\While_::class . '->stmts' => "\n", + + // dummy for top-level context + 'File->stmts' => "\n", + ]; + } + + protected function initializeEmptyListInsertionMap(): void { + if (isset($this->emptyListInsertionMap)) { + return; + } + + // TODO Insertion into empty statement lists. + + // [$find, $extraLeft, $extraRight] + $this->emptyListInsertionMap = [ + Expr\ArrowFunction::class . '->params' => ['(', '', ''], + Expr\Closure::class . '->uses' => [')', ' use (', ')'], + Expr\Closure::class . '->params' => ['(', '', ''], + Expr\FuncCall::class . '->args' => ['(', '', ''], + Expr\MethodCall::class . '->args' => ['(', '', ''], + Expr\NullsafeMethodCall::class . '->args' => ['(', '', ''], + Expr\New_::class . '->args' => ['(', '', ''], + PrintableNewAnonClassNode::class . '->args' => ['(', '', ''], + PrintableNewAnonClassNode::class . '->implements' => [null, ' implements ', ''], + Expr\StaticCall::class . '->args' => ['(', '', ''], + Stmt\Class_::class . '->implements' => [null, ' implements ', ''], + Stmt\Enum_::class . '->implements' => [null, ' implements ', ''], + Stmt\ClassMethod::class . '->params' => ['(', '', ''], + Stmt\Interface_::class . '->extends' => [null, ' extends ', ''], + Stmt\Function_::class . '->params' => ['(', '', ''], + Stmt\Interface_::class . '->attrGroups' => [null, '', "\n"], + Stmt\Class_::class . '->attrGroups' => [null, '', "\n"], + Stmt\ClassConst::class . '->attrGroups' => [null, '', "\n"], + Stmt\ClassMethod::class . '->attrGroups' => [null, '', "\n"], + Stmt\Function_::class . '->attrGroups' => [null, '', "\n"], + Stmt\Property::class . '->attrGroups' => [null, '', "\n"], + Stmt\Trait_::class . '->attrGroups' => [null, '', "\n"], + Expr\ArrowFunction::class . '->attrGroups' => [null, '', ' '], + Expr\Closure::class . '->attrGroups' => [null, '', ' '], + PrintableNewAnonClassNode::class . '->attrGroups' => [\T_NEW, ' ', ''], + + /* These cannot be empty to start with: + * Expr_Isset->vars + * Stmt_Catch->types + * Stmt_Const->consts + * Stmt_ClassConst->consts + * Stmt_Declare->declares + * Stmt_Echo->exprs + * Stmt_Global->vars + * Stmt_GroupUse->uses + * Stmt_Property->props + * Stmt_StaticVar->vars + * Stmt_TraitUse->traits + * Stmt_TraitUseAdaptation_Precedence->insteadof + * Stmt_Unset->vars + * Stmt_Use->uses + * UnionType->types + */ + + /* TODO + * Stmt_If->elseifs + * Stmt_TryCatch->catches + * Expr_Array->items + * Expr_List->items + * Stmt_For->init + * Stmt_For->cond + * Stmt_For->loop + */ + ]; + } + + protected function initializeModifierChangeMap(): void { + if (isset($this->modifierChangeMap)) { + return; + } + + $this->modifierChangeMap = [ + Stmt\ClassConst::class . '->flags' => ['pModifiers', \T_CONST], + Stmt\ClassMethod::class . '->flags' => ['pModifiers', \T_FUNCTION], + Stmt\Class_::class . '->flags' => ['pModifiers', \T_CLASS], + Stmt\Property::class . '->flags' => ['pModifiers', \T_VARIABLE], + PrintableNewAnonClassNode::class . '->flags' => ['pModifiers', \T_CLASS], + Param::class . '->flags' => ['pModifiers', \T_VARIABLE], + Expr\Closure::class . '->static' => ['pStatic', \T_FUNCTION], + Expr\ArrowFunction::class . '->static' => ['pStatic', \T_FN], + //Stmt\TraitUseAdaptation\Alias::class . '->newModifier' => 0, // TODO + ]; + + // List of integer subnodes that are not modifiers: + // Expr_Include->type + // Stmt_GroupUse->type + // Stmt_Use->type + // UseItem->type + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Token.php b/vendor/nikic/php-parser/lib/PhpParser/Token.php new file mode 100644 index 0000000..6683310 --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/Token.php @@ -0,0 +1,18 @@ +pos + \strlen($this->text); + } + + /** Get 1-based end line number of the token. */ + public function getEndLine(): int { + return $this->line + \substr_count($this->text, "\n"); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php b/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php new file mode 100644 index 0000000..273271d --- /dev/null +++ b/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php @@ -0,0 +1,63 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\Exception as VersionException; +use PharIo\Version\Version; +use PharIo\Version\VersionConstraintParser; + +class ManifestDocumentMapper { + public function map(ManifestDocument $document): Manifest { + try { + $contains = $document->getContainsElement(); + $type = $this->mapType($contains); + $copyright = $this->mapCopyright($document->getCopyrightElement()); + $requirements = $this->mapRequirements($document->getRequiresElement()); + $bundledComponents = $this->mapBundledComponents($document); + + return new Manifest( + new ApplicationName($contains->getName()), + new Version($contains->getVersion()), + $type, + $copyright, + $requirements, + $bundledComponents + ); + } catch (VersionException $e) { + throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); + } catch (Exception $e) { + throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); + } + } + + private function mapType(ContainsElement $contains): Type { + switch ($contains->getType()) { + case 'application': + return Type::application(); + case 'library': + return Type::library(); + case 'extension': + return $this->mapExtension($contains->getExtensionElement()); + } + + throw new ManifestDocumentMapperException( + \sprintf('Unsupported type %s', $contains->getType()) + ); + } + + private function mapCopyright(CopyrightElement $copyright): CopyrightInformation { + $authors = new AuthorCollection(); + + foreach ($copyright->getAuthorElements() as $authorElement) { + $authors->add( + new Author( + $authorElement->getName(), + new Email($authorElement->getEmail()) + ) + ); + } + + $licenseElement = $copyright->getLicenseElement(); + $license = new License( + $licenseElement->getType(), + new Url($licenseElement->getUrl()) + ); + + return new CopyrightInformation( + $authors, + $license + ); + } + + private function mapRequirements(RequiresElement $requires): RequirementCollection { + $collection = new RequirementCollection(); + $phpElement = $requires->getPHPElement(); + $parser = new VersionConstraintParser; + + try { + $versionConstraint = $parser->parse($phpElement->getVersion()); + } catch (VersionException $e) { + throw new ManifestDocumentMapperException( + \sprintf('Unsupported version constraint - %s', $e->getMessage()), + (int)$e->getCode(), + $e + ); + } + + $collection->add( + new PhpVersionRequirement( + $versionConstraint + ) + ); + + if (!$phpElement->hasExtElements()) { + return $collection; + } + + foreach ($phpElement->getExtElements() as $extElement) { + $collection->add( + new PhpExtensionRequirement($extElement->getName()) + ); + } + + return $collection; + } + + private function mapBundledComponents(ManifestDocument $document): BundledComponentCollection { + $collection = new BundledComponentCollection(); + + if (!$document->hasBundlesElement()) { + return $collection; + } + + foreach ($document->getBundlesElement()->getComponentElements() as $componentElement) { + $collection->add( + new BundledComponent( + $componentElement->getName(), + new Version( + $componentElement->getVersion() + ) + ) + ); + } + + return $collection; + } + + private function mapExtension(ExtensionElement $extension): Extension { + try { + $versionConstraint = (new VersionConstraintParser)->parse($extension->getCompatible()); + + return Type::extension( + new ApplicationName($extension->getFor()), + $versionConstraint + ); + } catch (VersionException $e) { + throw new ManifestDocumentMapperException( + \sprintf('Unsupported version constraint - %s', $e->getMessage()), + (int)$e->getCode(), + $e + ); + } + } +} diff --git a/vendor/phar-io/manifest/src/ManifestLoader.php b/vendor/phar-io/manifest/src/ManifestLoader.php new file mode 100644 index 0000000..ae884e4 --- /dev/null +++ b/vendor/phar-io/manifest/src/ManifestLoader.php @@ -0,0 +1,44 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ManifestLoader { + public static function fromFile(string $filename): Manifest { + try { + return (new ManifestDocumentMapper())->map( + ManifestDocument::fromFile($filename) + ); + } catch (Exception $e) { + throw new ManifestLoaderException( + \sprintf('Loading %s failed.', $filename), + (int)$e->getCode(), + $e + ); + } + } + + public static function fromPhar(string $filename): Manifest { + return self::fromFile('phar://' . $filename . '/manifest.xml'); + } + + public static function fromString(string $manifest): Manifest { + try { + return (new ManifestDocumentMapper())->map( + ManifestDocument::fromString($manifest) + ); + } catch (Exception $e) { + throw new ManifestLoaderException( + 'Processing string failed', + (int)$e->getCode(), + $e + ); + } + } +} diff --git a/vendor/phar-io/manifest/src/ManifestSerializer.php b/vendor/phar-io/manifest/src/ManifestSerializer.php new file mode 100644 index 0000000..e236b59 --- /dev/null +++ b/vendor/phar-io/manifest/src/ManifestSerializer.php @@ -0,0 +1,168 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\AnyVersionConstraint; +use PharIo\Version\Version; +use PharIo\Version\VersionConstraint; +use XMLWriter; + +/** @psalm-suppress MissingConstructor */ +class ManifestSerializer { + /** @var XMLWriter */ + private $xmlWriter; + + public function serializeToFile(Manifest $manifest, string $filename): void { + \file_put_contents( + $filename, + $this->serializeToString($manifest) + ); + } + + public function serializeToString(Manifest $manifest): string { + $this->startDocument(); + + $this->addContains($manifest->getName(), $manifest->getVersion(), $manifest->getType()); + $this->addCopyright($manifest->getCopyrightInformation()); + $this->addRequirements($manifest->getRequirements()); + $this->addBundles($manifest->getBundledComponents()); + + return $this->finishDocument(); + } + + private function startDocument(): void { + $xmlWriter = new XMLWriter(); + $xmlWriter->openMemory(); + $xmlWriter->setIndent(true); + $xmlWriter->setIndentString(\str_repeat(' ', 4)); + $xmlWriter->startDocument('1.0', 'UTF-8'); + $xmlWriter->startElement('phar'); + $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); + + $this->xmlWriter = $xmlWriter; + } + + private function finishDocument(): string { + $this->xmlWriter->endElement(); + $this->xmlWriter->endDocument(); + + return $this->xmlWriter->outputMemory(); + } + + private function addContains(ApplicationName $name, Version $version, Type $type): void { + $this->xmlWriter->startElement('contains'); + $this->xmlWriter->writeAttribute('name', $name->asString()); + $this->xmlWriter->writeAttribute('version', $version->getVersionString()); + + switch (true) { + case $type->isApplication(): { + $this->xmlWriter->writeAttribute('type', 'application'); + + break; + } + + case $type->isLibrary(): { + $this->xmlWriter->writeAttribute('type', 'library'); + + break; + } + + case $type->isExtension(): { + $this->xmlWriter->writeAttribute('type', 'extension'); + /* @var $type Extension */ + $this->addExtension( + $type->getApplicationName(), + $type->getVersionConstraint() + ); + + break; + } + + default: { + $this->xmlWriter->writeAttribute('type', 'custom'); + } + } + + $this->xmlWriter->endElement(); + } + + private function addCopyright(CopyrightInformation $copyrightInformation): void { + $this->xmlWriter->startElement('copyright'); + + foreach ($copyrightInformation->getAuthors() as $author) { + $this->xmlWriter->startElement('author'); + $this->xmlWriter->writeAttribute('name', $author->getName()); + $this->xmlWriter->writeAttribute('email', $author->getEmail()->asString()); + $this->xmlWriter->endElement(); + } + + $license = $copyrightInformation->getLicense(); + + $this->xmlWriter->startElement('license'); + $this->xmlWriter->writeAttribute('type', $license->getName()); + $this->xmlWriter->writeAttribute('url', $license->getUrl()->asString()); + $this->xmlWriter->endElement(); + + $this->xmlWriter->endElement(); + } + + private function addRequirements(RequirementCollection $requirementCollection): void { + $phpRequirement = new AnyVersionConstraint(); + $extensions = []; + + foreach ($requirementCollection as $requirement) { + if ($requirement instanceof PhpVersionRequirement) { + $phpRequirement = $requirement->getVersionConstraint(); + + continue; + } + + if ($requirement instanceof PhpExtensionRequirement) { + $extensions[] = $requirement->asString(); + } + } + + $this->xmlWriter->startElement('requires'); + $this->xmlWriter->startElement('php'); + $this->xmlWriter->writeAttribute('version', $phpRequirement->asString()); + + foreach ($extensions as $extension) { + $this->xmlWriter->startElement('ext'); + $this->xmlWriter->writeAttribute('name', $extension); + $this->xmlWriter->endElement(); + } + + $this->xmlWriter->endElement(); + $this->xmlWriter->endElement(); + } + + private function addBundles(BundledComponentCollection $bundledComponentCollection): void { + if (\count($bundledComponentCollection) === 0) { + return; + } + $this->xmlWriter->startElement('bundles'); + + foreach ($bundledComponentCollection as $bundledComponent) { + $this->xmlWriter->startElement('component'); + $this->xmlWriter->writeAttribute('name', $bundledComponent->getName()); + $this->xmlWriter->writeAttribute('version', $bundledComponent->getVersion()->getVersionString()); + $this->xmlWriter->endElement(); + } + + $this->xmlWriter->endElement(); + } + + private function addExtension(ApplicationName $applicationName, VersionConstraint $versionConstraint): void { + $this->xmlWriter->startElement('extension'); + $this->xmlWriter->writeAttribute('for', $applicationName->asString()); + $this->xmlWriter->writeAttribute('compatible', $versionConstraint->asString()); + $this->xmlWriter->endElement(); + } +} diff --git a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php new file mode 100644 index 0000000..766fc0e --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php @@ -0,0 +1,13 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ElementCollectionException extends \InvalidArgumentException implements Exception { +} diff --git a/vendor/phar-io/manifest/src/exceptions/Exception.php b/vendor/phar-io/manifest/src/exceptions/Exception.php new file mode 100644 index 0000000..e7f1220 --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/Exception.php @@ -0,0 +1,13 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +interface Exception extends \Throwable { +} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php new file mode 100644 index 0000000..952901e --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php @@ -0,0 +1,14 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { + public const InvalidFormat = 2; +} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php new file mode 100644 index 0000000..3cbe082 --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php @@ -0,0 +1,13 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class InvalidEmailException extends \InvalidArgumentException implements Exception { +} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php new file mode 100644 index 0000000..8f77e29 --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php @@ -0,0 +1,13 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class InvalidUrlException extends \InvalidArgumentException implements Exception { +} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php new file mode 100644 index 0000000..cf1c314 --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php @@ -0,0 +1,5 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use LibXMLError; + +class ManifestDocumentLoadingException extends \Exception implements Exception { + /** @var LibXMLError[] */ + private $libxmlErrors; + + /** + * ManifestDocumentLoadingException constructor. + * + * @param LibXMLError[] $libxmlErrors + */ + public function __construct(array $libxmlErrors) { + $this->libxmlErrors = $libxmlErrors; + $first = $this->libxmlErrors[0]; + + parent::__construct( + \sprintf( + '%s (Line: %d / Column: %d / File: %s)', + $first->message, + $first->line, + $first->column, + $first->file + ), + $first->code + ); + } + + /** + * @return LibXMLError[] + */ + public function getLibxmlErrors(): array { + return $this->libxmlErrors; + } +} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php new file mode 100644 index 0000000..43373bd --- /dev/null +++ b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php @@ -0,0 +1,5 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class Application extends Type { + public function isApplication(): bool { + return true; + } +} diff --git a/vendor/phar-io/manifest/src/values/ApplicationName.php b/vendor/phar-io/manifest/src/values/ApplicationName.php new file mode 100644 index 0000000..d71744a --- /dev/null +++ b/vendor/phar-io/manifest/src/values/ApplicationName.php @@ -0,0 +1,37 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ApplicationName { + /** @var string */ + private $name; + + public function __construct(string $name) { + $this->ensureValidFormat($name); + $this->name = $name; + } + + public function asString(): string { + return $this->name; + } + + public function isEqual(ApplicationName $name): bool { + return $this->name === $name->name; + } + + private function ensureValidFormat(string $name): void { + if (!\preg_match('#\w/\w#', $name)) { + throw new InvalidApplicationNameException( + \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), + InvalidApplicationNameException::InvalidFormat + ); + } + } +} diff --git a/vendor/phar-io/manifest/src/values/Author.php b/vendor/phar-io/manifest/src/values/Author.php new file mode 100644 index 0000000..82b666e --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Author.php @@ -0,0 +1,39 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class Author { + /** @var string */ + private $name; + + /** @var Email */ + private $email; + + public function __construct(string $name, Email $email) { + $this->name = $name; + $this->email = $email; + } + + public function asString(): string { + return \sprintf( + '%s <%s>', + $this->name, + $this->email->asString() + ); + } + + public function getName(): string { + return $this->name; + } + + public function getEmail(): Email { + return $this->email; + } +} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollection.php b/vendor/phar-io/manifest/src/values/AuthorCollection.php new file mode 100644 index 0000000..27e50ad --- /dev/null +++ b/vendor/phar-io/manifest/src/values/AuthorCollection.php @@ -0,0 +1,34 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class AuthorCollection implements \Countable, \IteratorAggregate { + /** @var Author[] */ + private $authors = []; + + public function add(Author $author): void { + $this->authors[] = $author; + } + + /** + * @return Author[] + */ + public function getAuthors(): array { + return $this->authors; + } + + public function count(): int { + return \count($this->authors); + } + + public function getIterator(): AuthorCollectionIterator { + return new AuthorCollectionIterator($this); + } +} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php new file mode 100644 index 0000000..4ff3c39 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php @@ -0,0 +1,42 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class AuthorCollectionIterator implements \Iterator { + /** @var Author[] */ + private $authors; + + /** @var int */ + private $position = 0; + + public function __construct(AuthorCollection $authors) { + $this->authors = $authors->getAuthors(); + } + + public function rewind(): void { + $this->position = 0; + } + + public function valid(): bool { + return $this->position < \count($this->authors); + } + + public function key(): int { + return $this->position; + } + + public function current(): Author { + return $this->authors[$this->position]; + } + + public function next(): void { + $this->position++; + } +} diff --git a/vendor/phar-io/manifest/src/values/BundledComponent.php b/vendor/phar-io/manifest/src/values/BundledComponent.php new file mode 100644 index 0000000..ea77b44 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/BundledComponent.php @@ -0,0 +1,33 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\Version; + +class BundledComponent { + /** @var string */ + private $name; + + /** @var Version */ + private $version; + + public function __construct(string $name, Version $version) { + $this->name = $name; + $this->version = $version; + } + + public function getName(): string { + return $this->name; + } + + public function getVersion(): Version { + return $this->version; + } +} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php new file mode 100644 index 0000000..b628eaa --- /dev/null +++ b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php @@ -0,0 +1,34 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class BundledComponentCollection implements \Countable, \IteratorAggregate { + /** @var BundledComponent[] */ + private $bundledComponents = []; + + public function add(BundledComponent $bundledComponent): void { + $this->bundledComponents[] = $bundledComponent; + } + + /** + * @return BundledComponent[] + */ + public function getBundledComponents(): array { + return $this->bundledComponents; + } + + public function count(): int { + return \count($this->bundledComponents); + } + + public function getIterator(): BundledComponentCollectionIterator { + return new BundledComponentCollectionIterator($this); + } +} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php new file mode 100644 index 0000000..462db45 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php @@ -0,0 +1,42 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class BundledComponentCollectionIterator implements \Iterator { + /** @var BundledComponent[] */ + private $bundledComponents; + + /** @var int */ + private $position = 0; + + public function __construct(BundledComponentCollection $bundledComponents) { + $this->bundledComponents = $bundledComponents->getBundledComponents(); + } + + public function rewind(): void { + $this->position = 0; + } + + public function valid(): bool { + return $this->position < \count($this->bundledComponents); + } + + public function key(): int { + return $this->position; + } + + public function current(): BundledComponent { + return $this->bundledComponents[$this->position]; + } + + public function next(): void { + $this->position++; + } +} diff --git a/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/vendor/phar-io/manifest/src/values/CopyrightInformation.php new file mode 100644 index 0000000..d26f947 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/CopyrightInformation.php @@ -0,0 +1,31 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class CopyrightInformation { + /** @var AuthorCollection */ + private $authors; + + /** @var License */ + private $license; + + public function __construct(AuthorCollection $authors, License $license) { + $this->authors = $authors; + $this->license = $license; + } + + public function getAuthors(): AuthorCollection { + return $this->authors; + } + + public function getLicense(): License { + return $this->license; + } +} diff --git a/vendor/phar-io/manifest/src/values/Email.php b/vendor/phar-io/manifest/src/values/Email.php new file mode 100644 index 0000000..588348d --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Email.php @@ -0,0 +1,31 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class Email { + /** @var string */ + private $email; + + public function __construct(string $email) { + $this->ensureEmailIsValid($email); + + $this->email = $email; + } + + public function asString(): string { + return $this->email; + } + + private function ensureEmailIsValid(string $url): void { + if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { + throw new InvalidEmailException; + } + } +} diff --git a/vendor/phar-io/manifest/src/values/Extension.php b/vendor/phar-io/manifest/src/values/Extension.php new file mode 100644 index 0000000..4c5726f --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Extension.php @@ -0,0 +1,46 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\Version; +use PharIo\Version\VersionConstraint; + +class Extension extends Type { + /** @var ApplicationName */ + private $application; + + /** @var VersionConstraint */ + private $versionConstraint; + + public function __construct(ApplicationName $application, VersionConstraint $versionConstraint) { + $this->application = $application; + $this->versionConstraint = $versionConstraint; + } + + public function getApplicationName(): ApplicationName { + return $this->application; + } + + public function getVersionConstraint(): VersionConstraint { + return $this->versionConstraint; + } + + public function isExtension(): bool { + return true; + } + + public function isExtensionFor(ApplicationName $name): bool { + return $this->application->isEqual($name); + } + + public function isCompatibleWith(ApplicationName $name, Version $version): bool { + return $this->isExtensionFor($name) && $this->versionConstraint->complies($version); + } +} diff --git a/vendor/phar-io/manifest/src/values/Library.php b/vendor/phar-io/manifest/src/values/Library.php new file mode 100644 index 0000000..21849e1 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Library.php @@ -0,0 +1,16 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class Library extends Type { + public function isLibrary(): bool { + return true; + } +} diff --git a/vendor/phar-io/manifest/src/values/License.php b/vendor/phar-io/manifest/src/values/License.php new file mode 100644 index 0000000..39542fe --- /dev/null +++ b/vendor/phar-io/manifest/src/values/License.php @@ -0,0 +1,31 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class License { + /** @var string */ + private $name; + + /** @var Url */ + private $url; + + public function __construct(string $name, Url $url) { + $this->name = $name; + $this->url = $url; + } + + public function getName(): string { + return $this->name; + } + + public function getUrl(): Url { + return $this->url; + } +} diff --git a/vendor/phar-io/manifest/src/values/Manifest.php b/vendor/phar-io/manifest/src/values/Manifest.php new file mode 100644 index 0000000..0140b84 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Manifest.php @@ -0,0 +1,92 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\Version; + +class Manifest { + /** @var ApplicationName */ + private $name; + + /** @var Version */ + private $version; + + /** @var Type */ + private $type; + + /** @var CopyrightInformation */ + private $copyrightInformation; + + /** @var RequirementCollection */ + private $requirements; + + /** @var BundledComponentCollection */ + private $bundledComponents; + + public function __construct(ApplicationName $name, Version $version, Type $type, CopyrightInformation $copyrightInformation, RequirementCollection $requirements, BundledComponentCollection $bundledComponents) { + $this->name = $name; + $this->version = $version; + $this->type = $type; + $this->copyrightInformation = $copyrightInformation; + $this->requirements = $requirements; + $this->bundledComponents = $bundledComponents; + } + + public function getName(): ApplicationName { + return $this->name; + } + + public function getVersion(): Version { + return $this->version; + } + + public function getType(): Type { + return $this->type; + } + + public function getCopyrightInformation(): CopyrightInformation { + return $this->copyrightInformation; + } + + public function getRequirements(): RequirementCollection { + return $this->requirements; + } + + public function getBundledComponents(): BundledComponentCollection { + return $this->bundledComponents; + } + + public function isApplication(): bool { + return $this->type->isApplication(); + } + + public function isLibrary(): bool { + return $this->type->isLibrary(); + } + + public function isExtension(): bool { + return $this->type->isExtension(); + } + + public function isExtensionFor(ApplicationName $application, Version $version = null): bool { + if (!$this->isExtension()) { + return false; + } + + /** @var Extension $type */ + $type = $this->type; + + if ($version !== null) { + return $type->isCompatibleWith($application, $version); + } + + return $type->isExtensionFor($application); + } +} diff --git a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php new file mode 100644 index 0000000..088f385 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php @@ -0,0 +1,23 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class PhpExtensionRequirement implements Requirement { + /** @var string */ + private $extension; + + public function __construct(string $extension) { + $this->extension = $extension; + } + + public function asString(): string { + return $this->extension; + } +} diff --git a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php new file mode 100644 index 0000000..f8d6f6d --- /dev/null +++ b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php @@ -0,0 +1,25 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\VersionConstraint; + +class PhpVersionRequirement implements Requirement { + /** @var VersionConstraint */ + private $versionConstraint; + + public function __construct(VersionConstraint $versionConstraint) { + $this->versionConstraint = $versionConstraint; + } + + public function getVersionConstraint(): VersionConstraint { + return $this->versionConstraint; + } +} diff --git a/vendor/phar-io/manifest/src/values/Requirement.php b/vendor/phar-io/manifest/src/values/Requirement.php new file mode 100644 index 0000000..8b845d6 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Requirement.php @@ -0,0 +1,13 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +interface Requirement { +} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollection.php b/vendor/phar-io/manifest/src/values/RequirementCollection.php new file mode 100644 index 0000000..b82cd95 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/RequirementCollection.php @@ -0,0 +1,34 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class RequirementCollection implements \Countable, \IteratorAggregate { + /** @var Requirement[] */ + private $requirements = []; + + public function add(Requirement $requirement): void { + $this->requirements[] = $requirement; + } + + /** + * @return Requirement[] + */ + public function getRequirements(): array { + return $this->requirements; + } + + public function count(): int { + return \count($this->requirements); + } + + public function getIterator(): RequirementCollectionIterator { + return new RequirementCollectionIterator($this); + } +} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php new file mode 100644 index 0000000..5614eaf --- /dev/null +++ b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php @@ -0,0 +1,42 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class RequirementCollectionIterator implements \Iterator { + /** @var Requirement[] */ + private $requirements; + + /** @var int */ + private $position = 0; + + public function __construct(RequirementCollection $requirements) { + $this->requirements = $requirements->getRequirements(); + } + + public function rewind(): void { + $this->position = 0; + } + + public function valid(): bool { + return $this->position < \count($this->requirements); + } + + public function key(): int { + return $this->position; + } + + public function current(): Requirement { + return $this->requirements[$this->position]; + } + + public function next(): void { + $this->position++; + } +} diff --git a/vendor/phar-io/manifest/src/values/Type.php b/vendor/phar-io/manifest/src/values/Type.php new file mode 100644 index 0000000..23b2898 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Type.php @@ -0,0 +1,41 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use PharIo\Version\VersionConstraint; + +abstract class Type { + public static function application(): Application { + return new Application; + } + + public static function library(): Library { + return new Library; + } + + public static function extension(ApplicationName $application, VersionConstraint $versionConstraint): Extension { + return new Extension($application, $versionConstraint); + } + + /** @psalm-assert-if-true Application $this */ + public function isApplication(): bool { + return false; + } + + /** @psalm-assert-if-true Library $this */ + public function isLibrary(): bool { + return false; + } + + /** @psalm-assert-if-true Extension $this */ + public function isExtension(): bool { + return false; + } +} diff --git a/vendor/phar-io/manifest/src/values/Url.php b/vendor/phar-io/manifest/src/values/Url.php new file mode 100644 index 0000000..6395253 --- /dev/null +++ b/vendor/phar-io/manifest/src/values/Url.php @@ -0,0 +1,36 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class Url { + /** @var string */ + private $url; + + public function __construct(string $url) { + $this->ensureUrlIsValid($url); + + $this->url = $url; + } + + public function asString(): string { + return $this->url; + } + + /** + * @param string $url + * + * @throws InvalidUrlException + */ + private function ensureUrlIsValid($url): void { + if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { + throw new InvalidUrlException; + } + } +} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElement.php b/vendor/phar-io/manifest/src/xml/AuthorElement.php new file mode 100644 index 0000000..c454b27 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/AuthorElement.php @@ -0,0 +1,20 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class AuthorElement extends ManifestElement { + public function getName(): string { + return $this->getAttributeValue('name'); + } + + public function getEmail(): string { + return $this->getAttributeValue('email'); + } +} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php new file mode 100644 index 0000000..a54147e --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php @@ -0,0 +1,18 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class AuthorElementCollection extends ElementCollection { + public function current(): AuthorElement { + return new AuthorElement( + $this->getCurrentElement() + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/BundlesElement.php b/vendor/phar-io/manifest/src/xml/BundlesElement.php new file mode 100644 index 0000000..eb2105a --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/BundlesElement.php @@ -0,0 +1,18 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class BundlesElement extends ManifestElement { + public function getComponentElements(): ComponentElementCollection { + return new ComponentElementCollection( + $this->getChildrenByName('component') + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElement.php b/vendor/phar-io/manifest/src/xml/ComponentElement.php new file mode 100644 index 0000000..7f6a5ec --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ComponentElement.php @@ -0,0 +1,20 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ComponentElement extends ManifestElement { + public function getName(): string { + return $this->getAttributeValue('name'); + } + + public function getVersion(): string { + return $this->getAttributeValue('version'); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php new file mode 100644 index 0000000..23bcbd2 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php @@ -0,0 +1,18 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ComponentElementCollection extends ElementCollection { + public function current(): ComponentElement { + return new ComponentElement( + $this->getCurrentElement() + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ContainsElement.php b/vendor/phar-io/manifest/src/xml/ContainsElement.php new file mode 100644 index 0000000..ebef49d --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ContainsElement.php @@ -0,0 +1,30 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ContainsElement extends ManifestElement { + public function getName(): string { + return $this->getAttributeValue('name'); + } + + public function getVersion(): string { + return $this->getAttributeValue('version'); + } + + public function getType(): string { + return $this->getAttributeValue('type'); + } + + public function getExtensionElement(): ExtensionElement { + return new ExtensionElement( + $this->getChildByName('extension') + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/vendor/phar-io/manifest/src/xml/CopyrightElement.php new file mode 100644 index 0000000..3debe7d --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/CopyrightElement.php @@ -0,0 +1,24 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class CopyrightElement extends ManifestElement { + public function getAuthorElements(): AuthorElementCollection { + return new AuthorElementCollection( + $this->getChildrenByName('author') + ); + } + + public function getLicenseElement(): LicenseElement { + return new LicenseElement( + $this->getChildByName('license') + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ElementCollection.php b/vendor/phar-io/manifest/src/xml/ElementCollection.php new file mode 100644 index 0000000..26d9250 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ElementCollection.php @@ -0,0 +1,61 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use DOMElement; +use DOMNodeList; + +abstract class ElementCollection implements \Iterator { + /** @var DOMElement[] */ + private $nodes = []; + + /** @var int */ + private $position; + + public function __construct(DOMNodeList $nodeList) { + $this->position = 0; + $this->importNodes($nodeList); + } + + #[\ReturnTypeWillChange] + abstract public function current(); + + public function next(): void { + $this->position++; + } + + public function key(): int { + return $this->position; + } + + public function valid(): bool { + return $this->position < \count($this->nodes); + } + + public function rewind(): void { + $this->position = 0; + } + + protected function getCurrentElement(): DOMElement { + return $this->nodes[$this->position]; + } + + private function importNodes(DOMNodeList $nodeList): void { + foreach ($nodeList as $node) { + if (!$node instanceof DOMElement) { + throw new ElementCollectionException( + \sprintf('\DOMElement expected, got \%s', \get_class($node)) + ); + } + + $this->nodes[] = $node; + } + } +} diff --git a/vendor/phar-io/manifest/src/xml/ExtElement.php b/vendor/phar-io/manifest/src/xml/ExtElement.php new file mode 100644 index 0000000..257853c --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ExtElement.php @@ -0,0 +1,16 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ExtElement extends ManifestElement { + public function getName(): string { + return $this->getAttributeValue('name'); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php new file mode 100644 index 0000000..0597734 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php @@ -0,0 +1,18 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ExtElementCollection extends ElementCollection { + public function current(): ExtElement { + return new ExtElement( + $this->getCurrentElement() + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/vendor/phar-io/manifest/src/xml/ExtensionElement.php new file mode 100644 index 0000000..db067f9 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ExtensionElement.php @@ -0,0 +1,20 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class ExtensionElement extends ManifestElement { + public function getFor(): string { + return $this->getAttributeValue('for'); + } + + public function getCompatible(): string { + return $this->getAttributeValue('compatible'); + } +} diff --git a/vendor/phar-io/manifest/src/xml/LicenseElement.php b/vendor/phar-io/manifest/src/xml/LicenseElement.php new file mode 100644 index 0000000..658c3d1 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/LicenseElement.php @@ -0,0 +1,20 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class LicenseElement extends ManifestElement { + public function getType(): string { + return $this->getAttributeValue('type'); + } + + public function getUrl(): string { + return $this->getAttributeValue('url'); + } +} diff --git a/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/vendor/phar-io/manifest/src/xml/ManifestDocument.php new file mode 100644 index 0000000..f88b282 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ManifestDocument.php @@ -0,0 +1,103 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use DOMDocument; +use DOMElement; + +class ManifestDocument { + public const XMLNS = 'https://phar.io/xml/manifest/1.0'; + + /** @var DOMDocument */ + private $dom; + + public static function fromFile(string $filename): ManifestDocument { + if (!\file_exists($filename)) { + throw new ManifestDocumentException( + \sprintf('File "%s" not found', $filename) + ); + } + + return self::fromString( + \file_get_contents($filename) + ); + } + + public static function fromString(string $xmlString): ManifestDocument { + $prev = \libxml_use_internal_errors(true); + \libxml_clear_errors(); + + $dom = new DOMDocument(); + $dom->loadXML($xmlString); + + $errors = \libxml_get_errors(); + \libxml_use_internal_errors($prev); + + if (\count($errors) !== 0) { + throw new ManifestDocumentLoadingException($errors); + } + + return new self($dom); + } + + private function __construct(DOMDocument $dom) { + $this->ensureCorrectDocumentType($dom); + + $this->dom = $dom; + } + + public function getContainsElement(): ContainsElement { + return new ContainsElement( + $this->fetchElementByName('contains') + ); + } + + public function getCopyrightElement(): CopyrightElement { + return new CopyrightElement( + $this->fetchElementByName('copyright') + ); + } + + public function getRequiresElement(): RequiresElement { + return new RequiresElement( + $this->fetchElementByName('requires') + ); + } + + public function hasBundlesElement(): bool { + return $this->dom->getElementsByTagNameNS(self::XMLNS, 'bundles')->length === 1; + } + + public function getBundlesElement(): BundlesElement { + return new BundlesElement( + $this->fetchElementByName('bundles') + ); + } + + private function ensureCorrectDocumentType(DOMDocument $dom): void { + $root = $dom->documentElement; + + if ($root->localName !== 'phar' || $root->namespaceURI !== self::XMLNS) { + throw new ManifestDocumentException('Not a phar.io manifest document'); + } + } + + private function fetchElementByName(string $elementName): DOMElement { + $element = $this->dom->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); + + if (!$element instanceof DOMElement) { + throw new ManifestDocumentException( + \sprintf('Element %s missing', $elementName) + ); + } + + return $element; + } +} diff --git a/vendor/phar-io/manifest/src/xml/ManifestElement.php b/vendor/phar-io/manifest/src/xml/ManifestElement.php new file mode 100644 index 0000000..1f57f54 --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/ManifestElement.php @@ -0,0 +1,66 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +use DOMElement; +use DOMNodeList; + +class ManifestElement { + public const XMLNS = 'https://phar.io/xml/manifest/1.0'; + + /** @var DOMElement */ + private $element; + + public function __construct(DOMElement $element) { + $this->element = $element; + } + + protected function getAttributeValue(string $name): string { + if (!$this->element->hasAttribute($name)) { + throw new ManifestElementException( + \sprintf( + 'Attribute %s not set on element %s', + $name, + $this->element->localName + ) + ); + } + + return $this->element->getAttribute($name); + } + + protected function getChildByName(string $elementName): DOMElement { + $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); + + if (!$element instanceof DOMElement) { + throw new ManifestElementException( + \sprintf('Element %s missing', $elementName) + ); + } + + return $element; + } + + protected function getChildrenByName(string $elementName): DOMNodeList { + $elementList = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName); + + if ($elementList->length === 0) { + throw new ManifestElementException( + \sprintf('Element(s) %s missing', $elementName) + ); + } + + return $elementList; + } + + protected function hasChild(string $elementName): bool { + return $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->length !== 0; + } +} diff --git a/vendor/phar-io/manifest/src/xml/PhpElement.php b/vendor/phar-io/manifest/src/xml/PhpElement.php new file mode 100644 index 0000000..c5c906c --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/PhpElement.php @@ -0,0 +1,26 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class PhpElement extends ManifestElement { + public function getVersion(): string { + return $this->getAttributeValue('version'); + } + + public function hasExtElements(): bool { + return $this->hasChild('ext'); + } + + public function getExtElements(): ExtElementCollection { + return new ExtElementCollection( + $this->getChildrenByName('ext') + ); + } +} diff --git a/vendor/phar-io/manifest/src/xml/RequiresElement.php b/vendor/phar-io/manifest/src/xml/RequiresElement.php new file mode 100644 index 0000000..b7cd41e --- /dev/null +++ b/vendor/phar-io/manifest/src/xml/RequiresElement.php @@ -0,0 +1,18 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Manifest; + +class RequiresElement extends ManifestElement { + public function getPHPElement(): PhpElement { + return new PhpElement( + $this->getChildByName('php') + ); + } +} diff --git a/vendor/phar-io/version/src/BuildMetaData.php b/vendor/phar-io/version/src/BuildMetaData.php new file mode 100644 index 0000000..d42f036 --- /dev/null +++ b/vendor/phar-io/version/src/BuildMetaData.php @@ -0,0 +1,28 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class BuildMetaData { + + /** @var string */ + private $value; + + public function __construct(string $value) { + $this->value = $value; + } + + public function asString(): string { + return $this->value; + } + + public function equals(BuildMetaData $other): bool { + return $this->asString() === $other->asString(); + } +} diff --git a/vendor/phar-io/version/src/PreReleaseSuffix.php b/vendor/phar-io/version/src/PreReleaseSuffix.php new file mode 100644 index 0000000..0056300 --- /dev/null +++ b/vendor/phar-io/version/src/PreReleaseSuffix.php @@ -0,0 +1,82 @@ + 0, + 'a' => 1, + 'alpha' => 1, + 'b' => 2, + 'beta' => 2, + 'rc' => 3, + 'p' => 4, + 'pl' => 4, + 'patch' => 4, + ]; + + /** @var string */ + private $value; + + /** @var int */ + private $valueScore; + + /** @var int */ + private $number = 0; + + /** @var string */ + private $full; + + /** + * @throws InvalidPreReleaseSuffixException + */ + public function __construct(string $value) { + $this->parseValue($value); + } + + public function asString(): string { + return $this->full; + } + + public function getValue(): string { + return $this->value; + } + + public function getNumber(): ?int { + return $this->number; + } + + public function isGreaterThan(PreReleaseSuffix $suffix): bool { + if ($this->valueScore > $suffix->valueScore) { + return true; + } + + if ($this->valueScore < $suffix->valueScore) { + return false; + } + + return $this->getNumber() > $suffix->getNumber(); + } + + private function mapValueToScore(string $value): int { + $value = \strtolower($value); + + return self::valueScoreMap[$value]; + } + + private function parseValue(string $value): void { + $regex = '/-?((dev|beta|b|rc|alpha|a|patch|p|pl)\.?(\d*)).*$/i'; + + if (\preg_match($regex, $value, $matches) !== 1) { + throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value)); + } + + $this->full = $matches[1]; + $this->value = $matches[2]; + + if ($matches[3] !== '') { + $this->number = (int)$matches[3]; + } + + $this->valueScore = $this->mapValueToScore($matches[2]); + } +} diff --git a/vendor/phar-io/version/src/Version.php b/vendor/phar-io/version/src/Version.php new file mode 100644 index 0000000..644af5c --- /dev/null +++ b/vendor/phar-io/version/src/Version.php @@ -0,0 +1,208 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class Version { + /** @var string */ + private $originalVersionString; + + /** @var VersionNumber */ + private $major; + + /** @var VersionNumber */ + private $minor; + + /** @var VersionNumber */ + private $patch; + + /** @var null|PreReleaseSuffix */ + private $preReleaseSuffix; + + /** @var null|BuildMetaData */ + private $buildMetadata; + + public function __construct(string $versionString) { + $this->ensureVersionStringIsValid($versionString); + $this->originalVersionString = $versionString; + } + + /** + * @throws NoPreReleaseSuffixException + */ + public function getPreReleaseSuffix(): PreReleaseSuffix { + if ($this->preReleaseSuffix === null) { + throw new NoPreReleaseSuffixException('No pre-release suffix set'); + } + + return $this->preReleaseSuffix; + } + + public function getOriginalString(): string { + return $this->originalVersionString; + } + + public function getVersionString(): string { + $str = \sprintf( + '%d.%d.%d', + $this->getMajor()->getValue() ?? 0, + $this->getMinor()->getValue() ?? 0, + $this->getPatch()->getValue() ?? 0 + ); + + if (!$this->hasPreReleaseSuffix()) { + return $str; + } + + return $str . '-' . $this->getPreReleaseSuffix()->asString(); + } + + public function hasPreReleaseSuffix(): bool { + return $this->preReleaseSuffix !== null; + } + + public function equals(Version $other): bool { + if ($this->getVersionString() !== $other->getVersionString()) { + return false; + } + + if ($this->hasBuildMetaData() !== $other->hasBuildMetaData()) { + return false; + } + + if ($this->hasBuildMetaData() && $other->hasBuildMetaData() && + !$this->getBuildMetaData()->equals($other->getBuildMetaData())) { + return false; + } + + return true; + } + + public function isGreaterThan(Version $version): bool { + if ($version->getMajor()->getValue() > $this->getMajor()->getValue()) { + return false; + } + + if ($version->getMajor()->getValue() < $this->getMajor()->getValue()) { + return true; + } + + if ($version->getMinor()->getValue() > $this->getMinor()->getValue()) { + return false; + } + + if ($version->getMinor()->getValue() < $this->getMinor()->getValue()) { + return true; + } + + if ($version->getPatch()->getValue() > $this->getPatch()->getValue()) { + return false; + } + + if ($version->getPatch()->getValue() < $this->getPatch()->getValue()) { + return true; + } + + if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { + return false; + } + + if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { + return true; + } + + if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) { + return false; + } + + return $this->getPreReleaseSuffix()->isGreaterThan($version->getPreReleaseSuffix()); + } + + public function getMajor(): VersionNumber { + return $this->major; + } + + public function getMinor(): VersionNumber { + return $this->minor; + } + + public function getPatch(): VersionNumber { + return $this->patch; + } + + /** + * @psalm-assert-if-true BuildMetaData $this->buildMetadata + * @psalm-assert-if-true BuildMetaData $this->getBuildMetaData() + */ + public function hasBuildMetaData(): bool { + return $this->buildMetadata !== null; + } + + /** + * @throws NoBuildMetaDataException + */ + public function getBuildMetaData(): BuildMetaData { + if (!$this->hasBuildMetaData()) { + throw new NoBuildMetaDataException('No build metadata set'); + } + + return $this->buildMetadata; + } + + /** + * @param string[] $matches + * + * @throws InvalidPreReleaseSuffixException + */ + private function parseVersion(array $matches): void { + $this->major = new VersionNumber((int)$matches['Major']); + $this->minor = new VersionNumber((int)$matches['Minor']); + $this->patch = isset($matches['Patch']) ? new VersionNumber((int)$matches['Patch']) : new VersionNumber(0); + + if (isset($matches['PreReleaseSuffix']) && $matches['PreReleaseSuffix'] !== '') { + $this->preReleaseSuffix = new PreReleaseSuffix($matches['PreReleaseSuffix']); + } + + if (isset($matches['BuildMetadata'])) { + $this->buildMetadata = new BuildMetaData($matches['BuildMetadata']); + } + } + + /** + * @param string $version + * + * @throws InvalidVersionException + */ + private function ensureVersionStringIsValid($version): void { + $regex = '/^v? + (?P0|[1-9]\d*) + \\. + (?P0|[1-9]\d*) + (\\. + (?P0|[1-9]\d*) + )? + (?: + - + (?(?:(dev|beta|b|rc|alpha|a|patch|p|pl)\.?\d*)) + )? + (?: + \\+ + (?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-@]+)*) + )? + $/xi'; + + if (\preg_match($regex, $version, $matches) !== 1) { + throw new InvalidVersionException( + \sprintf("Version string '%s' does not follow SemVer semantics", $version) + ); + } + + $this->parseVersion($matches); + } +} diff --git a/vendor/phar-io/version/src/VersionConstraintParser.php b/vendor/phar-io/version/src/VersionConstraintParser.php new file mode 100644 index 0000000..03d6a09 --- /dev/null +++ b/vendor/phar-io/version/src/VersionConstraintParser.php @@ -0,0 +1,115 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class VersionConstraintParser { + /** + * @throws UnsupportedVersionConstraintException + */ + public function parse(string $value): VersionConstraint { + if (\strpos($value, '|') !== false) { + return $this->handleOrGroup($value); + } + + if (!\preg_match('/^[\^~*]?v?[\d.*]+(?:-.*)?$/i', $value)) { + throw new UnsupportedVersionConstraintException( + \sprintf('Version constraint %s is not supported.', $value) + ); + } + + switch ($value[0]) { + case '~': + return $this->handleTildeOperator($value); + case '^': + return $this->handleCaretOperator($value); + } + + $constraint = new VersionConstraintValue($value); + + if ($constraint->getMajor()->isAny()) { + return new AnyVersionConstraint(); + } + + if ($constraint->getMinor()->isAny()) { + return new SpecificMajorVersionConstraint( + $constraint->getVersionString(), + $constraint->getMajor()->getValue() ?? 0 + ); + } + + if ($constraint->getPatch()->isAny()) { + return new SpecificMajorAndMinorVersionConstraint( + $constraint->getVersionString(), + $constraint->getMajor()->getValue() ?? 0, + $constraint->getMinor()->getValue() ?? 0 + ); + } + + return new ExactVersionConstraint($constraint->getVersionString()); + } + + private function handleOrGroup(string $value): OrVersionConstraintGroup { + $constraints = []; + + foreach (\preg_split('{\s*\|\|?\s*}', \trim($value)) as $groupSegment) { + $constraints[] = $this->parse(\trim($groupSegment)); + } + + return new OrVersionConstraintGroup($value, $constraints); + } + + private function handleTildeOperator(string $value): AndVersionConstraintGroup { + $constraintValue = new VersionConstraintValue(\substr($value, 1)); + + if ($constraintValue->getPatch()->isAny()) { + return $this->handleCaretOperator($value); + } + + $constraints = [ + new GreaterThanOrEqualToVersionConstraint( + $value, + new Version(\substr($value, 1)) + ), + new SpecificMajorAndMinorVersionConstraint( + $value, + $constraintValue->getMajor()->getValue() ?? 0, + $constraintValue->getMinor()->getValue() ?? 0 + ) + ]; + + return new AndVersionConstraintGroup($value, $constraints); + } + + private function handleCaretOperator(string $value): AndVersionConstraintGroup { + $constraintValue = new VersionConstraintValue(\substr($value, 1)); + + $constraints = [ + new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))) + ]; + + if ($constraintValue->getMajor()->getValue() === 0) { + $constraints[] = new SpecificMajorAndMinorVersionConstraint( + $value, + $constraintValue->getMajor()->getValue() ?? 0, + $constraintValue->getMinor()->getValue() ?? 0 + ); + } else { + $constraints[] = new SpecificMajorVersionConstraint( + $value, + $constraintValue->getMajor()->getValue() ?? 0 + ); + } + + return new AndVersionConstraintGroup( + $value, + $constraints + ); + } +} diff --git a/vendor/phar-io/version/src/VersionConstraintValue.php b/vendor/phar-io/version/src/VersionConstraintValue.php new file mode 100644 index 0000000..0762e7c --- /dev/null +++ b/vendor/phar-io/version/src/VersionConstraintValue.php @@ -0,0 +1,88 @@ +versionString = $versionString; + + $this->parseVersion($versionString); + } + + public function getLabel(): string { + return $this->label; + } + + public function getBuildMetaData(): string { + return $this->buildMetaData; + } + + public function getVersionString(): string { + return $this->versionString; + } + + public function getMajor(): VersionNumber { + return $this->major; + } + + public function getMinor(): VersionNumber { + return $this->minor; + } + + public function getPatch(): VersionNumber { + return $this->patch; + } + + private function parseVersion(string $versionString): void { + $this->extractBuildMetaData($versionString); + $this->extractLabel($versionString); + $this->stripPotentialVPrefix($versionString); + + $versionSegments = \explode('.', $versionString); + $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int)$versionSegments[0] : null); + + $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int)$versionSegments[1] : null; + $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int)$versionSegments[2] : null; + + $this->minor = new VersionNumber($minorValue); + $this->patch = new VersionNumber($patchValue); + } + + private function extractBuildMetaData(string &$versionString): void { + if (\preg_match('/\+(.*)/', $versionString, $matches) === 1) { + $this->buildMetaData = $matches[1]; + $versionString = \str_replace($matches[0], '', $versionString); + } + } + + private function extractLabel(string &$versionString): void { + if (\preg_match('/-(.*)/', $versionString, $matches) === 1) { + $this->label = $matches[1]; + $versionString = \str_replace($matches[0], '', $versionString); + } + } + + private function stripPotentialVPrefix(string &$versionString): void { + if ($versionString[0] !== 'v') { + return; + } + $versionString = \substr($versionString, 1); + } +} diff --git a/vendor/phar-io/version/src/VersionNumber.php b/vendor/phar-io/version/src/VersionNumber.php new file mode 100644 index 0000000..4833a9b --- /dev/null +++ b/vendor/phar-io/version/src/VersionNumber.php @@ -0,0 +1,28 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class VersionNumber { + + /** @var ?int */ + private $value; + + public function __construct(?int $value) { + $this->value = $value; + } + + public function isAny(): bool { + return $this->value === null; + } + + public function getValue(): ?int { + return $this->value; + } +} diff --git a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php b/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php new file mode 100644 index 0000000..66201a1 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php @@ -0,0 +1,23 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +abstract class AbstractVersionConstraint implements VersionConstraint { + /** @var string */ + private $originalValue; + + public function __construct(string $originalValue) { + $this->originalValue = $originalValue; + } + + public function asString(): string { + return $this->originalValue; + } +} diff --git a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php new file mode 100644 index 0000000..5096f2f --- /dev/null +++ b/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php @@ -0,0 +1,34 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class AndVersionConstraintGroup extends AbstractVersionConstraint { + /** @var VersionConstraint[] */ + private $constraints = []; + + /** + * @param VersionConstraint[] $constraints + */ + public function __construct(string $originalValue, array $constraints) { + parent::__construct($originalValue); + + $this->constraints = $constraints; + } + + public function complies(Version $version): bool { + foreach ($this->constraints as $constraint) { + if (!$constraint->complies($version)) { + return false; + } + } + + return true; + } +} diff --git a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php b/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php new file mode 100644 index 0000000..1499f07 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php @@ -0,0 +1,20 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class AnyVersionConstraint implements VersionConstraint { + public function complies(Version $version): bool { + return true; + } + + public function asString(): string { + return '*'; + } +} diff --git a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php b/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php new file mode 100644 index 0000000..1d675c9 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php @@ -0,0 +1,22 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class ExactVersionConstraint extends AbstractVersionConstraint { + public function complies(Version $version): bool { + $other = $version->getVersionString(); + + if ($version->hasBuildMetaData()) { + $other .= '+' . $version->getBuildMetaData()->asString(); + } + + return $this->asString() === $other; + } +} diff --git a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php b/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php new file mode 100644 index 0000000..ec37172 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php @@ -0,0 +1,26 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class GreaterThanOrEqualToVersionConstraint extends AbstractVersionConstraint { + /** @var Version */ + private $minimalVersion; + + public function __construct(string $originalValue, Version $minimalVersion) { + parent::__construct($originalValue); + + $this->minimalVersion = $minimalVersion; + } + + public function complies(Version $version): bool { + return $version->getVersionString() === $this->minimalVersion->getVersionString() + || $version->isGreaterThan($this->minimalVersion); + } +} diff --git a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php new file mode 100644 index 0000000..59fd382 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php @@ -0,0 +1,35 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class OrVersionConstraintGroup extends AbstractVersionConstraint { + /** @var VersionConstraint[] */ + private $constraints = []; + + /** + * @param string $originalValue + * @param VersionConstraint[] $constraints + */ + public function __construct($originalValue, array $constraints) { + parent::__construct($originalValue); + + $this->constraints = $constraints; + } + + public function complies(Version $version): bool { + foreach ($this->constraints as $constraint) { + if ($constraint->complies($version)) { + return true; + } + } + + return false; + } +} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php new file mode 100644 index 0000000..302aa31 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php @@ -0,0 +1,33 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class SpecificMajorAndMinorVersionConstraint extends AbstractVersionConstraint { + /** @var int */ + private $major; + + /** @var int */ + private $minor; + + public function __construct(string $originalValue, int $major, int $minor) { + parent::__construct($originalValue); + + $this->major = $major; + $this->minor = $minor; + } + + public function complies(Version $version): bool { + if ($version->getMajor()->getValue() !== $this->major) { + return false; + } + + return $version->getMinor()->getValue() === $this->minor; + } +} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php new file mode 100644 index 0000000..968b809 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php @@ -0,0 +1,25 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +class SpecificMajorVersionConstraint extends AbstractVersionConstraint { + /** @var int */ + private $major; + + public function __construct(string $originalValue, int $major) { + parent::__construct($originalValue); + + $this->major = $major; + } + + public function complies(Version $version): bool { + return $version->getMajor()->getValue() === $this->major; + } +} diff --git a/vendor/phar-io/version/src/constraints/VersionConstraint.php b/vendor/phar-io/version/src/constraints/VersionConstraint.php new file mode 100644 index 0000000..e94f9e0 --- /dev/null +++ b/vendor/phar-io/version/src/constraints/VersionConstraint.php @@ -0,0 +1,16 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +interface VersionConstraint { + public function complies(Version $version): bool; + + public function asString(): string; +} diff --git a/vendor/phar-io/version/src/exceptions/Exception.php b/vendor/phar-io/version/src/exceptions/Exception.php new file mode 100644 index 0000000..3ea458f --- /dev/null +++ b/vendor/phar-io/version/src/exceptions/Exception.php @@ -0,0 +1,15 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +use Throwable; + +interface Exception extends Throwable { +} diff --git a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php b/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php new file mode 100644 index 0000000..bc0b0c3 --- /dev/null +++ b/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php @@ -0,0 +1,5 @@ +, Sebastian Heuer , Sebastian Bergmann + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PharIo\Version; + +final class UnsupportedVersionConstraintException extends \RuntimeException implements Exception { +} diff --git a/vendor/phpmailer/phpmailer/COMMITMENT b/vendor/phpmailer/phpmailer/COMMITMENT new file mode 100644 index 0000000..a687e0d --- /dev/null +++ b/vendor/phpmailer/phpmailer/COMMITMENT @@ -0,0 +1,46 @@ +GPL Cooperation Commitment +Version 1.0 + +Before filing or continuing to prosecute any legal proceeding or claim +(other than a Defensive Action) arising from termination of a Covered +License, we commit to extend to the person or entity ('you') accused +of violating the Covered License the following provisions regarding +cure and reinstatement, taken from GPL version 3. As used here, the +term 'this License' refers to the specific Covered License being +enforced. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you + have received notice of violation of this License (for any work) + from that copyright holder, and you cure the violation prior to 30 + days after your receipt of the notice. + +We intend this Commitment to be irrevocable, and binding and +enforceable against us and assignees of or successors to our +copyrights. + +Definitions + +'Covered License' means the GNU General Public License, version 2 +(GPLv2), the GNU Lesser General Public License, version 2.1 +(LGPLv2.1), or the GNU Library General Public License, version 2 +(LGPLv2), all as published by the Free Software Foundation. + +'Defensive Action' means a legal proceeding or claim that We bring +against you in response to a prior proceeding or claim initiated by +you or your affiliate. + +'We' means each contributor to this repository as of the date of +inclusion of this file, including subsidiaries of a corporate +contributor. + +This work is available under a Creative Commons Attribution-ShareAlike +4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php new file mode 100644 index 0000000..cda0445 --- /dev/null +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -0,0 +1,182 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Get an OAuth2 token from an OAuth2 provider. + * * Install this script on your server so that it's accessible + * as [https/http]:////get_oauth_token.php + * e.g.: http://localhost/phpmailer/get_oauth_token.php + * * Ensure dependencies are installed with 'composer install' + * * Set up an app in your Google/Yahoo/Microsoft account + * * Set the script address as the app's redirect URL + * If no refresh token is obtained when running this file, + * revoke access to your app and run the script again. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Aliases for League Provider Classes + * Make sure you have added these to your composer.json and run `composer install` + * Plenty to choose from here: + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + */ +//@see https://github.com/thephpleague/oauth2-google +use League\OAuth2\Client\Provider\Google; +//@see https://packagist.org/packages/hayageek/oauth2-yahoo +use Hayageek\OAuth2\Client\Provider\Yahoo; +//@see https://github.com/stevenmaguire/oauth2-microsoft +use Stevenmaguire\OAuth2\Client\Provider\Microsoft; +//@see https://github.com/greew/oauth2-azure-provider +use Greew\OAuth2\Client\Provider\Azure; + +if (!isset($_GET['code']) && !isset($_POST['provider'])) { + ?> + + +
+

Select Provider

+ +
+ +
+ +
+ +
+

Enter id and secret

+

These details are obtained by setting up an app in your provider's developer console. +

+

ClientId:

+

ClientSecret:

+

TenantID (only relevant for Azure):

+ +
+ + + $clientId, + 'clientSecret' => $clientSecret, + 'redirectUri' => $redirectUri, + 'accessType' => 'offline' +]; + +$options = []; +$provider = null; + +switch ($providerName) { + case 'Google': + $provider = new Google($params); + $options = [ + 'scope' => [ + 'https://mail.google.com/' + ] + ]; + break; + case 'Yahoo': + $provider = new Yahoo($params); + break; + case 'Microsoft': + $provider = new Microsoft($params); + $options = [ + 'scope' => [ + 'wl.imap', + 'wl.offline_access' + ] + ]; + break; + case 'Azure': + $params['tenantId'] = $tenantId; + + $provider = new Azure($params); + $options = [ + 'scope' => [ + 'https://outlook.office.com/SMTP.Send', + 'offline_access' + ] + ]; + break; +} + +if (null === $provider) { + exit('Provider missing'); +} + +if (!isset($_GET['code'])) { + //If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl($options); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit; + //Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + unset($_SESSION['provider']); + exit('Invalid state'); +} else { + unset($_SESSION['provider']); + //Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken( + 'authorization_code', + [ + 'code' => $_GET['code'] + ] + ); + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires + echo 'Refresh Token: ', $token->getRefreshToken(); +} diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php new file mode 100644 index 0000000..0b2a72d --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; +$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; +$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; +$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; +$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; +$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; +$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; +$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; +$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; +$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; +$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php new file mode 100644 index 0000000..552167e --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php new file mode 100644 index 0000000..9e92dda --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; +$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; +$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; +$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; +$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; +$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; +$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; +$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; +$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; +$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; +$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; +$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; +$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php new file mode 100644 index 0000000..c41f675 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; +$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; +$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; +$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; +$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; +$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; +$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; +$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; +$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; +$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; +$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; +$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php new file mode 100644 index 0000000..3468485 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; +$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; +$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; +$PHPMAILER_LANG['execute'] = 'No es pot executar: '; +$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; +$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; +$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; +$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; +$PHPMAILER_LANG['signing'] = 'Error al signar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php new file mode 100644 index 0000000..e770a1a --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php @@ -0,0 +1,28 @@ + + * Rewrite and extension of the work by Mikael Stokkebro + * + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; +$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; +$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; +$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; +$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php new file mode 100644 index 0000000..e7e59d2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php @@ -0,0 +1,28 @@ + + * @author Crystopher Glodzienski Cardoso + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; +$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; +$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; +$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php new file mode 100644 index 0000000..93addc9 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; +$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; +$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; +$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; +$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; +$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; +$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; +$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; +$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; +$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; +$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; +$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php new file mode 100644 index 0000000..295a47f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php @@ -0,0 +1,28 @@ + + * @author Mohammad Hossein Mojtahedi + */ + +$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; +$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; +$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; +$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; +$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; +$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; +$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; +$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; +$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; +$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; +$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; +$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; +$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; +$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php new file mode 100644 index 0000000..6d1e637 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; +$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; +$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; +$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; +$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; +$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; +$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php new file mode 100644 index 0000000..0d367fc --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -0,0 +1,37 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; +$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; +$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; +$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; +$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; +$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php new file mode 100644 index 0000000..b123aa5 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; +$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; +$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; +$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; +$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; +$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; +$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; +$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; +$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; +$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; +$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php new file mode 100644 index 0000000..d2856e0 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -0,0 +1,35 @@ + + * Rewrite and extension of the work by Jayanti Suthar + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; +$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; +$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; +$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; +$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; +$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; +$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; +$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; +$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; +$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; +$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; +$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php new file mode 100644 index 0000000..cacb6c3 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; +$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php new file mode 100644 index 0000000..e6b58b0 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; +$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; +$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; +$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; +$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; +$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; +$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; +$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; +$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; +$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; +$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; +$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; +$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php new file mode 100644 index 0000000..212a11f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php @@ -0,0 +1,31 @@ + + * @author @januridp + * @author Ian Mustafa + */ + +$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; +$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; +$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; +$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; +$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; +$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php new file mode 100644 index 0000000..08a6b73 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php @@ -0,0 +1,28 @@ + + * @author Stefano Sabatini + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; +$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; +$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; +$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; +$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; +$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php new file mode 100644 index 0000000..c76f526 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -0,0 +1,29 @@ + + * @author Yoshi Sakai + * @author Arisophy + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; +$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; +$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; +$PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; +$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; +$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; +$PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; +$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php new file mode 100644 index 0000000..51fe403 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; +$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; +$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; +$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; +$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; +$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; +$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php new file mode 100644 index 0000000..8c97dd9 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; +$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다'; +$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: '; +$PHPMAILER_LANG['execute'] = '실행 불가: '; +$PHPMAILER_LANG['file_access'] = '파일 접근 불가: '; +$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: '; +$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다'; +$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; +$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['signing'] = '서명 오류: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; +$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: '; +$PHPMAILER_LANG['extension_missing'] = '확장자 없음: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php new file mode 100644 index 0000000..4f115b1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; +$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; +$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; +$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; +$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; +$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; +$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; +$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; +$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; +$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; +$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; +$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php new file mode 100644 index 0000000..679b18c --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; +$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; +$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; +$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; +$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; +$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; +$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; +$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; +$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; +$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; +$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php new file mode 100644 index 0000000..8a94f6a --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; +$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; +$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; +$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; +$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; +$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; +$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; +$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; +$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; +$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php new file mode 100644 index 0000000..04d262c --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; +$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; +$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; +$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; +$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; +$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; +$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; +$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; +$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; +$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php new file mode 100644 index 0000000..c9621a1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php @@ -0,0 +1,33 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; +$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; +$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; +$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; +$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; +$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; +$PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; +$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php new file mode 100644 index 0000000..b0469fd --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; +$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; +$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php new file mode 100644 index 0000000..5239865 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -0,0 +1,38 @@ + + * @author Lucas Guimarães + * @author Phelipe Alves + * @author Fabio Beneditto + * @author Geidson Benício Coelho + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; +$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; +$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; +$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php new file mode 100644 index 0000000..45bef91 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -0,0 +1,33 @@ + + * @author Foster Snowhill + */ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; +$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; +$PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php new file mode 100644 index 0000000..dce502a --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php @@ -0,0 +1,34 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP දෝෂය: සත්‍යාපනය අසාර්ථක විය.'; +$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දෝෂයක් නිසා email පණිවිඩ දෝෂ සහගත වීමේ හැකියාවක් ඇත. මෙය විසදීම සදහා SMTP භාවිතා කිරීම, mail.add_x_header INI setting එක අක්‍රීය කිරීම, MacOS හෝ Linux වලට මාරු වීම, හෝ ඔබගේ PHP version එක 7.0.17+ හෝ 7.1.3+ වලට අලුත් කිරීම කරගන්න.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP දෝෂය: සම්බන්ධ වීමට නොහැකි විය.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දෝෂය: දත්ත පිළිගනු නොලැබේ.'; +$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්'; +$PHPMAILER_LANG['encoding'] = 'නොදන්නා කේතනය: '; +$PHPMAILER_LANG['execute'] = 'ක්‍රියාත්මක කළ නොහැකි විය: '; +$PHPMAILER_LANG['extension_missing'] = 'Extension එක නොමැත: '; +$PHPMAILER_LANG['file_access'] = 'File එකට ප්‍රවේශ විය නොහැකි විය: '; +$PHPMAILER_LANG['file_open'] = 'File දෝෂය: File එක විවෘත කළ නොහැක: '; +$PHPMAILER_LANG['from_failed'] = 'පහත From ලිපිනයන් අසාර්ථක විය: '; +$PHPMAILER_LANG['instantiate'] = 'mail function එක ක්‍රියාත්මක කළ නොහැක.'; +$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: '; +$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header නාමයක් හෝ අගයක්'; +$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry එකක්: '; +$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host එකක්: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහාය නොදක්වයි.'; +$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම වශයෙන් එක් ලබන්නෙකුගේ ඊමේල් ලිපිනයක් සැපයිය යුතුය.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP දෝෂය: පහත ලබන්නන් අසමත් විය: '; +$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දෝෂය: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය අසාර්ථක විය.'; +$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP දෝෂය: '; +$PHPMAILER_LANG['variable_set'] = 'Variable එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php new file mode 100644 index 0000000..028f5bc --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php @@ -0,0 +1,30 @@ + + * @author Peter Orlický + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; +$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; +$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; +$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; +$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; +$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; +$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; +$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; +$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; +$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php new file mode 100644 index 0000000..3e00c25 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -0,0 +1,36 @@ + + * @author Filip Š + * @author Blaž Oražem + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; +$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; +$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; +$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; +$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; +$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; +$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; +$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; +$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; +$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; +$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; +$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; +$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php new file mode 100644 index 0000000..0b5280f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php @@ -0,0 +1,28 @@ + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; +$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; +$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; +$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; +$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; +$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; +$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; +$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; +$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; +$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php new file mode 100644 index 0000000..6213832 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php @@ -0,0 +1,28 @@ + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; +$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php new file mode 100644 index 0000000..9872c19 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; +$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php new file mode 100644 index 0000000..d15bed1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; +$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; +$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; +$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; +$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; +$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; +$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; +$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php new file mode 100644 index 0000000..f938f80 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -0,0 +1,31 @@ + + * @fixed by Boris Yurchenko + */ + +$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; +$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; +$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; +$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; +$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; +$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; +$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; +$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; +$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; +$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; +$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; +$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; +$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: '; +$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php new file mode 100644 index 0000000..d65576e --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; +$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; +$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php new file mode 100644 index 0000000..35e4e70 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php @@ -0,0 +1,29 @@ + + * @author Peter Dave Hello <@PeterDaveHello/> + * @author Jason Chiang + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; +$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; +$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; +$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; +$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; +$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php new file mode 100644 index 0000000..03d4911 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -0,0 +1,36 @@ + + * @author young + * @author Teddysun + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['buggy_php'] = '您的 PHP 版本存在漏洞,可能会导致消息损坏。为修复此问题,请切换到使用 SMTP 发送,在您的 php.ini 中禁用 mail.add_x_header 选项。切换到 MacOS 或 Linux,或将您的 PHP 升级到 7.0.17+ 或 7.1.3+ 版本。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; +$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['extension_missing'] = '缺少扩展名:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; +$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; +$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; +$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值'; +$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: '; +$PHPMAILER_LANG['invalid_host'] = '无效的主机:'; +$PHPMAILER_LANG['signing'] = '签名错误:'; +$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: '; +$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: '; +$PHPMAILER_LANG['smtp_detail'] = '详情:'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php new file mode 100644 index 0000000..566c961 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -0,0 +1,245 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception('Malformed DSN'); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php new file mode 100644 index 0000000..52eaf95 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -0,0 +1,40 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer exception handler. + * + * @author Marcus Bointon + */ +class Exception extends \Exception +{ + /** + * Prettify error message output. + * + * @return string + */ + public function errorMessage() + { + return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n"; + } +} diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php new file mode 100644 index 0000000..c1d5b77 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -0,0 +1,139 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +use League\OAuth2\Client\Grant\RefreshToken; +use League\OAuth2\Client\Provider\AbstractProvider; +use League\OAuth2\Client\Token\AccessToken; + +/** + * OAuth - OAuth2 authentication wrapper class. + * Uses the oauth2-client package from the League of Extraordinary Packages. + * + * @see http://oauth2-client.thephpleague.com + * + * @author Marcus Bointon (Synchro/coolbru) + */ +class OAuth implements OAuthTokenProvider +{ + /** + * An instance of the League OAuth Client Provider. + * + * @var AbstractProvider + */ + protected $provider; + + /** + * The current OAuth access token. + * + * @var AccessToken + */ + protected $oauthToken; + + /** + * The user's email address, usually used as the login ID + * and also the from address when sending email. + * + * @var string + */ + protected $oauthUserEmail = ''; + + /** + * The client secret, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientSecret = ''; + + /** + * The client ID, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientId = ''; + + /** + * The refresh token, used to obtain new AccessTokens. + * + * @var string + */ + protected $oauthRefreshToken = ''; + + /** + * OAuth constructor. + * + * @param array $options Associative array containing + * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements + */ + public function __construct($options) + { + $this->provider = $options['provider']; + $this->oauthUserEmail = $options['userName']; + $this->oauthClientSecret = $options['clientSecret']; + $this->oauthClientId = $options['clientId']; + $this->oauthRefreshToken = $options['refreshToken']; + } + + /** + * Get a new RefreshToken. + * + * @return RefreshToken + */ + protected function getGrant() + { + return new RefreshToken(); + } + + /** + * Get a new AccessToken. + * + * @return AccessToken + */ + protected function getToken() + { + return $this->provider->getAccessToken( + $this->getGrant(), + ['refresh_token' => $this->oauthRefreshToken] + ); + } + + /** + * Generate a base64-encoded OAuth token. + * + * @return string + */ + public function getOauth64() + { + //Get a new token if it's not available or has expired + if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { + $this->oauthToken = $this->getToken(); + } + + return base64_encode( + 'user=' . + $this->oauthUserEmail . + "\001auth=Bearer " . + $this->oauthToken . + "\001\001" + ); + } +} diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php new file mode 100644 index 0000000..1155507 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -0,0 +1,44 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * OAuthTokenProvider - OAuth2 token provider interface. + * Provides base64 encoded OAuth2 auth strings for SMTP authentication. + * + * @see OAuth + * @see SMTP::authenticate() + * + * @author Peter Scopes (pdscopes) + * @author Marcus Bointon (Synchro/coolbru) + */ +interface OAuthTokenProvider +{ + /** + * Generate a base64-encoded OAuth token ensuring that the access token has not expired. + * The string to be base 64 encoded should be in the form: + * "user=\001auth=Bearer \001\001" + * + * @return string + */ + public function getOauth64(); +} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php new file mode 100644 index 0000000..7f56ea2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -0,0 +1,5126 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer - PHP email creation and transport class. + * + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + const CHARSET_ASCII = 'us-ascii'; + const CHARSET_ISO88591 = 'iso-8859-1'; + const CHARSET_UTF8 = 'utf-8'; + + const CONTENT_TYPE_PLAINTEXT = 'text/plain'; + const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; + const CONTENT_TYPE_TEXT_HTML = 'text/html'; + const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; + const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; + const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; + + const ENCODING_7BIT = '7bit'; + const ENCODING_8BIT = '8bit'; + const ENCODING_BASE64 = 'base64'; + const ENCODING_BINARY = 'binary'; + const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; + + const ENCRYPTION_STARTTLS = 'tls'; + const ENCRYPTION_SMTPS = 'ssl'; + + const ICAL_METHOD_REQUEST = 'REQUEST'; + const ICAL_METHOD_PUBLISH = 'PUBLISH'; + const ICAL_METHOD_REPLY = 'REPLY'; + const ICAL_METHOD_ADD = 'ADD'; + const ICAL_METHOD_CANCEL = 'CANCEL'; + const ICAL_METHOD_REFRESH = 'REFRESH'; + const ICAL_METHOD_COUNTER = 'COUNTER'; + const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; + + /** + * Email priority. + * Options: null (default), 1 = High, 3 = Normal, 5 = low. + * When null, the header is not set at all. + * + * @var int|null + */ + public $Priority; + + /** + * The character set of the message. + * + * @var string + */ + public $CharSet = self::CHARSET_ISO88591; + + /** + * The MIME Content-type of the message. + * + * @var string + */ + public $ContentType = self::CONTENT_TYPE_PLAINTEXT; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * + * @var string + */ + public $Encoding = self::ENCODING_8BIT; + + /** + * Holds the most recent mailer error message. + * + * @var string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * + * @var string + */ + public $From = ''; + + /** + * The From name of the message. + * + * @var string + */ + public $FromName = ''; + + /** + * The envelope sender of the message. + * This will usually be turned into a Return-Path header by the receiver, + * and is the address that bounces will be sent to. + * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. + * + * @var string + */ + public $Sender = ''; + + /** + * The Subject of the message. + * + * @var string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * + * @var string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * + * @var string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. + * + * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @see http://kigkonsult.se/iCalcreator/ + * + * @var string + */ + public $Ical = ''; + + /** + * Value-array of "method" in Contenttype header "text/calendar" + * + * @var string[] + */ + protected static $IcalMethods = [ + self::ICAL_METHOD_REQUEST, + self::ICAL_METHOD_PUBLISH, + self::ICAL_METHOD_REPLY, + self::ICAL_METHOD_ADD, + self::ICAL_METHOD_CANCEL, + self::ICAL_METHOD_REFRESH, + self::ICAL_METHOD_COUNTER, + self::ICAL_METHOD_DECLINECOUNTER, + ]; + + /** + * The complete compiled MIME message body. + * + * @var string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * + * @var string + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * + * @var string + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. + * + * @see static::STD_LINE_LENGTH + * + * @var int + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * + * @var string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * + * @var string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * + * @var bool + */ + public $UseSendmailOptions = true; + + /** + * The email address that a reading confirmation should be sent to, also known as read receipt. + * + * @var string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in the Message-ID header and as default HELO string. + * If empty, PHPMailer attempts to find one with, in order, + * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value + * 'localhost.localdomain'. + * + * @see PHPMailer::$Helo + * + * @var string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-ID header. + * If empty, a unique id will be generated. + * You can set your own, but it must be in the format "", + * as defined in RFC5322 section 3.6.4 or it will be ignored. + * + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * + * @var string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * + * @var string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * You can also specify encryption type, for example: + * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). + * Hosts will be tried in order. + * + * @var string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * + * @var int + */ + public $Port = 25; + + /** + * The SMTP HELO/EHLO name used for the SMTP connection. + * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find + * one with the same method described above for $Hostname. + * + * @see PHPMailer::$Hostname + * + * @var string + */ + public $Helo = ''; + + /** + * What kind of encryption to use on the SMTP connection. + * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. + * + * @var string + */ + public $SMTPSecure = ''; + + /** + * Whether to enable TLS encryption automatically if a server supports it, + * even if `SMTPSecure` is not set to 'tls'. + * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. + * + * @var bool + */ + public $SMTPAutoTLS = true; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * + * @see PHPMailer::$Username + * @see PHPMailer::$Password + * + * @var bool + */ + public $SMTPAuth = false; + + /** + * Options array passed to stream_context_create when connecting via SMTP. + * + * @var array + */ + public $SMTPOptions = []; + + /** + * SMTP username. + * + * @var string + */ + public $Username = ''; + + /** + * SMTP password. + * + * @var string + */ + public $Password = ''; + + /** + * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. + * If not specified, the first one from that list that the server supports will be selected. + * + * @var string + */ + public $AuthType = ''; + + /** + * An implementation of the PHPMailer OAuthTokenProvider interface. + * + * @var OAuthTokenProvider + */ + protected $oauth; + + /** + * The SMTP server timeout in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timeout = 300; + + /** + * Comma separated list of DSN notifications + * 'NEVER' under no circumstances a DSN must be returned to the sender. + * If you use NEVER all other notifications will be ignored. + * 'SUCCESS' will notify you when your mail has arrived at its destination. + * 'FAILURE' will arrive if an error occurred during delivery. + * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual + * delivery's outcome (success or failure) is not yet decided. + * + * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + */ + public $dsn = ''; + + /** + * SMTP class debug output mode. + * Debug output level. + * Options: + * @see SMTP::DEBUG_OFF: No output + * @see SMTP::DEBUG_CLIENT: Client messages + * @see SMTP::DEBUG_SERVER: Client and server messages + * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status + * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed + * + * @see SMTP::$do_debug + * + * @var int + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @see SMTP::$Debugoutput + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep the SMTP connection open after each message. + * If this is set to true then the connection will remain open after a send, + * and closing the connection will require an explicit call to smtpClose(). + * It's a good idea to use this if you are sending multiple messages as it reduces overhead. + * See the mailing list example for how to use it. + * + * @var bool + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * Only supported in `mail` and `sendmail` transports, not in SMTP. + * + * @var bool + * + * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * + * @var array + */ + protected $SingleToArray = []; + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * + * @var bool + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * + * @var bool + */ + public $AllowEmpty = false; + + /** + * DKIM selector. + * + * @var string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email. + * + * @var string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * + * @var string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * + * @example 'example.com' + * + * @var string + */ + public $DKIM_domain = ''; + + /** + * DKIM Copy header field values for diagnostic use. + * + * @var bool + */ + public $DKIM_copyHeaderFields = true; + + /** + * DKIM Extra signing headers. + * + * @example ['List-Unsubscribe', 'List-Help'] + * + * @var array + */ + public $DKIM_extraHeaders = []; + + /** + * DKIM private key file path. + * + * @var string + */ + public $DKIM_private = ''; + + /** + * DKIM private key string. + * + * If set, takes precedence over `$DKIM_private`. + * + * @var string + */ + public $DKIM_private_string = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * bool $result result of the send action + * array $to email addresses of the recipients + * array $cc cc email addresses + * array $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * string $extra extra information of possible use + * "smtp_transaction_id' => last smtp transaction id + * + * @var string + */ + public $action_function = ''; + + /** + * What to put in the X-Mailer header. + * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. + * + * @var string|null + */ + public $XMailer = ''; + + /** + * Which validator to use by default when validating email addresses. + * May be a callable to inject your own validator, but there are several built-in validators. + * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. + * + * @see PHPMailer::validateAddress() + * + * @var string|callable + */ + public static $validator = 'php'; + + /** + * An instance of the SMTP sender class. + * + * @var SMTP + */ + protected $smtp; + + /** + * The array of 'to' names and addresses. + * + * @var array + */ + protected $to = []; + + /** + * The array of 'cc' names and addresses. + * + * @var array + */ + protected $cc = []; + + /** + * The array of 'bcc' names and addresses. + * + * @var array + */ + protected $bcc = []; + + /** + * The array of reply-to names and addresses. + * + * @var array + */ + protected $ReplyTo = []; + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * + * @var array + */ + protected $all_recipients = []; + + /** + * An array of names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $all_recipients + * and one of $to, $cc, or $bcc. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * @see PHPMailer::$all_recipients + * + * @var array + */ + protected $RecipientsQueue = []; + + /** + * An array of reply-to names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $ReplyTo. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$ReplyTo + * + * @var array + */ + protected $ReplyToQueue = []; + + /** + * The array of attachments. + * + * @var array + */ + protected $attachment = []; + + /** + * The array of custom headers. + * + * @var array + */ + protected $CustomHeader = []; + + /** + * The most recent Message-ID (including angular brackets). + * + * @var string + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * + * @var string + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * + * @var array + */ + protected $boundary = []; + + /** + * The array of available text strings for the current language. + * + * @var array + */ + protected $language = []; + + /** + * The number of errors encountered. + * + * @var int + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * + * @var string + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * + * @var string + */ + protected $sign_key_file = ''; + + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * + * @var string + */ + protected $sign_extracerts_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * + * @var string + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * + * @var bool + */ + protected $exceptions = false; + + /** + * Unique ID used for message ID and boundaries. + * + * @var string + */ + protected $uniqueid = ''; + + /** + * The PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.8.1'; + + /** + * Error severity: message only, continue processing. + * + * @var int + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing. + * + * @var int + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached. + * + * @var int + */ + const STOP_CRITICAL = 2; + + /** + * The SMTP standard CRLF line break. + * If you want to change line break format, change static::$LE, not this. + */ + const CRLF = "\r\n"; + + /** + * "Folding White Space" a white space string used for line folding. + */ + const FWS = ' '; + + /** + * SMTP RFC standard line ending; Carriage Return, Line Feed. + * + * @var string + */ + protected static $LE = self::CRLF; + + /** + * The maximum line length supported by mail(). + * + * Background: mail() will sometimes corrupt messages + * with headers longer than 65 chars, see #818. + * + * @var int + */ + const MAIL_MAX_LINE_LENGTH = 63; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1. + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The lower maximum line length allowed by RFC 2822 section 2.1.1. + * This length does NOT include the line break + * 76 means that lines will be 77 or 78 chars depending on whether + * the line break format is LF or CRLF; both are valid. + * + * @var int + */ + const STD_LINE_LENGTH = 76; + + /** + * Constructor. + * + * @param bool $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = null) + { + if (null !== $exceptions) { + $this->exceptions = (bool) $exceptions; + } + //Pick an appropriate debug output format automatically + $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); + } + + /** + * Destructor. + */ + public function __destruct() + { + //Close any open SMTP connection nicely + $this->smtpClose(); + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do). + * + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string|null $params Params + * + * @return bool + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if ((int)ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + //Calling mail() with null params breaks + $this->edebug('Sending with mail()'); + $this->edebug('Sendmail path: ' . ini_get('sendmail_path')); + $this->edebug("Envelope sender: {$this->Sender}"); + $this->edebug("To: {$to}"); + $this->edebug("Subject: {$subject}"); + $this->edebug("Headers: {$header}"); + if (!$this->UseSendmailOptions || null === $params) { + $result = @mail($to, $subject, $body, $header); + } else { + $this->edebug("Additional params: {$params}"); + $result = @mail($to, $subject, $body, $header, $params); + } + $this->edebug('Result: ' . ($result ? 'true' : 'false')); + return $result; + } + + /** + * Output debugging info via a user-defined method. + * Only generates output if debug output is enabled. + * + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * + * @param string $str + */ + protected function edebug($str) + { + if ($this->SMTPDebug <= 0) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $this->SMTPDebug); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Sets message type to HTML or plain. + * + * @param bool $isHtml True for HTML mode + */ + public function isHTML($isHtml = true) + { + if ($isHtml) { + $this->ContentType = static::CONTENT_TYPE_TEXT_HTML; + } else { + $this->ContentType = static::CONTENT_TYPE_PLAINTEXT; + } + } + + /** + * Send messages using SMTP. + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addAddress($address, $name = '') + { + return $this->addOrEnqueueAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addBCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-To" address. + * + * @param string $address The email address to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addReplyTo($address, $name = '') + { + return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer + * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still + * be modified after calling this function), addition of such addresses is delayed until send(). + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address + * @param string $name An optional username associated with the address + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addOrEnqueueAnAddress($kind, $address, $name) + { + $pos = false; + if ($address !== null) { + $address = trim($address); + $pos = strrpos($address, '@'); + } + if (false === $pos) { + //At-sign is missing. + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ($name !== null && is_string($name)) { + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + } else { + $name = ''; + } + $params = [$kind, $address, $name]; + //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + //Domain is assumed to be whatever is after the last @ symbol in the address + if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + + return true; + } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + + return true; + } + + return false; + } + + //Immediately add standard addresses without IDN. + return call_user_func_array([$this, 'addAnAddress'], $params); + } + + /** + * Set the boundaries to use for delimiting MIME parts. + * If you override this, ensure you set all 3 boundaries to unique values. + * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, + * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 + * + * @return void + */ + public function setBoundaries() + { + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1=_' . $this->uniqueid; + $this->boundary[2] = 'b2=_' . $this->uniqueid; + $this->boundary[3] = 'b3=_' . $this->uniqueid; + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { + $error_message = sprintf( + '%s: %s', + $this->lang('Invalid recipient kind'), + $kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if (!static::validateAddress($address)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ('Reply-To' !== $kind) { + if (!array_key_exists(strtolower($address), $this->all_recipients)) { + $this->{$kind}[] = [$address, $name]; + $this->all_recipients[strtolower($address)] = true; + + return true; + } + } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = [$address, $name]; + + return true; + } + + return false; + } + + /** + * Parse and validate a string containing one or more RFC822-style comma-separated email addresses + * of the form "display name
" into an array of name/address pairs. + * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. + * Note that quotes in the name part are removed. + * + * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * + * @param string $addrstr The address list string + * @param bool $useimap Whether to use the IMAP extension to parse the list + * @param string $charset The charset to use when decoding the address list string. + * + * @return array + */ + public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) + { + $addresses = []; + if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { + //Use this built-in parser if it's available + $list = imap_rfc822_parse_adrlist($addrstr, ''); + // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + imap_errors(); + foreach ($list as $address) { + if ( + '.SYNTAX-ERROR.' !== $address->host && + static::validateAddress($address->mailbox . '@' . $address->host) + ) { + //Decode the name part if it's present and encoded + if ( + property_exists($address, 'personal') && + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + defined('MB_CASE_UPPER') && + preg_match('/^=\?.*\?=$/s', $address->personal) + ) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $address->personal = str_replace('_', '=20', $address->personal); + //Decode the name + $address->personal = mb_decode_mimeheader($address->personal); + mb_internal_encoding($origCharset); + } + + $addresses[] = [ + 'name' => (property_exists($address, 'personal') ? $address->personal : ''), + 'address' => $address->mailbox . '@' . $address->host, + ]; + } + } + } else { + //Use this simpler parser + $list = explode(',', $addrstr); + foreach ($list as $address) { + $address = trim($address); + //Is there a separate name part? + if (strpos($address, '<') === false) { + //No separate name, just use the whole thing + if (static::validateAddress($address)) { + $addresses[] = [ + 'name' => '', + 'address' => $address, + ]; + } + } else { + list($name, $email) = explode('<', $address); + $email = trim(str_replace('>', '', $email)); + $name = trim($name); + if (static::validateAddress($email)) { + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + //If this name is encoded, decode it + if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $name = str_replace('_', '=20', $name); + //Decode the name + $name = mb_decode_mimeheader($name); + mb_internal_encoding($origCharset); + } + $addresses[] = [ + //Remove any surrounding quotes and spaces from the name + 'name' => trim($name, '\'" '), + 'address' => $email, + ]; + } + } + } + } + + return $addresses; + } + + /** + * Set the From and FromName properties. + * + * @param string $address + * @param string $name + * @param bool $auto Whether to also set the Sender address, defaults to true + * + * @throws Exception + * + * @return bool + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim((string)$address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + //Don't validate now addresses with IDN. Will be done in send(). + $pos = strrpos($address, '@'); + if ( + (false === $pos) + || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) + && !static::validateAddress($address)) + ) { + $error_message = sprintf( + '%s (From): %s', + $this->lang('invalid_address'), + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto && empty($this->Sender)) { + $this->Sender = $address; + } + + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * Validation patterns supported: + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * + * ```php + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * ``` + * + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * + * @param string $address The email address to check + * @param string|callable $patternselect Which pattern to use + * + * @return bool + */ + public static function validateAddress($address, $patternselect = null) + { + if (null === $patternselect) { + $patternselect = static::$validator; + } + //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603 + if (is_callable($patternselect) && !is_string($patternselect)) { + return call_user_func($patternselect, $address); + } + //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 + if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { + return false; + } + switch ($patternselect) { + case 'pcre': //Kept for BC + case 'pcre8': + /* + * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL + * is based. + * In addition to the addresses allowed by filter_var, also permits: + * * dotless domains: `a@b` + * * comments: `1234 @ local(blah) .machine .example` + * * quoted elements: `'"test blah"@example.org'` + * * numeric TLDs: `a@b.123` + * * unbracketed IPv4 literals: `a@192.168.0.1` + * * IPv6 literals: 'first.last@[IPv6:a1::]' + * Not all of these will necessarily work for sending! + * + * @see http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (bool) preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + case 'html5': + /* + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * + * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) + */ + return (bool) preg_match( + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', + $address + ); + case 'php': + default: + return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; + } + } + + /** + * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the + * `intl` and `mbstring` PHP extensions. + * + * @return bool `true` if required functions for IDN support are present + */ + public static function idnSupported() + { + return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding'); + } + + /** + * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. + * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. + * This function silently returns unmodified address if: + * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) + * - Conversion to punycode is impossible (e.g. required PHP functions are not available) + * or fails for any reason (e.g. domain contains characters not allowed in an IDN). + * + * @see PHPMailer::$CharSet + * + * @param string $address The email address to convert + * + * @return string The encoded address in ASCII form + */ + public function punyencodeAddress($address) + { + //Verify we have required functions, CharSet, and at-sign. + $pos = strrpos($address, '@'); + if ( + !empty($this->CharSet) && + false !== $pos && + static::idnSupported() + ) { + $domain = substr($address, ++$pos); + //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { + //Convert the domain from whatever charset it's in to UTF-8 + $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); + //Ignore IDE complaints about this line - method signature changed in PHP 5.4 + $errorcode = 0; + if (defined('INTL_IDNA_VARIANT_UTS46')) { + //Use the current punycode standard (appeared in PHP 7.2) + $punycode = idn_to_ascii( + $domain, + \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | + \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, + \INTL_IDNA_VARIANT_UTS46 + ); + } elseif (defined('INTL_IDNA_VARIANT_2003')) { + //Fall back to this old, deprecated/removed encoding + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); + } else { + //Fall back to a default we don't know about + $punycode = idn_to_ascii($domain, $errorcode); + } + if (false !== $punycode) { + return substr($address, 0, $pos) . $punycode; + } + } + } + + return $address; + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * + * @throws Exception + * + * @return bool false on error - See the ErrorInfo property for details of the error + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + + return $this->postSend(); + } catch (Exception $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Prepare a message for sending. + * + * @throws Exception + * + * @return bool + */ + public function preSend() + { + if ( + 'smtp' === $this->Mailer + || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) + ) { + //SMTP mandates RFC-compliant line endings + //and it's also used with mail() on Windows + static::setLE(self::CRLF); + } else { + //Maintain backward compatibility with legacy Linux command line mailers + static::setLE(PHP_EOL); + } + //Check for buggy PHP versions that add a header with an incorrect line break + if ( + 'mail' === $this->Mailer + && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) + || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) + && ini_get('mail.add_x_header') === '1' + && stripos(PHP_OS, 'WIN') === 0 + ) { + trigger_error($this->lang('buggy_php'), E_USER_WARNING); + } + + try { + $this->error_count = 0; //Reset errors + $this->mailHeader = ''; + + //Dequeue recipient and Reply-To addresses with IDN + foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { + $params[1] = $this->punyencodeAddress($params[1]); + call_user_func_array([$this, 'addAnAddress'], $params); + } + if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { + throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); + } + + //Validate From, Sender, and ConfirmReadingTo addresses + foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { + $this->{$address_kind} = trim($this->{$address_kind}); + if (empty($this->{$address_kind})) { + continue; + } + $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); + if (!static::validateAddress($this->{$address_kind})) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $address_kind, + $this->{$address_kind} + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + } + + //Set whether the message is multipart/alternative + if ($this->alternativeExists()) { + $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; + } + + $this->setMessageType(); + //Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty && empty($this->Body)) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + + //Trim subject consistently + $this->Subject = trim($this->Subject); + //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + $this->MIMEHeader = ''; + $this->MIMEBody = $this->createBody(); + //createBody may have added some headers, so retain them + $tempheaders = $this->MIMEHeader; + $this->MIMEHeader = $this->createHeader(); + $this->MIMEHeader .= $tempheaders; + + //To capture the complete message when using mail(), create + //an extra header list which createHeader() doesn't fold in + if ('mail' === $this->Mailer) { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader($this->Subject)) + ); + } + + //Sign with DKIM if enabled + if ( + !empty($this->DKIM_domain) + && !empty($this->DKIM_selector) + && (!empty($this->DKIM_private_string) + || (!empty($this->DKIM_private) + && static::isPermittedPath($this->DKIM_private) + && file_exists($this->DKIM_private) + ) + ) + ) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE . + static::normalizeBreaks($header_dkim) . static::$LE; + } + + return true; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Actually send a message via the selected mechanism. + * + * @throws Exception + * + * @return bool + */ + public function postSend() + { + try { + //Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer . 'Send'; + if (method_exists($this, $sendMethod)) { + return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { + $this->smtp->reset(); + } + if ($this->exceptions) { + throw $exc; + } + } + + return false; + } + + /** + * Send mail using the $Sendmail program. + * + * @see PHPMailer::$Sendmail + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function sendmailSend($header, $body) + { + if ($this->Mailer === 'qmail') { + $this->edebug('Sending with qmail'); + } else { + $this->edebug('Sending with sendmail'); + } + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + if ($this->Mailer === 'qmail') { + $sendmailFmt = '%s -f%s'; + } else { + $sendmailFmt = '%s -oi -f%s -t'; + } + } else { + //allow sendmail to choose a default envelope sender. It may + //seem preferable to force it to use the From header as with + //SMTP, but that introduces new problems (see + //), and + //it has historically worked this way. + $sendmailFmt = '%s -oi -t'; + } + + $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + $this->edebug('Sendmail path: ' . $this->Sendmail); + $this->edebug('Sendmail command: ' . $sendmail); + $this->edebug('Envelope sender: ' . $this->Sender); + $this->edebug("Headers: {$header}"); + + if ($this->SingleTo) { + foreach ($this->SingleToArray as $toAddr) { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + $this->edebug("To: {$toAddr}"); + fwrite($mail, 'To: ' . $toAddr . "\n"); + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $this->doCallback( + ($result === 0), + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result === 0), + $this->to, + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + + return true; + } + + /** + * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. + * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. + * + * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report + * + * @param string $string The string to be validated + * + * @return bool + */ + protected static function isShellSafe($string) + { + //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, + //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, + //so we don't. + if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { + return false; + } + + if ( + escapeshellcmd($string) !== $string + || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) + ) { + return false; + } + + $length = strlen($string); + + for ($i = 0; $i < $length; ++$i) { + $c = $string[$i]; + + //All other characters have a special meaning in at least one common shell, including = and +. + //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + //Note that this does permit non-Latin alphanumeric characters based on the current locale. + if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { + return false; + } + } + + return true; + } + + /** + * Check whether a file path is of a permitted type. + * Used to reject URLs and phar files from functions that access local file paths, + * such as addAttachment. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function isPermittedPath($path) + { + //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 + return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); + } + + /** + * Check whether a file path is safe, accessible, and readable. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function fileIsAccessible($path) + { + if (!static::isPermittedPath($path)) { + return false; + } + $readable = is_file($path); + //If not a UNC path (expected to start with \\), check read permission, see #2069 + if (strpos($path, '\\\\') !== 0) { + $readable = $readable && is_readable($path); + } + return $readable; + } + + /** + * Send mail using the PHP mail() function. + * + * @see http://www.php.net/manual/en/book.mail.php + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function mailSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + + $toArr = []; + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = trim(implode(', ', $toArr)); + + //If there are no To-addresses (e.g. when sending only to BCC-addresses) + //the following should be added to get a correct DKIM-signature. + //Compare with $this->preSend() + if ($to === '') { + $to = 'undisclosed-recipients:;'; + } + + $params = null; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + if (!empty($this->Sender) && static::validateAddress($this->Sender)) { + if (self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo && count($toArr) > 1) { + foreach ($toArr as $toAddr) { + $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $this->doCallback( + $result, + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL); + } + + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation, + * or set one with setSMTPInstance. + * + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP(); + } + + return $this->smtp; + } + + /** + * Provide an instance to use for SMTP operations. + * + * @return SMTP + */ + public function setSMTPInstance(SMTP $smtp) + { + $this->smtp = $smtp; + + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * + * @see PHPMailer::setSMTPInstance() to use a different class. + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function smtpSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + $bad_rcpt = []; + if (!$this->smtpConnect($this->SMTPOptions)) { + throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + //Sender already validated in preSend() + if ('' === $this->Sender) { + $smtp_from = $this->From; + } else { + $smtp_from = $this->Sender; + } + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); + } + + $callbacks = []; + //Attempt to send to all recipients + foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { + foreach ($togroup as $to) { + if (!$this->smtp->recipient($to[0], $this->dsn)) { + $error = $this->smtp->getError(); + $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']]; + $isSent = false; + } else { + $isSent = true; + } + + $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]]; + } + } + + //Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { + throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + + $smtp_transaction_id = $this->smtp->getLastTransactionID(); + + if ($this->SMTPKeepAlive) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + + foreach ($callbacks as $cb) { + $this->doCallback( + $cb['issent'], + [[$cb['to'], $cb['name']]], + [], + [], + $this->Subject, + $body, + $this->From, + ['smtp_transaction_id' => $smtp_transaction_id] + ); + } + + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { + $errstr = ''; + foreach ($bad_rcpt as $bad) { + $errstr .= $bad['to'] . ': ' . $bad['error']; + } + throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE); + } + + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * + * @param array $options An array of options compatible with stream_context_create() + * + * @throws Exception + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @return bool + */ + public function smtpConnect($options = null) + { + if (null === $this->smtp) { + $this->smtp = $this->getSMTPInstance(); + } + + //If no options are provided, use whatever is set in the instance + if (null === $options) { + $options = $this->SMTPOptions; + } + + //Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + if ($this->Host === null) { + $this->Host = 'localhost'; + } + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = []; + if ( + !preg_match( + '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', + trim($hostentry), + $hostinfo + ) + ) { + $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); + //Not a valid host entry + continue; + } + //$hostinfo[1]: optional ssl or tls prefix + //$hostinfo[2]: the hostname + //$hostinfo[3]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used + + //Check the host name is a valid name or IP address before trying to use it + if (!static::isValidHost($hostinfo[2])) { + $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]); + continue; + } + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); + if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; //Can't have SSL and TLS at the same time + $secure = static::ENCRYPTION_SMTPS; + } elseif ('tls' === $hostinfo[1]) { + $tls = true; + //TLS doesn't use a prefix + $secure = static::ENCRYPTION_STARTTLS; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA256'); + if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[2]; + $port = $this->Port; + if ( + array_key_exists(3, $hostinfo) && + is_numeric($hostinfo[3]) && + $hostinfo[3] > 0 && + $hostinfo[3] < 65536 + ) { + $port = (int) $hostinfo[3]; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + //* it's not disabled + //* we have openssl extension + //* we are not already using SSL + //* the server offers STARTTLS + if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); + } + //We must resend EHLO after TLS negotiation + $this->smtp->hello($hello); + } + if ( + $this->SMTPAuth && !$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->oauth + ) + ) { + throw new Exception($this->lang('authenticate')); + } + + return true; + } catch (Exception $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + //We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + //If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + //As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions && null !== $lastexception) { + throw $lastexception; + } + if ($this->exceptions) { + // no exception was thrown, likely $this->smtp->connect() failed + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); + } + + return false; + } + + /** + * Close the active SMTP session if one exists. + */ + public function smtpClose() + { + if ((null !== $this->smtp) && $this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + + /** + * Set the language for error messages. + * The default language is English. + * + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * Optionally, the language code can be enhanced with a 4-character + * script annotation and/or a 2-character country annotation. + * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * Do not set this from user input! + * + * @return bool Returns true if the requested language was loaded, false otherwise. + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + //Backwards compatibility for renamed language codes + $renamed_langcodes = [ + 'br' => 'pt_br', + 'cz' => 'cs', + 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', + 'rs' => 'sr', + 'tg' => 'tl', + 'am' => 'hy', + ]; + + if (array_key_exists($langcode, $renamed_langcodes)) { + $langcode = $renamed_langcodes[$langcode]; + } + + //Define full set of translatable strings in English + $PHPMAILER_LANG = [ + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'extension_missing' => 'Extension missing: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address: ', + 'invalid_header' => 'Invalid header name or value', + 'invalid_hostentry' => 'Invalid hostentry: ', + 'invalid_host' => 'Invalid host: ', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_code' => 'SMTP code: ', + 'smtp_code_ex' => 'Additional SMTP info: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_detail' => 'Detail: ', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ', + ]; + if (empty($lang_path)) { + //Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; + } + + //Validate $langcode + $foundlang = true; + $langcode = strtolower($langcode); + if ( + !preg_match('/^(?P[a-z]{2})(?P - - - - - diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php deleted file mode 100644 index a85e451..0000000 --- a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details.html.php +++ /dev/null @@ -1,2 +0,0 @@ -render($frame_code) ?> -render($env_details) ?> \ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php deleted file mode 100644 index 8162d8c..0000000 --- a/vendor/filp/whoops/src/Whoops/Resources/views/panel_details_outer.html.php +++ /dev/null @@ -1,3 +0,0 @@ -
- render($panel_details) ?> -
\ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php deleted file mode 100644 index 7e652e4..0000000 --- a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left.html.php +++ /dev/null @@ -1,4 +0,0 @@ -render($header_outer); -$tpl->render($frames_description); -$tpl->render($frames_container); diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php deleted file mode 100644 index 77b575c..0000000 --- a/vendor/filp/whoops/src/Whoops/Resources/views/panel_left_outer.html.php +++ /dev/null @@ -1,3 +0,0 @@ -
- render($panel_left) ?> -
\ No newline at end of file diff --git a/vendor/filp/whoops/src/Whoops/Run.php b/vendor/filp/whoops/src/Whoops/Run.php deleted file mode 100644 index 0862768..0000000 --- a/vendor/filp/whoops/src/Whoops/Run.php +++ /dev/null @@ -1,597 +0,0 @@ - - */ - -namespace Whoops; - -use InvalidArgumentException; -use Throwable; -use Whoops\Exception\ErrorException; -use Whoops\Handler\CallbackHandler; -use Whoops\Handler\Handler; -use Whoops\Handler\HandlerInterface; -use Whoops\Inspector\CallableInspectorFactory; -use Whoops\Inspector\InspectorFactory; -use Whoops\Inspector\InspectorFactoryInterface; -use Whoops\Inspector\InspectorInterface; -use Whoops\Util\Misc; -use Whoops\Util\SystemFacade; - -final class Run implements RunInterface -{ - /** - * @var bool - */ - private $isRegistered; - - /** - * @var bool - */ - private $allowQuit = true; - - /** - * @var bool - */ - private $sendOutput = true; - - /** - * @var integer|false - */ - private $sendHttpCode = 500; - - /** - * @var integer|false - */ - private $sendExitCode = 1; - - /** - * @var HandlerInterface[] - */ - private $handlerStack = []; - - /** - * @var array - * @psalm-var list - */ - private $silencedPatterns = []; - - /** - * @var SystemFacade - */ - private $system; - - /** - * In certain scenarios, like in shutdown handler, we can not throw exceptions. - * - * @var bool - */ - private $canThrowExceptions = true; - - /** - * The inspector factory to create inspectors. - * - * @var InspectorFactoryInterface - */ - private $inspectorFactory; - - /** - * @var array - */ - private $frameFilters = []; - - public function __construct(SystemFacade $system = null) - { - $this->system = $system ?: new SystemFacade; - $this->inspectorFactory = new InspectorFactory(); - } - - /** - * Explicitly request your handler runs as the last of all currently registered handlers. - * - * @param callable|HandlerInterface $handler - * - * @return Run - */ - public function appendHandler($handler) - { - array_unshift($this->handlerStack, $this->resolveHandler($handler)); - return $this; - } - - /** - * Explicitly request your handler runs as the first of all currently registered handlers. - * - * @param callable|HandlerInterface $handler - * - * @return Run - */ - public function prependHandler($handler) - { - return $this->pushHandler($handler); - } - - /** - * Register your handler as the last of all currently registered handlers (to be executed first). - * Prefer using appendHandler and prependHandler for clarity. - * - * @param callable|HandlerInterface $handler - * - * @return Run - * - * @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface. - */ - public function pushHandler($handler) - { - $this->handlerStack[] = $this->resolveHandler($handler); - return $this; - } - - /** - * Removes and returns the last handler pushed to the handler stack. - * - * @see Run::removeFirstHandler(), Run::removeLastHandler() - * - * @return HandlerInterface|null - */ - public function popHandler() - { - return array_pop($this->handlerStack); - } - - /** - * Removes the first handler. - * - * @return void - */ - public function removeFirstHandler() - { - array_pop($this->handlerStack); - } - - /** - * Removes the last handler. - * - * @return void - */ - public function removeLastHandler() - { - array_shift($this->handlerStack); - } - - /** - * Returns an array with all handlers, in the order they were added to the stack. - * - * @return array - */ - public function getHandlers() - { - return $this->handlerStack; - } - - /** - * Clears all handlers in the handlerStack, including the default PrettyPage handler. - * - * @return Run - */ - public function clearHandlers() - { - $this->handlerStack = []; - return $this; - } - - public function getFrameFilters() - { - return $this->frameFilters; - } - - public function clearFrameFilters() - { - $this->frameFilters = []; - return $this; - } - - /** - * Registers this instance as an error handler. - * - * @return Run - */ - public function register() - { - if (!$this->isRegistered) { - // Workaround PHP bug 42098 - // https://bugs.php.net/bug.php?id=42098 - class_exists("\\Whoops\\Exception\\ErrorException"); - class_exists("\\Whoops\\Exception\\FrameCollection"); - class_exists("\\Whoops\\Exception\\Frame"); - class_exists("\\Whoops\\Exception\\Inspector"); - class_exists("\\Whoops\\Inspector\\InspectorFactory"); - - $this->system->setErrorHandler([$this, self::ERROR_HANDLER]); - $this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]); - $this->system->registerShutdownFunction([$this, self::SHUTDOWN_HANDLER]); - - $this->isRegistered = true; - } - - return $this; - } - - /** - * Unregisters all handlers registered by this Whoops\Run instance. - * - * @return Run - */ - public function unregister() - { - if ($this->isRegistered) { - $this->system->restoreExceptionHandler(); - $this->system->restoreErrorHandler(); - - $this->isRegistered = false; - } - - return $this; - } - - /** - * Should Whoops allow Handlers to force the script to quit? - * - * @param bool|int $exit - * - * @return bool - */ - public function allowQuit($exit = null) - { - if (func_num_args() == 0) { - return $this->allowQuit; - } - - return $this->allowQuit = (bool) $exit; - } - - /** - * Silence particular errors in particular files. - * - * @param array|string $patterns List or a single regex pattern to match. - * @param int $levels Defaults to E_STRICT | E_DEPRECATED. - * - * @return Run - */ - public function silenceErrorsInPaths($patterns, $levels = 10240) - { - $this->silencedPatterns = array_merge( - $this->silencedPatterns, - array_map( - function ($pattern) use ($levels) { - return [ - "pattern" => $pattern, - "levels" => $levels, - ]; - }, - (array) $patterns - ) - ); - - return $this; - } - - /** - * Returns an array with silent errors in path configuration. - * - * @return array - */ - public function getSilenceErrorsInPaths() - { - return $this->silencedPatterns; - } - - /** - * Should Whoops send HTTP error code to the browser if possible? - * Whoops will by default send HTTP code 500, but you may wish to - * use 502, 503, or another 5xx family code. - * - * @param bool|int $code - * - * @return int|false - * - * @throws InvalidArgumentException - */ - public function sendHttpCode($code = null) - { - if (func_num_args() == 0) { - return $this->sendHttpCode; - } - - if (!$code) { - return $this->sendHttpCode = false; - } - - if ($code === true) { - $code = 500; - } - - if ($code < 400 || 600 <= $code) { - throw new InvalidArgumentException( - "Invalid status code '$code', must be 4xx or 5xx" - ); - } - - return $this->sendHttpCode = $code; - } - - /** - * Should Whoops exit with a specific code on the CLI if possible? - * Whoops will exit with 1 by default, but you can specify something else. - * - * @param int $code - * - * @return int - * - * @throws InvalidArgumentException - */ - public function sendExitCode($code = null) - { - if (func_num_args() == 0) { - return $this->sendExitCode; - } - - if ($code < 0 || 255 <= $code) { - throw new InvalidArgumentException( - "Invalid status code '$code', must be between 0 and 254" - ); - } - - return $this->sendExitCode = (int) $code; - } - - /** - * Should Whoops push output directly to the client? - * If this is false, output will be returned by handleException. - * - * @param bool|int $send - * - * @return bool - */ - public function writeToOutput($send = null) - { - if (func_num_args() == 0) { - return $this->sendOutput; - } - - return $this->sendOutput = (bool) $send; - } - - /** - * Handles an exception, ultimately generating a Whoops error page. - * - * @param Throwable $exception - * - * @return string Output generated by handlers. - */ - public function handleException($exception) - { - // Walk the registered handlers in the reverse order - // they were registered, and pass off the exception - $inspector = $this->getInspector($exception); - - // Capture output produced while handling the exception, - // we might want to send it straight away to the client, - // or return it silently. - $this->system->startOutputBuffering(); - - // Just in case there are no handlers: - $handlerResponse = null; - $handlerContentType = null; - - try { - foreach (array_reverse($this->handlerStack) as $handler) { - $handler->setRun($this); - $handler->setInspector($inspector); - $handler->setException($exception); - - // The HandlerInterface does not require an Exception passed to handle() - // and neither of our bundled handlers use it. - // However, 3rd party handlers may have already relied on this parameter, - // and removing it would be possibly breaking for users. - $handlerResponse = $handler->handle($exception); - - // Collect the content type for possible sending in the headers. - $handlerContentType = method_exists($handler, 'contentType') ? $handler->contentType() : null; - - if (in_array($handlerResponse, [Handler::LAST_HANDLER, Handler::QUIT])) { - // The Handler has handled the exception in some way, and - // wishes to quit execution (Handler::QUIT), or skip any - // other handlers (Handler::LAST_HANDLER). If $this->allowQuit - // is false, Handler::QUIT behaves like Handler::LAST_HANDLER - break; - } - } - - $willQuit = $handlerResponse == Handler::QUIT && $this->allowQuit(); - } finally { - $output = $this->system->cleanOutputBuffer(); - } - - // If we're allowed to, send output generated by handlers directly - // to the output, otherwise, and if the script doesn't quit, return - // it so that it may be used by the caller - if ($this->writeToOutput()) { - // @todo Might be able to clean this up a bit better - if ($willQuit) { - // Cleanup all other output buffers before sending our output: - while ($this->system->getOutputBufferLevel() > 0) { - $this->system->endOutputBuffering(); - } - - // Send any headers if needed: - if (Misc::canSendHeaders() && $handlerContentType) { - header("Content-Type: {$handlerContentType}"); - } - } - - $this->writeToOutputNow($output); - } - - if ($willQuit) { - // HHVM fix for https://github.com/facebook/hhvm/issues/4055 - $this->system->flushOutputBuffer(); - - $this->system->stopExecution( - $this->sendExitCode() - ); - } - - return $output; - } - - /** - * Converts generic PHP errors to \ErrorException instances, before passing them off to be handled. - * - * This method MUST be compatible with set_error_handler. - * - * @param int $level - * @param string $message - * @param string|null $file - * @param int|null $line - * - * @return bool - * - * @throws ErrorException - */ - public function handleError($level, $message, $file = null, $line = null) - { - if ($level & $this->system->getErrorReportingLevel()) { - foreach ($this->silencedPatterns as $entry) { - $pathMatches = (bool) preg_match($entry["pattern"], $file); - $levelMatches = $level & $entry["levels"]; - if ($pathMatches && $levelMatches) { - // Ignore the error, abort handling - // See https://github.com/filp/whoops/issues/418 - return true; - } - } - - // XXX we pass $level for the "code" param only for BC reasons. - // see https://github.com/filp/whoops/issues/267 - $exception = new ErrorException($message, /*code*/ $level, /*severity*/ $level, $file, $line); - if ($this->canThrowExceptions) { - throw $exception; - } else { - $this->handleException($exception); - } - // Do not propagate errors which were already handled by Whoops. - return true; - } - - // Propagate error to the next handler, allows error_get_last() to - // work on silenced errors. - return false; - } - - /** - * Special case to deal with Fatal errors and the like. - * - * @return void - */ - public function handleShutdown() - { - // If we reached this step, we are in shutdown handler. - // An exception thrown in a shutdown handler will not be propagated - // to the exception handler. Pass that information along. - $this->canThrowExceptions = false; - - $error = $this->system->getLastError(); - if ($error && Misc::isLevelFatal($error['type'])) { - // If there was a fatal error, - // it was not handled in handleError yet. - $this->allowQuit = false; - $this->handleError( - $error['type'], - $error['message'], - $error['file'], - $error['line'] - ); - } - } - - - /** - * @param InspectorFactoryInterface $factory - * - * @return void - */ - public function setInspectorFactory(InspectorFactoryInterface $factory) - { - $this->inspectorFactory = $factory; - } - - public function addFrameFilter($filterCallback) - { - if (!is_callable($filterCallback)) { - throw new \InvalidArgumentException(sprintf( - "A frame filter must be of type callable, %s type given.", - gettype($filterCallback) - )); - } - - $this->frameFilters[] = $filterCallback; - return $this; - } - - /** - * @param Throwable $exception - * - * @return InspectorInterface - */ - private function getInspector($exception) - { - return $this->inspectorFactory->create($exception); - } - - /** - * Resolves the giving handler. - * - * @param callable|HandlerInterface $handler - * - * @return HandlerInterface - * - * @throws InvalidArgumentException - */ - private function resolveHandler($handler) - { - if (is_callable($handler)) { - $handler = new CallbackHandler($handler); - } - - if (!$handler instanceof HandlerInterface) { - throw new InvalidArgumentException( - "Handler must be a callable, or instance of " - . "Whoops\\Handler\\HandlerInterface" - ); - } - - return $handler; - } - - /** - * Echo something to the browser. - * - * @param string $output - * - * @return Run - */ - private function writeToOutputNow($output) - { - if ($this->sendHttpCode() && Misc::canSendHeaders()) { - $this->system->setHttpResponseCode( - $this->sendHttpCode() - ); - } - - echo $output; - - return $this; - } -} diff --git a/vendor/filp/whoops/src/Whoops/RunInterface.php b/vendor/filp/whoops/src/Whoops/RunInterface.php deleted file mode 100644 index 0ef3e3f..0000000 --- a/vendor/filp/whoops/src/Whoops/RunInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - */ - -namespace Whoops; - -use InvalidArgumentException; -use Whoops\Exception\ErrorException; -use Whoops\Handler\HandlerInterface; - -interface RunInterface -{ - const EXCEPTION_HANDLER = "handleException"; - const ERROR_HANDLER = "handleError"; - const SHUTDOWN_HANDLER = "handleShutdown"; - - /** - * Pushes a handler to the end of the stack - * - * @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface - * @param Callable|HandlerInterface $handler - * @return Run - */ - public function pushHandler($handler); - - /** - * Removes the last handler in the stack and returns it. - * Returns null if there"s nothing else to pop. - * - * @return null|HandlerInterface - */ - public function popHandler(); - - /** - * Returns an array with all handlers, in the - * order they were added to the stack. - * - * @return array - */ - public function getHandlers(); - - /** - * Clears all handlers in the handlerStack, including - * the default PrettyPage handler. - * - * @return Run - */ - public function clearHandlers(); - - /** - * @return array - */ - public function getFrameFilters(); - - /** - * @return Run - */ - public function clearFrameFilters(); - - /** - * Registers this instance as an error handler. - * - * @return Run - */ - public function register(); - - /** - * Unregisters all handlers registered by this Whoops\Run instance - * - * @return Run - */ - public function unregister(); - - /** - * Should Whoops allow Handlers to force the script to quit? - * - * @param bool|int $exit - * @return bool - */ - public function allowQuit($exit = null); - - /** - * Silence particular errors in particular files - * - * @param array|string $patterns List or a single regex pattern to match - * @param int $levels Defaults to E_STRICT | E_DEPRECATED - * @return \Whoops\Run - */ - public function silenceErrorsInPaths($patterns, $levels = 10240); - - /** - * Should Whoops send HTTP error code to the browser if possible? - * Whoops will by default send HTTP code 500, but you may wish to - * use 502, 503, or another 5xx family code. - * - * @param bool|int $code - * @return int|false - */ - public function sendHttpCode($code = null); - - /** - * Should Whoops exit with a specific code on the CLI if possible? - * Whoops will exit with 1 by default, but you can specify something else. - * - * @param int $code - * @return int - */ - public function sendExitCode($code = null); - - /** - * Should Whoops push output directly to the client? - * If this is false, output will be returned by handleException - * - * @param bool|int $send - * @return bool - */ - public function writeToOutput($send = null); - - /** - * Handles an exception, ultimately generating a Whoops error - * page. - * - * @param \Throwable $exception - * @return string Output generated by handlers - */ - public function handleException($exception); - - /** - * Converts generic PHP errors to \ErrorException - * instances, before passing them off to be handled. - * - * This method MUST be compatible with set_error_handler. - * - * @param int $level - * @param string $message - * @param string $file - * @param int $line - * - * @return bool - * @throws ErrorException - */ - public function handleError($level, $message, $file = null, $line = null); - - /** - * Special case to deal with Fatal errors and the like. - */ - public function handleShutdown(); - - /** - * Registers a filter callback in the frame filters stack. - * - * @param callable $filterCallback - * @return \Whoops\Run - */ - public function addFrameFilter($filterCallback); -} diff --git a/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php b/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php deleted file mode 100644 index 8c828fd..0000000 --- a/vendor/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - -namespace Whoops\Util; - -/** - * Used as output callable for Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() - * - * @see TemplateHelper::dump() - */ -class HtmlDumperOutput -{ - private $output; - - public function __invoke($line, $depth) - { - // A negative depth means "end of dump" - if ($depth >= 0) { - // Adds a two spaces indentation to the line - $this->output .= str_repeat(' ', $depth) . $line . "\n"; - } - } - - public function getOutput() - { - return $this->output; - } - - public function clear() - { - $this->output = null; - } -} diff --git a/vendor/filp/whoops/src/Whoops/Util/Misc.php b/vendor/filp/whoops/src/Whoops/Util/Misc.php deleted file mode 100644 index 001a687..0000000 --- a/vendor/filp/whoops/src/Whoops/Util/Misc.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - -namespace Whoops\Util; - -class Misc -{ - /** - * Can we at this point in time send HTTP headers? - * - * Currently this checks if we are even serving an HTTP request, - * as opposed to running from a command line. - * - * If we are serving an HTTP request, we check if it's not too late. - * - * @return bool - */ - public static function canSendHeaders() - { - return isset($_SERVER["REQUEST_URI"]) && !headers_sent(); - } - - public static function isAjaxRequest() - { - return ( - !empty($_SERVER['HTTP_X_REQUESTED_WITH']) - && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); - } - - /** - * Check, if possible, that this execution was triggered by a command line. - * @return bool - */ - public static function isCommandLine() - { - return PHP_SAPI == 'cli'; - } - - /** - * Translate ErrorException code into the represented constant. - * - * @param int $error_code - * @return string - */ - public static function translateErrorCode($error_code) - { - $constants = get_defined_constants(true); - if (array_key_exists('Core', $constants)) { - foreach ($constants['Core'] as $constant => $value) { - if (substr($constant, 0, 2) == 'E_' && $value == $error_code) { - return $constant; - } - } - } - return "E_UNKNOWN"; - } - - /** - * Determine if an error level is fatal (halts execution) - * - * @param int $level - * @return bool - */ - public static function isLevelFatal($level) - { - $errors = E_ERROR; - $errors |= E_PARSE; - $errors |= E_CORE_ERROR; - $errors |= E_CORE_WARNING; - $errors |= E_COMPILE_ERROR; - $errors |= E_COMPILE_WARNING; - return ($level & $errors) > 0; - } -} diff --git a/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php b/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php deleted file mode 100644 index 9eb0acf..0000000 --- a/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php +++ /dev/null @@ -1,144 +0,0 @@ - - */ - -namespace Whoops\Util; - -class SystemFacade -{ - /** - * Turns on output buffering. - * - * @return bool - */ - public function startOutputBuffering() - { - return ob_start(); - } - - /** - * @param callable $handler - * @param int $types - * - * @return callable|null - */ - public function setErrorHandler(callable $handler, $types = 'use-php-defaults') - { - // Since PHP 5.4 the constant E_ALL contains all errors (even E_STRICT) - if ($types === 'use-php-defaults') { - $types = E_ALL; - } - return set_error_handler($handler, $types); - } - - /** - * @param callable $handler - * - * @return callable|null - */ - public function setExceptionHandler(callable $handler) - { - return set_exception_handler($handler); - } - - /** - * @return void - */ - public function restoreExceptionHandler() - { - restore_exception_handler(); - } - - /** - * @return void - */ - public function restoreErrorHandler() - { - restore_error_handler(); - } - - /** - * @param callable $function - * - * @return void - */ - public function registerShutdownFunction(callable $function) - { - register_shutdown_function($function); - } - - /** - * @return string|false - */ - public function cleanOutputBuffer() - { - return ob_get_clean(); - } - - /** - * @return int - */ - public function getOutputBufferLevel() - { - return ob_get_level(); - } - - /** - * @return bool - */ - public function endOutputBuffering() - { - return ob_end_clean(); - } - - /** - * @return void - */ - public function flushOutputBuffer() - { - flush(); - } - - /** - * @return int - */ - public function getErrorReportingLevel() - { - return error_reporting(); - } - - /** - * @return array|null - */ - public function getLastError() - { - return error_get_last(); - } - - /** - * @param int $httpCode - * - * @return int - */ - public function setHttpResponseCode($httpCode) - { - if (!headers_sent()) { - // Ensure that no 'location' header is present as otherwise this - // will override the HTTP code being set here, and mask the - // expected error page. - header_remove('location'); - } - - return http_response_code($httpCode); - } - - /** - * @param int $exitStatus - */ - public function stopExecution($exitStatus) - { - exit($exitStatus); - } -} diff --git a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php deleted file mode 100644 index 8e4df32..0000000 --- a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php +++ /dev/null @@ -1,349 +0,0 @@ - - */ - -namespace Whoops\Util; - -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Cloner\AbstractCloner; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Whoops\Exception\Frame; - -/** - * Exposes useful tools for working with/in templates - */ -class TemplateHelper -{ - /** - * An array of variables to be passed to all templates - * @var array - */ - private $variables = []; - - /** - * @var HtmlDumper - */ - private $htmlDumper; - - /** - * @var HtmlDumperOutput - */ - private $htmlDumperOutput; - - /** - * @var AbstractCloner - */ - private $cloner; - - /** - * @var string - */ - private $applicationRootPath; - - public function __construct() - { - // root path for ordinary composer projects - $this->applicationRootPath = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); - } - - /** - * Escapes a string for output in an HTML document - * - * @param string $raw - * @return string - */ - public function escape($raw) - { - $flags = ENT_QUOTES; - - // HHVM has all constants defined, but only ENT_IGNORE - // works at the moment - if (defined("ENT_SUBSTITUTE") && !defined("HHVM_VERSION")) { - $flags |= ENT_SUBSTITUTE; - } else { - // This is for 5.3. - // The documentation warns of a potential security issue, - // but it seems it does not apply in our case, because - // we do not blacklist anything anywhere. - $flags |= ENT_IGNORE; - } - - $raw = str_replace(chr(9), ' ', $raw); - - return htmlspecialchars($raw, $flags, "UTF-8"); - } - - /** - * Escapes a string for output in an HTML document, but preserves - * URIs within it, and converts them to clickable anchor elements. - * - * @param string $raw - * @return string - */ - public function escapeButPreserveUris($raw) - { - $escaped = $this->escape($raw); - return preg_replace( - "@([A-z]+?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@", - "
$1", - $escaped - ); - } - - /** - * Makes sure that the given string breaks on the delimiter. - * - * @param string $delimiter - * @param string $s - * @return string - */ - public function breakOnDelimiter($delimiter, $s) - { - $parts = explode($delimiter, $s); - foreach ($parts as &$part) { - $part = '' . $part . ''; - } - - return implode($delimiter, $parts); - } - - /** - * Replace the part of the path that all files have in common. - * - * @param string $path - * @return string - */ - public function shorten($path) - { - if ($this->applicationRootPath != "/") { - $path = str_replace($this->applicationRootPath, '…', $path); - } - - return $path; - } - - private function getDumper() - { - if (!$this->htmlDumper && class_exists('Symfony\Component\VarDumper\Cloner\VarCloner')) { - $this->htmlDumperOutput = new HtmlDumperOutput(); - // re-use the same var-dumper instance, so it won't re-render the global styles/scripts on each dump. - $this->htmlDumper = new HtmlDumper($this->htmlDumperOutput); - - $styles = [ - 'default' => 'color:#FFFFFF; line-height:normal; font:12px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace !important; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: normal', - 'num' => 'color:#BCD42A', - 'const' => 'color: #4bb1b1;', - 'str' => 'color:#BCD42A', - 'note' => 'color:#ef7c61', - 'ref' => 'color:#A0A0A0', - 'public' => 'color:#FFFFFF', - 'protected' => 'color:#FFFFFF', - 'private' => 'color:#FFFFFF', - 'meta' => 'color:#FFFFFF', - 'key' => 'color:#BCD42A', - 'index' => 'color:#ef7c61', - ]; - $this->htmlDumper->setStyles($styles); - } - - return $this->htmlDumper; - } - - /** - * Format the given value into a human readable string. - * - * @param mixed $value - * @return string - */ - public function dump($value) - { - $dumper = $this->getDumper(); - - if ($dumper) { - // re-use the same DumpOutput instance, so it won't re-render the global styles/scripts on each dump. - // exclude verbose information (e.g. exception stack traces) - if (class_exists('Symfony\Component\VarDumper\Caster\Caster')) { - $cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); - // Symfony VarDumper 2.6 Caster class dont exist. - } else { - $cloneVar = $this->getCloner()->cloneVar($value); - } - - $dumper->dump( - $cloneVar, - $this->htmlDumperOutput - ); - - $output = $this->htmlDumperOutput->getOutput(); - $this->htmlDumperOutput->clear(); - - return $output; - } - - return htmlspecialchars(print_r($value, true)); - } - - /** - * Format the args of the given Frame as a human readable html string - * - * @param Frame $frame - * @return string the rendered html - */ - public function dumpArgs(Frame $frame) - { - // we support frame args only when the optional dumper is available - if (!$this->getDumper()) { - return ''; - } - - $html = ''; - $numFrames = count($frame->getArgs()); - - if ($numFrames > 0) { - $html = '
    '; - foreach ($frame->getArgs() as $j => $frameArg) { - $html .= '
  1. '. $this->dump($frameArg) .'
  2. '; - } - $html .= '
'; - } - - return $html; - } - - /** - * Convert a string to a slug version of itself - * - * @param string $original - * @return string - */ - public function slug($original) - { - $slug = str_replace(" ", "-", $original); - $slug = preg_replace('/[^\w\d\-\_]/i', '', $slug); - return strtolower($slug); - } - - /** - * Given a template path, render it within its own scope. This - * method also accepts an array of additional variables to be - * passed to the template. - * - * @param string $template - */ - public function render($template, array $additionalVariables = null) - { - $variables = $this->getVariables(); - - // Pass the helper to the template: - $variables["tpl"] = $this; - - if ($additionalVariables !== null) { - $variables = array_replace($variables, $additionalVariables); - } - - call_user_func(function () { - extract(func_get_arg(1)); - require func_get_arg(0); - }, $template, $variables); - } - - /** - * Sets the variables to be passed to all templates rendered - * by this template helper. - */ - public function setVariables(array $variables) - { - $this->variables = $variables; - } - - /** - * Sets a single template variable, by its name: - * - * @param string $variableName - * @param mixed $variableValue - */ - public function setVariable($variableName, $variableValue) - { - $this->variables[$variableName] = $variableValue; - } - - /** - * Gets a single template variable, by its name, or - * $defaultValue if the variable does not exist - * - * @param string $variableName - * @param mixed $defaultValue - * @return mixed - */ - public function getVariable($variableName, $defaultValue = null) - { - return isset($this->variables[$variableName]) ? - $this->variables[$variableName] : $defaultValue; - } - - /** - * Unsets a single template variable, by its name - * - * @param string $variableName - */ - public function delVariable($variableName) - { - unset($this->variables[$variableName]); - } - - /** - * Returns all variables for this helper - * - * @return array - */ - public function getVariables() - { - return $this->variables; - } - - /** - * Set the cloner used for dumping variables. - * - * @param AbstractCloner $cloner - */ - public function setCloner($cloner) - { - $this->cloner = $cloner; - } - - /** - * Get the cloner used for dumping variables. - * - * @return AbstractCloner - */ - public function getCloner() - { - if (!$this->cloner) { - $this->cloner = new VarCloner(); - } - return $this->cloner; - } - - /** - * Set the application root path. - * - * @param string $applicationRootPath - */ - public function setApplicationRootPath($applicationRootPath) - { - $this->applicationRootPath = $applicationRootPath; - } - - /** - * Return the application root path. - * - * @return string - */ - public function getApplicationRootPath() - { - return $this->applicationRootPath; - } -} diff --git a/vendor/laminas/laminas-escaper/src/Escaper.php b/vendor/laminas/laminas-escaper/src/Escaper.php deleted file mode 100644 index c4964cb..0000000 --- a/vendor/laminas/laminas-escaper/src/Escaper.php +++ /dev/null @@ -1,424 +0,0 @@ - - */ - protected static $htmlNamedEntityMap = [ - 34 => 'quot', // quotation mark - 38 => 'amp', // ampersand - 60 => 'lt', // less-than sign - 62 => 'gt', // greater-than sign - ]; - - /** - * Current encoding for escaping. If not UTF-8, we convert strings from this encoding - * pre-escaping and back to this encoding post-escaping. - * - * @var string - */ - protected $encoding = 'utf-8'; - - /** - * Holds the value of the special flags passed as second parameter to - * htmlspecialchars(). - * - * @var int - */ - protected $htmlSpecialCharsFlags; - - /** - * Static Matcher which escapes characters for HTML Attribute contexts - * - * @var callable - * @psalm-var callable(array):string - */ - protected $htmlAttrMatcher; - - /** - * Static Matcher which escapes characters for Javascript contexts - * - * @var callable - * @psalm-var callable(array):string - */ - protected $jsMatcher; - - /** - * Static Matcher which escapes characters for CSS Attribute contexts - * - * @var callable - * @psalm-var callable(array):string - */ - protected $cssMatcher; - - /** - * List of all encoding supported by this class - * - * @var array - */ - protected $supportedEncodings = [ - 'iso-8859-1', - 'iso8859-1', - 'iso-8859-5', - 'iso8859-5', - 'iso-8859-15', - 'iso8859-15', - 'utf-8', - 'cp866', - 'ibm866', - '866', - 'cp1251', - 'windows-1251', - 'win-1251', - '1251', - 'cp1252', - 'windows-1252', - '1252', - 'koi8-r', - 'koi8-ru', - 'koi8r', - 'big5', - '950', - 'gb2312', - '936', - 'big5-hkscs', - 'shift_jis', - 'sjis', - 'sjis-win', - 'cp932', - '932', - 'euc-jp', - 'eucjp', - 'eucjp-win', - 'macroman', - ]; - - /** - * Constructor: Single parameter allows setting of global encoding for use by - * the current object. - * - * @throws Exception\InvalidArgumentException - */ - public function __construct(?string $encoding = null) - { - if ($encoding !== null) { - if ($encoding === '') { - throw new Exception\InvalidArgumentException( - static::class . ' constructor parameter does not allow a blank value' - ); - } - - $encoding = strtolower($encoding); - if (! in_array($encoding, $this->supportedEncodings)) { - throw new Exception\InvalidArgumentException( - 'Value of \'' . $encoding . '\' passed to ' . static::class - . ' constructor parameter is invalid. Provide an encoding supported by htmlspecialchars()' - ); - } - - $this->encoding = $encoding; - } - - // We take advantage of ENT_SUBSTITUTE flag to correctly deal with invalid UTF-8 sequences. - $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; - - // set matcher callbacks - $this->htmlAttrMatcher = - /** @param array $matches */ - function (array $matches): string { - return $this->htmlAttrMatcher($matches); - }; - $this->jsMatcher = - /** @param array $matches */ - function (array $matches): string { - return $this->jsMatcher($matches); - }; - $this->cssMatcher = - /** @param array $matches */ - function (array $matches): string { - return $this->cssMatcher($matches); - }; - } - - /** - * Return the encoding that all output/input is expected to be encoded in. - * - * @return string - */ - public function getEncoding() - { - return $this->encoding; - } - - /** - * Escape a string for the HTML Body context where there are very few characters - * of special meaning. Internally this will use htmlspecialchars(). - * - * @return string - */ - public function escapeHtml(string $string) - { - return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding); - } - - /** - * Escape a string for the HTML Attribute context. We use an extended set of characters - * to escape that are not covered by htmlspecialchars() to cover cases where an attribute - * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE). - * - * @return string - */ - public function escapeHtmlAttr(string $string) - { - $string = $this->toUtf8($string); - if ($string === '' || ctype_digit($string)) { - return $string; - } - - $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string); - return $this->fromUtf8($result); - } - - /** - * Escape a string for the Javascript context. This does not use json_encode(). An extended - * set of characters are escaped beyond ECMAScript's rules for Javascript literal string - * escaping in order to prevent misinterpretation of Javascript as HTML leading to the - * injection of special characters and entities. The escaping used should be tolerant - * of cases where HTML escaping was not applied on top of Javascript escaping correctly. - * Backslash escaping is not used as it still leaves the escaped character as-is and so - * is not useful in a HTML context. - * - * @return string - */ - public function escapeJs(string $string) - { - $string = $this->toUtf8($string); - if ($string === '' || ctype_digit($string)) { - return $string; - } - - $result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string); - return $this->fromUtf8($result); - } - - /** - * Escape a string for the URI or Parameter contexts. This should not be used to escape - * an entire URI - only a subcomponent being inserted. The function is a simple proxy - * to rawurlencode() which now implements RFC 3986 since PHP 5.3 completely. - * - * @return string - */ - public function escapeUrl(string $string) - { - return rawurlencode($string); - } - - /** - * Escape a string for the CSS context. CSS escaping can be applied to any string being - * inserted into CSS and escapes everything except alphanumerics. - * - * @return string - */ - public function escapeCss(string $string) - { - $string = $this->toUtf8($string); - if ($string === '' || ctype_digit($string)) { - return $string; - } - - $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string); - return $this->fromUtf8($result); - } - - /** - * Callback function for preg_replace_callback that applies HTML Attribute - * escaping to all matches. - * - * @param array $matches - * @return string - */ - protected function htmlAttrMatcher($matches) - { - $chr = $matches[0]; - $ord = ord($chr); - - /** - * The following replaces characters undefined in HTML with the - * hex entity for the Unicode replacement character. - */ - if ( - ($ord <= 0x1f && $chr !== "\t" && $chr !== "\n" && $chr !== "\r") - || ($ord >= 0x7f && $ord <= 0x9f) - ) { - return '�'; - } - - /** - * Check if the current character to escape has a name entity we should - * replace it with while grabbing the integer value of the character. - */ - if (strlen($chr) > 1) { - $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8'); - } - - $hex = bin2hex($chr); - $ord = hexdec($hex); - if (isset(static::$htmlNamedEntityMap[$ord])) { - return '&' . static::$htmlNamedEntityMap[$ord] . ';'; - } - - /** - * Per OWASP recommendations, we'll use upper hex entities - * for any other characters where a named entity does not exist. - */ - if ($ord > 255) { - return sprintf('&#x%04X;', $ord); - } - return sprintf('&#x%02X;', $ord); - } - - /** - * Callback function for preg_replace_callback that applies Javascript - * escaping to all matches. - * - * @param array $matches - * @return string - */ - protected function jsMatcher($matches) - { - $chr = $matches[0]; - if (strlen($chr) === 1) { - return sprintf('\\x%02X', ord($chr)); - } - $chr = $this->convertEncoding($chr, 'UTF-16BE', 'UTF-8'); - $hex = strtoupper(bin2hex($chr)); - if (strlen($hex) <= 4) { - return sprintf('\\u%04s', $hex); - } - $highSurrogate = substr($hex, 0, 4); - $lowSurrogate = substr($hex, 4, 4); - return sprintf('\\u%04s\\u%04s', $highSurrogate, $lowSurrogate); - } - - /** - * Callback function for preg_replace_callback that applies CSS - * escaping to all matches. - * - * @param array $matches - * @return string - */ - protected function cssMatcher($matches) - { - $chr = $matches[0]; - if (strlen($chr) === 1) { - $ord = ord($chr); - } else { - $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8'); - $ord = hexdec(bin2hex($chr)); - } - return sprintf('\\%X ', $ord); - } - - /** - * Converts a string to UTF-8 from the base encoding. The base encoding is set via this - * - * @param string $string - * @throws Exception\RuntimeException - * @return string - */ - protected function toUtf8($string) - { - if ($this->getEncoding() === 'utf-8') { - $result = $string; - } else { - $result = $this->convertEncoding($string, 'UTF-8', $this->getEncoding()); - } - - if (! $this->isUtf8($result)) { - throw new Exception\RuntimeException( - sprintf('String to be escaped was not valid UTF-8 or could not be converted: %s', $result) - ); - } - - return $result; - } - - /** - * Converts a string from UTF-8 to the base encoding. The base encoding is set via this - * - * @param string $string - * @return string - */ - protected function fromUtf8($string) - { - if ($this->getEncoding() === 'utf-8') { - return $string; - } - - return $this->convertEncoding($string, $this->getEncoding(), 'UTF-8'); - } - - /** - * Checks if a given string appears to be valid UTF-8 or not. - * - * @param string $string - * @return bool - */ - protected function isUtf8($string) - { - return $string === '' || preg_match('/^./su', $string); - } - - /** - * Encoding conversion helper which wraps mb_convert_encoding - * - * @param string $string - * @param string $to - * @param array|string $from - * @return string - */ - protected function convertEncoding($string, $to, $from) - { - $result = mb_convert_encoding($string, $to, $from); - - if ($result === false) { - return ''; // return non-fatal blank string on encoding errors from users - } - - return $result; - } -} diff --git a/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php b/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php deleted file mode 100644 index 8f5fd89..0000000 --- a/vendor/laminas/laminas-escaper/src/Exception/ExceptionInterface.php +++ /dev/null @@ -1,11 +0,0 @@ - $color >> 16 & 0xFF, - 'g' => $color >> 8 & 0xFF, - 'b' => $color & 0xFF, - ]; - } - - /** - * @param array $components - * - * @return int - */ - public static function fromRgbToInt(array $components) - { - return ($components['r'] * 65536) + ($components['g'] * 256) + ($components['b']); - } -} diff --git a/vendor/league/color-extractor/src/ColorExtractor.php b/vendor/league/color-extractor/src/ColorExtractor.php deleted file mode 100644 index 364a3bd..0000000 --- a/vendor/league/color-extractor/src/ColorExtractor.php +++ /dev/null @@ -1,282 +0,0 @@ -palette = $palette; - } - - /** - * @param int $colorCount - * - * @return array - */ - public function extract($colorCount = 1) - { - if ($colorCount === 0) { - return []; - } - - if (!$this->isInitialized()) { - $this->initialize(); - } - - return self::mergeColors($this->sortedColors, $colorCount, 100 / $colorCount); - } - - /** - * @return bool - */ - protected function isInitialized() - { - return $this->sortedColors !== null; - } - - protected function initialize() - { - $queue = new \SplPriorityQueue(); - $this->sortedColors = new \SplFixedArray(count($this->palette)); - - $i = 0; - foreach ($this->palette as $color => $count) { - $labColor = self::intColorToLab($color); - $queue->insert( - $color, - (sqrt($labColor['a'] * $labColor['a'] + $labColor['b'] * $labColor['b']) ?: 1) * - (1 - $labColor['L'] / 200) * - sqrt($count) - ); - ++$i; - } - - $i = 0; - while ($queue->valid()) { - $this->sortedColors[$i] = $queue->current(); - $queue->next(); - ++$i; - } - } - - /** - * @param \SplFixedArray $colors - * @param int $limit - * @param int $maxDelta - * - * @return array - */ - protected static function mergeColors(\SplFixedArray $colors, $limit, $maxDelta) - { - $limit = min(count($colors), $limit); - if ($limit === 0) { - return []; - } - if ($limit === 1) { - return [$colors[0]]; - } - $labCache = new \SplFixedArray($limit - 1); - $mergedColors = []; - - foreach ($colors as $color) { - $hasColorBeenMerged = false; - - $colorLab = self::intColorToLab($color); - - foreach ($mergedColors as $i => $mergedColor) { - if (self::ciede2000DeltaE($colorLab, $labCache[$i]) < $maxDelta) { - $hasColorBeenMerged = true; - break; - } - } - - if ($hasColorBeenMerged) { - continue; - } - - $mergedColorCount = count($mergedColors); - $mergedColors[] = $color; - - if ($mergedColorCount + 1 == $limit) { - break; - } - - $labCache[$mergedColorCount] = $colorLab; - } - - return $mergedColors; - } - - /** - * @param array $firstLabColor - * @param array $secondLabColor - * - * @return float - */ - protected static function ciede2000DeltaE($firstLabColor, $secondLabColor) - { - $C1 = sqrt(pow($firstLabColor['a'], 2) + pow($firstLabColor['b'], 2)); - $C2 = sqrt(pow($secondLabColor['a'], 2) + pow($secondLabColor['b'], 2)); - $Cb = ($C1 + $C2) / 2; - - $G = .5 * (1 - sqrt(pow($Cb, 7) / (pow($Cb, 7) + pow(25, 7)))); - - $a1p = (1 + $G) * $firstLabColor['a']; - $a2p = (1 + $G) * $secondLabColor['a']; - - $C1p = sqrt(pow($a1p, 2) + pow($firstLabColor['b'], 2)); - $C2p = sqrt(pow($a2p, 2) + pow($secondLabColor['b'], 2)); - - $h1p = $a1p == 0 && $firstLabColor['b'] == 0 ? 0 : atan2($firstLabColor['b'], $a1p); - $h2p = $a2p == 0 && $secondLabColor['b'] == 0 ? 0 : atan2($secondLabColor['b'], $a2p); - - $LpDelta = $secondLabColor['L'] - $firstLabColor['L']; - $CpDelta = $C2p - $C1p; - - if ($C1p * $C2p == 0) { - $hpDelta = 0; - } elseif (abs($h2p - $h1p) <= 180) { - $hpDelta = $h2p - $h1p; - } elseif ($h2p - $h1p > 180) { - $hpDelta = $h2p - $h1p - 360; - } else { - $hpDelta = $h2p - $h1p + 360; - } - - $HpDelta = 2 * sqrt($C1p * $C2p) * sin($hpDelta / 2); - - $Lbp = ($firstLabColor['L'] + $secondLabColor['L']) / 2; - $Cbp = ($C1p + $C2p) / 2; - - if ($C1p * $C2p == 0) { - $hbp = $h1p + $h2p; - } elseif (abs($h1p - $h2p) <= 180) { - $hbp = ($h1p + $h2p) / 2; - } elseif ($h1p + $h2p < 360) { - $hbp = ($h1p + $h2p + 360) / 2; - } else { - $hbp = ($h1p + $h2p - 360) / 2; - } - - $T = 1 - .17 * cos($hbp - 30) + .24 * cos(2 * $hbp) + .32 * cos(3 * $hbp + 6) - .2 * cos(4 * $hbp - 63); - - $sigmaDelta = 30 * exp(-pow(($hbp - 275) / 25, 2)); - - $Rc = 2 * sqrt(pow($Cbp, 7) / (pow($Cbp, 7) + pow(25, 7))); - - $Sl = 1 + ((.015 * pow($Lbp - 50, 2)) / sqrt(20 + pow($Lbp - 50, 2))); - $Sc = 1 + .045 * $Cbp; - $Sh = 1 + .015 * $Cbp * $T; - - $Rt = -sin(2 * $sigmaDelta) * $Rc; - - return sqrt( - pow($LpDelta / $Sl, 2) + - pow($CpDelta / $Sc, 2) + - pow($HpDelta / $Sh, 2) + - $Rt * ($CpDelta / $Sc) * ($HpDelta / $Sh) - ); - } - - /** - * @param int $color - * - * @return array - */ - protected static function intColorToLab($color) - { - return self::xyzToLab( - self::srgbToXyz( - self::rgbToSrgb( - [ - 'R' => ($color >> 16) & 0xFF, - 'G' => ($color >> 8) & 0xFF, - 'B' => $color & 0xFF, - ] - ) - ) - ); - } - - /** - * @param int $value - * - * @return float - */ - protected static function rgbToSrgbStep($value) - { - $value /= 255; - - return $value <= .03928 ? - $value / 12.92 : - pow(($value + .055) / 1.055, 2.4); - } - - /** - * @param array $rgb - * - * @return array - */ - protected static function rgbToSrgb($rgb) - { - return [ - 'R' => self::rgbToSrgbStep($rgb['R']), - 'G' => self::rgbToSrgbStep($rgb['G']), - 'B' => self::rgbToSrgbStep($rgb['B']), - ]; - } - - /** - * @param array $rgb - * - * @return array - */ - protected static function srgbToXyz($rgb) - { - return [ - 'X' => (.4124564 * $rgb['R']) + (.3575761 * $rgb['G']) + (.1804375 * $rgb['B']), - 'Y' => (.2126729 * $rgb['R']) + (.7151522 * $rgb['G']) + (.0721750 * $rgb['B']), - 'Z' => (.0193339 * $rgb['R']) + (.1191920 * $rgb['G']) + (.9503041 * $rgb['B']), - ]; - } - - /** - * @param float $value - * - * @return float - */ - protected static function xyzToLabStep($value) - { - return $value > 216 / 24389 ? pow($value, 1 / 3) : 841 * $value / 108 + 4 / 29; - } - - /** - * @param array $xyz - * - * @return array - */ - protected static function xyzToLab($xyz) - { - //http://en.wikipedia.org/wiki/Illuminant_D65#Definition - $Xn = .95047; - $Yn = 1; - $Zn = 1.08883; - - // http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions - return [ - 'L' => 116 * self::xyzToLabStep($xyz['Y'] / $Yn) - 16, - 'a' => 500 * (self::xyzToLabStep($xyz['X'] / $Xn) - self::xyzToLabStep($xyz['Y'] / $Yn)), - 'b' => 200 * (self::xyzToLabStep($xyz['Y'] / $Yn) - self::xyzToLabStep($xyz['Z'] / $Zn)), - ]; - } -} diff --git a/vendor/league/color-extractor/src/Palette.php b/vendor/league/color-extractor/src/Palette.php deleted file mode 100644 index 5c5266f..0000000 --- a/vendor/league/color-extractor/src/Palette.php +++ /dev/null @@ -1,180 +0,0 @@ -colors); - } - - /** - * @return \Traversable - */ - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->colors); - } - - /** - * @return int - */ - public function getColorCount($color) - { - if (!array_key_exists($color, $this->colors)) { - return 0; - } - - return $this->colors[$color]; - } - - /** - * @param int $limit = null - * - * @return array - */ - public function getMostUsedColors($limit = null) - { - return array_slice($this->colors, 0, $limit, true); - } - - /** - * @param string $filename - * @param int|null $backgroundColor - * - * @return Palette - * - * @throws \InvalidArgumentException - */ - public static function fromFilename($filename, $backgroundColor = null) - { - if (!is_readable($filename)) { - throw new \InvalidArgumentException('Filename must be a valid path and should be readable'); - } - - return self::fromContents(file_get_contents($filename), $backgroundColor); - } - - /** - * @param string $url - * @param int|null $backgroundColor - * - * @return Palette - * - * @throws \RuntimeException - */ - public static function fromUrl($url, $backgroundColor = null) - { - if (!function_exists('curl_init')){ - return self::fromContents(file_get_contents($url)); - } - - $ch = curl_init(); - try { - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $contents = curl_exec($ch); - if ($contents === false) { - throw new \RuntimeException('Failed to fetch image from URL'); - } - } finally { - curl_close($ch); - } - - return self::fromContents($contents, $backgroundColor); - } - - /** - * Create instance with file contents - * - * @param string $contents - * @param int|null $backgroundColor - * - * @return Palette - */ - public static function fromContents($contents, $backgroundColor = null) { - $image = imagecreatefromstring($contents); - $palette = self::fromGD($image, $backgroundColor); - imagedestroy($image); - - return $palette; - } - - /** - * @param \GDImage|resource $image - * @param int|null $backgroundColor - * - * @return Palette - * - * @throws \InvalidArgumentException - */ - public static function fromGD($image, ?int $backgroundColor = null) - { - if (!$image instanceof \GDImage && (!is_resource($image) || get_resource_type($image) !== 'gd')) { - throw new \InvalidArgumentException('Image must be a gd resource'); - } - if ($backgroundColor !== null && (!is_numeric($backgroundColor) || $backgroundColor < 0 || $backgroundColor > 16777215)) { - throw new \InvalidArgumentException(sprintf('"%s" does not represent a valid color', $backgroundColor)); - } - - $palette = new self(); - - $areColorsIndexed = !imageistruecolor($image); - $imageWidth = imagesx($image); - $imageHeight = imagesy($image); - $palette->colors = []; - - $backgroundColorRed = ($backgroundColor >> 16) & 0xFF; - $backgroundColorGreen = ($backgroundColor >> 8) & 0xFF; - $backgroundColorBlue = $backgroundColor & 0xFF; - - for ($x = 0; $x < $imageWidth; ++$x) { - for ($y = 0; $y < $imageHeight; ++$y) { - $color = imagecolorat($image, $x, $y); - if ($areColorsIndexed) { - $colorComponents = imagecolorsforindex($image, $color); - $color = ($colorComponents['alpha'] * 16777216) + - ($colorComponents['red'] * 65536) + - ($colorComponents['green'] * 256) + - ($colorComponents['blue']); - } - - if ($alpha = $color >> 24) { - if ($backgroundColor === null) { - continue; - } - - $alpha /= 127; - $color = (int) (($color >> 16 & 0xFF) * (1 - $alpha) + $backgroundColorRed * $alpha) * 65536 + - (int) (($color >> 8 & 0xFF) * (1 - $alpha) + $backgroundColorGreen * $alpha) * 256 + - (int) (($color & 0xFF) * (1 - $alpha) + $backgroundColorBlue * $alpha); - } - - isset($palette->colors[$color]) ? - $palette->colors[$color] += 1 : - $palette->colors[$color] = 1; - } - } - - arsort($palette->colors); - - return $palette; - } - - protected function __construct() - { - $this->colors = []; - } -} diff --git a/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php b/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php deleted file mode 100644 index b4ee661..0000000 --- a/vendor/michelf/php-smartypants/Michelf/SmartyPants.inc.php +++ /dev/null @@ -1,9 +0,0 @@ - -# -# Original SmartyPants -# Copyright (c) 2003-2004 John Gruber -# -# -namespace Michelf; - - -# -# SmartyPants Parser Class -# - -class SmartyPants { - - ### Version ### - - const SMARTYPANTSLIB_VERSION = "1.8.1"; - - - ### Presets - - # SmartyPants does nothing at all - const ATTR_DO_NOTHING = 0; - # "--" for em-dashes; no en-dash support - const ATTR_EM_DASH = 1; - # "---" for em-dashes; "--" for en-dashes - const ATTR_LONG_EM_DASH_SHORT_EN = 2; - # "--" for em-dashes; "---" for en-dashes - const ATTR_SHORT_EM_DASH_LONG_EN = 3; - # "--" for em-dashes; "---" for en-dashes - const ATTR_STUPEFY = -1; - - # The default preset: ATTR_EM_DASH - const ATTR_DEFAULT = SmartyPants::ATTR_EM_DASH; - - - ### Standard Function Interface ### - - public static function defaultTransform($text, $attr = SmartyPants::ATTR_DEFAULT) { - # - # Initialize the parser and return the result of its transform method. - # This will work fine for derived classes too. - # - # Take parser class on which this function was called. - $parser_class = \get_called_class(); - - # try to take parser from the static parser list - static $parser_list; - $parser =& $parser_list[$parser_class][$attr]; - - # create the parser if not already set - if (!$parser) - $parser = new $parser_class($attr); - - # Transform text using parser. - return $parser->transform($text); - } - - - ### Configuration Variables ### - - # Partial regex for matching tags to skip - public $tags_to_skip = 'pre|code|kbd|script|style|math'; - - # Options to specify which transformations to make: - public $do_nothing = 0; # disable all transforms - public $do_quotes = 0; - public $do_backticks = 0; # 1 => double only, 2 => double & single - public $do_dashes = 0; # 1, 2, or 3 for the three modes described above - public $do_ellipses = 0; - public $do_stupefy = 0; - public $convert_quot = 0; # should we translate " entities into normal quotes? - - # Smart quote characters: - # Opening and closing smart double-quotes. - public $smart_doublequote_open = '“'; - public $smart_doublequote_close = '”'; - public $smart_singlequote_open = '‘'; - public $smart_singlequote_close = '’'; # Also apostrophe. - - # ``Backtick quotes'' - public $backtick_doublequote_open = '“'; // replacement for `` - public $backtick_doublequote_close = '”'; // replacement for '' - public $backtick_singlequote_open = '‘'; // replacement for ` - public $backtick_singlequote_close = '’'; // replacement for ' (also apostrophe) - - # Other punctuation - public $em_dash = '—'; - public $en_dash = '–'; - public $ellipsis = '…'; - - ### Parser Implementation ### - - public function __construct($attr = SmartyPants::ATTR_DEFAULT) { - # - # Initialize a parser with certain attributes. - # - # Parser attributes: - # 0 : do nothing - # 1 : set all - # 2 : set all, using old school en- and em- dash shortcuts - # 3 : set all, using inverted old school en and em- dash shortcuts - # - # q : quotes - # b : backtick quotes (``double'' only) - # B : backtick quotes (``double'' and `single') - # d : dashes - # D : old school dashes - # i : inverted old school dashes - # e : ellipses - # w : convert " entities to " for Dreamweaver users - # - if ($attr == "0") { - $this->do_nothing = 1; - } - else if ($attr == "1") { - # Do everything, turn all options on. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 1; - $this->do_ellipses = 1; - } - else if ($attr == "2") { - # Do everything, turn all options on, use old school dash shorthand. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 2; - $this->do_ellipses = 1; - } - else if ($attr == "3") { - # Do everything, turn all options on, use inverted old school dash shorthand. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 3; - $this->do_ellipses = 1; - } - else if ($attr == "-1") { - # Special "stupefy" mode. - $this->do_stupefy = 1; - } - else { - $chars = preg_split('//', $attr); - foreach ($chars as $c){ - if ($c == "q") { $this->do_quotes = 1; } - else if ($c == "b") { $this->do_backticks = 1; } - else if ($c == "B") { $this->do_backticks = 2; } - else if ($c == "d") { $this->do_dashes = 1; } - else if ($c == "D") { $this->do_dashes = 2; } - else if ($c == "i") { $this->do_dashes = 3; } - else if ($c == "e") { $this->do_ellipses = 1; } - else if ($c == "w") { $this->convert_quot = 1; } - else { - # Unknown attribute option, ignore. - } - } - } - } - - public function transform($text) { - - if ($this->do_nothing) { - return $text; - } - - $tokens = $this->tokenizeHTML($text); - $result = ''; - $in_pre = 0; # Keep track of when we're inside
 or  tags.
-
-		$prev_token_last_char = ""; # This is a cheat, used to get some context
-									# for one-character tokens that consist of 
-									# just a quote char. What we do is remember
-									# the last character of the previous text
-									# token, to use as context to curl single-
-									# character quote tokens correctly.
-
-		foreach ($tokens as $cur_token) {
-			if ($cur_token[0] == "tag") {
-				# Don't mess with quotes inside tags.
-				$result .= $cur_token[1];
-				if (preg_match('@<(/?)(?:'.$this->tags_to_skip.')[\s>]@', $cur_token[1], $matches)) {
-					$in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
-				}
-			} else {
-				$t = $cur_token[1];
-				$last_char = substr($t, -1); # Remember last char of this token before processing.
-				if (! $in_pre) {
-					$t = $this->educate($t, $prev_token_last_char);
-				}
-				$prev_token_last_char = $last_char;
-				$result .= $t;
-			}
-		}
-
-		return $result;
-	}
-
-
-	function decodeEntitiesInConfiguration() {
-	#
-	#   Utility function that converts entities in configuration variables to
-	#   UTF-8 characters.
-	#
-		$output_config_vars = array(
-			'smart_doublequote_open',
-			'smart_doublequote_close',
-			'smart_singlequote_open',
-			'smart_singlequote_close',
-			'backtick_doublequote_open',
-			'backtick_doublequote_close',
-			'backtick_singlequote_open',
-			'backtick_singlequote_close',
-			'em_dash',
-			'en_dash',
-			'ellipsis',
-		);
-		foreach ($output_config_vars as $var) {
-			$this->$var = html_entity_decode($this->$var);
-		}
-	}
-
-
-	protected function educate($t, $prev_token_last_char) {
-		$t = $this->processEscapes($t);
-
-		if ($this->convert_quot) {
-			$t = preg_replace('/"/', '"', $t);
-		}
-
-		if ($this->do_dashes) {
-			if ($this->do_dashes == 1) $t = $this->educateDashes($t);
-			if ($this->do_dashes == 2) $t = $this->educateDashesOldSchool($t);
-			if ($this->do_dashes == 3) $t = $this->educateDashesOldSchoolInverted($t);
-		}
-
-		if ($this->do_ellipses) $t = $this->educateEllipses($t);
-
-		# Note: backticks need to be processed before quotes.
-		if ($this->do_backticks) {
-			$t = $this->educateBackticks($t);
-			if ($this->do_backticks == 2) $t = $this->educateSingleBackticks($t);
-		}
-
-		if ($this->do_quotes) {
-			if ($t == "'") {
-				# Special case: single-character ' token
-				if (preg_match('/\S/', $prev_token_last_char)) {
-					$t = $this->smart_singlequote_close;
-				}
-				else {
-					$t = $this->smart_singlequote_open;
-				}
-			}
-			else if ($t == '"') {
-				# Special case: single-character " token
-				if (preg_match('/\S/', $prev_token_last_char)) {
-					$t = $this->smart_doublequote_close;
-				}
-				else {
-					$t = $this->smart_doublequote_open;
-				}
-			}
-			else {
-				# Normal case:
-				$t = $this->educateQuotes($t);
-			}
-		}
-
-		if ($this->do_stupefy) $t = $this->stupefyEntities($t);
-		
-		return $t;
-	}
-
-
-	protected function educateQuotes($_) {
-	#
-	#   Parameter:  String.
-	#
-	#   Returns:    The string, with "educated" curly quote HTML entities.
-	#
-	#   Example input:  "Isn't this fun?"
-	#   Example output: “Isn’t this fun?”
-	#
-		$dq_open  = $this->smart_doublequote_open;
-		$dq_close = $this->smart_doublequote_close;
-		$sq_open  = $this->smart_singlequote_open;
-		$sq_close = $this->smart_singlequote_close;
-	
-		# Make our own "punctuation" character class, because the POSIX-style
-		# [:PUNCT:] is only available in Perl 5.6 or later:
-		$punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]";
-
-		# Special case if the very first character is a quote
-		# followed by punctuation at a non-word-break. Close the quotes by brute force:
-		$_ = preg_replace(
-			array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"),
-			array($sq_close,                 $dq_close), $_);
-
-		# Special case for double sets of quotes, e.g.:
-		#   

He said, "'Quoted' words in a larger quote."

- $_ = preg_replace( - array("/\"'(?=\w)/", "/'\"(?=\w)/"), - array($dq_open.$sq_open, $sq_open.$dq_open), $_); - - # Special case for decade abbreviations (the '80s): - $_ = preg_replace("/'(?=\\d{2}s)/", $sq_close, $_); - - $close_class = '[^\ \t\r\n\[\{\(\-]'; - $dec_dashes = '&\#8211;|&\#8212;'; - - # Get most opening single quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - ' # the quote - (?=\\w) # followed by a word character - }x", '\1'.$sq_open, $_); - # Single closing quotes: - $_ = preg_replace("{ - ($close_class)? - ' - (?(1)| # If $1 captured, then do nothing; - (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace - ) # char or an 's' at a word ending position. This - # is a special case to handle something like: - # \"Custer's Last Stand.\" - }xi", '\1'.$sq_close, $_); - - # Any remaining single quotes should be opening ones: - $_ = str_replace("'", $sq_open, $_); - - - # Get most opening double quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - \" # the quote - (?=\\w) # followed by a word character - }x", '\1'.$dq_open, $_); - - # Double closing quotes: - $_ = preg_replace("{ - ($close_class)? - \" - (?(1)|(?=\\s)) # If $1 captured, then do nothing; - # if not, then make sure the next char is whitespace. - }x", '\1'.$dq_close, $_); - - # Any remaining quotes should be opening ones. - $_ = str_replace('"', $dq_open, $_); - - return $_; - } - - - protected function educateBackticks($_) { - # - # Parameter: String. - # Returns: The string, with ``backticks'' -style double quotes - # translated into HTML curly quote entities. - # - # Example input: ``Isn't this fun?'' - # Example output: “Isn't this fun?” - # - - $_ = str_replace(array("``", "''",), - array($this->backtick_doublequote_open, - $this->backtick_doublequote_close), $_); - return $_; - } - - - protected function educateSingleBackticks($_) { - # - # Parameter: String. - # Returns: The string, with `backticks' -style single quotes - # translated into HTML curly quote entities. - # - # Example input: `Isn't this fun?' - # Example output: ‘Isn’t this fun?’ - # - - $_ = str_replace(array("`", "'",), - array($this->backtick_singlequote_open, - $this->backtick_singlequote_close), $_); - return $_; - } - - - protected function educateDashes($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an em-dash HTML entity. - # - - $_ = str_replace('--', $this->em_dash, $_); - return $_; - } - - - protected function educateDashesOldSchool($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an en-dash HTML entity, and each "---" translated to - # an em-dash HTML entity. - # - - # em en - $_ = str_replace(array("---", "--",), - array($this->em_dash, $this->en_dash), $_); - return $_; - } - - - protected function educateDashesOldSchoolInverted($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an em-dash HTML entity, and each "---" translated to - # an en-dash HTML entity. Two reasons why: First, unlike the - # en- and em-dash syntax supported by - # EducateDashesOldSchool(), it's compatible with existing - # entries written before SmartyPants 1.1, back when "--" was - # only used for em-dashes. Second, em-dashes are more - # common than en-dashes, and so it sort of makes sense that - # the shortcut should be shorter to type. (Thanks to Aaron - # Swartz for the idea.) - # - - # en em - $_ = str_replace(array("---", "--",), - array($this->en_dash, $this->em_dash), $_); - return $_; - } - - - protected function educateEllipses($_) { - # - # Parameter: String. - # Returns: The string, with each instance of "..." translated to - # an ellipsis HTML entity. Also converts the case where - # there are spaces between the dots. - # - # Example input: Huh...? - # Example output: Huh…? - # - - $_ = str_replace(array("...", ". . .",), $this->ellipsis, $_); - return $_; - } - - - protected function stupefyEntities($_) { - # - # Parameter: String. - # Returns: The string, with each SmartyPants HTML entity translated to - # its ASCII counterpart. - # - # Example input: “Hello — world.” - # Example output: "Hello -- world." - # - - # en-dash em-dash - $_ = str_replace(array('–', '—'), - array('-', '--'), $_); - - # single quote open close - $_ = str_replace(array('‘', '’'), "'", $_); - - # double quote open close - $_ = str_replace(array('“', '”'), '"', $_); - - $_ = str_replace('…', '...', $_); # ellipsis - - return $_; - } - - - protected function processEscapes($_) { - # - # Parameter: String. - # Returns: The string, with after processing the following backslash - # escape sequences. This is useful if you want to force a "dumb" - # quote or other character to appear. - # - # Escape Value - # ------ ----- - # \\ \ - # \" " - # \' ' - # \. . - # \- - - # \` ` - # - $_ = str_replace( - array('\\\\', '\"', "\'", '\.', '\-', '\`'), - array('\', '"', ''', '.', '-', '`'), $_); - - return $_; - } - - - protected function tokenizeHTML($str) { - # - # Parameter: String containing HTML markup. - # Returns: An array of the tokens comprising the input - # string. Each token is either a tag (possibly with nested, - # tags contained therein, such as , or a - # run of text between tags. Each element of the array is a - # two-element array; the first is either 'tag' or 'text'; - # the second is the actual value. - # - # - # Regular expression derived from the _tokenize() subroutine in - # Brad Choate's MTRegex plugin. - # - # - $index = 0; - $tokens = array(); - - $match = '(?s:)|'. # comment - '(?s:<\?.*?\?>)|'. # processing instruction - # regular tags - '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)'; - - $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE); - - foreach ($parts as $part) { - if (++$index % 2 && $part != '') - $tokens[] = array('text', $part); - else - $tokens[] = array('tag', $part); - } - return $tokens; - } - -} diff --git a/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php b/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php deleted file mode 100644 index 9b3d274..0000000 --- a/vendor/michelf/php-smartypants/Michelf/SmartyPantsTypographer.inc.php +++ /dev/null @@ -1,10 +0,0 @@ - -# -# Original SmartyPants -# Copyright (c) 2003-2004 John Gruber -# -# -namespace Michelf; - - -# -# SmartyPants Typographer Parser Class -# -class SmartyPantsTypographer extends \Michelf\SmartyPants { - - ### Configuration Variables ### - - # Options to specify which transformations to make: - public $do_comma_quotes = 0; - public $do_guillemets = 0; - public $do_geresh_gershayim = 0; - public $do_space_emdash = 0; - public $do_space_endash = 0; - public $do_space_colon = 0; - public $do_space_semicolon = 0; - public $do_space_marks = 0; - public $do_space_frenchquote = 0; - public $do_space_thousand = 0; - public $do_space_unit = 0; - - # Quote characters for replacing ASCII approximations - public $doublequote_low = "„"; // replacement for ,, - public $guillemet_leftpointing = "«"; // replacement for << - public $guillemet_rightpointing = "»"; // replacement for >> - public $geresh = "׳"; - public $gershayim = "״"; - - # Space characters for different places: - # Space around em-dashes. "He_—_or she_—_should change that." - public $space_emdash = " "; - # Space around en-dashes. "He_–_or she_–_should change that." - public $space_endash = " "; - # Space before a colon. "He said_: here it is." - public $space_colon = " "; - # Space before a semicolon. "That's what I said_; that's what he said." - public $space_semicolon = " "; - # Space before a question mark and an exclamation mark: "¡_Holà_! What_?" - public $space_marks = " "; - # Space inside french quotes. "Voici la «_chose_» qui m'a attaqué." - public $space_frenchquote = " "; - # Space as thousand separator. "On compte 10_000 maisons sur cette liste." - public $space_thousand = " "; - # Space before a unit abreviation. "This 12_kg of matter costs 10_$." - public $space_unit = " "; - - - # Expression of a space (breakable or not): - public $space = '(?: | | |�*160;|�*[aA]0;)'; - - - ### Parser Implementation ### - - public function __construct($attr = SmartyPants::ATTR_DEFAULT) { - # - # Initialize a SmartyPantsTypographer_Parser with certain attributes. - # - # Parser attributes: - # 0 : do nothing - # 1 : set all, except dash spacing - # 2 : set all, except dash spacing, using old school en- and em- dash shortcuts - # 3 : set all, except dash spacing, using inverted old school en and em- dash shortcuts - # - # Punctuation: - # q -> quotes - # b -> backtick quotes (``double'' only) - # B -> backtick quotes (``double'' and `single') - # c -> comma quotes (,,double`` only) - # g -> guillemets (<> only) - # d -> dashes - # D -> old school dashes - # i -> inverted old school dashes - # e -> ellipses - # w -> convert " entities to " for Dreamweaver users - # - # Spacing: - # : -> colon spacing +- - # ; -> semicolon spacing +- - # m -> question and exclamation marks spacing +- - # h -> em-dash spacing +- - # H -> en-dash spacing +- - # f -> french quote spacing +- - # t -> thousand separator spacing - - # u -> unit spacing +- - # (you can add a plus sign after some of these options denoted by + to - # add the space when it is not already present, or you can add a minus - # sign to completly remove any space present) - # - # Initialize inherited SmartyPants parser. - parent::__construct($attr); - - if ($attr == "1" || $attr == "2" || $attr == "3") { - # Do everything, turn all options on. - $this->do_comma_quotes = 1; - $this->do_guillemets = 1; - $this->do_geresh_gershayim = 1; - $this->do_space_emdash = 1; - $this->do_space_endash = 1; - $this->do_space_colon = 1; - $this->do_space_semicolon = 1; - $this->do_space_marks = 1; - $this->do_space_frenchquote = 1; - $this->do_space_thousand = 1; - $this->do_space_unit = 1; - } - else if ($attr == "-1") { - # Special "stupefy" mode. - $this->do_stupefy = 1; - } - else { - $chars = preg_split('//', $attr); - foreach ($chars as $c){ - if ($c == "c") { $current =& $this->do_comma_quotes; } - else if ($c == "g") { $current =& $this->do_guillemets; } - else if ($c == "G") { $current =& $this->do_geresh_gershayim; } - else if ($c == ":") { $current =& $this->do_space_colon; } - else if ($c == ";") { $current =& $this->do_space_semicolon; } - else if ($c == "m") { $current =& $this->do_space_marks; } - else if ($c == "h") { $current =& $this->do_space_emdash; } - else if ($c == "H") { $current =& $this->do_space_endash; } - else if ($c == "f") { $current =& $this->do_space_frenchquote; } - else if ($c == "t") { $current =& $this->do_space_thousand; } - else if ($c == "u") { $current =& $this->do_space_unit; } - else if ($c == "+") { - $current = 2; - unset($current); - } - else if ($c == "-") { - $current = -1; - unset($current); - } - else { - # Unknown attribute option, ignore. - } - $current = 1; - } - } - } - - - function decodeEntitiesInConfiguration() { - parent::decodeEntitiesInConfiguration(); - $output_config_vars = array( - 'doublequote_low', - 'guillemet_leftpointing', - 'guillemet_rightpointing', - 'space_emdash', - 'space_endash', - 'space_colon', - 'space_semicolon', - 'space_marks', - 'space_frenchquote', - 'space_thousand', - 'space_unit', - ); - foreach ($output_config_vars as $var) { - $this->$var = html_entity_decode($this->$var); - } - } - - - function educate($t, $prev_token_last_char) { - # must happen before regular smart quotes - if ($this->do_geresh_gershayim) $t = $this->educateGereshGershayim($t); - - $t = parent::educate($t, $prev_token_last_char); - - if ($this->do_comma_quotes) $t = $this->educateCommaQuotes($t); - if ($this->do_guillemets) $t = $this->educateGuillemets($t); - - if ($this->do_space_emdash) $t = $this->spaceEmDash($t); - if ($this->do_space_endash) $t = $this->spaceEnDash($t); - if ($this->do_space_colon) $t = $this->spaceColon($t); - if ($this->do_space_semicolon) $t = $this->spaceSemicolon($t); - if ($this->do_space_marks) $t = $this->spaceMarks($t); - if ($this->do_space_frenchquote) $t = $this->spaceFrenchQuotes($t); - if ($this->do_space_thousand) $t = $this->spaceThousandSeparator($t); - if ($this->do_space_unit) $t = $this->spaceUnit($t); - - return $t; - } - - - protected function educateCommaQuotes($_) { - # - # Parameter: String. - # Returns: The string, with ,,comma,, -style double quotes - # translated into HTML curly quote entities. - # - # Example input: ,,Isn't this fun?,, - # Example output: „Isn't this fun?„ - # - # Note: this is meant to be used alongside with backtick quotes; there is - # no language that use only lower quotations alone mark like in the example. - # - $_ = str_replace(",,", $this->doublequote_low, $_); - return $_; - } - - - protected function educateGuillemets($_) { - # - # Parameter: String. - # Returns: The string, with << guillemets >> -style quotes - # translated into HTML guillemets entities. - # - # Example input: << Isn't this fun? >> - # Example output: „ Isn't this fun? „ - # - $_ = preg_replace("/(?:<|<){2}/", $this->guillemet_leftpointing, $_); - $_ = preg_replace("/(?:>|>){2}/", $this->guillemet_rightpointing, $_); - return $_; - } - - - protected function educateGereshGershayim($_) { - # - # Parameter: String, UTF-8 encoded. - # Returns: The string, where simple a or double quote surrounded by - # two hebrew characters is replaced into a typographic - # geresh or gershayim punctuation mark. - # - # Example input: צה"ל / צ'ארלס - # Example output: צה״ל / צ׳ארלס - # - // surrounding code points can be U+0590 to U+05BF and U+05D0 to U+05F2 - // encoded in UTF-8: D6.90 to D6.BF and D7.90 to D7.B2 - $_ = preg_replace('/(?<=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])\'(?=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])/', $this->geresh, $_); - $_ = preg_replace('/(?<=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])"(?=\xD6[\x90-\xBF]|\xD7[\x90-\xB2])/', $this->gershayim, $_); - return $_; - } - - - protected function spaceFrenchQuotes($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # inside french-style quotes, only french quotes. - # - # Example input: Quotes in « French », »German« and »Finnish» style. - # Example output: Quotes in «_French_», »German« and »Finnish» style. - # - $opt = ( $this->do_space_frenchquote == 2 ? '?' : '' ); - $chr = ( $this->do_space_frenchquote != -1 ? $this->space_frenchquote : '' ); - - # Characters allowed immediatly outside quotes. - $outside_char = $this->space . '|\s|[.,:;!?\[\](){}|@*~=+-]|¡|¿'; - - $_ = preg_replace( - "/(^|$outside_char)(«|«|›|‹)$this->space$opt/", - "\\1\\2$chr", $_); - $_ = preg_replace( - "/$this->space$opt(»|»|‹|›)($outside_char|$)/", - "$chr\\1\\2", $_); - return $_; - } - - - protected function spaceColon($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before colons. - # - # Example input: Ingredients : fun. - # Example output: Ingredients_: fun. - # - $opt = ( $this->do_space_colon == 2 ? '?' : '' ); - $chr = ( $this->do_space_colon != -1 ? $this->space_colon : '' ); - - $_ = preg_replace("/$this->space$opt(:)(\\s|$)/m", - "$chr\\1\\2", $_); - return $_; - } - - - protected function spaceSemicolon($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before semicolons. - # - # Example input: There he goes ; there she goes. - # Example output: There he goes_; there she goes. - # - $opt = ( $this->do_space_semicolon == 2 ? '?' : '' ); - $chr = ( $this->do_space_semicolon != -1 ? $this->space_semicolon : '' ); - - $_ = preg_replace("/$this->space(;)(?=\\s|$)/m", - " \\1", $_); - $_ = preg_replace("/((?:^|\\s)(?>[^&;\\s]+|&#?[a-zA-Z0-9]+;)*)". - " $opt(;)(?=\\s|$)/m", - "\\1$chr\\2", $_); - return $_; - } - - - protected function spaceMarks($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # around question and exclamation marks. - # - # Example input: ¡ Holà ! What ? - # Example output: ¡_Holà_! What_? - # - $opt = ( $this->do_space_marks == 2 ? '?' : '' ); - $chr = ( $this->do_space_marks != -1 ? $this->space_marks : '' ); - - // Regular marks. - $_ = preg_replace("/$this->space$opt([?!]+)/", "$chr\\1", $_); - - // Inverted marks. - $imarks = "(?:¡|¡|¡|&#x[Aa]1;|¿|¿|¿|&#x[Bb][Ff];)"; - $_ = preg_replace("/($imarks+)$this->space$opt/", "\\1$chr", $_); - - return $_; - } - - - protected function spaceEmDash($_) { - # - # Parameters: String, two replacement characters separated by a hyphen (`-`), - # and forcing flag. - # - # Returns: The string, with appropriates spaces replaced - # around dashes. - # - # Example input: Then — without any plan — the fun happend. - # Example output: Then_—_without any plan_—_the fun happend. - # - $opt = ( $this->do_space_emdash == 2 ? '?' : '' ); - $chr = ( $this->do_space_emdash != -1 ? $this->space_emdash : '' ); - $_ = preg_replace("/$this->space$opt(—|—)$this->space$opt/", - "$chr\\1$chr", $_); - return $_; - } - - - protected function spaceEnDash($_) { - # - # Parameters: String, two replacement characters separated by a hyphen (`-`), - # and forcing flag. - # - # Returns: The string, with appropriates spaces replaced - # around dashes. - # - # Example input: Then — without any plan — the fun happend. - # Example output: Then_—_without any plan_—_the fun happend. - # - $opt = ( $this->do_space_endash == 2 ? '?' : '' ); - $chr = ( $this->do_space_endash != -1 ? $this->space_endash : '' ); - $_ = preg_replace("/$this->space$opt(–|–)$this->space$opt/", - "$chr\\1$chr", $_); - return $_; - } - - - protected function spaceThousandSeparator($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # inside numbers (thousand separator in french). - # - # Example input: Il y a 10 000 insectes amusants dans ton jardin. - # Example output: Il y a 10_000 insectes amusants dans ton jardin. - # - $chr = ( $this->do_space_thousand != -1 ? $this->space_thousand : '' ); - $_ = preg_replace('/([0-9]) ([0-9])/', "\\1$chr\\2", $_); - return $_; - } - - - protected $units = ' - ### Metric units (with prefixes) - (?: - p | - µ | µ | &\#0*181; | &\#[xX]0*[Bb]5; | - [mcdhkMGT] - )? - (?: - [mgstAKNJWCVFSTHBL]|mol|cd|rad|Hz|Pa|Wb|lm|lx|Bq|Gy|Sv|kat| - Ω | Ohm | Ω | &\#0*937; | &\#[xX]0*3[Aa]9; - )| - ### Computers units (KB, Kb, TB, Kbps) - [kKMGT]?(?:[oBb]|[oBb]ps|flops)| - ### Money - ¢ | ¢ | &\#0*162; | &\#[xX]0*[Aa]2; | - M?(?: - £ | £ | &\#0*163; | &\#[xX]0*[Aa]3; | - ¥ | ¥ | &\#0*165; | &\#[xX]0*[Aa]5; | - € | € | &\#0*8364; | &\#[xX]0*20[Aa][Cc]; | - $ - )| - ### Other units - (?: ° | ° | &\#0*176; | &\#[xX]0*[Bb]0; ) [CF]? | - %|pt|pi|M?px|em|en|gal|lb|[NSEOW]|[NS][EOW]|ha|mbar - '; //x - - protected function spaceUnit($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before unit symbols. - # - # Example input: Get 3 mol of fun for 3 $. - # Example output: Get 3_mol of fun for 3_$. - # - $opt = ( $this->do_space_unit == 2 ? '?' : '' ); - $chr = ( $this->do_space_unit != -1 ? $this->space_unit : '' ); - - $_ = preg_replace('/ - (?:([0-9])[ ]'.$opt.') # Number followed by space. - ('.$this->units.') # Unit. - (?![a-zA-Z0-9]) # Negative lookahead for other unit characters. - /x', - "\\1$chr\\2", $_); - - return $_; - } - - - protected function spaceAbbr($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # around abbreviations. - # - # Example input: Fun i.e. something pleasant. - # Example output: Fun i.e._something pleasant. - # - $opt = ( $this->do_space_abbr == 2 ? '?' : '' ); - - $_ = preg_replace("/(^|\s)($this->abbr_after) $opt/m", - "\\1\\2$this->space_abbr", $_); - $_ = preg_replace("/( )$opt($this->abbr_sp_before)(?![a-zA-Z'])/m", - "\\1$this->space_abbr\\2", $_); - return $_; - } - - - protected function stupefyEntities($_) { - # - # Adding angle quotes and lower quotes to SmartyPants's stupefy mode. - # - $_ = parent::stupefyEntities($_); - - $_ = str_replace(array('„', '«', '»'), '"', $_); - - return $_; - } - - - protected function processEscapes($_) { - # - # Adding a few more escapes to SmartyPants's escapes: - # - # Escape Value - # ------ ----- - # \, , - # \< < - # \> > - # - $_ = parent::processEscapes($_); - - $_ = str_replace( - array('\,', '\<', '\>', '\<', '\>'), - array(',', '<', '>', '<', '>'), $_); - - return $_; - } -} diff --git a/vendor/michelf/php-smartypants/Readme.php b/vendor/michelf/php-smartypants/Readme.php deleted file mode 100644 index 55e840e..0000000 --- a/vendor/michelf/php-smartypants/Readme.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - - PHP Smartypants Lib - Readme - - - - - diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php deleted file mode 100644 index 6e766d8..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ /dev/null @@ -1,308 +0,0 @@ - Filter, 'matcher' => Matcher] pairs. - */ - private $filters = []; - - /** - * Type Filters to apply. - * - * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - */ - private $typeFilters = []; - - /** - * @var bool - */ - private $skipUncloneable = false; - - /** - * @var bool - */ - private $useCloneMethod; - - /** - * @param bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used - * instead of the regular deep cloning. - */ - public function __construct($useCloneMethod = false) - { - $this->useCloneMethod = $useCloneMethod; - - $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); - $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); - $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); - } - - /** - * If enabled, will not throw an exception when coming across an uncloneable property. - * - * @param $skipUncloneable - * - * @return $this - */ - public function skipUncloneable($skipUncloneable = true) - { - $this->skipUncloneable = $skipUncloneable; - - return $this; - } - - /** - * Deep copies the given object. - * - * @param mixed $object - * - * @return mixed - */ - public function copy($object) - { - $this->hashMap = []; - - return $this->recursiveCopy($object); - } - - public function addFilter(Filter $filter, Matcher $matcher) - { - $this->filters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - public function prependFilter(Filter $filter, Matcher $matcher) - { - array_unshift($this->filters, [ - 'matcher' => $matcher, - 'filter' => $filter, - ]); - } - - public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher) - { - $this->typeFilters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - private function recursiveCopy($var) - { - // Matches Type Filter - if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) { - return $filter->apply($var); - } - - // Resource - if (is_resource($var)) { - return $var; - } - - // Array - if (is_array($var)) { - return $this->copyArray($var); - } - - // Scalar - if (! is_object($var)) { - return $var; - } - - // Enum - if (PHP_VERSION_ID >= 80100 && enum_exists(get_class($var))) { - return $var; - } - - // Object - return $this->copyObject($var); - } - - /** - * Copy an array - * @param array $array - * @return array - */ - private function copyArray(array $array) - { - foreach ($array as $key => $value) { - $array[$key] = $this->recursiveCopy($value); - } - - return $array; - } - - /** - * Copies an object. - * - * @param object $object - * - * @throws CloneException - * - * @return object - */ - private function copyObject($object) - { - $objectHash = spl_object_hash($object); - - if (isset($this->hashMap[$objectHash])) { - return $this->hashMap[$objectHash]; - } - - $reflectedObject = new ReflectionObject($object); - $isCloneable = $reflectedObject->isCloneable(); - - if (false === $isCloneable) { - if ($this->skipUncloneable) { - $this->hashMap[$objectHash] = $object; - - return $object; - } - - throw new CloneException( - sprintf( - 'The class "%s" is not cloneable.', - $reflectedObject->getName() - ) - ); - } - - $newObject = clone $object; - $this->hashMap[$objectHash] = $newObject; - - if ($this->useCloneMethod && $reflectedObject->hasMethod('__clone')) { - return $newObject; - } - - if ($newObject instanceof DateTimeInterface || $newObject instanceof DateTimeZone) { - return $newObject; - } - - foreach (ReflectionHelper::getProperties($reflectedObject) as $property) { - $this->copyObjectProperty($newObject, $property); - } - - return $newObject; - } - - private function copyObjectProperty($object, ReflectionProperty $property) - { - // Ignore static properties - if ($property->isStatic()) { - return; - } - - // Apply the filters - foreach ($this->filters as $item) { - /** @var Matcher $matcher */ - $matcher = $item['matcher']; - /** @var Filter $filter */ - $filter = $item['filter']; - - if ($matcher->matches($object, $property->getName())) { - $filter->apply( - $object, - $property->getName(), - function ($object) { - return $this->recursiveCopy($object); - } - ); - - if ($filter instanceof ChainableFilter) { - continue; - } - - // If a filter matches, we stop processing this property - return; - } - } - - $property->setAccessible(true); - - // Ignore uninitialized properties (for PHP >7.4) - if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { - return; - } - - $propertyValue = $property->getValue($object); - - // Copy the property - $property->setValue($object, $this->recursiveCopy($propertyValue)); - } - - /** - * Returns first filter that matches variable, `null` if no such filter found. - * - * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and - * 'matcher' with value of type {@see TypeMatcher} - * @param mixed $var - * - * @return TypeFilter|null - */ - private function getFirstMatchedTypeFilter(array $filterRecords, $var) - { - $matched = $this->first( - $filterRecords, - function (array $record) use ($var) { - /* @var TypeMatcher $matcher */ - $matcher = $record['matcher']; - - return $matcher->matches($var); - } - ); - - return isset($matched) ? $matched['filter'] : null; - } - - /** - * Returns first element that matches predicate, `null` if no such element found. - * - * @param array $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - * @param callable $predicate Predicate arguments are: element. - * - * @return array|null Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and 'matcher' - * with value of type {@see TypeMatcher} or `null`. - */ - private function first(array $elements, callable $predicate) - { - foreach ($elements as $element) { - if (call_user_func($predicate, $element)) { - return $element; - } - } - - return null; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php deleted file mode 100644 index c046706..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php +++ /dev/null @@ -1,9 +0,0 @@ -filter = $filter; - } - - public function apply($object, $property, $objectCopier) - { - $this->filter->apply($object, $property, $objectCopier); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php deleted file mode 100644 index e6d9377..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php +++ /dev/null @@ -1,33 +0,0 @@ -setAccessible(true); - $oldCollection = $reflectionProperty->getValue($object); - - $newCollection = $oldCollection->map( - function ($item) use ($objectCopier) { - return $objectCopier($item); - } - ); - - $reflectionProperty->setValue($object, $newCollection); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php deleted file mode 100644 index 7b33fd5..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php +++ /dev/null @@ -1,28 +0,0 @@ -setAccessible(true); - - $reflectionProperty->setValue($object, new ArrayCollection()); - } -} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php deleted file mode 100644 index 8bee8f7..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php +++ /dev/null @@ -1,22 +0,0 @@ -__load(); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php deleted file mode 100644 index 85ba18c..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php +++ /dev/null @@ -1,18 +0,0 @@ -callback = $callable; - } - - /** - * Replaces the object property by the result of the callback called with the object property. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); - - $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); - - $reflectionProperty->setValue($object, $value); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php deleted file mode 100644 index bea86b8..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php +++ /dev/null @@ -1,24 +0,0 @@ -setAccessible(true); - $reflectionProperty->setValue($object, null); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php deleted file mode 100644 index c5887b1..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php +++ /dev/null @@ -1,22 +0,0 @@ -class = $class; - $this->property = $property; - } - - /** - * Matches a specific property of a specific class. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return ($object instanceof $this->class) && $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php deleted file mode 100644 index c8ec0d2..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php +++ /dev/null @@ -1,32 +0,0 @@ -property = $property; - } - - /** - * Matches a property by its name. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php deleted file mode 100644 index c7f4690..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php +++ /dev/null @@ -1,52 +0,0 @@ -propertyType = $propertyType; - } - - /** - * {@inheritdoc} - */ - public function matches($object, $property) - { - try { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - } catch (ReflectionException $exception) { - return false; - } - - $reflectionProperty->setAccessible(true); - - // Uninitialized properties (for PHP >7.4) - if (method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) { - // null instanceof $this->propertyType - return false; - } - - return $reflectionProperty->getValue($object) instanceof $this->propertyType; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php b/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php deleted file mode 100644 index 742410c..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php +++ /dev/null @@ -1,78 +0,0 @@ -getProperties() does not return private properties from ancestor classes. - * - * @author muratyaman@gmail.com - * @see http://php.net/manual/en/reflectionclass.getproperties.php - * - * @param ReflectionClass $ref - * - * @return ReflectionProperty[] - */ - public static function getProperties(ReflectionClass $ref) - { - $props = $ref->getProperties(); - $propsArr = array(); - - foreach ($props as $prop) { - $propertyName = $prop->getName(); - $propsArr[$propertyName] = $prop; - } - - if ($parentClass = $ref->getParentClass()) { - $parentPropsArr = self::getProperties($parentClass); - foreach ($propsArr as $key => $property) { - $parentPropsArr[$key] = $property; - } - - return $parentPropsArr; - } - - return $propsArr; - } - - /** - * Retrieves property by name from object and all its ancestors. - * - * @param object|string $object - * @param string $name - * - * @throws PropertyException - * @throws ReflectionException - * - * @return ReflectionProperty - */ - public static function getProperty($object, $name) - { - $reflection = is_object($object) ? new ReflectionObject($object) : new ReflectionClass($object); - - if ($reflection->hasProperty($name)) { - return $reflection->getProperty($name); - } - - if ($parentClass = $reflection->getParentClass()) { - return self::getProperty($parentClass->getName(), $name); - } - - throw new PropertyException( - sprintf( - 'The class "%s" doesn\'t have a property with the given name: "%s".', - is_object($object) ? get_class($object) : $object, - $name - ) - ); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php deleted file mode 100644 index becd1cf..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php +++ /dev/null @@ -1,33 +0,0 @@ - $propertyValue) { - $copy->{$propertyName} = $propertyValue; - } - - return $copy; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php deleted file mode 100644 index 164f8b8..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php +++ /dev/null @@ -1,30 +0,0 @@ -callback = $callable; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - return call_user_func($this->callback, $element); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php deleted file mode 100644 index a5fbd7a..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php +++ /dev/null @@ -1,17 +0,0 @@ -copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($arrayObject) - { - $clone = clone $arrayObject; - foreach ($arrayObject->getArrayCopy() as $k => $v) { - $clone->offsetSet($k, $this->copier->copy($v)); - } - - return $clone; - } -} - diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php deleted file mode 100644 index c5644cf..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php +++ /dev/null @@ -1,10 +0,0 @@ -copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - $newElement = clone $element; - - $copy = $this->createCopyClosure(); - - return $copy($newElement); - } - - private function createCopyClosure() - { - $copier = $this->copier; - - $copy = function (SplDoublyLinkedList $list) use ($copier) { - // Replace each element in the list with a deep copy of itself - for ($i = 1; $i <= $list->count(); $i++) { - $copy = $copier->recursiveCopy($list->shift()); - - $list->push($copy); - } - - return $list; - }; - - return Closure::bind($copy, null, DeepCopy::class); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php deleted file mode 100644 index 5785a7d..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php +++ /dev/null @@ -1,13 +0,0 @@ -type = $type; - } - - /** - * @param mixed $element - * - * @return boolean - */ - public function matches($element) - { - return is_object($element) ? is_a($element, $this->type) : gettype($element) === $this->type; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php b/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php deleted file mode 100644 index 55dcc92..0000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php +++ /dev/null @@ -1,20 +0,0 @@ -copy($value); - } -} diff --git a/vendor/nikic/php-parser/bin/php-parse b/vendor/nikic/php-parser/bin/php-parse deleted file mode 100755 index fc44f23..0000000 --- a/vendor/nikic/php-parser/bin/php-parse +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env php -createForVersion($attributes['version']); -$dumper = new PhpParser\NodeDumper([ - 'dumpComments' => true, - 'dumpPositions' => $attributes['with-positions'], -]); -$prettyPrinter = new PhpParser\PrettyPrinter\Standard; - -$traverser = new PhpParser\NodeTraverser(); -$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); - -foreach ($files as $file) { - if ($file === '-') { - $code = file_get_contents('php://stdin'); - fwrite(STDERR, "====> Stdin:\n"); - } else if (strpos($file, ' Code $code\n"); - } else { - if (!file_exists($file)) { - fwrite(STDERR, "File $file does not exist.\n"); - exit(1); - } - - $code = file_get_contents($file); - fwrite(STDERR, "====> File $file:\n"); - } - - if ($attributes['with-recovery']) { - $errorHandler = new PhpParser\ErrorHandler\Collecting; - $stmts = $parser->parse($code, $errorHandler); - foreach ($errorHandler->getErrors() as $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - } - if (null === $stmts) { - continue; - } - } else { - try { - $stmts = $parser->parse($code); - } catch (PhpParser\Error $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - exit(1); - } - } - - foreach ($operations as $operation) { - if ('dump' === $operation) { - fwrite(STDERR, "==> Node dump:\n"); - echo $dumper->dump($stmts, $code), "\n"; - } elseif ('pretty-print' === $operation) { - fwrite(STDERR, "==> Pretty print:\n"); - echo $prettyPrinter->prettyPrintFile($stmts), "\n"; - } elseif ('json-dump' === $operation) { - fwrite(STDERR, "==> JSON dump:\n"); - echo json_encode($stmts, JSON_PRETTY_PRINT), "\n"; - } elseif ('var-dump' === $operation) { - fwrite(STDERR, "==> var_dump():\n"); - var_dump($stmts); - } elseif ('resolve-names' === $operation) { - fwrite(STDERR, "==> Resolved names.\n"); - $stmts = $traverser->traverse($stmts); - } - } -} - -function formatErrorMessage(PhpParser\Error $e, $code, $withColumnInfo) { - if ($withColumnInfo && $e->hasColumnInfo()) { - return $e->getMessageWithColumnInfo($code); - } else { - return $e->getMessage(); - } -} - -function showHelp($error = '') { - if ($error) { - fwrite(STDERR, $error . "\n\n"); - } - fwrite($error ? STDERR : STDOUT, <<<'OUTPUT' -Usage: php-parse [operations] file1.php [file2.php ...] - or: php-parse [operations] " false, - 'with-positions' => false, - 'with-recovery' => false, - 'version' => PhpParser\PhpVersion::getNewestSupported(), - ]; - - array_shift($args); - $parseOptions = true; - foreach ($args as $arg) { - if (!$parseOptions) { - $files[] = $arg; - continue; - } - - switch ($arg) { - case '--dump': - case '-d': - $operations[] = 'dump'; - break; - case '--pretty-print': - case '-p': - $operations[] = 'pretty-print'; - break; - case '--json-dump': - case '-j': - $operations[] = 'json-dump'; - break; - case '--var-dump': - $operations[] = 'var-dump'; - break; - case '--resolve-names': - case '-N'; - $operations[] = 'resolve-names'; - break; - case '--with-column-info': - case '-c'; - $attributes['with-column-info'] = true; - break; - case '--with-positions': - case '-P': - $attributes['with-positions'] = true; - break; - case '--with-recovery': - case '-r': - $attributes['with-recovery'] = true; - break; - case '--help': - case '-h'; - showHelp(); - break; - case '--': - $parseOptions = false; - break; - default: - if (preg_match('/^--version=(.*)$/', $arg, $matches)) { - $attributes['version'] = PhpParser\PhpVersion::fromString($matches[1]); - } elseif ($arg[0] === '-' && \strlen($arg[0]) > 1) { - showHelp("Invalid operation $arg."); - } else { - $files[] = $arg; - } - } - } - - return [$operations, $files, $attributes]; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder.php b/vendor/nikic/php-parser/lib/PhpParser/Builder.php deleted file mode 100644 index d6aa124..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder.php +++ /dev/null @@ -1,12 +0,0 @@ - */ - protected array $attributes = []; - /** @var list */ - protected array $constants = []; - - /** @var list */ - protected array $attributeGroups = []; - /** @var Identifier|Node\Name|Node\ComplexType|null */ - protected ?Node $type = null; - - /** - * Creates a class constant builder - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - */ - public function __construct($name, $value) { - $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; - } - - /** - * Add another constant to const group - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return $this The builder instance (for fluid interface) - */ - public function addConst($name, $value) { - $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value)); - - return $this; - } - - /** - * Makes the constant public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); - - return $this; - } - - /** - * Makes the constant protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); - - return $this; - } - - /** - * Makes the constant private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); - - return $this; - } - - /** - * Makes the constant final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Sets the constant type. - * - * @param string|Node\Name|Identifier|Node\ComplexType $type - * - * @return $this - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\ClassConst The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\ClassConst( - $this->constants, - $this->flags, - $this->attributes, - $this->attributeGroups, - $this->type - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php deleted file mode 100644 index 6f39431..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +++ /dev/null @@ -1,151 +0,0 @@ - */ - protected array $implements = []; - protected int $flags = 0; - /** @var list */ - protected array $uses = []; - /** @var list */ - protected array $constants = []; - /** @var list */ - protected array $properties = []; - /** @var list */ - protected array $methods = []; - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates a class builder. - * - * @param string $name Name of the class - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Extends a class. - * - * @param Name|string $class Name of class to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend($class) { - $this->extends = BuilderHelpers::normalizeName($class); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Makes the class abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::ABSTRACT); - - return $this; - } - - /** - * Makes the class final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::FINAL); - - return $this; - } - - /** - * Makes the class readonly. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReadonly() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::READONLY); - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\Property) { - $this->properties[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - $this->methods[] = $stmt; - } elseif ($stmt instanceof Stmt\TraitUse) { - $this->uses[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Class_ The built class node - */ - public function getNode(): PhpParser\Node { - return new Stmt\Class_($this->name, [ - 'flags' => $this->flags, - 'extends' => $this->extends, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php deleted file mode 100644 index 488b721..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +++ /dev/null @@ -1,50 +0,0 @@ - */ - protected array $attributes = []; - - /** - * Adds a statement. - * - * @param PhpParser\Node\Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - abstract public function addStmt($stmt); - - /** - * Adds multiple statements. - * - * @param (PhpParser\Node\Stmt|PhpParser\Builder)[] $stmts The statements to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmts(array $stmts) { - foreach ($stmts as $stmt) { - $this->addStmt($stmt); - } - - return $this; - } - - /** - * Sets doc comment for the declaration. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes['comments'] = [ - BuilderHelpers::normalizeDocComment($docComment) - ]; - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php deleted file mode 100644 index 04058bf..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +++ /dev/null @@ -1,87 +0,0 @@ - */ - protected array $attributes = []; - - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates an enum case builder. - * - * @param string|Identifier $name Name - */ - public function __construct($name) { - $this->name = $name; - } - - /** - * Sets the value. - * - * @param Node\Expr|string|int $value - * - * @return $this - */ - public function setValue($value) { - $this->value = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built enum case node. - * - * @return Stmt\EnumCase The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\EnumCase( - $this->name, - $this->value, - $this->attributeGroups, - $this->attributes - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php deleted file mode 100644 index c00df03..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +++ /dev/null @@ -1,116 +0,0 @@ - */ - protected array $implements = []; - /** @var list */ - protected array $uses = []; - /** @var list */ - protected array $enumCases = []; - /** @var list */ - protected array $constants = []; - /** @var list */ - protected array $methods = []; - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates an enum builder. - * - * @param string $name Name of the enum - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Sets the scalar type. - * - * @param string|Identifier $scalarType - * - * @return $this - */ - public function setScalarType($scalarType) { - $this->scalarType = BuilderHelpers::normalizeType($scalarType); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\EnumCase) { - $this->enumCases[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - $this->methods[] = $stmt; - } elseif ($stmt instanceof Stmt\TraitUse) { - $this->uses[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Enum_ The built enum node - */ - public function getNode(): PhpParser\Node { - return new Stmt\Enum_($this->name, [ - 'scalarType' => $this->scalarType, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php deleted file mode 100644 index ff79cb6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +++ /dev/null @@ -1,73 +0,0 @@ -returnByRef = true; - - return $this; - } - - /** - * Adds a parameter. - * - * @param Node\Param|Param $param The parameter to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParam($param) { - $param = BuilderHelpers::normalizeNode($param); - - if (!$param instanceof Node\Param) { - throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); - } - - $this->params[] = $param; - - return $this; - } - - /** - * Adds multiple parameters. - * - * @param (Node\Param|Param)[] $params The parameters to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParams(array $params) { - foreach ($params as $param) { - $this->addParam($param); - } - - return $this; - } - - /** - * Sets the return type for PHP 7. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type - * - * @return $this The builder instance (for fluid interface) - */ - public function setReturnType($type) { - $this->returnType = BuilderHelpers::normalizeType($type); - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php deleted file mode 100644 index 48f5f69..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +++ /dev/null @@ -1,67 +0,0 @@ - */ - protected array $stmts = []; - - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates a function builder. - * - * @param string $name Name of the function - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built function node. - * - * @return Stmt\Function_ The built function node - */ - public function getNode(): Node { - return new Stmt\Function_($this->name, [ - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php deleted file mode 100644 index 13dd3f7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +++ /dev/null @@ -1,94 +0,0 @@ - */ - protected array $extends = []; - /** @var list */ - protected array $constants = []; - /** @var list */ - protected array $methods = []; - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Extends one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend(...$interfaces) { - foreach ($interfaces as $interface) { - $this->extends[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - // we erase all statements in the body of an interface method - $stmt->stmts = null; - $this->methods[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built interface node. - * - * @return Stmt\Interface_ The built interface node - */ - public function getNode(): PhpParser\Node { - return new Stmt\Interface_($this->name, [ - 'extends' => $this->extends, - 'stmts' => array_merge($this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php deleted file mode 100644 index 8358dbe..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +++ /dev/null @@ -1,147 +0,0 @@ -|null */ - protected ?array $stmts = []; - - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates a method builder. - * - * @param string $name Name of the method - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Makes the method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); - - return $this; - } - - /** - * Makes the method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); - - return $this; - } - - /** - * Makes the method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); - - return $this; - } - - /** - * Makes the method static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); - - return $this; - } - - /** - * Makes the method abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - if (!empty($this->stmts)) { - throw new \LogicException('Cannot make method with statements abstract'); - } - - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT); - $this->stmts = null; // abstract methods don't have statements - - return $this; - } - - /** - * Makes the method final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); - - return $this; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - if (null === $this->stmts) { - throw new \LogicException('Cannot add statements to an abstract method'); - } - - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built method node. - * - * @return Stmt\ClassMethod The built method node - */ - public function getNode(): Node { - return new Stmt\ClassMethod($this->name, [ - 'flags' => $this->flags, - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php deleted file mode 100644 index 80fe6f8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +++ /dev/null @@ -1,45 +0,0 @@ -name = null !== $name ? BuilderHelpers::normalizeName($name) : null; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Namespace_ The built node - */ - public function getNode(): Node { - return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php deleted file mode 100644 index f439e87..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ /dev/null @@ -1,149 +0,0 @@ - */ - protected array $attributeGroups = []; - - /** - * Creates a parameter builder. - * - * @param string $name Name of the parameter - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Sets default value for the parameter. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets type for the parameter. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type - * - * @return $this The builder instance (for fluid interface) - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - if ($this->type == 'void') { - throw new \LogicException('Parameter type cannot be void'); - } - - return $this; - } - - /** - * Make the parameter accept the value by reference. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeByRef() { - $this->byRef = true; - - return $this; - } - - /** - * Make the parameter variadic - * - * @return $this The builder instance (for fluid interface) - */ - public function makeVariadic() { - $this->variadic = true; - - return $this; - } - - /** - * Makes the (promoted) parameter public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); - - return $this; - } - - /** - * Makes the (promoted) parameter protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); - - return $this; - } - - /** - * Makes the (promoted) parameter private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); - - return $this; - } - - /** - * Makes the (promoted) parameter readonly. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReadonly() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built parameter node. - * - * @return Node\Param The built parameter node - */ - public function getNode(): Node { - return new Node\Param( - new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php deleted file mode 100644 index 3fc96d9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +++ /dev/null @@ -1,161 +0,0 @@ - */ - protected array $attributes = []; - /** @var null|Identifier|Name|ComplexType */ - protected ?Node $type = null; - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates a property builder. - * - * @param string $name Name of the property - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Makes the property public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); - - return $this; - } - - /** - * Makes the property protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); - - return $this; - } - - /** - * Makes the property private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); - - return $this; - } - - /** - * Makes the property static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); - - return $this; - } - - /** - * Makes the property readonly. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReadonly() { - $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); - - return $this; - } - - /** - * Sets default value for the property. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the property. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Sets the property type for PHP 7.4+. - * - * @param string|Name|Identifier|ComplexType $type - * - * @return $this - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Property The built property node - */ - public function getNode(): PhpParser\Node { - return new Stmt\Property( - $this->flags !== 0 ? $this->flags : Modifiers::PUBLIC, - [ - new Node\PropertyItem($this->name, $this->default) - ], - $this->attributes, - $this->type, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php deleted file mode 100644 index cf21c82..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +++ /dev/null @@ -1,65 +0,0 @@ -and($trait); - } - } - - /** - * Adds used trait. - * - * @param Node\Name|string $trait Trait name - * - * @return $this The builder instance (for fluid interface) - */ - public function and($trait) { - $this->traits[] = BuilderHelpers::normalizeName($trait); - return $this; - } - - /** - * Adds trait adaptation. - * - * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation - * - * @return $this The builder instance (for fluid interface) - */ - public function with($adaptation) { - $adaptation = BuilderHelpers::normalizeNode($adaptation); - - if (!$adaptation instanceof Stmt\TraitUseAdaptation) { - throw new \LogicException('Adaptation must have type TraitUseAdaptation'); - } - - $this->adaptations[] = $adaptation; - return $this; - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode(): Node { - return new Stmt\TraitUse($this->traits, $this->adaptations); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php deleted file mode 100644 index fee0958..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +++ /dev/null @@ -1,145 +0,0 @@ -type = self::TYPE_UNDEFINED; - - $this->trait = is_null($trait) ? null : BuilderHelpers::normalizeName($trait); - $this->method = BuilderHelpers::normalizeIdentifier($method); - } - - /** - * Sets alias of method. - * - * @param Node\Identifier|string $alias Alias for adapted method - * - * @return $this The builder instance (for fluid interface) - */ - public function as($alias) { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set alias for not alias adaptation buider'); - } - - $this->alias = BuilderHelpers::normalizeIdentifier($alias); - return $this; - } - - /** - * Sets adapted method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->setModifier(Modifiers::PUBLIC); - return $this; - } - - /** - * Sets adapted method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->setModifier(Modifiers::PROTECTED); - return $this; - } - - /** - * Sets adapted method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->setModifier(Modifiers::PRIVATE); - return $this; - } - - /** - * Adds overwritten traits. - * - * @param Node\Name|string ...$traits Traits for overwrite - * - * @return $this The builder instance (for fluid interface) - */ - public function insteadof(...$traits) { - if ($this->type === self::TYPE_UNDEFINED) { - if (is_null($this->trait)) { - throw new \LogicException('Precedence adaptation must have trait'); - } - - $this->type = self::TYPE_PRECEDENCE; - } - - if ($this->type !== self::TYPE_PRECEDENCE) { - throw new \LogicException('Cannot add overwritten traits for not precedence adaptation buider'); - } - - foreach ($traits as $trait) { - $this->insteadof[] = BuilderHelpers::normalizeName($trait); - } - - return $this; - } - - protected function setModifier(int $modifier): void { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set access modifier for not alias adaptation buider'); - } - - if (is_null($this->modifier)) { - $this->modifier = $modifier; - } else { - throw new \LogicException('Multiple access type modifiers are not allowed'); - } - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode(): Node { - switch ($this->type) { - case self::TYPE_ALIAS: - return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias); - case self::TYPE_PRECEDENCE: - return new Stmt\TraitUseAdaptation\Precedence($this->trait, $this->method, $this->insteadof); - default: - throw new \LogicException('Type of adaptation is not defined'); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php deleted file mode 100644 index ffa1bd5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +++ /dev/null @@ -1,83 +0,0 @@ - */ - protected array $uses = []; - /** @var list */ - protected array $constants = []; - /** @var list */ - protected array $properties = []; - /** @var list */ - protected array $methods = []; - /** @var list */ - protected array $attributeGroups = []; - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\Property) { - $this->properties[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - $this->methods[] = $stmt; - } elseif ($stmt instanceof Stmt\TraitUse) { - $this->uses[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built trait node. - * - * @return Stmt\Trait_ The built interface node - */ - public function getNode(): PhpParser\Node { - return new Stmt\Trait_( - $this->name, [ - 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php deleted file mode 100644 index b82cf13..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +++ /dev/null @@ -1,49 +0,0 @@ -name = BuilderHelpers::normalizeName($name); - $this->type = $type; - } - - /** - * Sets alias for used name. - * - * @param string $alias Alias to use (last component of full name by default) - * - * @return $this The builder instance (for fluid interface) - */ - public function as(string $alias) { - $this->alias = $alias; - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Use_ The built node - */ - public function getNode(): Node { - return new Stmt\Use_([ - new Node\UseItem($this->name, $this->alias) - ], $this->type); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php deleted file mode 100644 index b7efe5e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ /dev/null @@ -1,375 +0,0 @@ -args($args) - ); - } - - /** - * Creates a namespace builder. - * - * @param null|string|Node\Name $name Name of the namespace - * - * @return Builder\Namespace_ The created namespace builder - */ - public function namespace($name): Builder\Namespace_ { - return new Builder\Namespace_($name); - } - - /** - * Creates a class builder. - * - * @param string $name Name of the class - * - * @return Builder\Class_ The created class builder - */ - public function class(string $name): Builder\Class_ { - return new Builder\Class_($name); - } - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - * - * @return Builder\Interface_ The created interface builder - */ - public function interface(string $name): Builder\Interface_ { - return new Builder\Interface_($name); - } - - /** - * Creates a trait builder. - * - * @param string $name Name of the trait - * - * @return Builder\Trait_ The created trait builder - */ - public function trait(string $name): Builder\Trait_ { - return new Builder\Trait_($name); - } - - /** - * Creates an enum builder. - * - * @param string $name Name of the enum - * - * @return Builder\Enum_ The created enum builder - */ - public function enum(string $name): Builder\Enum_ { - return new Builder\Enum_($name); - } - - /** - * Creates a trait use builder. - * - * @param Node\Name|string ...$traits Trait names - * - * @return Builder\TraitUse The created trait use builder - */ - public function useTrait(...$traits): Builder\TraitUse { - return new Builder\TraitUse(...$traits); - } - - /** - * Creates a trait use adaptation builder. - * - * @param Node\Name|string|null $trait Trait name - * @param Node\Identifier|string $method Method name - * - * @return Builder\TraitUseAdaptation The created trait use adaptation builder - */ - public function traitUseAdaptation($trait, $method = null): Builder\TraitUseAdaptation { - if ($method === null) { - $method = $trait; - $trait = null; - } - - return new Builder\TraitUseAdaptation($trait, $method); - } - - /** - * Creates a method builder. - * - * @param string $name Name of the method - * - * @return Builder\Method The created method builder - */ - public function method(string $name): Builder\Method { - return new Builder\Method($name); - } - - /** - * Creates a parameter builder. - * - * @param string $name Name of the parameter - * - * @return Builder\Param The created parameter builder - */ - public function param(string $name): Builder\Param { - return new Builder\Param($name); - } - - /** - * Creates a property builder. - * - * @param string $name Name of the property - * - * @return Builder\Property The created property builder - */ - public function property(string $name): Builder\Property { - return new Builder\Property($name); - } - - /** - * Creates a function builder. - * - * @param string $name Name of the function - * - * @return Builder\Function_ The created function builder - */ - public function function(string $name): Builder\Function_ { - return new Builder\Function_($name); - } - - /** - * Creates a namespace/class use builder. - * - * @param Node\Name|string $name Name of the entity (namespace or class) to alias - * - * @return Builder\Use_ The created use builder - */ - public function use($name): Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_NORMAL); - } - - /** - * Creates a function use builder. - * - * @param Node\Name|string $name Name of the function to alias - * - * @return Builder\Use_ The created use function builder - */ - public function useFunction($name): Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_FUNCTION); - } - - /** - * Creates a constant use builder. - * - * @param Node\Name|string $name Name of the const to alias - * - * @return Builder\Use_ The created use const builder - */ - public function useConst($name): Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_CONSTANT); - } - - /** - * Creates a class constant builder. - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return Builder\ClassConst The created use const builder - */ - public function classConst($name, $value): Builder\ClassConst { - return new Builder\ClassConst($name, $value); - } - - /** - * Creates an enum case builder. - * - * @param string|Identifier $name Name - * - * @return Builder\EnumCase The created use const builder - */ - public function enumCase($name): Builder\EnumCase { - return new Builder\EnumCase($name); - } - - /** - * Creates node a for a literal value. - * - * @param Expr|bool|null|int|float|string|array $value $value - */ - public function val($value): Expr { - return BuilderHelpers::normalizeValue($value); - } - - /** - * Creates variable node. - * - * @param string|Expr $name Name - */ - public function var($name): Expr\Variable { - if (!\is_string($name) && !$name instanceof Expr) { - throw new \LogicException('Variable name must be string or Expr'); - } - - return new Expr\Variable($name); - } - - /** - * Normalizes an argument list. - * - * Creates Arg nodes for all arguments and converts literal values to expressions. - * - * @param array $args List of arguments to normalize - * - * @return list - */ - public function args(array $args): array { - $normalizedArgs = []; - foreach ($args as $key => $arg) { - if (!($arg instanceof Arg)) { - $arg = new Arg(BuilderHelpers::normalizeValue($arg)); - } - if (\is_string($key)) { - $arg->name = BuilderHelpers::normalizeIdentifier($key); - } - $normalizedArgs[] = $arg; - } - return $normalizedArgs; - } - - /** - * Creates a function call node. - * - * @param string|Name|Expr $name Function name - * @param array $args Function arguments - */ - public function funcCall($name, array $args = []): Expr\FuncCall { - return new Expr\FuncCall( - BuilderHelpers::normalizeNameOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a method call node. - * - * @param Expr $var Variable the method is called on - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - */ - public function methodCall(Expr $var, $name, array $args = []): Expr\MethodCall { - return new Expr\MethodCall( - $var, - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a static method call node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - */ - public function staticCall($class, $name, array $args = []): Expr\StaticCall { - return new Expr\StaticCall( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates an object creation node. - * - * @param string|Name|Expr $class Class name - * @param array $args Constructor arguments - */ - public function new($class, array $args = []): Expr\New_ { - return new Expr\New_( - BuilderHelpers::normalizeNameOrExpr($class), - $this->args($args) - ); - } - - /** - * Creates a constant fetch node. - * - * @param string|Name $name Constant name - */ - public function constFetch($name): Expr\ConstFetch { - return new Expr\ConstFetch(BuilderHelpers::normalizeName($name)); - } - - /** - * Creates a property fetch node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - */ - public function propertyFetch(Expr $var, $name): Expr\PropertyFetch { - return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name)); - } - - /** - * Creates a class constant fetch node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier|Expr $name Constant name - */ - public function classConstFetch($class, $name): Expr\ClassConstFetch { - return new Expr\ClassConstFetch( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifierOrExpr($name) - ); - } - - /** - * Creates nested Concat nodes from a list of expressions. - * - * @param Expr|string ...$exprs Expressions or literal strings - */ - public function concat(...$exprs): Concat { - $numExprs = count($exprs); - if ($numExprs < 2) { - throw new \LogicException('Expected at least two expressions'); - } - - $lastConcat = $this->normalizeStringExpr($exprs[0]); - for ($i = 1; $i < $numExprs; $i++) { - $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i])); - } - return $lastConcat; - } - - /** - * @param string|Expr $expr - */ - private function normalizeStringExpr($expr): Expr { - if ($expr instanceof Expr) { - return $expr; - } - - if (\is_string($expr)) { - return new String_($expr); - } - - throw new \LogicException('Expected string or Expr'); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php deleted file mode 100644 index 3e41b26..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ /dev/null @@ -1,333 +0,0 @@ -getNode(); - } - - if ($node instanceof Node) { - return $node; - } - - throw new \LogicException('Expected node or builder object'); - } - - /** - * Normalizes a node to a statement. - * - * Expressions are wrapped in a Stmt\Expression node. - * - * @param Node|Builder $node The node to normalize - * - * @return Stmt The normalized statement node - */ - public static function normalizeStmt($node): Stmt { - $node = self::normalizeNode($node); - if ($node instanceof Stmt) { - return $node; - } - - if ($node instanceof Expr) { - return new Stmt\Expression($node); - } - - throw new \LogicException('Expected statement or expression node'); - } - - /** - * Normalizes strings to Identifier. - * - * @param string|Identifier $name The identifier to normalize - * - * @return Identifier The normalized identifier - */ - public static function normalizeIdentifier($name): Identifier { - if ($name instanceof Identifier) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier'); - } - - /** - * Normalizes strings to Identifier, also allowing expressions. - * - * @param string|Identifier|Expr $name The identifier to normalize - * - * @return Identifier|Expr The normalized identifier or expression - */ - public static function normalizeIdentifierOrExpr($name) { - if ($name instanceof Identifier || $name instanceof Expr) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier or Node\Expr'); - } - - /** - * Normalizes a name: Converts string names to Name nodes. - * - * @param Name|string $name The name to normalize - * - * @return Name The normalized name - */ - public static function normalizeName($name): Name { - if ($name instanceof Name) { - return $name; - } - - if (is_string($name)) { - if (!$name) { - throw new \LogicException('Name cannot be empty'); - } - - if ($name[0] === '\\') { - return new Name\FullyQualified(substr($name, 1)); - } - - if (0 === strpos($name, 'namespace\\')) { - return new Name\Relative(substr($name, strlen('namespace\\'))); - } - - return new Name($name); - } - - throw new \LogicException('Name must be a string or an instance of Node\Name'); - } - - /** - * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. - * - * @param Expr|Name|string $name The name to normalize - * - * @return Name|Expr The normalized name or expression - */ - public static function normalizeNameOrExpr($name) { - if ($name instanceof Expr) { - return $name; - } - - if (!is_string($name) && !($name instanceof Name)) { - throw new \LogicException( - 'Name must be a string or an instance of Node\Name or Node\Expr' - ); - } - - return self::normalizeName($name); - } - - /** - * Normalizes a type: Converts plain-text type names into proper AST representation. - * - * In particular, builtin types become Identifiers, custom types become Names and nullables - * are wrapped in NullableType nodes. - * - * @param string|Name|Identifier|ComplexType $type The type to normalize - * - * @return Name|Identifier|ComplexType The normalized type - */ - public static function normalizeType($type) { - if (!is_string($type)) { - if ( - !$type instanceof Name && !$type instanceof Identifier && - !$type instanceof ComplexType - ) { - throw new \LogicException( - 'Type must be a string, or an instance of Name, Identifier or ComplexType' - ); - } - return $type; - } - - $nullable = false; - if (strlen($type) > 0 && $type[0] === '?') { - $nullable = true; - $type = substr($type, 1); - } - - $builtinTypes = [ - 'array', - 'callable', - 'bool', - 'int', - 'float', - 'string', - 'iterable', - 'void', - 'object', - 'null', - 'false', - 'mixed', - 'never', - 'true', - ]; - - $lowerType = strtolower($type); - if (in_array($lowerType, $builtinTypes)) { - $type = new Identifier($lowerType); - } else { - $type = self::normalizeName($type); - } - - $notNullableTypes = [ - 'void', 'mixed', 'never', - ]; - if ($nullable && in_array((string) $type, $notNullableTypes)) { - throw new \LogicException(sprintf('%s type cannot be nullable', $type)); - } - - return $nullable ? new NullableType($type) : $type; - } - - /** - * Normalizes a value: Converts nulls, booleans, integers, - * floats, strings and arrays into their respective nodes - * - * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize - * - * @return Expr The normalized value - */ - public static function normalizeValue($value): Expr { - if ($value instanceof Node\Expr) { - return $value; - } - - if (is_null($value)) { - return new Expr\ConstFetch( - new Name('null') - ); - } - - if (is_bool($value)) { - return new Expr\ConstFetch( - new Name($value ? 'true' : 'false') - ); - } - - if (is_int($value)) { - return new Scalar\Int_($value); - } - - if (is_float($value)) { - return new Scalar\Float_($value); - } - - if (is_string($value)) { - return new Scalar\String_($value); - } - - if (is_array($value)) { - $items = []; - $lastKey = -1; - foreach ($value as $itemKey => $itemValue) { - // for consecutive, numeric keys don't generate keys - if (null !== $lastKey && ++$lastKey === $itemKey) { - $items[] = new Node\ArrayItem( - self::normalizeValue($itemValue) - ); - } else { - $lastKey = null; - $items[] = new Node\ArrayItem( - self::normalizeValue($itemValue), - self::normalizeValue($itemKey) - ); - } - } - - return new Expr\Array_($items); - } - - throw new \LogicException('Invalid value'); - } - - /** - * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc. - * - * @param Comment\Doc|string $docComment The doc comment to normalize - * - * @return Comment\Doc The normalized doc comment - */ - public static function normalizeDocComment($docComment): Comment\Doc { - if ($docComment instanceof Comment\Doc) { - return $docComment; - } - - if (is_string($docComment)) { - return new Comment\Doc($docComment); - } - - throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc'); - } - - /** - * Normalizes a attribute: Converts attribute to the Attribute Group if needed. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return Node\AttributeGroup The Attribute Group - */ - public static function normalizeAttribute($attribute): Node\AttributeGroup { - if ($attribute instanceof Node\AttributeGroup) { - return $attribute; - } - - if (!($attribute instanceof Node\Attribute)) { - throw new \LogicException('Attribute must be an instance of PhpParser\Node\Attribute or PhpParser\Node\AttributeGroup'); - } - - return new Node\AttributeGroup([$attribute]); - } - - /** - * Adds a modifier and returns new modifier bitmask. - * - * @param int $modifiers Existing modifiers - * @param int $modifier Modifier to set - * - * @return int New modifiers - */ - public static function addModifier(int $modifiers, int $modifier): int { - Modifiers::verifyModifier($modifiers, $modifier); - return $modifiers | $modifier; - } - - /** - * Adds a modifier and returns new modifier bitmask. - * @return int New modifiers - */ - public static function addClassModifier(int $existingModifiers, int $modifierToSet): int { - Modifiers::verifyClassModifier($existingModifiers, $modifierToSet); - return $existingModifiers | $modifierToSet; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/vendor/nikic/php-parser/lib/PhpParser/Comment.php deleted file mode 100644 index 17dc4c7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment.php +++ /dev/null @@ -1,207 +0,0 @@ -text = $text; - $this->startLine = $startLine; - $this->startFilePos = $startFilePos; - $this->startTokenPos = $startTokenPos; - $this->endLine = $endLine; - $this->endFilePos = $endFilePos; - $this->endTokenPos = $endTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function getText(): string { - return $this->text; - } - - /** - * Gets the line number the comment started on. - * - * @return int Line number (or -1 if not available) - */ - public function getStartLine(): int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @return int File offset (or -1 if not available) - */ - public function getStartFilePos(): int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @return int Token offset (or -1 if not available) - */ - public function getStartTokenPos(): int { - return $this->startTokenPos; - } - - /** - * Gets the line number the comment ends on. - * - * @return int Line number (or -1 if not available) - */ - public function getEndLine(): int { - return $this->endLine; - } - - /** - * Gets the file offset the comment ends on. - * - * @return int File offset (or -1 if not available) - */ - public function getEndFilePos(): int { - return $this->endFilePos; - } - - /** - * Gets the token offset the comment ends on. - * - * @return int Token offset (or -1 if not available) - */ - public function getEndTokenPos(): int { - return $this->endTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function __toString(): string { - return $this->text; - } - - /** - * Gets the reformatted comment text. - * - * "Reformatted" here means that we try to clean up the whitespace at the - * starts of the lines. This is necessary because we receive the comments - * without leading whitespace on the first line, but with leading whitespace - * on all subsequent lines. - * - * Additionally, this normalizes CRLF newlines to LF newlines. - */ - public function getReformattedText(): string { - $text = str_replace("\r\n", "\n", $this->text); - $newlinePos = strpos($text, "\n"); - if (false === $newlinePos) { - // Single line comments don't need further processing - return $text; - } - if (preg_match('(^.*(?:\n\s+\*.*)+$)', $text)) { - // Multi line comment of the type - // - // /* - // * Some text. - // * Some more text. - // */ - // - // is handled by replacing the whitespace sequences before the * by a single space - return preg_replace('(^\s+\*)m', ' *', $text); - } - if (preg_match('(^/\*\*?\s*\n)', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { - // Multi line comment of the type - // - // /* - // Some text. - // Some more text. - // */ - // - // is handled by removing the whitespace sequence on the line before the closing - // */ on all lines. So if the last line is " */", then " " is removed at the - // start of all lines. - return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text); - } - if (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { - // Multi line comment of the type - // - // /* Some text. - // Some more text. - // Indented text. - // Even more text. */ - // - // is handled by removing the difference between the shortest whitespace prefix on all - // lines and the length of the "/* " opening sequence. - $prefixLen = $this->getShortestWhitespacePrefixLen(substr($text, $newlinePos + 1)); - $removeLen = $prefixLen - strlen($matches[0]); - return preg_replace('(^\s{' . $removeLen . '})m', '', $text); - } - - // No idea how to format this comment, so simply return as is - return $text; - } - - /** - * Get length of shortest whitespace prefix (at the start of a line). - * - * If there is a line with no prefix whitespace, 0 is a valid return value. - * - * @param string $str String to check - * @return int Length in characters. Tabs count as single characters. - */ - private function getShortestWhitespacePrefixLen(string $str): int { - $lines = explode("\n", $str); - $shortestPrefixLen = \PHP_INT_MAX; - foreach ($lines as $line) { - preg_match('(^\s*)', $line, $matches); - $prefixLen = strlen($matches[0]); - if ($prefixLen < $shortestPrefixLen) { - $shortestPrefixLen = $prefixLen; - } - } - return $shortestPrefixLen; - } - - /** - * @return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} - */ - public function jsonSerialize(): array { - // Technically not a node, but we make it look like one anyway - $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment'; - return [ - 'nodeType' => $type, - 'text' => $this->text, - // TODO: Rename these to include "start". - 'line' => $this->startLine, - 'filePos' => $this->startFilePos, - 'tokenPos' => $this->startTokenPos, - 'endLine' => $this->endLine, - 'endFilePos' => $this->endFilePos, - 'endTokenPos' => $this->endTokenPos, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php b/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php deleted file mode 100644 index bb3e914..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +++ /dev/null @@ -1,6 +0,0 @@ -fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) { - throw new ConstExprEvaluationException( - "Expression of type {$expr->getType()} cannot be evaluated" - ); - }; - } - - /** - * Silently evaluates a constant expression into a PHP value. - * - * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException. - * The original source of the exception is available through getPrevious(). - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred - */ - public function evaluateSilently(Expr $expr) { - set_error_handler(function ($num, $str, $file, $line) { - throw new \ErrorException($str, 0, $num, $file, $line); - }); - - try { - return $this->evaluate($expr); - } catch (\Throwable $e) { - if (!$e instanceof ConstExprEvaluationException) { - $e = new ConstExprEvaluationException( - "An error occurred during constant expression evaluation", 0, $e); - } - throw $e; - } finally { - restore_error_handler(); - } - } - - /** - * Directly evaluates a constant expression into a PHP value. - * - * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these - * into a ConstExprEvaluationException. - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated - */ - public function evaluateDirectly(Expr $expr) { - return $this->evaluate($expr); - } - - /** @return mixed */ - private function evaluate(Expr $expr) { - if ($expr instanceof Scalar\Int_ - || $expr instanceof Scalar\Float_ - || $expr instanceof Scalar\String_ - ) { - return $expr->value; - } - - if ($expr instanceof Expr\Array_) { - return $this->evaluateArray($expr); - } - - // Unary operators - if ($expr instanceof Expr\UnaryPlus) { - return +$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\UnaryMinus) { - return -$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BooleanNot) { - return !$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BitwiseNot) { - return ~$this->evaluate($expr->expr); - } - - if ($expr instanceof Expr\BinaryOp) { - return $this->evaluateBinaryOp($expr); - } - - if ($expr instanceof Expr\Ternary) { - return $this->evaluateTernary($expr); - } - - if ($expr instanceof Expr\ArrayDimFetch && null !== $expr->dim) { - return $this->evaluate($expr->var)[$this->evaluate($expr->dim)]; - } - - if ($expr instanceof Expr\ConstFetch) { - return $this->evaluateConstFetch($expr); - } - - return ($this->fallbackEvaluator)($expr); - } - - private function evaluateArray(Expr\Array_ $expr): array { - $array = []; - foreach ($expr->items as $item) { - if (null !== $item->key) { - $array[$this->evaluate($item->key)] = $this->evaluate($item->value); - } elseif ($item->unpack) { - $array = array_merge($array, $this->evaluate($item->value)); - } else { - $array[] = $this->evaluate($item->value); - } - } - return $array; - } - - /** @return mixed */ - private function evaluateTernary(Expr\Ternary $expr) { - if (null === $expr->if) { - return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else); - } - - return $this->evaluate($expr->cond) - ? $this->evaluate($expr->if) - : $this->evaluate($expr->else); - } - - /** @return mixed */ - private function evaluateBinaryOp(Expr\BinaryOp $expr) { - if ($expr instanceof Expr\BinaryOp\Coalesce - && $expr->left instanceof Expr\ArrayDimFetch - ) { - // This needs to be special cased to respect BP_VAR_IS fetch semantics - return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] - ?? $this->evaluate($expr->right); - } - - // The evaluate() calls are repeated in each branch, because some of the operators are - // short-circuiting and evaluating the RHS in advance may be illegal in that case - $l = $expr->left; - $r = $expr->right; - switch ($expr->getOperatorSigil()) { - case '&': return $this->evaluate($l) & $this->evaluate($r); - case '|': return $this->evaluate($l) | $this->evaluate($r); - case '^': return $this->evaluate($l) ^ $this->evaluate($r); - case '&&': return $this->evaluate($l) && $this->evaluate($r); - case '||': return $this->evaluate($l) || $this->evaluate($r); - case '??': return $this->evaluate($l) ?? $this->evaluate($r); - case '.': return $this->evaluate($l) . $this->evaluate($r); - case '/': return $this->evaluate($l) / $this->evaluate($r); - case '==': return $this->evaluate($l) == $this->evaluate($r); - case '>': return $this->evaluate($l) > $this->evaluate($r); - case '>=': return $this->evaluate($l) >= $this->evaluate($r); - case '===': return $this->evaluate($l) === $this->evaluate($r); - case 'and': return $this->evaluate($l) and $this->evaluate($r); - case 'or': return $this->evaluate($l) or $this->evaluate($r); - case 'xor': return $this->evaluate($l) xor $this->evaluate($r); - case '-': return $this->evaluate($l) - $this->evaluate($r); - case '%': return $this->evaluate($l) % $this->evaluate($r); - case '*': return $this->evaluate($l) * $this->evaluate($r); - case '!=': return $this->evaluate($l) != $this->evaluate($r); - case '!==': return $this->evaluate($l) !== $this->evaluate($r); - case '+': return $this->evaluate($l) + $this->evaluate($r); - case '**': return $this->evaluate($l) ** $this->evaluate($r); - case '<<': return $this->evaluate($l) << $this->evaluate($r); - case '>>': return $this->evaluate($l) >> $this->evaluate($r); - case '<': return $this->evaluate($l) < $this->evaluate($r); - case '<=': return $this->evaluate($l) <= $this->evaluate($r); - case '<=>': return $this->evaluate($l) <=> $this->evaluate($r); - } - - throw new \Exception('Should not happen'); - } - - /** @return mixed */ - private function evaluateConstFetch(Expr\ConstFetch $expr) { - $name = $expr->name->toLowerString(); - switch ($name) { - case 'null': return null; - case 'false': return false; - case 'true': return true; - } - - return ($this->fallbackEvaluator)($expr); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Error.php deleted file mode 100644 index 02feace..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Error.php +++ /dev/null @@ -1,171 +0,0 @@ - */ - protected array $attributes; - - /** - * Creates an Exception signifying a parse error. - * - * @param string $message Error message - * @param array $attributes Attributes of node/token where error occurred - */ - public function __construct(string $message, array $attributes = []) { - $this->rawMessage = $message; - $this->attributes = $attributes; - $this->updateMessage(); - } - - /** - * Gets the error message - * - * @return string Error message - */ - public function getRawMessage(): string { - return $this->rawMessage; - } - - /** - * Gets the line the error starts in. - * - * @return int Error start line - */ - public function getStartLine(): int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the error ends in. - * - * @return int Error end line - */ - public function getEndLine(): int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the attributes of the node/token the error occurred at. - * - * @return array - */ - public function getAttributes(): array { - return $this->attributes; - } - - /** - * Sets the attributes of the node/token the error occurred at. - * - * @param array $attributes - */ - public function setAttributes(array $attributes): void { - $this->attributes = $attributes; - $this->updateMessage(); - } - - /** - * Sets the line of the PHP file the error occurred in. - * - * @param string $message Error message - */ - public function setRawMessage(string $message): void { - $this->rawMessage = $message; - $this->updateMessage(); - } - - /** - * Sets the line the error starts in. - * - * @param int $line Error start line - */ - public function setStartLine(int $line): void { - $this->attributes['startLine'] = $line; - $this->updateMessage(); - } - - /** - * Returns whether the error has start and end column information. - * - * For column information enable the startFilePos and endFilePos in the lexer options. - */ - public function hasColumnInfo(): bool { - return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); - } - - /** - * Gets the start column (1-based) into the line where the error started. - * - * @param string $code Source code of the file - */ - public function getStartColumn(string $code): int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['startFilePos']); - } - - /** - * Gets the end column (1-based) into the line where the error ended. - * - * @param string $code Source code of the file - */ - public function getEndColumn(string $code): int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['endFilePos']); - } - - /** - * Formats message including line and column information. - * - * @param string $code Source code associated with the error, for calculation of the columns - * - * @return string Formatted message - */ - public function getMessageWithColumnInfo(string $code): string { - return sprintf( - '%s from %d:%d to %d:%d', $this->getRawMessage(), - $this->getStartLine(), $this->getStartColumn($code), - $this->getEndLine(), $this->getEndColumn($code) - ); - } - - /** - * Converts a file offset into a column. - * - * @param string $code Source code that $pos indexes into - * @param int $pos 0-based position in $code - * - * @return int 1-based column (relative to start of line) - */ - private function toColumn(string $code, int $pos): int { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } - - /** - * Updates the exception message after a change to rawMessage or rawLine. - */ - protected function updateMessage(): void { - $this->message = $this->rawMessage; - - if (-1 === $this->getStartLine()) { - $this->message .= ' on unknown line'; - } else { - $this->message .= ' on line ' . $this->getStartLine(); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php deleted file mode 100644 index 51ad730..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +++ /dev/null @@ -1,12 +0,0 @@ -errors[] = $error; - } - - /** - * Get collected errors. - * - * @return Error[] - */ - public function getErrors(): array { - return $this->errors; - } - - /** - * Check whether there are any errors. - */ - public function hasErrors(): bool { - return !empty($this->errors); - } - - /** - * Reset/clear collected errors. - */ - public function clearErrors(): void { - $this->errors = []; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php deleted file mode 100644 index dff33dd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +++ /dev/null @@ -1,17 +0,0 @@ -type = $type; - $this->old = $old; - $this->new = $new; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php deleted file mode 100644 index 253e175..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +++ /dev/null @@ -1,178 +0,0 @@ -isEqual = $isEqual; - } - - /** - * Calculate diff (edit script) from $old to $new. - * - * @param T[] $old Original array - * @param T[] $new New array - * - * @return DiffElem[] Diff (edit script) - */ - public function diff(array $old, array $new): array { - $old = \array_values($old); - $new = \array_values($new); - list($trace, $x, $y) = $this->calculateTrace($old, $new); - return $this->extractDiff($trace, $x, $y, $old, $new); - } - - /** - * Calculate diff, including "replace" operations. - * - * If a sequence of remove operations is followed by the same number of add operations, these - * will be coalesced into replace operations. - * - * @param T[] $old Original array - * @param T[] $new New array - * - * @return DiffElem[] Diff (edit script), including replace operations - */ - public function diffWithReplacements(array $old, array $new): array { - return $this->coalesceReplacements($this->diff($old, $new)); - } - - /** - * @param T[] $old - * @param T[] $new - * @return array{array>, int, int} - */ - private function calculateTrace(array $old, array $new): array { - $n = \count($old); - $m = \count($new); - $max = $n + $m; - $v = [1 => 0]; - $trace = []; - for ($d = 0; $d <= $max; $d++) { - $trace[] = $v; - for ($k = -$d; $k <= $d; $k += 2) { - if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { - $x = $v[$k + 1]; - } else { - $x = $v[$k - 1] + 1; - } - - $y = $x - $k; - while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) { - $x++; - $y++; - } - - $v[$k] = $x; - if ($x >= $n && $y >= $m) { - return [$trace, $x, $y]; - } - } - } - throw new \Exception('Should not happen'); - } - - /** - * @param array> $trace - * @param T[] $old - * @param T[] $new - * @return DiffElem[] - */ - private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array { - $result = []; - for ($d = \count($trace) - 1; $d >= 0; $d--) { - $v = $trace[$d]; - $k = $x - $y; - - if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { - $prevK = $k + 1; - } else { - $prevK = $k - 1; - } - - $prevX = $v[$prevK]; - $prevY = $prevX - $prevK; - - while ($x > $prevX && $y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]); - $x--; - $y--; - } - - if ($d === 0) { - break; - } - - while ($x > $prevX) { - $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null); - $x--; - } - - while ($y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]); - $y--; - } - } - return array_reverse($result); - } - - /** - * Coalesce equal-length sequences of remove+add into a replace operation. - * - * @param DiffElem[] $diff - * @return DiffElem[] - */ - private function coalesceReplacements(array $diff): array { - $newDiff = []; - $c = \count($diff); - for ($i = 0; $i < $c; $i++) { - $diffType = $diff[$i]->type; - if ($diffType !== DiffElem::TYPE_REMOVE) { - $newDiff[] = $diff[$i]; - continue; - } - - $j = $i; - while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { - $j++; - } - - $k = $j; - while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { - $k++; - } - - if ($j - $i === $k - $j) { - $len = $j - $i; - for ($n = 0; $n < $len; $n++) { - $newDiff[] = new DiffElem( - DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new - ); - } - } else { - for (; $i < $k; $i++) { - $newDiff[] = $diff[$i]; - } - } - $i = $k - 1; - } - return $newDiff; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php deleted file mode 100644 index b30a99a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ /dev/null @@ -1,71 +0,0 @@ - $attributes Attributes - */ - public function __construct( - array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements, - array $stmts, array $attributes - ) { - parent::__construct($attributes); - $this->attrGroups = $attrGroups; - $this->flags = $flags; - $this->args = $args; - $this->extends = $extends; - $this->implements = $implements; - $this->stmts = $stmts; - } - - public static function fromNewNode(Expr\New_ $newNode): self { - $class = $newNode->class; - assert($class instanceof Node\Stmt\Class_); - // We don't assert that $class->name is null here, to allow consumers to assign unique names - // to anonymous classes for their own purposes. We simplify ignore the name here. - return new self( - $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, - $class->stmts, $newNode->getAttributes() - ); - } - - public function getType(): string { - return 'Expr_PrintableNewAnonClass'; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php deleted file mode 100644 index 36022d0..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +++ /dev/null @@ -1,237 +0,0 @@ -= 80000) { - class TokenPolyfill extends \PhpToken { - } - return; -} - -/** - * This is a polyfill for the PhpToken class introduced in PHP 8.0. We do not actually polyfill - * PhpToken, because composer might end up picking a different polyfill implementation, which does - * not meet our requirements. - * - * @internal - */ -class TokenPolyfill { - /** @var int The ID of the token. Either a T_* constant of a character code < 256. */ - public int $id; - /** @var string The textual content of the token. */ - public string $text; - /** @var int The 1-based starting line of the token (or -1 if unknown). */ - public int $line; - /** @var int The 0-based starting position of the token (or -1 if unknown). */ - public int $pos; - - /** @var array Tokens ignored by the PHP parser. */ - private const IGNORABLE_TOKENS = [ - \T_WHITESPACE => true, - \T_COMMENT => true, - \T_DOC_COMMENT => true, - \T_OPEN_TAG => true, - ]; - - /** @var array Tokens that may be part of a T_NAME_* identifier. */ - private static array $identifierTokens; - - /** - * Create a Token with the given ID and text, as well optional line and position information. - */ - final public function __construct(int $id, string $text, int $line = -1, int $pos = -1) { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $pos; - } - - /** - * Get the name of the token. For single-char tokens this will be the token character. - * Otherwise it will be a T_* style name, or null if the token ID is unknown. - */ - public function getTokenName(): ?string { - if ($this->id < 256) { - return \chr($this->id); - } - - $name = token_name($this->id); - return $name === 'UNKNOWN' ? null : $name; - } - - /** - * Check whether the token is of the given kind. The kind may be either an integer that matches - * the token ID, a string that matches the token text, or an array of integers/strings. In the - * latter case, the function returns true if any of the kinds in the array match. - * - * @param int|string|(int|string)[] $kind - */ - public function is($kind): bool { - if (\is_int($kind)) { - return $this->id === $kind; - } - if (\is_string($kind)) { - return $this->text === $kind; - } - if (\is_array($kind)) { - foreach ($kind as $entry) { - if (\is_int($entry)) { - if ($this->id === $entry) { - return true; - } - } elseif (\is_string($entry)) { - if ($this->text === $entry) { - return true; - } - } else { - throw new \TypeError( - 'Argument #1 ($kind) must only have elements of type string|int, ' . - gettype($entry) . ' given'); - } - } - return false; - } - throw new \TypeError( - 'Argument #1 ($kind) must be of type string|int|array, ' .gettype($kind) . ' given'); - } - - /** - * Check whether this token would be ignored by the PHP parser. Returns true for T_WHITESPACE, - * T_COMMENT, T_DOC_COMMENT and T_OPEN_TAG, and false for everything else. - */ - public function isIgnorable(): bool { - return isset(self::IGNORABLE_TOKENS[$this->id]); - } - - /** - * Return the textual content of the token. - */ - public function __toString(): string { - return $this->text; - } - - /** - * Tokenize the given source code and return an array of tokens. - * - * This performs certain canonicalizations to match the PHP 8.0 token format: - * * Bad characters are represented using T_BAD_CHARACTER rather than omitted. - * * T_COMMENT does not include trailing newlines, instead the newline is part of a following - * T_WHITESPACE token. - * * Namespaced names are represented using T_NAME_* tokens. - * - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array { - self::init(); - - $tokens = []; - $line = 1; - $pos = 0; - $origTokens = \token_get_all($code, $flags); - - $numTokens = \count($origTokens); - for ($i = 0; $i < $numTokens; $i++) { - $token = $origTokens[$i]; - if (\is_string($token)) { - if (\strlen($token) === 2) { - // b" and B" are tokenized as single-char tokens, even though they aren't. - $tokens[] = new static(\ord('"'), $token, $line, $pos); - $pos += 2; - } else { - $tokens[] = new static(\ord($token), $token, $line, $pos); - $pos++; - } - } else { - $id = $token[0]; - $text = $token[1]; - - // Emulate PHP 8.0 comment format, which does not include trailing whitespace anymore. - if ($id === \T_COMMENT && \substr($text, 0, 2) !== '/*' && - \preg_match('/(\r\n|\n|\r)$/D', $text, $matches) - ) { - $trailingNewline = $matches[0]; - $text = \substr($text, 0, -\strlen($trailingNewline)); - $tokens[] = new static($id, $text, $line, $pos); - $pos += \strlen($text); - - if ($i + 1 < $numTokens && $origTokens[$i + 1][0] === \T_WHITESPACE) { - // Move trailing newline into following T_WHITESPACE token, if it already exists. - $origTokens[$i + 1][1] = $trailingNewline . $origTokens[$i + 1][1]; - $origTokens[$i + 1][2]--; - } else { - // Otherwise, we need to create a new T_WHITESPACE token. - $tokens[] = new static(\T_WHITESPACE, $trailingNewline, $line, $pos); - $line++; - $pos += \strlen($trailingNewline); - } - continue; - } - - // Emulate PHP 8.0 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and - // T_STRING into a single token. - if (($id === \T_NS_SEPARATOR || isset(self::$identifierTokens[$id]))) { - $newText = $text; - $lastWasSeparator = $id === \T_NS_SEPARATOR; - for ($j = $i + 1; $j < $numTokens; $j++) { - if ($lastWasSeparator) { - if (!isset(self::$identifierTokens[$origTokens[$j][0]])) { - break; - } - $lastWasSeparator = false; - } else { - if ($origTokens[$j][0] !== \T_NS_SEPARATOR) { - break; - } - $lastWasSeparator = true; - } - $newText .= $origTokens[$j][1]; - } - if ($lastWasSeparator) { - // Trailing separator is not part of the name. - $j--; - $newText = \substr($newText, 0, -1); - } - if ($j > $i + 1) { - if ($id === \T_NS_SEPARATOR) { - $id = \T_NAME_FULLY_QUALIFIED; - } elseif ($id === \T_NAMESPACE) { - $id = \T_NAME_RELATIVE; - } else { - $id = \T_NAME_QUALIFIED; - } - $tokens[] = new static($id, $newText, $line, $pos); - $pos += \strlen($newText); - $i = $j - 1; - continue; - } - } - - $tokens[] = new static($id, $text, $line, $pos); - $line += \substr_count($text, "\n"); - $pos += \strlen($text); - } - } - return $tokens; - } - - /** Initialize private static state needed by tokenize(). */ - private static function init(): void { - if (isset(self::$identifierTokens)) { - return; - } - - // Based on semi_reserved production. - self::$identifierTokens = \array_fill_keys([ - \T_STRING, - \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, - \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, - \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, - \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, - \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, - \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, - \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, - \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, - \T_MATCH, - ], true); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php deleted file mode 100644 index 8fba131..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +++ /dev/null @@ -1,271 +0,0 @@ -tokens = $tokens; - $this->indentMap = $this->calcIndentMap(); - } - - /** - * Whether the given position is immediately surrounded by parenthesis. - * - * @param int $startPos Start position - * @param int $endPos End position - */ - public function haveParens(int $startPos, int $endPos): bool { - return $this->haveTokenImmediatelyBefore($startPos, '(') - && $this->haveTokenImmediatelyAfter($endPos, ')'); - } - - /** - * Whether the given position is immediately surrounded by braces. - * - * @param int $startPos Start position - * @param int $endPos End position - */ - public function haveBraces(int $startPos, int $endPos): bool { - return ($this->haveTokenImmediatelyBefore($startPos, '{') - || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) - && $this->haveTokenImmediatelyAfter($endPos, '}'); - } - - /** - * Check whether the position is directly preceded by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position before which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType): bool { - $tokens = $this->tokens; - $pos--; - for (; $pos >= 0; $pos--) { - $token = $tokens[$pos]; - if ($token->is($expectedTokenType)) { - return true; - } - if (!$token->isIgnorable()) { - break; - } - } - return false; - } - - /** - * Check whether the position is directly followed by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position after which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType): bool { - $tokens = $this->tokens; - $pos++; - for ($c = \count($tokens); $pos < $c; $pos++) { - $token = $tokens[$pos]; - if ($token->is($expectedTokenType)) { - return true; - } - if (!$token->isIgnorable()) { - break; - } - } - return false; - } - - /** @param int|string|(int|string)[] $skipTokenType */ - public function skipLeft(int $pos, $skipTokenType): int { - $tokens = $this->tokens; - - $pos = $this->skipLeftWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if (!$tokens[$pos]->is($skipTokenType)) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos--; - - return $this->skipLeftWhitespace($pos); - } - - /** @param int|string|(int|string)[] $skipTokenType */ - public function skipRight(int $pos, $skipTokenType): int { - $tokens = $this->tokens; - - $pos = $this->skipRightWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if (!$tokens[$pos]->is($skipTokenType)) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos++; - - return $this->skipRightWhitespace($pos); - } - - /** - * Return first non-whitespace token position smaller or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipLeftWhitespace(int $pos): int { - $tokens = $this->tokens; - for (; $pos >= 0; $pos--) { - if (!$tokens[$pos]->isIgnorable()) { - break; - } - } - return $pos; - } - - /** - * Return first non-whitespace position greater or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipRightWhitespace(int $pos): int { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - if (!$tokens[$pos]->isIgnorable()) { - break; - } - } - return $pos; - } - - /** @param int|string|(int|string)[] $findTokenType */ - public function findRight(int $pos, $findTokenType): int { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - if ($tokens[$pos]->is($findTokenType)) { - return $pos; - } - } - return -1; - } - - /** - * Whether the given position range contains a certain token type. - * - * @param int $startPos Starting position (inclusive) - * @param int $endPos Ending position (exclusive) - * @param int|string $tokenType Token type to look for - * @return bool Whether the token occurs in the given range - */ - public function haveTokenInRange(int $startPos, int $endPos, $tokenType): bool { - $tokens = $this->tokens; - for ($pos = $startPos; $pos < $endPos; $pos++) { - if ($tokens[$pos]->is($tokenType)) { - return true; - } - } - return false; - } - - public function haveTagInRange(int $startPos, int $endPos): bool { - return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) - || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG); - } - - /** - * Get indentation before token position. - * - * @param int $pos Token position - * - * @return int Indentation depth (in spaces) - */ - public function getIndentationBefore(int $pos): int { - return $this->indentMap[$pos]; - } - - /** - * Get the code corresponding to a token offset range, optionally adjusted for indentation. - * - * @param int $from Token start position (inclusive) - * @param int $to Token end position (exclusive) - * @param int $indent By how much the code should be indented (can be negative as well) - * - * @return string Code corresponding to token range, adjusted for indentation - */ - public function getTokenCode(int $from, int $to, int $indent): string { - $tokens = $this->tokens; - $result = ''; - for ($pos = $from; $pos < $to; $pos++) { - $token = $tokens[$pos]; - $id = $token->id; - $text = $token->text; - if ($id === \T_CONSTANT_ENCAPSED_STRING || $id === \T_ENCAPSED_AND_WHITESPACE) { - $result .= $text; - } else { - // TODO Handle non-space indentation - if ($indent < 0) { - $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $text); - } elseif ($indent > 0) { - $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $text); - } else { - $result .= $text; - } - } - } - return $result; - } - - /** - * Precalculate the indentation at every token position. - * - * @return int[] Token position to indentation map - */ - private function calcIndentMap(): array { - $indentMap = []; - $indent = 0; - foreach ($this->tokens as $token) { - $indentMap[] = $indent; - - if ($token->id === \T_WHITESPACE) { - $content = $token->text; - $newlinePos = \strrpos($content, "\n"); - if (false !== $newlinePos) { - $indent = \strlen($content) - $newlinePos - 1; - } - } - } - - // Add a sentinel for one past end of the file - $indentMap[] = $indent; - - return $indentMap; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php b/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php deleted file mode 100644 index 7be4142..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +++ /dev/null @@ -1,108 +0,0 @@ -[] Node type to reflection class map */ - private array $reflectionClassCache; - - /** @return mixed */ - public function decode(string $json) { - $value = json_decode($json, true); - if (json_last_error()) { - throw new \RuntimeException('JSON decoding error: ' . json_last_error_msg()); - } - - return $this->decodeRecursive($value); - } - - /** - * @param mixed $value - * @return mixed - */ - private function decodeRecursive($value) { - if (\is_array($value)) { - if (isset($value['nodeType'])) { - if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') { - return $this->decodeComment($value); - } - return $this->decodeNode($value); - } - return $this->decodeArray($value); - } - return $value; - } - - private function decodeArray(array $array): array { - $decodedArray = []; - foreach ($array as $key => $value) { - $decodedArray[$key] = $this->decodeRecursive($value); - } - return $decodedArray; - } - - private function decodeNode(array $value): Node { - $nodeType = $value['nodeType']; - if (!\is_string($nodeType)) { - throw new \RuntimeException('Node type must be a string'); - } - - $reflectionClass = $this->reflectionClassFromNodeType($nodeType); - $node = $reflectionClass->newInstanceWithoutConstructor(); - - if (isset($value['attributes'])) { - if (!\is_array($value['attributes'])) { - throw new \RuntimeException('Attributes must be an array'); - } - - $node->setAttributes($this->decodeArray($value['attributes'])); - } - - foreach ($value as $name => $subNode) { - if ($name === 'nodeType' || $name === 'attributes') { - continue; - } - - $node->$name = $this->decodeRecursive($subNode); - } - - return $node; - } - - private function decodeComment(array $value): Comment { - $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class; - if (!isset($value['text'])) { - throw new \RuntimeException('Comment must have text'); - } - - return new $className( - $value['text'], - $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, - $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1 - ); - } - - /** @return \ReflectionClass */ - private function reflectionClassFromNodeType(string $nodeType): \ReflectionClass { - if (!isset($this->reflectionClassCache[$nodeType])) { - $className = $this->classNameFromNodeType($nodeType); - $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className); - } - return $this->reflectionClassCache[$nodeType]; - } - - /** @return class-string */ - private function classNameFromNodeType(string $nodeType): string { - $className = 'PhpParser\\Node\\' . strtr($nodeType, '_', '\\'); - if (class_exists($className)) { - return $className; - } - - $className .= '_'; - if (class_exists($className)) { - return $className; - } - - throw new \RuntimeException("Unknown node type \"$nodeType\""); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php deleted file mode 100644 index 5e2ece9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ /dev/null @@ -1,116 +0,0 @@ -postprocessTokens($tokens, $errorHandler); - - if (false !== $scream) { - ini_set('xdebug.scream', $scream); - } - - return $tokens; - } - - private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void { - $chr = $token->text; - if ($chr === "\0") { - // PHP cuts error message after null byte, so need special case - $errorMsg = 'Unexpected null byte'; - } else { - $errorMsg = sprintf( - 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) - ); - } - - $errorHandler->handleError(new Error($errorMsg, [ - 'startLine' => $token->line, - 'endLine' => $token->line, - 'startFilePos' => $token->pos, - 'endFilePos' => $token->pos, - ])); - } - - private function isUnterminatedComment(Token $token): bool { - return $token->is([\T_COMMENT, \T_DOC_COMMENT]) - && substr($token->text, 0, 2) === '/*' - && substr($token->text, -2) !== '*/'; - } - - /** - * @param list $tokens - */ - protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void { - // This function reports errors (bad characters and unterminated comments) in the token - // array, and performs certain canonicalizations: - // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and - // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. - // * Add a sentinel token with ID 0. - - $numTokens = \count($tokens); - if ($numTokens === 0) { - // Empty input edge case: Just add the sentinel token. - $tokens[] = new Token(0, "\0", 1, 0); - return; - } - - for ($i = 0; $i < $numTokens; $i++) { - $token = $tokens[$i]; - if ($token->id === \T_BAD_CHARACTER) { - $this->handleInvalidCharacter($token, $errorHandler); - } - - if ($token->id === \ord('&')) { - $next = $i + 1; - while (isset($tokens[$next]) && $tokens[$next]->id === \T_WHITESPACE) { - $next++; - } - $followedByVarOrVarArg = isset($tokens[$next]) && - $tokens[$next]->is([\T_VARIABLE, \T_ELLIPSIS]); - $token->id = $followedByVarOrVarArg - ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; - } - } - - // Check for unterminated comment - $lastToken = $tokens[$numTokens - 1]; - if ($this->isUnterminatedComment($lastToken)) { - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $lastToken->line, - 'endLine' => $lastToken->getEndLine(), - 'startFilePos' => $lastToken->pos, - 'endFilePos' => $lastToken->getEndPos(), - ])); - } - - // Add sentinel token. - $tokens[] = new Token(0, "\0", $lastToken->getEndLine(), $lastToken->getEndPos()); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php deleted file mode 100644 index 934954c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ /dev/null @@ -1,226 +0,0 @@ - */ - private array $emulators = []; - - private PhpVersion $targetPhpVersion; - - private PhpVersion $hostPhpVersion; - - /** - * @param PhpVersion|null $phpVersion PHP version to emulate. Defaults to newest supported. - */ - public function __construct(?PhpVersion $phpVersion = null) { - $this->targetPhpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); - $this->hostPhpVersion = PhpVersion::getHostVersion(); - - $emulators = [ - new MatchTokenEmulator(), - new NullsafeTokenEmulator(), - new AttributeEmulator(), - new EnumTokenEmulator(), - new ReadonlyTokenEmulator(), - new ExplicitOctalEmulator(), - new ReadonlyFunctionTokenEmulator(), - ]; - - // Collect emulators that are relevant for the PHP version we're running - // and the PHP version we're targeting for emulation. - foreach ($emulators as $emulator) { - $emulatorPhpVersion = $emulator->getPhpVersion(); - if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = $emulator; - } elseif ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = new ReverseEmulator($emulator); - } - } - } - - public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { - $emulators = array_filter($this->emulators, function ($emulator) use ($code) { - return $emulator->isEmulationNeeded($code); - }); - - if (empty($emulators)) { - // Nothing to emulate, yay - return parent::tokenize($code, $errorHandler); - } - - if ($errorHandler === null) { - $errorHandler = new ErrorHandler\Throwing(); - } - - $this->patches = []; - foreach ($emulators as $emulator) { - $code = $emulator->preprocessCode($code, $this->patches); - } - - $collector = new ErrorHandler\Collecting(); - $tokens = parent::tokenize($code, $collector); - $this->sortPatches(); - $tokens = $this->fixupTokens($tokens); - - $errors = $collector->getErrors(); - if (!empty($errors)) { - $this->fixupErrors($errors); - foreach ($errors as $error) { - $errorHandler->handleError($error); - } - } - - foreach ($emulators as $emulator) { - $tokens = $emulator->emulate($code, $tokens); - } - - return $tokens; - } - - private function isForwardEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { - return $this->hostPhpVersion->older($emulatorPhpVersion) - && $this->targetPhpVersion->newerOrEqual($emulatorPhpVersion); - } - - private function isReverseEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { - return $this->hostPhpVersion->newerOrEqual($emulatorPhpVersion) - && $this->targetPhpVersion->older($emulatorPhpVersion); - } - - private function sortPatches(): void { - // Patches may be contributed by different emulators. - // Make sure they are sorted by increasing patch position. - usort($this->patches, function ($p1, $p2) { - return $p1[0] <=> $p2[0]; - }); - } - - /** - * @param list $tokens - * @return list - */ - private function fixupTokens(array $tokens): array { - if (\count($this->patches) === 0) { - return $tokens; - } - - // Load first patch - $patchIdx = 0; - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // We use a manual loop over the tokens, because we modify the array on the fly - $posDelta = 0; - $lineDelta = 0; - for ($i = 0, $c = \count($tokens); $i < $c; $i++) { - $token = $tokens[$i]; - $pos = $token->pos; - $token->pos += $posDelta; - $token->line += $lineDelta; - $localPosDelta = 0; - $len = \strlen($token->text); - while ($patchPos >= $pos && $patchPos < $pos + $len) { - $patchTextLen = \strlen($patchText); - if ($patchType === 'remove') { - if ($patchPos === $pos && $patchTextLen === $len) { - // Remove token entirely - array_splice($tokens, $i, 1, []); - $i--; - $c--; - } else { - // Remove from token string - $token->text = substr_replace( - $token->text, '', $patchPos - $pos + $localPosDelta, $patchTextLen - ); - $localPosDelta -= $patchTextLen; - } - $lineDelta -= \substr_count($patchText, "\n"); - } elseif ($patchType === 'add') { - // Insert into the token string - $token->text = substr_replace( - $token->text, $patchText, $patchPos - $pos + $localPosDelta, 0 - ); - $localPosDelta += $patchTextLen; - $lineDelta += \substr_count($patchText, "\n"); - } elseif ($patchType === 'replace') { - // Replace inside the token string - $token->text = substr_replace( - $token->text, $patchText, $patchPos - $pos + $localPosDelta, $patchTextLen - ); - } else { - assert(false); - } - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches. However, we still need to adjust position. - $patchPos = \PHP_INT_MAX; - break; - } - - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - } - - $posDelta += $localPosDelta; - } - return $tokens; - } - - /** - * Fixup line and position information in errors. - * - * @param Error[] $errors - */ - private function fixupErrors(array $errors): void { - foreach ($errors as $error) { - $attrs = $error->getAttributes(); - - $posDelta = 0; - $lineDelta = 0; - foreach ($this->patches as $patch) { - list($patchPos, $patchType, $patchText) = $patch; - if ($patchPos >= $attrs['startFilePos']) { - // No longer relevant - break; - } - - if ($patchType === 'add') { - $posDelta += strlen($patchText); - $lineDelta += substr_count($patchText, "\n"); - } elseif ($patchType === 'remove') { - $posDelta -= strlen($patchText); - $lineDelta -= substr_count($patchText, "\n"); - } - } - - $attrs['startFilePos'] += $posDelta; - $attrs['endFilePos'] += $posDelta; - $attrs['startLine'] += $lineDelta; - $attrs['endLine'] += $lineDelta; - $error->setAttributes($attrs); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php deleted file mode 100644 index 2c12f33..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +++ /dev/null @@ -1,49 +0,0 @@ -text === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1]->text === '[') { - array_splice($tokens, $i, 2, [ - new Token(\T_ATTRIBUTE, '#[', $token->line, $token->pos), - ]); - $c--; - continue; - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array { - // TODO - return $tokens; - } - - public function preprocessCode(string $code, array &$patches): string { - $pos = 0; - while (false !== $pos = strpos($code, '#[', $pos)) { - // Replace #[ with %[ - $code[$pos] = '%'; - $patches[] = [$pos, 'replace', '#']; - $pos += 2; - } - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php deleted file mode 100644 index 5418f52..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +++ /dev/null @@ -1,26 +0,0 @@ -id === \T_WHITESPACE - && $tokens[$pos + 2]->id === \T_STRING; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php deleted file mode 100644 index 9cadf42..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +++ /dev/null @@ -1,45 +0,0 @@ -id == \T_LNUMBER && $token->text === '0' && - isset($tokens[$i + 1]) && $tokens[$i + 1]->id == \T_STRING && - preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1]->text) - ) { - $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1]->text); - array_splice($tokens, $i, 2, [ - new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos), - ]); - $c--; - } - } - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int { - $str = substr($str, 1); - $str = str_replace('_', '', $str); - $num = octdec($str); - return is_float($num) ? \T_DNUMBER : \T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array { - // Explicit octals were not legal code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php deleted file mode 100644 index 9803f99..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +++ /dev/null @@ -1,56 +0,0 @@ -getKeywordString()) !== false; - } - - /** @param Token[] $tokens */ - protected function isKeywordContext(array $tokens, int $pos): bool { - $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); - return $previousNonSpaceToken === null || $previousNonSpaceToken->id !== \T_OBJECT_OPERATOR; - } - - public function emulate(string $code, array $tokens): array { - $keywordString = $this->getKeywordString(); - foreach ($tokens as $i => $token) { - if ($token->id === T_STRING && strtolower($token->text) === $keywordString - && $this->isKeywordContext($tokens, $i)) { - $token->id = $this->getKeywordToken(); - } - } - - return $tokens; - } - - /** @param Token[] $tokens */ - private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token { - for ($i = $start - 1; $i >= 0; --$i) { - if ($tokens[$i]->id === T_WHITESPACE) { - continue; - } - - return $tokens[$i]; - } - - return null; - } - - public function reverseEmulate(string $code, array $tokens): array { - $keywordToken = $this->getKeywordToken(); - foreach ($tokens as $token) { - if ($token->id === $keywordToken) { - $token->id = \T_STRING; - } - } - - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php deleted file mode 100644 index 0fa5fbc..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +++ /dev/null @@ -1,19 +0,0 @@ -') !== false; - } - - public function emulate(string $code, array $tokens): array { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - $token = $tokens[$i]; - if ($token->text === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1]->id === \T_OBJECT_OPERATOR) { - array_splice($tokens, $i, 2, [ - new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), - ]); - $c--; - continue; - } - - // Handle ?-> inside encapsed string. - if ($token->id === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) - && $tokens[$i - 1]->id === \T_VARIABLE - && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $token->text, $matches) - ) { - $replacement = [ - new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), - new Token(\T_STRING, $matches[1], $token->line, $token->pos + 3), - ]; - $matchLen = \strlen($matches[0]); - if ($matchLen !== \strlen($token->text)) { - $replacement[] = new Token( - \T_ENCAPSED_AND_WHITESPACE, - \substr($token->text, $matchLen), - $token->line, $token->pos + $matchLen - ); - } - array_splice($tokens, $i, 1, $replacement); - $c += \count($replacement) - 1; - continue; - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array { - // ?-> was not valid code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php deleted file mode 100644 index 5990d7f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +++ /dev/null @@ -1,31 +0,0 @@ -text === '(' || - ($tokens[$pos + 1]->id === \T_WHITESPACE && - isset($tokens[$pos + 2]) && - $tokens[$pos + 2]->text === '('))); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php deleted file mode 100644 index 851b5c4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +++ /dev/null @@ -1,37 +0,0 @@ -emulator = $emulator; - } - - public function getPhpVersion(): PhpVersion { - return $this->emulator->getPhpVersion(); - } - - public function isEmulationNeeded(string $code): bool { - return $this->emulator->isEmulationNeeded($code); - } - - public function emulate(string $code, array $tokens): array { - return $this->emulator->reverseEmulate($code, $tokens); - } - - public function reverseEmulate(string $code, array $tokens): array { - return $this->emulator->emulate($code, $tokens); - } - - public function preprocessCode(string $code, array &$patches): string { - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php deleted file mode 100644 index fec2f19..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +++ /dev/null @@ -1,30 +0,0 @@ - [aliasName => originalName]] */ - protected array $aliases = []; - - /** @var Name[][] Same as $aliases but preserving original case */ - protected array $origAliases = []; - - /** @var ErrorHandler Error handler */ - protected ErrorHandler $errorHandler; - - /** - * Create a name context. - * - * @param ErrorHandler $errorHandler Error handling used to report errors - */ - public function __construct(ErrorHandler $errorHandler) { - $this->errorHandler = $errorHandler; - } - - /** - * Start a new namespace. - * - * This also resets the alias table. - * - * @param Name|null $namespace Null is the global namespace - */ - public function startNamespace(?Name $namespace = null): void { - $this->namespace = $namespace; - $this->origAliases = $this->aliases = [ - Stmt\Use_::TYPE_NORMAL => [], - Stmt\Use_::TYPE_FUNCTION => [], - Stmt\Use_::TYPE_CONSTANT => [], - ]; - } - - /** - * Add an alias / import. - * - * @param Name $name Original name - * @param string $aliasName Aliased name - * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* - * @param array $errorAttrs Attributes to use to report an error - */ - public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []): void { - // Constant names are case sensitive, everything else case insensitive - if ($type === Stmt\Use_::TYPE_CONSTANT) { - $aliasLookupName = $aliasName; - } else { - $aliasLookupName = strtolower($aliasName); - } - - if (isset($this->aliases[$type][$aliasLookupName])) { - $typeStringMap = [ - Stmt\Use_::TYPE_NORMAL => '', - Stmt\Use_::TYPE_FUNCTION => 'function ', - Stmt\Use_::TYPE_CONSTANT => 'const ', - ]; - - $this->errorHandler->handleError(new Error( - sprintf( - 'Cannot use %s%s as %s because the name is already in use', - $typeStringMap[$type], $name, $aliasName - ), - $errorAttrs - )); - return; - } - - $this->aliases[$type][$aliasLookupName] = $name; - $this->origAliases[$type][$aliasName] = $name; - } - - /** - * Get current namespace. - * - * @return null|Name Namespace (or null if global namespace) - */ - public function getNamespace(): ?Name { - return $this->namespace; - } - - /** - * Get resolved name. - * - * @param Name $name Name to resolve - * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} - * - * @return null|Name Resolved name, or null if static resolution is not possible - */ - public function getResolvedName(Name $name, int $type): ?Name { - // don't resolve special class names - if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) { - if (!$name->isUnqualified()) { - $this->errorHandler->handleError(new Error( - sprintf("'\\%s' is an invalid class name", $name->toString()), - $name->getAttributes() - )); - } - return $name; - } - - // fully qualified names are already resolved - if ($name->isFullyQualified()) { - return $name; - } - - // Try to resolve aliases - if (null !== $resolvedName = $this->resolveAlias($name, $type)) { - return $resolvedName; - } - - if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) { - if (null === $this->namespace) { - // outside of a namespace unaliased unqualified is same as fully qualified - return new FullyQualified($name, $name->getAttributes()); - } - - // Cannot resolve statically - return null; - } - - // if no alias exists prepend current namespace - return FullyQualified::concat($this->namespace, $name, $name->getAttributes()); - } - - /** - * Get resolved class name. - * - * @param Name $name Class ame to resolve - * - * @return Name Resolved name - */ - public function getResolvedClassName(Name $name): Name { - return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL); - } - - /** - * Get possible ways of writing a fully qualified name (e.g., by making use of aliases). - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* - * - * @return Name[] Possible representations of the name - */ - public function getPossibleNames(string $name, int $type): array { - $lcName = strtolower($name); - - if ($type === Stmt\Use_::TYPE_NORMAL) { - // self, parent and static must always be unqualified - if ($lcName === "self" || $lcName === "parent" || $lcName === "static") { - return [new Name($name)]; - } - } - - // Collect possible ways to write this name, starting with the fully-qualified name - $possibleNames = [new FullyQualified($name)]; - - if (null !== $nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type)) { - // Make sure there is no alias that makes the normally namespace-relative name - // into something else - if (null === $this->resolveAlias($nsRelativeName, $type)) { - $possibleNames[] = $nsRelativeName; - } - } - - // Check for relevant namespace use statements - foreach ($this->origAliases[Stmt\Use_::TYPE_NORMAL] as $alias => $orig) { - $lcOrig = $orig->toLowerString(); - if (0 === strpos($lcName, $lcOrig . '\\')) { - $possibleNames[] = new Name($alias . substr($name, strlen($lcOrig))); - } - } - - // Check for relevant type-specific use statements - foreach ($this->origAliases[$type] as $alias => $orig) { - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // Constants are are complicated-sensitive - $normalizedOrig = $this->normalizeConstName($orig->toString()); - if ($normalizedOrig === $this->normalizeConstName($name)) { - $possibleNames[] = new Name($alias); - } - } else { - // Everything else is case-insensitive - if ($orig->toLowerString() === $lcName) { - $possibleNames[] = new Name($alias); - } - } - } - - return $possibleNames; - } - - /** - * Get shortest representation of this fully-qualified name. - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* - * - * @return Name Shortest representation - */ - public function getShortName(string $name, int $type): Name { - $possibleNames = $this->getPossibleNames($name, $type); - - // Find shortest name - $shortestName = null; - $shortestLength = \INF; - foreach ($possibleNames as $possibleName) { - $length = strlen($possibleName->toCodeString()); - if ($length < $shortestLength) { - $shortestName = $possibleName; - $shortestLength = $length; - } - } - - return $shortestName; - } - - private function resolveAlias(Name $name, int $type): ?FullyQualified { - $firstPart = $name->getFirst(); - - if ($name->isQualified()) { - // resolve aliases for qualified names, always against class alias table - $checkName = strtolower($firstPart); - if (isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName])) { - $alias = $this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName]; - return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes()); - } - } elseif ($name->isUnqualified()) { - // constant aliases are case-sensitive, function aliases case-insensitive - $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : strtolower($firstPart); - if (isset($this->aliases[$type][$checkName])) { - // resolve unqualified aliases - return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes()); - } - } - - // No applicable aliases - return null; - } - - private function getNamespaceRelativeName(string $name, string $lcName, int $type): ?Name { - if (null === $this->namespace) { - return new Name($name); - } - - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // The constants true/false/null always resolve to the global symbols, even inside a - // namespace, so they may be used without qualification - if ($lcName === "true" || $lcName === "false" || $lcName === "null") { - return new Name($name); - } - } - - $namespacePrefix = strtolower($this->namespace . '\\'); - if (0 === strpos($lcName, $namespacePrefix)) { - return new Name(substr($name, strlen($namespacePrefix))); - } - - return null; - } - - private function normalizeConstName(string $name): string { - $nsSep = strrpos($name, '\\'); - if (false === $nsSep) { - return $name; - } - - // Constants have case-insensitive namespace and case-sensitive short-name - $ns = substr($name, 0, $nsSep); - $shortName = substr($name, $nsSep + 1); - return strtolower($ns) . '\\' . $shortName; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node.php b/vendor/nikic/php-parser/lib/PhpParser/Node.php deleted file mode 100644 index 258e451..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node.php +++ /dev/null @@ -1,146 +0,0 @@ - - */ - public function getAttributes(): array; - - /** - * Replaces all the attributes of this node. - * - * @param array $attributes - */ - public function setAttributes(array $attributes): void; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php deleted file mode 100644 index 6680efa..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +++ /dev/null @@ -1,44 +0,0 @@ - $attributes Additional attributes - * @param Identifier|null $name Parameter name (for named parameters) - */ - public function __construct( - Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [], - ?Identifier $name = null - ) { - $this->attributes = $attributes; - $this->name = $name; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames(): array { - return ['name', 'value', 'byRef', 'unpack']; - } - - public function getType(): string { - return 'Arg'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php deleted file mode 100644 index fa1cff5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +++ /dev/null @@ -1,43 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $value, ?Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { - $this->attributes = $attributes; - $this->key = $key; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames(): array { - return ['key', 'value', 'byRef', 'unpack']; - } - - public function getType(): string { - return 'ArrayItem'; - } -} - -// @deprecated compatibility alias -class_alias(ArrayItem::class, Expr\ArrayItem::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php deleted file mode 100644 index 9d89243..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +++ /dev/null @@ -1,33 +0,0 @@ - Attribute arguments */ - public array $args; - - /** - * @param Node\Name $name Attribute name - * @param list $args Attribute arguments - * @param array $attributes Additional node attributes - */ - public function __construct(Name $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['name', 'args']; - } - - public function getType(): string { - return 'Attribute'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php b/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php deleted file mode 100644 index b9eb588..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +++ /dev/null @@ -1,27 +0,0 @@ - $attributes Additional node attributes - */ - public function __construct(array $attrs, array $attributes = []) { - $this->attributes = $attributes; - $this->attrs = $attrs; - } - - public function getSubNodeNames(): array { - return ['attrs']; - } - - public function getType(): string { - return 'AttributeGroup'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php deleted file mode 100644 index e313280..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +++ /dev/null @@ -1,36 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr\Variable $var, bool $byRef = false, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->byRef = $byRef; - } - - public function getSubNodeNames(): array { - return ['var', 'byRef']; - } - - public function getType(): string { - return 'ClosureUse'; - } -} - -// @deprecated compatibility alias -class_alias(ClosureUse::class, Expr\ClosureUse::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php deleted file mode 100644 index 05a5e5e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +++ /dev/null @@ -1,13 +0,0 @@ - $attributes Additional attributes - */ - public function __construct($name, Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['name', 'value']; - } - - public function getType(): string { - return 'Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php deleted file mode 100644 index 55c1fe4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +++ /dev/null @@ -1,37 +0,0 @@ -value pair node. - * - * @param string|Node\Identifier $key Key - * @param Node\Expr $value Value - * @param array $attributes Additional attributes - */ - public function __construct($key, Node\Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->key = \is_string($key) ? new Node\Identifier($key) : $key; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['key', 'value']; - } - - public function getType(): string { - return 'DeclareItem'; - } -} - -// @deprecated compatibility alias -class_alias(DeclareItem::class, Stmt\DeclareDeclare::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php deleted file mode 100644 index 8b7dbb6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +++ /dev/null @@ -1,8 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->dim = $dim; - } - - public function getSubNodeNames(): array { - return ['var', 'dim']; - } - - public function getType(): string { - return 'Expr_ArrayDimFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php deleted file mode 100644 index 490ac93..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $items = [], array $attributes = []) { - $this->attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames(): array { - return ['items']; - } - - public function getType(): string { - return 'Expr_Array'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php deleted file mode 100644 index 0e98ce9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +++ /dev/null @@ -1,84 +0,0 @@ - false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes, array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $this->returnType = $subNodes['returnType'] ?? null; - $this->expr = $subNodes['expr']; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; - } - - public function returnsByRef(): bool { - return $this->byRef; - } - - public function getParams(): array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups(): array { - return $this->attrGroups; - } - - /** - * @return Node\Stmt\Return_[] - */ - public function getStmts(): array { - return [new Node\Stmt\Return_($this->expr)]; - } - - public function getType(): string { - return 'Expr_ArrowFunction'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php deleted file mode 100644 index dcbf84d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['var', 'expr']; - } - - public function getType(): string { - return 'Expr_Assign'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php deleted file mode 100644 index 5209a64..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['var', 'expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php deleted file mode 100644 index 4f3623f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +++ /dev/null @@ -1,11 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['var', 'expr']; - } - - public function getType(): string { - return 'Expr_AssignRef'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php deleted file mode 100644 index 1b92bd4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +++ /dev/null @@ -1,37 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $left, Expr $right, array $attributes = []) { - $this->attributes = $attributes; - $this->left = $left; - $this->right = $right; - } - - public function getSubNodeNames(): array { - return ['left', 'right']; - } - - /** - * Get the operator sigil for this binary operation. - * - * In the case there are multiple possible sigils for an operator, this method does not - * necessarily return the one used in the parsed code. - */ - abstract public function getOperatorSigil(): string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php deleted file mode 100644 index 5930c54..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +++ /dev/null @@ -1,15 +0,0 @@ -'; - } - - public function getType(): string { - return 'Expr_BinaryOp_Greater'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php deleted file mode 100644 index 4d440b1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +++ /dev/null @@ -1,15 +0,0 @@ -='; - } - - public function getType(): string { - return 'Expr_BinaryOp_GreaterOrEqual'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php deleted file mode 100644 index e25d17c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +++ /dev/null @@ -1,15 +0,0 @@ ->'; - } - - public function getType(): string { - return 'Expr_BinaryOp_ShiftRight'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php deleted file mode 100644 index 01e9b23..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +++ /dev/null @@ -1,15 +0,0 @@ -'; - } - - public function getType(): string { - return 'Expr_BinaryOp_Spaceship'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php deleted file mode 100644 index b7175a7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_BitwiseNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php deleted file mode 100644 index c66d233..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_BooleanNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php deleted file mode 100644 index 2af2245..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - abstract public function getRawArgs(): array; - - /** - * Returns whether this call expression is actually a first class callable. - */ - public function isFirstClassCallable(): bool { - $rawArgs = $this->getRawArgs(); - return count($rawArgs) === 1 && current($rawArgs) instanceof VariadicPlaceholder; - } - - /** - * Assert that this is not a first-class callable and return only ordinary Args. - * - * @return Arg[] - */ - public function getArgs(): array { - assert(!$this->isFirstClassCallable()); - return $this->getRawArgs(); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php deleted file mode 100644 index c2751de..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +++ /dev/null @@ -1,25 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php deleted file mode 100644 index 471cb82..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +++ /dev/null @@ -1,11 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node $class, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['class', 'name']; - } - - public function getType(): string { - return 'Expr_ClassConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php deleted file mode 100644 index d85bc9a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Clone'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php deleted file mode 100644 index 0680446..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +++ /dev/null @@ -1,86 +0,0 @@ - false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'uses' => array(): use()s - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attributes groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $this->uses = $subNodes['uses'] ?? []; - $this->returnType = $subNodes['returnType'] ?? null; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts']; - } - - public function returnsByRef(): bool { - return $this->byRef; - } - - public function getParams(): array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - /** @return Node\Stmt[] */ - public function getStmts(): array { - return $this->stmts; - } - - public function getAttrGroups(): array { - return $this->attrGroups; - } - - public function getType(): string { - return 'Expr_Closure'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php deleted file mode 100644 index 681ff31..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Name $name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames(): array { - return ['name']; - } - - public function getType(): string { - return 'Expr_ConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php deleted file mode 100644 index d2f3050..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Empty'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php deleted file mode 100644 index 43010ac..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +++ /dev/null @@ -1,30 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getSubNodeNames(): array { - return []; - } - - public function getType(): string { - return 'Expr_Error'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php deleted file mode 100644 index 32625a2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_ErrorSuppress'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php deleted file mode 100644 index 5120b1b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Eval'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php deleted file mode 100644 index cf00246..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Expr $expr = null, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Exit'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php deleted file mode 100644 index 0b85840..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ /dev/null @@ -1,38 +0,0 @@ - Arguments */ - public array $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr $name Function name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Node $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['name', 'args']; - } - - public function getType(): string { - return 'Expr_FuncCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php deleted file mode 100644 index e1187b1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +++ /dev/null @@ -1,38 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, int $type, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->type = $type; - } - - public function getSubNodeNames(): array { - return ['expr', 'type']; - } - - public function getType(): string { - return 'Expr_Include'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php deleted file mode 100644 index a2783cb..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +++ /dev/null @@ -1,35 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, Node $class, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->class = $class; - } - - public function getSubNodeNames(): array { - return ['expr', 'class']; - } - - public function getType(): string { - return 'Expr_Instanceof'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php deleted file mode 100644 index 4f80fff..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames(): array { - return ['vars']; - } - - public function getType(): string { - return 'Expr_Isset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php deleted file mode 100644 index 496b7b3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +++ /dev/null @@ -1,34 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $items, array $attributes = []) { - $this->attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames(): array { - return ['items']; - } - - public function getType(): string { - return 'Expr_List'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php deleted file mode 100644 index cd028a2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +++ /dev/null @@ -1,32 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->arms = $arms; - } - - public function getSubNodeNames(): array { - return ['cond', 'arms']; - } - - public function getType(): string { - return 'Expr_Match'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php deleted file mode 100644 index 2703c75..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ - Arguments */ - public array $args; - - /** - * Constructs a function call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['var', 'name', 'args']; - } - - public function getType(): string { - return 'Expr_MethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php deleted file mode 100644 index eedaaa1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +++ /dev/null @@ -1,40 +0,0 @@ - Arguments */ - public array $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Node $class, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['class', 'args']; - } - - public function getType(): string { - return 'Expr_New'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php deleted file mode 100644 index a151f71..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ - Arguments */ - public array $args; - - /** - * Constructs a nullsafe method call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['var', 'name', 'args']; - } - - public function getType(): string { - return 'Expr_NullsafeMethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php deleted file mode 100644 index 6f73a16..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['var', 'name']; - } - - public function getType(): string { - return 'Expr_NullsafePropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php deleted file mode 100644 index 3dca8fd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames(): array { - return ['var']; - } - - public function getType(): string { - return 'Expr_PostDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php deleted file mode 100644 index bc990c3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames(): array { - return ['var']; - } - - public function getType(): string { - return 'Expr_PostInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php deleted file mode 100644 index 2f16873..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames(): array { - return ['var']; - } - - public function getType(): string { - return 'Expr_PreDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php deleted file mode 100644 index fd455f5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames(): array { - return ['var']; - } - - public function getType(): string { - return 'Expr_PreInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php deleted file mode 100644 index 6057476..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Print'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php deleted file mode 100644 index 8c416a8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['var', 'name']; - } - - public function getType(): string { - return 'Expr_PropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php deleted file mode 100644 index e400351..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +++ /dev/null @@ -1,30 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $parts, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames(): array { - return ['parts']; - } - - public function getType(): string { - return 'Expr_ShellExec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php deleted file mode 100644 index 707f34b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +++ /dev/null @@ -1,45 +0,0 @@ - Arguments */ - public array $args; - - /** - * Constructs a static method call node. - * - * @param Node\Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Node $class, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames(): array { - return ['class', 'name', 'args']; - } - - public function getType(): string { - return 'Expr_StaticCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php deleted file mode 100644 index 4836a65..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +++ /dev/null @@ -1,36 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node $class, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['class', 'name']; - } - - public function getType(): string { - return 'Expr_StaticPropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php deleted file mode 100644 index d4837e6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +++ /dev/null @@ -1,37 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->if = $if; - $this->else = $else; - } - - public function getSubNodeNames(): array { - return ['cond', 'if', 'else']; - } - - public function getType(): string { - return 'Expr_Ternary'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php deleted file mode 100644 index ee49f83..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_Throw'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php deleted file mode 100644 index cd06f74..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_UnaryMinus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php deleted file mode 100644 index 1b44f7b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_UnaryPlus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php deleted file mode 100644 index bab7492..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames(): array { - return ['name']; - } - - public function getType(): string { - return 'Expr_Variable'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php deleted file mode 100644 index 5cff88f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Expr_YieldFrom'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php deleted file mode 100644 index bd81e69..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) { - $this->attributes = $attributes; - $this->key = $key; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['key', 'value']; - } - - public function getType(): string { - return 'Expr_Yield'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php deleted file mode 100644 index 58f653a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +++ /dev/null @@ -1,40 +0,0 @@ - */ - private static array $specialClassNames = [ - 'self' => true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs an identifier node. - * - * @param string $name Identifier as string - * @param array $attributes Additional attributes - */ - public function __construct(string $name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames(): array { - return ['name']; - } - - /** - * Get identifier as string. - * - * @return string Identifier as string. - */ - public function toString(): string { - return $this->name; - } - - /** - * Get lowercased identifier as string. - * - * @return string Lowercased identifier as string - */ - public function toLowerString(): string { - return strtolower($this->name); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName(): bool { - return isset(self::$specialClassNames[strtolower($this->name)]); - } - - /** - * Get identifier as string. - * - * @return string Identifier as string - */ - public function __toString(): string { - return $this->name; - } - - public function getType(): string { - return 'Identifier'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php b/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php deleted file mode 100644 index 576dac4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +++ /dev/null @@ -1,32 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['value']; - } - - public function getType(): string { - return 'InterpolatedStringPart'; - } -} - -// @deprecated compatibility alias -class_alias(InterpolatedStringPart::class, Scalar\EncapsedStringPart::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php deleted file mode 100644 index 3b39cf1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +++ /dev/null @@ -1,27 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $types, array $attributes = []) { - $this->attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames(): array { - return ['types']; - } - - public function getType(): string { - return 'IntersectionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php b/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php deleted file mode 100644 index 2927f02..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +++ /dev/null @@ -1,30 +0,0 @@ - */ - public ?array $conds; - /** @var Node\Expr */ - public Expr $body; - - /** - * @param null|list $conds - */ - public function __construct(?array $conds, Node\Expr $body, array $attributes = []) { - $this->conds = $conds; - $this->body = $body; - $this->attributes = $attributes; - } - - public function getSubNodeNames(): array { - return ['conds', 'body']; - } - - public function getType(): string { - return 'MatchArm'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php deleted file mode 100644 index 26b863e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ /dev/null @@ -1,269 +0,0 @@ - */ - private static array $specialClassNames = [ - 'self' => true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs a name node. - * - * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) - * @param array $attributes Additional attributes - */ - final public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = self::prepareName($name); - } - - public function getSubNodeNames(): array { - return ['name']; - } - - /** - * Get parts of name (split by the namespace separator). - * - * @return string[] Parts of name - */ - public function getParts(): array { - return \explode('\\', $this->name); - } - - /** - * Gets the first part of the name, i.e. everything before the first namespace separator. - * - * @return string First part of the name - */ - public function getFirst(): string { - if (false !== $pos = \strpos($this->name, '\\')) { - return \substr($this->name, 0, $pos); - } - return $this->name; - } - - /** - * Gets the last part of the name, i.e. everything after the last namespace separator. - * - * @return string Last part of the name - */ - public function getLast(): string { - if (false !== $pos = \strrpos($this->name, '\\')) { - return \substr($this->name, $pos + 1); - } - return $this->name; - } - - /** - * Checks whether the name is unqualified. (E.g. Name) - * - * @return bool Whether the name is unqualified - */ - public function isUnqualified(): bool { - return false === \strpos($this->name, '\\'); - } - - /** - * Checks whether the name is qualified. (E.g. Name\Name) - * - * @return bool Whether the name is qualified - */ - public function isQualified(): bool { - return false !== \strpos($this->name, '\\'); - } - - /** - * Checks whether the name is fully qualified. (E.g. \Name) - * - * @return bool Whether the name is fully qualified - */ - public function isFullyQualified(): bool { - return false; - } - - /** - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) - * - * @return bool Whether the name is relative - */ - public function isRelative(): bool { - return false; - } - - /** - * Returns a string representation of the name itself, without taking the name type into - * account (e.g., not including a leading backslash for fully qualified names). - * - * @return string String representation - */ - public function toString(): string { - return $this->name; - } - - /** - * Returns a string representation of the name as it would occur in code (e.g., including - * leading backslash for fully qualified names. - * - * @return string String representation - */ - public function toCodeString(): string { - return $this->toString(); - } - - /** - * Returns lowercased string representation of the name, without taking the name type into - * account (e.g., no leading backslash for fully qualified names). - * - * @return string Lowercased string representation - */ - public function toLowerString(): string { - return strtolower($this->name); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName(): bool { - return isset(self::$specialClassNames[strtolower($this->name)]); - } - - /** - * Returns a string representation of the name by imploding the namespace parts with the - * namespace separator. - * - * @return string String representation - */ - public function __toString(): string { - return $this->name; - } - - /** - * Gets a slice of a name (similar to array_slice). - * - * This method returns a new instance of the same type as the original and with the same - * attributes. - * - * If the slice is empty, null is returned. The null value will be correctly handled in - * concatenations using concat(). - * - * Offset and length have the same meaning as in array_slice(). - * - * @param int $offset Offset to start the slice at (may be negative) - * @param int|null $length Length of the slice (may be negative) - * - * @return static|null Sliced name - */ - public function slice(int $offset, ?int $length = null) { - if ($offset === 1 && $length === null) { - // Short-circuit the common case. - if (false !== $pos = \strpos($this->name, '\\')) { - return new static(\substr($this->name, $pos + 1)); - } - return null; - } - - $parts = \explode('\\', $this->name); - $numParts = \count($parts); - - $realOffset = $offset < 0 ? $offset + $numParts : $offset; - if ($realOffset < 0 || $realOffset > $numParts) { - throw new \OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset)); - } - - if (null === $length) { - $realLength = $numParts - $realOffset; - } else { - $realLength = $length < 0 ? $length + $numParts - $realOffset : $length; - if ($realLength < 0 || $realLength > $numParts - $realOffset) { - throw new \OutOfBoundsException(sprintf('Length %d is out of bounds', $length)); - } - } - - if ($realLength === 0) { - // Empty slice is represented as null - return null; - } - - return new static(array_slice($parts, $realOffset, $realLength), $this->attributes); - } - - /** - * Concatenate two names, yielding a new Name instance. - * - * The type of the generated instance depends on which class this method is called on, for - * example Name\FullyQualified::concat() will yield a Name\FullyQualified instance. - * - * If one of the arguments is null, a new instance of the other name will be returned. If both - * arguments are null, null will be returned. As such, writing - * Name::concat($namespace, $shortName) - * where $namespace is a Name node or null will work as expected. - * - * @param string|string[]|self|null $name1 The first name - * @param string|string[]|self|null $name2 The second name - * @param array $attributes Attributes to assign to concatenated name - * - * @return static|null Concatenated name - */ - public static function concat($name1, $name2, array $attributes = []) { - if (null === $name1 && null === $name2) { - return null; - } - if (null === $name1) { - return new static($name2, $attributes); - } - if (null === $name2) { - return new static($name1, $attributes); - } else { - return new static( - self::prepareName($name1) . '\\' . self::prepareName($name2), $attributes - ); - } - } - - /** - * Prepares a (string, array or Name node) name for use in name changing methods by converting - * it to a string. - * - * @param string|string[]|self $name Name to prepare - * - * @return string Prepared name - */ - private static function prepareName($name): string { - if (\is_string($name)) { - if ('' === $name) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return $name; - } - if (\is_array($name)) { - if (empty($name)) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return implode('\\', $name); - } - if ($name instanceof self) { - return $name->name; - } - - throw new \InvalidArgumentException( - 'Expected string, array of parts or Name instance' - ); - } - - public function getType(): string { - return 'Name'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php deleted file mode 100644 index 2118378..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +++ /dev/null @@ -1,49 +0,0 @@ -toString(); - } - - public function getType(): string { - return 'Name_FullyQualified'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php deleted file mode 100644 index 0226a4e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +++ /dev/null @@ -1,49 +0,0 @@ -toString(); - } - - public function getType(): string { - return 'Name_Relative'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php deleted file mode 100644 index b99acd1..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node $type, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - } - - public function getSubNodeNames(): array { - return ['type']; - } - - public function getType(): string { - return 'NullableType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php deleted file mode 100644 index 0e9ff0e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ /dev/null @@ -1,84 +0,0 @@ - $attributes Additional attributes - * @param int $flags Optional visibility flags - * @param list $attrGroups PHP attribute groups - */ - public function __construct( - Expr $var, ?Expr $default = null, ?Node $type = null, - bool $byRef = false, bool $variadic = false, - array $attributes = [], - int $flags = 0, - array $attrGroups = [] - ) { - $this->attributes = $attributes; - $this->type = $type; - $this->byRef = $byRef; - $this->variadic = $variadic; - $this->var = $var; - $this->default = $default; - $this->flags = $flags; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; - } - - public function getType(): string { - return 'Param'; - } - - /** - * Whether this parameter uses constructor property promotion. - */ - public function isPromoted(): bool { - return $this->flags !== 0; - } - - public function isPublic(): bool { - return (bool) ($this->flags & Modifiers::PUBLIC); - } - - public function isProtected(): bool { - return (bool) ($this->flags & Modifiers::PROTECTED); - } - - public function isPrivate(): bool { - return (bool) ($this->flags & Modifiers::PRIVATE); - } - - public function isReadonly(): bool { - return (bool) ($this->flags & Modifiers::READONLY); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php deleted file mode 100644 index 101611e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +++ /dev/null @@ -1,37 +0,0 @@ - $attributes Additional attributes - */ - public function __construct($name, ?Node\Expr $default = null, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; - $this->default = $default; - } - - public function getSubNodeNames(): array { - return ['name', 'default']; - } - - public function getType(): string { - return 'PropertyItem'; - } -} - -// @deprecated compatibility alias -class_alias(PropertyItem::class, Stmt\PropertyProperty::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php deleted file mode 100644 index 3df2572..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +++ /dev/null @@ -1,6 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(float $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['value']; - } - - /** - * @param mixed[] $attributes - */ - public static function fromString(string $str, array $attributes = []): Float_ { - $attributes['rawValue'] = $str; - $float = self::parse($str); - - return new Float_($float, $attributes); - } - - /** - * @internal - * - * Parses a DNUMBER token like PHP would. - * - * @param string $str A string number - * - * @return float The parsed number - */ - public static function parse(string $str): float { - $str = str_replace('_', '', $str); - - // Check whether this is one of the special integer notations. - if ('0' === $str[0]) { - // hex - if ('x' === $str[1] || 'X' === $str[1]) { - return hexdec($str); - } - - // bin - if ('b' === $str[1] || 'B' === $str[1]) { - return bindec($str); - } - - // oct, but only if the string does not contain any of '.eE'. - if (false === strpbrk($str, '.eE')) { - // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit - // (8 or 9) so that only the digits before that are used. - return octdec(substr($str, 0, strcspn($str, '89'))); - } - } - - // dec - return (float) $str; - } - - public function getType(): string { - return 'Scalar_Float'; - } -} - -// @deprecated compatibility alias -class_alias(Float_::class, DNumber::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php deleted file mode 100644 index bcc257a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +++ /dev/null @@ -1,82 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(int $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['value']; - } - - /** - * Constructs an Int node from a string number literal. - * - * @param string $str String number literal (decimal, octal, hex or binary) - * @param array $attributes Additional attributes - * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) - * - * @return Int_ The constructed LNumber, including kind attribute - */ - public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false): Int_ { - $attributes['rawValue'] = $str; - - $str = str_replace('_', '', $str); - - if ('0' !== $str[0] || '0' === $str) { - $attributes['kind'] = Int_::KIND_DEC; - return new Int_((int) $str, $attributes); - } - - if ('x' === $str[1] || 'X' === $str[1]) { - $attributes['kind'] = Int_::KIND_HEX; - return new Int_(hexdec($str), $attributes); - } - - if ('b' === $str[1] || 'B' === $str[1]) { - $attributes['kind'] = Int_::KIND_BIN; - return new Int_(bindec($str), $attributes); - } - - if (!$allowInvalidOctal && strpbrk($str, '89')) { - throw new Error('Invalid numeric literal', $attributes); - } - - // Strip optional explicit octal prefix. - if ('o' === $str[1] || 'O' === $str[1]) { - $str = substr($str, 2); - } - - // use intval instead of octdec to get proper cutting behavior with malformed numbers - $attributes['kind'] = Int_::KIND_OCT; - return new Int_(intval($str, 8), $attributes); - } - - public function getType(): string { - return 'Scalar_Int'; - } -} - -// @deprecated compatibility alias -class_alias(Int_::class, LNumber::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php deleted file mode 100644 index 9336dfe..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +++ /dev/null @@ -1,34 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $parts, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames(): array { - return ['parts']; - } - - public function getType(): string { - return 'Scalar_InterpolatedString'; - } -} - -// @deprecated compatibility alias -class_alias(InterpolatedString::class, Encapsed::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php deleted file mode 100644 index cfe8c8c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getSubNodeNames(): array { - return []; - } - - /** - * Get name of magic constant. - * - * @return string Name of magic constant - */ - abstract public function getName(): string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php deleted file mode 100644 index 732ed14..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +++ /dev/null @@ -1,15 +0,0 @@ - Escaped character to its decoded value */ - protected static array $replacements = [ - '\\' => '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Constructs a string scalar node. - * - * @param string $value Value of the string - * @param array $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['value']; - } - - /** - * @param array $attributes - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - */ - public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self { - $attributes['kind'] = ($str[0] === "'" || ($str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B'))) - ? Scalar\String_::KIND_SINGLE_QUOTED - : Scalar\String_::KIND_DOUBLE_QUOTED; - - $attributes['rawValue'] = $str; - - $string = self::parse($str, $parseUnicodeEscape); - - return new self($string, $attributes); - } - - /** - * @internal - * - * Parses a string token. - * - * @param string $str String token content - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string The parsed string - */ - public static function parse(string $str, bool $parseUnicodeEscape = true): string { - $bLength = 0; - if ('b' === $str[0] || 'B' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences( - substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape - ); - } - } - - /** - * @internal - * - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param null|string $quote Quote type - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string String with escape sequences parsed - */ - public static function parseEscapeSequences(string $str, ?string $quote, bool $parseUnicodeEscape = true): string { - if (null !== $quote) { - $str = str_replace('\\' . $quote, $quote, $str); - } - - $extra = ''; - if ($parseUnicodeEscape) { - $extra = '|u\{([0-9a-fA-F]+)\}'; - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', - function ($matches) { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } - if ('x' === $str[0] || 'X' === $str[0]) { - return chr(hexdec(substr($str, 1))); - } - if ('u' === $str[0]) { - $dec = hexdec($matches[2]); - // If it overflowed to float, treat as INT_MAX, it will throw an error anyway. - return self::codePointToUtf8(\is_int($dec) ? $dec : \PHP_INT_MAX); - } else { - return chr(octdec($str)); - } - }, - $str - ); - } - - /** - * Converts a Unicode code point to its UTF-8 encoded representation. - * - * @param int $num Code point - * - * @return string UTF-8 representation of code point - */ - private static function codePointToUtf8(int $num): string { - if ($num <= 0x7F) { - return chr($num); - } - if ($num <= 0x7FF) { - return chr(($num >> 6) + 0xC0) . chr(($num & 0x3F) + 0x80); - } - if ($num <= 0xFFFF) { - return chr(($num >> 12) + 0xE0) . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); - } - if ($num <= 0x1FFFFF) { - return chr(($num >> 18) + 0xF0) . chr((($num >> 12) & 0x3F) + 0x80) - . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); - } - throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); - } - - public function getType(): string { - return 'Scalar_String'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php deleted file mode 100644 index 517c0ed..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +++ /dev/null @@ -1,39 +0,0 @@ - $attributes Additional attributes - */ - public function __construct( - Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] - ) { - $this->attributes = $attributes; - $this->var = $var; - $this->default = $default; - } - - public function getSubNodeNames(): array { - return ['var', 'default']; - } - - public function getType(): string { - return 'StaticVar'; - } -} - -// @deprecated compatibility alias -class_alias(StaticVar::class, Stmt\StaticVar::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php deleted file mode 100644 index 481d31a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +++ /dev/null @@ -1,8 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $stmts, array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - } - - public function getType(): string { - return 'Stmt_Block'; - } - - public function getSubNodeNames(): array { - return ['stmts']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php deleted file mode 100644 index d2bcc5e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Expr $num = null, array $attributes = []) { - $this->attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames(): array { - return ['num']; - } - - public function getType(): string { - return 'Stmt_Break'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php deleted file mode 100644 index a06ca18..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['cond', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Case'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php deleted file mode 100644 index e8d39c9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +++ /dev/null @@ -1,40 +0,0 @@ - $attributes Additional attributes - */ - public function __construct( - array $types, ?Expr\Variable $var = null, array $stmts = [], array $attributes = [] - ) { - $this->attributes = $attributes; - $this->types = $types; - $this->var = $var; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['types', 'var', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Catch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php deleted file mode 100644 index 9bdce1f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ /dev/null @@ -1,77 +0,0 @@ - $attributes Additional attributes - * @param list $attrGroups PHP attribute groups - * @param null|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration - */ - public function __construct( - array $consts, - int $flags = 0, - array $attributes = [], - array $attrGroups = [], - ?Node $type = null - ) { - $this->attributes = $attributes; - $this->flags = $flags; - $this->consts = $consts; - $this->attrGroups = $attrGroups; - $this->type = $type; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'type', 'consts']; - } - - /** - * Whether constant is explicitly or implicitly public. - */ - public function isPublic(): bool { - return ($this->flags & Modifiers::PUBLIC) !== 0 - || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; - } - - /** - * Whether constant is protected. - */ - public function isProtected(): bool { - return (bool) ($this->flags & Modifiers::PROTECTED); - } - - /** - * Whether constant is private. - */ - public function isPrivate(): bool { - return (bool) ($this->flags & Modifiers::PRIVATE); - } - - /** - * Whether constant is final. - */ - public function isFinal(): bool { - return (bool) ($this->flags & Modifiers::FINAL); - } - - public function getType(): string { - return 'Stmt_ClassConst'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php deleted file mode 100644 index fb9ba4f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +++ /dev/null @@ -1,109 +0,0 @@ -stmts as $stmt) { - if ($stmt instanceof TraitUse) { - $traitUses[] = $stmt; - } - } - return $traitUses; - } - - /** - * @return ClassConst[] - */ - public function getConstants(): array { - $constants = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassConst) { - $constants[] = $stmt; - } - } - return $constants; - } - - /** - * @return Property[] - */ - public function getProperties(): array { - $properties = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - $properties[] = $stmt; - } - } - return $properties; - } - - /** - * Gets property with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the property - * - * @return Property|null Property node or null if the property does not exist - */ - public function getProperty(string $name): ?Property { - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - foreach ($stmt->props as $prop) { - if ($prop instanceof PropertyItem && $name === $prop->name->toString()) { - return $stmt; - } - } - } - } - return null; - } - - /** - * Gets all methods defined directly in this class/interface/trait - * - * @return ClassMethod[] - */ - public function getMethods(): array { - $methods = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod) { - $methods[] = $stmt; - } - } - return $methods; - } - - /** - * Gets method with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the method (compared case-insensitively) - * - * @return ClassMethod|null Method node or null if the method does not exist - */ - public function getMethod(string $name): ?ClassMethod { - $lowerName = strtolower($name); - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) { - return $stmt; - } - } - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php deleted file mode 100644 index 59c0519..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +++ /dev/null @@ -1,154 +0,0 @@ - */ - private static array $magicNames = [ - '__construct' => true, - '__destruct' => true, - '__call' => true, - '__callstatic' => true, - '__get' => true, - '__set' => true, - '__isset' => true, - '__unset' => true, - '__sleep' => true, - '__wakeup' => true, - '__tostring' => true, - '__set_state' => true, - '__clone' => true, - '__invoke' => true, - '__debuginfo' => true, - '__serialize' => true, - '__unserialize' => true, - ]; - - /** - * Constructs a class method node. - * - * @param string|Node\Identifier $name Name - * @param array{ - * flags?: int, - * byRef?: bool, - * params?: Node\Param[], - * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, - * stmts?: Node\Stmt[]|null, - * attrGroups?: Node\AttributeGroup[], - * } $subNodes Array of the following optional subnodes: - * 'flags => 0 : Flags - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $this->returnType = $subNodes['returnType'] ?? null; - $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef(): bool { - return $this->byRef; - } - - public function getParams(): array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getStmts(): ?array { - return $this->stmts; - } - - public function getAttrGroups(): array { - return $this->attrGroups; - } - - /** - * Whether the method is explicitly or implicitly public. - */ - public function isPublic(): bool { - return ($this->flags & Modifiers::PUBLIC) !== 0 - || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; - } - - /** - * Whether the method is protected. - */ - public function isProtected(): bool { - return (bool) ($this->flags & Modifiers::PROTECTED); - } - - /** - * Whether the method is private. - */ - public function isPrivate(): bool { - return (bool) ($this->flags & Modifiers::PRIVATE); - } - - /** - * Whether the method is abstract. - */ - public function isAbstract(): bool { - return (bool) ($this->flags & Modifiers::ABSTRACT); - } - - /** - * Whether the method is final. - */ - public function isFinal(): bool { - return (bool) ($this->flags & Modifiers::FINAL); - } - - /** - * Whether the method is static. - */ - public function isStatic(): bool { - return (bool) ($this->flags & Modifiers::STATIC); - } - - /** - * Whether the method is magic. - */ - public function isMagic(): bool { - return isset(self::$magicNames[$this->name->toLowerString()]); - } - - public function getType(): string { - return 'Stmt_ClassMethod'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php deleted file mode 100644 index 3f492b7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +++ /dev/null @@ -1,94 +0,0 @@ - 0 : Flags - * 'extends' => null : Name of extended class - * 'implements' => array(): Names of implemented interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; - } - - /** - * Whether the class is explicitly abstract. - */ - public function isAbstract(): bool { - return (bool) ($this->flags & Modifiers::ABSTRACT); - } - - /** - * Whether the class is final. - */ - public function isFinal(): bool { - return (bool) ($this->flags & Modifiers::FINAL); - } - - public function isReadonly(): bool { - return (bool) ($this->flags & Modifiers::READONLY); - } - - /** - * Whether the class is anonymous. - */ - public function isAnonymous(): bool { - return null === $this->name; - } - - public function getType(): string { - return 'Stmt_Class'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php deleted file mode 100644 index f1165fd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $consts, array $attributes = []) { - $this->attributes = $attributes; - $this->consts = $consts; - } - - public function getSubNodeNames(): array { - return ['consts']; - } - - public function getType(): string { - return 'Stmt_Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php deleted file mode 100644 index 54e979d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Expr $num = null, array $attributes = []) { - $this->attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames(): array { - return ['num']; - } - - public function getType(): string { - return 'Stmt_Continue'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php deleted file mode 100644 index cb9e837..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $declares, ?array $stmts = null, array $attributes = []) { - $this->attributes = $attributes; - $this->declares = $declares; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['declares', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Declare'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php deleted file mode 100644 index 6124442..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['stmts', 'cond']; - } - - public function getType(): string { - return 'Stmt_Do'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php deleted file mode 100644 index 4d42452..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $exprs, array $attributes = []) { - $this->attributes = $attributes; - $this->exprs = $exprs; - } - - public function getSubNodeNames(): array { - return ['exprs']; - } - - public function getType(): string { - return 'Stmt_Echo'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php deleted file mode 100644 index b26d59c..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['cond', 'stmts']; - } - - public function getType(): string { - return 'Stmt_ElseIf'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php deleted file mode 100644 index 3d2b066..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['stmts']; - } - - public function getType(): string { - return 'Stmt_Else'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php deleted file mode 100644 index c071a0a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +++ /dev/null @@ -1,36 +0,0 @@ - $attrGroups PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { - parent::__construct($attributes); - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->expr = $expr; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'name', 'expr']; - } - - public function getType(): string { - return 'Stmt_EnumCase'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php deleted file mode 100644 index 7eea6a6..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +++ /dev/null @@ -1,44 +0,0 @@ - null : Scalar type - * 'implements' => array() : Names of implemented interfaces - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->scalarType = $subNodes['scalarType'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - - parent::__construct($attributes); - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Enum'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php deleted file mode 100644 index 89751fa..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +++ /dev/null @@ -1,32 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Stmt_Expression'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php deleted file mode 100644 index 69ecf25..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['stmts']; - } - - public function getType(): string { - return 'Stmt_Finally'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php deleted file mode 100644 index 6f2fbb9..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +++ /dev/null @@ -1,47 +0,0 @@ - array(): Init expressions - * 'cond' => array(): Loop conditions - * 'loop' => array(): Loop expressions - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->init = $subNodes['init'] ?? []; - $this->cond = $subNodes['cond'] ?? []; - $this->loop = $subNodes['loop'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames(): array { - return ['init', 'cond', 'loop', 'stmts']; - } - - public function getType(): string { - return 'Stmt_For'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php deleted file mode 100644 index c5d9a8b..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +++ /dev/null @@ -1,50 +0,0 @@ - null : Variable to assign key to - * 'byRef' => false : Whether to assign value by reference - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->keyVar = $subNodes['keyVar'] ?? null; - $this->byRef = $subNodes['byRef'] ?? false; - $this->valueVar = $valueVar; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames(): array { - return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Foreach'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php deleted file mode 100644 index 2111bab..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +++ /dev/null @@ -1,81 +0,0 @@ - false : Whether to return by reference - * 'params' => array(): Parameters - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $this->returnType = $subNodes['returnType'] ?? null; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef(): bool { - return $this->byRef; - } - - public function getParams(): array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups(): array { - return $this->attrGroups; - } - - /** @return Node\Stmt[] */ - public function getStmts(): array { - return $this->stmts; - } - - public function getType(): string { - return 'Stmt_Function'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php deleted file mode 100644 index d3ab12f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames(): array { - return ['vars']; - } - - public function getType(): string { - return 'Stmt_Global'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php deleted file mode 100644 index 26a0d01..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +++ /dev/null @@ -1,30 +0,0 @@ - $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['name']; - } - - public function getType(): string { - return 'Stmt_Goto'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php deleted file mode 100644 index 0ec8e9d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +++ /dev/null @@ -1,41 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->prefix = $prefix; - $this->uses = $uses; - } - - public function getSubNodeNames(): array { - return ['type', 'prefix', 'uses']; - } - - public function getType(): string { - return 'Stmt_GroupUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php deleted file mode 100644 index 665bacd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(string $remaining, array $attributes = []) { - $this->attributes = $attributes; - $this->remaining = $remaining; - } - - public function getSubNodeNames(): array { - return ['remaining']; - } - - public function getType(): string { - return 'Stmt_HaltCompiler'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php deleted file mode 100644 index 544390f..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +++ /dev/null @@ -1,46 +0,0 @@ - array(): Statements - * 'elseifs' => array(): Elseif clauses - * 'else' => null : Else clause - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $subNodes['stmts'] ?? []; - $this->elseifs = $subNodes['elseifs'] ?? []; - $this->else = $subNodes['else'] ?? null; - } - - public function getSubNodeNames(): array { - return ['cond', 'stmts', 'elseifs', 'else']; - } - - public function getType(): string { - return 'Stmt_If'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php deleted file mode 100644 index 0515d02..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames(): array { - return ['value']; - } - - public function getType(): string { - return 'Stmt_InlineHTML'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php deleted file mode 100644 index 9359064..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +++ /dev/null @@ -1,40 +0,0 @@ - array(): Name of extended interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'name', 'extends', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Interface'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php deleted file mode 100644 index 658468d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +++ /dev/null @@ -1,30 +0,0 @@ - $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames(): array { - return ['name']; - } - - public function getType(): string { - return 'Stmt_Label'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php deleted file mode 100644 index f5b59ad..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +++ /dev/null @@ -1,37 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Name $name = null, ?array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['name', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Namespace'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php deleted file mode 100644 index 3acfa46..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +++ /dev/null @@ -1,16 +0,0 @@ - $attributes Additional attributes - * @param null|Identifier|Name|ComplexType $type Type declaration - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups - */ - public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = []) { - $this->attributes = $attributes; - $this->flags = $flags; - $this->props = $props; - $this->type = $type; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'flags', 'type', 'props']; - } - - /** - * Whether the property is explicitly or implicitly public. - */ - public function isPublic(): bool { - return ($this->flags & Modifiers::PUBLIC) !== 0 - || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; - } - - /** - * Whether the property is protected. - */ - public function isProtected(): bool { - return (bool) ($this->flags & Modifiers::PROTECTED); - } - - /** - * Whether the property is private. - */ - public function isPrivate(): bool { - return (bool) ($this->flags & Modifiers::PRIVATE); - } - - /** - * Whether the property is static. - */ - public function isStatic(): bool { - return (bool) ($this->flags & Modifiers::STATIC); - } - - /** - * Whether the property is readonly. - */ - public function isReadonly(): bool { - return (bool) ($this->flags & Modifiers::READONLY); - } - - public function getType(): string { - return 'Stmt_Property'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php deleted file mode 100644 index 4a21a88..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Expr $expr = null, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames(): array { - return ['expr']; - } - - public function getType(): string { - return 'Stmt_Return'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php deleted file mode 100644 index 88452e7..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames(): array { - return ['vars']; - } - - public function getType(): string { - return 'Stmt_Static'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php deleted file mode 100644 index 21e5efa..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $cases, array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->cases = $cases; - } - - public function getSubNodeNames(): array { - return ['cond', 'cases']; - } - - public function getType(): string { - return 'Stmt_Switch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php deleted file mode 100644 index 7705a57..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $traits, array $adaptations = [], array $attributes = []) { - $this->attributes = $attributes; - $this->traits = $traits; - $this->adaptations = $adaptations; - } - - public function getSubNodeNames(): array { - return ['traits', 'adaptations']; - } - - public function getType(): string { - return 'Stmt_TraitUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php deleted file mode 100644 index 987bc88..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +++ /dev/null @@ -1,12 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(?Node\Name $trait, $method, ?int $newModifier, $newName, array $attributes = []) { - $this->attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->newModifier = $newModifier; - $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; - } - - public function getSubNodeNames(): array { - return ['trait', 'method', 'newModifier', 'newName']; - } - - public function getType(): string { - return 'Stmt_TraitUseAdaptation_Alias'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php deleted file mode 100644 index 7bc4083..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = []) { - $this->attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->insteadof = $insteadof; - } - - public function getSubNodeNames(): array { - return ['trait', 'method', 'insteadof']; - } - - public function getType(): string { - return 'Stmt_TraitUseAdaptation_Precedence'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php deleted file mode 100644 index 5f2b330..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +++ /dev/null @@ -1,34 +0,0 @@ - array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames(): array { - return ['attrGroups', 'name', 'stmts']; - } - - public function getType(): string { - return 'Stmt_Trait'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php deleted file mode 100644 index 6414c46..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ /dev/null @@ -1,37 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - $this->catches = $catches; - $this->finally = $finally; - } - - public function getSubNodeNames(): array { - return ['stmts', 'catches', 'finally']; - } - - public function getType(): string { - return 'Stmt_TryCatch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php deleted file mode 100644 index c211beb..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +++ /dev/null @@ -1,29 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames(): array { - return ['vars']; - } - - public function getType(): string { - return 'Stmt_Unset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php deleted file mode 100644 index 85830ed..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +++ /dev/null @@ -1,3 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->uses = $uses; - } - - public function getSubNodeNames(): array { - return ['type', 'uses']; - } - - public function getType(): string { - return 'Stmt_Use'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php deleted file mode 100644 index 2f7aed2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +++ /dev/null @@ -1,33 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames(): array { - return ['cond', 'stmts']; - } - - public function getType(): string { - return 'Stmt_While'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php deleted file mode 100644 index bad88d2..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +++ /dev/null @@ -1,27 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $types, array $attributes = []) { - $this->attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames(): array { - return ['types']; - } - - public function getType(): string { - return 'UnionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php deleted file mode 100644 index a7d9fc4..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php +++ /dev/null @@ -1,55 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->name = $name; - $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; - } - - public function getSubNodeNames(): array { - return ['type', 'name', 'alias']; - } - - /** - * Get alias. If not explicitly given this is the last component of the used name. - */ - public function getAlias(): Identifier { - if (null !== $this->alias) { - return $this->alias; - } - - return new Identifier($this->name->getLast()); - } - - public function getType(): string { - return 'UseItem'; - } -} - -// @deprecated compatibility alias -class_alias(UseItem::class, Stmt\UseUse::class); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php b/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php deleted file mode 100644 index 9baa6fe..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +++ /dev/null @@ -1,16 +0,0 @@ - $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getType(): string { - return 'VariadicPlaceholder'; - } - - public function getSubNodeNames(): array { - return []; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php deleted file mode 100644 index 7c3a360..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +++ /dev/null @@ -1,178 +0,0 @@ - Attributes */ - protected array $attributes; - - /** - * Creates a Node. - * - * @param array $attributes Array of attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - /** - * Gets line the node started in (alias of getStartLine). - * - * @return int Start line (or -1 if not available) - */ - public function getLine(): int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets line the node started in. - * - * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int Start line (or -1 if not available) - */ - public function getStartLine(): int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the node ended in. - * - * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int End line (or -1 if not available) - */ - public function getEndLine(): int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the token offset of the first token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token start position (or -1 if not available) - */ - public function getStartTokenPos(): int { - return $this->attributes['startTokenPos'] ?? -1; - } - - /** - * Gets the token offset of the last token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token end position (or -1 if not available) - */ - public function getEndTokenPos(): int { - return $this->attributes['endTokenPos'] ?? -1; - } - - /** - * Gets the file offset of the first character that is part of this node. - * - * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File start position (or -1 if not available) - */ - public function getStartFilePos(): int { - return $this->attributes['startFilePos'] ?? -1; - } - - /** - * Gets the file offset of the last character that is part of this node. - * - * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File end position (or -1 if not available) - */ - public function getEndFilePos(): int { - return $this->attributes['endFilePos'] ?? -1; - } - - /** - * Gets all comments directly preceding this node. - * - * The comments are also available through the "comments" attribute. - * - * @return Comment[] - */ - public function getComments(): array { - return $this->attributes['comments'] ?? []; - } - - /** - * Gets the doc comment of the node. - * - * @return null|Comment\Doc Doc comment object or null - */ - public function getDocComment(): ?Comment\Doc { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - $comment = $comments[$i]; - if ($comment instanceof Comment\Doc) { - return $comment; - } - } - - return null; - } - - /** - * Sets the doc comment of the node. - * - * This will either replace an existing doc comment or add it to the comments array. - * - * @param Comment\Doc $docComment Doc comment to set - */ - public function setDocComment(Comment\Doc $docComment): void { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - if ($comments[$i] instanceof Comment\Doc) { - // Replace existing doc comment. - $comments[$i] = $docComment; - $this->setAttribute('comments', $comments); - return; - } - } - - // Append new doc comment. - $comments[] = $docComment; - $this->setAttribute('comments', $comments); - } - - public function setAttribute(string $key, $value): void { - $this->attributes[$key] = $value; - } - - public function hasAttribute(string $key): bool { - return array_key_exists($key, $this->attributes); - } - - public function getAttribute(string $key, $default = null) { - if (array_key_exists($key, $this->attributes)) { - return $this->attributes[$key]; - } - - return $default; - } - - public function getAttributes(): array { - return $this->attributes; - } - - public function setAttributes(array $attributes): void { - $this->attributes = $attributes; - } - - /** - * @return array - */ - public function jsonSerialize(): array { - return ['nodeType' => $this->getType()] + get_object_vars($this); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php deleted file mode 100644 index a2535de..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ /dev/null @@ -1,290 +0,0 @@ - true, - 'startLine' => true, - 'endLine' => true, - 'startFilePos' => true, - 'endFilePos' => true, - 'startTokenPos' => true, - 'endTokenPos' => true, - ]; - - /** - * Constructs a NodeDumper. - * - * Supported options: - * * bool dumpComments: Whether comments should be dumped. - * * bool dumpPositions: Whether line/offset information should be dumped. To dump offset - * information, the code needs to be passed to dump(). - * * bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped. - * - * @param array $options Options (see description) - */ - public function __construct(array $options = []) { - $this->dumpComments = !empty($options['dumpComments']); - $this->dumpPositions = !empty($options['dumpPositions']); - $this->dumpOtherAttributes = !empty($options['dumpOtherAttributes']); - } - - /** - * Dumps a node or array. - * - * @param array|Node $node Node or array to dump - * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if - * the dumpPositions option is enabled and the dumping of node offsets - * is desired. - * - * @return string Dumped value - */ - public function dump($node, ?string $code = null): string { - $this->code = $code; - $this->res = ''; - $this->nl = "\n"; - $this->dumpRecursive($node, false); - return $this->res; - } - - /** @param mixed $node */ - protected function dumpRecursive($node, bool $indent = true): void { - if ($indent) { - $this->nl .= " "; - } - if ($node instanceof Node) { - $this->res .= $node->getType(); - if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) { - $this->res .= $p; - } - $this->res .= '('; - - foreach ($node->getSubNodeNames() as $key) { - $this->res .= "$this->nl " . $key . ': '; - - $value = $node->$key; - if (\is_int($value)) { - if ('flags' === $key || 'newModifier' === $key) { - $this->res .= $this->dumpFlags($value); - continue; - } - if ('type' === $key && $node instanceof Include_) { - $this->res .= $this->dumpIncludeType($value); - continue; - } - if ('type' === $key - && ($node instanceof Use_ || $node instanceof UseItem || $node instanceof GroupUse)) { - $this->res .= $this->dumpUseType($value); - continue; - } - } - $this->dumpRecursive($value); - } - - if ($this->dumpComments && $comments = $node->getComments()) { - $this->res .= "$this->nl comments: "; - $this->dumpRecursive($comments); - } - - if ($this->dumpOtherAttributes) { - foreach ($node->getAttributes() as $key => $value) { - if (isset(self::IGNORE_ATTRIBUTES[$key])) { - continue; - } - - $this->res .= "$this->nl $key: "; - if (\is_int($value)) { - if ('kind' === $key) { - if ($node instanceof Int_) { - $this->res .= $this->dumpIntKind($value); - continue; - } - if ($node instanceof String_ || $node instanceof InterpolatedString) { - $this->res .= $this->dumpStringKind($value); - continue; - } - if ($node instanceof Array_) { - $this->res .= $this->dumpArrayKind($value); - continue; - } - if ($node instanceof List_) { - $this->res .= $this->dumpListKind($value); - continue; - } - } - } - $this->dumpRecursive($value); - } - } - $this->res .= "$this->nl)"; - } elseif (\is_array($node)) { - $this->res .= 'array('; - foreach ($node as $key => $value) { - $this->res .= "$this->nl " . $key . ': '; - $this->dumpRecursive($value); - } - $this->res .= "$this->nl)"; - } elseif ($node instanceof Comment) { - $this->res .= \str_replace("\n", $this->nl, $node->getReformattedText()); - } elseif (\is_string($node)) { - $this->res .= \str_replace("\n", $this->nl, (string)$node); - } elseif (\is_int($node) || \is_float($node)) { - $this->res .= $node; - } elseif (null === $node) { - $this->res .= 'null'; - } elseif (false === $node) { - $this->res .= 'false'; - } elseif (true === $node) { - $this->res .= 'true'; - } else { - throw new \InvalidArgumentException('Can only dump nodes and arrays.'); - } - if ($indent) { - $this->nl = \substr($this->nl, 0, -4); - } - } - - protected function dumpFlags(int $flags): string { - $strs = []; - if ($flags & Modifiers::PUBLIC) { - $strs[] = 'PUBLIC'; - } - if ($flags & Modifiers::PROTECTED) { - $strs[] = 'PROTECTED'; - } - if ($flags & Modifiers::PRIVATE) { - $strs[] = 'PRIVATE'; - } - if ($flags & Modifiers::ABSTRACT) { - $strs[] = 'ABSTRACT'; - } - if ($flags & Modifiers::STATIC) { - $strs[] = 'STATIC'; - } - if ($flags & Modifiers::FINAL) { - $strs[] = 'FINAL'; - } - if ($flags & Modifiers::READONLY) { - $strs[] = 'READONLY'; - } - - if ($strs) { - return implode(' | ', $strs) . ' (' . $flags . ')'; - } else { - return (string) $flags; - } - } - - /** @param array $map */ - private function dumpEnum(int $value, array $map): string { - if (!isset($map[$value])) { - return (string) $value; - } - return $map[$value] . ' (' . $value . ')'; - } - - private function dumpIncludeType(int $type): string { - return $this->dumpEnum($type, [ - Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', - Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', - Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', - Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE', - ]); - } - - private function dumpUseType(int $type): string { - return $this->dumpEnum($type, [ - Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', - Use_::TYPE_NORMAL => 'TYPE_NORMAL', - Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', - Use_::TYPE_CONSTANT => 'TYPE_CONSTANT', - ]); - } - - private function dumpIntKind(int $kind): string { - return $this->dumpEnum($kind, [ - Int_::KIND_BIN => 'KIND_BIN', - Int_::KIND_OCT => 'KIND_OCT', - Int_::KIND_DEC => 'KIND_DEC', - Int_::KIND_HEX => 'KIND_HEX', - ]); - } - - private function dumpStringKind(int $kind): string { - return $this->dumpEnum($kind, [ - String_::KIND_SINGLE_QUOTED => 'KIND_SINGLE_QUOTED', - String_::KIND_DOUBLE_QUOTED => 'KIND_DOUBLE_QUOTED', - String_::KIND_HEREDOC => 'KIND_HEREDOC', - String_::KIND_NOWDOC => 'KIND_NOWDOC', - ]); - } - - private function dumpArrayKind(int $kind): string { - return $this->dumpEnum($kind, [ - Array_::KIND_LONG => 'KIND_LONG', - Array_::KIND_SHORT => 'KIND_SHORT', - ]); - } - - private function dumpListKind(int $kind): string { - return $this->dumpEnum($kind, [ - List_::KIND_LIST => 'KIND_LIST', - List_::KIND_ARRAY => 'KIND_ARRAY', - ]); - } - - /** - * Dump node position, if possible. - * - * @param Node $node Node for which to dump position - * - * @return string|null Dump of position, or null if position information not available - */ - protected function dumpPosition(Node $node): ?string { - if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) { - return null; - } - - $start = $node->getStartLine(); - $end = $node->getEndLine(); - if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos') - && null !== $this->code - ) { - $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos()); - $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos()); - } - return "[$start - $end]"; - } - - // Copied from Error class - private function toColumn(string $code, int $pos): int { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php b/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php deleted file mode 100644 index 96c8452..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +++ /dev/null @@ -1,90 +0,0 @@ -traverse($nodes); - - return $visitor->getFoundNodes(); - } - - /** - * Find all nodes that are instances of a certain class. - - * @template TNode as Node - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param class-string $class Class name - * - * @return TNode[] Found nodes (all instances of $class) - */ - public function findInstanceOf($nodes, string $class): array { - return $this->find($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } - - /** - * Find first node satisfying a filter callback. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool - * - * @return null|Node Found node (or null if none found) - */ - public function findFirst($nodes, callable $filter): ?Node { - if ($nodes === []) { - return null; - } - - if (!is_array($nodes)) { - $nodes = [$nodes]; - } - - $visitor = new FirstFindingVisitor($filter); - - $traverser = new NodeTraverser($visitor); - $traverser->traverse($nodes); - - return $visitor->getFoundNode(); - } - - /** - * Find first node that is an instance of a certain class. - * - * @template TNode as Node - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param class-string $class Class name - * - * @return null|TNode Found node, which is an instance of $class (or null if none found) - */ - public function findFirstInstanceOf($nodes, string $class): ?Node { - return $this->findFirst($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php deleted file mode 100644 index f5b868a..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +++ /dev/null @@ -1,278 +0,0 @@ - Visitors */ - protected array $visitors = []; - - /** @var bool Whether traversal should be stopped */ - protected bool $stopTraversal; - - /** - * Create a traverser with the given visitors. - * - * @param NodeVisitor ...$visitors Node visitors - */ - public function __construct(NodeVisitor ...$visitors) { - $this->visitors = $visitors; - } - - /** - * Adds a visitor. - * - * @param NodeVisitor $visitor Visitor to add - */ - public function addVisitor(NodeVisitor $visitor): void { - $this->visitors[] = $visitor; - } - - /** - * Removes an added visitor. - */ - public function removeVisitor(NodeVisitor $visitor): void { - $index = array_search($visitor, $this->visitors); - if ($index !== false) { - array_splice($this->visitors, $index, 1, []); - } - } - - /** - * Traverses an array of nodes using the registered visitors. - * - * @param Node[] $nodes Array of nodes - * - * @return Node[] Traversed array of nodes - */ - public function traverse(array $nodes): array { - $this->stopTraversal = false; - - foreach ($this->visitors as $visitor) { - if (null !== $return = $visitor->beforeTraverse($nodes)) { - $nodes = $return; - } - } - - $nodes = $this->traverseArray($nodes); - - for ($i = \count($this->visitors) - 1; $i >= 0; --$i) { - $visitor = $this->visitors[$i]; - if (null !== $return = $visitor->afterTraverse($nodes)) { - $nodes = $return; - } - } - - return $nodes; - } - - /** - * Recursively traverse a node. - * - * @param Node $node Node to traverse. - */ - protected function traverseNode(Node $node): void { - foreach ($node->getSubNodeNames() as $name) { - $subNode = $node->$name; - - if (\is_array($subNode)) { - $node->$name = $this->traverseArray($subNode); - if ($this->stopTraversal) { - break; - } - } elseif ($subNode instanceof Node) { - $traverseChildren = true; - $visitorIndex = -1; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($subNode); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $node->$name = $return; - } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - $node->$name = null; - continue 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $this->traverseNode($subNode); - if ($this->stopTraversal) { - break; - } - } - - for (; $visitorIndex >= 0; --$visitorIndex) { - $visitor = $this->visitors[$visitorIndex]; - $return = $visitor->leaveNode($subNode); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $node->$name = $return; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - $node->$name = null; - break; - } elseif (\is_array($return)) { - throw new \LogicException( - 'leaveNode() may only return an array ' . - 'if the parent structure is an array' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - } - } - } - - /** - * Recursively traverse array (usually of nodes). - * - * @param array $nodes Array to traverse - * - * @return array Result of traversal (may be original array or changed one) - */ - protected function traverseArray(array $nodes): array { - $doNodes = []; - - foreach ($nodes as $i => $node) { - if ($node instanceof Node) { - $traverseChildren = true; - $visitorIndex = -1; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($node); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $nodes[$i] = $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - continue 2; - } elseif (NodeVisitor::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - continue 2; - } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - throw new \LogicException( - 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $this->traverseNode($node); - if ($this->stopTraversal) { - break; - } - } - - for (; $visitorIndex >= 0; --$visitorIndex) { - $visitor = $this->visitors[$visitorIndex]; - $return = $visitor->leaveNode($node); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $nodes[$i] = $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - break; - } elseif (NodeVisitor::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - throw new \LogicException( - 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - } elseif (\is_array($node)) { - throw new \LogicException('Invalid node structure: Contains nested arrays'); - } - } - - if (!empty($doNodes)) { - while (list($i, $replace) = array_pop($doNodes)) { - array_splice($nodes, $i, 1, $replace); - } - } - - return $nodes; - } - - private function ensureReplacementReasonable(Node $old, Node $new): void { - if ($old instanceof Node\Stmt && $new instanceof Node\Expr) { - throw new \LogicException( - "Trying to replace statement ({$old->getType()}) " . - "with expression ({$new->getType()}). Are you missing a " . - "Stmt_Expression wrapper?" - ); - } - - if ($old instanceof Node\Expr && $new instanceof Node\Stmt) { - throw new \LogicException( - "Trying to replace expression ({$old->getType()}) " . - "with statement ({$new->getType()})" - ); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php deleted file mode 100644 index c3992b3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - $node stays as-is - * * array (of Nodes) - * => The return value is merged into the parent array (at the position of the $node) - * * NodeVisitor::REMOVE_NODE - * => $node is removed from the parent array - * * NodeVisitor::REPLACE_WITH_NULL - * => $node is replaced with null - * * NodeVisitor::DONT_TRAVERSE_CHILDREN - * => Children of $node are not traversed. $node stays as-is - * * NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN - * => Further visitors for the current node are skipped, and its children are not - * traversed. $node stays as-is. - * * NodeVisitor::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node|Node[] Replacement node (or special return value) - */ - public function enterNode(Node $node); - - /** - * Called when leaving a node. - * - * Return value semantics: - * * null - * => $node stays as-is - * * NodeVisitor::REMOVE_NODE - * => $node is removed from the parent array - * * NodeVisitor::REPLACE_WITH_NULL - * => $node is replaced with null - * * NodeVisitor::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * array (of Nodes) - * => The return value is merged into the parent array (at the position of the $node) - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node|Node[] Replacement node (or special return value) - */ - public function leaveNode(Node $node); - - /** - * Called once after traversal. - * - * Return value semantics: - * * null: $nodes stays as-is - * * otherwise: $nodes is set to the return value - * - * @param Node[] $nodes Array of nodes - * - * @return null|Node[] Array of nodes - */ - public function afterTraverse(array $nodes); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php deleted file mode 100644 index cba9249..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +++ /dev/null @@ -1,19 +0,0 @@ -setAttribute('origNode', $origNode); - return $node; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php deleted file mode 100644 index 5e2aed3..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +++ /dev/null @@ -1,82 +0,0 @@ - Token positions of comments */ - private array $commentPositions = []; - - /** - * Create a comment annotation visitor. - * - * @param Token[] $tokens Token array - */ - public function __construct(array $tokens) { - $this->tokens = $tokens; - - // Collect positions of comments. We use this to avoid traversing parts of the AST where - // there are no comments. - foreach ($tokens as $i => $token) { - if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { - $this->commentPositions[] = $i; - } - } - } - - public function enterNode(Node $node) { - $nextCommentPos = current($this->commentPositions); - if ($nextCommentPos === false) { - // No more comments. - return self::STOP_TRAVERSAL; - } - - $oldPos = $this->pos; - $this->pos = $pos = $node->getStartTokenPos(); - if ($nextCommentPos > $oldPos && $nextCommentPos < $pos) { - $comments = []; - while (--$pos >= $oldPos) { - $token = $this->tokens[$pos]; - if ($token->id === \T_DOC_COMMENT) { - $comments[] = new Comment\Doc( - $token->text, $token->line, $token->pos, $pos, - $token->getEndLine(), $token->getEndPos() - 1, $pos); - continue; - } - if ($token->id === \T_COMMENT) { - $comments[] = new Comment( - $token->text, $token->line, $token->pos, $pos, - $token->getEndLine(), $token->getEndPos() - 1, $pos); - continue; - } - if ($token->id !== \T_WHITESPACE) { - break; - } - } - if (!empty($comments)) { - $node->setAttribute('comments', array_reverse($comments)); - } - - do { - $nextCommentPos = next($this->commentPositions); - } while ($nextCommentPos !== false && $nextCommentPos < $this->pos); - } - - $endPos = $node->getEndTokenPos(); - if ($nextCommentPos > $endPos) { - // Skip children if there are no comments located inside this node. - $this->pos = $endPos; - return self::DONT_TRAVERSE_CHILDREN; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php deleted file mode 100644 index 1f3f4ba..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +++ /dev/null @@ -1,47 +0,0 @@ -filterCallback = $filterCallback; - } - - /** - * Get found nodes satisfying the filter callback. - * - * Nodes are returned in pre-order. - * - * @return Node[] Found nodes - */ - public function getFoundNodes(): array { - return $this->foundNodes; - } - - public function beforeTraverse(array $nodes): ?array { - $this->foundNodes = []; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNodes[] = $node; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php deleted file mode 100644 index 05deed5..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +++ /dev/null @@ -1,49 +0,0 @@ -filterCallback = $filterCallback; - } - - /** - * Get found node satisfying the filter callback. - * - * Returns null if no node satisfies the filter callback. - * - * @return null|Node Found node (or null if not found) - */ - public function getFoundNode(): ?Node { - return $this->foundNode; - } - - public function beforeTraverse(array $nodes): ?array { - $this->foundNode = null; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNode = $node; - return NodeVisitor::STOP_TRAVERSAL; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php deleted file mode 100644 index ccd014e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ /dev/null @@ -1,262 +0,0 @@ -nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing()); - $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; - $this->replaceNodes = $options['replaceNodes'] ?? true; - } - - /** - * Get name resolution context. - */ - public function getNameContext(): NameContext { - return $this->nameContext; - } - - public function beforeTraverse(array $nodes): ?array { - $this->nameContext->startNamespace(); - return null; - } - - public function enterNode(Node $node) { - if ($node instanceof Stmt\Namespace_) { - $this->nameContext->startNamespace($node->name); - } elseif ($node instanceof Stmt\Use_) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, null); - } - } elseif ($node instanceof Stmt\GroupUse) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, $node->prefix); - } - } elseif ($node instanceof Stmt\Class_) { - if (null !== $node->extends) { - $node->extends = $this->resolveClassName($node->extends); - } - - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } else { - $node->namespacedName = null; - } - } elseif ($node instanceof Stmt\Interface_) { - foreach ($node->extends as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Enum_) { - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Trait_) { - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Function_) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\ClassMethod - || $node instanceof Expr\Closure - || $node instanceof Expr\ArrowFunction - ) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Property) { - if (null !== $node->type) { - $node->type = $this->resolveType($node->type); - } - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Const_) { - foreach ($node->consts as $const) { - $this->addNamespacedName($const); - } - } elseif ($node instanceof Stmt\ClassConst) { - if (null !== $node->type) { - $node->type = $this->resolveType($node->type); - } - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\EnumCase) { - $this->resolveAttrGroups($node); - } elseif ($node instanceof Expr\StaticCall - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\ClassConstFetch - || $node instanceof Expr\New_ - || $node instanceof Expr\Instanceof_ - ) { - if ($node->class instanceof Name) { - $node->class = $this->resolveClassName($node->class); - } - } elseif ($node instanceof Stmt\Catch_) { - foreach ($node->types as &$type) { - $type = $this->resolveClassName($type); - } - } elseif ($node instanceof Expr\FuncCall) { - if ($node->name instanceof Name) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION); - } - } elseif ($node instanceof Expr\ConstFetch) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT); - } elseif ($node instanceof Stmt\TraitUse) { - foreach ($node->traits as &$trait) { - $trait = $this->resolveClassName($trait); - } - - foreach ($node->adaptations as $adaptation) { - if (null !== $adaptation->trait) { - $adaptation->trait = $this->resolveClassName($adaptation->trait); - } - - if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) { - foreach ($adaptation->insteadof as &$insteadof) { - $insteadof = $this->resolveClassName($insteadof); - } - } - } - } - - return null; - } - - /** @param Stmt\Use_::TYPE_* $type */ - private function addAlias(Node\UseItem $use, int $type, ?Name $prefix = null): void { - // Add prefix for group uses - $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; - // Type is determined either by individual element or whole use declaration - $type |= $use->type; - - $this->nameContext->addAlias( - $name, (string) $use->getAlias(), $type, $use->getAttributes() - ); - } - - /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure|Expr\ArrowFunction $node */ - private function resolveSignature($node): void { - foreach ($node->params as $param) { - $param->type = $this->resolveType($param->type); - $this->resolveAttrGroups($param); - } - $node->returnType = $this->resolveType($node->returnType); - } - - /** - * @template T of Node\Identifier|Name|Node\ComplexType|null - * @param T $node - * @return T - */ - private function resolveType(?Node $node): ?Node { - if ($node instanceof Name) { - return $this->resolveClassName($node); - } - if ($node instanceof Node\NullableType) { - $node->type = $this->resolveType($node->type); - return $node; - } - if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { - foreach ($node->types as &$type) { - $type = $this->resolveType($type); - } - return $node; - } - return $node; - } - - /** - * Resolve name, according to name resolver options. - * - * @param Name $name Function or constant name to resolve - * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* - * - * @return Name Resolved name, or original name with attribute - */ - protected function resolveName(Name $name, int $type): Name { - if (!$this->replaceNodes) { - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - $name->setAttribute('resolvedName', $resolvedName); - } else { - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - } - return $name; - } - - if ($this->preserveOriginalNames) { - // Save the original name - $originalName = $name; - $name = clone $originalName; - $name->setAttribute('originalName', $originalName); - } - - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - return $resolvedName; - } - - // unqualified names inside a namespace cannot be resolved at compile-time - // add the namespaced version of the name as an attribute - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - return $name; - } - - protected function resolveClassName(Name $name): Name { - return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL); - } - - protected function addNamespacedName(Node $node): void { - $node->namespacedName = Name::concat( - $this->nameContext->getNamespace(), (string) $node->name); - } - - protected function resolveAttrGroups(Node $node): void { - foreach ($node->attrGroups as $attrGroup) { - foreach ($attrGroup->attrs as $attr) { - $attr->name = $this->resolveClassName($attr->name); - } - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php deleted file mode 100644 index 38fedfd..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +++ /dev/null @@ -1,51 +0,0 @@ -$node->getAttribute('parent')
, the previous - * node can be accessed through $node->getAttribute('previous'), - * and the next node can be accessed through $node->getAttribute('next'). - */ -final class NodeConnectingVisitor extends NodeVisitorAbstract { - /** - * @var Node[] - */ - private array $stack = []; - - /** - * @var ?Node - */ - private $previous; - - public function beforeTraverse(array $nodes) { - $this->stack = []; - $this->previous = null; - } - - public function enterNode(Node $node) { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) { - $node->setAttribute('previous', $this->previous); - $this->previous->setAttribute('next', $node); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) { - $this->previous = $node; - - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php deleted file mode 100644 index 1e7e9e8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +++ /dev/null @@ -1,38 +0,0 @@ -$node->getAttribute('parent'). - */ -final class ParentConnectingVisitor extends NodeVisitorAbstract { - /** - * @var Node[] - */ - private array $stack = []; - - public function beforeTraverse(array $nodes) { - $this->stack = []; - } - - public function enterNode(Node $node) { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) { - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php deleted file mode 100644 index 6fb15cc..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +++ /dev/null @@ -1,24 +0,0 @@ -'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_READONLY", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_ENUM", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "T_ATTRIBUTE", - "';'", - "']'", - "'('", - "')'", - "'{'", - "'}'", - "'`'", - "'\"'", - "'$'" - ); - - protected array $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, - 161, 162, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 163, 35, 164, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158 - ); - - protected array $action = array( - 133, 134, 135, 582, 136, 137, 0, 751, 752, 753, - 138, 38,-32766,-32766,-32766, 151,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 102, 103, 104, 105, 106, 1112, 1113, - 1114, 1111, 1110, 1109, 1115, 745, 744,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 1245, 837,-32766, 1322, 754,-32766,-32766,-32766,-32766, - -594,-32766,-32766,-32766, 104, 105, 106, -594, 1306, 265, - 139, 404, 758, 759, 760, 761, 990,-32766, 429,-32766, - -32766, -16,-32766, 242, 1027, 815, 762, 763, 764, 765, - 766, 767, 768, 769, 770, 771, 791, 583, 792, 793, - 794, 795, 783, 784, 345, 346, 786, 787, 772, 773, - 774, 776, 777, 778, 356, 818, 819, 820, 821, 822, - 584, 779, 780, 585, 586,-32766, 803, 801, 802, 814, - 798, 799, 835, 826, 587, 588, 797, 589, 590, 591, - 592, 593, 594, 826, 459, 460, 461, 1036, 800, 595, - 596, 941, 140, 2, 133, 134, 135, 582, 136, 137, - 1060, 751, 752, 753, 138, 38, -328, -110, -110, 1326, - 290, 23, -110,-32766,-32766,-32766, 1325, 35, -110, 1112, - 1113, 1114, 1111, 1110, 1109, 1115, 612,-32766, 129, 745, - 744, 107, 108, 109,-32766, 274,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 828, 991, -194, 145, 110, 298, 754, - 836, 75,-32766,-32766,-32766, 1351, 142, 326, 1352, -594, - 326, -594, 254, 265, 139, 404, 758, 759, 760, 761, - 82, -272, 429,-32766, 326,-32766,-32766,-32766,-32766, 815, - 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, - 791, 583, 792, 793, 794, 795, 783, 784, 345, 346, - 786, 787, 772, 773, 774, 776, 777, 778, 356, 818, - 819, 820, 821, 822, 584, 779, 780, 585, 586, 830, - 803, 801, 802, 814, 798, 799, 712, 309, 587, 588, - 797, 589, 590, 591, 592, 593, 594, -78, 83, 84, - 85, -85, 800, 595, 596, 311, 149, 775, 746, 747, - 748, 749, 750, 725, 751, 752, 753, 788, 789, 37, - -328, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 323, 274, 482,-32766,-32766, - -32766, -58,-32766,-32766,-32766, 959, 960, 127, 110, -194, - 961, 339, 754,-32766,-32766,-32766, 955, -85, 291,-32766, - 1088,-32766,-32766,-32766,-32766,-32766, 755, 756, 757, 758, - 759, 760, 761, -193,-32766, 824,-32766,-32766,-32766, -367, - 429, -367, 815, 762, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 791, 813, 792, 793, 794, 795, 783, - 784, 785, 812, 786, 787, 772, 773, 774, 776, 777, - 778, 817, 818, 819, 820, 821, 822, 823, 779, 780, - 781, 782, -548, 803, 801, 802, 814, 798, 799, 340, - 327, 790, 796, 797, 804, 805, 807, 806, 808, 809, - 1033, 391, 606, 7,-32766, 800, 811, 810, 50, 51, - 52, 513, 53, 54, 831, 1240, 1239, 1241, 55, 56, - -110, 57, 1036, 920, 1090, -110, 1036, -110, 291, 483, - 745, 744, 305, 382, 381, -110, -110, -110, -110, -110, - -110, -110, -110, 423, 920, 283, -548, -548, 152, 290, - 380, 381, 1245, 715, 467, 468, 58, 59, 370, 21, - 423, -545, 60, 556, 61, 248, 249, 62, 63, 64, - 65, 66, 67, 68, 69, -548, 28, 267, 70, 445, - 514, 1104, 374, -342, 1272, 1273, 515, -193, 835, 154, - 832, -544, 1270, 42, 25, 516, 389, 517, 241, 518, - 920, 519, 298, 1238, 520, 521, 910, 920, 441, 44, - 45, 446, 377, 376,-32766, 46, 522, 1023, 1022, 1021, - 1024, 368, 338, 442, 1278, -545, -545, 910, 1231, 443, - 524, 525, 526, 835, 1245, 835, 1036, 716, 1341, 1236, - -545, 155, 528, 529,-32766, 1259, 1260, 1261, 1262, 1256, - 1257, 297, -551, 943, -545, -544, -544, 1263, 1258, 290, - 1035, 1240, 1239, 1241, 298, 444, 1036, 71, 1266, 841, - -544, 321, 322, 326, -153, -153, -153, 920, 1240, 1239, - 1241, 922, -550, 910, -544, 710, 943, -591,-32766, -153, - 910, -153, 357, -153, -591, -153, 862, 1033, 863, 1089, - 36, 251, 922, 737, 156, 375, 710, 717, 862, -585, - 863, -585, 75, 158, -546, 835, 959, 960, 326, 1036, - -57, 523, 920,-32766,-32766, 362, 896, 955, -110, -110, - -110, 32, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 745, 744, 656, 26, 835, - -110, -110, 720, 745, 744, -110, 33, 834, 922, 124, - 910, -110, 710, -153, 125, 922, 675, 676, 130, 710, - -32766, 150, 407, 131, 1150, 1152, 48, 144, -546, -546, - 378, 379,-32766, 383, 384, -543, 28, 159, 1238, 920, - 160, 298, 1059, -546, 75,-32766,-32766,-32766, 835,-32766, - 326,-32766, 1270,-32766, -87, 910,-32766, -546, 647, 648, - 161,-32766,-32766,-32766, -4, 920, -84,-32766,-32766, 727, - 162, 287, 163,-32766, 420, -302, -78, -73, -72, -71, - 141, 287,-32766, -70, 326, 976, 745, 744, 1231, 710, - 299, 300, -69, -68, -67, -298, -591, -66, -591, -543, - -543, -65, 528, 529, -46, 1259, 1260, 1261, 1262, 1256, - 1257, -18, 74, 148, -543, 273, 284, 1263, 1258, 126, - -543, 726, 910,-32766, 729, 919, 147, 73, -543, 1238, - 922, 690, 322, 326, 710, 279,-32766,-32766,-32766, 280, - -32766, 285,-32766, 286,-32766, 332, 288,-32766, 910, 289, - 292, 49,-32766,-32766,-32766, 293, 274, 1033,-32766,-32766, - 937, 110, -50, 685,-32766, 420, 146, 691, 826, 701, - 375, 703, 436,-32766, 1353, 20, 561, 296, 645, 1036, - 835, 959, 960, 1119, -543, -543, 523,-32766, 692, 693, - 306, 527, 955, -110, -110, -110, 132, 922, 834, -543, - 464, 710, 283, 662, 657,-32766, 1240, 1239, 1241, 678, - 304, 1238, 283, -543, 10, 301, 302, 493,-32766,-32766, - -32766, 663,-32766, 922,-32766, 679,-32766, 710, -4,-32766, - 373, 40, -508, 956,-32766,-32766,-32766, -275, 731,-32766, - -32766,-32766, 920, 303, 128, 1238,-32766, 420, 310, 0, - 567, 0,-32766,-32766,-32766,-32766,-32766, 0,-32766, 0, - -32766,-32766, 0,-32766, 0, 1277, -498, 0,-32766,-32766, - -32766,-32766, 1279, 0,-32766,-32766, 8, 1238, 24, 372, - -32766, 420, 920, 1267,-32766,-32766,-32766, 610,-32766,-32766, - -32766, 939,-32766, 298, -579,-32766, 846, 41, 734, 488, - -32766,-32766,-32766,-32766, 735, 854,-32766,-32766, 901, 1238, - 574, 1000,-32766, 420, 977, 984,-32766,-32766,-32766, 974, - -32766,-32766,-32766, 985,-32766, 910, 899,-32766, 972, 1093, - 1096, 1097,-32766,-32766,-32766, 1094, 1095, 1101,-32766,-32766, - 1292, -250, -250, -250,-32766, 420, 1310, 375, 1344, 650, - 28, 267, -578,-32766, -577, -551, -550, -549, 959, 960, - -492, 1, 835, 523, 29, 910, 1270, 30, 896, 955, - -110, -110, -110, 39, 43, 47, 72, 76, 77, 78, - 79, -249, -249, -249, 80, 81, 143, 375, 153, 157, - 897, 247, 328, 357, 358, 359, 360, 361, 959, 960, - 922, 362, 1231, 523, 710, -250, 363, 364, 896, 955, - -110, -110, -110, 365, 366, 367, 369, 529, 28, 1259, - 1260, 1261, 1262, 1256, 1257, 437, 555, 1348, -273, -272, - 835, 1263, 1258, 13, 1270, 14,-32766, 15, 16, 18, - 922, 73, 1238, 1350, 710, -249, 322, 326, 406,-32766, - -32766,-32766, 484,-32766, 485,-32766, 492,-32766, 495, 496, - -32766, 497, 498, 502, 503,-32766,-32766,-32766, 504, 511, - 1231,-32766,-32766, 572, 696, 1249, 1190,-32766, 420, 1268, - 1062, 1061, 1042, 1226, 1038, 529,-32766, 1259, 1260, 1261, - 1262, 1256, 1257, -277, -102, 12, 17, 27, 295, 1263, - 1258, 405, 603, 607, 636, 702, 1194, 1244, 1191, 73, - 34, 1323, 0, 320, 322, 326, 371, 711, 714, 718, - 719, 721, 722, 723, 724, 0, 728, 713, 0, 857, - 856, 865, 949, 992, 864, 1349, 948, 946, 947, 950, - 1222, 930, 940, 928, 982, 983, 634, 1347, 1304, 1293, - 1311, 1320, 0, 1207, 0, 1271, 0, 326 - ); - - protected array $actionCheck = array( - 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 9, 10, 11, 14, 9, 10, 11, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 1, 1, 9, 1, 57, 9, 10, 11, 137, - 1, 9, 10, 11, 50, 51, 52, 8, 1, 71, - 72, 73, 74, 75, 76, 77, 31, 30, 80, 32, - 33, 31, 30, 14, 1, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 116, 128, 129, 130, 131, - 132, 133, 82, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 80, 129, 130, 131, 138, 150, 151, - 152, 1, 154, 8, 2, 3, 4, 5, 6, 7, - 162, 9, 10, 11, 12, 13, 8, 117, 118, 1, - 161, 8, 122, 9, 10, 11, 8, 8, 128, 116, - 117, 118, 119, 120, 121, 122, 51, 137, 8, 37, - 38, 53, 54, 55, 30, 57, 32, 33, 34, 35, - 36, 37, 38, 80, 159, 8, 8, 69, 158, 57, - 159, 161, 9, 10, 11, 80, 163, 167, 83, 160, - 167, 162, 8, 71, 72, 73, 74, 75, 76, 77, - 163, 162, 80, 30, 167, 32, 33, 34, 35, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 156, - 128, 129, 130, 131, 132, 133, 163, 8, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 16, 9, 10, - 11, 31, 150, 151, 152, 8, 154, 2, 3, 4, - 5, 6, 7, 163, 9, 10, 11, 12, 13, 30, - 162, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 8, 57, 31, 9, 10, - 11, 16, 9, 10, 11, 117, 118, 14, 69, 162, - 122, 8, 57, 9, 10, 11, 128, 97, 30, 30, - 1, 32, 33, 34, 35, 36, 71, 72, 73, 74, - 75, 76, 77, 8, 30, 80, 32, 33, 34, 106, - 80, 108, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 70, 128, 129, 130, 131, 132, 133, 8, - 70, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 116, 106, 1, 108, 116, 150, 151, 152, 2, 3, - 4, 5, 6, 7, 80, 155, 156, 157, 12, 13, - 101, 15, 138, 1, 164, 106, 138, 108, 30, 163, - 37, 38, 113, 106, 107, 116, 117, 118, 119, 120, - 121, 122, 123, 116, 1, 161, 134, 135, 14, 161, - 106, 107, 1, 31, 134, 135, 50, 51, 8, 101, - 116, 70, 56, 85, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 163, 70, 71, 72, 73, - 74, 123, 8, 164, 78, 79, 80, 162, 82, 14, - 156, 70, 86, 87, 88, 89, 8, 91, 97, 93, - 1, 95, 158, 80, 98, 99, 84, 1, 8, 103, - 104, 105, 106, 107, 116, 109, 110, 119, 120, 121, - 122, 115, 116, 8, 146, 134, 135, 84, 122, 8, - 124, 125, 126, 82, 1, 82, 138, 31, 85, 116, - 149, 14, 136, 137, 116, 139, 140, 141, 142, 143, - 144, 145, 161, 122, 163, 134, 135, 151, 152, 161, - 137, 155, 156, 157, 158, 8, 138, 161, 1, 8, - 149, 165, 166, 167, 75, 76, 77, 1, 155, 156, - 157, 159, 161, 84, 163, 163, 122, 1, 137, 90, - 84, 92, 161, 94, 8, 96, 106, 116, 108, 159, - 147, 148, 159, 163, 14, 106, 163, 31, 106, 160, - 108, 162, 161, 14, 70, 82, 117, 118, 167, 138, - 16, 122, 1, 9, 10, 161, 127, 128, 129, 130, - 131, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 37, 38, 75, 76, 82, - 117, 118, 31, 37, 38, 122, 14, 155, 159, 16, - 84, 128, 163, 164, 16, 159, 75, 76, 16, 163, - 137, 101, 102, 16, 59, 60, 70, 16, 134, 135, - 106, 107, 74, 106, 107, 70, 70, 16, 80, 1, - 16, 158, 1, 149, 161, 87, 88, 89, 82, 91, - 167, 93, 86, 95, 31, 84, 98, 163, 111, 112, - 16, 103, 104, 105, 0, 1, 31, 109, 110, 31, - 16, 30, 16, 115, 116, 35, 31, 31, 31, 31, - 163, 30, 124, 31, 167, 159, 37, 38, 122, 163, - 134, 135, 31, 31, 31, 35, 160, 31, 162, 134, - 135, 31, 136, 137, 31, 139, 140, 141, 142, 143, - 144, 31, 154, 31, 149, 31, 31, 151, 152, 163, - 70, 31, 84, 74, 31, 31, 31, 161, 163, 80, - 159, 80, 166, 167, 163, 35, 87, 88, 89, 35, - 91, 35, 93, 35, 95, 35, 37, 98, 84, 37, - 37, 70, 103, 104, 105, 37, 57, 116, 109, 110, - 38, 69, 31, 77, 115, 116, 70, 116, 80, 80, - 106, 92, 108, 124, 83, 97, 89, 113, 113, 138, - 82, 117, 118, 82, 134, 135, 122, 85, 137, 138, - 114, 127, 128, 129, 130, 131, 31, 159, 155, 149, - 97, 163, 161, 96, 90, 74, 155, 156, 157, 94, - 133, 80, 161, 163, 150, 134, 135, 97, 87, 88, - 89, 100, 91, 159, 93, 100, 95, 163, 164, 98, - 149, 159, 149, 128, 103, 104, 105, 162, 164, 74, - 109, 110, 1, 132, 163, 80, 115, 116, 132, -1, - 153, -1, 87, 88, 89, 124, 91, -1, 93, -1, - 95, 137, -1, 98, -1, 146, 149, -1, 103, 104, - 105, 74, 146, -1, 109, 110, 149, 80, 149, 149, - 115, 116, 1, 160, 87, 88, 89, 153, 91, 124, - 93, 154, 95, 158, 161, 98, 160, 159, 159, 102, - 103, 104, 105, 74, 159, 159, 109, 110, 159, 80, - 81, 159, 115, 116, 159, 159, 87, 88, 89, 159, - 91, 124, 93, 159, 95, 84, 159, 98, 159, 159, - 159, 159, 103, 104, 105, 159, 159, 159, 109, 110, - 160, 100, 101, 102, 115, 116, 160, 106, 160, 160, - 70, 71, 161, 124, 161, 161, 161, 161, 117, 118, - 161, 161, 82, 122, 161, 84, 86, 161, 127, 128, - 129, 130, 131, 161, 161, 161, 161, 161, 161, 161, - 161, 100, 101, 102, 161, 161, 161, 106, 161, 161, - 164, 161, 161, 161, 161, 161, 161, 161, 117, 118, - 159, 161, 122, 122, 163, 164, 161, 161, 127, 128, - 129, 130, 131, 161, 161, 161, 161, 137, 70, 139, - 140, 141, 142, 143, 144, 161, 161, 164, 162, 162, - 82, 151, 152, 162, 86, 162, 74, 162, 162, 162, - 159, 161, 80, 164, 163, 164, 166, 167, 162, 87, - 88, 89, 162, 91, 162, 93, 162, 95, 162, 162, - 98, 162, 162, 162, 162, 103, 104, 105, 162, 162, - 122, 109, 110, 162, 162, 162, 162, 115, 116, 162, - 162, 162, 162, 162, 162, 137, 124, 139, 140, 141, - 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, - 152, 162, 162, 162, 162, 162, 162, 162, 162, 161, - 163, 162, -1, 163, 166, 167, 163, 163, 163, 163, - 163, 163, 163, 163, 163, -1, 163, 163, -1, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, -1, 165, -1, 166, -1, 167 - ); - - protected array $actionBase = array( - 0, -2, 152, 549, 764, 941, 981, 751, 617, 310, - 123, 877, 556, 671, 671, 738, 671, 472, 626, 789, - 63, 305, 305, 789, 305, 493, 493, 493, 658, 658, - 658, 658, 749, 749, 897, 897, 929, 865, 831, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 51, 45, 451, 692, 1036, 1044, - 1040, 1045, 1034, 1033, 1039, 1041, 1046, 1083, 1084, 795, - 1085, 1086, 1082, 1087, 1042, 889, 1035, 1043, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 44, 343, 664, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 52, 52, - 52, 666, 666, 47, 354, 980, 203, 1048, 1048, 1048, - 1048, 1048, 1048, 1048, 1048, 1048, 665, 339, 164, 164, - 7, 7, 7, 7, 7, 50, 369, 583, -25, -25, - -25, -25, 448, 741, 501, 408, 283, 338, 394, 334, - 334, 14, 14, 531, 531, 9, 9, 531, 531, 531, - 478, 478, 478, 478, 441, 471, 552, 428, 824, 53, - 53, 53, 53, 824, 824, 824, 824, 826, 1089, 824, - 824, 824, 594, 750, 750, 781, 138, 138, 138, 750, - 540, 503, 503, 540, 238, 503, 67, 135, -78, 805, - 377, 499, -78, 362, 656, 636, 59, 743, 624, 743, - 1032, 481, 802, 802, 514, 773, 746, 878, 1064, 1049, - 821, 1080, 825, 1081, 15, 370, 745, 1031, 1031, 1031, - 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1090, 443, - 1032, 384, 1090, 1090, 1090, 443, 443, 443, 443, 443, - 443, 443, 443, 443, 443, 647, 384, 622, 641, 384, - 810, 443, 51, 817, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 780, 316, 51, 45, 150, 150, - 490, 83, 150, 150, 150, 150, 51, 51, 51, 51, - 624, 799, 797, 627, 834, 375, 799, 799, 799, 270, - 158, 69, 197, 740, 760, 345, 788, 788, 801, 900, - 900, 788, 798, 788, 801, 914, 788, 788, 900, 900, - 835, 180, 550, 353, 524, 565, 900, 279, 788, 788, - 788, 788, 816, 571, 788, 214, 198, 788, 788, 816, - 811, 785, 145, 777, 900, 900, 900, 816, 500, 777, - 777, 777, 839, 845, 765, 784, 337, 297, 611, 169, - 822, 784, 784, 788, 538, 765, 784, 765, 784, 837, - 784, 784, 784, 765, 784, 798, 431, 784, 721, 607, - 163, 784, 6, 915, 916, 723, 917, 912, 918, 964, - 919, 923, 1054, 899, 930, 913, 924, 965, 906, 903, - 794, 693, 698, 827, 783, 896, 792, 792, 792, 894, - 792, 792, 792, 792, 792, 792, 792, 792, 693, 823, - 830, 787, 933, 702, 707, 1011, 819, 926, 1088, 932, - 1013, 925, 772, 711, 977, 934, 774, 1050, 935, 936, - 986, 1014, 846, 1017, 963, 796, 979, 1065, 836, 945, - 1055, 792, 915, 923, 735, 913, 924, 906, 903, 770, - 766, 762, 763, 761, 752, 747, 748, 782, 1018, 893, - 833, 880, 940, 895, 693, 886, 971, 1047, 990, 992, - 1053, 803, 791, 888, 1066, 946, 952, 953, 1056, 1019, - 1057, 838, 973, 775, 994, 820, 1067, 996, 997, 999, - 1000, 1058, 1068, 1059, 891, 1060, 849, 814, 966, 807, - 1069, 1, 806, 808, 818, 955, 484, 931, 1061, 1070, - 1071, 1001, 1002, 1006, 1072, 1073, 927, 852, 975, 815, - 976, 967, 855, 856, 525, 813, 1020, 800, 804, 812, - 577, 640, 1074, 1075, 1076, 928, 790, 786, 860, 864, - 1021, 809, 1022, 1077, 649, 867, 724, 1078, 1012, 744, - 754, 281, 654, 335, 756, 779, 1063, 829, 776, 778, - 954, 754, 793, 869, 1079, 870, 871, 872, 1007, 876, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 456, 456, 456, 456, 456, 456, 305, 305, 305, 305, - 305, 456, 456, 456, 456, 456, 456, 456, 305, 305, - 0, 0, 305, 0, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 473, 473, 289, 289, 473, 289, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 0, 289, 289, 289, 289, - 289, 289, 289, 289, 473, 835, 473, 138, 138, 138, - 138, 473, 473, 473, -88, -88, 473, 238, 473, 473, - 138, 138, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 0, 0, 384, 503, 473, 798, 798, - 798, 798, 473, 473, 473, 473, 503, 503, 473, 473, - 473, 0, 0, 0, 0, 0, 0, 0, 0, 384, - 0, 0, 384, 0, 0, 798, 798, 473, 238, 835, - 168, 473, 0, 0, 0, 0, 384, 798, 384, 443, - 788, 503, 503, 788, 443, 443, 150, 51, 168, 620, - 620, 620, 620, 0, 0, 624, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 798, 0, 835, - 0, 798, 798, 798, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 798, - 0, 0, 900, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, - 798, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 792, 803, 0, 803, 0, 792, 792, 792, 0, 0, - 0, 0, 813, 809 - ); - - protected array $actionDefault = array( - 3,32767, 102,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 100,32767,32767,32767,32767, 597, 597, - 597, 597,32767,32767, 254, 102,32767,32767, 470, 387, - 387, 387,32767,32767, 541, 541, 541, 541, 541, 541, - 32767,32767,32767,32767,32767,32767, 470,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 100, - 32767,32767,32767, 36, 7, 8, 10, 11, 49, 17, - 324,32767,32767,32767,32767, 102,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 590,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 474, 453, - 454, 456, 457, 386, 542, 596, 327, 593, 385, 145, - 339, 329, 242, 330, 258, 475, 259, 476, 479, 480, - 215, 287, 382, 149, 150, 417, 471, 419, 469, 473, - 418, 392, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 390, 391, 472, 450, 449, - 448,32767,32767, 415, 416,32767, 420,32767,32767,32767, - 32767,32767,32767,32767, 102,32767, 389, 423, 421, 422, - 439, 440, 437, 438, 441,32767,32767,32767, 442, 443, - 444, 445, 316,32767,32767, 366, 364, 316, 111,32767, - 32767, 430, 431,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 535, 447,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 102, - 32767, 100, 537, 412, 414, 504, 425, 426, 424, 393, - 32767, 511,32767, 102,32767, 513,32767,32767,32767,32767, - 32767,32767,32767, 536,32767, 543, 543,32767, 497, 100, - 195,32767,32767, 512,32767, 195, 195,32767,32767,32767, - 32767,32767,32767,32767,32767, 604, 497, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110,32767, 195, - 110,32767,32767,32767, 100, 195, 195, 195, 195, 195, - 195, 195, 195, 195, 195, 190,32767, 268, 270, 102, - 558, 195,32767, 516,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 509,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 497, 435, 138,32767, 138, 543, 427, 428, 429, 499, - 543, 543, 543, 312, 289,32767,32767,32767,32767, 514, - 514, 100, 100, 100, 100, 509,32767,32767,32767,32767, - 111, 99, 99, 99, 99, 99, 103, 101,32767,32767, - 32767,32767, 223, 99,32767, 101, 101,32767,32767, 223, - 225, 212, 101, 227,32767, 562, 563, 223, 101, 227, - 227, 227, 247, 247, 486, 318, 101, 99, 101, 101, - 197, 318, 318,32767, 101, 486, 318, 486, 318, 199, - 318, 318, 318, 486, 318,32767, 101, 318, 214, 99, - 99, 318,32767,32767,32767, 499,32767,32767,32767,32767, - 32767,32767,32767, 222,32767,32767,32767,32767,32767,32767, - 32767,32767, 530,32767, 547, 560, 433, 434, 436, 545, - 458, 459, 460, 461, 462, 463, 464, 466, 592,32767, - 503,32767,32767,32767, 338,32767, 602,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 603,32767, 543,32767,32767,32767, - 32767, 432, 9, 74, 492, 42, 43, 51, 57, 520, - 521, 522, 523, 517, 518, 524, 519,32767,32767, 525, - 568,32767,32767, 544, 595,32767,32767,32767,32767,32767, - 32767, 138,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 530,32767, 136,32767,32767,32767,32767, - 32767,32767,32767,32767, 526,32767,32767,32767, 543,32767, - 32767,32767,32767, 314, 311,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 543,32767,32767,32767,32767,32767, 291,32767, 308, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 286,32767,32767, 381, - 499, 294, 296, 297,32767,32767,32767,32767, 360,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 152, 152, 3, 3, 341, 152, 152, 152, 341, 341, - 152, 341, 341, 341, 152, 152, 152, 152, 152, 152, - 280, 185, 262, 265, 247, 247, 152, 352, 152 - ); - - protected array $goto = array( - 196, 196, 1034, 1065, 697, 431, 661, 621, 658, 319, - 706, 425, 313, 314, 335, 576, 430, 336, 432, 638, - 654, 655, 852, 672, 673, 674, 853, 167, 167, 167, - 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, - 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, - 189, 190, 191, 192, 218, 216, 219, 536, 537, 421, - 538, 540, 541, 542, 543, 544, 545, 546, 547, 1136, - 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, - 176, 178, 215, 217, 220, 238, 243, 244, 246, 257, - 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, - 271, 281, 282, 316, 317, 318, 426, 427, 428, 581, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, - 200, 239, 188, 189, 190, 191, 192, 218, 1136, 201, - 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, - 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, - 212, 213, 214, 855, 466, 466, 278, 278, 278, 278, - 623, 623, 351, 466, 1269, 600, 1269, 1269, 1269, 1269, - 1269, 1269, 1269, 1269, 1269, 1287, 1287, 599, 1100, 1287, - 709, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, - 508, 700, 458, 1098, 975, 559, 552, 860, 419, 909, - 904, 905, 918, 861, 906, 858, 907, 908, 859, 848, - 827, 912, 354, 354, 354, 354, 396, 399, 560, 601, - 605, 1087, 1082, 1083, 1084, 341, 552, 559, 568, 569, - 344, 579, 602, 616, 617, 408, 409, 1232, 440, 479, - 670, 22, 671, 886, 412, 413, 414, 481, 684, 349, - 1237, 415, 1237, 1107, 1108, 347, 833, 1034, 1034, 1237, - 573, 848, 1034, 1327, 1034, 1034, 1040, 1039, 1034, 1034, - 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1319, - 1319, 1319, 1319, 1237, 893, 851, 893, 893, 1237, 1237, - 1237, 1237, 1233, 1234, 1237, 1237, 1237, 833, 355, 833, - 843, 996, 252, 252, 1043, 1044, 1037, 1037, 355, 355, - 681, 952, 394, 926, 1029, 1045, 1046, 927, 1235, 1295, - 1296, 942, 355, 355, 942, 913, 355, 914, 1354, 250, - 250, 250, 250, 245, 253, 548, 548, 548, 548, 554, - 604, 1285, 1285, 355, 355, 1285, 571, 1285, 1285, 1285, - 1285, 1285, 1285, 1285, 1285, 1285, 539, 539, 342, 424, - 539, 611, 539, 539, 539, 539, 539, 539, 539, 539, - 539, 566, 476, 1312, 1313, 733, 637, 639, 325, 308, - 659, 848, 343, 342, 683, 687, 1010, 695, 704, 1006, - 660, 1298, 609, 624, 627, 628, 629, 630, 651, 652, - 653, 708, 1216, 944, 1314, 1315, 1217, 1220, 945, 1221, - 1337, 1337, 686, 352, 353, 868, 553, 563, 450, 450, - 450, 553, 1309, 563, 1309, 1133, 397, 462, 1337, 1058, - 880, 1309, 1185, 867, 500, 5, 501, 6, 469, 580, - 470, 471, 507, 554, 878, 1340, 1340, 1345, 1346, 433, - 438, 550, 666, 550, 433, 682, 1321, 1321, 1321, 1321, - 550, 337, 1041, 1041, 931, 1123, 873, 665, 1052, 1048, - 1049, 619, 845, 876, 324, 275, 324, 1015, 967, 410, - 705, 577, 614, 1305, 456, 872, 403, 664, 994, 969, - 969, 969, 969, 866, 870, 456, 963, 970, 881, 869, - 1070, 1074, 631, 633, 635, 1227, 1230, 958, 615, 978, - 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, - 450, 999, 1018, 450, 971, 1073, 732, 477, 1228, 1307, - 1307, 1073, 736, 968, 551, 1008, 1003, 882, 694, 1075, - 1071, 829, 255, 255, 980, 0, 1118, 0, 1013, 1013, - 694, 0, 0, 0, 694, 1116, 885 - ); - - protected array $gotoCheck = array( - 42, 42, 73, 127, 73, 66, 66, 56, 56, 66, - 9, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 86, 86, 26, 86, 86, 86, 27, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 15, 149, 149, 23, 23, 23, 23, - 108, 108, 97, 149, 108, 130, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 170, 170, 8, 8, 170, - 8, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 8, 8, 83, 8, 49, 76, 76, 15, 43, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 22, - 6, 15, 24, 24, 24, 24, 59, 59, 59, 59, - 59, 15, 15, 15, 15, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 82, 82, 20, 83, 84, - 82, 76, 82, 45, 82, 82, 82, 84, 82, 179, - 73, 82, 73, 144, 144, 82, 12, 73, 73, 73, - 172, 22, 73, 181, 73, 73, 118, 118, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 9, - 9, 9, 9, 73, 25, 25, 25, 25, 73, 73, - 73, 73, 20, 20, 73, 73, 73, 12, 14, 12, - 20, 103, 5, 5, 119, 119, 89, 89, 14, 14, - 89, 89, 62, 73, 89, 89, 89, 73, 20, 20, - 20, 9, 14, 14, 9, 65, 14, 65, 14, 5, - 5, 5, 5, 5, 5, 107, 107, 107, 107, 14, - 107, 171, 171, 14, 14, 171, 104, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 173, 173, 168, 13, - 173, 13, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 48, 176, 176, 176, 48, 48, 48, 169, 169, - 48, 22, 168, 168, 48, 48, 48, 48, 48, 48, - 64, 14, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 79, 79, 178, 178, 79, 79, 79, 79, - 182, 182, 14, 97, 97, 35, 9, 9, 23, 23, - 23, 9, 130, 9, 130, 150, 9, 9, 182, 114, - 35, 130, 151, 35, 155, 46, 155, 46, 9, 9, - 9, 9, 155, 14, 9, 182, 182, 9, 9, 117, - 113, 19, 120, 19, 117, 116, 130, 130, 130, 130, - 19, 29, 117, 117, 17, 17, 39, 117, 117, 117, - 117, 17, 18, 9, 24, 24, 24, 17, 93, 93, - 93, 2, 2, 130, 19, 17, 28, 17, 17, 19, - 19, 19, 19, 17, 37, 19, 19, 19, 16, 16, - 16, 16, 85, 85, 85, 17, 14, 92, 80, 16, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 50, 110, 23, 50, 130, 50, 157, 160, 130, - 130, 130, 99, 16, 50, 50, 50, 41, 7, 132, - 129, 7, 5, 5, 96, -1, 147, -1, 107, 107, - 7, -1, -1, -1, 7, 16, 16 - ); - - protected array $gotoBase = array( - 0, 0, -221, 0, 0, 311, 200, 541, 179, -10, - 0, 0, -30, 32, 11, -185, 56, 9, 173, 196, - -146, 0, -59, 163, 219, 291, 18, 22, 159, 175, - 0, 0, 0, 0, 0, 54, 0, 165, 0, 153, - 0, 106, -1, 189, 0, 230, -291, 0, -330, 186, - 519, 0, 0, 0, 0, 0, -33, 0, 0, 181, - 0, 0, 280, 0, 158, 321, -236, 0, 0, 0, - 0, 0, 0, -5, 0, 0, -140, 0, 0, 4, - 174, 44, -246, -76, -220, 33, -698, 0, 0, 37, - 0, 0, 188, 184, 0, 0, 111, -311, 0, 135, - 0, 0, 0, 276, 313, 0, 0, 317, -71, 0, - 162, 0, 0, 183, 166, 0, 182, 187, -3, 29, - 172, 0, 0, 0, 0, 0, 0, 1, 0, 176, - 167, 0, 107, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -12, 0, 0, 112, 0, 130, - 190, 168, 0, 0, 0, -51, 0, 97, 0, 0, - 169, 0, 0, 0, 0, 0, 0, 0, 71, 67, - -56, 110, 241, 125, 0, 0, 82, 0, 42, 229, - 0, 242, 113, 0, 0 - ); - - protected array $gotoDefault = array( - -32768, 512, 740, 4, 741, 935, 816, 825, 597, 530, - 707, 348, 625, 422, 1303, 911, 1122, 578, 844, 1246, - 1254, 457, 847, 330, 730, 923, 894, 895, 400, 386, - 392, 398, 649, 626, 494, 879, 453, 871, 486, 874, - 452, 883, 164, 418, 510, 887, 3, 890, 557, 921, - 973, 387, 898, 388, 677, 900, 562, 902, 903, 395, - 401, 402, 1127, 570, 622, 915, 256, 564, 916, 385, - 917, 925, 390, 393, 688, 465, 505, 499, 411, 1102, - 565, 608, 646, 447, 473, 620, 632, 618, 480, 434, - 416, 329, 957, 965, 487, 463, 979, 350, 987, 738, - 1135, 640, 489, 995, 641, 1002, 1005, 531, 532, 478, - 1017, 272, 1020, 490, 19, 667, 1031, 1032, 668, 642, - 1054, 643, 669, 644, 1056, 472, 598, 1064, 454, 1072, - 1291, 455, 1076, 266, 1079, 277, 417, 435, 1085, 1086, - 9, 1092, 698, 699, 11, 276, 509, 1117, 689, 451, - 1134, 439, 1204, 1206, 558, 491, 1224, 1223, 680, 506, - 1229, 448, 1294, 449, 533, 474, 315, 534, 1338, 307, - 333, 312, 549, 294, 334, 535, 475, 1300, 1308, 331, - 31, 1328, 1339, 575, 613 - ); - - protected array $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, - 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, - 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, - 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, - 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, - 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 50, 69, 69, 72, 72, 71, - 70, 70, 63, 75, 75, 76, 76, 77, 77, 78, - 78, 79, 79, 80, 80, 26, 26, 27, 27, 27, - 27, 27, 88, 88, 90, 90, 83, 83, 91, 91, - 92, 92, 92, 84, 84, 87, 87, 85, 85, 93, - 94, 94, 57, 57, 65, 65, 68, 68, 68, 67, - 95, 95, 96, 58, 58, 58, 58, 97, 97, 98, - 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, - 55, 55, 51, 51, 105, 53, 53, 106, 52, 52, - 54, 54, 64, 64, 64, 64, 81, 81, 109, 109, - 111, 111, 112, 112, 112, 112, 110, 110, 110, 114, - 114, 114, 114, 89, 89, 117, 117, 117, 118, 118, - 115, 115, 119, 119, 121, 121, 122, 122, 116, 123, - 123, 120, 124, 124, 124, 124, 113, 113, 82, 82, - 82, 20, 20, 20, 126, 125, 125, 127, 127, 127, - 127, 60, 128, 128, 129, 61, 131, 131, 132, 132, - 133, 133, 86, 134, 134, 134, 134, 134, 134, 134, - 139, 139, 140, 140, 141, 141, 141, 141, 141, 142, - 143, 143, 138, 138, 135, 135, 137, 137, 145, 145, - 144, 144, 144, 144, 144, 144, 144, 136, 146, 146, - 148, 147, 147, 62, 104, 149, 149, 56, 56, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 156, 150, 150, 155, 155, 158, 159, - 159, 160, 161, 162, 162, 162, 162, 19, 19, 73, - 73, 73, 73, 151, 151, 151, 151, 164, 164, 152, - 152, 154, 154, 154, 157, 157, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 171, 171, 171, 108, 173, - 173, 173, 173, 153, 153, 153, 153, 153, 153, 153, - 153, 59, 59, 167, 167, 167, 167, 174, 174, 163, - 163, 163, 175, 175, 175, 175, 175, 175, 74, 74, - 66, 66, 66, 66, 130, 130, 130, 130, 178, 177, - 166, 166, 166, 166, 166, 166, 166, 165, 165, 165, - 176, 176, 176, 176, 107, 172, 180, 180, 179, 179, - 181, 181, 181, 181, 181, 181, 181, 181, 169, 169, - 169, 169, 168, 183, 182, 182, 182, 182, 182, 182, - 182, 182, 184, 184, 184, 184 - ); - - protected array $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, - 0, 1, 1, 1, 1, 4, 3, 5, 4, 3, - 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, - 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, - 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 1, 0, 2, 1, 3, 8, - 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, - 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, - 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, - 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, - 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, - 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, - 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, - 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, - 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, - 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, - 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, - 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, - 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, - 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, - 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, - 3, 3, 3, 4, 4, 1, 1, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, - 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, - 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, - 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, - 3, 2, 1, 2, 2, 2, 4, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 1, 1, 0, - 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 5, 3, 3, 4, - 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, - 3, 0, 1, 1, 3, 1, 1, 1, 1, 1, - 3, 1, 1, 4, 4, 1, 4, 4, 0, 1, - 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, - 1, 4, 4, 3, 3, 3, 3, 1, 3, 1, - 1, 3, 1, 1, 4, 1, 1, 1, 3, 1, - 1, 2, 1, 3, 4, 3, 2, 0, 2, 2, - 1, 2, 1, 1, 1, 4, 3, 3, 3, 3, - 6, 3, 1, 1, 2, 1 - ); - - protected function initReduceCallbacks(): void { - $this->reduceCallbacks = [ - 0 => null, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => null, - 6 => null, - 7 => null, - 8 => null, - 9 => null, - 10 => null, - 11 => null, - 12 => null, - 13 => null, - 14 => null, - 15 => null, - 16 => null, - 17 => null, - 18 => null, - 19 => null, - 20 => null, - 21 => null, - 22 => null, - 23 => null, - 24 => null, - 25 => null, - 26 => null, - 27 => null, - 28 => null, - 29 => null, - 30 => null, - 31 => null, - 32 => null, - 33 => null, - 34 => null, - 35 => null, - 36 => null, - 37 => null, - 38 => null, - 39 => null, - 40 => null, - 41 => null, - 42 => null, - 43 => null, - 44 => null, - 45 => null, - 46 => null, - 47 => null, - 48 => null, - 49 => null, - 50 => null, - 51 => null, - 52 => null, - 53 => null, - 54 => null, - 55 => null, - 56 => null, - 57 => null, - 58 => null, - 59 => null, - 60 => null, - 61 => null, - 62 => null, - 63 => null, - 64 => null, - 65 => null, - 66 => null, - 67 => null, - 68 => null, - 69 => null, - 70 => null, - 71 => null, - 72 => null, - 73 => null, - 74 => null, - 75 => null, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; if ($this->semValue === "emitError(new Error('Cannot use "getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); - }, - 77 => null, - 78 => null, - 79 => null, - 80 => null, - 81 => null, - 82 => null, - 83 => null, - 84 => null, - 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 88 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 90 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 91 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 92 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 93 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 94 => null, - 95 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 96 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 97 => function ($stackPos) { - /* nothing */ - }, - 98 => function ($stackPos) { - /* nothing */ - }, - 99 => function ($stackPos) { - /* nothing */ - }, - 100 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); - }, - 101 => null, - 102 => null, - 103 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 104 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 105 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 106 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 107 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 108 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 109 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 110 => function ($stackPos) { - $this->semValue = []; - }, - 111 => null, - 112 => null, - 113 => null, - 114 => null, - 115 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->handleHaltCompiler(), $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 119 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 120 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 121 => null, - 122 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 123 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 124 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 125 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 127 => null, - 128 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 129 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 130 => null, - 131 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 132 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 133 => null, - 134 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 135 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 136 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 137 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 138 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 139 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 140 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 141 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 142 => null, - 143 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 144 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 145 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 146 => null, - 147 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 148 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 149 => function ($stackPos) { - $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 150 => function ($stackPos) { - $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 151 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; - }, - 152 => function ($stackPos) { - $this->semValue = array(); - }, - 153 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 154 => null, - 155 => null, - 156 => null, - 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 158 => function ($stackPos) { - $this->semValue = new Stmt\Block($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => $this->semStack[$stackPos-(7-5)], 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 161 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 162 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 163 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 164 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 165 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 167 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 169 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 170 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 171 => function ($stackPos) { - - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('hasLeadingNewline', $this->inlineHtmlHasLeadingNewline($stackPos-(1-1))); - - }, - 172 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 173 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 174 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 175 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 176 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-4)], $this->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->checkTryCatch($this->semValue); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 181 => function ($stackPos) { - $this->semValue = null; /* means: no statement */ - }, - 182 => null, - 183 => function ($stackPos) { - $this->semValue = $this->maybeCreateNop($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); - }, - 184 => function ($stackPos) { - if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; - }, - 185 => function ($stackPos) { - $this->semValue = array(); - }, - 186 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 187 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 188 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 189 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 190 => function ($stackPos) { - $this->semValue = null; - }, - 191 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 192 => null, - 193 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 194 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 195 => function ($stackPos) { - $this->semValue = false; - }, - 196 => function ($stackPos) { - $this->semValue = true; - }, - 197 => function ($stackPos) { - $this->semValue = false; - }, - 198 => function ($stackPos) { - $this->semValue = true; - }, - 199 => function ($stackPos) { - $this->semValue = false; - }, - 200 => function ($stackPos) { - $this->semValue = true; - }, - 201 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 202 => function ($stackPos) { - $this->semValue = []; - }, - 203 => null, - 204 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 205 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 206 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 207 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 208 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - $this->checkClass($this->semValue, $stackPos-(8-3)); - }, - 209 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - $this->checkInterface($this->semValue, $stackPos-(7-3)); - }, - 210 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 211 => function ($stackPos) { - $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - $this->checkEnum($this->semValue, $stackPos-(8-3)); - }, - 212 => function ($stackPos) { - $this->semValue = null; - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 214 => function ($stackPos) { - $this->semValue = null; - }, - 215 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 216 => function ($stackPos) { - $this->semValue = 0; - }, - 217 => null, - 218 => null, - 219 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 220 => function ($stackPos) { - $this->semValue = Modifiers::ABSTRACT; - }, - 221 => function ($stackPos) { - $this->semValue = Modifiers::FINAL; - }, - 222 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 223 => function ($stackPos) { - $this->semValue = null; - }, - 224 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 225 => function ($stackPos) { - $this->semValue = array(); - }, - 226 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 227 => function ($stackPos) { - $this->semValue = array(); - }, - 228 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 229 => null, - 230 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 231 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 232 => null, - 233 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 234 => null, - 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 236 => function ($stackPos) { - if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; - }, - 237 => function ($stackPos) { - $this->semValue = null; - }, - 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 239 => null, - 240 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 241 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 242 => function ($stackPos) { - $this->semValue = new Node\DeclareItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 245 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 246 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 247 => function ($stackPos) { - $this->semValue = array(); - }, - 248 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 249 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 250 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 251 => null, - 252 => null, - 253 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 254 => function ($stackPos) { - $this->semValue = []; - }, - 255 => null, - 256 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 257 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 258 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 259 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 260 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 261 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 262 => function ($stackPos) { - $this->semValue = array(); - }, - 263 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 264 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 265 => function ($stackPos) { - $this->semValue = array(); - }, - 266 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 267 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); - }, - 268 => function ($stackPos) { - $this->semValue = null; - }, - 269 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 270 => function ($stackPos) { - $this->semValue = null; - }, - 271 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); - }, - 272 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 274 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 275 => function ($stackPos) { - $this->semValue = array($this->fixupArrayDestructuring($this->semStack[$stackPos-(1-1)]), false); - }, - 276 => null, - 277 => function ($stackPos) { - $this->semValue = array(); - }, - 278 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 279 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 280 => function ($stackPos) { - $this->semValue = 0; - }, - 281 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 282 => function ($stackPos) { - $this->semValue = Modifiers::PUBLIC; - }, - 283 => function ($stackPos) { - $this->semValue = Modifiers::PROTECTED; - }, - 284 => function ($stackPos) { - $this->semValue = Modifiers::PRIVATE; - }, - 285 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 286 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); - }, - 287 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); - $this->checkParam($this->semValue); - }, - 288 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - }, - 289 => null, - 290 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 291 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 292 => null, - 293 => null, - 294 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 295 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); - }, - 296 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 297 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 298 => null, - 299 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 300 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 301 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 302 => null, - 303 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 304 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 305 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 306 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 307 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 308 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 309 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 310 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 311 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 312 => null, - 313 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 314 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 315 => null, - 316 => function ($stackPos) { - $this->semValue = null; - }, - 317 => null, - 318 => function ($stackPos) { - $this->semValue = null; - }, - 319 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 320 => function ($stackPos) { - $this->semValue = null; - }, - 321 => function ($stackPos) { - $this->semValue = array(); - }, - 322 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 323 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); - }, - 324 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 325 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 326 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 327 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 328 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 329 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 330 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(3-1)]); - }, - 331 => null, - 332 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 333 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 334 => null, - 335 => null, - 336 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 337 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 338 => function ($stackPos) { - $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 339 => function ($stackPos) { - $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 340 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 341 => function ($stackPos) { - $this->semValue = array(); - }, - 342 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 343 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); - $this->checkProperty($this->semValue, $stackPos-(5-2)); - }, - 344 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-1)]); - $this->checkClassConst($this->semValue, $stackPos-(5-2)); - }, - 345 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); - $this->checkClassConst($this->semValue, $stackPos-(6-2)); - }, - 346 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); - }, - 347 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 348 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 349 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ - }, - 350 => function ($stackPos) { - $this->semValue = array(); - }, - 351 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 352 => function ($stackPos) { - $this->semValue = array(); - }, - 353 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 354 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 355 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 356 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 357 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 358 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 359 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 360 => null, - 361 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 362 => function ($stackPos) { - $this->semValue = null; - }, - 363 => null, - 364 => null, - 365 => function ($stackPos) { - $this->semValue = 0; - }, - 366 => function ($stackPos) { - $this->semValue = 0; - }, - 367 => null, - 368 => null, - 369 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 370 => function ($stackPos) { - $this->semValue = Modifiers::PUBLIC; - }, - 371 => function ($stackPos) { - $this->semValue = Modifiers::PROTECTED; - }, - 372 => function ($stackPos) { - $this->semValue = Modifiers::PRIVATE; - }, - 373 => function ($stackPos) { - $this->semValue = Modifiers::STATIC; - }, - 374 => function ($stackPos) { - $this->semValue = Modifiers::ABSTRACT; - }, - 375 => function ($stackPos) { - $this->semValue = Modifiers::FINAL; - }, - 376 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 377 => null, - 378 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 379 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 380 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 381 => function ($stackPos) { - $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 382 => function ($stackPos) { - $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 383 => null, - 384 => null, - 385 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 386 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 387 => function ($stackPos) { - $this->semValue = array(); - }, - 388 => null, - 389 => null, - 390 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->fixupArrayDestructuring($this->semStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 392 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - if (!$this->phpVersion->allowsAssignNewByReference()) { - $this->emitError(new Error('Cannot assign new by reference', $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]))); - } - - }, - 395 => null, - 396 => null, - 397 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 410 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 413 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 414 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 430 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 431 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 432 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 433 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 434 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 435 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 436 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 440 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 441 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 442 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 443 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 444 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 445 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 446 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 447 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 451 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 459 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 465 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 467 => null, - 468 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 479 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 480 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 481 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 482 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 483 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); - }, - 484 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 485 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 486 => function ($stackPos) { - $this->semValue = array(); - }, - 487 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 488 => null, - 489 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 490 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 491 => function ($stackPos) { - $this->semValue = new Node\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 492 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 493 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 494 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 495 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 496 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 497 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 498 => null, - 499 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 500 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 501 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 502 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 503 => null, - 504 => null, - 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 506 => function ($stackPos) { - $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 507 => null, - 508 => null, - 509 => function ($stackPos) { - $this->semValue = null; - }, - 510 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 511 => function ($stackPos) { - $this->semValue = array(); - }, - 512 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); foreach ($this->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; - }, - 513 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 514 => function ($stackPos) { - $this->semValue = array(); - }, - 515 => null, - 516 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 517 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 518 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 519 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 520 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 521 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 522 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 523 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 524 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 525 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 526 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 527 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)])), $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 528 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 529 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - $this->createdArrays->attach($this->semValue); - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->createdArrays->attach($this->semValue); - }, - 531 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->supportsUnicodeEscapes()); - }, - 532 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = new Scalar\InterpolatedString($this->semStack[$stackPos-(3-2)], $attrs); - }, - 533 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->allowsInvalidOctals()); - }, - 534 => function ($stackPos) { - $this->semValue = Scalar\Float_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 535 => null, - 536 => null, - 537 => null, - 538 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); - }, - 539 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(2-2)], $this->tokenEndStack[$stackPos-(2-2)]), true); - }, - 540 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); - }, - 541 => function ($stackPos) { - $this->semValue = null; - }, - 542 => null, - 543 => null, - 544 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 545 => null, - 546 => null, - 547 => null, - 548 => null, - 549 => null, - 550 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 551 => null, - 552 => null, - 553 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 555 => null, - 556 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 558 => function ($stackPos) { - $this->semValue = null; - }, - 559 => null, - 560 => null, - 561 => null, - 562 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 563 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 564 => null, - 565 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 566 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 567 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])), $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 568 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])) : $var; - }, - 569 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 570 => null, - 571 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 572 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 573 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 574 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 575 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 576 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 577 => null, - 578 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 579 => null, - 580 => null, - 581 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 582 => null, - 583 => function ($stackPos) { - $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 584 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); $this->semValue->setAttribute('kind', Expr\List_::KIND_LIST); - $this->postprocessList($this->semValue); - }, - 585 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end]->value instanceof Expr\Error) array_pop($this->semValue); - }, - 586 => null, - 587 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ - }, - 588 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 589 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 590 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 591 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 592 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 593 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 594 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 595 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 596 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), true); - }, - 597 => function ($stackPos) { - /* Create an Error node now to remember the position. We'll later either report an error, - or convert this into a null element, depending on whether this is a creation or destructuring context. */ - $attrs = $this->createEmptyElemAttributes($this->tokenPos); - $this->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); - }, - 598 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 599 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 600 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 601 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 602 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); $attrs['rawValue'] = $this->semStack[$stackPos-(1-1)]; $this->semValue = new Node\InterpolatedStringPart($this->semStack[$stackPos-(1-1)], $attrs); - }, - 603 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 604 => null, - 605 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 606 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 607 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 608 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 609 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 610 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 611 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 612 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 613 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 614 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 615 => null, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php deleted file mode 100644 index 76d52a8..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +++ /dev/null @@ -1,2717 +0,0 @@ -'", - "T_IS_GREATER_OR_EQUAL", - "'.'", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_READONLY", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_ENUM", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "T_ATTRIBUTE", - "';'", - "']'", - "'('", - "')'", - "'{'", - "'}'", - "'`'", - "'\"'", - "'$'" - ); - - protected array $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, - 161, 162, 53, 51, 8, 52, 48, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 163, 35, 164, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 49, 50, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158 - ); - - protected array $action = array( - 133, 134, 135, 582, 136, 137, 0, 751, 752, 753, - 138, 38, 327,-32766,-32766,-32766,-32766,-32766,-32766, 837, - 826,-32767,-32767,-32767,-32767, 102, 103, 104, 1112, 1113, - 1114, 1111, 1110, 1109, 1115, 745, 744,-32766, 1027,-32766, - -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 1245,-32766,-32766, 1322, 754, 1112, 1113, 1114, 1111, - 1110, 1109, 1115, 459, 460, 461, 2, 990, 1306, 265, - 139, 404, 758, 759, 760, 761, 467, 468, 429, 835, - 606, -16, 1341, 23, 292, 815, 762, 763, 764, 765, - 766, 767, 768, 769, 770, 771, 791, 583, 792, 793, - 794, 795, 783, 784, 345, 346, 786, 787, 772, 773, - 774, 776, 777, 778, 356, 818, 819, 820, 821, 822, - 584, 779, 780, 585, 586, 941, 803, 801, 802, 814, - 798, 799, 835, 826, 587, 588, 797, 589, 590, 591, - 592, 593, 594, -328, 36, 251, 35, -194, 800, 595, - 596, -193, 140, -85, 133, 134, 135, 582, 136, 137, - 1060, 751, 752, 753, 138, 38, 129, -110, -110, -585, - -32766, -585, -110,-32766,-32766,-32766, 241, 836, -110, 145, - 959, 960,-32766,-32766,-32766, 961, -594,-32766, 482, 745, - 744, 955, 1036, -594,-32766, 991,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, 299, 754, - 831, 75,-32766,-32766,-32766, 291, 142, 326, 242, -85, - 326, 382, 381, 265, 139, 404, 758, 759, 760, 761, - 82, 423, 429,-32766, 326,-32766,-32766,-32766,-32766, 815, - 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, - 791, 583, 792, 793, 794, 795, 783, 784, 345, 346, - 786, 787, 772, 773, 774, 776, 777, 778, 356, 818, - 819, 820, 821, 822, 584, 779, 780, 585, 586, 254, - 803, 801, 802, 814, 798, 799, 832, 725, 587, 588, - 797, 589, 590, 591, 592, 593, 594, -328, 83, 84, - 85, -194, 800, 595, 596, -193, 149, 775, 746, 747, - 748, 749, 750, 151, 751, 752, 753, 788, 789, 37, - 483, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, -594, 274, -594,-32766,-32766, - -32766,-32766,-32766,-32766, 310, 1089, 127, 312, 110, 737, - 1326, 21, 754,-32766,-32766,-32766, -272, 1325,-32766,-32766, - 1088,-32766,-32766,-32766,-32766,-32766, 755, 756, 757, 758, - 759, 760, 761, 1104,-32766, 824,-32766,-32766, -545, 429, - 1036, 323, 815, 762, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 791, 813, 792, 793, 794, 795, 783, - 784, 785, 812, 786, 787, 772, 773, 774, 776, 777, - 778, 817, 818, 819, 820, 821, 822, 823, 779, 780, - 781, 782, 1033, 803, 801, 802, 814, 798, 799, 745, - 744, 790, 796, 797, 804, 805, 807, 806, 808, 809, - 152,-32766, -545, -545, 1036, 800, 811, 810, 50, 51, - 52, 513, 53, 54, 1240, 1239, 1241, -545, 55, 56, - -110, 57,-32766, 1090, 920, -110, 556, -110, 292, -551, - 339, -545, 306, 103, 104, -110, -110, -110, -110, -110, - -110, -110, -110, 105, 106, 107, 108, 109, 1245, 274, - 380, 381, -591, -367, 715, -367, 340, 58, 59, -591, - 423, 110, 60, 370, 61, 248, 249, 62, 63, 64, - 65, 66, 67, 68, 69, -544, 28, 267, 70, 445, - 514,-32766, 374, -342, 1272, 1273, 515, 1278, 835, 862, - 389, 863, 1270, 42, 25, 516, 943, 517, 943, 518, - 920, 519, 299, 1036, 520, 521, 1266, 910, 441, 44, - 45, 446, 377, 376,-32766, 46, 522, 1023, 1022, 1021, - 1024, 368, 338, 391, 1238, 7, 291, 442, 1231, 835, - 524, 525, 526, 443, 1245, 357, 1036, 362, 834, -544, - -544, 154, 528, 529, 444, 1259, 1260, 1261, 1262, 1256, - 1257, 298,-32766,-32766, -544, -548, 1059, 1263, 1258, 291, - 1236, 1240, 1239, 1241, 299, 841, -550, 71, -544, 656, - 26, 321, 322, 326, -153, -153, -153, 920, 612, 675, - 676, 1035, 922, 910,-32766, 286, 710, 835, 155, -153, - 828, -153, 862, -153, 863, -153, 150, 407, 156, 1240, - 1239, 1241,-32766,-32766,-32766, 375, 1351, 716, 75, 1352, - 158, -591, 33, -591, 326, 835, 959, 960, -78, -548, - -548, 523, 920,-32766, 378, 379, 896, 955, -110, -110, - -110, 32, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 745, 744, -58, -548, -57, - -110, -110, 717, 745, 744, -110, 383, 384, 922, 1033, - 910, -110, 710, -153, 647, 648, 830, 124, 141, 125, - -32766, 1033, 326, 712, 1150, 1152, 48, 130, 131, 144, - 159, 1036,-32766, 160, 161, -543, 28, 162, 1238, 920, - 163, 299, 920, 1036, 75,-32766,-32766,-32766, 835,-32766, - 326,-32766, 1270,-32766, 282, 910,-32766, -87, -84, -78, - -73,-32766,-32766,-32766, -4, 920, 282,-32766,-32766, 720, - -72, -71, 727,-32766, 420, -70, -69, -68, -67, -66, - 287, 286,-32766, -65, -46, 922, 745, 744, 1231, 710, - 300, 301, -546, -18, 148, -302, 273, 283, 726, -543, - -543, 729, 528, 529, 920, 1259, 1260, 1261, 1262, 1256, - 1257, 919, 74, 147, -543, 288, 293, 1263, 1258, 126, - -298, 280, 910,-32766, 281, 910, 284, 73, -543, 1238, - 976, 690, 322, 326, 710, 285,-32766,-32766,-32766, 332, - -32766, 274,-32766, 294,-32766, 937, 110,-32766, 910, 685, - 835, -543,-32766,-32766,-32766, 826, -546, -546,-32766,-32766, - 146,-32766, -50, 701,-32766, 420, 703, 691, 20, 1119, - 375, -546, 436,-32766, 645, 1353, 1277, 297, 657,-32766, - 1279, 959, 960, 561, 956, -546, 523, 910, 692, 693, - 678, 527, 955, -110, -110, -110, 132, 922, 662, 663, - 922, 710, 464, -508, 710,-32766, 1240, 1239, 1241, 493, - 679, 1238, 282, 939, 10, -543, -543, 40,-32766,-32766, - -32766, 731,-32766, 922,-32766, 307,-32766, 710, -4,-32766, - -543, 305, 41, 304,-32766,-32766,-32766, 0, 0,-32766, - -32766,-32766, 920, 0, -543, 1238,-32766, 420, 311, 0, - 567, 299,-32766,-32766,-32766,-32766,-32766, -498,-32766, 897, - -32766, 0, 922,-32766, 8, 0, 710, 24,-32766,-32766, - -32766,-32766, 372, 610,-32766,-32766, 834, 1238, 734, -275, - -32766, 420, 920, 735,-32766,-32766,-32766, 854,-32766,-32766, - -32766, 901,-32766, 1000, 977,-32766, 49, 984, 974, 488, - -32766,-32766,-32766,-32766, 985, 899,-32766,-32766, 972, 1238, - 574, 1093,-32766, 420, 1096, 1097,-32766,-32766,-32766, 1094, - -32766,-32766,-32766, 1095,-32766, 910, 1101,-32766, 1267, 846, - 1292, 1310,-32766,-32766,-32766, 1344, 650, 34,-32766,-32766, - -579, -250, -250, -250,-32766, 420, -578, 375, -577, -551, - 28, 267, -550,-32766, -549, -492, 1, 29, 959, 960, - 302, 303, 835, 523, 30, 910, 1270, 39, 896, 955, - -110, -110, -110, 43, 47, 373, 72, 76, 77, 78, - 79, -249, -249, -249, 80, 81, 143, 375, 153, 128, - -273, 157, 247, 328, 357, 358, 359, 360, 959, 960, - 922, 361, 1231, 523, 710, -250, 362, 363, 896, 955, - -110, -110, -110, 364, 365, 366, 367, 529, 28, 1259, - 1260, 1261, 1262, 1256, 1257, 369, 437, 555, 1207, -272, - 835, 1263, 1258, 13, 1270, 14,-32766, 15, 16, 18, - 922, 73, 1238, 1348, 710, -249, 322, 326, 406,-32766, - -32766,-32766, 484,-32766, 485,-32766, 492,-32766, 495, 496, - -32766, 497, 498, 502, 503,-32766,-32766,-32766, 504, 511, - 1231,-32766,-32766, 572, 696, 1249, 1190,-32766, 420, 1268, - 1062, 1061, 1042, 1226, 1038, 529,-32766, 1259, 1260, 1261, - 1262, 1256, 1257, -277, -102, 12, 17, 27, 296, 1263, - 1258, 405, 603, 607, 636, 702, 1194, 1244, 1191, 73, - 320, 1323, 0, 371, 322, 326, 711, 714, 718, 719, - 721, 722, 723, 724, 728, 0, 713, 0, 1350, 857, - 856, 865, 949, 992, 864, 1349, 948, 946, 947, 950, - 1222, 930, 940, 928, 982, 983, 634, 1347, 1304, 1293, - 1311, 1320, 0, 0, 1271, 0, 326 - ); - - protected array $actionCheck = array( - 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 70, 9, 10, 11, 9, 10, 11, 1, - 80, 44, 45, 46, 47, 48, 49, 50, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 1, 9, 10, 1, 57, 116, 117, 118, 119, - 120, 121, 122, 129, 130, 131, 8, 31, 1, 71, - 72, 73, 74, 75, 76, 77, 134, 135, 80, 82, - 1, 31, 85, 8, 30, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 1, 128, 129, 130, 131, - 132, 133, 82, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 8, 147, 148, 8, 8, 150, 151, - 152, 8, 154, 31, 2, 3, 4, 5, 6, 7, - 162, 9, 10, 11, 12, 13, 8, 117, 118, 160, - 116, 162, 122, 9, 10, 11, 97, 159, 128, 8, - 117, 118, 9, 10, 11, 122, 1, 137, 31, 37, - 38, 128, 138, 8, 30, 159, 32, 33, 34, 35, - 36, 37, 38, 30, 9, 32, 33, 34, 158, 57, - 80, 161, 9, 10, 11, 161, 163, 167, 14, 97, - 167, 106, 107, 71, 72, 73, 74, 75, 76, 77, - 163, 116, 80, 30, 167, 32, 33, 34, 35, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 8, - 128, 129, 130, 131, 132, 133, 156, 163, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 162, 9, 10, - 11, 162, 150, 151, 152, 162, 154, 2, 3, 4, - 5, 6, 7, 14, 9, 10, 11, 12, 13, 30, - 163, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 160, 57, 162, 9, 10, - 11, 9, 10, 11, 8, 159, 14, 8, 69, 163, - 1, 101, 57, 9, 10, 11, 162, 8, 116, 30, - 1, 32, 33, 34, 35, 36, 71, 72, 73, 74, - 75, 76, 77, 123, 30, 80, 32, 33, 70, 80, - 138, 8, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 116, 128, 129, 130, 131, 132, 133, 37, - 38, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 14, 116, 134, 135, 138, 150, 151, 152, 2, 3, - 4, 5, 6, 7, 155, 156, 157, 149, 12, 13, - 101, 15, 137, 164, 1, 106, 85, 108, 30, 161, - 8, 163, 113, 49, 50, 116, 117, 118, 119, 120, - 121, 122, 123, 51, 52, 53, 54, 55, 1, 57, - 106, 107, 1, 106, 31, 108, 8, 51, 52, 8, - 116, 69, 56, 8, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 70, 70, 71, 72, 73, - 74, 116, 8, 164, 78, 79, 80, 146, 82, 106, - 8, 108, 86, 87, 88, 89, 122, 91, 122, 93, - 1, 95, 158, 138, 98, 99, 1, 84, 8, 103, - 104, 105, 106, 107, 116, 109, 110, 119, 120, 121, - 122, 115, 116, 106, 80, 108, 161, 8, 122, 82, - 124, 125, 126, 8, 1, 161, 138, 161, 155, 134, - 135, 14, 136, 137, 8, 139, 140, 141, 142, 143, - 144, 145, 51, 52, 149, 70, 1, 151, 152, 161, - 116, 155, 156, 157, 158, 8, 161, 161, 163, 75, - 76, 165, 166, 167, 75, 76, 77, 1, 52, 75, - 76, 137, 159, 84, 137, 30, 163, 82, 14, 90, - 80, 92, 106, 94, 108, 96, 101, 102, 14, 155, - 156, 157, 9, 10, 11, 106, 80, 31, 161, 83, - 14, 160, 14, 162, 167, 82, 117, 118, 16, 134, - 135, 122, 1, 30, 106, 107, 127, 128, 129, 130, - 131, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 37, 38, 16, 163, 16, - 117, 118, 31, 37, 38, 122, 106, 107, 159, 116, - 84, 128, 163, 164, 111, 112, 156, 16, 163, 16, - 137, 116, 167, 163, 59, 60, 70, 16, 16, 16, - 16, 138, 74, 16, 16, 70, 70, 16, 80, 1, - 16, 158, 1, 138, 161, 87, 88, 89, 82, 91, - 167, 93, 86, 95, 161, 84, 98, 31, 31, 31, - 31, 103, 104, 105, 0, 1, 161, 109, 110, 31, - 31, 31, 31, 115, 116, 31, 31, 31, 31, 31, - 37, 30, 124, 31, 31, 159, 37, 38, 122, 163, - 134, 135, 70, 31, 31, 35, 31, 31, 31, 134, - 135, 31, 136, 137, 1, 139, 140, 141, 142, 143, - 144, 31, 154, 31, 149, 37, 37, 151, 152, 163, - 35, 35, 84, 74, 35, 84, 35, 161, 163, 80, - 159, 80, 166, 167, 163, 35, 87, 88, 89, 35, - 91, 57, 93, 37, 95, 38, 69, 98, 84, 77, - 82, 70, 103, 104, 105, 80, 134, 135, 109, 110, - 70, 85, 31, 80, 115, 116, 92, 116, 97, 82, - 106, 149, 108, 124, 113, 83, 146, 113, 90, 137, - 146, 117, 118, 89, 128, 163, 122, 84, 137, 138, - 94, 127, 128, 129, 130, 131, 31, 159, 96, 100, - 159, 163, 97, 149, 163, 74, 155, 156, 157, 97, - 100, 80, 161, 154, 150, 134, 135, 159, 87, 88, - 89, 164, 91, 159, 93, 114, 95, 163, 164, 98, - 149, 133, 159, 132, 103, 104, 105, -1, -1, 74, - 109, 110, 1, -1, 163, 80, 115, 116, 132, -1, - 153, 158, 87, 88, 89, 124, 91, 149, 93, 164, - 95, -1, 159, 98, 149, -1, 163, 149, 103, 104, - 105, 74, 149, 153, 109, 110, 155, 80, 159, 162, - 115, 116, 1, 159, 87, 88, 89, 159, 91, 124, - 93, 159, 95, 159, 159, 98, 70, 159, 159, 102, - 103, 104, 105, 74, 159, 159, 109, 110, 159, 80, - 81, 159, 115, 116, 159, 159, 87, 88, 89, 159, - 91, 124, 93, 159, 95, 84, 159, 98, 160, 160, - 160, 160, 103, 104, 105, 160, 160, 163, 109, 110, - 161, 100, 101, 102, 115, 116, 161, 106, 161, 161, - 70, 71, 161, 124, 161, 161, 161, 161, 117, 118, - 134, 135, 82, 122, 161, 84, 86, 161, 127, 128, - 129, 130, 131, 161, 161, 149, 161, 161, 161, 161, - 161, 100, 101, 102, 161, 161, 161, 106, 161, 163, - 162, 161, 161, 161, 161, 161, 161, 161, 117, 118, - 159, 161, 122, 122, 163, 164, 161, 161, 127, 128, - 129, 130, 131, 161, 161, 161, 161, 137, 70, 139, - 140, 141, 142, 143, 144, 161, 161, 161, 165, 162, - 82, 151, 152, 162, 86, 162, 74, 162, 162, 162, - 159, 161, 80, 164, 163, 164, 166, 167, 162, 87, - 88, 89, 162, 91, 162, 93, 162, 95, 162, 162, - 98, 162, 162, 162, 162, 103, 104, 105, 162, 162, - 122, 109, 110, 162, 162, 162, 162, 115, 116, 162, - 162, 162, 162, 162, 162, 137, 124, 139, 140, 141, - 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, - 152, 162, 162, 162, 162, 162, 162, 162, 162, 161, - 163, 162, -1, 163, 166, 167, 163, 163, 163, 163, - 163, 163, 163, 163, 163, -1, 163, -1, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, -1, -1, 166, -1, 167 - ); - - protected array $actionBase = array( - 0, -2, 152, 549, 764, 941, 981, 751, 555, 309, - 560, 864, 626, 738, 738, 741, 738, 473, 671, 783, - -60, 305, 305, 783, 305, 803, 803, 803, 658, 658, - 658, 658, 749, 749, 897, 897, 929, 865, 831, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, - 1062, 1062, 1062, 1062, 18, 36, 79, 648, 1036, 1044, - 1040, 1045, 1034, 1033, 1039, 1041, 1046, 1083, 1084, 782, - 1085, 1086, 1082, 1087, 1042, 876, 1035, 1043, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 195, 342, 43, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 643, 643, - 643, 666, 666, 354, 173, 980, 203, 1048, 1048, 1048, - 1048, 1048, 1048, 1048, 1048, 1048, 665, 339, 164, 164, - 7, 7, 7, 7, 7, 50, 369, 583, -23, -23, - -23, -23, 448, 605, 497, 260, 397, 434, 54, 394, - 593, 593, 316, 316, 415, 415, 316, 316, 316, 442, - 442, 252, 252, 252, 252, 318, 455, 433, 391, 742, - 53, 53, 53, 53, 742, 742, 742, 742, 734, 1088, - 742, 742, 742, 722, 781, 781, 926, 551, 551, 781, - 536, -3, -3, 536, 63, -3, 67, 576, 335, 756, - 115, 9, 335, 535, 656, 501, 185, 821, 568, 821, - 1032, 424, 776, 776, 426, 753, 729, 867, 1063, 1049, - 799, 1080, 810, 1081, -66, -58, 728, 1031, 1031, 1031, - 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1089, 402, - 1032, 130, 1089, 1089, 1089, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 603, 130, 544, 554, 130, - 804, 402, 18, 808, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 762, 157, 18, 36, 124, 124, - 196, 37, 124, 124, 124, 124, 18, 18, 18, 18, - 568, 784, 797, 600, 820, 143, 784, 784, 784, 122, - 135, 204, 139, 760, 785, 467, 775, 775, 787, 895, - 895, 775, 768, 775, 787, 913, 775, 775, 895, 895, - 793, 158, 550, 472, 524, 569, 895, 346, 775, 775, - 775, 775, 816, 575, 775, 271, 171, 775, 775, 816, - 801, 766, 58, 798, 895, 895, 895, 816, 505, 798, - 798, 798, 819, 824, 761, 765, 383, 349, 607, 138, - 807, 765, 765, 775, 532, 761, 765, 761, 765, 759, - 765, 765, 765, 761, 765, 768, 498, 765, 714, 586, - 75, 765, 6, 915, 916, 726, 917, 906, 918, 965, - 919, 923, 1053, 894, 931, 912, 924, 966, 903, 896, - 780, 701, 703, 815, 754, 893, 777, 777, 777, 888, - 777, 777, 777, 777, 777, 777, 777, 777, 701, 868, - 823, 794, 934, 711, 712, 1011, 730, 795, 963, 933, - 1013, 925, 758, 713, 977, 935, 757, 1047, 936, 940, - 986, 1014, 828, 1017, 979, 790, 1064, 1065, 869, 946, - 1054, 777, 915, 923, 727, 912, 924, 903, 896, 752, - 748, 746, 747, 745, 744, 739, 740, 763, 1018, 887, - 879, 870, 945, 891, 701, 871, 971, 874, 990, 992, - 1050, 805, 792, 875, 1066, 952, 953, 954, 1055, 1019, - 1056, 773, 973, 817, 994, 812, 1067, 996, 997, 999, - 1000, 1057, 1068, 1058, 885, 1059, 832, 788, 928, 802, - 1069, 299, 791, 800, 806, 964, 436, 932, 1060, 1070, - 1071, 1001, 1002, 1006, 1072, 1073, 927, 834, 975, 796, - 976, 967, 835, 838, 577, 779, 1020, 786, 789, 778, - 624, 634, 1074, 1075, 1076, 930, 767, 772, 839, 845, - 1021, 743, 1022, 1077, 646, 846, 717, 1078, 1012, 718, - 721, 652, 683, 681, 724, 774, 1061, 818, 811, 771, - 955, 721, 770, 849, 1079, 852, 855, 856, 1007, 860, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 456, 456, 456, 456, 456, 456, 305, 305, 305, 305, - 305, 456, 456, 456, 456, 456, 456, 456, 305, 305, - 0, 0, 305, 0, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - 456, 456, 456, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, - 494, 494, 289, 289, 494, 289, 494, 494, 494, 494, - 494, 494, 494, 494, 494, 0, 289, 289, 289, 289, - 289, 289, 289, 289, 494, 793, 494, 442, 442, 442, - 442, 494, 494, 494, -88, -88, 442, 494, 63, 494, - 494, 494, 494, 494, 494, 494, 494, 494, 0, 0, - 494, 494, 494, 494, 0, 0, 130, -3, 494, 768, - 768, 768, 768, 494, 494, 494, 494, -3, -3, 494, - 494, 494, 0, 0, 0, 0, 442, 442, 0, 130, - 0, 0, 130, 0, 0, 768, 768, 494, 63, 793, - 359, 494, 0, 0, 0, 0, 130, 768, 130, 402, - 775, -3, -3, 775, 402, 402, 124, 18, 359, 545, - 545, 545, 545, 0, 0, 568, 793, 793, 793, 793, - 793, 793, 793, 793, 793, 793, 793, 768, 0, 793, - 0, 768, 768, 768, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 768, - 0, 0, 895, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, - 768, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 777, 805, 0, 805, 0, 777, 777, 777, 0, 0, - 0, 0, 779, 743 - ); - - protected array $actionDefault = array( - 3,32767, 102,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 100,32767,32767,32767,32767, 597, 597, - 597, 597,32767,32767, 254, 102,32767,32767, 470, 387, - 387, 387,32767,32767, 541, 541, 541, 541, 541, 541, - 32767,32767,32767,32767,32767,32767, 470,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 100, - 32767,32767,32767, 36, 7, 8, 10, 11, 49, 17, - 324,32767,32767,32767,32767, 102,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 590,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 474, 453, - 454, 456, 457, 386, 542, 596, 327, 593, 385, 145, - 339, 329, 242, 330, 258, 475, 259, 476, 479, 480, - 215, 287, 382, 149, 150, 417, 471, 419, 469, 473, - 418, 392, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 390, 391, 472, 450, 449, - 448,32767,32767, 415, 416,32767, 420,32767,32767,32767, - 32767,32767,32767,32767, 102,32767, 389, 423, 421, 422, - 439, 440, 437, 438, 441,32767,32767,32767, 442, 443, - 444, 445, 316,32767,32767, 366, 364, 424, 316, 111, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 430, - 431,32767,32767,32767,32767, 535, 447,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 102,32767, 100, 537, 412, 414, 504, 425, 426, 393, - 32767, 511,32767, 102,32767, 513,32767,32767,32767,32767, - 32767,32767,32767, 536,32767, 543, 543,32767, 497, 100, - 195,32767,32767, 512,32767, 195, 195,32767,32767,32767, - 32767,32767,32767,32767,32767, 604, 497, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110,32767, 195, - 110,32767,32767,32767, 100, 195, 195, 195, 195, 195, - 195, 195, 195, 195, 195, 190,32767, 268, 270, 102, - 558, 195,32767, 516,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 509,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 497, 435, 138,32767, 138, 543, 427, 428, 429, 499, - 543, 543, 543, 312, 289,32767,32767,32767,32767, 514, - 514, 100, 100, 100, 100, 509,32767,32767,32767,32767, - 111, 99, 99, 99, 99, 99, 103, 101,32767,32767, - 32767,32767, 223, 99,32767, 101, 101,32767,32767, 223, - 225, 212, 101, 227,32767, 562, 563, 223, 101, 227, - 227, 227, 247, 247, 486, 318, 101, 99, 101, 101, - 197, 318, 318,32767, 101, 486, 318, 486, 318, 199, - 318, 318, 318, 486, 318,32767, 101, 318, 214, 99, - 99, 318,32767,32767,32767, 499,32767,32767,32767,32767, - 32767,32767,32767, 222,32767,32767,32767,32767,32767,32767, - 32767,32767, 530,32767, 547, 560, 433, 434, 436, 545, - 458, 459, 460, 461, 462, 463, 464, 466, 592,32767, - 503,32767,32767,32767, 338,32767, 602,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 603,32767, 543,32767,32767,32767, - 32767, 432, 9, 74, 492, 42, 43, 51, 57, 520, - 521, 522, 523, 517, 518, 524, 519,32767,32767, 525, - 568,32767,32767, 544, 595,32767,32767,32767,32767,32767, - 32767, 138,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 530,32767, 136,32767,32767,32767,32767, - 32767,32767,32767,32767, 526,32767,32767,32767, 543,32767, - 32767,32767,32767, 314, 311,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 543,32767,32767,32767,32767,32767, 291,32767, 308, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 286,32767,32767, 381, - 499, 294, 296, 297,32767,32767,32767,32767, 360,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 152, 152, 3, 3, 341, 152, 152, 152, 341, 341, - 152, 341, 341, 341, 152, 152, 152, 152, 152, 152, - 280, 185, 262, 265, 247, 247, 152, 352, 152 - ); - - protected array $goto = array( - 196, 196, 1034, 1065, 697, 431, 661, 621, 658, 319, - 706, 425, 314, 315, 335, 576, 430, 336, 432, 638, - 654, 655, 852, 672, 673, 674, 853, 167, 167, 167, - 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, - 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, - 189, 190, 191, 192, 218, 216, 219, 536, 537, 421, - 538, 540, 541, 542, 543, 544, 545, 546, 547, 1136, - 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, - 176, 178, 215, 217, 220, 238, 243, 244, 246, 257, - 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, - 271, 277, 289, 290, 317, 318, 426, 427, 428, 581, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, - 200, 239, 188, 189, 190, 191, 192, 218, 1136, 201, - 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, - 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, - 212, 213, 214, 855, 1232, 975, 279, 279, 279, 279, - 623, 623, 419, 351, 1269, 600, 1269, 1269, 1269, 1269, - 1269, 1269, 1269, 1269, 1269, 1287, 1287, 599, 1100, 1287, - 709, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, - 508, 700, 827, 1098, 458, 559, 552, 860, 833, 909, - 904, 905, 918, 861, 906, 858, 907, 908, 859, 1233, - 1234, 912, 500, 886, 501, 252, 252, 843, 1107, 1108, - 507, 1087, 1082, 1083, 1084, 341, 552, 559, 568, 569, - 344, 579, 602, 616, 617, 1235, 1295, 1296, 833, 440, - 833, 22, 250, 250, 250, 250, 245, 253, 694, 573, - 1237, 829, 1237, 893, 851, 893, 893, 1034, 1034, 1237, - 694, 349, 342, 1034, 694, 1034, 1034, 1034, 1034, 1034, - 1034, 1034, 1034, 1034, 848, 1327, 1034, 1034, 1034, 1034, - 1319, 1319, 1319, 1319, 1237, 343, 342, 1040, 1039, 1237, - 1237, 1237, 1237, 868, 996, 1237, 1237, 1237, 913, 355, - 914, 354, 354, 354, 354, 466, 466, 479, 880, 355, - 355, 867, 394, 926, 466, 481, 571, 927, 967, 410, - 705, 942, 355, 355, 942, 848, 355, 660, 1354, 609, - 624, 627, 628, 629, 630, 651, 652, 653, 708, 554, - 1133, 1285, 1285, 355, 355, 1285, 1058, 1285, 1285, 1285, - 1285, 1285, 1285, 1285, 1285, 1285, 539, 539, 1185, 424, - 539, 611, 539, 539, 539, 539, 539, 539, 539, 539, - 539, 566, 682, 1337, 1337, 733, 637, 639, 1043, 1044, - 659, 476, 1312, 1313, 683, 687, 1010, 695, 704, 1006, - 1337, 1298, 438, 408, 409, 631, 633, 635, 670, 5, - 671, 6, 412, 413, 414, 337, 684, 1340, 1340, 415, - 325, 309, 686, 347, 352, 353, 553, 563, 450, 450, - 450, 553, 1309, 563, 1309, 666, 397, 462, 845, 1314, - 1315, 1309, 548, 548, 548, 548, 873, 604, 469, 580, - 470, 471, 403, 554, 878, 848, 958, 1345, 1346, 577, - 614, 870, 550, 615, 550, 255, 255, 1321, 1321, 1321, - 1321, 550, 999, 1018, 477, 971, 1228, 732, 736, 881, - 869, 1070, 1074, 876, 882, 551, 1008, 1003, 1071, 1075, - 978, 980, 0, 1305, 1118, 0, 456, 0, 0, 0, - 0, 969, 969, 969, 969, 0, 0, 456, 963, 970, - 0, 0, 0, 0, 968, 0, 1230, 0, 0, 0, - 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, - 450, 931, 1123, 450, 0, 1073, 1116, 885, 619, 1307, - 1307, 1073, 1216, 944, 1015, 433, 1217, 1220, 945, 1221, - 0, 433, 872, 0, 664, 994, 0, 1041, 1041, 0, - 866, 0, 0, 0, 665, 1052, 1048, 1049, 0, 0, - 0, 0, 1227, 324, 275, 324, 1037, 1037, 681, 952, - 0, 0, 1029, 1045, 1046, 396, 399, 560, 601, 605, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1013, 1013 - ); - - protected array $gotoCheck = array( - 42, 42, 73, 127, 73, 66, 66, 56, 56, 66, - 9, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 86, 86, 26, 86, 86, 86, 27, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 15, 20, 49, 23, 23, 23, 23, - 108, 108, 43, 97, 108, 130, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 170, 170, 8, 8, 170, - 8, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 8, 8, 6, 8, 83, 76, 76, 15, 12, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 20, - 20, 15, 155, 45, 155, 5, 5, 20, 144, 144, - 155, 15, 15, 15, 15, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 20, 20, 20, 12, 83, - 12, 76, 5, 5, 5, 5, 5, 5, 7, 172, - 73, 7, 73, 25, 25, 25, 25, 73, 73, 73, - 7, 179, 168, 73, 7, 73, 73, 73, 73, 73, - 73, 73, 73, 73, 22, 181, 73, 73, 73, 73, - 9, 9, 9, 9, 73, 168, 168, 118, 118, 73, - 73, 73, 73, 35, 103, 73, 73, 73, 65, 14, - 65, 24, 24, 24, 24, 149, 149, 84, 35, 14, - 14, 35, 62, 73, 149, 84, 104, 73, 93, 93, - 93, 9, 14, 14, 9, 22, 14, 64, 14, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 14, - 150, 171, 171, 14, 14, 171, 114, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 173, 173, 151, 13, - 173, 13, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 48, 116, 182, 182, 48, 48, 48, 119, 119, - 48, 176, 176, 176, 48, 48, 48, 48, 48, 48, - 182, 14, 113, 82, 82, 85, 85, 85, 82, 46, - 82, 46, 82, 82, 82, 29, 82, 182, 182, 82, - 169, 169, 14, 82, 97, 97, 9, 9, 23, 23, - 23, 9, 130, 9, 130, 120, 9, 9, 18, 178, - 178, 130, 107, 107, 107, 107, 39, 107, 9, 9, - 9, 9, 28, 14, 9, 22, 92, 9, 9, 2, - 2, 37, 19, 80, 19, 5, 5, 130, 130, 130, - 130, 19, 50, 110, 157, 50, 160, 50, 99, 16, - 16, 16, 16, 9, 41, 50, 50, 50, 129, 132, - 16, 96, -1, 130, 147, -1, 19, -1, -1, -1, - -1, 19, 19, 19, 19, -1, -1, 19, 19, 19, - -1, -1, -1, -1, 16, -1, 14, -1, -1, -1, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 17, 17, 23, -1, 130, 16, 16, 17, 130, - 130, 130, 79, 79, 17, 117, 79, 79, 79, 79, - -1, 117, 17, -1, 17, 17, -1, 117, 117, -1, - 17, -1, -1, -1, 117, 117, 117, 117, -1, -1, - -1, -1, 17, 24, 24, 24, 89, 89, 89, 89, - -1, -1, 89, 89, 89, 59, 59, 59, 59, 59, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 107 - ); - - protected array $gotoBase = array( - 0, 0, -253, 0, 0, 224, 182, 251, 179, -10, - 0, 0, -89, 32, 11, -185, 27, 66, 128, 197, - -229, 0, 5, 163, 308, 260, 18, 22, 115, 118, - 0, 0, 0, 0, 0, -68, 0, 122, 0, 123, - 0, 43, -1, 153, 0, 200, -327, 0, -330, 147, - 460, 0, 0, 0, 0, 0, -33, 0, 0, 540, - 0, 0, 280, 0, 95, 294, -236, 0, 0, 0, - 0, 0, 0, -5, 0, 0, -140, 0, 0, 134, - 119, -19, -88, -75, -152, -74, -698, 0, 0, 296, - 0, 0, 127, 23, 0, 0, 48, -310, 0, 71, - 0, 0, 0, 269, 283, 0, 0, 414, -71, 0, - 103, 0, 0, 124, 83, 0, 100, 273, 17, 104, - 144, 0, 0, 0, 0, 0, 0, 1, 0, 114, - 167, 0, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -47, 0, 0, 50, 0, 281, - 105, 94, 0, 0, 0, -273, 0, 34, 0, 0, - 107, 0, 0, 0, 0, 0, 0, 0, -26, 99, - -56, 110, 230, 125, 0, 0, 90, 0, 67, 241, - 0, 254, 75, 0, 0 - ); - - protected array $gotoDefault = array( - -32768, 512, 740, 4, 741, 935, 816, 825, 597, 530, - 707, 348, 625, 422, 1303, 911, 1122, 578, 844, 1246, - 1254, 457, 847, 330, 730, 923, 894, 895, 400, 386, - 392, 398, 649, 626, 494, 879, 453, 871, 486, 874, - 452, 883, 164, 418, 510, 887, 3, 890, 557, 921, - 973, 387, 898, 388, 677, 900, 562, 902, 903, 395, - 401, 402, 1127, 570, 622, 915, 256, 564, 916, 385, - 917, 925, 390, 393, 688, 465, 505, 499, 411, 1102, - 565, 608, 646, 447, 473, 620, 632, 618, 480, 434, - 416, 329, 957, 965, 487, 463, 979, 350, 987, 738, - 1135, 640, 489, 995, 641, 1002, 1005, 531, 532, 478, - 1017, 272, 1020, 490, 19, 667, 1031, 1032, 668, 642, - 1054, 643, 669, 644, 1056, 472, 598, 1064, 454, 1072, - 1291, 455, 1076, 266, 1079, 278, 417, 435, 1085, 1086, - 9, 1092, 698, 699, 11, 276, 509, 1117, 689, 451, - 1134, 439, 1204, 1206, 558, 491, 1224, 1223, 680, 506, - 1229, 448, 1294, 449, 533, 474, 316, 534, 1338, 308, - 333, 313, 549, 295, 334, 535, 475, 1300, 1308, 331, - 31, 1328, 1339, 575, 613 - ); - - protected array $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, - 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, - 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, - 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, - 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, - 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 50, 69, 69, 72, 72, 71, - 70, 70, 63, 75, 75, 76, 76, 77, 77, 78, - 78, 79, 79, 80, 80, 26, 26, 27, 27, 27, - 27, 27, 88, 88, 90, 90, 83, 83, 91, 91, - 92, 92, 92, 84, 84, 87, 87, 85, 85, 93, - 94, 94, 57, 57, 65, 65, 68, 68, 68, 67, - 95, 95, 96, 58, 58, 58, 58, 97, 97, 98, - 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, - 55, 55, 51, 51, 105, 53, 53, 106, 52, 52, - 54, 54, 64, 64, 64, 64, 81, 81, 109, 109, - 111, 111, 112, 112, 112, 112, 110, 110, 110, 114, - 114, 114, 114, 89, 89, 117, 117, 117, 118, 118, - 115, 115, 119, 119, 121, 121, 122, 122, 116, 123, - 123, 120, 124, 124, 124, 124, 113, 113, 82, 82, - 82, 20, 20, 20, 126, 125, 125, 127, 127, 127, - 127, 60, 128, 128, 129, 61, 131, 131, 132, 132, - 133, 133, 86, 134, 134, 134, 134, 134, 134, 134, - 139, 139, 140, 140, 141, 141, 141, 141, 141, 142, - 143, 143, 138, 138, 135, 135, 137, 137, 145, 145, - 144, 144, 144, 144, 144, 144, 144, 136, 146, 146, - 148, 147, 147, 62, 104, 149, 149, 56, 56, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 156, 150, 150, 155, 155, 158, 159, - 159, 160, 161, 162, 162, 162, 162, 19, 19, 73, - 73, 73, 73, 151, 151, 151, 151, 164, 164, 152, - 152, 154, 154, 154, 157, 157, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 171, 171, 171, 108, 173, - 173, 173, 173, 153, 153, 153, 153, 153, 153, 153, - 153, 59, 59, 167, 167, 167, 167, 174, 174, 163, - 163, 163, 175, 175, 175, 175, 175, 175, 74, 74, - 66, 66, 66, 66, 130, 130, 130, 130, 178, 177, - 166, 166, 166, 166, 166, 166, 166, 165, 165, 165, - 176, 176, 176, 176, 107, 172, 180, 180, 179, 179, - 181, 181, 181, 181, 181, 181, 181, 181, 169, 169, - 169, 169, 168, 183, 182, 182, 182, 182, 182, 182, - 182, 182, 184, 184, 184, 184 - ); - - protected array $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, - 0, 1, 1, 1, 1, 4, 3, 5, 4, 3, - 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, - 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, - 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 1, 0, 2, 1, 3, 8, - 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, - 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, - 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, - 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, - 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, - 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, - 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, - 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, - 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, - 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, - 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, - 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, - 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, - 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, - 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, - 3, 3, 3, 4, 4, 1, 1, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, - 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, - 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, - 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, - 3, 2, 1, 2, 2, 2, 4, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 1, 1, 0, - 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 5, 3, 3, 4, - 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, - 3, 0, 1, 1, 3, 1, 1, 1, 1, 1, - 3, 1, 1, 4, 4, 1, 4, 4, 0, 1, - 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, - 1, 4, 4, 3, 3, 3, 3, 1, 3, 1, - 1, 3, 1, 1, 4, 1, 1, 1, 3, 1, - 1, 2, 1, 3, 4, 3, 2, 0, 2, 2, - 1, 2, 1, 1, 1, 4, 3, 3, 3, 3, - 6, 3, 1, 1, 2, 1 - ); - - protected function initReduceCallbacks(): void { - $this->reduceCallbacks = [ - 0 => null, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => null, - 6 => null, - 7 => null, - 8 => null, - 9 => null, - 10 => null, - 11 => null, - 12 => null, - 13 => null, - 14 => null, - 15 => null, - 16 => null, - 17 => null, - 18 => null, - 19 => null, - 20 => null, - 21 => null, - 22 => null, - 23 => null, - 24 => null, - 25 => null, - 26 => null, - 27 => null, - 28 => null, - 29 => null, - 30 => null, - 31 => null, - 32 => null, - 33 => null, - 34 => null, - 35 => null, - 36 => null, - 37 => null, - 38 => null, - 39 => null, - 40 => null, - 41 => null, - 42 => null, - 43 => null, - 44 => null, - 45 => null, - 46 => null, - 47 => null, - 48 => null, - 49 => null, - 50 => null, - 51 => null, - 52 => null, - 53 => null, - 54 => null, - 55 => null, - 56 => null, - 57 => null, - 58 => null, - 59 => null, - 60 => null, - 61 => null, - 62 => null, - 63 => null, - 64 => null, - 65 => null, - 66 => null, - 67 => null, - 68 => null, - 69 => null, - 70 => null, - 71 => null, - 72 => null, - 73 => null, - 74 => null, - 75 => null, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; if ($this->semValue === "emitError(new Error('Cannot use "getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); - }, - 77 => null, - 78 => null, - 79 => null, - 80 => null, - 81 => null, - 82 => null, - 83 => null, - 84 => null, - 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 88 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 90 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 91 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 92 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 93 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 94 => null, - 95 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 96 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 97 => function ($stackPos) { - /* nothing */ - }, - 98 => function ($stackPos) { - /* nothing */ - }, - 99 => function ($stackPos) { - /* nothing */ - }, - 100 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]))); - }, - 101 => null, - 102 => null, - 103 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 104 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 105 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 106 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 107 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 108 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 109 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 110 => function ($stackPos) { - $this->semValue = []; - }, - 111 => null, - 112 => null, - 113 => null, - 114 => null, - 115 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->handleHaltCompiler(), $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 119 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 120 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 121 => null, - 122 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 123 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 124 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 125 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 127 => null, - 128 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 129 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 130 => null, - 131 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 132 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 133 => null, - 134 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 135 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 136 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 137 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 138 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 139 => function ($stackPos) { - $this->semValue = new Node\UseItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 140 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 141 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 142 => null, - 143 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 144 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 145 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 146 => null, - 147 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 148 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 149 => function ($stackPos) { - $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 150 => function ($stackPos) { - $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos-(3-1)])), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 151 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; } $this->semValue = $this->semStack[$stackPos-(2-1)];; - }, - 152 => function ($stackPos) { - $this->semValue = array(); - }, - 153 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 154 => null, - 155 => null, - 156 => null, - 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 158 => function ($stackPos) { - $this->semValue = new Stmt\Block($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => $this->semStack[$stackPos-(7-5)], 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 161 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 162 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], $this->semStack[$stackPos-(7-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 163 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 164 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 165 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 167 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 169 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 170 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 171 => function ($stackPos) { - - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - $this->semValue->setAttribute('hasLeadingNewline', $this->inlineHtmlHasLeadingNewline($stackPos-(1-1))); - - }, - 172 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 173 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 174 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 175 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 176 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-4)], $this->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->checkTryCatch($this->semValue); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 181 => function ($stackPos) { - $this->semValue = null; /* means: no statement */ - }, - 182 => null, - 183 => function ($stackPos) { - $this->semValue = $this->maybeCreateNop($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); - }, - 184 => function ($stackPos) { - if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; - }, - 185 => function ($stackPos) { - $this->semValue = array(); - }, - 186 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 187 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 188 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 189 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 190 => function ($stackPos) { - $this->semValue = null; - }, - 191 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 192 => null, - 193 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 194 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 195 => function ($stackPos) { - $this->semValue = false; - }, - 196 => function ($stackPos) { - $this->semValue = true; - }, - 197 => function ($stackPos) { - $this->semValue = false; - }, - 198 => function ($stackPos) { - $this->semValue = true; - }, - 199 => function ($stackPos) { - $this->semValue = false; - }, - 200 => function ($stackPos) { - $this->semValue = true; - }, - 201 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 202 => function ($stackPos) { - $this->semValue = []; - }, - 203 => null, - 204 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 205 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 206 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 207 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 208 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - $this->checkClass($this->semValue, $stackPos-(8-3)); - }, - 209 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - $this->checkInterface($this->semValue, $stackPos-(7-3)); - }, - 210 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 211 => function ($stackPos) { - $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - $this->checkEnum($this->semValue, $stackPos-(8-3)); - }, - 212 => function ($stackPos) { - $this->semValue = null; - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 214 => function ($stackPos) { - $this->semValue = null; - }, - 215 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 216 => function ($stackPos) { - $this->semValue = 0; - }, - 217 => null, - 218 => null, - 219 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 220 => function ($stackPos) { - $this->semValue = Modifiers::ABSTRACT; - }, - 221 => function ($stackPos) { - $this->semValue = Modifiers::FINAL; - }, - 222 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 223 => function ($stackPos) { - $this->semValue = null; - }, - 224 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 225 => function ($stackPos) { - $this->semValue = array(); - }, - 226 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 227 => function ($stackPos) { - $this->semValue = array(); - }, - 228 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 229 => null, - 230 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 231 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 232 => null, - 233 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 234 => null, - 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 236 => function ($stackPos) { - if ($this->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $this->semValue = $this->semStack[$stackPos-(1-1)]->stmts; } else if ($this->semStack[$stackPos-(1-1)] === null) { $this->semValue = []; } else { $this->semValue = [$this->semStack[$stackPos-(1-1)]]; }; - }, - 237 => function ($stackPos) { - $this->semValue = null; - }, - 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 239 => null, - 240 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 241 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 242 => function ($stackPos) { - $this->semValue = new Node\DeclareItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 245 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 246 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 247 => function ($stackPos) { - $this->semValue = array(); - }, - 248 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 249 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 250 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 251 => null, - 252 => null, - 253 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(7-1)], $this->tokenEndStack[$stackPos])); - }, - 254 => function ($stackPos) { - $this->semValue = []; - }, - 255 => null, - 256 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 257 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 258 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 259 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 260 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 261 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 262 => function ($stackPos) { - $this->semValue = array(); - }, - 263 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 264 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 265 => function ($stackPos) { - $this->semValue = array(); - }, - 266 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 267 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); - }, - 268 => function ($stackPos) { - $this->semValue = null; - }, - 269 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 270 => function ($stackPos) { - $this->semValue = null; - }, - 271 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->fixupAlternativeElse($this->semValue); - }, - 272 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 274 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 275 => function ($stackPos) { - $this->semValue = array($this->fixupArrayDestructuring($this->semStack[$stackPos-(1-1)]), false); - }, - 276 => null, - 277 => function ($stackPos) { - $this->semValue = array(); - }, - 278 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 279 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 280 => function ($stackPos) { - $this->semValue = 0; - }, - 281 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 282 => function ($stackPos) { - $this->semValue = Modifiers::PUBLIC; - }, - 283 => function ($stackPos) { - $this->semValue = Modifiers::PROTECTED; - }, - 284 => function ($stackPos) { - $this->semValue = Modifiers::PRIVATE; - }, - 285 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 286 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); - }, - 287 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); - $this->checkParam($this->semValue); - }, - 288 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - }, - 289 => null, - 290 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 291 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 292 => null, - 293 => null, - 294 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 295 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); - }, - 296 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 297 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 298 => null, - 299 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 300 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 301 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 302 => null, - 303 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 304 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 305 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 306 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 307 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 308 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 309 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 310 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 311 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 312 => null, - 313 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 314 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 315 => null, - 316 => function ($stackPos) { - $this->semValue = null; - }, - 317 => null, - 318 => function ($stackPos) { - $this->semValue = null; - }, - 319 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 320 => function ($stackPos) { - $this->semValue = null; - }, - 321 => function ($stackPos) { - $this->semValue = array(); - }, - 322 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 323 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); - }, - 324 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 325 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 326 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 327 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 328 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 329 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 330 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(3-1)]); - }, - 331 => null, - 332 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 333 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 334 => null, - 335 => null, - 336 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 337 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 338 => function ($stackPos) { - $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 339 => function ($stackPos) { - $this->semValue = new Node\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 340 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 341 => function ($stackPos) { - $this->semValue = array(); - }, - 342 => function ($stackPos) { - $nop = $this->maybeCreateZeroLengthNop($this->tokenPos);; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 343 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); - $this->checkProperty($this->semValue, $stackPos-(5-2)); - }, - 344 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(5-1)]); - $this->checkClassConst($this->semValue, $stackPos-(5-2)); - }, - 345 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos]), $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); - $this->checkClassConst($this->semValue, $stackPos-(6-2)); - }, - 346 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); - }, - 347 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 348 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 349 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ - }, - 350 => function ($stackPos) { - $this->semValue = array(); - }, - 351 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 352 => function ($stackPos) { - $this->semValue = array(); - }, - 353 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 354 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 355 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 356 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 357 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 358 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 359 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 360 => null, - 361 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 362 => function ($stackPos) { - $this->semValue = null; - }, - 363 => null, - 364 => null, - 365 => function ($stackPos) { - $this->semValue = 0; - }, - 366 => function ($stackPos) { - $this->semValue = 0; - }, - 367 => null, - 368 => null, - 369 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 370 => function ($stackPos) { - $this->semValue = Modifiers::PUBLIC; - }, - 371 => function ($stackPos) { - $this->semValue = Modifiers::PROTECTED; - }, - 372 => function ($stackPos) { - $this->semValue = Modifiers::PRIVATE; - }, - 373 => function ($stackPos) { - $this->semValue = Modifiers::STATIC; - }, - 374 => function ($stackPos) { - $this->semValue = Modifiers::ABSTRACT; - }, - 375 => function ($stackPos) { - $this->semValue = Modifiers::FINAL; - }, - 376 => function ($stackPos) { - $this->semValue = Modifiers::READONLY; - }, - 377 => null, - 378 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 379 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 380 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 381 => function ($stackPos) { - $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(1-1)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 382 => function ($stackPos) { - $this->semValue = new Node\PropertyItem($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 383 => null, - 384 => null, - 385 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 386 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 387 => function ($stackPos) { - $this->semValue = array(); - }, - 388 => null, - 389 => null, - 390 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->fixupArrayDestructuring($this->semStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 392 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - if (!$this->phpVersion->allowsAssignNewByReference()) { - $this->emitError(new Error('Cannot assign new by reference', $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]))); - } - - }, - 395 => null, - 396 => null, - 397 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 410 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 413 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 414 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 430 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 431 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 432 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 433 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 434 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 435 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 436 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 440 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 441 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 442 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 443 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 444 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 445 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 446 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 447 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 451 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 459 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 465 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]); - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 467 => null, - 468 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 479 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 480 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 481 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(9-1)], $this->tokenEndStack[$stackPos])); - }, - 482 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(10-1)], $this->tokenEndStack[$stackPos])); - }, - 483 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->getAttributes($this->tokenStartStack[$stackPos-(8-1)], $this->tokenEndStack[$stackPos])), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); - }, - 484 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 485 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 486 => function ($stackPos) { - $this->semValue = array(); - }, - 487 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 488 => null, - 489 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 490 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 491 => function ($stackPos) { - $this->semValue = new Node\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 492 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 493 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 494 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 495 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 496 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 497 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 498 => null, - 499 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 500 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 501 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 502 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 503 => null, - 504 => null, - 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 506 => function ($stackPos) { - $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 507 => null, - 508 => null, - 509 => function ($stackPos) { - $this->semValue = null; - }, - 510 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 511 => function ($stackPos) { - $this->semValue = array(); - }, - 512 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); foreach ($this->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; - }, - 513 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 514 => function ($stackPos) { - $this->semValue = array(); - }, - 515 => null, - 516 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 517 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 518 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 519 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 520 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 521 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 522 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 523 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 524 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 525 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 526 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(5-1)], $this->tokenEndStack[$stackPos])); - }, - 527 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)])), $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 528 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 529 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - $this->createdArrays->attach($this->semValue); - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->createdArrays->attach($this->semValue); - }, - 531 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->supportsUnicodeEscapes()); - }, - 532 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $this->phpVersion->supportsUnicodeEscapes()); } }; $this->semValue = new Scalar\InterpolatedString($this->semStack[$stackPos-(3-2)], $attrs); - }, - 533 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]), $this->phpVersion->allowsInvalidOctals()); - }, - 534 => function ($stackPos) { - $this->semValue = Scalar\Float_::fromString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 535 => null, - 536 => null, - 537 => null, - 538 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); - }, - 539 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(2-2)], $this->tokenEndStack[$stackPos-(2-2)]), true); - }, - 540 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos]), $this->getAttributes($this->tokenStartStack[$stackPos-(3-3)], $this->tokenEndStack[$stackPos-(3-3)]), true); - }, - 541 => function ($stackPos) { - $this->semValue = null; - }, - 542 => null, - 543 => null, - 544 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 545 => null, - 546 => null, - 547 => null, - 548 => null, - 549 => null, - 550 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 551 => null, - 552 => null, - 553 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 555 => null, - 556 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 558 => function ($stackPos) { - $this->semValue = null; - }, - 559 => null, - 560 => null, - 561 => null, - 562 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 563 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 564 => null, - 565 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 566 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 567 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])), $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 568 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])) : $var; - }, - 569 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 570 => null, - 571 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 572 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 573 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 574 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 575 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 576 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 577 => null, - 578 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 579 => null, - 580 => null, - 581 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 582 => null, - 583 => function ($stackPos) { - $this->semValue = new Expr\Error($this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); $this->errorState = 2; - }, - 584 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); $this->semValue->setAttribute('kind', Expr\List_::KIND_LIST); - $this->postprocessList($this->semValue); - }, - 585 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end]->value instanceof Expr\Error) array_pop($this->semValue); - }, - 586 => null, - 587 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ - }, - 588 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 589 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 590 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 591 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 592 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 593 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 594 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 595 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 596 => function ($stackPos) { - $this->semValue = new Node\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos]), true); - }, - 597 => function ($stackPos) { - /* Create an Error node now to remember the position. We'll later either report an error, - or convert this into a null element, depending on whether this is a creation or destructuring context. */ - $attrs = $this->createEmptyElemAttributes($this->tokenPos); - $this->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); - }, - 598 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 599 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 600 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 601 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 602 => function ($stackPos) { - $attrs = $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos]); $attrs['rawValue'] = $this->semStack[$stackPos-(1-1)]; $this->semValue = new Node\InterpolatedStringPart($this->semStack[$stackPos-(1-1)], $attrs); - }, - 603 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 604 => null, - 605 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(4-1)], $this->tokenEndStack[$stackPos])); - }, - 606 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 607 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 608 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 609 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(3-1)], $this->tokenEndStack[$stackPos])); - }, - 610 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->getAttributes($this->tokenStartStack[$stackPos-(6-1)], $this->tokenEndStack[$stackPos])); - }, - 611 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 612 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 613 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->getAttributes($this->tokenStartStack[$stackPos-(1-1)], $this->tokenEndStack[$stackPos])); - }, - 614 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->getAttributes($this->tokenStartStack[$stackPos-(2-1)], $this->tokenEndStack[$stackPos])); - }, - 615 => null, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php deleted file mode 100644 index f0b1a50..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ /dev/null @@ -1,1241 +0,0 @@ - Map of PHP token IDs to drop */ - protected array $dropTokens; - /** @var int[] Map of external symbols (static::T_*) to internal symbols */ - protected array $tokenToSymbol; - /** @var string[] Map of symbols to their names */ - protected array $symbolToName; - /** @var array Names of the production rules (only necessary for debugging) */ - protected array $productions; - - /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this - * state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the - * action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected array $actionBase; - /** @var int[] Table of actions. Indexed according to $actionBase comment. */ - protected array $action; - /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol - * then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected array $actionCheck; - /** @var int[] Map of states to their default action */ - protected array $actionDefault; - /** @var callable[] Semantic action callbacks */ - protected array $reduceCallbacks; - - /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this - * non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */ - protected array $gotoBase; - /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */ - protected array $goto; - /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal - * then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */ - protected array $gotoCheck; - /** @var int[] Map of non-terminals to the default state to goto after their reduction */ - protected array $gotoDefault; - - /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for - * determining the state to goto after reduction. */ - protected array $ruleToNonTerminal; - /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to - * be popped from the stack(s) on reduction. */ - protected array $ruleToLength; - - /* - * The following members are part of the parser state: - */ - - /** @var mixed Temporary value containing the result of last semantic action (reduction) */ - protected $semValue; - /** @var mixed[] Semantic value stack (contains values of tokens and semantic action results) */ - protected array $semStack; - /** @var int[] Token start position stack */ - protected array $tokenStartStack; - /** @var int[] Token end position stack */ - protected array $tokenEndStack; - - /** @var ErrorHandler Error handler */ - protected ErrorHandler $errorHandler; - /** @var int Error state, used to avoid error floods */ - protected int $errorState; - - /** @var \SplObjectStorage|null Array nodes created during parsing, for postprocessing of empty elements. */ - protected ?\SplObjectStorage $createdArrays; - - /** @var Token[] Tokens for the current parse */ - protected array $tokens; - /** @var int Current position in token array */ - protected int $tokenPos; - - /** - * Initialize $reduceCallbacks map. - */ - abstract protected function initReduceCallbacks(): void; - - /** - * Creates a parser instance. - * - * Options: - * * phpVersion: ?PhpVersion, - * - * @param Lexer $lexer A lexer - * @param PhpVersion $phpVersion PHP version to target, defaults to latest supported. This - * option is best-effort: Even if specified, parsing will generally assume the latest - * supported version and only adjust behavior in minor ways, for example by omitting - * errors in older versions and interpreting type hints as a name or identifier depending - * on version. - */ - public function __construct(Lexer $lexer, ?PhpVersion $phpVersion = null) { - $this->lexer = $lexer; - $this->phpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); - - $this->initReduceCallbacks(); - $this->phpTokenToSymbol = $this->createTokenMap(); - $this->dropTokens = array_fill_keys( - [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], true - ); - } - - /** - * Parses PHP code into a node tree. - * - * If a non-throwing error handler is used, the parser will continue parsing after an error - * occurred and attempt to build a partial AST. - * - * @param string $code The source code to parse - * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults - * to ErrorHandler\Throwing. - * - * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and - * the parser was unable to recover from an error). - */ - public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array { - $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing(); - $this->createdArrays = new \SplObjectStorage(); - - $this->tokens = $this->lexer->tokenize($code, $this->errorHandler); - $result = $this->doParse(); - - // Report errors for any empty elements used inside arrays. This is delayed until after the main parse, - // because we don't know a priori whether a given array expression will be used in a destructuring context - // or not. - foreach ($this->createdArrays as $node) { - foreach ($node->items as $item) { - if ($item->value instanceof Expr\Error) { - $this->errorHandler->handleError( - new Error('Cannot use empty array elements in arrays', $item->getAttributes())); - } - } - } - - // Clear out some of the interior state, so we don't hold onto unnecessary - // memory between uses of the parser - $this->tokenStartStack = []; - $this->tokenEndStack = []; - $this->semStack = []; - $this->semValue = null; - $this->createdArrays = null; - - if ($result !== null) { - $traverser = new NodeTraverser(new CommentAnnotatingVisitor($this->tokens)); - $traverser->traverse($result); - } - - return $result; - } - - public function getTokens(): array { - return $this->tokens; - } - - /** @return Stmt[]|null */ - protected function doParse(): ?array { - // We start off with no lookahead-token - $symbol = self::SYMBOL_NONE; - $tokenValue = null; - $this->tokenPos = -1; - - // Keep stack of start and end attributes - $this->tokenStartStack = []; - $this->tokenEndStack = [0]; - - // Start off in the initial state and keep a stack of previous states - $state = 0; - $stateStack = [$state]; - - // Semantic value stack (contains values of tokens and semantic action results) - $this->semStack = []; - - // Current position in the stack(s) - $stackPos = 0; - - $this->errorState = 0; - - for (;;) { - //$this->traceNewState($state, $symbol); - - if ($this->actionBase[$state] === 0) { - $rule = $this->actionDefault[$state]; - } else { - if ($symbol === self::SYMBOL_NONE) { - do { - $token = $this->tokens[++$this->tokenPos]; - $tokenId = $token->id; - } while (isset($this->dropTokens[$tokenId])); - - // Map the lexer token id to the internally used symbols. - $tokenValue = $token->text; - if (!isset($this->phpTokenToSymbol[$tokenId])) { - throw new \RangeException(sprintf( - 'The lexer returned an invalid token (id=%d, value=%s)', - $tokenId, $tokenValue - )); - } - $symbol = $this->phpTokenToSymbol[$tokenId]; - - //$this->traceRead($symbol); - } - - $idx = $this->actionBase[$state] + $symbol; - if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)) - && ($action = $this->action[$idx]) !== $this->defaultAction) { - /* - * >= numNonLeafStates: shift and reduce - * > 0: shift - * = 0: accept - * < 0: reduce - * = -YYUNEXPECTED: error - */ - if ($action > 0) { - /* shift */ - //$this->traceShift($symbol); - - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - $this->semStack[$stackPos] = $tokenValue; - $this->tokenStartStack[$stackPos] = $this->tokenPos; - $this->tokenEndStack[$stackPos] = $this->tokenPos; - $symbol = self::SYMBOL_NONE; - - if ($this->errorState) { - --$this->errorState; - } - - if ($action < $this->numNonLeafStates) { - continue; - } - - /* $yyn >= numNonLeafStates means shift-and-reduce */ - $rule = $action - $this->numNonLeafStates; - } else { - $rule = -$action; - } - } else { - $rule = $this->actionDefault[$state]; - } - } - - for (;;) { - if ($rule === 0) { - /* accept */ - //$this->traceAccept(); - return $this->semValue; - } - if ($rule !== $this->unexpectedTokenRule) { - /* reduce */ - //$this->traceReduce($rule); - - $ruleLength = $this->ruleToLength[$rule]; - try { - $callback = $this->reduceCallbacks[$rule]; - if ($callback !== null) { - $callback($stackPos); - } elseif ($ruleLength > 0) { - $this->semValue = $this->semStack[$stackPos - $ruleLength + 1]; - } - } catch (Error $e) { - if (-1 === $e->getStartLine()) { - $e->setStartLine($this->tokens[$this->tokenPos]->line); - } - - $this->emitError($e); - // Can't recover from this type of error - return null; - } - - /* Goto - shift nonterminal */ - $lastTokenEnd = $this->tokenEndStack[$stackPos]; - $stackPos -= $ruleLength; - $nonTerminal = $this->ruleToNonTerminal[$rule]; - $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; - if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) { - $state = $this->goto[$idx]; - } else { - $state = $this->gotoDefault[$nonTerminal]; - } - - ++$stackPos; - $stateStack[$stackPos] = $state; - $this->semStack[$stackPos] = $this->semValue; - $this->tokenEndStack[$stackPos] = $lastTokenEnd; - if ($ruleLength === 0) { - // Empty productions use the start attributes of the lookahead token. - $this->tokenStartStack[$stackPos] = $this->tokenPos; - } - } else { - /* error */ - switch ($this->errorState) { - case 0: - $msg = $this->getErrorMessage($symbol, $state); - $this->emitError(new Error($msg, $this->getAttributesForToken($this->tokenPos))); - // Break missing intentionally - // no break - case 1: - case 2: - $this->errorState = 3; - - // Pop until error-expecting state uncovered - while (!( - (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this - if ($stackPos <= 0) { - // Could not recover from error - return null; - } - $state = $stateStack[--$stackPos]; - //$this->tracePop($state); - } - - //$this->traceShift($this->errorSymbol); - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - - // We treat the error symbol as being empty, so we reset the end attributes - // to the end attributes of the last non-error symbol - $this->tokenStartStack[$stackPos] = $this->tokenPos; - $this->tokenEndStack[$stackPos] = $this->tokenEndStack[$stackPos - 1]; - break; - - case 3: - if ($symbol === 0) { - // Reached EOF without recovering from error - return null; - } - - //$this->traceDiscard($symbol); - $symbol = self::SYMBOL_NONE; - break 2; - } - } - - if ($state < $this->numNonLeafStates) { - break; - } - - /* >= numNonLeafStates means shift-and-reduce */ - $rule = $state - $this->numNonLeafStates; - } - } - - throw new \RuntimeException('Reached end of parser loop'); - } - - protected function emitError(Error $error): void { - $this->errorHandler->handleError($error); - } - - /** - * Format error message including expected tokens. - * - * @param int $symbol Unexpected symbol - * @param int $state State at time of error - * - * @return string Formatted error message - */ - protected function getErrorMessage(int $symbol, int $state): string { - $expectedString = ''; - if ($expected = $this->getExpectedTokens($state)) { - $expectedString = ', expecting ' . implode(' or ', $expected); - } - - return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString; - } - - /** - * Get limited number of expected tokens in given state. - * - * @param int $state State - * - * @return string[] Expected tokens. If too many, an empty array is returned. - */ - protected function getExpectedTokens(int $state): array { - $expected = []; - - $base = $this->actionBase[$state]; - foreach ($this->symbolToName as $symbol => $name) { - $idx = $base + $symbol; - if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - || $state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - ) { - if ($this->action[$idx] !== $this->unexpectedTokenRule - && $this->action[$idx] !== $this->defaultAction - && $symbol !== $this->errorSymbol - ) { - if (count($expected) === 4) { - /* Too many expected tokens */ - return []; - } - - $expected[] = $name; - } - } - } - - return $expected; - } - - /** - * Get attributes for a node with the given start and end token positions. - * - * @param int $tokenStartPos Token position the node starts at - * @param int $tokenEndPos Token position the node ends at - * @return array Attributes - */ - protected function getAttributes(int $tokenStartPos, int $tokenEndPos): array { - $startToken = $this->tokens[$tokenStartPos]; - $afterEndToken = $this->tokens[$tokenEndPos + 1]; - return [ - 'startLine' => $startToken->line, - 'startTokenPos' => $tokenStartPos, - 'startFilePos' => $startToken->pos, - 'endLine' => $afterEndToken->line, - 'endTokenPos' => $tokenEndPos, - 'endFilePos' => $afterEndToken->pos - 1, - ]; - } - - /** - * Get attributes for a single token at the given token position. - * - * @return array Attributes - */ - protected function getAttributesForToken(int $tokenPos): array { - if ($tokenPos < \count($this->tokens) - 1) { - return $this->getAttributes($tokenPos, $tokenPos); - } - - // Get attributes for the sentinel token. - $token = $this->tokens[$tokenPos]; - return [ - 'startLine' => $token->line, - 'startTokenPos' => $tokenPos, - 'startFilePos' => $token->pos, - 'endLine' => $token->line, - 'endTokenPos' => $tokenPos, - 'endFilePos' => $token->pos, - ]; - } - - /* - * Tracing functions used for debugging the parser. - */ - - /* - protected function traceNewState($state, $symbol): void { - echo '% State ' . $state - . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n"; - } - - protected function traceRead($symbol): void { - echo '% Reading ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceShift($symbol): void { - echo '% Shift ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceAccept(): void { - echo "% Accepted.\n"; - } - - protected function traceReduce($n): void { - echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n"; - } - - protected function tracePop($state): void { - echo '% Recovering, uncovered state ' . $state . "\n"; - } - - protected function traceDiscard($symbol): void { - echo '% Discard ' . $this->symbolToName[$symbol] . "\n"; - } - */ - - /* - * Helper functions invoked by semantic actions - */ - - /** - * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions. - * - * @param Node\Stmt[] $stmts - * @return Node\Stmt[] - */ - protected function handleNamespaces(array $stmts): array { - $hasErrored = false; - $style = $this->getNamespacingStyle($stmts); - if (null === $style) { - // not namespaced, nothing to do - return $stmts; - } - if ('brace' === $style) { - // For braced namespaces we only have to check that there are no invalid statements between the namespaces - $afterFirstNamespace = false; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $afterFirstNamespace = true; - } elseif (!$stmt instanceof Node\Stmt\HaltCompiler - && !$stmt instanceof Node\Stmt\Nop - && $afterFirstNamespace && !$hasErrored) { - $this->emitError(new Error( - 'No code may exist outside of namespace {}', $stmt->getAttributes())); - $hasErrored = true; // Avoid one error for every statement - } - } - return $stmts; - } else { - // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts - $resultStmts = []; - $targetStmts = &$resultStmts; - $lastNs = null; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - if ($stmt->stmts === null) { - $stmt->stmts = []; - $targetStmts = &$stmt->stmts; - $resultStmts[] = $stmt; - } else { - // This handles the invalid case of mixed style namespaces - $resultStmts[] = $stmt; - $targetStmts = &$resultStmts; - } - $lastNs = $stmt; - } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { - // __halt_compiler() is not moved into the namespace - $resultStmts[] = $stmt; - } else { - $targetStmts[] = $stmt; - } - } - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - return $resultStmts; - } - } - - private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt): void { - // We moved the statements into the namespace node, as such the end of the namespace node - // needs to be extended to the end of the statements. - if (empty($stmt->stmts)) { - return; - } - - // We only move the builtin end attributes here. This is the best we can do with the - // knowledge we have. - $endAttributes = ['endLine', 'endFilePos', 'endTokenPos']; - $lastStmt = $stmt->stmts[count($stmt->stmts) - 1]; - foreach ($endAttributes as $endAttribute) { - if ($lastStmt->hasAttribute($endAttribute)) { - $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute)); - } - } - } - - /** @return array */ - private function getNamespaceErrorAttributes(Namespace_ $node): array { - $attrs = $node->getAttributes(); - // Adjust end attributes to only cover the "namespace" keyword, not the whole namespace. - if (isset($attrs['startLine'])) { - $attrs['endLine'] = $attrs['startLine']; - } - if (isset($attrs['startTokenPos'])) { - $attrs['endTokenPos'] = $attrs['startTokenPos']; - } - if (isset($attrs['startFilePos'])) { - $attrs['endFilePos'] = $attrs['startFilePos'] + \strlen('namespace') - 1; - } - return $attrs; - } - - /** - * Determine namespacing style (semicolon or brace) - * - * @param Node[] $stmts Top-level statements. - * - * @return null|string One of "semicolon", "brace" or null (no namespaces) - */ - private function getNamespacingStyle(array $stmts): ?string { - $style = null; - $hasNotAllowedStmts = false; - foreach ($stmts as $i => $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace'; - if (null === $style) { - $style = $currentStyle; - if ($hasNotAllowedStmts) { - $this->emitError(new Error( - 'Namespace declaration statement has to be the very first statement in the script', - $this->getNamespaceErrorAttributes($stmt) - )); - } - } elseif ($style !== $currentStyle) { - $this->emitError(new Error( - 'Cannot mix bracketed namespace declarations with unbracketed namespace declarations', - $this->getNamespaceErrorAttributes($stmt) - )); - // Treat like semicolon style for namespace normalization - return 'semicolon'; - } - continue; - } - - /* declare(), __halt_compiler() and nops can be used before a namespace declaration */ - if ($stmt instanceof Node\Stmt\Declare_ - || $stmt instanceof Node\Stmt\HaltCompiler - || $stmt instanceof Node\Stmt\Nop) { - continue; - } - - /* There may be a hashbang line at the very start of the file */ - if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) { - continue; - } - - /* Everything else if forbidden before namespace declarations */ - $hasNotAllowedStmts = true; - } - return $style; - } - - /** @return Name|Identifier */ - protected function handleBuiltinTypes(Name $name) { - if (!$name->isUnqualified()) { - return $name; - } - - $lowerName = $name->toLowerString(); - if (!$this->phpVersion->supportsBuiltinType($lowerName)) { - return $name; - } - - return new Node\Identifier($lowerName, $name->getAttributes()); - } - - /** - * Get combined start and end attributes at a stack location - * - * @param int $stackPos Stack location - * - * @return array Combined start and end attributes - */ - protected function getAttributesAt(int $stackPos): array { - return $this->getAttributes($this->tokenStartStack[$stackPos], $this->tokenEndStack[$stackPos]); - } - - protected function getFloatCastKind(string $cast): int { - $cast = strtolower($cast); - if (strpos($cast, 'float') !== false) { - return Double::KIND_FLOAT; - } - - if (strpos($cast, 'real') !== false) { - return Double::KIND_REAL; - } - - return Double::KIND_DOUBLE; - } - - /** @param array $attributes */ - protected function parseLNumber(string $str, array $attributes, bool $allowInvalidOctal = false): Int_ { - try { - return Int_::fromString($str, $attributes, $allowInvalidOctal); - } catch (Error $error) { - $this->emitError($error); - // Use dummy value - return new Int_(0, $attributes); - } - } - - /** - * Parse a T_NUM_STRING token into either an integer or string node. - * - * @param string $str Number string - * @param array $attributes Attributes - * - * @return Int_|String_ Integer or string node. - */ - protected function parseNumString(string $str, array $attributes) { - if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) { - return new String_($str, $attributes); - } - - $num = +$str; - if (!is_int($num)) { - return new String_($str, $attributes); - } - - return new Int_($num, $attributes); - } - - /** @param array $attributes */ - protected function stripIndentation( - string $string, int $indentLen, string $indentChar, - bool $newlineAtStart, bool $newlineAtEnd, array $attributes - ): string { - if ($indentLen === 0) { - return $string; - } - - $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)'; - $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])'; - $regex = '/' . $start . '([ \t]*)(' . $end . ')?/'; - return preg_replace_callback( - $regex, - function ($matches) use ($indentLen, $indentChar, $attributes) { - $prefix = substr($matches[1], 0, $indentLen); - if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', $attributes - )); - } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) { - $this->emitError(new Error( - 'Invalid body indentation level ' . - '(expecting an indentation level of at least ' . $indentLen . ')', - $attributes - )); - } - return substr($matches[0], strlen($prefix)); - }, - $string - ); - } - - /** - * @param string|(Expr|InterpolatedStringPart)[] $contents - * @param array $attributes - * @param array $endTokenAttributes - */ - protected function parseDocString( - string $startToken, $contents, string $endToken, - array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape - ): Expr { - $kind = strpos($startToken, "'") === false - ? String_::KIND_HEREDOC : String_::KIND_NOWDOC; - - $regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/'; - $result = preg_match($regex, $startToken, $matches); - assert($result === 1); - $label = $matches[1]; - - $result = preg_match('/\A[ \t]*/', $endToken, $matches); - assert($result === 1); - $indentation = $matches[0]; - - $attributes['kind'] = $kind; - $attributes['docLabel'] = $label; - $attributes['docIndentation'] = $indentation; - - $indentHasSpaces = false !== strpos($indentation, " "); - $indentHasTabs = false !== strpos($indentation, "\t"); - if ($indentHasSpaces && $indentHasTabs) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', - $endTokenAttributes - )); - - // Proceed processing as if this doc string is not indented - $indentation = ''; - } - - $indentLen = \strlen($indentation); - $indentChar = $indentHasSpaces ? " " : "\t"; - - if (\is_string($contents)) { - if ($contents === '') { - $attributes['rawValue'] = $contents; - return new String_('', $attributes); - } - - $contents = $this->stripIndentation( - $contents, $indentLen, $indentChar, true, true, $attributes - ); - $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents); - $attributes['rawValue'] = $contents; - - if ($kind === String_::KIND_HEREDOC) { - $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape); - } - - return new String_($contents, $attributes); - } else { - assert(count($contents) > 0); - if (!$contents[0] instanceof Node\InterpolatedStringPart) { - // If there is no leading encapsed string part, pretend there is an empty one - $this->stripIndentation( - '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes() - ); - } - - $newContents = []; - foreach ($contents as $i => $part) { - if ($part instanceof Node\InterpolatedStringPart) { - $isLast = $i === \count($contents) - 1; - $part->value = $this->stripIndentation( - $part->value, $indentLen, $indentChar, - $i === 0, $isLast, $part->getAttributes() - ); - if ($isLast) { - $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value); - } - $part->setAttribute('rawValue', $part->value); - $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); - if ('' === $part->value) { - continue; - } - } - $newContents[] = $part; - } - return new InterpolatedString($newContents, $attributes); - } - } - - protected function createCommentFromToken(Token $token, int $tokenPos): Comment { - assert($token->id === \T_COMMENT || $token->id == \T_DOC_COMMENT); - return \T_DOC_COMMENT === $token->id - ? new Comment\Doc($token->text, $token->line, $token->pos, $tokenPos, - $token->getEndLine(), $token->getEndPos() - 1, $tokenPos) - : new Comment($token->text, $token->line, $token->pos, $tokenPos, - $token->getEndLine(), $token->getEndPos() - 1, $tokenPos); - } - - /** - * Get last comment before the given token position, if any - */ - protected function getCommentBeforeToken(int $tokenPos): ?Comment { - while (--$tokenPos >= 0) { - $token = $this->tokens[$tokenPos]; - if (!isset($this->dropTokens[$token->id])) { - break; - } - - if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { - return $this->createCommentFromToken($token, $tokenPos); - } - } - return null; - } - - /** - * Create a zero-length nop to capture preceding comments, if any. - */ - protected function maybeCreateZeroLengthNop(int $tokenPos): ?Nop { - $comment = $this->getCommentBeforeToken($tokenPos); - if ($comment === null) { - return null; - } - - $commentEndLine = $comment->getEndLine(); - $commentEndFilePos = $comment->getEndFilePos(); - $commentEndTokenPos = $comment->getEndTokenPos(); - $attributes = [ - 'startLine' => $commentEndLine, - 'endLine' => $commentEndLine, - 'startFilePos' => $commentEndFilePos + 1, - 'endFilePos' => $commentEndFilePos, - 'startTokenPos' => $commentEndTokenPos + 1, - 'endTokenPos' => $commentEndTokenPos, - ]; - return new Nop($attributes); - } - - protected function maybeCreateNop(int $tokenStartPos, int $tokenEndPos): ?Nop { - if ($this->getCommentBeforeToken($tokenStartPos) === null) { - return null; - } - return new Nop($this->getAttributes($tokenStartPos, $tokenEndPos)); - } - - protected function handleHaltCompiler(): string { - // Prevent the lexer from returning any further tokens. - $nextToken = $this->tokens[$this->tokenPos + 1]; - $this->tokenPos = \count($this->tokens) - 2; - - // Return text after __halt_compiler. - return $nextToken->id === \T_INLINE_HTML ? $nextToken->text : ''; - } - - protected function inlineHtmlHasLeadingNewline(int $stackPos): bool { - $tokenPos = $this->tokenStartStack[$stackPos]; - $token = $this->tokens[$tokenPos]; - assert($token->id == \T_INLINE_HTML); - if ($tokenPos > 0) { - $prevToken = $this->tokens[$tokenPos - 1]; - assert($prevToken->id == \T_CLOSE_TAG); - return false !== strpos($prevToken->text, "\n") - || false !== strpos($prevToken->text, "\r"); - } - return true; - } - - /** - * @return array - */ - protected function createEmptyElemAttributes(int $tokenPos): array { - return $this->getAttributesForToken($tokenPos); - } - - protected function fixupArrayDestructuring(Array_ $node): Expr\List_ { - $this->createdArrays->detach($node); - return new Expr\List_(array_map(function (Node\ArrayItem $item) { - if ($item->value instanceof Expr\Error) { - // We used Error as a placeholder for empty elements, which are legal for destructuring. - return null; - } - if ($item->value instanceof Array_) { - return new Node\ArrayItem( - $this->fixupArrayDestructuring($item->value), - $item->key, $item->byRef, $item->getAttributes()); - } - return $item; - }, $node->items), ['kind' => Expr\List_::KIND_ARRAY] + $node->getAttributes()); - } - - protected function postprocessList(Expr\List_ $node): void { - foreach ($node->items as $i => $item) { - if ($item->value instanceof Expr\Error) { - // We used Error as a placeholder for empty elements, which are legal for destructuring. - $node->items[$i] = null; - } - } - } - - /** @param ElseIf_|Else_ $node */ - protected function fixupAlternativeElse($node): void { - // Make sure a trailing nop statement carrying comments is part of the node. - $numStmts = \count($node->stmts); - if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) { - $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes(); - if (isset($nopAttrs['endLine'])) { - $node->setAttribute('endLine', $nopAttrs['endLine']); - } - if (isset($nopAttrs['endFilePos'])) { - $node->setAttribute('endFilePos', $nopAttrs['endFilePos']); - } - if (isset($nopAttrs['endTokenPos'])) { - $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']); - } - } - } - - protected function checkClassModifier(int $a, int $b, int $modifierPos): void { - try { - Modifiers::verifyClassModifier($a, $b); - } catch (Error $error) { - $error->setAttributes($this->getAttributesAt($modifierPos)); - $this->emitError($error); - } - } - - protected function checkModifier(int $a, int $b, int $modifierPos): void { - // Jumping through some hoops here because verifyModifier() is also used elsewhere - try { - Modifiers::verifyModifier($a, $b); - } catch (Error $error) { - $error->setAttributes($this->getAttributesAt($modifierPos)); - $this->emitError($error); - } - } - - protected function checkParam(Param $node): void { - if ($node->variadic && null !== $node->default) { - $this->emitError(new Error( - 'Variadic parameter cannot have a default value', - $node->default->getAttributes() - )); - } - } - - protected function checkTryCatch(TryCatch $node): void { - if (empty($node->catches) && null === $node->finally) { - $this->emitError(new Error( - 'Cannot use try without catch or finally', $node->getAttributes() - )); - } - } - - protected function checkNamespace(Namespace_ $node): void { - if (null !== $node->stmts) { - foreach ($node->stmts as $stmt) { - if ($stmt instanceof Namespace_) { - $this->emitError(new Error( - 'Namespace declarations cannot be nested', $stmt->getAttributes() - )); - } - } - } - } - - private function checkClassName(?Identifier $name, int $namePos): void { - if (null !== $name && $name->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $name), - $this->getAttributesAt($namePos) - )); - } - } - - /** @param Name[] $interfaces */ - private function checkImplementedInterfaces(array $interfaces): void { - foreach ($interfaces as $interface) { - if ($interface->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface), - $interface->getAttributes() - )); - } - } - } - - protected function checkClass(Class_ $node, int $namePos): void { - $this->checkClassName($node->name, $namePos); - - if ($node->extends && $node->extends->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends), - $node->extends->getAttributes() - )); - } - - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkInterface(Interface_ $node, int $namePos): void { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->extends); - } - - protected function checkEnum(Enum_ $node, int $namePos): void { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkClassMethod(ClassMethod $node, int $modifierPos): void { - if ($node->flags & Modifiers::STATIC) { - switch ($node->name->toLowerString()) { - case '__construct': - $this->emitError(new Error( - sprintf('Constructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__destruct': - $this->emitError(new Error( - sprintf('Destructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__clone': - $this->emitError(new Error( - sprintf('Clone method %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - } - } - - if ($node->flags & Modifiers::READONLY) { - $this->emitError(new Error( - sprintf('Method %s() cannot be readonly', $node->name), - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkClassConst(ClassConst $node, int $modifierPos): void { - if ($node->flags & Modifiers::STATIC) { - $this->emitError(new Error( - "Cannot use 'static' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Modifiers::ABSTRACT) { - $this->emitError(new Error( - "Cannot use 'abstract' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Modifiers::READONLY) { - $this->emitError(new Error( - "Cannot use 'readonly' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkProperty(Property $node, int $modifierPos): void { - if ($node->flags & Modifiers::ABSTRACT) { - $this->emitError(new Error('Properties cannot be declared abstract', - $this->getAttributesAt($modifierPos))); - } - - if ($node->flags & Modifiers::FINAL) { - $this->emitError(new Error('Properties cannot be declared final', - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkUseUse(UseItem $node, int $namePos): void { - if ($node->alias && $node->alias->isSpecialClassName()) { - $this->emitError(new Error( - sprintf( - 'Cannot use %s as %s because \'%2$s\' is a special class name', - $node->name, $node->alias - ), - $this->getAttributesAt($namePos) - )); - } - } - - /** - * Creates the token map. - * - * The token map maps the PHP internal token identifiers - * to the identifiers used by the Parser. Additionally it - * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. - * - * @return array The token map - */ - protected function createTokenMap(): array { - $tokenMap = []; - - for ($i = 0; $i < 1000; ++$i) { - if ($i < 256) { - // Single-char tokens use an identity mapping. - $tokenMap[$i] = $i; - } elseif (\T_DOUBLE_COLON === $i) { - // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM - $tokenMap[$i] = static::T_PAAMAYIM_NEKUDOTAYIM; - } elseif (\T_OPEN_TAG_WITH_ECHO === $i) { - // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO - $tokenMap[$i] = static::T_ECHO; - } elseif (\T_CLOSE_TAG === $i) { - // T_CLOSE_TAG is equivalent to ';' - $tokenMap[$i] = ord(';'); - } elseif ('UNKNOWN' !== $name = token_name($i)) { - if (defined($name = static::class . '::' . $name)) { - // Other tokens can be mapped directly - $tokenMap[$i] = constant($name); - } - } - } - - // Assign tokens for which we define compatibility constants, as token_name() does not know them. - $tokenMap[\T_FN] = static::T_FN; - $tokenMap[\T_COALESCE_EQUAL] = static::T_COALESCE_EQUAL; - $tokenMap[\T_NAME_QUALIFIED] = static::T_NAME_QUALIFIED; - $tokenMap[\T_NAME_FULLY_QUALIFIED] = static::T_NAME_FULLY_QUALIFIED; - $tokenMap[\T_NAME_RELATIVE] = static::T_NAME_RELATIVE; - $tokenMap[\T_MATCH] = static::T_MATCH; - $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = static::T_NULLSAFE_OBJECT_OPERATOR; - $tokenMap[\T_ATTRIBUTE] = static::T_ATTRIBUTE; - $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = static::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = static::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_ENUM] = static::T_ENUM; - $tokenMap[\T_READONLY] = static::T_READONLY; - - // We have create a map from PHP token IDs to external symbol IDs. - // Now map them to the internal symbol ID. - $fullTokenMap = []; - foreach ($tokenMap as $phpToken => $extSymbol) { - $intSymbol = $this->tokenToSymbol[$extSymbol]; - if ($intSymbol === $this->invalidSymbol) { - continue; - } - $fullTokenMap[$phpToken] = $intSymbol; - } - - return $fullTokenMap; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php deleted file mode 100644 index 3a7586e..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +++ /dev/null @@ -1,42 +0,0 @@ -isHostVersion()) { - $lexer = new Lexer(); - } else { - $lexer = new Lexer\Emulative($version); - } - if ($version->id >= 80000) { - return new Php8($lexer, $version); - } - return new Php7($lexer, $version); - } - - /** - * Create a parser targeting the newest version supported by this library. Code for older - * versions will be accepted if there have been no relevant backwards-compatibility breaks in - * PHP. - */ - public function createForNewestSupportedVersion(): Parser { - return $this->createForVersion(PhpVersion::getNewestSupported()); - } - - /** - * Create a parser targeting the host PHP version, that is the PHP version we're currently - * running on. This parser will not use any token emulation. - */ - public function createForHostVersion(): Parser { - return $this->createForVersion(PhpVersion::getHostVersion()); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php b/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php deleted file mode 100644 index a6fbb58..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php +++ /dev/null @@ -1,164 +0,0 @@ - 50100, - 'callable' => 50400, - 'bool' => 70000, - 'int' => 70000, - 'float' => 70000, - 'string' => 70000, - 'iterable' => 70100, - 'void' => 70100, - 'object' => 70200, - 'null' => 80000, - 'false' => 80000, - 'mixed' => 80000, - 'never' => 80100, - 'true' => 80200, - ]; - - private function __construct(int $id) { - $this->id = $id; - } - - /** - * Create a PhpVersion object from major and minor version components. - */ - public static function fromComponents(int $major, int $minor): self { - return new self($major * 10000 + $minor * 100); - } - - /** - * Get the newest PHP version supported by this library. Support for this version may be partial, - * if it is still under development. - */ - public static function getNewestSupported(): self { - return self::fromComponents(8, 2); - } - - /** - * Get the host PHP version, that is the PHP version we're currently running on. - */ - public static function getHostVersion(): self { - return self::fromComponents(\PHP_MAJOR_VERSION, \PHP_MINOR_VERSION); - } - - /** - * Parse the version from a string like "8.1". - */ - public static function fromString(string $version): self { - if (!preg_match('/^(\d+)\.(\d+)/', $version, $matches)) { - throw new \LogicException("Invalid PHP version \"$version\""); - } - return self::fromComponents((int) $matches[1], (int) $matches[2]); - } - - /** - * Check whether two versions are the same. - */ - public function equals(PhpVersion $other): bool { - return $this->id === $other->id; - } - - /** - * Check whether this version is greater than or equal to the argument. - */ - public function newerOrEqual(PhpVersion $other): bool { - return $this->id >= $other->id; - } - - /** - * Check whether this version is older than the argument. - */ - public function older(PhpVersion $other): bool { - return $this->id < $other->id; - } - - /** - * Check whether this is the host PHP version. - */ - public function isHostVersion(): bool { - return $this->equals(self::getHostVersion()); - } - - /** - * Check whether this PHP version supports the given builtin type. Type name must be lowercase. - */ - public function supportsBuiltinType(string $type): bool { - $minVersion = self::BUILTIN_TYPE_VERSIONS[$type] ?? null; - return $minVersion !== null && $this->id >= $minVersion; - } - - /** - * Whether this version supports [] array literals. - */ - public function supportsShortArraySyntax(): bool { - return $this->id >= 50400; - } - - /** - * Whether this version supports [] for destructuring. - */ - public function supportsShortArrayDestructuring(): bool { - return $this->id >= 70100; - } - - /** - * Whether this version supports flexible heredoc/nowdoc. - */ - public function supportsFlexibleHeredoc(): bool { - return $this->id >= 70300; - } - - /** - * Whether this version supports trailing commas in parameter lists. - */ - public function supportsTrailingCommaInParamList(): bool { - return $this->id >= 80000; - } - - /** - * Whether this version allows "$var =& new Obj". - */ - public function allowsAssignNewByReference(): bool { - return $this->id < 70000; - } - - /** - * Whether this version allows invalid octals like "08". - */ - public function allowsInvalidOctals(): bool { - return $this->id < 70000; - } - - /** - * Whether this version allows DEL (\x7f) to occur in identifiers. - */ - public function allowsDelInIdentifiers(): bool { - return $this->id < 70100; - } - - /** - * Whether this version supports yield in expression context without parentheses. - */ - public function supportsYieldWithoutParentheses(): bool { - return $this->id >= 70000; - } - - /** - * Whether this version supports unicode escape sequences in strings. - */ - public function supportsUnicodeEscapes(): bool { - return $this->id >= 70000; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php deleted file mode 100644 index 892c686..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +++ /dev/null @@ -1,51 +0,0 @@ -pAttrGroups($node->attrGroups, true) - . $this->pModifiers($node->flags) - . ($node->type ? $this->p($node->type) . ' ' : '') - . ($node->byRef ? '&' : '') - . ($node->variadic ? '...' : '') - . $this->p($node->var) - . ($node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pArg(Node\Arg $node): string { - return ($node->name ? $node->name->toString() . ': ' : '') - . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node): string { - return '...'; - } - - protected function pConst(Node\Const_ $node): string { - return $node->name . ' = ' . $this->p($node->value); - } - - protected function pNullableType(Node\NullableType $node): string { - return '?' . $this->p($node->type); - } - - protected function pUnionType(Node\UnionType $node): string { - $types = []; - foreach ($node->types as $typeNode) { - if ($typeNode instanceof Node\IntersectionType) { - $types[] = '('. $this->p($typeNode) . ')'; - continue; - } - $types[] = $this->p($typeNode); - } - return implode('|', $types); - } - - protected function pIntersectionType(Node\IntersectionType $node): string { - return $this->pImplode($node->types, '&'); - } - - protected function pIdentifier(Node\Identifier $node): string { - return $node->name; - } - - protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node): string { - return '$' . $node->name; - } - - protected function pAttribute(Node\Attribute $node): string { - return $this->p($node->name) - . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : ''); - } - - protected function pAttributeGroup(Node\AttributeGroup $node): string { - return '#[' . $this->pCommaSeparated($node->attrs) . ']'; - } - - // Names - - protected function pName(Name $node): string { - return $node->name; - } - - protected function pName_FullyQualified(Name\FullyQualified $node): string { - return '\\' . $node->name; - } - - protected function pName_Relative(Name\Relative $node): string { - return 'namespace\\' . $node->name; - } - - // Magic Constants - - protected function pScalar_MagicConst_Class(MagicConst\Class_ $node): string { - return '__CLASS__'; - } - - protected function pScalar_MagicConst_Dir(MagicConst\Dir $node): string { - return '__DIR__'; - } - - protected function pScalar_MagicConst_File(MagicConst\File $node): string { - return '__FILE__'; - } - - protected function pScalar_MagicConst_Function(MagicConst\Function_ $node): string { - return '__FUNCTION__'; - } - - protected function pScalar_MagicConst_Line(MagicConst\Line $node): string { - return '__LINE__'; - } - - protected function pScalar_MagicConst_Method(MagicConst\Method $node): string { - return '__METHOD__'; - } - - protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node): string { - return '__NAMESPACE__'; - } - - protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node): string { - return '__TRAIT__'; - } - - // Scalars - - private function indentString(string $str): string { - return str_replace("\n", $this->nl, $str); - } - - protected function pScalar_String(Scalar\String_ $node): string { - $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED); - switch ($kind) { - case Scalar\String_::KIND_NOWDOC: - $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - $shouldIdent = $this->phpVersion->supportsFlexibleHeredoc(); - $nl = $shouldIdent ? $this->nl : $this->newline; - if ($node->value === '') { - return "<<<'$label'$nl$label{$this->docStringEndToken}"; - } - - // Make sure trailing \r is not combined with following \n into CRLF. - if ($node->value[strlen($node->value) - 1] !== "\r") { - $value = $shouldIdent ? $this->indentString($node->value) : $node->value; - return "<<<'$label'$nl$value$nl$label{$this->docStringEndToken}"; - } - } - /* break missing intentionally */ - // no break - case Scalar\String_::KIND_SINGLE_QUOTED: - return $this->pSingleQuotedString($node->value); - case Scalar\String_::KIND_HEREDOC: - $label = $node->getAttribute('docLabel'); - $escaped = $this->escapeString($node->value, null); - if ($label && !$this->containsEndLabel($escaped, $label)) { - $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; - if ($escaped === '') { - return "<<<$label$nl$label{$this->docStringEndToken}"; - } - - return "<<<$label$nl$escaped$nl$label{$this->docStringEndToken}"; - } - /* break missing intentionally */ - // no break - case Scalar\String_::KIND_DOUBLE_QUOTED: - return '"' . $this->escapeString($node->value, '"') . '"'; - } - throw new \Exception('Invalid string kind'); - } - - protected function pScalar_InterpolatedString(Scalar\InterpolatedString $node): string { - if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) { - $label = $node->getAttribute('docLabel'); - if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) { - $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; - if (count($node->parts) === 1 - && $node->parts[0] instanceof Node\InterpolatedStringPart - && $node->parts[0]->value === '' - ) { - return "<<<$label$nl$label{$this->docStringEndToken}"; - } - - return "<<<$label$nl" . $this->pEncapsList($node->parts, null) - . "$nl$label{$this->docStringEndToken}"; - } - } - return '"' . $this->pEncapsList($node->parts, '"') . '"'; - } - - protected function pScalar_Int(Scalar\Int_ $node): string { - if ($node->value === -\PHP_INT_MAX - 1) { - // PHP_INT_MIN cannot be represented as a literal, - // because the sign is not part of the literal - return '(-' . \PHP_INT_MAX . '-1)'; - } - - $kind = $node->getAttribute('kind', Scalar\Int_::KIND_DEC); - if (Scalar\Int_::KIND_DEC === $kind) { - return (string) $node->value; - } - - if ($node->value < 0) { - $sign = '-'; - $str = (string) -$node->value; - } else { - $sign = ''; - $str = (string) $node->value; - } - switch ($kind) { - case Scalar\Int_::KIND_BIN: - return $sign . '0b' . base_convert($str, 10, 2); - case Scalar\Int_::KIND_OCT: - return $sign . '0' . base_convert($str, 10, 8); - case Scalar\Int_::KIND_HEX: - return $sign . '0x' . base_convert($str, 10, 16); - } - throw new \Exception('Invalid number kind'); - } - - protected function pScalar_Float(Scalar\Float_ $node): string { - if (!is_finite($node->value)) { - if ($node->value === \INF) { - return '1.0E+1000'; - } - if ($node->value === -\INF) { - return '-1.0E+1000'; - } else { - return '\NAN'; - } - } - - // Try to find a short full-precision representation - $stringValue = sprintf('%.16G', $node->value); - if ($node->value !== (float) $stringValue) { - $stringValue = sprintf('%.17G', $node->value); - } - - // %G is locale dependent and there exists no locale-independent alternative. We don't want - // mess with switching locales here, so let's assume that a comma is the only non-standard - // decimal separator we may encounter... - $stringValue = str_replace(',', '.', $stringValue); - - // ensure that number is really printed as float - return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue; - } - - // Assignments - - protected function pExpr_Assign(Expr\Assign $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\Assign::class, $this->p($node->var) . ' = ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignRef(Expr\AssignRef $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\AssignRef::class, $this->p($node->var) . ' =& ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Plus(AssignOp\Plus $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Plus::class, $this->p($node->var) . ' += ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Minus(AssignOp\Minus $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Minus::class, $this->p($node->var) . ' -= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Mul(AssignOp\Mul $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Mul::class, $this->p($node->var) . ' *= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Div(AssignOp\Div $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Div::class, $this->p($node->var) . ' /= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Concat(AssignOp\Concat $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Concat::class, $this->p($node->var) . ' .= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Mod(AssignOp\Mod $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Mod::class, $this->p($node->var) . ' %= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\BitwiseAnd::class, $this->p($node->var) . ' &= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\BitwiseOr::class, $this->p($node->var) . ' |= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\BitwiseXor::class, $this->p($node->var) . ' ^= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\ShiftLeft::class, $this->p($node->var) . ' <<= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\ShiftRight::class, $this->p($node->var) . ' >>= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Pow(AssignOp\Pow $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Pow::class, $this->p($node->var) . ' **= ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(AssignOp\Coalesce::class, $this->p($node->var) . ' ??= ', $node->expr, $precedence, $lhsPrecedence); - } - - // Binary expressions - - protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Div(BinaryOp\Div $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { - return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right, $precedence, $lhsPrecedence); - } - - protected function pExpr_Instanceof(Expr\Instanceof_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPostfixOp( - Expr\Instanceof_::class, $node->expr, - ' instanceof ' . $this->pNewOperand($node->class), - $precedence, $lhsPrecedence); - } - - // Unary expressions - - protected function pExpr_BooleanNot(Expr\BooleanNot $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_BitwiseNot(Expr\BitwiseNot $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_UnaryMinus(Expr\UnaryMinus $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_UnaryPlus(Expr\UnaryPlus $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_PreInc(Expr\PreInc $node): string { - return '++' . $this->p($node->var); - } - - protected function pExpr_PreDec(Expr\PreDec $node): string { - return '--' . $this->p($node->var); - } - - protected function pExpr_PostInc(Expr\PostInc $node): string { - return $this->p($node->var) . '++'; - } - - protected function pExpr_PostDec(Expr\PostDec $node): string { - return $this->p($node->var) . '--'; - } - - protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_YieldFrom(Expr\YieldFrom $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Print(Expr\Print_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr, $precedence, $lhsPrecedence); - } - - // Casts - - protected function pExpr_Cast_Int(Cast\Int_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_Double(Cast\Double $node, int $precedence, int $lhsPrecedence): string { - $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE); - if ($kind === Cast\Double::KIND_DOUBLE) { - $cast = '(double)'; - } elseif ($kind === Cast\Double::KIND_FLOAT) { - $cast = '(float)'; - } else { - assert($kind === Cast\Double::KIND_REAL); - $cast = '(real)'; - } - return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_String(Cast\String_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_Array(Cast\Array_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_Object(Cast\Object_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_Bool(Cast\Bool_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Cast_Unset(Cast\Unset_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr, $precedence, $lhsPrecedence); - } - - // Function calls and similar constructs - - protected function pExpr_FuncCall(Expr\FuncCall $node): string { - return $this->pCallLhs($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_MethodCall(Expr\MethodCall $node): string { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node): string { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_StaticCall(Expr\StaticCall $node): string { - return $this->pStaticDereferenceLhs($node->class) . '::' - . ($node->name instanceof Expr - ? ($node->name instanceof Expr\Variable - ? $this->p($node->name) - : '{' . $this->p($node->name) . '}') - : $node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Empty(Expr\Empty_ $node): string { - return 'empty(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Isset(Expr\Isset_ $node): string { - return 'isset(' . $this->pCommaSeparated($node->vars) . ')'; - } - - protected function pExpr_Eval(Expr\Eval_ $node): string { - return 'eval(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Include(Expr\Include_ $node, int $precedence, int $lhsPrecedence): string { - static $map = [ - Expr\Include_::TYPE_INCLUDE => 'include', - Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', - Expr\Include_::TYPE_REQUIRE => 'require', - Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once', - ]; - - return $this->pPrefixOp(Expr\Include_::class, $map[$node->type] . ' ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_List(Expr\List_ $node): string { - $syntax = $node->getAttribute('kind', - $this->phpVersion->supportsShortArrayDestructuring() ? Expr\List_::KIND_ARRAY : Expr\List_::KIND_LIST); - if ($syntax === Expr\List_::KIND_ARRAY) { - return '[' . $this->pMaybeMultiline($node->items, true) . ']'; - } else { - return 'list(' . $this->pMaybeMultiline($node->items, true) . ')'; - } - } - - // Other - - protected function pExpr_Error(Expr\Error $node): string { - throw new \LogicException('Cannot pretty-print AST with Error nodes'); - } - - protected function pExpr_Variable(Expr\Variable $node): string { - if ($node->name instanceof Expr) { - return '${' . $this->p($node->name) . '}'; - } else { - return '$' . $node->name; - } - } - - protected function pExpr_Array(Expr\Array_ $node): string { - $syntax = $node->getAttribute('kind', - $this->shortArraySyntax ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); - if ($syntax === Expr\Array_::KIND_SHORT) { - return '[' . $this->pMaybeMultiline($node->items, true) . ']'; - } else { - return 'array(' . $this->pMaybeMultiline($node->items, true) . ')'; - } - } - - protected function pKey(?Node $node): string { - if ($node === null) { - return ''; - } - - // => is not really an operator and does not typically participate in precedence resolution. - // However, there is an exception if yield expressions with keys are involved: - // [yield $a => $b] is interpreted as [(yield $a => $b)], so we need to ensure that - // [(yield $a) => $b] is printed with parentheses. We approximate this by lowering the LHS - // precedence to that of yield (which will also print unnecessary parentheses for rare low - // precedence unary operators like include). - $yieldPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; - return $this->p($node, self::MAX_PRECEDENCE, $yieldPrecedence) . ' => '; - } - - protected function pArrayItem(Node\ArrayItem $node): string { - return $this->pKey($node->key) - . ($node->byRef ? '&' : '') - . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node): string { - return $this->pDereferenceLhs($node->var) - . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']'; - } - - protected function pExpr_ConstFetch(Expr\ConstFetch $node): string { - return $this->p($node->name); - } - - protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node): string { - return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name); - } - - protected function pExpr_PropertyFetch(Expr\PropertyFetch $node): string { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node): string { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node): string { - return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); - } - - protected function pExpr_ShellExec(Expr\ShellExec $node): string { - return '`' . $this->pEncapsList($node->parts, '`') . '`'; - } - - protected function pExpr_Closure(Expr\Closure $node): string { - return $this->pAttrGroups($node->attrGroups, true) - . $this->pStatic($node->static) - . 'function ' . ($node->byRef ? '&' : '') - . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' - . (!empty($node->uses) ? ' use (' . $this->pCommaSeparated($node->uses) . ')' : '') - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pExpr_Match(Expr\Match_ $node): string { - return 'match (' . $this->p($node->cond) . ') {' - . $this->pCommaSeparatedMultiline($node->arms, true) - . $this->nl - . '}'; - } - - protected function pMatchArm(Node\MatchArm $node): string { - $result = ''; - if ($node->conds) { - for ($i = 0, $c = \count($node->conds); $i + 1 < $c; $i++) { - $result .= $this->p($node->conds[$i]) . ', '; - } - $result .= $this->pKey($node->conds[$i]); - } else { - $result = 'default => '; - } - return $result . $this->p($node->body); - } - - protected function pExpr_ArrowFunction(Expr\ArrowFunction $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp( - Expr\ArrowFunction::class, - $this->pAttrGroups($node->attrGroups, true) - . $this->pStatic($node->static) - . 'fn' . ($node->byRef ? '&' : '') - . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . ' => ', - $node->expr, $precedence, $lhsPrecedence); - } - - protected function pClosureUse(Node\ClosureUse $node): string { - return ($node->byRef ? '&' : '') . $this->p($node->var); - } - - protected function pExpr_New(Expr\New_ $node): string { - if ($node->class instanceof Stmt\Class_) { - $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : ''; - return 'new ' . $this->pClassCommon($node->class, $args); - } - return 'new ' . $this->pNewOperand($node->class) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Clone(Expr\Clone_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\Clone_::class, 'clone ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Ternary(Expr\Ternary $node, int $precedence, int $lhsPrecedence): string { - // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator. - // this is okay because the part between ? and : never needs parentheses. - return $this->pInfixOp(Expr\Ternary::class, - $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else, - $precedence, $lhsPrecedence - ); - } - - protected function pExpr_Exit(Expr\Exit_ $node): string { - $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE); - return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') - . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : ''); - } - - protected function pExpr_Throw(Expr\Throw_ $node, int $precedence, int $lhsPrecedence): string { - return $this->pPrefixOp(Expr\Throw_::class, 'throw ', $node->expr, $precedence, $lhsPrecedence); - } - - protected function pExpr_Yield(Expr\Yield_ $node, int $precedence, int $lhsPrecedence): string { - if ($node->value === null) { - $opPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; - return $opPrecedence >= $lhsPrecedence ? '(yield)' : 'yield'; - } else { - if (!$this->phpVersion->supportsYieldWithoutParentheses()) { - return '(yield ' . $this->pKey($node->key) . $this->p($node->value) . ')'; - } - return $this->pPrefixOp( - Expr\Yield_::class, 'yield ' . $this->pKey($node->key), - $node->value, $precedence, $lhsPrecedence); - } - } - - // Declarations - - protected function pStmt_Namespace(Stmt\Namespace_ $node): string { - if ($this->canUseSemicolonNamespaces) { - return 'namespace ' . $this->p($node->name) . ';' - . $this->nl . $this->pStmts($node->stmts, false); - } else { - return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - } - - protected function pStmt_Use(Stmt\Use_ $node): string { - return 'use ' . $this->pUseType($node->type) - . $this->pCommaSeparated($node->uses) . ';'; - } - - protected function pStmt_GroupUse(Stmt\GroupUse $node): string { - return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) - . '\{' . $this->pCommaSeparated($node->uses) . '};'; - } - - protected function pUseItem(Node\UseItem $node): string { - return $this->pUseType($node->type) . $this->p($node->name) - . (null !== $node->alias ? ' as ' . $node->alias : ''); - } - - protected function pUseType(int $type): string { - return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' - : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : ''); - } - - protected function pStmt_Interface(Stmt\Interface_ $node): string { - return $this->pAttrGroups($node->attrGroups) - . 'interface ' . $node->name - . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Enum(Stmt\Enum_ $node): string { - return $this->pAttrGroups($node->attrGroups) - . 'enum ' . $node->name - . ($node->scalarType ? ' : ' . $this->p($node->scalarType) : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Class(Stmt\Class_ $node): string { - return $this->pClassCommon($node, ' ' . $node->name); - } - - protected function pStmt_Trait(Stmt\Trait_ $node): string { - return $this->pAttrGroups($node->attrGroups) - . 'trait ' . $node->name - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_EnumCase(Stmt\EnumCase $node): string { - return $this->pAttrGroups($node->attrGroups) - . 'case ' . $node->name - . ($node->expr ? ' = ' . $this->p($node->expr) : '') - . ';'; - } - - protected function pStmt_TraitUse(Stmt\TraitUse $node): string { - return 'use ' . $this->pCommaSeparated($node->traits) - . (empty($node->adaptations) - ? ';' - : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}'); - } - - protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node): string { - return $this->p($node->trait) . '::' . $node->method - . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';'; - } - - protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node): string { - return (null !== $node->trait ? $this->p($node->trait) . '::' : '') - . $node->method . ' as' - . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '') - . (null !== $node->newName ? ' ' . $node->newName : '') - . ';'; - } - - protected function pStmt_Property(Stmt\Property $node): string { - return $this->pAttrGroups($node->attrGroups) - . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) - . ($node->type ? $this->p($node->type) . ' ' : '') - . $this->pCommaSeparated($node->props) . ';'; - } - - protected function pPropertyItem(Node\PropertyItem $node): string { - return '$' . $node->name - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_ClassMethod(Stmt\ClassMethod $node): string { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . (null !== $node->stmts - ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' - : ';'); - } - - protected function pStmt_ClassConst(Stmt\ClassConst $node): string { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'const ' - . (null !== $node->type ? $this->p($node->type) . ' ' : '') - . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Function(Stmt\Function_ $node): string { - return $this->pAttrGroups($node->attrGroups) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Const(Stmt\Const_ $node): string { - return 'const ' . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Declare(Stmt\Declare_ $node): string { - return 'declare (' . $this->pCommaSeparated($node->declares) . ')' - . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); - } - - protected function pDeclareItem(Node\DeclareItem $node): string { - return $node->key . '=' . $this->p($node->value); - } - - // Control flow - - protected function pStmt_If(Stmt\If_ $node): string { - return 'if (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') - . (null !== $node->else ? ' ' . $this->p($node->else) : ''); - } - - protected function pStmt_ElseIf(Stmt\ElseIf_ $node): string { - return 'elseif (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Else(Stmt\Else_ $node): string { - if (\count($node->stmts) === 1 && $node->stmts[0] instanceof Stmt\If_) { - // Print as "else if" rather than "else { if }" - return 'else ' . $this->p($node->stmts[0]); - } - return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_For(Stmt\For_ $node): string { - return 'for (' - . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') - . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') - . $this->pCommaSeparated($node->loop) - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Foreach(Stmt\Foreach_ $node): string { - return 'foreach (' . $this->p($node->expr) . ' as ' - . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') - . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_While(Stmt\While_ $node): string { - return 'while (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Do(Stmt\Do_ $node): string { - return 'do {' . $this->pStmts($node->stmts) . $this->nl - . '} while (' . $this->p($node->cond) . ');'; - } - - protected function pStmt_Switch(Stmt\Switch_ $node): string { - return 'switch (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->cases) . $this->nl . '}'; - } - - protected function pStmt_Case(Stmt\Case_ $node): string { - return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' - . $this->pStmts($node->stmts); - } - - protected function pStmt_TryCatch(Stmt\TryCatch $node): string { - return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') - . ($node->finally !== null ? ' ' . $this->p($node->finally) : ''); - } - - protected function pStmt_Catch(Stmt\Catch_ $node): string { - return 'catch (' . $this->pImplode($node->types, '|') - . ($node->var !== null ? ' ' . $this->p($node->var) : '') - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Finally(Stmt\Finally_ $node): string { - return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Break(Stmt\Break_ $node): string { - return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Continue(Stmt\Continue_ $node): string { - return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Return(Stmt\Return_ $node): string { - return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';'; - } - - protected function pStmt_Label(Stmt\Label $node): string { - return $node->name . ':'; - } - - protected function pStmt_Goto(Stmt\Goto_ $node): string { - return 'goto ' . $node->name . ';'; - } - - // Other - - protected function pStmt_Expression(Stmt\Expression $node): string { - return $this->p($node->expr) . ';'; - } - - protected function pStmt_Echo(Stmt\Echo_ $node): string { - return 'echo ' . $this->pCommaSeparated($node->exprs) . ';'; - } - - protected function pStmt_Static(Stmt\Static_ $node): string { - return 'static ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStmt_Global(Stmt\Global_ $node): string { - return 'global ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStaticVar(Node\StaticVar $node): string { - return $this->p($node->var) - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_Unset(Stmt\Unset_ $node): string { - return 'unset(' . $this->pCommaSeparated($node->vars) . ');'; - } - - protected function pStmt_InlineHTML(Stmt\InlineHTML $node): string { - $newline = $node->getAttribute('hasLeadingNewline', true) ? $this->newline : ''; - return '?>' . $newline . $node->value . 'remaining; - } - - protected function pStmt_Nop(Stmt\Nop $node): string { - return ''; - } - - protected function pStmt_Block(Stmt\Block $node): string { - return '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - // Helpers - - protected function pClassCommon(Stmt\Class_ $node, string $afterClassToken): string { - return $this->pAttrGroups($node->attrGroups, $node->name === null) - . $this->pModifiers($node->flags) - . 'class' . $afterClassToken - . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pObjectProperty(Node $node): string { - if ($node instanceof Expr) { - return '{' . $this->p($node) . '}'; - } else { - assert($node instanceof Node\Identifier); - return $node->name; - } - } - - /** @param (Expr|Node\InterpolatedStringPart)[] $encapsList */ - protected function pEncapsList(array $encapsList, ?string $quote): string { - $return = ''; - foreach ($encapsList as $element) { - if ($element instanceof Node\InterpolatedStringPart) { - $return .= $this->escapeString($element->value, $quote); - } else { - $return .= '{' . $this->p($element) . '}'; - } - } - - return $return; - } - - protected function pSingleQuotedString(string $string): string { - // It is idiomatic to only escape backslashes when necessary, i.e. when followed by ', \ or - // the end of the string ('Foo\Bar' instead of 'Foo\\Bar'). However, we also don't want to - // produce an odd number of backslashes, so '\\\\a' should not get rendered as '\\\a', even - // though that would be legal. - $regex = '/\'|\\\\(?=[\'\\\\]|$)|(?<=\\\\)\\\\/'; - return '\'' . preg_replace($regex, '\\\\$0', $string) . '\''; - } - - protected function escapeString(string $string, ?string $quote): string { - if (null === $quote) { - // For doc strings, don't escape newlines - $escaped = addcslashes($string, "\t\f\v$\\"); - // But do escape isolated \r. Combined with the terminating newline, it might get - // interpreted as \r\n and dropped from the string contents. - $escaped = preg_replace('/\r(?!\n)/', '\\r', $escaped); - if ($this->phpVersion->supportsFlexibleHeredoc()) { - $escaped = $this->indentString($escaped); - } - } else { - $escaped = addcslashes($string, "\n\r\t\f\v$" . $quote . "\\"); - } - - // Escape control characters and non-UTF-8 characters. - // Regex based on https://stackoverflow.com/a/11709412/385378. - $regex = '/( - [\x00-\x08\x0E-\x1F] # Control characters - | [\xC0-\xC1] # Invalid UTF-8 Bytes - | [\xF5-\xFF] # Invalid UTF-8 Bytes - | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point - | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point - | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start - | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start - | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start - | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle - | (? $part) { - if ($part instanceof Node\InterpolatedStringPart - && $this->containsEndLabel($this->escapeString($part->value, null), $label, $i === 0) - ) { - return true; - } - } - return false; - } - - protected function pDereferenceLhs(Node $node): string { - if (!$this->dereferenceLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pStaticDereferenceLhs(Node $node): string { - if (!$this->staticDereferenceLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pCallLhs(Node $node): string { - if (!$this->callLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pNewOperand(Node $node): string { - if (!$this->newOperandRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - /** - * @param Node[] $nodes - */ - protected function hasNodeWithComments(array $nodes): bool { - foreach ($nodes as $node) { - if ($node && $node->getComments()) { - return true; - } - } - return false; - } - - /** @param Node[] $nodes */ - protected function pMaybeMultiline(array $nodes, bool $trailingComma = false): string { - if (!$this->hasNodeWithComments($nodes)) { - return $this->pCommaSeparated($nodes); - } else { - return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl; - } - } - - /** @param Node\AttributeGroup[] $nodes */ - protected function pAttrGroups(array $nodes, bool $inline = false): string { - $result = ''; - $sep = $inline ? ' ' : $this->nl; - foreach ($nodes as $node) { - $result .= $this->p($node) . $sep; - } - - return $result; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php deleted file mode 100644 index 8303c42..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ /dev/null @@ -1,1655 +0,0 @@ - */ - protected array $precedenceMap = [ - // [precedence, precedenceLHS, precedenceRHS] - // Where the latter two are the precedences to use for the LHS and RHS of a binary operator, - // where 1 is added to one of the sides depending on associativity. This information is not - // used for unary operators and set to -1. - Expr\Clone_::class => [-10, 0, 1], - BinaryOp\Pow::class => [ 0, 0, 1], - Expr\BitwiseNot::class => [ 10, -1, -1], - Expr\UnaryPlus::class => [ 10, -1, -1], - Expr\UnaryMinus::class => [ 10, -1, -1], - Cast\Int_::class => [ 10, -1, -1], - Cast\Double::class => [ 10, -1, -1], - Cast\String_::class => [ 10, -1, -1], - Cast\Array_::class => [ 10, -1, -1], - Cast\Object_::class => [ 10, -1, -1], - Cast\Bool_::class => [ 10, -1, -1], - Cast\Unset_::class => [ 10, -1, -1], - Expr\ErrorSuppress::class => [ 10, -1, -1], - Expr\Instanceof_::class => [ 20, -1, -1], - Expr\BooleanNot::class => [ 30, -1, -1], - BinaryOp\Mul::class => [ 40, 41, 40], - BinaryOp\Div::class => [ 40, 41, 40], - BinaryOp\Mod::class => [ 40, 41, 40], - BinaryOp\Plus::class => [ 50, 51, 50], - BinaryOp\Minus::class => [ 50, 51, 50], - BinaryOp\Concat::class => [ 50, 51, 50], - BinaryOp\ShiftLeft::class => [ 60, 61, 60], - BinaryOp\ShiftRight::class => [ 60, 61, 60], - BinaryOp\Smaller::class => [ 70, 70, 70], - BinaryOp\SmallerOrEqual::class => [ 70, 70, 70], - BinaryOp\Greater::class => [ 70, 70, 70], - BinaryOp\GreaterOrEqual::class => [ 70, 70, 70], - BinaryOp\Equal::class => [ 80, 80, 80], - BinaryOp\NotEqual::class => [ 80, 80, 80], - BinaryOp\Identical::class => [ 80, 80, 80], - BinaryOp\NotIdentical::class => [ 80, 80, 80], - BinaryOp\Spaceship::class => [ 80, 80, 80], - BinaryOp\BitwiseAnd::class => [ 90, 91, 90], - BinaryOp\BitwiseXor::class => [100, 101, 100], - BinaryOp\BitwiseOr::class => [110, 111, 110], - BinaryOp\BooleanAnd::class => [120, 121, 120], - BinaryOp\BooleanOr::class => [130, 131, 130], - BinaryOp\Coalesce::class => [140, 140, 141], - Expr\Ternary::class => [150, -1, -1], - Expr\Assign::class => [160, -1, -1], - Expr\AssignRef::class => [160, -1, -1], - AssignOp\Plus::class => [160, -1, -1], - AssignOp\Minus::class => [160, -1, -1], - AssignOp\Mul::class => [160, -1, -1], - AssignOp\Div::class => [160, -1, -1], - AssignOp\Concat::class => [160, -1, -1], - AssignOp\Mod::class => [160, -1, -1], - AssignOp\BitwiseAnd::class => [160, -1, -1], - AssignOp\BitwiseOr::class => [160, -1, -1], - AssignOp\BitwiseXor::class => [160, -1, -1], - AssignOp\ShiftLeft::class => [160, -1, -1], - AssignOp\ShiftRight::class => [160, -1, -1], - AssignOp\Pow::class => [160, -1, -1], - AssignOp\Coalesce::class => [160, -1, -1], - Expr\YieldFrom::class => [170, -1, -1], - Expr\Yield_::class => [175, -1, -1], - Expr\Print_::class => [180, -1, -1], - BinaryOp\LogicalAnd::class => [190, 191, 190], - BinaryOp\LogicalXor::class => [200, 201, 200], - BinaryOp\LogicalOr::class => [210, 211, 210], - Expr\Include_::class => [220, -1, -1], - Expr\ArrowFunction::class => [230, -1, -1], - Expr\Throw_::class => [240, -1, -1], - ]; - - /** @var int Current indentation level. */ - protected int $indentLevel; - /** @var string Newline style. Does not include current indentation. */ - protected string $newline; - /** @var string Newline including current indentation. */ - protected string $nl; - /** @var string|null Token placed at end of doc string to ensure it is followed by a newline. - * Null if flexible doc strings are used. */ - protected ?string $docStringEndToken; - /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */ - protected bool $canUseSemicolonNamespaces; - /** @var bool Whether to use short array syntax if the node specifies no preference */ - protected bool $shortArraySyntax; - /** @var PhpVersion PHP version to target */ - protected PhpVersion $phpVersion; - - /** @var TokenStream|null Original tokens for use in format-preserving pretty print */ - protected ?TokenStream $origTokens; - /** @var Internal\Differ Differ for node lists */ - protected Differ $nodeListDiffer; - /** @var array Map determining whether a certain character is a label character */ - protected array $labelCharMap; - /** - * @var array> Map from token classes and subnode names to FIXUP_* constants. - * This is used during format-preserving prints to place additional parens/braces if necessary. - */ - protected array $fixupMap; - /** - * @var array Map from "{$node->getType()}->{$subNode}" - * to ['left' => $l, 'right' => $r], where $l and $r specify the token type that needs to be stripped - * when removing this node. - */ - protected array $removalMap; - /** - * @var array Map from - * "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. - * $find is an optional token after which the insertion occurs. $extraLeft/Right - * are optionally added before/after the main insertions. - */ - protected array $insertionMap; - /** - * @var array Map From "{$class}->{$subNode}" to string that should be inserted - * between elements of this list subnode. - */ - protected array $listInsertionMap; - - /** - * @var array - */ - protected array $emptyListInsertionMap; - /** @var array Map from "{$class}->{$subNode}" to [$printFn, $token] - * where $printFn is the function to print the modifiers and $token is the token before which - * the modifiers should be reprinted. */ - protected array $modifierChangeMap; - - /** - * Creates a pretty printer instance using the given options. - * - * Supported options: - * * PhpVersion $phpVersion: The PHP version to target (default to PHP 7.4). This option - * controls compatibility of the generated code with older PHP - * versions in cases where a simple stylistic choice exists (e.g. - * array() vs []). It is safe to pretty-print an AST for a newer - * PHP version while specifying an older target (but the result will - * of course not be compatible with the older version in that case). - * * string $newline: The newline style to use. Should be "\n" (default) or "\r\n". - * * bool $shortArraySyntax: Whether to use [] instead of array() as the default array - * syntax, if the node does not specify a format. Defaults to whether - * the phpVersion support short array syntax. - * - * @param array{ - * phpVersion?: PhpVersion, newline?: string, shortArraySyntax?: bool - * } $options Dictionary of formatting options - */ - public function __construct(array $options = []) { - $this->phpVersion = $options['phpVersion'] ?? PhpVersion::fromComponents(7, 4); - - $this->newline = $options['newline'] ?? "\n"; - if ($this->newline !== "\n" && $this->newline != "\r\n") { - throw new \LogicException('Option "newline" must be one of "\n" or "\r\n"'); - } - - $this->shortArraySyntax = - $options['shortArraySyntax'] ?? $this->phpVersion->supportsShortArraySyntax(); - $this->docStringEndToken = - $this->phpVersion->supportsFlexibleHeredoc() ? null : '_DOC_STRING_END_' . mt_rand(); - } - - /** - * Reset pretty printing state. - */ - protected function resetState(): void { - $this->indentLevel = 0; - $this->nl = $this->newline; - $this->origTokens = null; - } - - /** - * Set indentation level - * - * @param int $level Level in number of spaces - */ - protected function setIndentLevel(int $level): void { - $this->indentLevel = $level; - $this->nl = $this->newline . \str_repeat(' ', $level); - } - - /** - * Increase indentation level. - */ - protected function indent(): void { - $this->indentLevel += 4; - $this->nl .= ' '; - } - - /** - * Decrease indentation level. - */ - protected function outdent(): void { - assert($this->indentLevel >= 4); - $this->indentLevel -= 4; - $this->nl = $this->newline . str_repeat(' ', $this->indentLevel); - } - - /** - * Pretty prints an array of statements. - * - * @param Node[] $stmts Array of statements - * - * @return string Pretty printed statements - */ - public function prettyPrint(array $stmts): string { - $this->resetState(); - $this->preprocessNodes($stmts); - - return ltrim($this->handleMagicTokens($this->pStmts($stmts, false))); - } - - /** - * Pretty prints an expression. - * - * @param Expr $node Expression node - * - * @return string Pretty printed node - */ - public function prettyPrintExpr(Expr $node): string { - $this->resetState(); - return $this->handleMagicTokens($this->p($node)); - } - - /** - * Pretty prints a file of statements (includes the opening newline . $this->newline; - } - - $p = "newline . $this->newline . $this->prettyPrint($stmts); - - if ($stmts[0] instanceof Stmt\InlineHTML) { - $p = preg_replace('/^<\?php\s+\?>\r?\n?/', '', $p); - } - if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) { - $p = preg_replace('/<\?php$/', '', rtrim($p)); - } - - return $p; - } - - /** - * Preprocesses the top-level nodes to initialize pretty printer state. - * - * @param Node[] $nodes Array of nodes - */ - protected function preprocessNodes(array $nodes): void { - /* We can use semicolon-namespaces unless there is a global namespace declaration */ - $this->canUseSemicolonNamespaces = true; - foreach ($nodes as $node) { - if ($node instanceof Stmt\Namespace_ && null === $node->name) { - $this->canUseSemicolonNamespaces = false; - break; - } - } - } - - /** - * Handles (and removes) doc-string-end tokens. - */ - protected function handleMagicTokens(string $str): string { - if ($this->docStringEndToken !== null) { - // Replace doc-string-end tokens with nothing or a newline - $str = str_replace( - $this->docStringEndToken . ';' . $this->newline, - ';' . $this->newline, - $str); - $str = str_replace($this->docStringEndToken, $this->newline, $str); - } - - return $str; - } - - /** - * Pretty prints an array of nodes (statements) and indents them optionally. - * - * @param Node[] $nodes Array of nodes - * @param bool $indent Whether to indent the printed nodes - * - * @return string Pretty printed statements - */ - protected function pStmts(array $nodes, bool $indent = true): string { - if ($indent) { - $this->indent(); - } - - $result = ''; - foreach ($nodes as $node) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - if ($node instanceof Stmt\Nop) { - continue; - } - } - - $result .= $this->nl . $this->p($node); - } - - if ($indent) { - $this->outdent(); - } - - return $result; - } - - /** - * Pretty-print an infix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param Node $leftNode Left-hand side node - * @param string $operatorString String representation of the operator - * @param Node $rightNode Right-hand side node - * @param int $precedence Precedence of parent operator - * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator - * - * @return string Pretty printed infix operation - */ - protected function pInfixOp( - string $class, Node $leftNode, string $operatorString, Node $rightNode, - int $precedence, int $lhsPrecedence - ): string { - list($opPrecedence, $newPrecedenceLHS, $newPrecedenceRHS) = $this->precedenceMap[$class]; - $prefix = ''; - $suffix = ''; - if ($opPrecedence >= $precedence) { - $prefix = '('; - $suffix = ')'; - $lhsPrecedence = self::MAX_PRECEDENCE; - } - return $prefix . $this->p($leftNode, $newPrecedenceLHS, $newPrecedenceLHS) - . $operatorString . $this->p($rightNode, $newPrecedenceRHS, $lhsPrecedence) . $suffix; - } - - /** - * Pretty-print a prefix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * @param int $precedence Precedence of parent operator - * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator - * - * @return string Pretty printed prefix operation - */ - protected function pPrefixOp(string $class, string $operatorString, Node $node, int $precedence, int $lhsPrecedence): string { - $opPrecedence = $this->precedenceMap[$class][0]; - $prefix = ''; - $suffix = ''; - if ($opPrecedence >= $lhsPrecedence) { - $prefix = '('; - $suffix = ')'; - $lhsPrecedence = self::MAX_PRECEDENCE; - } - $printedArg = $this->p($node, $opPrecedence, $lhsPrecedence); - if (($operatorString === '+' && $printedArg[0] === '+') || - ($operatorString === '-' && $printedArg[0] === '-') - ) { - // Avoid printing +(+$a) as ++$a and similar. - $printedArg = '(' . $printedArg . ')'; - } - return $prefix . $operatorString . $printedArg . $suffix; - } - - /** - * Pretty-print a postfix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * @param int $precedence Precedence of parent operator - * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator - * - * @return string Pretty printed postfix operation - */ - protected function pPostfixOp(string $class, Node $node, string $operatorString, int $precedence, int $lhsPrecedence): string { - $opPrecedence = $this->precedenceMap[$class][0]; - $prefix = ''; - $suffix = ''; - if ($opPrecedence >= $precedence) { - $prefix = '('; - $suffix = ')'; - $lhsPrecedence = self::MAX_PRECEDENCE; - } - if ($opPrecedence < $lhsPrecedence) { - $lhsPrecedence = $opPrecedence; - } - return $prefix . $this->p($node, $opPrecedence, $lhsPrecedence) . $operatorString . $suffix; - } - - /** - * Pretty prints an array of nodes and implodes the printed values. - * - * @param Node[] $nodes Array of Nodes to be printed - * @param string $glue Character to implode with - * - * @return string Imploded pretty printed nodes> $pre - */ - protected function pImplode(array $nodes, string $glue = ''): string { - $pNodes = []; - foreach ($nodes as $node) { - if (null === $node) { - $pNodes[] = ''; - } else { - $pNodes[] = $this->p($node); - } - } - - return implode($glue, $pNodes); - } - - /** - * Pretty prints an array of nodes and implodes the printed values with commas. - * - * @param Node[] $nodes Array of Nodes to be printed - * - * @return string Comma separated pretty printed nodes - */ - protected function pCommaSeparated(array $nodes): string { - return $this->pImplode($nodes, ', '); - } - - /** - * Pretty prints a comma-separated list of nodes in multiline style, including comments. - * - * The result includes a leading newline and one level of indentation (same as pStmts). - * - * @param Node[] $nodes Array of Nodes to be printed - * @param bool $trailingComma Whether to use a trailing comma - * - * @return string Comma separated pretty printed nodes in multiline style - */ - protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma): string { - $this->indent(); - - $result = ''; - $lastIdx = count($nodes) - 1; - foreach ($nodes as $idx => $node) { - if ($node !== null) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - } - - $result .= $this->nl . $this->p($node); - } else { - $result .= $this->nl; - } - if ($trailingComma || $idx !== $lastIdx) { - $result .= ','; - } - } - - $this->outdent(); - return $result; - } - - /** - * Prints reformatted text of the passed comments. - * - * @param Comment[] $comments List of comments - * - * @return string Reformatted text of comments - */ - protected function pComments(array $comments): string { - $formattedComments = []; - - foreach ($comments as $comment) { - $formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText()); - } - - return implode($this->nl, $formattedComments); - } - - /** - * Perform a format-preserving pretty print of an AST. - * - * The format preservation is best effort. For some changes to the AST the formatting will not - * be preserved (at least not locally). - * - * In order to use this method a number of prerequisites must be satisfied: - * * The startTokenPos and endTokenPos attributes in the lexer must be enabled. - * * The CloningVisitor must be run on the AST prior to modification. - * * The original tokens must be provided, using the getTokens() method on the lexer. - * - * @param Node[] $stmts Modified AST with links to original AST - * @param Node[] $origStmts Original AST with token offset information - * @param Token[] $origTokens Tokens of the original code - */ - public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string { - $this->initializeNodeListDiffer(); - $this->initializeLabelCharMap(); - $this->initializeFixupMap(); - $this->initializeRemovalMap(); - $this->initializeInsertionMap(); - $this->initializeListInsertionMap(); - $this->initializeEmptyListInsertionMap(); - $this->initializeModifierChangeMap(); - - $this->resetState(); - $this->origTokens = new TokenStream($origTokens); - - $this->preprocessNodes($stmts); - - $pos = 0; - $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null); - if (null !== $result) { - $result .= $this->origTokens->getTokenCode($pos, count($origTokens) - 1, 0); - } else { - // Fallback - // TODO Add newline . $this->pStmts($stmts, false); - } - - return $this->handleMagicTokens($result); - } - - protected function pFallback(Node $node, int $precedence, int $lhsPrecedence): string { - return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); - } - - /** - * Pretty prints a node. - * - * This method also handles formatting preservation for nodes. - * - * @param Node $node Node to be pretty printed - * @param int $precedence Precedence of parent operator - * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator - * @param bool $parentFormatPreserved Whether parent node has preserved formatting - * - * @return string Pretty printed node - */ - protected function p( - Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE, - bool $parentFormatPreserved = false - ): string { - // No orig tokens means this is a normal pretty print without preservation of formatting - if (!$this->origTokens) { - return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); - } - - /** @var Node|null $origNode */ - $origNode = $node->getAttribute('origNode'); - if (null === $origNode) { - return $this->pFallback($node, $precedence, $lhsPrecedence); - } - - $class = \get_class($node); - \assert($class === \get_class($origNode)); - - $startPos = $origNode->getStartTokenPos(); - $endPos = $origNode->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - - $fallbackNode = $node; - if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) { - // Normalize node structure of anonymous classes - assert($origNode instanceof Expr\New_); - $node = PrintableNewAnonClassNode::fromNewNode($node); - $origNode = PrintableNewAnonClassNode::fromNewNode($origNode); - $class = PrintableNewAnonClassNode::class; - } - - // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting - // is not preserved, then we need to use the fallback code to make sure the tags are - // printed. - if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) { - return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); - } - - $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos); - - $type = $node->getType(); - $fixupInfo = $this->fixupMap[$class] ?? null; - - $result = ''; - $pos = $startPos; - foreach ($node->getSubNodeNames() as $subNodeName) { - $subNode = $node->$subNodeName; - $origSubNode = $origNode->$subNodeName; - - if ((!$subNode instanceof Node && $subNode !== null) - || (!$origSubNode instanceof Node && $origSubNode !== null) - ) { - if ($subNode === $origSubNode) { - // Unchanged, can reuse old code - continue; - } - - if (is_array($subNode) && is_array($origSubNode)) { - // Array subnode changed, we might be able to reconstruct it - $listResult = $this->pArray( - $subNode, $origSubNode, $pos, $indentAdjustment, $class, $subNodeName, - $fixupInfo[$subNodeName] ?? null - ); - if (null === $listResult) { - return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); - } - - $result .= $listResult; - continue; - } - - // Check if this is a modifier change - $key = $class . '->' . $subNodeName; - if (!isset($this->modifierChangeMap[$key])) { - return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); - } - - [$printFn, $findToken] = $this->modifierChangeMap[$key]; - $result .= $this->$printFn($subNode); - $pos = $this->origTokens->findRight($pos, $findToken); - continue; - } - - $extraLeft = ''; - $extraRight = ''; - if ($origSubNode !== null) { - $subStartPos = $origSubNode->getStartTokenPos(); - $subEndPos = $origSubNode->getEndTokenPos(); - \assert($subStartPos >= 0 && $subEndPos >= 0); - } else { - if ($subNode === null) { - // Both null, nothing to do - continue; - } - - // A node has been inserted, check if we have insertion information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->insertionMap[$key])) { - return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); - } - - list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key]; - if (null !== $findToken) { - $subStartPos = $this->origTokens->findRight($pos, $findToken) - + (int) !$beforeToken; - } else { - $subStartPos = $pos; - } - - if (null === $extraLeft && null !== $extraRight) { - // If inserting on the right only, skipping whitespace looks better - $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos); - } - $subEndPos = $subStartPos - 1; - } - - if (null === $subNode) { - // A node has been removed, check if we have removal information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->removalMap[$key])) { - return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); - } - - // Adjust positions to account for additional tokens that must be skipped - $removalInfo = $this->removalMap[$key]; - if (isset($removalInfo['left'])) { - $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1; - } - if (isset($removalInfo['right'])) { - $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1; - } - } - - $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment); - - if (null !== $subNode) { - $result .= $extraLeft; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); - - // If it's the same node that was previously in this position, it certainly doesn't - // need fixup. It's important to check this here, because our fixup checks are more - // conservative than strictly necessary. - if (isset($fixupInfo[$subNodeName]) - && $subNode->getAttribute('origNode') !== $origSubNode - ) { - $fixup = $fixupInfo[$subNodeName]; - $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos); - } else { - $res = $this->p($subNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); - } - - $this->safeAppend($result, $res); - $this->setIndentLevel($origIndentLevel); - - $result .= $extraRight; - } - - $pos = $subEndPos + 1; - } - - $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment); - return $result; - } - - /** - * Perform a format-preserving pretty print of an array. - * - * @param Node[] $nodes New nodes - * @param Node[] $origNodes Original nodes - * @param int $pos Current token position (updated by reference) - * @param int $indentAdjustment Adjustment for indentation - * @param string $parentNodeClass Class of the containing node. - * @param string $subNodeName Name of array subnode. - * @param null|int $fixup Fixup information for array item nodes - * - * @return null|string Result of pretty print or null if cannot preserve formatting - */ - protected function pArray( - array $nodes, array $origNodes, int &$pos, int $indentAdjustment, - string $parentNodeClass, string $subNodeName, ?int $fixup - ): ?string { - $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes); - - $mapKey = $parentNodeClass . '->' . $subNodeName; - $insertStr = $this->listInsertionMap[$mapKey] ?? null; - $isStmtList = $subNodeName === 'stmts'; - - $beforeFirstKeepOrReplace = true; - $skipRemovedNode = false; - $delayedAdd = []; - $lastElemIndentLevel = $this->indentLevel; - - $insertNewline = false; - if ($insertStr === "\n") { - $insertStr = ''; - $insertNewline = true; - } - - if ($isStmtList && \count($origNodes) === 1 && \count($nodes) !== 1) { - $startPos = $origNodes[0]->getStartTokenPos(); - $endPos = $origNodes[0]->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - if (!$this->origTokens->haveBraces($startPos, $endPos)) { - // This was a single statement without braces, but either additional statements - // have been added, or the single statement has been removed. This requires the - // addition of braces. For now fall back. - // TODO: Try to preserve formatting - return null; - } - } - - $result = ''; - foreach ($diff as $i => $diffElem) { - $diffType = $diffElem->type; - /** @var Node|string|null $arrItem */ - $arrItem = $diffElem->new; - /** @var Node|string|null $origArrItem */ - $origArrItem = $diffElem->old; - - if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { - $beforeFirstKeepOrReplace = false; - - if ($origArrItem === null || $arrItem === null) { - // We can only handle the case where both are null - if ($origArrItem === $arrItem) { - continue; - } - return null; - } - - if (!$arrItem instanceof Node || !$origArrItem instanceof Node) { - // We can only deal with nodes. This can occur for Names, which use string arrays. - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); - - $origIndentLevel = $this->indentLevel; - $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; - $this->setIndentLevel($lastElemIndentLevel); - - $comments = $arrItem->getComments(); - $origComments = $origArrItem->getComments(); - $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos; - \assert($commentStartPos >= 0); - - if ($commentStartPos < $pos) { - // Comments may be assigned to multiple nodes if they start at the same position. - // Make sure we don't try to print them multiple times. - $commentStartPos = $itemStartPos; - } - - if ($skipRemovedNode) { - if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { - // We'd remove an opening/closing PHP tag. - // TODO: Preserve formatting. - $this->setIndentLevel($origIndentLevel); - return null; - } - } else { - $result .= $this->origTokens->getTokenCode( - $pos, $commentStartPos, $indentAdjustment); - } - - if (!empty($delayedAdd)) { - /** @var Node $delayedAddNode */ - foreach ($delayedAdd as $delayedAddNode) { - if ($insertNewline) { - $delayedAddComments = $delayedAddNode->getComments(); - if ($delayedAddComments) { - $result .= $this->pComments($delayedAddComments) . $this->nl; - } - } - - $this->safeAppend($result, $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true)); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - } else { - $result .= $insertStr; - } - } - - $delayedAdd = []; - } - - if ($comments !== $origComments) { - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $this->origTokens->getTokenCode( - $commentStartPos, $itemStartPos, $indentAdjustment); - } - - // If we had to remove anything, we have done so now. - $skipRemovedNode = false; - } elseif ($diffType === DiffElem::TYPE_ADD) { - if (null === $insertStr) { - // We don't have insertion information for this list type - return null; - } - - if (!$arrItem instanceof Node) { - // We only support list insertion of nodes. - return null; - } - - // We go multiline if the original code was multiline, - // or if it's an array item with a comment above it. - // Match always uses multiline formatting. - if ($insertStr === ', ' && - ($this->isMultiline($origNodes) || $arrItem->getComments() || - $parentNodeClass === Expr\Match_::class) - ) { - $insertStr = ','; - $insertNewline = true; - } - - if ($beforeFirstKeepOrReplace) { - // Will be inserted at the next "replace" or "keep" element - $delayedAdd[] = $arrItem; - continue; - } - - $itemStartPos = $pos; - $itemEndPos = $pos - 1; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($lastElemIndentLevel); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - $comments = $arrItem->getComments(); - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $insertStr; - } - } elseif ($diffType === DiffElem::TYPE_REMOVE) { - if (!$origArrItem instanceof Node) { - // We only support removal for nodes - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0); - - // Consider comments part of the node. - $origComments = $origArrItem->getComments(); - if ($origComments) { - $itemStartPos = $origComments[0]->getStartTokenPos(); - } - - if ($i === 0) { - // If we're removing from the start, keep the tokens before the node and drop those after it, - // instead of the other way around. - $result .= $this->origTokens->getTokenCode( - $pos, $itemStartPos, $indentAdjustment); - $skipRemovedNode = true; - } else { - if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { - // We'd remove an opening/closing PHP tag. - // TODO: Preserve formatting. - return null; - } - } - - $pos = $itemEndPos + 1; - continue; - } else { - throw new \Exception("Shouldn't happen"); - } - - if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) { - $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos); - } else { - $res = $this->p($arrItem, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); - } - $this->safeAppend($result, $res); - - $this->setIndentLevel($origIndentLevel); - $pos = $itemEndPos + 1; - } - - if ($skipRemovedNode) { - // TODO: Support removing single node. - return null; - } - - if (!empty($delayedAdd)) { - if (!isset($this->emptyListInsertionMap[$mapKey])) { - return null; - } - - list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey]; - if (null !== $findToken) { - $insertPos = $this->origTokens->findRight($pos, $findToken) + 1; - $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment); - $pos = $insertPos; - } - - $first = true; - $result .= $extraLeft; - foreach ($delayedAdd as $delayedAddNode) { - if (!$first) { - $result .= $insertStr; - if ($insertNewline) { - $result .= $this->nl; - } - } - $result .= $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); - $first = false; - } - $result .= $extraRight === "\n" ? $this->nl : $extraRight; - } - - return $result; - } - - /** - * Print node with fixups. - * - * Fixups here refer to the addition of extra parentheses, braces or other characters, that - * are required to preserve program semantics in a certain context (e.g. to maintain precedence - * or because only certain expressions are allowed in certain places). - * - * @param int $fixup Fixup type - * @param Node $subNode Subnode to print - * @param string|null $parentClass Class of parent node - * @param int $subStartPos Original start pos of subnode - * @param int $subEndPos Original end pos of subnode - * - * @return string Result of fixed-up print of subnode - */ - protected function pFixup(int $fixup, Node $subNode, ?string $parentClass, int $subStartPos, int $subEndPos): string { - switch ($fixup) { - case self::FIXUP_PREC_LEFT: - // We use a conservative approximation where lhsPrecedence == precedence. - if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - $precedence = $this->precedenceMap[$parentClass][1]; - return $this->p($subNode, $precedence, $precedence); - } - break; - case self::FIXUP_PREC_RIGHT: - if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - $precedence = $this->precedenceMap[$parentClass][2]; - return $this->p($subNode, $precedence, $precedence); - } - break; - case self::FIXUP_PREC_UNARY: - if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - $precedence = $this->precedenceMap[$parentClass][0]; - return $this->p($subNode, $precedence, $precedence); - } - break; - case self::FIXUP_CALL_LHS: - if ($this->callLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_DEREF_LHS: - if ($this->dereferenceLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_STATIC_DEREF_LHS: - if ($this->staticDereferenceLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_NEW: - if ($this->newOperandRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos)) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_BRACED_NAME: - case self::FIXUP_VAR_BRACED_NAME: - if ($subNode instanceof Expr - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '') - . '{' . $this->p($subNode) . '}'; - } - break; - case self::FIXUP_ENCAPSED: - if (!$subNode instanceof Node\InterpolatedStringPart - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return '{' . $this->p($subNode) . '}'; - } - break; - default: - throw new \Exception('Cannot happen'); - } - - // Nothing special to do - return $this->p($subNode); - } - - /** - * Appends to a string, ensuring whitespace between label characters. - * - * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x". - * Without safeAppend the result would be "echox", which does not preserve semantics. - */ - protected function safeAppend(string &$str, string $append): void { - if ($str === "") { - $str = $append; - return; - } - - if ($append === "") { - return; - } - - if (!$this->labelCharMap[$append[0]] - || !$this->labelCharMap[$str[\strlen($str) - 1]]) { - $str .= $append; - } else { - $str .= " " . $append; - } - } - - /** - * Determines whether the LHS of a call must be wrapped in parenthesis. - * - * @param Node $node LHS of a call - * - * @return bool Whether parentheses are required - */ - protected function callLhsRequiresParens(Node $node): bool { - return !($node instanceof Node\Name - || $node instanceof Expr\Variable - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_); - } - - /** - * Determines whether the LHS of an array/object operation must be wrapped in parentheses. - * - * @param Node $node LHS of dereferencing operation - * - * @return bool Whether parentheses are required - */ - protected function dereferenceLhsRequiresParens(Node $node): bool { - // A constant can occur on the LHS of an array/object deref, but not a static deref. - return $this->staticDereferenceLhsRequiresParens($node) - && !$node instanceof Expr\ConstFetch; - } - - /** - * Determines whether the LHS of a static operation must be wrapped in parentheses. - * - * @param Node $node LHS of dereferencing operation - * - * @return bool Whether parentheses are required - */ - protected function staticDereferenceLhsRequiresParens(Node $node): bool { - return !($node instanceof Expr\Variable - || $node instanceof Node\Name - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\PropertyFetch - || $node instanceof Expr\NullsafePropertyFetch - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_ - || $node instanceof Scalar\String_ - || $node instanceof Expr\ClassConstFetch); - } - - /** - * Determines whether an expression used in "new" or "instanceof" requires parentheses. - * - * @param Node $node New or instanceof operand - * - * @return bool Whether parentheses are required - */ - protected function newOperandRequiresParens(Node $node): bool { - if ($node instanceof Node\Name || $node instanceof Expr\Variable) { - return false; - } - if ($node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || - $node instanceof Expr\NullsafePropertyFetch - ) { - return $this->newOperandRequiresParens($node->var); - } - if ($node instanceof Expr\StaticPropertyFetch) { - return $this->newOperandRequiresParens($node->class); - } - return true; - } - - /** - * Print modifiers, including trailing whitespace. - * - * @param int $modifiers Modifier mask to print - * - * @return string Printed modifiers - */ - protected function pModifiers(int $modifiers): string { - return ($modifiers & Modifiers::FINAL ? 'final ' : '') - . ($modifiers & Modifiers::ABSTRACT ? 'abstract ' : '') - . ($modifiers & Modifiers::PUBLIC ? 'public ' : '') - . ($modifiers & Modifiers::PROTECTED ? 'protected ' : '') - . ($modifiers & Modifiers::PRIVATE ? 'private ' : '') - . ($modifiers & Modifiers::STATIC ? 'static ' : '') - . ($modifiers & Modifiers::READONLY ? 'readonly ' : ''); - } - - protected function pStatic(bool $static): string { - return $static ? 'static ' : ''; - } - - /** - * Determine whether a list of nodes uses multiline formatting. - * - * @param (Node|null)[] $nodes Node list - * - * @return bool Whether multiline formatting is used - */ - protected function isMultiline(array $nodes): bool { - if (\count($nodes) < 2) { - return false; - } - - $pos = -1; - foreach ($nodes as $node) { - if (null === $node) { - continue; - } - - $endPos = $node->getEndTokenPos() + 1; - if ($pos >= 0) { - $text = $this->origTokens->getTokenCode($pos, $endPos, 0); - if (false === strpos($text, "\n")) { - // We require that a newline is present between *every* item. If the formatting - // is inconsistent, with only some items having newlines, we don't consider it - // as multiline - return false; - } - } - $pos = $endPos; - } - - return true; - } - - /** - * Lazily initializes label char map. - * - * The label char map determines whether a certain character may occur in a label. - */ - protected function initializeLabelCharMap(): void { - if (isset($this->labelCharMap)) { - return; - } - - $this->labelCharMap = []; - for ($i = 0; $i < 256; $i++) { - $chr = chr($i); - $this->labelCharMap[$chr] = $i >= 0x80 || ctype_alnum($chr); - } - - if ($this->phpVersion->allowsDelInIdentifiers()) { - $this->labelCharMap["\x7f"] = true; - } - } - - /** - * Lazily initializes node list differ. - * - * The node list differ is used to determine differences between two array subnodes. - */ - protected function initializeNodeListDiffer(): void { - if (isset($this->nodeListDiffer)) { - return; - } - - $this->nodeListDiffer = new Internal\Differ(function ($a, $b) { - if ($a instanceof Node && $b instanceof Node) { - return $a === $b->getAttribute('origNode'); - } - // Can happen for array destructuring - return $a === null && $b === null; - }); - } - - /** - * Lazily initializes fixup map. - * - * The fixup map is used to determine whether a certain subnode of a certain node may require - * some kind of "fixup" operation, e.g. the addition of parenthesis or braces. - */ - protected function initializeFixupMap(): void { - if (isset($this->fixupMap)) { - return; - } - - $this->fixupMap = [ - Expr\Instanceof_::class => [ - 'expr' => self::FIXUP_PREC_UNARY, - 'class' => self::FIXUP_NEW, - ], - Expr\Ternary::class => [ - 'cond' => self::FIXUP_PREC_LEFT, - 'else' => self::FIXUP_PREC_RIGHT, - ], - Expr\Yield_::class => ['value' => self::FIXUP_PREC_UNARY], - - Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS], - Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => [ - 'class' => self::FIXUP_STATIC_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\New_::class => ['class' => self::FIXUP_NEW], - Expr\MethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafeMethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_STATIC_DEREF_LHS, - 'name' => self::FIXUP_VAR_BRACED_NAME, - ], - Expr\PropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafePropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Scalar\InterpolatedString::class => [ - 'parts' => self::FIXUP_ENCAPSED, - ], - ]; - - $binaryOps = [ - BinaryOp\Pow::class, BinaryOp\Mul::class, BinaryOp\Div::class, BinaryOp\Mod::class, - BinaryOp\Plus::class, BinaryOp\Minus::class, BinaryOp\Concat::class, - BinaryOp\ShiftLeft::class, BinaryOp\ShiftRight::class, BinaryOp\Smaller::class, - BinaryOp\SmallerOrEqual::class, BinaryOp\Greater::class, BinaryOp\GreaterOrEqual::class, - BinaryOp\Equal::class, BinaryOp\NotEqual::class, BinaryOp\Identical::class, - BinaryOp\NotIdentical::class, BinaryOp\Spaceship::class, BinaryOp\BitwiseAnd::class, - BinaryOp\BitwiseXor::class, BinaryOp\BitwiseOr::class, BinaryOp\BooleanAnd::class, - BinaryOp\BooleanOr::class, BinaryOp\Coalesce::class, BinaryOp\LogicalAnd::class, - BinaryOp\LogicalXor::class, BinaryOp\LogicalOr::class, - ]; - foreach ($binaryOps as $binaryOp) { - $this->fixupMap[$binaryOp] = [ - 'left' => self::FIXUP_PREC_LEFT, - 'right' => self::FIXUP_PREC_RIGHT - ]; - } - - $prefixOps = [ - Expr\Clone_::class, Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, - Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, - Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, - Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class, - Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, - AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, - AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, - AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class, - Expr\ArrowFunction::class, Expr\Throw_::class, - ]; - foreach ($prefixOps as $prefixOp) { - $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_UNARY]; - } - } - - /** - * Lazily initializes the removal map. - * - * The removal map is used to determine which additional tokens should be removed when a - * certain node is replaced by null. - */ - protected function initializeRemovalMap(): void { - if (isset($this->removalMap)) { - return; - } - - $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE]; - $stripLeft = ['left' => \T_WHITESPACE]; - $stripRight = ['right' => \T_WHITESPACE]; - $stripDoubleArrow = ['right' => \T_DOUBLE_ARROW]; - $stripColon = ['left' => ':']; - $stripEquals = ['left' => '=']; - $this->removalMap = [ - 'Expr_ArrayDimFetch->dim' => $stripBoth, - 'ArrayItem->key' => $stripDoubleArrow, - 'Expr_ArrowFunction->returnType' => $stripColon, - 'Expr_Closure->returnType' => $stripColon, - 'Expr_Exit->expr' => $stripBoth, - 'Expr_Ternary->if' => $stripBoth, - 'Expr_Yield->key' => $stripDoubleArrow, - 'Expr_Yield->value' => $stripBoth, - 'Param->type' => $stripRight, - 'Param->default' => $stripEquals, - 'Stmt_Break->num' => $stripBoth, - 'Stmt_Catch->var' => $stripLeft, - 'Stmt_ClassConst->type' => $stripRight, - 'Stmt_ClassMethod->returnType' => $stripColon, - 'Stmt_Class->extends' => ['left' => \T_EXTENDS], - 'Stmt_Enum->scalarType' => $stripColon, - 'Stmt_EnumCase->expr' => $stripEquals, - 'Expr_PrintableNewAnonClass->extends' => ['left' => \T_EXTENDS], - 'Stmt_Continue->num' => $stripBoth, - 'Stmt_Foreach->keyVar' => $stripDoubleArrow, - 'Stmt_Function->returnType' => $stripColon, - 'Stmt_If->else' => $stripLeft, - 'Stmt_Namespace->name' => $stripLeft, - 'Stmt_Property->type' => $stripRight, - 'PropertyItem->default' => $stripEquals, - 'Stmt_Return->expr' => $stripBoth, - 'Stmt_StaticVar->default' => $stripEquals, - 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, - 'Stmt_TryCatch->finally' => $stripLeft, - // 'Stmt_Case->cond': Replace with "default" - // 'Stmt_Class->name': Unclear what to do - // 'Stmt_Declare->stmts': Not a plain node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a plain node - ]; - } - - protected function initializeInsertionMap(): void { - if (isset($this->insertionMap)) { - return; - } - - // TODO: "yield" where both key and value are inserted doesn't work - // [$find, $beforeToken, $extraLeft, $extraRight] - $this->insertionMap = [ - 'Expr_ArrayDimFetch->dim' => ['[', false, null, null], - 'ArrayItem->key' => [null, false, null, ' => '], - 'Expr_ArrowFunction->returnType' => [')', false, ': ', null], - 'Expr_Closure->returnType' => [')', false, ': ', null], - 'Expr_Ternary->if' => ['?', false, ' ', ' '], - 'Expr_Yield->key' => [\T_YIELD, false, null, ' => '], - 'Expr_Yield->value' => [\T_YIELD, false, ' ', null], - 'Param->type' => [null, false, null, ' '], - 'Param->default' => [null, false, ' = ', null], - 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], - 'Stmt_Catch->var' => [null, false, ' ', null], - 'Stmt_ClassMethod->returnType' => [')', false, ': ', null], - 'Stmt_ClassConst->type' => [\T_CONST, false, ' ', null], - 'Stmt_Class->extends' => [null, false, ' extends ', null], - 'Stmt_Enum->scalarType' => [null, false, ' : ', null], - 'Stmt_EnumCase->expr' => [null, false, ' = ', null], - 'Expr_PrintableNewAnonClass->extends' => [null, false, ' extends ', null], - 'Stmt_Continue->num' => [\T_CONTINUE, false, ' ', null], - 'Stmt_Foreach->keyVar' => [\T_AS, false, null, ' => '], - 'Stmt_Function->returnType' => [')', false, ': ', null], - 'Stmt_If->else' => [null, false, ' ', null], - 'Stmt_Namespace->name' => [\T_NAMESPACE, false, ' ', null], - 'Stmt_Property->type' => [\T_VARIABLE, true, null, ' '], - 'PropertyItem->default' => [null, false, ' = ', null], - 'Stmt_Return->expr' => [\T_RETURN, false, ' ', null], - 'Stmt_StaticVar->default' => [null, false, ' = ', null], - //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO - 'Stmt_TryCatch->finally' => [null, false, ' ', null], - - // 'Expr_Exit->expr': Complicated due to optional () - // 'Stmt_Case->cond': Conversion from default to case - // 'Stmt_Class->name': Unclear - // 'Stmt_Declare->stmts': Not a proper node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a proper node - ]; - } - - protected function initializeListInsertionMap(): void { - if (isset($this->listInsertionMap)) { - return; - } - - $this->listInsertionMap = [ - // special - //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully - //'Scalar_InterpolatedString->parts' => '', - Stmt\Catch_::class . '->types' => '|', - UnionType::class . '->types' => '|', - IntersectionType::class . '->types' => '&', - Stmt\If_::class . '->elseifs' => ' ', - Stmt\TryCatch::class . '->catches' => ' ', - - // comma-separated lists - Expr\Array_::class . '->items' => ', ', - Expr\ArrowFunction::class . '->params' => ', ', - Expr\Closure::class . '->params' => ', ', - Expr\Closure::class . '->uses' => ', ', - Expr\FuncCall::class . '->args' => ', ', - Expr\Isset_::class . '->vars' => ', ', - Expr\List_::class . '->items' => ', ', - Expr\MethodCall::class . '->args' => ', ', - Expr\NullsafeMethodCall::class . '->args' => ', ', - Expr\New_::class . '->args' => ', ', - PrintableNewAnonClassNode::class . '->args' => ', ', - Expr\StaticCall::class . '->args' => ', ', - Stmt\ClassConst::class . '->consts' => ', ', - Stmt\ClassMethod::class . '->params' => ', ', - Stmt\Class_::class . '->implements' => ', ', - Stmt\Enum_::class . '->implements' => ', ', - PrintableNewAnonClassNode::class . '->implements' => ', ', - Stmt\Const_::class . '->consts' => ', ', - Stmt\Declare_::class . '->declares' => ', ', - Stmt\Echo_::class . '->exprs' => ', ', - Stmt\For_::class . '->init' => ', ', - Stmt\For_::class . '->cond' => ', ', - Stmt\For_::class . '->loop' => ', ', - Stmt\Function_::class . '->params' => ', ', - Stmt\Global_::class . '->vars' => ', ', - Stmt\GroupUse::class . '->uses' => ', ', - Stmt\Interface_::class . '->extends' => ', ', - Expr\Match_::class . '->arms' => ', ', - Stmt\Property::class . '->props' => ', ', - Stmt\StaticVar::class . '->vars' => ', ', - Stmt\TraitUse::class . '->traits' => ', ', - Stmt\TraitUseAdaptation\Precedence::class . '->insteadof' => ', ', - Stmt\Unset_::class . '->vars' => ', ', - Stmt\UseUse::class . '->uses' => ', ', - MatchArm::class . '->conds' => ', ', - AttributeGroup::class . '->attrs' => ', ', - - // statement lists - Expr\Closure::class . '->stmts' => "\n", - Stmt\Case_::class . '->stmts' => "\n", - Stmt\Catch_::class . '->stmts' => "\n", - Stmt\Class_::class . '->stmts' => "\n", - Stmt\Enum_::class . '->stmts' => "\n", - PrintableNewAnonClassNode::class . '->stmts' => "\n", - Stmt\Interface_::class . '->stmts' => "\n", - Stmt\Trait_::class . '->stmts' => "\n", - Stmt\ClassMethod::class . '->stmts' => "\n", - Stmt\Declare_::class . '->stmts' => "\n", - Stmt\Do_::class . '->stmts' => "\n", - Stmt\ElseIf_::class . '->stmts' => "\n", - Stmt\Else_::class . '->stmts' => "\n", - Stmt\Finally_::class . '->stmts' => "\n", - Stmt\Foreach_::class . '->stmts' => "\n", - Stmt\For_::class . '->stmts' => "\n", - Stmt\Function_::class . '->stmts' => "\n", - Stmt\If_::class . '->stmts' => "\n", - Stmt\Namespace_::class . '->stmts' => "\n", - Stmt\Block::class . '->stmts' => "\n", - - // Attribute groups - Stmt\Class_::class . '->attrGroups' => "\n", - Stmt\Enum_::class . '->attrGroups' => "\n", - Stmt\EnumCase::class . '->attrGroups' => "\n", - Stmt\Interface_::class . '->attrGroups' => "\n", - Stmt\Trait_::class . '->attrGroups' => "\n", - Stmt\Function_::class . '->attrGroups' => "\n", - Stmt\ClassMethod::class . '->attrGroups' => "\n", - Stmt\ClassConst::class . '->attrGroups' => "\n", - Stmt\Property::class . '->attrGroups' => "\n", - PrintableNewAnonClassNode::class . '->attrGroups' => ' ', - Expr\Closure::class . '->attrGroups' => ' ', - Expr\ArrowFunction::class . '->attrGroups' => ' ', - Param::class . '->attrGroups' => ' ', - Stmt\Switch_::class . '->cases' => "\n", - Stmt\TraitUse::class . '->adaptations' => "\n", - Stmt\TryCatch::class . '->stmts' => "\n", - Stmt\While_::class . '->stmts' => "\n", - - // dummy for top-level context - 'File->stmts' => "\n", - ]; - } - - protected function initializeEmptyListInsertionMap(): void { - if (isset($this->emptyListInsertionMap)) { - return; - } - - // TODO Insertion into empty statement lists. - - // [$find, $extraLeft, $extraRight] - $this->emptyListInsertionMap = [ - Expr\ArrowFunction::class . '->params' => ['(', '', ''], - Expr\Closure::class . '->uses' => [')', ' use (', ')'], - Expr\Closure::class . '->params' => ['(', '', ''], - Expr\FuncCall::class . '->args' => ['(', '', ''], - Expr\MethodCall::class . '->args' => ['(', '', ''], - Expr\NullsafeMethodCall::class . '->args' => ['(', '', ''], - Expr\New_::class . '->args' => ['(', '', ''], - PrintableNewAnonClassNode::class . '->args' => ['(', '', ''], - PrintableNewAnonClassNode::class . '->implements' => [null, ' implements ', ''], - Expr\StaticCall::class . '->args' => ['(', '', ''], - Stmt\Class_::class . '->implements' => [null, ' implements ', ''], - Stmt\Enum_::class . '->implements' => [null, ' implements ', ''], - Stmt\ClassMethod::class . '->params' => ['(', '', ''], - Stmt\Interface_::class . '->extends' => [null, ' extends ', ''], - Stmt\Function_::class . '->params' => ['(', '', ''], - Stmt\Interface_::class . '->attrGroups' => [null, '', "\n"], - Stmt\Class_::class . '->attrGroups' => [null, '', "\n"], - Stmt\ClassConst::class . '->attrGroups' => [null, '', "\n"], - Stmt\ClassMethod::class . '->attrGroups' => [null, '', "\n"], - Stmt\Function_::class . '->attrGroups' => [null, '', "\n"], - Stmt\Property::class . '->attrGroups' => [null, '', "\n"], - Stmt\Trait_::class . '->attrGroups' => [null, '', "\n"], - Expr\ArrowFunction::class . '->attrGroups' => [null, '', ' '], - Expr\Closure::class . '->attrGroups' => [null, '', ' '], - PrintableNewAnonClassNode::class . '->attrGroups' => [\T_NEW, ' ', ''], - - /* These cannot be empty to start with: - * Expr_Isset->vars - * Stmt_Catch->types - * Stmt_Const->consts - * Stmt_ClassConst->consts - * Stmt_Declare->declares - * Stmt_Echo->exprs - * Stmt_Global->vars - * Stmt_GroupUse->uses - * Stmt_Property->props - * Stmt_StaticVar->vars - * Stmt_TraitUse->traits - * Stmt_TraitUseAdaptation_Precedence->insteadof - * Stmt_Unset->vars - * Stmt_Use->uses - * UnionType->types - */ - - /* TODO - * Stmt_If->elseifs - * Stmt_TryCatch->catches - * Expr_Array->items - * Expr_List->items - * Stmt_For->init - * Stmt_For->cond - * Stmt_For->loop - */ - ]; - } - - protected function initializeModifierChangeMap(): void { - if (isset($this->modifierChangeMap)) { - return; - } - - $this->modifierChangeMap = [ - Stmt\ClassConst::class . '->flags' => ['pModifiers', \T_CONST], - Stmt\ClassMethod::class . '->flags' => ['pModifiers', \T_FUNCTION], - Stmt\Class_::class . '->flags' => ['pModifiers', \T_CLASS], - Stmt\Property::class . '->flags' => ['pModifiers', \T_VARIABLE], - PrintableNewAnonClassNode::class . '->flags' => ['pModifiers', \T_CLASS], - Param::class . '->flags' => ['pModifiers', \T_VARIABLE], - Expr\Closure::class . '->static' => ['pStatic', \T_FUNCTION], - Expr\ArrowFunction::class . '->static' => ['pStatic', \T_FN], - //Stmt\TraitUseAdaptation\Alias::class . '->newModifier' => 0, // TODO - ]; - - // List of integer subnodes that are not modifiers: - // Expr_Include->type - // Stmt_GroupUse->type - // Stmt_Use->type - // UseItem->type - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Token.php b/vendor/nikic/php-parser/lib/PhpParser/Token.php deleted file mode 100644 index 6683310..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Token.php +++ /dev/null @@ -1,18 +0,0 @@ -pos + \strlen($this->text); - } - - /** Get 1-based end line number of the token. */ - public function getEndLine(): int { - return $this->line + \substr_count($this->text, "\n"); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php b/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php deleted file mode 100644 index 273271d..0000000 --- a/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +++ /dev/null @@ -1,63 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Exception as VersionException; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraintParser; - -class ManifestDocumentMapper { - public function map(ManifestDocument $document): Manifest { - try { - $contains = $document->getContainsElement(); - $type = $this->mapType($contains); - $copyright = $this->mapCopyright($document->getCopyrightElement()); - $requirements = $this->mapRequirements($document->getRequiresElement()); - $bundledComponents = $this->mapBundledComponents($document); - - return new Manifest( - new ApplicationName($contains->getName()), - new Version($contains->getVersion()), - $type, - $copyright, - $requirements, - $bundledComponents - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } catch (Exception $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } - } - - private function mapType(ContainsElement $contains): Type { - switch ($contains->getType()) { - case 'application': - return Type::application(); - case 'library': - return Type::library(); - case 'extension': - return $this->mapExtension($contains->getExtensionElement()); - } - - throw new ManifestDocumentMapperException( - \sprintf('Unsupported type %s', $contains->getType()) - ); - } - - private function mapCopyright(CopyrightElement $copyright): CopyrightInformation { - $authors = new AuthorCollection(); - - foreach ($copyright->getAuthorElements() as $authorElement) { - $authors->add( - new Author( - $authorElement->getName(), - new Email($authorElement->getEmail()) - ) - ); - } - - $licenseElement = $copyright->getLicenseElement(); - $license = new License( - $licenseElement->getType(), - new Url($licenseElement->getUrl()) - ); - - return new CopyrightInformation( - $authors, - $license - ); - } - - private function mapRequirements(RequiresElement $requires): RequirementCollection { - $collection = new RequirementCollection(); - $phpElement = $requires->getPHPElement(); - $parser = new VersionConstraintParser; - - try { - $versionConstraint = $parser->parse($phpElement->getVersion()); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - - $collection->add( - new PhpVersionRequirement( - $versionConstraint - ) - ); - - if (!$phpElement->hasExtElements()) { - return $collection; - } - - foreach ($phpElement->getExtElements() as $extElement) { - $collection->add( - new PhpExtensionRequirement($extElement->getName()) - ); - } - - return $collection; - } - - private function mapBundledComponents(ManifestDocument $document): BundledComponentCollection { - $collection = new BundledComponentCollection(); - - if (!$document->hasBundlesElement()) { - return $collection; - } - - foreach ($document->getBundlesElement()->getComponentElements() as $componentElement) { - $collection->add( - new BundledComponent( - $componentElement->getName(), - new Version( - $componentElement->getVersion() - ) - ) - ); - } - - return $collection; - } - - private function mapExtension(ExtensionElement $extension): Extension { - try { - $versionConstraint = (new VersionConstraintParser)->parse($extension->getCompatible()); - - return Type::extension( - new ApplicationName($extension->getFor()), - $versionConstraint - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestLoader.php b/vendor/phar-io/manifest/src/ManifestLoader.php deleted file mode 100644 index ae884e4..0000000 --- a/vendor/phar-io/manifest/src/ManifestLoader.php +++ /dev/null @@ -1,44 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ManifestLoader { - public static function fromFile(string $filename): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromFile($filename) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - \sprintf('Loading %s failed.', $filename), - (int)$e->getCode(), - $e - ); - } - } - - public static function fromPhar(string $filename): Manifest { - return self::fromFile('phar://' . $filename . '/manifest.xml'); - } - - public static function fromString(string $manifest): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromString($manifest) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - 'Processing string failed', - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestSerializer.php b/vendor/phar-io/manifest/src/ManifestSerializer.php deleted file mode 100644 index e236b59..0000000 --- a/vendor/phar-io/manifest/src/ManifestSerializer.php +++ /dev/null @@ -1,168 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\AnyVersionConstraint; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; -use XMLWriter; - -/** @psalm-suppress MissingConstructor */ -class ManifestSerializer { - /** @var XMLWriter */ - private $xmlWriter; - - public function serializeToFile(Manifest $manifest, string $filename): void { - \file_put_contents( - $filename, - $this->serializeToString($manifest) - ); - } - - public function serializeToString(Manifest $manifest): string { - $this->startDocument(); - - $this->addContains($manifest->getName(), $manifest->getVersion(), $manifest->getType()); - $this->addCopyright($manifest->getCopyrightInformation()); - $this->addRequirements($manifest->getRequirements()); - $this->addBundles($manifest->getBundledComponents()); - - return $this->finishDocument(); - } - - private function startDocument(): void { - $xmlWriter = new XMLWriter(); - $xmlWriter->openMemory(); - $xmlWriter->setIndent(true); - $xmlWriter->setIndentString(\str_repeat(' ', 4)); - $xmlWriter->startDocument('1.0', 'UTF-8'); - $xmlWriter->startElement('phar'); - $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); - - $this->xmlWriter = $xmlWriter; - } - - private function finishDocument(): string { - $this->xmlWriter->endElement(); - $this->xmlWriter->endDocument(); - - return $this->xmlWriter->outputMemory(); - } - - private function addContains(ApplicationName $name, Version $version, Type $type): void { - $this->xmlWriter->startElement('contains'); - $this->xmlWriter->writeAttribute('name', $name->asString()); - $this->xmlWriter->writeAttribute('version', $version->getVersionString()); - - switch (true) { - case $type->isApplication(): { - $this->xmlWriter->writeAttribute('type', 'application'); - - break; - } - - case $type->isLibrary(): { - $this->xmlWriter->writeAttribute('type', 'library'); - - break; - } - - case $type->isExtension(): { - $this->xmlWriter->writeAttribute('type', 'extension'); - /* @var $type Extension */ - $this->addExtension( - $type->getApplicationName(), - $type->getVersionConstraint() - ); - - break; - } - - default: { - $this->xmlWriter->writeAttribute('type', 'custom'); - } - } - - $this->xmlWriter->endElement(); - } - - private function addCopyright(CopyrightInformation $copyrightInformation): void { - $this->xmlWriter->startElement('copyright'); - - foreach ($copyrightInformation->getAuthors() as $author) { - $this->xmlWriter->startElement('author'); - $this->xmlWriter->writeAttribute('name', $author->getName()); - $this->xmlWriter->writeAttribute('email', $author->getEmail()->asString()); - $this->xmlWriter->endElement(); - } - - $license = $copyrightInformation->getLicense(); - - $this->xmlWriter->startElement('license'); - $this->xmlWriter->writeAttribute('type', $license->getName()); - $this->xmlWriter->writeAttribute('url', $license->getUrl()->asString()); - $this->xmlWriter->endElement(); - - $this->xmlWriter->endElement(); - } - - private function addRequirements(RequirementCollection $requirementCollection): void { - $phpRequirement = new AnyVersionConstraint(); - $extensions = []; - - foreach ($requirementCollection as $requirement) { - if ($requirement instanceof PhpVersionRequirement) { - $phpRequirement = $requirement->getVersionConstraint(); - - continue; - } - - if ($requirement instanceof PhpExtensionRequirement) { - $extensions[] = $requirement->asString(); - } - } - - $this->xmlWriter->startElement('requires'); - $this->xmlWriter->startElement('php'); - $this->xmlWriter->writeAttribute('version', $phpRequirement->asString()); - - foreach ($extensions as $extension) { - $this->xmlWriter->startElement('ext'); - $this->xmlWriter->writeAttribute('name', $extension); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - $this->xmlWriter->endElement(); - } - - private function addBundles(BundledComponentCollection $bundledComponentCollection): void { - if (\count($bundledComponentCollection) === 0) { - return; - } - $this->xmlWriter->startElement('bundles'); - - foreach ($bundledComponentCollection as $bundledComponent) { - $this->xmlWriter->startElement('component'); - $this->xmlWriter->writeAttribute('name', $bundledComponent->getName()); - $this->xmlWriter->writeAttribute('version', $bundledComponent->getVersion()->getVersionString()); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - } - - private function addExtension(ApplicationName $applicationName, VersionConstraint $versionConstraint): void { - $this->xmlWriter->startElement('extension'); - $this->xmlWriter->writeAttribute('for', $applicationName->asString()); - $this->xmlWriter->writeAttribute('compatible', $versionConstraint->asString()); - $this->xmlWriter->endElement(); - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php deleted file mode 100644 index 766fc0e..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ElementCollectionException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/Exception.php b/vendor/phar-io/manifest/src/exceptions/Exception.php deleted file mode 100644 index e7f1220..0000000 --- a/vendor/phar-io/manifest/src/exceptions/Exception.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Exception extends \Throwable { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php deleted file mode 100644 index 952901e..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php +++ /dev/null @@ -1,14 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { - public const InvalidFormat = 2; -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php deleted file mode 100644 index 3cbe082..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidEmailException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php deleted file mode 100644 index 8f77e29..0000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidUrlException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php deleted file mode 100644 index cf1c314..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use LibXMLError; - -class ManifestDocumentLoadingException extends \Exception implements Exception { - /** @var LibXMLError[] */ - private $libxmlErrors; - - /** - * ManifestDocumentLoadingException constructor. - * - * @param LibXMLError[] $libxmlErrors - */ - public function __construct(array $libxmlErrors) { - $this->libxmlErrors = $libxmlErrors; - $first = $this->libxmlErrors[0]; - - parent::__construct( - \sprintf( - '%s (Line: %d / Column: %d / File: %s)', - $first->message, - $first->line, - $first->column, - $first->file - ), - $first->code - ); - } - - /** - * @return LibXMLError[] - */ - public function getLibxmlErrors(): array { - return $this->libxmlErrors; - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php deleted file mode 100644 index 43373bd..0000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Application extends Type { - public function isApplication(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/ApplicationName.php b/vendor/phar-io/manifest/src/values/ApplicationName.php deleted file mode 100644 index d71744a..0000000 --- a/vendor/phar-io/manifest/src/values/ApplicationName.php +++ /dev/null @@ -1,37 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ApplicationName { - /** @var string */ - private $name; - - public function __construct(string $name) { - $this->ensureValidFormat($name); - $this->name = $name; - } - - public function asString(): string { - return $this->name; - } - - public function isEqual(ApplicationName $name): bool { - return $this->name === $name->name; - } - - private function ensureValidFormat(string $name): void { - if (!\preg_match('#\w/\w#', $name)) { - throw new InvalidApplicationNameException( - \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), - InvalidApplicationNameException::InvalidFormat - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Author.php b/vendor/phar-io/manifest/src/values/Author.php deleted file mode 100644 index 82b666e..0000000 --- a/vendor/phar-io/manifest/src/values/Author.php +++ /dev/null @@ -1,39 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Author { - /** @var string */ - private $name; - - /** @var Email */ - private $email; - - public function __construct(string $name, Email $email) { - $this->name = $name; - $this->email = $email; - } - - public function asString(): string { - return \sprintf( - '%s <%s>', - $this->name, - $this->email->asString() - ); - } - - public function getName(): string { - return $this->name; - } - - public function getEmail(): Email { - return $this->email; - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollection.php b/vendor/phar-io/manifest/src/values/AuthorCollection.php deleted file mode 100644 index 27e50ad..0000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollection implements \Countable, \IteratorAggregate { - /** @var Author[] */ - private $authors = []; - - public function add(Author $author): void { - $this->authors[] = $author; - } - - /** - * @return Author[] - */ - public function getAuthors(): array { - return $this->authors; - } - - public function count(): int { - return \count($this->authors); - } - - public function getIterator(): AuthorCollectionIterator { - return new AuthorCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php deleted file mode 100644 index 4ff3c39..0000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollectionIterator implements \Iterator { - /** @var Author[] */ - private $authors; - - /** @var int */ - private $position = 0; - - public function __construct(AuthorCollection $authors) { - $this->authors = $authors->getAuthors(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->authors); - } - - public function key(): int { - return $this->position; - } - - public function current(): Author { - return $this->authors[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponent.php b/vendor/phar-io/manifest/src/values/BundledComponent.php deleted file mode 100644 index ea77b44..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponent.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class BundledComponent { - /** @var string */ - private $name; - - /** @var Version */ - private $version; - - public function __construct(string $name, Version $version) { - $this->name = $name; - $this->version = $version; - } - - public function getName(): string { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php deleted file mode 100644 index b628eaa..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollection implements \Countable, \IteratorAggregate { - /** @var BundledComponent[] */ - private $bundledComponents = []; - - public function add(BundledComponent $bundledComponent): void { - $this->bundledComponents[] = $bundledComponent; - } - - /** - * @return BundledComponent[] - */ - public function getBundledComponents(): array { - return $this->bundledComponents; - } - - public function count(): int { - return \count($this->bundledComponents); - } - - public function getIterator(): BundledComponentCollectionIterator { - return new BundledComponentCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php deleted file mode 100644 index 462db45..0000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollectionIterator implements \Iterator { - /** @var BundledComponent[] */ - private $bundledComponents; - - /** @var int */ - private $position = 0; - - public function __construct(BundledComponentCollection $bundledComponents) { - $this->bundledComponents = $bundledComponents->getBundledComponents(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->bundledComponents); - } - - public function key(): int { - return $this->position; - } - - public function current(): BundledComponent { - return $this->bundledComponents[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/vendor/phar-io/manifest/src/values/CopyrightInformation.php deleted file mode 100644 index d26f947..0000000 --- a/vendor/phar-io/manifest/src/values/CopyrightInformation.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightInformation { - /** @var AuthorCollection */ - private $authors; - - /** @var License */ - private $license; - - public function __construct(AuthorCollection $authors, License $license) { - $this->authors = $authors; - $this->license = $license; - } - - public function getAuthors(): AuthorCollection { - return $this->authors; - } - - public function getLicense(): License { - return $this->license; - } -} diff --git a/vendor/phar-io/manifest/src/values/Email.php b/vendor/phar-io/manifest/src/values/Email.php deleted file mode 100644 index 588348d..0000000 --- a/vendor/phar-io/manifest/src/values/Email.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Email { - /** @var string */ - private $email; - - public function __construct(string $email) { - $this->ensureEmailIsValid($email); - - $this->email = $email; - } - - public function asString(): string { - return $this->email; - } - - private function ensureEmailIsValid(string $url): void { - if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { - throw new InvalidEmailException; - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Extension.php b/vendor/phar-io/manifest/src/values/Extension.php deleted file mode 100644 index 4c5726f..0000000 --- a/vendor/phar-io/manifest/src/values/Extension.php +++ /dev/null @@ -1,46 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; - -class Extension extends Type { - /** @var ApplicationName */ - private $application; - - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(ApplicationName $application, VersionConstraint $versionConstraint) { - $this->application = $application; - $this->versionConstraint = $versionConstraint; - } - - public function getApplicationName(): ApplicationName { - return $this->application; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } - - public function isExtension(): bool { - return true; - } - - public function isExtensionFor(ApplicationName $name): bool { - return $this->application->isEqual($name); - } - - public function isCompatibleWith(ApplicationName $name, Version $version): bool { - return $this->isExtensionFor($name) && $this->versionConstraint->complies($version); - } -} diff --git a/vendor/phar-io/manifest/src/values/Library.php b/vendor/phar-io/manifest/src/values/Library.php deleted file mode 100644 index 21849e1..0000000 --- a/vendor/phar-io/manifest/src/values/Library.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Library extends Type { - public function isLibrary(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/License.php b/vendor/phar-io/manifest/src/values/License.php deleted file mode 100644 index 39542fe..0000000 --- a/vendor/phar-io/manifest/src/values/License.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class License { - /** @var string */ - private $name; - - /** @var Url */ - private $url; - - public function __construct(string $name, Url $url) { - $this->name = $name; - $this->url = $url; - } - - public function getName(): string { - return $this->name; - } - - public function getUrl(): Url { - return $this->url; - } -} diff --git a/vendor/phar-io/manifest/src/values/Manifest.php b/vendor/phar-io/manifest/src/values/Manifest.php deleted file mode 100644 index 0140b84..0000000 --- a/vendor/phar-io/manifest/src/values/Manifest.php +++ /dev/null @@ -1,92 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class Manifest { - /** @var ApplicationName */ - private $name; - - /** @var Version */ - private $version; - - /** @var Type */ - private $type; - - /** @var CopyrightInformation */ - private $copyrightInformation; - - /** @var RequirementCollection */ - private $requirements; - - /** @var BundledComponentCollection */ - private $bundledComponents; - - public function __construct(ApplicationName $name, Version $version, Type $type, CopyrightInformation $copyrightInformation, RequirementCollection $requirements, BundledComponentCollection $bundledComponents) { - $this->name = $name; - $this->version = $version; - $this->type = $type; - $this->copyrightInformation = $copyrightInformation; - $this->requirements = $requirements; - $this->bundledComponents = $bundledComponents; - } - - public function getName(): ApplicationName { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } - - public function getType(): Type { - return $this->type; - } - - public function getCopyrightInformation(): CopyrightInformation { - return $this->copyrightInformation; - } - - public function getRequirements(): RequirementCollection { - return $this->requirements; - } - - public function getBundledComponents(): BundledComponentCollection { - return $this->bundledComponents; - } - - public function isApplication(): bool { - return $this->type->isApplication(); - } - - public function isLibrary(): bool { - return $this->type->isLibrary(); - } - - public function isExtension(): bool { - return $this->type->isExtension(); - } - - public function isExtensionFor(ApplicationName $application, Version $version = null): bool { - if (!$this->isExtension()) { - return false; - } - - /** @var Extension $type */ - $type = $this->type; - - if ($version !== null) { - return $type->isCompatibleWith($application, $version); - } - - return $type->isExtensionFor($application); - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php deleted file mode 100644 index 088f385..0000000 --- a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpExtensionRequirement implements Requirement { - /** @var string */ - private $extension; - - public function __construct(string $extension) { - $this->extension = $extension; - } - - public function asString(): string { - return $this->extension; - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php deleted file mode 100644 index f8d6f6d..0000000 --- a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -class PhpVersionRequirement implements Requirement { - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(VersionConstraint $versionConstraint) { - $this->versionConstraint = $versionConstraint; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } -} diff --git a/vendor/phar-io/manifest/src/values/Requirement.php b/vendor/phar-io/manifest/src/values/Requirement.php deleted file mode 100644 index 8b845d6..0000000 --- a/vendor/phar-io/manifest/src/values/Requirement.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Requirement { -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollection.php b/vendor/phar-io/manifest/src/values/RequirementCollection.php deleted file mode 100644 index b82cd95..0000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollection implements \Countable, \IteratorAggregate { - /** @var Requirement[] */ - private $requirements = []; - - public function add(Requirement $requirement): void { - $this->requirements[] = $requirement; - } - - /** - * @return Requirement[] - */ - public function getRequirements(): array { - return $this->requirements; - } - - public function count(): int { - return \count($this->requirements); - } - - public function getIterator(): RequirementCollectionIterator { - return new RequirementCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php deleted file mode 100644 index 5614eaf..0000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollectionIterator implements \Iterator { - /** @var Requirement[] */ - private $requirements; - - /** @var int */ - private $position = 0; - - public function __construct(RequirementCollection $requirements) { - $this->requirements = $requirements->getRequirements(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->requirements); - } - - public function key(): int { - return $this->position; - } - - public function current(): Requirement { - return $this->requirements[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/Type.php b/vendor/phar-io/manifest/src/values/Type.php deleted file mode 100644 index 23b2898..0000000 --- a/vendor/phar-io/manifest/src/values/Type.php +++ /dev/null @@ -1,41 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -abstract class Type { - public static function application(): Application { - return new Application; - } - - public static function library(): Library { - return new Library; - } - - public static function extension(ApplicationName $application, VersionConstraint $versionConstraint): Extension { - return new Extension($application, $versionConstraint); - } - - /** @psalm-assert-if-true Application $this */ - public function isApplication(): bool { - return false; - } - - /** @psalm-assert-if-true Library $this */ - public function isLibrary(): bool { - return false; - } - - /** @psalm-assert-if-true Extension $this */ - public function isExtension(): bool { - return false; - } -} diff --git a/vendor/phar-io/manifest/src/values/Url.php b/vendor/phar-io/manifest/src/values/Url.php deleted file mode 100644 index 6395253..0000000 --- a/vendor/phar-io/manifest/src/values/Url.php +++ /dev/null @@ -1,36 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Url { - /** @var string */ - private $url; - - public function __construct(string $url) { - $this->ensureUrlIsValid($url); - - $this->url = $url; - } - - public function asString(): string { - return $this->url; - } - - /** - * @param string $url - * - * @throws InvalidUrlException - */ - private function ensureUrlIsValid($url): void { - if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { - throw new InvalidUrlException; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElement.php b/vendor/phar-io/manifest/src/xml/AuthorElement.php deleted file mode 100644 index c454b27..0000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getEmail(): string { - return $this->getAttributeValue('email'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php deleted file mode 100644 index a54147e..0000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElementCollection extends ElementCollection { - public function current(): AuthorElement { - return new AuthorElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/BundlesElement.php b/vendor/phar-io/manifest/src/xml/BundlesElement.php deleted file mode 100644 index eb2105a..0000000 --- a/vendor/phar-io/manifest/src/xml/BundlesElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundlesElement extends ManifestElement { - public function getComponentElements(): ComponentElementCollection { - return new ComponentElementCollection( - $this->getChildrenByName('component') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElement.php b/vendor/phar-io/manifest/src/xml/ComponentElement.php deleted file mode 100644 index 7f6a5ec..0000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php deleted file mode 100644 index 23bcbd2..0000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElementCollection extends ElementCollection { - public function current(): ComponentElement { - return new ComponentElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ContainsElement.php b/vendor/phar-io/manifest/src/xml/ContainsElement.php deleted file mode 100644 index ebef49d..0000000 --- a/vendor/phar-io/manifest/src/xml/ContainsElement.php +++ /dev/null @@ -1,30 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ContainsElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getExtensionElement(): ExtensionElement { - return new ExtensionElement( - $this->getChildByName('extension') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/vendor/phar-io/manifest/src/xml/CopyrightElement.php deleted file mode 100644 index 3debe7d..0000000 --- a/vendor/phar-io/manifest/src/xml/CopyrightElement.php +++ /dev/null @@ -1,24 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightElement extends ManifestElement { - public function getAuthorElements(): AuthorElementCollection { - return new AuthorElementCollection( - $this->getChildrenByName('author') - ); - } - - public function getLicenseElement(): LicenseElement { - return new LicenseElement( - $this->getChildByName('license') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ElementCollection.php b/vendor/phar-io/manifest/src/xml/ElementCollection.php deleted file mode 100644 index 26d9250..0000000 --- a/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ /dev/null @@ -1,61 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -abstract class ElementCollection implements \Iterator { - /** @var DOMElement[] */ - private $nodes = []; - - /** @var int */ - private $position; - - public function __construct(DOMNodeList $nodeList) { - $this->position = 0; - $this->importNodes($nodeList); - } - - #[\ReturnTypeWillChange] - abstract public function current(); - - public function next(): void { - $this->position++; - } - - public function key(): int { - return $this->position; - } - - public function valid(): bool { - return $this->position < \count($this->nodes); - } - - public function rewind(): void { - $this->position = 0; - } - - protected function getCurrentElement(): DOMElement { - return $this->nodes[$this->position]; - } - - private function importNodes(DOMNodeList $nodeList): void { - foreach ($nodeList as $node) { - if (!$node instanceof DOMElement) { - throw new ElementCollectionException( - \sprintf('\DOMElement expected, got \%s', \get_class($node)) - ); - } - - $this->nodes[] = $node; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElement.php b/vendor/phar-io/manifest/src/xml/ExtElement.php deleted file mode 100644 index 257853c..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtElement.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php deleted file mode 100644 index 0597734..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElementCollection extends ElementCollection { - public function current(): ExtElement { - return new ExtElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/vendor/phar-io/manifest/src/xml/ExtensionElement.php deleted file mode 100644 index db067f9..0000000 --- a/vendor/phar-io/manifest/src/xml/ExtensionElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtensionElement extends ManifestElement { - public function getFor(): string { - return $this->getAttributeValue('for'); - } - - public function getCompatible(): string { - return $this->getAttributeValue('compatible'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/LicenseElement.php b/vendor/phar-io/manifest/src/xml/LicenseElement.php deleted file mode 100644 index 658c3d1..0000000 --- a/vendor/phar-io/manifest/src/xml/LicenseElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class LicenseElement extends ManifestElement { - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getUrl(): string { - return $this->getAttributeValue('url'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/vendor/phar-io/manifest/src/xml/ManifestDocument.php deleted file mode 100644 index f88b282..0000000 --- a/vendor/phar-io/manifest/src/xml/ManifestDocument.php +++ /dev/null @@ -1,103 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMDocument; -use DOMElement; - -class ManifestDocument { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMDocument */ - private $dom; - - public static function fromFile(string $filename): ManifestDocument { - if (!\file_exists($filename)) { - throw new ManifestDocumentException( - \sprintf('File "%s" not found', $filename) - ); - } - - return self::fromString( - \file_get_contents($filename) - ); - } - - public static function fromString(string $xmlString): ManifestDocument { - $prev = \libxml_use_internal_errors(true); - \libxml_clear_errors(); - - $dom = new DOMDocument(); - $dom->loadXML($xmlString); - - $errors = \libxml_get_errors(); - \libxml_use_internal_errors($prev); - - if (\count($errors) !== 0) { - throw new ManifestDocumentLoadingException($errors); - } - - return new self($dom); - } - - private function __construct(DOMDocument $dom) { - $this->ensureCorrectDocumentType($dom); - - $this->dom = $dom; - } - - public function getContainsElement(): ContainsElement { - return new ContainsElement( - $this->fetchElementByName('contains') - ); - } - - public function getCopyrightElement(): CopyrightElement { - return new CopyrightElement( - $this->fetchElementByName('copyright') - ); - } - - public function getRequiresElement(): RequiresElement { - return new RequiresElement( - $this->fetchElementByName('requires') - ); - } - - public function hasBundlesElement(): bool { - return $this->dom->getElementsByTagNameNS(self::XMLNS, 'bundles')->length === 1; - } - - public function getBundlesElement(): BundlesElement { - return new BundlesElement( - $this->fetchElementByName('bundles') - ); - } - - private function ensureCorrectDocumentType(DOMDocument $dom): void { - $root = $dom->documentElement; - - if ($root->localName !== 'phar' || $root->namespaceURI !== self::XMLNS) { - throw new ManifestDocumentException('Not a phar.io manifest document'); - } - } - - private function fetchElementByName(string $elementName): DOMElement { - $element = $this->dom->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestDocumentException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestElement.php b/vendor/phar-io/manifest/src/xml/ManifestElement.php deleted file mode 100644 index 1f57f54..0000000 --- a/vendor/phar-io/manifest/src/xml/ManifestElement.php +++ /dev/null @@ -1,66 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -class ManifestElement { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMElement */ - private $element; - - public function __construct(DOMElement $element) { - $this->element = $element; - } - - protected function getAttributeValue(string $name): string { - if (!$this->element->hasAttribute($name)) { - throw new ManifestElementException( - \sprintf( - 'Attribute %s not set on element %s', - $name, - $this->element->localName - ) - ); - } - - return $this->element->getAttribute($name); - } - - protected function getChildByName(string $elementName): DOMElement { - $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestElementException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } - - protected function getChildrenByName(string $elementName): DOMNodeList { - $elementList = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName); - - if ($elementList->length === 0) { - throw new ManifestElementException( - \sprintf('Element(s) %s missing', $elementName) - ); - } - - return $elementList; - } - - protected function hasChild(string $elementName): bool { - return $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->length !== 0; - } -} diff --git a/vendor/phar-io/manifest/src/xml/PhpElement.php b/vendor/phar-io/manifest/src/xml/PhpElement.php deleted file mode 100644 index c5c906c..0000000 --- a/vendor/phar-io/manifest/src/xml/PhpElement.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpElement extends ManifestElement { - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function hasExtElements(): bool { - return $this->hasChild('ext'); - } - - public function getExtElements(): ExtElementCollection { - return new ExtElementCollection( - $this->getChildrenByName('ext') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/RequiresElement.php b/vendor/phar-io/manifest/src/xml/RequiresElement.php deleted file mode 100644 index b7cd41e..0000000 --- a/vendor/phar-io/manifest/src/xml/RequiresElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequiresElement extends ManifestElement { - public function getPHPElement(): PhpElement { - return new PhpElement( - $this->getChildByName('php') - ); - } -} diff --git a/vendor/phar-io/version/src/BuildMetaData.php b/vendor/phar-io/version/src/BuildMetaData.php deleted file mode 100644 index d42f036..0000000 --- a/vendor/phar-io/version/src/BuildMetaData.php +++ /dev/null @@ -1,28 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class BuildMetaData { - - /** @var string */ - private $value; - - public function __construct(string $value) { - $this->value = $value; - } - - public function asString(): string { - return $this->value; - } - - public function equals(BuildMetaData $other): bool { - return $this->asString() === $other->asString(); - } -} diff --git a/vendor/phar-io/version/src/PreReleaseSuffix.php b/vendor/phar-io/version/src/PreReleaseSuffix.php deleted file mode 100644 index 0056300..0000000 --- a/vendor/phar-io/version/src/PreReleaseSuffix.php +++ /dev/null @@ -1,82 +0,0 @@ - 0, - 'a' => 1, - 'alpha' => 1, - 'b' => 2, - 'beta' => 2, - 'rc' => 3, - 'p' => 4, - 'pl' => 4, - 'patch' => 4, - ]; - - /** @var string */ - private $value; - - /** @var int */ - private $valueScore; - - /** @var int */ - private $number = 0; - - /** @var string */ - private $full; - - /** - * @throws InvalidPreReleaseSuffixException - */ - public function __construct(string $value) { - $this->parseValue($value); - } - - public function asString(): string { - return $this->full; - } - - public function getValue(): string { - return $this->value; - } - - public function getNumber(): ?int { - return $this->number; - } - - public function isGreaterThan(PreReleaseSuffix $suffix): bool { - if ($this->valueScore > $suffix->valueScore) { - return true; - } - - if ($this->valueScore < $suffix->valueScore) { - return false; - } - - return $this->getNumber() > $suffix->getNumber(); - } - - private function mapValueToScore(string $value): int { - $value = \strtolower($value); - - return self::valueScoreMap[$value]; - } - - private function parseValue(string $value): void { - $regex = '/-?((dev|beta|b|rc|alpha|a|patch|p|pl)\.?(\d*)).*$/i'; - - if (\preg_match($regex, $value, $matches) !== 1) { - throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value)); - } - - $this->full = $matches[1]; - $this->value = $matches[2]; - - if ($matches[3] !== '') { - $this->number = (int)$matches[3]; - } - - $this->valueScore = $this->mapValueToScore($matches[2]); - } -} diff --git a/vendor/phar-io/version/src/Version.php b/vendor/phar-io/version/src/Version.php deleted file mode 100644 index 644af5c..0000000 --- a/vendor/phar-io/version/src/Version.php +++ /dev/null @@ -1,208 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class Version { - /** @var string */ - private $originalVersionString; - - /** @var VersionNumber */ - private $major; - - /** @var VersionNumber */ - private $minor; - - /** @var VersionNumber */ - private $patch; - - /** @var null|PreReleaseSuffix */ - private $preReleaseSuffix; - - /** @var null|BuildMetaData */ - private $buildMetadata; - - public function __construct(string $versionString) { - $this->ensureVersionStringIsValid($versionString); - $this->originalVersionString = $versionString; - } - - /** - * @throws NoPreReleaseSuffixException - */ - public function getPreReleaseSuffix(): PreReleaseSuffix { - if ($this->preReleaseSuffix === null) { - throw new NoPreReleaseSuffixException('No pre-release suffix set'); - } - - return $this->preReleaseSuffix; - } - - public function getOriginalString(): string { - return $this->originalVersionString; - } - - public function getVersionString(): string { - $str = \sprintf( - '%d.%d.%d', - $this->getMajor()->getValue() ?? 0, - $this->getMinor()->getValue() ?? 0, - $this->getPatch()->getValue() ?? 0 - ); - - if (!$this->hasPreReleaseSuffix()) { - return $str; - } - - return $str . '-' . $this->getPreReleaseSuffix()->asString(); - } - - public function hasPreReleaseSuffix(): bool { - return $this->preReleaseSuffix !== null; - } - - public function equals(Version $other): bool { - if ($this->getVersionString() !== $other->getVersionString()) { - return false; - } - - if ($this->hasBuildMetaData() !== $other->hasBuildMetaData()) { - return false; - } - - if ($this->hasBuildMetaData() && $other->hasBuildMetaData() && - !$this->getBuildMetaData()->equals($other->getBuildMetaData())) { - return false; - } - - return true; - } - - public function isGreaterThan(Version $version): bool { - if ($version->getMajor()->getValue() > $this->getMajor()->getValue()) { - return false; - } - - if ($version->getMajor()->getValue() < $this->getMajor()->getValue()) { - return true; - } - - if ($version->getMinor()->getValue() > $this->getMinor()->getValue()) { - return false; - } - - if ($version->getMinor()->getValue() < $this->getMinor()->getValue()) { - return true; - } - - if ($version->getPatch()->getValue() > $this->getPatch()->getValue()) { - return false; - } - - if ($version->getPatch()->getValue() < $this->getPatch()->getValue()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return false; - } - - if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) { - return false; - } - - return $this->getPreReleaseSuffix()->isGreaterThan($version->getPreReleaseSuffix()); - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - /** - * @psalm-assert-if-true BuildMetaData $this->buildMetadata - * @psalm-assert-if-true BuildMetaData $this->getBuildMetaData() - */ - public function hasBuildMetaData(): bool { - return $this->buildMetadata !== null; - } - - /** - * @throws NoBuildMetaDataException - */ - public function getBuildMetaData(): BuildMetaData { - if (!$this->hasBuildMetaData()) { - throw new NoBuildMetaDataException('No build metadata set'); - } - - return $this->buildMetadata; - } - - /** - * @param string[] $matches - * - * @throws InvalidPreReleaseSuffixException - */ - private function parseVersion(array $matches): void { - $this->major = new VersionNumber((int)$matches['Major']); - $this->minor = new VersionNumber((int)$matches['Minor']); - $this->patch = isset($matches['Patch']) ? new VersionNumber((int)$matches['Patch']) : new VersionNumber(0); - - if (isset($matches['PreReleaseSuffix']) && $matches['PreReleaseSuffix'] !== '') { - $this->preReleaseSuffix = new PreReleaseSuffix($matches['PreReleaseSuffix']); - } - - if (isset($matches['BuildMetadata'])) { - $this->buildMetadata = new BuildMetaData($matches['BuildMetadata']); - } - } - - /** - * @param string $version - * - * @throws InvalidVersionException - */ - private function ensureVersionStringIsValid($version): void { - $regex = '/^v? - (?P0|[1-9]\d*) - \\. - (?P0|[1-9]\d*) - (\\. - (?P0|[1-9]\d*) - )? - (?: - - - (?(?:(dev|beta|b|rc|alpha|a|patch|p|pl)\.?\d*)) - )? - (?: - \\+ - (?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-@]+)*) - )? - $/xi'; - - if (\preg_match($regex, $version, $matches) !== 1) { - throw new InvalidVersionException( - \sprintf("Version string '%s' does not follow SemVer semantics", $version) - ); - } - - $this->parseVersion($matches); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintParser.php b/vendor/phar-io/version/src/VersionConstraintParser.php deleted file mode 100644 index 03d6a09..0000000 --- a/vendor/phar-io/version/src/VersionConstraintParser.php +++ /dev/null @@ -1,115 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionConstraintParser { - /** - * @throws UnsupportedVersionConstraintException - */ - public function parse(string $value): VersionConstraint { - if (\strpos($value, '|') !== false) { - return $this->handleOrGroup($value); - } - - if (!\preg_match('/^[\^~*]?v?[\d.*]+(?:-.*)?$/i', $value)) { - throw new UnsupportedVersionConstraintException( - \sprintf('Version constraint %s is not supported.', $value) - ); - } - - switch ($value[0]) { - case '~': - return $this->handleTildeOperator($value); - case '^': - return $this->handleCaretOperator($value); - } - - $constraint = new VersionConstraintValue($value); - - if ($constraint->getMajor()->isAny()) { - return new AnyVersionConstraint(); - } - - if ($constraint->getMinor()->isAny()) { - return new SpecificMajorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0 - ); - } - - if ($constraint->getPatch()->isAny()) { - return new SpecificMajorAndMinorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0, - $constraint->getMinor()->getValue() ?? 0 - ); - } - - return new ExactVersionConstraint($constraint->getVersionString()); - } - - private function handleOrGroup(string $value): OrVersionConstraintGroup { - $constraints = []; - - foreach (\preg_split('{\s*\|\|?\s*}', \trim($value)) as $groupSegment) { - $constraints[] = $this->parse(\trim($groupSegment)); - } - - return new OrVersionConstraintGroup($value, $constraints); - } - - private function handleTildeOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - if ($constraintValue->getPatch()->isAny()) { - return $this->handleCaretOperator($value); - } - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint( - $value, - new Version(\substr($value, 1)) - ), - new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ) - ]; - - return new AndVersionConstraintGroup($value, $constraints); - } - - private function handleCaretOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))) - ]; - - if ($constraintValue->getMajor()->getValue() === 0) { - $constraints[] = new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ); - } else { - $constraints[] = new SpecificMajorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0 - ); - } - - return new AndVersionConstraintGroup( - $value, - $constraints - ); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintValue.php b/vendor/phar-io/version/src/VersionConstraintValue.php deleted file mode 100644 index 0762e7c..0000000 --- a/vendor/phar-io/version/src/VersionConstraintValue.php +++ /dev/null @@ -1,88 +0,0 @@ -versionString = $versionString; - - $this->parseVersion($versionString); - } - - public function getLabel(): string { - return $this->label; - } - - public function getBuildMetaData(): string { - return $this->buildMetaData; - } - - public function getVersionString(): string { - return $this->versionString; - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - private function parseVersion(string $versionString): void { - $this->extractBuildMetaData($versionString); - $this->extractLabel($versionString); - $this->stripPotentialVPrefix($versionString); - - $versionSegments = \explode('.', $versionString); - $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int)$versionSegments[0] : null); - - $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int)$versionSegments[1] : null; - $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int)$versionSegments[2] : null; - - $this->minor = new VersionNumber($minorValue); - $this->patch = new VersionNumber($patchValue); - } - - private function extractBuildMetaData(string &$versionString): void { - if (\preg_match('/\+(.*)/', $versionString, $matches) === 1) { - $this->buildMetaData = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function extractLabel(string &$versionString): void { - if (\preg_match('/-(.*)/', $versionString, $matches) === 1) { - $this->label = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function stripPotentialVPrefix(string &$versionString): void { - if ($versionString[0] !== 'v') { - return; - } - $versionString = \substr($versionString, 1); - } -} diff --git a/vendor/phar-io/version/src/VersionNumber.php b/vendor/phar-io/version/src/VersionNumber.php deleted file mode 100644 index 4833a9b..0000000 --- a/vendor/phar-io/version/src/VersionNumber.php +++ /dev/null @@ -1,28 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionNumber { - - /** @var ?int */ - private $value; - - public function __construct(?int $value) { - $this->value = $value; - } - - public function isAny(): bool { - return $this->value === null; - } - - public function getValue(): ?int { - return $this->value; - } -} diff --git a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php b/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php deleted file mode 100644 index 66201a1..0000000 --- a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -abstract class AbstractVersionConstraint implements VersionConstraint { - /** @var string */ - private $originalValue; - - public function __construct(string $originalValue) { - $this->originalValue = $originalValue; - } - - public function asString(): string { - return $this->originalValue; - } -} diff --git a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php deleted file mode 100644 index 5096f2f..0000000 --- a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AndVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param VersionConstraint[] $constraints - */ - public function __construct(string $originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if (!$constraint->complies($version)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php b/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php deleted file mode 100644 index 1499f07..0000000 --- a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AnyVersionConstraint implements VersionConstraint { - public function complies(Version $version): bool { - return true; - } - - public function asString(): string { - return '*'; - } -} diff --git a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php b/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php deleted file mode 100644 index 1d675c9..0000000 --- a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php +++ /dev/null @@ -1,22 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class ExactVersionConstraint extends AbstractVersionConstraint { - public function complies(Version $version): bool { - $other = $version->getVersionString(); - - if ($version->hasBuildMetaData()) { - $other .= '+' . $version->getBuildMetaData()->asString(); - } - - return $this->asString() === $other; - } -} diff --git a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php b/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php deleted file mode 100644 index ec37172..0000000 --- a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class GreaterThanOrEqualToVersionConstraint extends AbstractVersionConstraint { - /** @var Version */ - private $minimalVersion; - - public function __construct(string $originalValue, Version $minimalVersion) { - parent::__construct($originalValue); - - $this->minimalVersion = $minimalVersion; - } - - public function complies(Version $version): bool { - return $version->getVersionString() === $this->minimalVersion->getVersionString() - || $version->isGreaterThan($this->minimalVersion); - } -} diff --git a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php deleted file mode 100644 index 59fd382..0000000 --- a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php +++ /dev/null @@ -1,35 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class OrVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param string $originalValue - * @param VersionConstraint[] $constraints - */ - public function __construct($originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if ($constraint->complies($version)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php deleted file mode 100644 index 302aa31..0000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorAndMinorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - /** @var int */ - private $minor; - - public function __construct(string $originalValue, int $major, int $minor) { - parent::__construct($originalValue); - - $this->major = $major; - $this->minor = $minor; - } - - public function complies(Version $version): bool { - if ($version->getMajor()->getValue() !== $this->major) { - return false; - } - - return $version->getMinor()->getValue() === $this->minor; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php deleted file mode 100644 index 968b809..0000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - public function __construct(string $originalValue, int $major) { - parent::__construct($originalValue); - - $this->major = $major; - } - - public function complies(Version $version): bool { - return $version->getMajor()->getValue() === $this->major; - } -} diff --git a/vendor/phar-io/version/src/constraints/VersionConstraint.php b/vendor/phar-io/version/src/constraints/VersionConstraint.php deleted file mode 100644 index e94f9e0..0000000 --- a/vendor/phar-io/version/src/constraints/VersionConstraint.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -interface VersionConstraint { - public function complies(Version $version): bool; - - public function asString(): string; -} diff --git a/vendor/phar-io/version/src/exceptions/Exception.php b/vendor/phar-io/version/src/exceptions/Exception.php deleted file mode 100644 index 3ea458f..0000000 --- a/vendor/phar-io/version/src/exceptions/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -use Throwable; - -interface Exception extends Throwable { -} diff --git a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php b/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php deleted file mode 100644 index bc0b0c3..0000000 --- a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -final class UnsupportedVersionConstraintException extends \RuntimeException implements Exception { -} diff --git a/vendor/phpmailer/phpmailer/COMMITMENT b/vendor/phpmailer/phpmailer/COMMITMENT deleted file mode 100644 index a687e0d..0000000 --- a/vendor/phpmailer/phpmailer/COMMITMENT +++ /dev/null @@ -1,46 +0,0 @@ -GPL Cooperation Commitment -Version 1.0 - -Before filing or continuing to prosecute any legal proceeding or claim -(other than a Defensive Action) arising from termination of a Covered -License, we commit to extend to the person or entity ('you') accused -of violating the Covered License the following provisions regarding -cure and reinstatement, taken from GPL version 3. As used here, the -term 'this License' refers to the specific Covered License being -enforced. - - However, if you cease all violation of this License, then your - license from a particular copyright holder is reinstated (a) - provisionally, unless and until the copyright holder explicitly - and finally terminates your license, and (b) permanently, if the - copyright holder fails to notify you of the violation by some - reasonable means prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is - reinstated permanently if the copyright holder notifies you of the - violation by some reasonable means, this is the first time you - have received notice of violation of this License (for any work) - from that copyright holder, and you cure the violation prior to 30 - days after your receipt of the notice. - -We intend this Commitment to be irrevocable, and binding and -enforceable against us and assignees of or successors to our -copyrights. - -Definitions - -'Covered License' means the GNU General Public License, version 2 -(GPLv2), the GNU Lesser General Public License, version 2.1 -(LGPLv2.1), or the GNU Library General Public License, version 2 -(LGPLv2), all as published by the Free Software Foundation. - -'Defensive Action' means a legal proceeding or claim that We bring -against you in response to a prior proceeding or claim initiated by -you or your affiliate. - -'We' means each contributor to this repository as of the date of -inclusion of this file, including subsidiaries of a corporate -contributor. - -This work is available under a Creative Commons Attribution-ShareAlike -4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php deleted file mode 100644 index cda0445..0000000 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * Get an OAuth2 token from an OAuth2 provider. - * * Install this script on your server so that it's accessible - * as [https/http]:////get_oauth_token.php - * e.g.: http://localhost/phpmailer/get_oauth_token.php - * * Ensure dependencies are installed with 'composer install' - * * Set up an app in your Google/Yahoo/Microsoft account - * * Set the script address as the app's redirect URL - * If no refresh token is obtained when running this file, - * revoke access to your app and run the script again. - */ - -namespace PHPMailer\PHPMailer; - -/** - * Aliases for League Provider Classes - * Make sure you have added these to your composer.json and run `composer install` - * Plenty to choose from here: - * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ - */ -//@see https://github.com/thephpleague/oauth2-google -use League\OAuth2\Client\Provider\Google; -//@see https://packagist.org/packages/hayageek/oauth2-yahoo -use Hayageek\OAuth2\Client\Provider\Yahoo; -//@see https://github.com/stevenmaguire/oauth2-microsoft -use Stevenmaguire\OAuth2\Client\Provider\Microsoft; -//@see https://github.com/greew/oauth2-azure-provider -use Greew\OAuth2\Client\Provider\Azure; - -if (!isset($_GET['code']) && !isset($_POST['provider'])) { - ?> - - -
-

Select Provider

- -
- -
- -
- -
-

Enter id and secret

-

These details are obtained by setting up an app in your provider's developer console. -

-

ClientId:

-

ClientSecret:

-

TenantID (only relevant for Azure):

- -
- - - $clientId, - 'clientSecret' => $clientSecret, - 'redirectUri' => $redirectUri, - 'accessType' => 'offline' -]; - -$options = []; -$provider = null; - -switch ($providerName) { - case 'Google': - $provider = new Google($params); - $options = [ - 'scope' => [ - 'https://mail.google.com/' - ] - ]; - break; - case 'Yahoo': - $provider = new Yahoo($params); - break; - case 'Microsoft': - $provider = new Microsoft($params); - $options = [ - 'scope' => [ - 'wl.imap', - 'wl.offline_access' - ] - ]; - break; - case 'Azure': - $params['tenantId'] = $tenantId; - - $provider = new Azure($params); - $options = [ - 'scope' => [ - 'https://outlook.office.com/SMTP.Send', - 'offline_access' - ] - ]; - break; -} - -if (null === $provider) { - exit('Provider missing'); -} - -if (!isset($_GET['code'])) { - //If we don't have an authorization code then get one - $authUrl = $provider->getAuthorizationUrl($options); - $_SESSION['oauth2state'] = $provider->getState(); - header('Location: ' . $authUrl); - exit; - //Check given state against previously stored one to mitigate CSRF attack -} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - unset($_SESSION['oauth2state']); - unset($_SESSION['provider']); - exit('Invalid state'); -} else { - unset($_SESSION['provider']); - //Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken( - 'authorization_code', - [ - 'code' => $_GET['code'] - ] - ); - //Use this to interact with an API on the users behalf - //Use this to get a new access token if the old one expires - echo 'Refresh Token: ', $token->getRefreshToken(); -} diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php deleted file mode 100644 index 0b2a72d..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; -$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; -$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; -$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; -$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; -$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; -$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; -$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; -$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; -$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; -$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; -$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; -$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; -$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php deleted file mode 100644 index 552167e..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; -$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php deleted file mode 100644 index 9e92dda..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; -$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; -$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; -$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; -$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; -$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; -$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; -$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; -$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; -$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; -$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; -$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; -$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; -$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php deleted file mode 100644 index c41f675..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; -$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; -$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; -$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; -$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; -$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; -$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; -$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; -$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; -$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; -$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; -$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php deleted file mode 100644 index 3468485..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; -$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; -$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; -$PHPMAILER_LANG['execute'] = 'No es pot executar: '; -$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; -$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; -$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; -$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; -$PHPMAILER_LANG['signing'] = 'Error al signar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; -$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php deleted file mode 100644 index e770a1a..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +++ /dev/null @@ -1,28 +0,0 @@ - - * Rewrite and extension of the work by Mikael Stokkebro - * - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; -$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; -$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; -$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; -$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; -$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; -$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; -$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; -$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; -$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; -$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; -$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php deleted file mode 100644 index e7e59d2..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Crystopher Glodzienski Cardoso - */ - -$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; -$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; -$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; -$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; -$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; -$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Error al firmar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; -$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; -$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; -$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php deleted file mode 100644 index 93addc9..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; -$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; -$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; -$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; -$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; -$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; -$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; -$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; -$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; -$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; -$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; -$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; -$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php deleted file mode 100644 index 295a47f..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Mohammad Hossein Mojtahedi - */ - -$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; -$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; -$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; -$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; -$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; -$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; -$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; -$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; -$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; -$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; -$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; -$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; -$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; -$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php deleted file mode 100644 index 6d1e637..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; -$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; -$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; -$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; -$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; -$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; -$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php deleted file mode 100644 index 0d367fc..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; -$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; -$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; -$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; -$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; -$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; -$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php deleted file mode 100644 index b123aa5..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; -$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; -$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; -$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; -$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; -$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; -$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; -$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; -$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; -$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; -$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php deleted file mode 100644 index d2856e0..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Rewrite and extension of the work by Jayanti Suthar - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; -$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; -$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; -$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; -$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; -$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; -$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; -$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; -$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; -$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; -$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; -$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; -$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; -$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; -$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; -$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php deleted file mode 100644 index cacb6c3..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; -$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php deleted file mode 100644 index e6b58b0..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; -$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; -$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; -$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; -$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; -$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; -$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; -$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; -$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; -$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; -$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; -$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; -$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php deleted file mode 100644 index 212a11f..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @author @januridp - * @author Ian Mustafa - */ - -$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; -$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; -$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; -$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; -$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; -$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; -$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; -$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; -$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; -$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; -$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php deleted file mode 100644 index 08a6b73..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Stefano Sabatini - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; -$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; -$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; -$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; -$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; -$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; -$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; -$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; -$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; -$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; -$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; -$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php deleted file mode 100644 index c76f526..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @author Yoshi Sakai - * @author Arisophy - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; -$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; -$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; -$PHPMAILER_LANG['execute'] = '実行できませんでした: '; -$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; -$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; -$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; -$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; -$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; -$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -$PHPMAILER_LANG['signing'] = '署名エラー: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; -$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; -$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; -$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php deleted file mode 100644 index 51fe403..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; -$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; -$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; -$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; -$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; -$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; -$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; -$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; -$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; -$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; -$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; -$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; -$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php deleted file mode 100644 index 8c97dd9..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; -$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다'; -$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: '; -$PHPMAILER_LANG['execute'] = '실행 불가: '; -$PHPMAILER_LANG['file_access'] = '파일 접근 불가: '; -$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: '; -$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: '; -$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다'; -$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; -$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; -$PHPMAILER_LANG['signing'] = '서명 오류: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; -$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: '; -$PHPMAILER_LANG['extension_missing'] = '확장자 없음: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php deleted file mode 100644 index 4f115b1..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; -$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; -$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; -$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; -$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; -$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; -$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; -$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; -$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; -$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; -$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; -$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php deleted file mode 100644 index 679b18c..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; -$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; -$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; -$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; -$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; -$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; -$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; -$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; -$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; -$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; -$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; -$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php deleted file mode 100644 index 8a94f6a..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; -$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; -$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; -$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; -$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; -$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; -$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; -$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; -$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; -$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; -$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php deleted file mode 100644 index 04d262c..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; -$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; -$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; -$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; -$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; -$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; -$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; -$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; -$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; -$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php deleted file mode 100644 index c9621a1..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; -$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; -$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; -$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; -$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; -$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; -$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; -$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; -$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; -$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; -$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; -$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; -$PHPMAILER_LANG['signing'] = 'Signeerfout: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; -$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php deleted file mode 100644 index b0469fd..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; -$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; -$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; -$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; -$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; -$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; -$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php deleted file mode 100644 index 5239865..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @author Lucas Guimarães - * @author Phelipe Alves - * @author Fabio Beneditto - * @author Geidson Benício Coelho - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; -$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; -$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; -$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; -$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; -$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; -$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; -$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; -$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; -$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; -$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php deleted file mode 100644 index 45bef91..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @author Foster Snowhill - */ - -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; -$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; -$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; -$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; -$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; -$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; -$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; -$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; -$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; -$PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; -$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; -$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php deleted file mode 100644 index dce502a..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP දෝෂය: සත්‍යාපනය අසාර්ථක විය.'; -$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දෝෂයක් නිසා email පණිවිඩ දෝෂ සහගත වීමේ හැකියාවක් ඇත. මෙය විසදීම සදහා SMTP භාවිතා කිරීම, mail.add_x_header INI setting එක අක්‍රීය කිරීම, MacOS හෝ Linux වලට මාරු වීම, හෝ ඔබගේ PHP version එක 7.0.17+ හෝ 7.1.3+ වලට අලුත් කිරීම කරගන්න.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP දෝෂය: සම්බන්ධ වීමට නොහැකි විය.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දෝෂය: දත්ත පිළිගනු නොලැබේ.'; -$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්'; -$PHPMAILER_LANG['encoding'] = 'නොදන්නා කේතනය: '; -$PHPMAILER_LANG['execute'] = 'ක්‍රියාත්මක කළ නොහැකි විය: '; -$PHPMAILER_LANG['extension_missing'] = 'Extension එක නොමැත: '; -$PHPMAILER_LANG['file_access'] = 'File එකට ප්‍රවේශ විය නොහැකි විය: '; -$PHPMAILER_LANG['file_open'] = 'File දෝෂය: File එක විවෘත කළ නොහැක: '; -$PHPMAILER_LANG['from_failed'] = 'පහත From ලිපිනයන් අසාර්ථක විය: '; -$PHPMAILER_LANG['instantiate'] = 'mail function එක ක්‍රියාත්මක කළ නොහැක.'; -$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: '; -$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header නාමයක් හෝ අගයක්'; -$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry එකක්: '; -$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host එකක්: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහාය නොදක්වයි.'; -$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම වශයෙන් එක් ලබන්නෙකුගේ ඊමේල් ලිපිනයක් සැපයිය යුතුය.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP දෝෂය: පහත ලබන්නන් අසමත් විය: '; -$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දෝෂය: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය අසාර්ථක විය.'; -$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP දෝෂය: '; -$PHPMAILER_LANG['variable_set'] = 'Variable එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php deleted file mode 100644 index 028f5bc..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @author Peter Orlický - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; -$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; -$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; -$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; -$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; -$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; -$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; -$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; -$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; -$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; -$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; -$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; -$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php deleted file mode 100644 index 3e00c25..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @author Filip Š - * @author Blaž Oražem - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; -$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; -$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; -$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; -$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; -$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; -$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; -$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; -$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; -$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; -$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; -$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; -$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; -$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; -$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; -$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; -$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php deleted file mode 100644 index 0b5280f..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Miloš Milanović - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; -$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; -$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; -$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; -$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; -$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; -$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; -$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; -$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; -$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; -$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; -$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php deleted file mode 100644 index 6213832..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Miloš Milanović - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; -$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; -$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; -$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; -$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php deleted file mode 100644 index 9872c19..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; -$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; -$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; -$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; -$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; -$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; -$PHPMAILER_LANG['signing'] = 'Signeringsfel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; -$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php deleted file mode 100644 index d15bed1..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; -$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; -$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; -$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; -$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; -$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; -$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; -$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; -$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; -$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; -$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; -$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; -$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php deleted file mode 100644 index f938f80..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @fixed by Boris Yurchenko - */ - -$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; -$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; -$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; -$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; -$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; -$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; -$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; -$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; -$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; -$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; -$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; -$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; -$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; -$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: '; -$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php deleted file mode 100644 index d65576e..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; -$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; -$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; -$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; -$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; -$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; -$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; -$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; -$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; -$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; -$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; -$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; -$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; -$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; -$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php deleted file mode 100644 index 35e4e70..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @author Peter Dave Hello <@PeterDaveHello/> - * @author Jason Chiang - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; -$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; -$PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; -$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; -$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; -$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; -$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; -$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; -$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; -$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; -$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; -$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php deleted file mode 100644 index 03d4911..0000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @author young - * @author Teddysun - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG['buggy_php'] = '您的 PHP 版本存在漏洞,可能会导致消息损坏。为修复此问题,请切换到使用 SMTP 发送,在您的 php.ini 中禁用 mail.add_x_header 选项。切换到 MacOS 或 Linux,或将您的 PHP 升级到 7.0.17+ 或 7.1.3+ 版本。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; -$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; -$PHPMAILER_LANG['encoding'] = '未知编码:'; -$PHPMAILER_LANG['execute'] = '无法执行:'; -$PHPMAILER_LANG['extension_missing'] = '缺少扩展名:'; -$PHPMAILER_LANG['file_access'] = '无法访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; -$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; -$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; -$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; -$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; -$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值'; -$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: '; -$PHPMAILER_LANG['invalid_host'] = '无效的主机:'; -$PHPMAILER_LANG['signing'] = '签名错误:'; -$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: '; -$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: '; -$PHPMAILER_LANG['smtp_detail'] = '详情:'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php deleted file mode 100644 index 566c961..0000000 --- a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +++ /dev/null @@ -1,245 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2023 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * Configure PHPMailer with DSN string. - * - * @see https://en.wikipedia.org/wiki/Data_source_name - * - * @author Oleg Voronkovich - */ -class DSNConfigurator -{ - /** - * Create new PHPMailer instance configured by DSN. - * - * @param string $dsn DSN - * @param bool $exceptions Should we throw external exceptions? - * - * @return PHPMailer - */ - public static function mailer($dsn, $exceptions = null) - { - static $configurator = null; - - if (null === $configurator) { - $configurator = new DSNConfigurator(); - } - - return $configurator->configure(new PHPMailer($exceptions), $dsn); - } - - /** - * Configure PHPMailer instance with DSN string. - * - * @param PHPMailer $mailer PHPMailer instance - * @param string $dsn DSN - * - * @return PHPMailer - */ - public function configure(PHPMailer $mailer, $dsn) - { - $config = $this->parseDSN($dsn); - - $this->applyConfig($mailer, $config); - - return $mailer; - } - - /** - * Parse DSN string. - * - * @param string $dsn DSN - * - * @throws Exception If DSN is malformed - * - * @return array Configuration - */ - private function parseDSN($dsn) - { - $config = $this->parseUrl($dsn); - - if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { - throw new Exception('Malformed DSN'); - } - - if (isset($config['query'])) { - parse_str($config['query'], $config['query']); - } - - return $config; - } - - /** - * Apply configuration to mailer. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $config Configuration - * - * @throws Exception If scheme is invalid - */ - private function applyConfig(PHPMailer $mailer, $config) - { - switch ($config['scheme']) { - case 'mail': - $mailer->isMail(); - break; - case 'sendmail': - $mailer->isSendmail(); - break; - case 'qmail': - $mailer->isQmail(); - break; - case 'smtp': - case 'smtps': - $mailer->isSMTP(); - $this->configureSMTP($mailer, $config); - break; - default: - throw new Exception( - sprintf( - 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', - $config['scheme'] - ) - ); - } - - if (isset($config['query'])) { - $this->configureOptions($mailer, $config['query']); - } - } - - /** - * Configure SMTP. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $config Configuration - */ - private function configureSMTP($mailer, $config) - { - $isSMTPS = 'smtps' === $config['scheme']; - - if ($isSMTPS) { - $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; - } - - $mailer->Host = $config['host']; - - if (isset($config['port'])) { - $mailer->Port = $config['port']; - } elseif ($isSMTPS) { - $mailer->Port = SMTP::DEFAULT_SECURE_PORT; - } - - $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); - - if (isset($config['user'])) { - $mailer->Username = $config['user']; - } - - if (isset($config['pass'])) { - $mailer->Password = $config['pass']; - } - } - - /** - * Configure options. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $options Options - * - * @throws Exception If option is unknown - */ - private function configureOptions(PHPMailer $mailer, $options) - { - $allowedOptions = get_object_vars($mailer); - - unset($allowedOptions['Mailer']); - unset($allowedOptions['SMTPAuth']); - unset($allowedOptions['Username']); - unset($allowedOptions['Password']); - unset($allowedOptions['Hostname']); - unset($allowedOptions['Port']); - unset($allowedOptions['ErrorInfo']); - - $allowedOptions = \array_keys($allowedOptions); - - foreach ($options as $key => $value) { - if (!in_array($key, $allowedOptions)) { - throw new Exception( - sprintf( - 'Unknown option: "%s". Allowed values: "%s"', - $key, - implode('", "', $allowedOptions) - ) - ); - } - - switch ($key) { - case 'AllowEmpty': - case 'SMTPAutoTLS': - case 'SMTPKeepAlive': - case 'SingleTo': - case 'UseSendmailOptions': - case 'do_verp': - case 'DKIM_copyHeaderFields': - $mailer->$key = (bool) $value; - break; - case 'Priority': - case 'SMTPDebug': - case 'WordWrap': - $mailer->$key = (int) $value; - break; - default: - $mailer->$key = $value; - break; - } - } - } - - /** - * Parse a URL. - * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. - * - * @param string $url URL - * - * @return array|false - */ - protected function parseUrl($url) - { - if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { - return parse_url($url); - } - - $chunks = explode('?', $url); - if (is_array($chunks)) { - $result = parse_url($chunks[0]); - if (is_array($result)) { - $result['query'] = $chunks[1]; - } - return $result; - } - - return false; - } -} diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php deleted file mode 100644 index 52eaf95..0000000 --- a/vendor/phpmailer/phpmailer/src/Exception.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * PHPMailer exception handler. - * - * @author Marcus Bointon - */ -class Exception extends \Exception -{ - /** - * Prettify error message output. - * - * @return string - */ - public function errorMessage() - { - return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n"; - } -} diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php deleted file mode 100644 index c1d5b77..0000000 --- a/vendor/phpmailer/phpmailer/src/OAuth.php +++ /dev/null @@ -1,139 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -use League\OAuth2\Client\Grant\RefreshToken; -use League\OAuth2\Client\Provider\AbstractProvider; -use League\OAuth2\Client\Token\AccessToken; - -/** - * OAuth - OAuth2 authentication wrapper class. - * Uses the oauth2-client package from the League of Extraordinary Packages. - * - * @see http://oauth2-client.thephpleague.com - * - * @author Marcus Bointon (Synchro/coolbru) - */ -class OAuth implements OAuthTokenProvider -{ - /** - * An instance of the League OAuth Client Provider. - * - * @var AbstractProvider - */ - protected $provider; - - /** - * The current OAuth access token. - * - * @var AccessToken - */ - protected $oauthToken; - - /** - * The user's email address, usually used as the login ID - * and also the from address when sending email. - * - * @var string - */ - protected $oauthUserEmail = ''; - - /** - * The client secret, generated in the app definition of the service you're connecting to. - * - * @var string - */ - protected $oauthClientSecret = ''; - - /** - * The client ID, generated in the app definition of the service you're connecting to. - * - * @var string - */ - protected $oauthClientId = ''; - - /** - * The refresh token, used to obtain new AccessTokens. - * - * @var string - */ - protected $oauthRefreshToken = ''; - - /** - * OAuth constructor. - * - * @param array $options Associative array containing - * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements - */ - public function __construct($options) - { - $this->provider = $options['provider']; - $this->oauthUserEmail = $options['userName']; - $this->oauthClientSecret = $options['clientSecret']; - $this->oauthClientId = $options['clientId']; - $this->oauthRefreshToken = $options['refreshToken']; - } - - /** - * Get a new RefreshToken. - * - * @return RefreshToken - */ - protected function getGrant() - { - return new RefreshToken(); - } - - /** - * Get a new AccessToken. - * - * @return AccessToken - */ - protected function getToken() - { - return $this->provider->getAccessToken( - $this->getGrant(), - ['refresh_token' => $this->oauthRefreshToken] - ); - } - - /** - * Generate a base64-encoded OAuth token. - * - * @return string - */ - public function getOauth64() - { - //Get a new token if it's not available or has expired - if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { - $this->oauthToken = $this->getToken(); - } - - return base64_encode( - 'user=' . - $this->oauthUserEmail . - "\001auth=Bearer " . - $this->oauthToken . - "\001\001" - ); - } -} diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php deleted file mode 100644 index 1155507..0000000 --- a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * OAuthTokenProvider - OAuth2 token provider interface. - * Provides base64 encoded OAuth2 auth strings for SMTP authentication. - * - * @see OAuth - * @see SMTP::authenticate() - * - * @author Peter Scopes (pdscopes) - * @author Marcus Bointon (Synchro/coolbru) - */ -interface OAuthTokenProvider -{ - /** - * Generate a base64-encoded OAuth token ensuring that the access token has not expired. - * The string to be base 64 encoded should be in the form: - * "user=\001auth=Bearer \001\001" - * - * @return string - */ - public function getOauth64(); -} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php deleted file mode 100644 index 7f56ea2..0000000 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ /dev/null @@ -1,5126 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * PHPMailer - PHP email creation and transport class. - * - * @author Marcus Bointon (Synchro/coolbru) - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - */ -class PHPMailer -{ - const CHARSET_ASCII = 'us-ascii'; - const CHARSET_ISO88591 = 'iso-8859-1'; - const CHARSET_UTF8 = 'utf-8'; - - const CONTENT_TYPE_PLAINTEXT = 'text/plain'; - const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; - const CONTENT_TYPE_TEXT_HTML = 'text/html'; - const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; - const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; - const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; - - const ENCODING_7BIT = '7bit'; - const ENCODING_8BIT = '8bit'; - const ENCODING_BASE64 = 'base64'; - const ENCODING_BINARY = 'binary'; - const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; - - const ENCRYPTION_STARTTLS = 'tls'; - const ENCRYPTION_SMTPS = 'ssl'; - - const ICAL_METHOD_REQUEST = 'REQUEST'; - const ICAL_METHOD_PUBLISH = 'PUBLISH'; - const ICAL_METHOD_REPLY = 'REPLY'; - const ICAL_METHOD_ADD = 'ADD'; - const ICAL_METHOD_CANCEL = 'CANCEL'; - const ICAL_METHOD_REFRESH = 'REFRESH'; - const ICAL_METHOD_COUNTER = 'COUNTER'; - const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; - - /** - * Email priority. - * Options: null (default), 1 = High, 3 = Normal, 5 = low. - * When null, the header is not set at all. - * - * @var int|null - */ - public $Priority; - - /** - * The character set of the message. - * - * @var string - */ - public $CharSet = self::CHARSET_ISO88591; - - /** - * The MIME Content-type of the message. - * - * @var string - */ - public $ContentType = self::CONTENT_TYPE_PLAINTEXT; - - /** - * The message encoding. - * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". - * - * @var string - */ - public $Encoding = self::ENCODING_8BIT; - - /** - * Holds the most recent mailer error message. - * - * @var string - */ - public $ErrorInfo = ''; - - /** - * The From email address for the message. - * - * @var string - */ - public $From = ''; - - /** - * The From name of the message. - * - * @var string - */ - public $FromName = ''; - - /** - * The envelope sender of the message. - * This will usually be turned into a Return-Path header by the receiver, - * and is the address that bounces will be sent to. - * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. - * - * @var string - */ - public $Sender = ''; - - /** - * The Subject of the message. - * - * @var string - */ - public $Subject = ''; - - /** - * An HTML or plain text message body. - * If HTML then call isHTML(true). - * - * @var string - */ - public $Body = ''; - - /** - * The plain-text message body. - * This body can be read by mail clients that do not have HTML email - * capability such as mutt & Eudora. - * Clients that can read HTML will view the normal Body. - * - * @var string - */ - public $AltBody = ''; - - /** - * An iCal message part body. - * Only supported in simple alt or alt_inline message types - * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. - * - * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @see http://kigkonsult.se/iCalcreator/ - * - * @var string - */ - public $Ical = ''; - - /** - * Value-array of "method" in Contenttype header "text/calendar" - * - * @var string[] - */ - protected static $IcalMethods = [ - self::ICAL_METHOD_REQUEST, - self::ICAL_METHOD_PUBLISH, - self::ICAL_METHOD_REPLY, - self::ICAL_METHOD_ADD, - self::ICAL_METHOD_CANCEL, - self::ICAL_METHOD_REFRESH, - self::ICAL_METHOD_COUNTER, - self::ICAL_METHOD_DECLINECOUNTER, - ]; - - /** - * The complete compiled MIME message body. - * - * @var string - */ - protected $MIMEBody = ''; - - /** - * The complete compiled MIME message headers. - * - * @var string - */ - protected $MIMEHeader = ''; - - /** - * Extra headers that createHeader() doesn't fold in. - * - * @var string - */ - protected $mailHeader = ''; - - /** - * Word-wrap the message body to this number of chars. - * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. - * - * @see static::STD_LINE_LENGTH - * - * @var int - */ - public $WordWrap = 0; - - /** - * Which method to use to send mail. - * Options: "mail", "sendmail", or "smtp". - * - * @var string - */ - public $Mailer = 'mail'; - - /** - * The path to the sendmail program. - * - * @var string - */ - public $Sendmail = '/usr/sbin/sendmail'; - - /** - * Whether mail() uses a fully sendmail-compatible MTA. - * One which supports sendmail's "-oi -f" options. - * - * @var bool - */ - public $UseSendmailOptions = true; - - /** - * The email address that a reading confirmation should be sent to, also known as read receipt. - * - * @var string - */ - public $ConfirmReadingTo = ''; - - /** - * The hostname to use in the Message-ID header and as default HELO string. - * If empty, PHPMailer attempts to find one with, in order, - * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value - * 'localhost.localdomain'. - * - * @see PHPMailer::$Helo - * - * @var string - */ - public $Hostname = ''; - - /** - * An ID to be used in the Message-ID header. - * If empty, a unique id will be generated. - * You can set your own, but it must be in the format "", - * as defined in RFC5322 section 3.6.4 or it will be ignored. - * - * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 - * - * @var string - */ - public $MessageID = ''; - - /** - * The message Date to be used in the Date header. - * If empty, the current date will be added. - * - * @var string - */ - public $MessageDate = ''; - - /** - * SMTP hosts. - * Either a single hostname or multiple semicolon-delimited hostnames. - * You can also specify a different port - * for each host by using this format: [hostname:port] - * (e.g. "smtp1.example.com:25;smtp2.example.com"). - * You can also specify encryption type, for example: - * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). - * Hosts will be tried in order. - * - * @var string - */ - public $Host = 'localhost'; - - /** - * The default SMTP server port. - * - * @var int - */ - public $Port = 25; - - /** - * The SMTP HELO/EHLO name used for the SMTP connection. - * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find - * one with the same method described above for $Hostname. - * - * @see PHPMailer::$Hostname - * - * @var string - */ - public $Helo = ''; - - /** - * What kind of encryption to use on the SMTP connection. - * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. - * - * @var string - */ - public $SMTPSecure = ''; - - /** - * Whether to enable TLS encryption automatically if a server supports it, - * even if `SMTPSecure` is not set to 'tls'. - * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. - * - * @var bool - */ - public $SMTPAutoTLS = true; - - /** - * Whether to use SMTP authentication. - * Uses the Username and Password properties. - * - * @see PHPMailer::$Username - * @see PHPMailer::$Password - * - * @var bool - */ - public $SMTPAuth = false; - - /** - * Options array passed to stream_context_create when connecting via SMTP. - * - * @var array - */ - public $SMTPOptions = []; - - /** - * SMTP username. - * - * @var string - */ - public $Username = ''; - - /** - * SMTP password. - * - * @var string - */ - public $Password = ''; - - /** - * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. - * If not specified, the first one from that list that the server supports will be selected. - * - * @var string - */ - public $AuthType = ''; - - /** - * An implementation of the PHPMailer OAuthTokenProvider interface. - * - * @var OAuthTokenProvider - */ - protected $oauth; - - /** - * The SMTP server timeout in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. - * - * @var int - */ - public $Timeout = 300; - - /** - * Comma separated list of DSN notifications - * 'NEVER' under no circumstances a DSN must be returned to the sender. - * If you use NEVER all other notifications will be ignored. - * 'SUCCESS' will notify you when your mail has arrived at its destination. - * 'FAILURE' will arrive if an error occurred during delivery. - * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual - * delivery's outcome (success or failure) is not yet decided. - * - * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY - */ - public $dsn = ''; - - /** - * SMTP class debug output mode. - * Debug output level. - * Options: - * @see SMTP::DEBUG_OFF: No output - * @see SMTP::DEBUG_CLIENT: Client messages - * @see SMTP::DEBUG_SERVER: Client and server messages - * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status - * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed - * - * @see SMTP::$do_debug - * - * @var int - */ - public $SMTPDebug = 0; - - /** - * How to handle debug output. - * Options: - * * `echo` Output plain-text as-is, appropriate for CLI - * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output - * * `error_log` Output to error log as configured in php.ini - * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. - * Alternatively, you can provide a callable expecting two params: a message string and the debug level: - * - * ```php - * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; - * ``` - * - * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` - * level output is used: - * - * ```php - * $mail->Debugoutput = new myPsr3Logger; - * ``` - * - * @see SMTP::$Debugoutput - * - * @var string|callable|\Psr\Log\LoggerInterface - */ - public $Debugoutput = 'echo'; - - /** - * Whether to keep the SMTP connection open after each message. - * If this is set to true then the connection will remain open after a send, - * and closing the connection will require an explicit call to smtpClose(). - * It's a good idea to use this if you are sending multiple messages as it reduces overhead. - * See the mailing list example for how to use it. - * - * @var bool - */ - public $SMTPKeepAlive = false; - - /** - * Whether to split multiple to addresses into multiple messages - * or send them all in one message. - * Only supported in `mail` and `sendmail` transports, not in SMTP. - * - * @var bool - * - * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! - */ - public $SingleTo = false; - - /** - * Storage for addresses when SingleTo is enabled. - * - * @var array - */ - protected $SingleToArray = []; - - /** - * Whether to generate VERP addresses on send. - * Only applicable when sending via SMTP. - * - * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Postfix VERP info - * - * @var bool - */ - public $do_verp = false; - - /** - * Whether to allow sending messages with an empty body. - * - * @var bool - */ - public $AllowEmpty = false; - - /** - * DKIM selector. - * - * @var string - */ - public $DKIM_selector = ''; - - /** - * DKIM Identity. - * Usually the email address used as the source of the email. - * - * @var string - */ - public $DKIM_identity = ''; - - /** - * DKIM passphrase. - * Used if your key is encrypted. - * - * @var string - */ - public $DKIM_passphrase = ''; - - /** - * DKIM signing domain name. - * - * @example 'example.com' - * - * @var string - */ - public $DKIM_domain = ''; - - /** - * DKIM Copy header field values for diagnostic use. - * - * @var bool - */ - public $DKIM_copyHeaderFields = true; - - /** - * DKIM Extra signing headers. - * - * @example ['List-Unsubscribe', 'List-Help'] - * - * @var array - */ - public $DKIM_extraHeaders = []; - - /** - * DKIM private key file path. - * - * @var string - */ - public $DKIM_private = ''; - - /** - * DKIM private key string. - * - * If set, takes precedence over `$DKIM_private`. - * - * @var string - */ - public $DKIM_private_string = ''; - - /** - * Callback Action function name. - * - * The function that handles the result of the send email action. - * It is called out by send() for each email sent. - * - * Value can be any php callable: http://www.php.net/is_callable - * - * Parameters: - * bool $result result of the send action - * array $to email addresses of the recipients - * array $cc cc email addresses - * array $bcc bcc email addresses - * string $subject the subject - * string $body the email body - * string $from email address of sender - * string $extra extra information of possible use - * "smtp_transaction_id' => last smtp transaction id - * - * @var string - */ - public $action_function = ''; - - /** - * What to put in the X-Mailer header. - * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. - * - * @var string|null - */ - public $XMailer = ''; - - /** - * Which validator to use by default when validating email addresses. - * May be a callable to inject your own validator, but there are several built-in validators. - * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. - * - * @see PHPMailer::validateAddress() - * - * @var string|callable - */ - public static $validator = 'php'; - - /** - * An instance of the SMTP sender class. - * - * @var SMTP - */ - protected $smtp; - - /** - * The array of 'to' names and addresses. - * - * @var array - */ - protected $to = []; - - /** - * The array of 'cc' names and addresses. - * - * @var array - */ - protected $cc = []; - - /** - * The array of 'bcc' names and addresses. - * - * @var array - */ - protected $bcc = []; - - /** - * The array of reply-to names and addresses. - * - * @var array - */ - protected $ReplyTo = []; - - /** - * An array of all kinds of addresses. - * Includes all of $to, $cc, $bcc. - * - * @see PHPMailer::$to - * @see PHPMailer::$cc - * @see PHPMailer::$bcc - * - * @var array - */ - protected $all_recipients = []; - - /** - * An array of names and addresses queued for validation. - * In send(), valid and non duplicate entries are moved to $all_recipients - * and one of $to, $cc, or $bcc. - * This array is used only for addresses with IDN. - * - * @see PHPMailer::$to - * @see PHPMailer::$cc - * @see PHPMailer::$bcc - * @see PHPMailer::$all_recipients - * - * @var array - */ - protected $RecipientsQueue = []; - - /** - * An array of reply-to names and addresses queued for validation. - * In send(), valid and non duplicate entries are moved to $ReplyTo. - * This array is used only for addresses with IDN. - * - * @see PHPMailer::$ReplyTo - * - * @var array - */ - protected $ReplyToQueue = []; - - /** - * The array of attachments. - * - * @var array - */ - protected $attachment = []; - - /** - * The array of custom headers. - * - * @var array - */ - protected $CustomHeader = []; - - /** - * The most recent Message-ID (including angular brackets). - * - * @var string - */ - protected $lastMessageID = ''; - - /** - * The message's MIME type. - * - * @var string - */ - protected $message_type = ''; - - /** - * The array of MIME boundary strings. - * - * @var array - */ - protected $boundary = []; - - /** - * The array of available text strings for the current language. - * - * @var array - */ - protected $language = []; - - /** - * The number of errors encountered. - * - * @var int - */ - protected $error_count = 0; - - /** - * The S/MIME certificate file path. - * - * @var string - */ - protected $sign_cert_file = ''; - - /** - * The S/MIME key file path. - * - * @var string - */ - protected $sign_key_file = ''; - - /** - * The optional S/MIME extra certificates ("CA Chain") file path. - * - * @var string - */ - protected $sign_extracerts_file = ''; - - /** - * The S/MIME password for the key. - * Used only if the key is encrypted. - * - * @var string - */ - protected $sign_key_pass = ''; - - /** - * Whether to throw exceptions for errors. - * - * @var bool - */ - protected $exceptions = false; - - /** - * Unique ID used for message ID and boundaries. - * - * @var string - */ - protected $uniqueid = ''; - - /** - * The PHPMailer Version number. - * - * @var string - */ - const VERSION = '6.8.1'; - - /** - * Error severity: message only, continue processing. - * - * @var int - */ - const STOP_MESSAGE = 0; - - /** - * Error severity: message, likely ok to continue processing. - * - * @var int - */ - const STOP_CONTINUE = 1; - - /** - * Error severity: message, plus full stop, critical error reached. - * - * @var int - */ - const STOP_CRITICAL = 2; - - /** - * The SMTP standard CRLF line break. - * If you want to change line break format, change static::$LE, not this. - */ - const CRLF = "\r\n"; - - /** - * "Folding White Space" a white space string used for line folding. - */ - const FWS = ' '; - - /** - * SMTP RFC standard line ending; Carriage Return, Line Feed. - * - * @var string - */ - protected static $LE = self::CRLF; - - /** - * The maximum line length supported by mail(). - * - * Background: mail() will sometimes corrupt messages - * with headers longer than 65 chars, see #818. - * - * @var int - */ - const MAIL_MAX_LINE_LENGTH = 63; - - /** - * The maximum line length allowed by RFC 2822 section 2.1.1. - * - * @var int - */ - const MAX_LINE_LENGTH = 998; - - /** - * The lower maximum line length allowed by RFC 2822 section 2.1.1. - * This length does NOT include the line break - * 76 means that lines will be 77 or 78 chars depending on whether - * the line break format is LF or CRLF; both are valid. - * - * @var int - */ - const STD_LINE_LENGTH = 76; - - /** - * Constructor. - * - * @param bool $exceptions Should we throw external exceptions? - */ - public function __construct($exceptions = null) - { - if (null !== $exceptions) { - $this->exceptions = (bool) $exceptions; - } - //Pick an appropriate debug output format automatically - $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); - } - - /** - * Destructor. - */ - public function __destruct() - { - //Close any open SMTP connection nicely - $this->smtpClose(); - } - - /** - * Call mail() in a safe_mode-aware fashion. - * Also, unless sendmail_path points to sendmail (or something that - * claims to be sendmail), don't pass params (not a perfect fix, - * but it will do). - * - * @param string $to To - * @param string $subject Subject - * @param string $body Message Body - * @param string $header Additional Header(s) - * @param string|null $params Params - * - * @return bool - */ - private function mailPassthru($to, $subject, $body, $header, $params) - { - //Check overloading of mail function to avoid double-encoding - if ((int)ini_get('mbstring.func_overload') & 1) { - $subject = $this->secureHeader($subject); - } else { - $subject = $this->encodeHeader($this->secureHeader($subject)); - } - //Calling mail() with null params breaks - $this->edebug('Sending with mail()'); - $this->edebug('Sendmail path: ' . ini_get('sendmail_path')); - $this->edebug("Envelope sender: {$this->Sender}"); - $this->edebug("To: {$to}"); - $this->edebug("Subject: {$subject}"); - $this->edebug("Headers: {$header}"); - if (!$this->UseSendmailOptions || null === $params) { - $result = @mail($to, $subject, $body, $header); - } else { - $this->edebug("Additional params: {$params}"); - $result = @mail($to, $subject, $body, $header, $params); - } - $this->edebug('Result: ' . ($result ? 'true' : 'false')); - return $result; - } - - /** - * Output debugging info via a user-defined method. - * Only generates output if debug output is enabled. - * - * @see PHPMailer::$Debugoutput - * @see PHPMailer::$SMTPDebug - * - * @param string $str - */ - protected function edebug($str) - { - if ($this->SMTPDebug <= 0) { - return; - } - //Is this a PSR-3 logger? - if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); - - return; - } - //Avoid clash with built-in function names - if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { - call_user_func($this->Debugoutput, $str, $this->SMTPDebug); - - return; - } - switch ($this->Debugoutput) { - case 'error_log': - //Don't output, just log - /** @noinspection ForgottenDebugOutputInspection */ - error_log($str); - break; - case 'html': - //Cleans up output a bit for a better looking, HTML-safe output - echo htmlentities( - preg_replace('/[\r\n]+/', '', $str), - ENT_QUOTES, - 'UTF-8' - ), "
\n"; - break; - case 'echo': - default: - //Normalize line breaks - $str = preg_replace('/\r\n|\r/m', "\n", $str); - echo gmdate('Y-m-d H:i:s'), - "\t", - //Trim trailing space - trim( - //Indent for readability, except for trailing break - str_replace( - "\n", - "\n \t ", - trim($str) - ) - ), - "\n"; - } - } - - /** - * Sets message type to HTML or plain. - * - * @param bool $isHtml True for HTML mode - */ - public function isHTML($isHtml = true) - { - if ($isHtml) { - $this->ContentType = static::CONTENT_TYPE_TEXT_HTML; - } else { - $this->ContentType = static::CONTENT_TYPE_PLAINTEXT; - } - } - - /** - * Send messages using SMTP. - */ - public function isSMTP() - { - $this->Mailer = 'smtp'; - } - - /** - * Send messages using PHP's mail() function. - */ - public function isMail() - { - $this->Mailer = 'mail'; - } - - /** - * Send messages using $Sendmail. - */ - public function isSendmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (false === stripos($ini_sendmail_path, 'sendmail')) { - $this->Sendmail = '/usr/sbin/sendmail'; - } else { - $this->Sendmail = $ini_sendmail_path; - } - $this->Mailer = 'sendmail'; - } - - /** - * Send messages using qmail. - */ - public function isQmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (false === stripos($ini_sendmail_path, 'qmail')) { - $this->Sendmail = '/var/qmail/bin/qmail-inject'; - } else { - $this->Sendmail = $ini_sendmail_path; - } - $this->Mailer = 'qmail'; - } - - /** - * Add a "To" address. - * - * @param string $address The email address to send to - * @param string $name - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - public function addAddress($address, $name = '') - { - return $this->addOrEnqueueAnAddress('to', $address, $name); - } - - /** - * Add a "CC" address. - * - * @param string $address The email address to send to - * @param string $name - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - public function addCC($address, $name = '') - { - return $this->addOrEnqueueAnAddress('cc', $address, $name); - } - - /** - * Add a "BCC" address. - * - * @param string $address The email address to send to - * @param string $name - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - public function addBCC($address, $name = '') - { - return $this->addOrEnqueueAnAddress('bcc', $address, $name); - } - - /** - * Add a "Reply-To" address. - * - * @param string $address The email address to reply to - * @param string $name - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - public function addReplyTo($address, $name = '') - { - return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); - } - - /** - * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer - * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still - * be modified after calling this function), addition of such addresses is delayed until send(). - * Addresses that have been added already return false, but do not throw exceptions. - * - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address - * @param string $name An optional username associated with the address - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - protected function addOrEnqueueAnAddress($kind, $address, $name) - { - $pos = false; - if ($address !== null) { - $address = trim($address); - $pos = strrpos($address, '@'); - } - if (false === $pos) { - //At-sign is missing. - $error_message = sprintf( - '%s (%s): %s', - $this->lang('invalid_address'), - $kind, - $address - ); - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new Exception($error_message); - } - - return false; - } - if ($name !== null && is_string($name)) { - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - } else { - $name = ''; - } - $params = [$kind, $address, $name]; - //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - //Domain is assumed to be whatever is after the last @ symbol in the address - if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { - if ('Reply-To' !== $kind) { - if (!array_key_exists($address, $this->RecipientsQueue)) { - $this->RecipientsQueue[$address] = $params; - - return true; - } - } elseif (!array_key_exists($address, $this->ReplyToQueue)) { - $this->ReplyToQueue[$address] = $params; - - return true; - } - - return false; - } - - //Immediately add standard addresses without IDN. - return call_user_func_array([$this, 'addAnAddress'], $params); - } - - /** - * Set the boundaries to use for delimiting MIME parts. - * If you override this, ensure you set all 3 boundaries to unique values. - * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, - * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 - * - * @return void - */ - public function setBoundaries() - { - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1=_' . $this->uniqueid; - $this->boundary[2] = 'b2=_' . $this->uniqueid; - $this->boundary[3] = 'b3=_' . $this->uniqueid; - } - - /** - * Add an address to one of the recipient arrays or to the ReplyTo array. - * Addresses that have been added already return false, but do not throw exceptions. - * - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address to send, resp. to reply to - * @param string $name - * - * @throws Exception - * - * @return bool true on success, false if address already used or invalid in some way - */ - protected function addAnAddress($kind, $address, $name = '') - { - if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { - $error_message = sprintf( - '%s: %s', - $this->lang('Invalid recipient kind'), - $kind - ); - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new Exception($error_message); - } - - return false; - } - if (!static::validateAddress($address)) { - $error_message = sprintf( - '%s (%s): %s', - $this->lang('invalid_address'), - $kind, - $address - ); - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new Exception($error_message); - } - - return false; - } - if ('Reply-To' !== $kind) { - if (!array_key_exists(strtolower($address), $this->all_recipients)) { - $this->{$kind}[] = [$address, $name]; - $this->all_recipients[strtolower($address)] = true; - - return true; - } - } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) { - $this->ReplyTo[strtolower($address)] = [$address, $name]; - - return true; - } - - return false; - } - - /** - * Parse and validate a string containing one or more RFC822-style comma-separated email addresses - * of the form "display name
" into an array of name/address pairs. - * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. - * Note that quotes in the name part are removed. - * - * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation - * - * @param string $addrstr The address list string - * @param bool $useimap Whether to use the IMAP extension to parse the list - * @param string $charset The charset to use when decoding the address list string. - * - * @return array - */ - public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) - { - $addresses = []; - if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { - //Use this built-in parser if it's available - $list = imap_rfc822_parse_adrlist($addrstr, ''); - // Clear any potential IMAP errors to get rid of notices being thrown at end of script. - imap_errors(); - foreach ($list as $address) { - if ( - '.SYNTAX-ERROR.' !== $address->host && - static::validateAddress($address->mailbox . '@' . $address->host) - ) { - //Decode the name part if it's present and encoded - if ( - property_exists($address, 'personal') && - //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled - defined('MB_CASE_UPPER') && - preg_match('/^=\?.*\?=$/s', $address->personal) - ) { - $origCharset = mb_internal_encoding(); - mb_internal_encoding($charset); - //Undo any RFC2047-encoded spaces-as-underscores - $address->personal = str_replace('_', '=20', $address->personal); - //Decode the name - $address->personal = mb_decode_mimeheader($address->personal); - mb_internal_encoding($origCharset); - } - - $addresses[] = [ - 'name' => (property_exists($address, 'personal') ? $address->personal : ''), - 'address' => $address->mailbox . '@' . $address->host, - ]; - } - } - } else { - //Use this simpler parser - $list = explode(',', $addrstr); - foreach ($list as $address) { - $address = trim($address); - //Is there a separate name part? - if (strpos($address, '<') === false) { - //No separate name, just use the whole thing - if (static::validateAddress($address)) { - $addresses[] = [ - 'name' => '', - 'address' => $address, - ]; - } - } else { - list($name, $email) = explode('<', $address); - $email = trim(str_replace('>', '', $email)); - $name = trim($name); - if (static::validateAddress($email)) { - //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled - //If this name is encoded, decode it - if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { - $origCharset = mb_internal_encoding(); - mb_internal_encoding($charset); - //Undo any RFC2047-encoded spaces-as-underscores - $name = str_replace('_', '=20', $name); - //Decode the name - $name = mb_decode_mimeheader($name); - mb_internal_encoding($origCharset); - } - $addresses[] = [ - //Remove any surrounding quotes and spaces from the name - 'name' => trim($name, '\'" '), - 'address' => $email, - ]; - } - } - } - } - - return $addresses; - } - - /** - * Set the From and FromName properties. - * - * @param string $address - * @param string $name - * @param bool $auto Whether to also set the Sender address, defaults to true - * - * @throws Exception - * - * @return bool - */ - public function setFrom($address, $name = '', $auto = true) - { - $address = trim((string)$address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - //Don't validate now addresses with IDN. Will be done in send(). - $pos = strrpos($address, '@'); - if ( - (false === $pos) - || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) - && !static::validateAddress($address)) - ) { - $error_message = sprintf( - '%s (From): %s', - $this->lang('invalid_address'), - $address - ); - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new Exception($error_message); - } - - return false; - } - $this->From = $address; - $this->FromName = $name; - if ($auto && empty($this->Sender)) { - $this->Sender = $address; - } - - return true; - } - - /** - * Return the Message-ID header of the last email. - * Technically this is the value from the last time the headers were created, - * but it's also the message ID of the last sent message except in - * pathological cases. - * - * @return string - */ - public function getLastMessageID() - { - return $this->lastMessageID; - } - - /** - * Check that a string looks like an email address. - * Validation patterns supported: - * * `auto` Pick best pattern automatically; - * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; - * * `pcre` Use old PCRE implementation; - * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; - * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. - * * `noregex` Don't use a regex: super fast, really dumb. - * Alternatively you may pass in a callable to inject your own validator, for example: - * - * ```php - * PHPMailer::validateAddress('user@example.com', function($address) { - * return (strpos($address, '@') !== false); - * }); - * ``` - * - * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. - * - * @param string $address The email address to check - * @param string|callable $patternselect Which pattern to use - * - * @return bool - */ - public static function validateAddress($address, $patternselect = null) - { - if (null === $patternselect) { - $patternselect = static::$validator; - } - //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603 - if (is_callable($patternselect) && !is_string($patternselect)) { - return call_user_func($patternselect, $address); - } - //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 - if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { - return false; - } - switch ($patternselect) { - case 'pcre': //Kept for BC - case 'pcre8': - /* - * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL - * is based. - * In addition to the addresses allowed by filter_var, also permits: - * * dotless domains: `a@b` - * * comments: `1234 @ local(blah) .machine .example` - * * quoted elements: `'"test blah"@example.org'` - * * numeric TLDs: `a@b.123` - * * unbracketed IPv4 literals: `a@192.168.0.1` - * * IPv6 literals: 'first.last@[IPv6:a1::]' - * Not all of these will necessarily work for sending! - * - * @see http://squiloople.com/2009/12/20/email-address-validation/ - * @copyright 2009-2010 Michael Rushton - * Feel free to use and redistribute this code. But please keep this copyright notice. - */ - return (bool) preg_match( - '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . - '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . - '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . - '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . - '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . - '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . - '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . - '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . - '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', - $address - ); - case 'html5': - /* - * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. - * - * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) - */ - return (bool) preg_match( - '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . - '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', - $address - ); - case 'php': - default: - return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; - } - } - - /** - * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the - * `intl` and `mbstring` PHP extensions. - * - * @return bool `true` if required functions for IDN support are present - */ - public static function idnSupported() - { - return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding'); - } - - /** - * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. - * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. - * This function silently returns unmodified address if: - * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) - * - Conversion to punycode is impossible (e.g. required PHP functions are not available) - * or fails for any reason (e.g. domain contains characters not allowed in an IDN). - * - * @see PHPMailer::$CharSet - * - * @param string $address The email address to convert - * - * @return string The encoded address in ASCII form - */ - public function punyencodeAddress($address) - { - //Verify we have required functions, CharSet, and at-sign. - $pos = strrpos($address, '@'); - if ( - !empty($this->CharSet) && - false !== $pos && - static::idnSupported() - ) { - $domain = substr($address, ++$pos); - //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. - if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { - //Convert the domain from whatever charset it's in to UTF-8 - $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); - //Ignore IDE complaints about this line - method signature changed in PHP 5.4 - $errorcode = 0; - if (defined('INTL_IDNA_VARIANT_UTS46')) { - //Use the current punycode standard (appeared in PHP 7.2) - $punycode = idn_to_ascii( - $domain, - \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | - \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, - \INTL_IDNA_VARIANT_UTS46 - ); - } elseif (defined('INTL_IDNA_VARIANT_2003')) { - //Fall back to this old, deprecated/removed encoding - $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); - } else { - //Fall back to a default we don't know about - $punycode = idn_to_ascii($domain, $errorcode); - } - if (false !== $punycode) { - return substr($address, 0, $pos) . $punycode; - } - } - } - - return $address; - } - - /** - * Create a message and send it. - * Uses the sending method specified by $Mailer. - * - * @throws Exception - * - * @return bool false on error - See the ErrorInfo property for details of the error - */ - public function send() - { - try { - if (!$this->preSend()) { - return false; - } - - return $this->postSend(); - } catch (Exception $exc) { - $this->mailHeader = ''; - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - } - - /** - * Prepare a message for sending. - * - * @throws Exception - * - * @return bool - */ - public function preSend() - { - if ( - 'smtp' === $this->Mailer - || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) - ) { - //SMTP mandates RFC-compliant line endings - //and it's also used with mail() on Windows - static::setLE(self::CRLF); - } else { - //Maintain backward compatibility with legacy Linux command line mailers - static::setLE(PHP_EOL); - } - //Check for buggy PHP versions that add a header with an incorrect line break - if ( - 'mail' === $this->Mailer - && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) - || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) - && ini_get('mail.add_x_header') === '1' - && stripos(PHP_OS, 'WIN') === 0 - ) { - trigger_error($this->lang('buggy_php'), E_USER_WARNING); - } - - try { - $this->error_count = 0; //Reset errors - $this->mailHeader = ''; - - //Dequeue recipient and Reply-To addresses with IDN - foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { - $params[1] = $this->punyencodeAddress($params[1]); - call_user_func_array([$this, 'addAnAddress'], $params); - } - if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { - throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); - } - - //Validate From, Sender, and ConfirmReadingTo addresses - foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { - $this->{$address_kind} = trim($this->{$address_kind}); - if (empty($this->{$address_kind})) { - continue; - } - $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); - if (!static::validateAddress($this->{$address_kind})) { - $error_message = sprintf( - '%s (%s): %s', - $this->lang('invalid_address'), - $address_kind, - $this->{$address_kind} - ); - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new Exception($error_message); - } - - return false; - } - } - - //Set whether the message is multipart/alternative - if ($this->alternativeExists()) { - $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; - } - - $this->setMessageType(); - //Refuse to send an empty message unless we are specifically allowing it - if (!$this->AllowEmpty && empty($this->Body)) { - throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); - } - - //Trim subject consistently - $this->Subject = trim($this->Subject); - //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) - $this->MIMEHeader = ''; - $this->MIMEBody = $this->createBody(); - //createBody may have added some headers, so retain them - $tempheaders = $this->MIMEHeader; - $this->MIMEHeader = $this->createHeader(); - $this->MIMEHeader .= $tempheaders; - - //To capture the complete message when using mail(), create - //an extra header list which createHeader() doesn't fold in - if ('mail' === $this->Mailer) { - if (count($this->to) > 0) { - $this->mailHeader .= $this->addrAppend('To', $this->to); - } else { - $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); - } - $this->mailHeader .= $this->headerLine( - 'Subject', - $this->encodeHeader($this->secureHeader($this->Subject)) - ); - } - - //Sign with DKIM if enabled - if ( - !empty($this->DKIM_domain) - && !empty($this->DKIM_selector) - && (!empty($this->DKIM_private_string) - || (!empty($this->DKIM_private) - && static::isPermittedPath($this->DKIM_private) - && file_exists($this->DKIM_private) - ) - ) - ) { - $header_dkim = $this->DKIM_Add( - $this->MIMEHeader . $this->mailHeader, - $this->encodeHeader($this->secureHeader($this->Subject)), - $this->MIMEBody - ); - $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE . - static::normalizeBreaks($header_dkim) . static::$LE; - } - - return true; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - } - - /** - * Actually send a message via the selected mechanism. - * - * @throws Exception - * - * @return bool - */ - public function postSend() - { - try { - //Choose the mailer and send through it - switch ($this->Mailer) { - case 'sendmail': - case 'qmail': - return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); - case 'smtp': - return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); - case 'mail': - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); - default: - $sendMethod = $this->Mailer . 'Send'; - if (method_exists($this, $sendMethod)) { - return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody); - } - - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); - } - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { - $this->smtp->reset(); - } - if ($this->exceptions) { - throw $exc; - } - } - - return false; - } - - /** - * Send mail using the $Sendmail program. - * - * @see PHPMailer::$Sendmail - * - * @param string $header The message headers - * @param string $body The message body - * - * @throws Exception - * - * @return bool - */ - protected function sendmailSend($header, $body) - { - if ($this->Mailer === 'qmail') { - $this->edebug('Sending with qmail'); - } else { - $this->edebug('Sending with sendmail'); - } - $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; - //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver - //A space after `-f` is optional, but there is a long history of its presence - //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html - //Example problem: https://www.drupal.org/node/1057954 - - //PHP 5.6 workaround - $sendmail_from_value = ini_get('sendmail_from'); - if (empty($this->Sender) && !empty($sendmail_from_value)) { - //PHP config has a sender address we can use - $this->Sender = ini_get('sendmail_from'); - } - //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { - if ($this->Mailer === 'qmail') { - $sendmailFmt = '%s -f%s'; - } else { - $sendmailFmt = '%s -oi -f%s -t'; - } - } else { - //allow sendmail to choose a default envelope sender. It may - //seem preferable to force it to use the From header as with - //SMTP, but that introduces new problems (see - //), and - //it has historically worked this way. - $sendmailFmt = '%s -oi -t'; - } - - $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); - $this->edebug('Sendmail path: ' . $this->Sendmail); - $this->edebug('Sendmail command: ' . $sendmail); - $this->edebug('Envelope sender: ' . $this->Sender); - $this->edebug("Headers: {$header}"); - - if ($this->SingleTo) { - foreach ($this->SingleToArray as $toAddr) { - $mail = @popen($sendmail, 'w'); - if (!$mail) { - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - $this->edebug("To: {$toAddr}"); - fwrite($mail, 'To: ' . $toAddr . "\n"); - fwrite($mail, $header); - fwrite($mail, $body); - $result = pclose($mail); - $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); - $this->doCallback( - ($result === 0), - [[$addrinfo['address'], $addrinfo['name']]], - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From, - [] - ); - $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); - if (0 !== $result) { - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - } - } else { - $mail = @popen($sendmail, 'w'); - if (!$mail) { - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - fwrite($mail, $header); - fwrite($mail, $body); - $result = pclose($mail); - $this->doCallback( - ($result === 0), - $this->to, - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From, - [] - ); - $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); - if (0 !== $result) { - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - } - - return true; - } - - /** - * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. - * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. - * - * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report - * - * @param string $string The string to be validated - * - * @return bool - */ - protected static function isShellSafe($string) - { - //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, - //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, - //so we don't. - if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { - return false; - } - - if ( - escapeshellcmd($string) !== $string - || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) - ) { - return false; - } - - $length = strlen($string); - - for ($i = 0; $i < $length; ++$i) { - $c = $string[$i]; - - //All other characters have a special meaning in at least one common shell, including = and +. - //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. - //Note that this does permit non-Latin alphanumeric characters based on the current locale. - if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { - return false; - } - } - - return true; - } - - /** - * Check whether a file path is of a permitted type. - * Used to reject URLs and phar files from functions that access local file paths, - * such as addAttachment. - * - * @param string $path A relative or absolute path to a file - * - * @return bool - */ - protected static function isPermittedPath($path) - { - //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 - return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); - } - - /** - * Check whether a file path is safe, accessible, and readable. - * - * @param string $path A relative or absolute path to a file - * - * @return bool - */ - protected static function fileIsAccessible($path) - { - if (!static::isPermittedPath($path)) { - return false; - } - $readable = is_file($path); - //If not a UNC path (expected to start with \\), check read permission, see #2069 - if (strpos($path, '\\\\') !== 0) { - $readable = $readable && is_readable($path); - } - return $readable; - } - - /** - * Send mail using the PHP mail() function. - * - * @see http://www.php.net/manual/en/book.mail.php - * - * @param string $header The message headers - * @param string $body The message body - * - * @throws Exception - * - * @return bool - */ - protected function mailSend($header, $body) - { - $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; - - $toArr = []; - foreach ($this->to as $toaddr) { - $toArr[] = $this->addrFormat($toaddr); - } - $to = trim(implode(', ', $toArr)); - - //If there are no To-addresses (e.g. when sending only to BCC-addresses) - //the following should be added to get a correct DKIM-signature. - //Compare with $this->preSend() - if ($to === '') { - $to = 'undisclosed-recipients:;'; - } - - $params = null; - //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver - //A space after `-f` is optional, but there is a long history of its presence - //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html - //Example problem: https://www.drupal.org/node/1057954 - //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - - //PHP 5.6 workaround - $sendmail_from_value = ini_get('sendmail_from'); - if (empty($this->Sender) && !empty($sendmail_from_value)) { - //PHP config has a sender address we can use - $this->Sender = ini_get('sendmail_from'); - } - if (!empty($this->Sender) && static::validateAddress($this->Sender)) { - if (self::isShellSafe($this->Sender)) { - $params = sprintf('-f%s', $this->Sender); - } - $old_from = ini_get('sendmail_from'); - ini_set('sendmail_from', $this->Sender); - } - $result = false; - if ($this->SingleTo && count($toArr) > 1) { - foreach ($toArr as $toAddr) { - $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); - $this->doCallback( - $result, - [[$addrinfo['address'], $addrinfo['name']]], - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From, - [] - ); - } - } else { - $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); - $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); - } - if (isset($old_from)) { - ini_set('sendmail_from', $old_from); - } - if (!$result) { - throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL); - } - - return true; - } - - /** - * Get an instance to use for SMTP operations. - * Override this function to load your own SMTP implementation, - * or set one with setSMTPInstance. - * - * @return SMTP - */ - public function getSMTPInstance() - { - if (!is_object($this->smtp)) { - $this->smtp = new SMTP(); - } - - return $this->smtp; - } - - /** - * Provide an instance to use for SMTP operations. - * - * @return SMTP - */ - public function setSMTPInstance(SMTP $smtp) - { - $this->smtp = $smtp; - - return $this->smtp; - } - - /** - * Send mail via SMTP. - * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. - * - * @see PHPMailer::setSMTPInstance() to use a different class. - * - * @uses \PHPMailer\PHPMailer\SMTP - * - * @param string $header The message headers - * @param string $body The message body - * - * @throws Exception - * - * @return bool - */ - protected function smtpSend($header, $body) - { - $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; - $bad_rcpt = []; - if (!$this->smtpConnect($this->SMTPOptions)) { - throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); - } - //Sender already validated in preSend() - if ('' === $this->Sender) { - $smtp_from = $this->From; - } else { - $smtp_from = $this->Sender; - } - if (!$this->smtp->mail($smtp_from)) { - $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); - throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); - } - - $callbacks = []; - //Attempt to send to all recipients - foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { - foreach ($togroup as $to) { - if (!$this->smtp->recipient($to[0], $this->dsn)) { - $error = $this->smtp->getError(); - $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']]; - $isSent = false; - } else { - $isSent = true; - } - - $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]]; - } - } - - //Only send the DATA command if we have viable recipients - if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { - throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); - } - - $smtp_transaction_id = $this->smtp->getLastTransactionID(); - - if ($this->SMTPKeepAlive) { - $this->smtp->reset(); - } else { - $this->smtp->quit(); - $this->smtp->close(); - } - - foreach ($callbacks as $cb) { - $this->doCallback( - $cb['issent'], - [[$cb['to'], $cb['name']]], - [], - [], - $this->Subject, - $body, - $this->From, - ['smtp_transaction_id' => $smtp_transaction_id] - ); - } - - //Create error message for any bad addresses - if (count($bad_rcpt) > 0) { - $errstr = ''; - foreach ($bad_rcpt as $bad) { - $errstr .= $bad['to'] . ': ' . $bad['error']; - } - throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE); - } - - return true; - } - - /** - * Initiate a connection to an SMTP server. - * Returns false if the operation failed. - * - * @param array $options An array of options compatible with stream_context_create() - * - * @throws Exception - * - * @uses \PHPMailer\PHPMailer\SMTP - * - * @return bool - */ - public function smtpConnect($options = null) - { - if (null === $this->smtp) { - $this->smtp = $this->getSMTPInstance(); - } - - //If no options are provided, use whatever is set in the instance - if (null === $options) { - $options = $this->SMTPOptions; - } - - //Already connected? - if ($this->smtp->connected()) { - return true; - } - - $this->smtp->setTimeout($this->Timeout); - $this->smtp->setDebugLevel($this->SMTPDebug); - $this->smtp->setDebugOutput($this->Debugoutput); - $this->smtp->setVerp($this->do_verp); - if ($this->Host === null) { - $this->Host = 'localhost'; - } - $hosts = explode(';', $this->Host); - $lastexception = null; - - foreach ($hosts as $hostentry) { - $hostinfo = []; - if ( - !preg_match( - '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', - trim($hostentry), - $hostinfo - ) - ) { - $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); - //Not a valid host entry - continue; - } - //$hostinfo[1]: optional ssl or tls prefix - //$hostinfo[2]: the hostname - //$hostinfo[3]: optional port number - //The host string prefix can temporarily override the current setting for SMTPSecure - //If it's not specified, the default value is used - - //Check the host name is a valid name or IP address before trying to use it - if (!static::isValidHost($hostinfo[2])) { - $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]); - continue; - } - $prefix = ''; - $secure = $this->SMTPSecure; - $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); - if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { - $prefix = 'ssl://'; - $tls = false; //Can't have SSL and TLS at the same time - $secure = static::ENCRYPTION_SMTPS; - } elseif ('tls' === $hostinfo[1]) { - $tls = true; - //TLS doesn't use a prefix - $secure = static::ENCRYPTION_STARTTLS; - } - //Do we need the OpenSSL extension? - $sslext = defined('OPENSSL_ALGO_SHA256'); - if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) { - //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled - if (!$sslext) { - throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); - } - } - $host = $hostinfo[2]; - $port = $this->Port; - if ( - array_key_exists(3, $hostinfo) && - is_numeric($hostinfo[3]) && - $hostinfo[3] > 0 && - $hostinfo[3] < 65536 - ) { - $port = (int) $hostinfo[3]; - } - if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { - try { - if ($this->Helo) { - $hello = $this->Helo; - } else { - $hello = $this->serverHostname(); - } - $this->smtp->hello($hello); - //Automatically enable TLS encryption if: - //* it's not disabled - //* we have openssl extension - //* we are not already using SSL - //* the server offers STARTTLS - if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { - $tls = true; - } - if ($tls) { - if (!$this->smtp->startTLS()) { - $message = $this->getSmtpErrorMessage('connect_host'); - throw new Exception($message); - } - //We must resend EHLO after TLS negotiation - $this->smtp->hello($hello); - } - if ( - $this->SMTPAuth && !$this->smtp->authenticate( - $this->Username, - $this->Password, - $this->AuthType, - $this->oauth - ) - ) { - throw new Exception($this->lang('authenticate')); - } - - return true; - } catch (Exception $exc) { - $lastexception = $exc; - $this->edebug($exc->getMessage()); - //We must have connected, but then failed TLS or Auth, so close connection nicely - $this->smtp->quit(); - } - } - } - //If we get here, all connection attempts have failed, so close connection hard - $this->smtp->close(); - //As we've caught all exceptions, just report whatever the last one was - if ($this->exceptions && null !== $lastexception) { - throw $lastexception; - } - if ($this->exceptions) { - // no exception was thrown, likely $this->smtp->connect() failed - $message = $this->getSmtpErrorMessage('connect_host'); - throw new Exception($message); - } - - return false; - } - - /** - * Close the active SMTP session if one exists. - */ - public function smtpClose() - { - if ((null !== $this->smtp) && $this->smtp->connected()) { - $this->smtp->quit(); - $this->smtp->close(); - } - } - - /** - * Set the language for error messages. - * The default language is English. - * - * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * Optionally, the language code can be enhanced with a 4-character - * script annotation and/or a 2-character country annotation. - * @param string $lang_path Path to the language file directory, with trailing separator (slash) - * Do not set this from user input! - * - * @return bool Returns true if the requested language was loaded, false otherwise. - */ - public function setLanguage($langcode = 'en', $lang_path = '') - { - //Backwards compatibility for renamed language codes - $renamed_langcodes = [ - 'br' => 'pt_br', - 'cz' => 'cs', - 'dk' => 'da', - 'no' => 'nb', - 'se' => 'sv', - 'rs' => 'sr', - 'tg' => 'tl', - 'am' => 'hy', - ]; - - if (array_key_exists($langcode, $renamed_langcodes)) { - $langcode = $renamed_langcodes[$langcode]; - } - - //Define full set of translatable strings in English - $PHPMAILER_LANG = [ - 'authenticate' => 'SMTP Error: Could not authenticate.', - 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . - ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', - 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', - 'data_not_accepted' => 'SMTP Error: data not accepted.', - 'empty_message' => 'Message body empty', - 'encoding' => 'Unknown encoding: ', - 'execute' => 'Could not execute: ', - 'extension_missing' => 'Extension missing: ', - 'file_access' => 'Could not access file: ', - 'file_open' => 'File Error: Could not open file: ', - 'from_failed' => 'The following From address failed: ', - 'instantiate' => 'Could not instantiate mail function.', - 'invalid_address' => 'Invalid address: ', - 'invalid_header' => 'Invalid header name or value', - 'invalid_hostentry' => 'Invalid hostentry: ', - 'invalid_host' => 'Invalid host: ', - 'mailer_not_supported' => ' mailer is not supported.', - 'provide_address' => 'You must provide at least one recipient email address.', - 'recipients_failed' => 'SMTP Error: The following recipients failed: ', - 'signing' => 'Signing Error: ', - 'smtp_code' => 'SMTP code: ', - 'smtp_code_ex' => 'Additional SMTP info: ', - 'smtp_connect_failed' => 'SMTP connect() failed.', - 'smtp_detail' => 'Detail: ', - 'smtp_error' => 'SMTP server error: ', - 'variable_set' => 'Cannot set or reset variable: ', - ]; - if (empty($lang_path)) { - //Calculate an absolute path so it can work if CWD is not here - $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; - } - - //Validate $langcode - $foundlang = true; - $langcode = strtolower($langcode); - if ( - !preg_match('/^(?P[a-z]{2})(?P