@appthreat/atom 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/astgen.js +6 -2
  2. package/index.js +3 -1
  3. package/package.json +3 -2
  4. package/phpastgen.js +37 -0
  5. package/plugins/autoload.php +25 -0
  6. package/plugins/bin/atom +1 -1
  7. package/plugins/bin/atom.bat +1 -1
  8. package/plugins/bin/php-parse +119 -0
  9. package/plugins/composer/ClassLoader.php +579 -0
  10. package/plugins/composer/InstalledVersions.php +359 -0
  11. package/plugins/composer/LICENSE +21 -0
  12. package/plugins/composer/autoload_classmap.php +260 -0
  13. package/plugins/composer/autoload_namespaces.php +9 -0
  14. package/plugins/composer/autoload_psr4.php +10 -0
  15. package/plugins/composer/autoload_real.php +36 -0
  16. package/plugins/composer/autoload_static.php +286 -0
  17. package/plugins/composer/installed.json +65 -0
  18. package/plugins/composer/installed.php +32 -0
  19. package/plugins/lib/io.appthreat.atom-1.8.2-classpath.jar +0 -0
  20. package/plugins/lib/{io.appthreat.atom-1.8.0.jar → io.appthreat.atom-1.8.2.jar} +0 -0
  21. package/plugins/lib/{io.appthreat.c2cpg_3-1.1.1.jar → io.appthreat.c2cpg_3-1.1.4.jar} +0 -0
  22. package/plugins/lib/{io.appthreat.dataflowengineoss_3-1.1.1.jar → io.appthreat.dataflowengineoss_3-1.1.4.jar} +0 -0
  23. package/plugins/lib/{io.appthreat.javasrc2cpg_3-1.1.1.jar → io.appthreat.javasrc2cpg_3-1.1.4.jar} +0 -0
  24. package/plugins/lib/{io.appthreat.jimple2cpg_3-1.1.1.jar → io.appthreat.jimple2cpg_3-1.1.4.jar} +0 -0
  25. package/plugins/lib/{io.appthreat.jssrc2cpg_3-1.1.1.jar → io.appthreat.jssrc2cpg_3-1.1.4.jar} +0 -0
  26. package/plugins/lib/io.appthreat.php2atom_3-1.1.4.jar +0 -0
  27. package/plugins/lib/{io.appthreat.pysrc2cpg_3-1.1.1.jar → io.appthreat.pysrc2cpg_3-1.1.4.jar} +0 -0
  28. package/plugins/lib/{io.appthreat.semanticcpg_3-1.1.1.jar → io.appthreat.semanticcpg_3-1.1.4.jar} +0 -0
  29. package/plugins/lib/{io.appthreat.x2cpg_3-1.1.1.jar → io.appthreat.x2cpg_3-1.1.4.jar} +0 -0
  30. package/plugins/nikic/php-parser/LICENSE +29 -0
  31. package/plugins/nikic/php-parser/README.md +225 -0
  32. package/plugins/nikic/php-parser/bin/php-parse +205 -0
  33. package/plugins/nikic/php-parser/composer.json +41 -0
  34. package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +148 -0
  35. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +146 -0
  36. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +43 -0
  37. package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +85 -0
  38. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +117 -0
  39. package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +73 -0
  40. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +67 -0
  41. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +93 -0
  42. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +146 -0
  43. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +45 -0
  44. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +168 -0
  45. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +161 -0
  46. package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +64 -0
  47. package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +148 -0
  48. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +78 -0
  49. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +49 -0
  50. package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +13 -0
  51. package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +399 -0
  52. package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +335 -0
  53. package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +7 -0
  54. package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +239 -0
  55. package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +6 -0
  56. package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +229 -0
  57. package/plugins/nikic/php-parser/lib/PhpParser/Error.php +180 -0
  58. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +46 -0
  59. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +18 -0
  60. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +13 -0
  61. package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +27 -0
  62. package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +164 -0
  63. package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +64 -0
  64. package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +286 -0
  65. package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +103 -0
  66. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +251 -0
  67. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +56 -0
  68. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +47 -0
  69. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +31 -0
  70. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +44 -0
  71. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +76 -0
  72. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +23 -0
  73. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +62 -0
  74. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +23 -0
  75. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +67 -0
  76. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +105 -0
  77. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
  78. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +36 -0
  79. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +36 -0
  80. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +25 -0
  81. package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +560 -0
  82. package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +285 -0
  83. package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +46 -0
  84. package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +34 -0
  85. package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +29 -0
  86. package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +14 -0
  87. package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +37 -0
  88. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +34 -0
  89. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +41 -0
  90. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +34 -0
  91. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +79 -0
  92. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +34 -0
  93. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +12 -0
  94. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +12 -0
  95. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +12 -0
  96. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +12 -0
  97. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +12 -0
  98. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +12 -0
  99. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +12 -0
  100. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +12 -0
  101. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +12 -0
  102. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +12 -0
  103. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +12 -0
  104. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +12 -0
  105. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +12 -0
  106. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +30 -0
  107. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +34 -0
  108. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +16 -0
  109. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +16 -0
  110. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +16 -0
  111. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +16 -0
  112. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +16 -0
  113. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +16 -0
  114. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +16 -0
  115. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +16 -0
  116. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +16 -0
  117. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +16 -0
  118. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +16 -0
  119. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +16 -0
  120. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +16 -0
  121. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +16 -0
  122. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +16 -0
  123. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +16 -0
  124. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +16 -0
  125. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +16 -0
  126. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +16 -0
  127. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +16 -0
  128. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +16 -0
  129. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +16 -0
  130. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +16 -0
  131. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +16 -0
  132. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +16 -0
  133. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +16 -0
  134. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +16 -0
  135. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +40 -0
  136. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +30 -0
  137. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +30 -0
  138. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +39 -0
  139. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +12 -0
  140. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +12 -0
  141. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +17 -0
  142. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +12 -0
  143. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +12 -0
  144. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +12 -0
  145. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +12 -0
  146. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +26 -0
  147. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +36 -0
  148. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +30 -0
  149. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +79 -0
  150. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +34 -0
  151. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +31 -0
  152. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +30 -0
  153. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +31 -0
  154. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +30 -0
  155. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +30 -0
  156. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +34 -0
  157. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +39 -0
  158. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +39 -0
  159. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +35 -0
  160. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +30 -0
  161. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +30 -0
  162. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +31 -0
  163. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +45 -0
  164. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +41 -0
  165. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +45 -0
  166. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +35 -0
  167. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +30 -0
  168. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +30 -0
  169. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +30 -0
  170. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +30 -0
  171. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +30 -0
  172. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +35 -0
  173. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +30 -0
  174. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +46 -0
  175. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +36 -0
  176. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +38 -0
  177. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +30 -0
  178. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +30 -0
  179. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +30 -0
  180. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +30 -0
  181. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +30 -0
  182. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +34 -0
  183. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +9 -0
  184. package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +43 -0
  185. package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +75 -0
  186. package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +30 -0
  187. package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +31 -0
  188. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +50 -0
  189. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +50 -0
  190. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +254 -0
  191. package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +28 -0
  192. package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +60 -0
  193. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +77 -0
  194. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +31 -0
  195. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +30 -0
  196. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +80 -0
  197. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +16 -0
  198. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +16 -0
  199. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +16 -0
  200. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +16 -0
  201. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +16 -0
  202. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +16 -0
  203. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +16 -0
  204. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +16 -0
  205. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +28 -0
  206. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +157 -0
  207. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +7 -0
  208. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +30 -0
  209. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +34 -0
  210. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +41 -0
  211. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +85 -0
  212. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +109 -0
  213. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +161 -0
  214. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +137 -0
  215. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +30 -0
  216. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +30 -0
  217. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +34 -0
  218. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +34 -0
  219. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +34 -0
  220. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +30 -0
  221. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +34 -0
  222. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +30 -0
  223. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +37 -0
  224. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +40 -0
  225. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +33 -0
  226. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +30 -0
  227. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +43 -0
  228. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +47 -0
  229. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +77 -0
  230. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +30 -0
  231. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +31 -0
  232. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +39 -0
  233. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +30 -0
  234. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +43 -0
  235. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +30 -0
  236. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +37 -0
  237. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +31 -0
  238. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +38 -0
  239. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +17 -0
  240. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +91 -0
  241. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +34 -0
  242. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +30 -0
  243. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +37 -0
  244. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +30 -0
  245. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +34 -0
  246. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +30 -0
  247. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +34 -0
  248. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +38 -0
  249. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +34 -0
  250. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +13 -0
  251. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +32 -0
  252. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +38 -0
  253. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +30 -0
  254. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +52 -0
  255. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +47 -0
  256. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +34 -0
  257. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +9 -0
  258. package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +28 -0
  259. package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +17 -0
  260. package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
  261. package/plugins/nikic/php-parser/lib/PhpParser/Node.php +151 -0
  262. package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +178 -0
  263. package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +206 -0
  264. package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +81 -0
  265. package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +291 -0
  266. package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +29 -0
  267. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +20 -0
  268. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +48 -0
  269. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +50 -0
  270. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +260 -0
  271. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +52 -0
  272. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +41 -0
  273. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +72 -0
  274. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +25 -0
  275. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +55 -0
  276. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +2682 -0
  277. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2898 -0
  278. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +148 -0
  279. package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +18 -0
  280. package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +1060 -0
  281. package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +76 -0
  282. package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +1126 -0
  283. package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +1576 -0
  284. package/utils.mjs +10 -0
  285. package/plugins/lib/io.appthreat.atom-1.8.0-classpath.jar +0 -0
@@ -0,0 +1,178 @@
1
+ <?php declare(strict_types=1);
2
+
3
+ namespace PhpParser;
4
+
5
+ abstract class NodeAbstract implements Node, \JsonSerializable
6
+ {
7
+ protected $attributes;
8
+
9
+ /**
10
+ * Creates a Node.
11
+ *
12
+ * @param array $attributes Array of attributes
13
+ */
14
+ public function __construct(array $attributes = []) {
15
+ $this->attributes = $attributes;
16
+ }
17
+
18
+ /**
19
+ * Gets line the node started in (alias of getStartLine).
20
+ *
21
+ * @return int Start line (or -1 if not available)
22
+ */
23
+ public function getLine() : int {
24
+ return $this->attributes['startLine'] ?? -1;
25
+ }
26
+
27
+ /**
28
+ * Gets line the node started in.
29
+ *
30
+ * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
31
+ *
32
+ * @return int Start line (or -1 if not available)
33
+ */
34
+ public function getStartLine() : int {
35
+ return $this->attributes['startLine'] ?? -1;
36
+ }
37
+
38
+ /**
39
+ * Gets the line the node ended in.
40
+ *
41
+ * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
42
+ *
43
+ * @return int End line (or -1 if not available)
44
+ */
45
+ public function getEndLine() : int {
46
+ return $this->attributes['endLine'] ?? -1;
47
+ }
48
+
49
+ /**
50
+ * Gets the token offset of the first token that is part of this node.
51
+ *
52
+ * The offset is an index into the array returned by Lexer::getTokens().
53
+ *
54
+ * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
55
+ *
56
+ * @return int Token start position (or -1 if not available)
57
+ */
58
+ public function getStartTokenPos() : int {
59
+ return $this->attributes['startTokenPos'] ?? -1;
60
+ }
61
+
62
+ /**
63
+ * Gets the token offset of the last token that is part of this node.
64
+ *
65
+ * The offset is an index into the array returned by Lexer::getTokens().
66
+ *
67
+ * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
68
+ *
69
+ * @return int Token end position (or -1 if not available)
70
+ */
71
+ public function getEndTokenPos() : int {
72
+ return $this->attributes['endTokenPos'] ?? -1;
73
+ }
74
+
75
+ /**
76
+ * Gets the file offset of the first character that is part of this node.
77
+ *
78
+ * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
79
+ *
80
+ * @return int File start position (or -1 if not available)
81
+ */
82
+ public function getStartFilePos() : int {
83
+ return $this->attributes['startFilePos'] ?? -1;
84
+ }
85
+
86
+ /**
87
+ * Gets the file offset of the last character that is part of this node.
88
+ *
89
+ * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
90
+ *
91
+ * @return int File end position (or -1 if not available)
92
+ */
93
+ public function getEndFilePos() : int {
94
+ return $this->attributes['endFilePos'] ?? -1;
95
+ }
96
+
97
+ /**
98
+ * Gets all comments directly preceding this node.
99
+ *
100
+ * The comments are also available through the "comments" attribute.
101
+ *
102
+ * @return Comment[]
103
+ */
104
+ public function getComments() : array {
105
+ return $this->attributes['comments'] ?? [];
106
+ }
107
+
108
+ /**
109
+ * Gets the doc comment of the node.
110
+ *
111
+ * @return null|Comment\Doc Doc comment object or null
112
+ */
113
+ public function getDocComment() {
114
+ $comments = $this->getComments();
115
+ for ($i = count($comments) - 1; $i >= 0; $i--) {
116
+ $comment = $comments[$i];
117
+ if ($comment instanceof Comment\Doc) {
118
+ return $comment;
119
+ }
120
+ }
121
+
122
+ return null;
123
+ }
124
+
125
+ /**
126
+ * Sets the doc comment of the node.
127
+ *
128
+ * This will either replace an existing doc comment or add it to the comments array.
129
+ *
130
+ * @param Comment\Doc $docComment Doc comment to set
131
+ */
132
+ public function setDocComment(Comment\Doc $docComment) {
133
+ $comments = $this->getComments();
134
+ for ($i = count($comments) - 1; $i >= 0; $i--) {
135
+ if ($comments[$i] instanceof Comment\Doc) {
136
+ // Replace existing doc comment.
137
+ $comments[$i] = $docComment;
138
+ $this->setAttribute('comments', $comments);
139
+ return;
140
+ }
141
+ }
142
+
143
+ // Append new doc comment.
144
+ $comments[] = $docComment;
145
+ $this->setAttribute('comments', $comments);
146
+ }
147
+
148
+ public function setAttribute(string $key, $value) {
149
+ $this->attributes[$key] = $value;
150
+ }
151
+
152
+ public function hasAttribute(string $key) : bool {
153
+ return array_key_exists($key, $this->attributes);
154
+ }
155
+
156
+ public function getAttribute(string $key, $default = null) {
157
+ if (array_key_exists($key, $this->attributes)) {
158
+ return $this->attributes[$key];
159
+ }
160
+
161
+ return $default;
162
+ }
163
+
164
+ public function getAttributes() : array {
165
+ return $this->attributes;
166
+ }
167
+
168
+ public function setAttributes(array $attributes) {
169
+ $this->attributes = $attributes;
170
+ }
171
+
172
+ /**
173
+ * @return array
174
+ */
175
+ public function jsonSerialize() : array {
176
+ return ['nodeType' => $this->getType()] + get_object_vars($this);
177
+ }
178
+ }
@@ -0,0 +1,206 @@
1
+ <?php declare(strict_types=1);
2
+
3
+ namespace PhpParser;
4
+
5
+ use PhpParser\Node\Expr\Include_;
6
+ use PhpParser\Node\Stmt\Class_;
7
+ use PhpParser\Node\Stmt\GroupUse;
8
+ use PhpParser\Node\Stmt\Use_;
9
+ use PhpParser\Node\Stmt\UseUse;
10
+
11
+ class NodeDumper
12
+ {
13
+ private $dumpComments;
14
+ private $dumpPositions;
15
+ private $code;
16
+
17
+ /**
18
+ * Constructs a NodeDumper.
19
+ *
20
+ * Supported options:
21
+ * * bool dumpComments: Whether comments should be dumped.
22
+ * * bool dumpPositions: Whether line/offset information should be dumped. To dump offset
23
+ * information, the code needs to be passed to dump().
24
+ *
25
+ * @param array $options Options (see description)
26
+ */
27
+ public function __construct(array $options = []) {
28
+ $this->dumpComments = !empty($options['dumpComments']);
29
+ $this->dumpPositions = !empty($options['dumpPositions']);
30
+ }
31
+
32
+ /**
33
+ * Dumps a node or array.
34
+ *
35
+ * @param array|Node $node Node or array to dump
36
+ * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if
37
+ * the dumpPositions option is enabled and the dumping of node offsets
38
+ * is desired.
39
+ *
40
+ * @return string Dumped value
41
+ */
42
+ public function dump($node, string $code = null) : string {
43
+ $this->code = $code;
44
+ return $this->dumpRecursive($node);
45
+ }
46
+
47
+ protected function dumpRecursive($node) {
48
+ if ($node instanceof Node) {
49
+ $r = $node->getType();
50
+ if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) {
51
+ $r .= $p;
52
+ }
53
+ $r .= '(';
54
+
55
+ foreach ($node->getSubNodeNames() as $key) {
56
+ $r .= "\n " . $key . ': ';
57
+
58
+ $value = $node->$key;
59
+ if (null === $value) {
60
+ $r .= 'null';
61
+ } elseif (false === $value) {
62
+ $r .= 'false';
63
+ } elseif (true === $value) {
64
+ $r .= 'true';
65
+ } elseif (is_scalar($value)) {
66
+ if ('flags' === $key || 'newModifier' === $key) {
67
+ $r .= $this->dumpFlags($value);
68
+ } elseif ('type' === $key && $node instanceof Include_) {
69
+ $r .= $this->dumpIncludeType($value);
70
+ } elseif ('type' === $key
71
+ && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) {
72
+ $r .= $this->dumpUseType($value);
73
+ } else {
74
+ $r .= $value;
75
+ }
76
+ } else {
77
+ $r .= str_replace("\n", "\n ", $this->dumpRecursive($value));
78
+ }
79
+ }
80
+
81
+ if ($this->dumpComments && $comments = $node->getComments()) {
82
+ $r .= "\n comments: " . str_replace("\n", "\n ", $this->dumpRecursive($comments));
83
+ }
84
+ } elseif (is_array($node)) {
85
+ $r = 'array(';
86
+
87
+ foreach ($node as $key => $value) {
88
+ $r .= "\n " . $key . ': ';
89
+
90
+ if (null === $value) {
91
+ $r .= 'null';
92
+ } elseif (false === $value) {
93
+ $r .= 'false';
94
+ } elseif (true === $value) {
95
+ $r .= 'true';
96
+ } elseif (is_scalar($value)) {
97
+ $r .= $value;
98
+ } else {
99
+ $r .= str_replace("\n", "\n ", $this->dumpRecursive($value));
100
+ }
101
+ }
102
+ } elseif ($node instanceof Comment) {
103
+ return $node->getReformattedText();
104
+ } else {
105
+ throw new \InvalidArgumentException('Can only dump nodes and arrays.');
106
+ }
107
+
108
+ return $r . "\n)";
109
+ }
110
+
111
+ protected function dumpFlags($flags) {
112
+ $strs = [];
113
+ if ($flags & Class_::MODIFIER_PUBLIC) {
114
+ $strs[] = 'MODIFIER_PUBLIC';
115
+ }
116
+ if ($flags & Class_::MODIFIER_PROTECTED) {
117
+ $strs[] = 'MODIFIER_PROTECTED';
118
+ }
119
+ if ($flags & Class_::MODIFIER_PRIVATE) {
120
+ $strs[] = 'MODIFIER_PRIVATE';
121
+ }
122
+ if ($flags & Class_::MODIFIER_ABSTRACT) {
123
+ $strs[] = 'MODIFIER_ABSTRACT';
124
+ }
125
+ if ($flags & Class_::MODIFIER_STATIC) {
126
+ $strs[] = 'MODIFIER_STATIC';
127
+ }
128
+ if ($flags & Class_::MODIFIER_FINAL) {
129
+ $strs[] = 'MODIFIER_FINAL';
130
+ }
131
+ if ($flags & Class_::MODIFIER_READONLY) {
132
+ $strs[] = 'MODIFIER_READONLY';
133
+ }
134
+
135
+ if ($strs) {
136
+ return implode(' | ', $strs) . ' (' . $flags . ')';
137
+ } else {
138
+ return $flags;
139
+ }
140
+ }
141
+
142
+ protected function dumpIncludeType($type) {
143
+ $map = [
144
+ Include_::TYPE_INCLUDE => 'TYPE_INCLUDE',
145
+ Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE',
146
+ Include_::TYPE_REQUIRE => 'TYPE_REQUIRE',
147
+ Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE',
148
+ ];
149
+
150
+ if (!isset($map[$type])) {
151
+ return $type;
152
+ }
153
+ return $map[$type] . ' (' . $type . ')';
154
+ }
155
+
156
+ protected function dumpUseType($type) {
157
+ $map = [
158
+ Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
159
+ Use_::TYPE_NORMAL => 'TYPE_NORMAL',
160
+ Use_::TYPE_FUNCTION => 'TYPE_FUNCTION',
161
+ Use_::TYPE_CONSTANT => 'TYPE_CONSTANT',
162
+ ];
163
+
164
+ if (!isset($map[$type])) {
165
+ return $type;
166
+ }
167
+ return $map[$type] . ' (' . $type . ')';
168
+ }
169
+
170
+ /**
171
+ * Dump node position, if possible.
172
+ *
173
+ * @param Node $node Node for which to dump position
174
+ *
175
+ * @return string|null Dump of position, or null if position information not available
176
+ */
177
+ protected function dumpPosition(Node $node) {
178
+ if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) {
179
+ return null;
180
+ }
181
+
182
+ $start = $node->getStartLine();
183
+ $end = $node->getEndLine();
184
+ if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos')
185
+ && null !== $this->code
186
+ ) {
187
+ $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos());
188
+ $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos());
189
+ }
190
+ return "[$start - $end]";
191
+ }
192
+
193
+ // Copied from Error class
194
+ private function toColumn($code, $pos) {
195
+ if ($pos > strlen($code)) {
196
+ throw new \RuntimeException('Invalid position information');
197
+ }
198
+
199
+ $lineStartPos = strrpos($code, "\n", $pos - strlen($code));
200
+ if (false === $lineStartPos) {
201
+ $lineStartPos = -1;
202
+ }
203
+
204
+ return $pos - $lineStartPos;
205
+ }
206
+ }
@@ -0,0 +1,81 @@
1
+ <?php declare(strict_types=1);
2
+
3
+ namespace PhpParser;
4
+
5
+ use PhpParser\NodeVisitor\FindingVisitor;
6
+ use PhpParser\NodeVisitor\FirstFindingVisitor;
7
+
8
+ class NodeFinder
9
+ {
10
+ /**
11
+ * Find all nodes satisfying a filter callback.
12
+ *
13
+ * @param Node|Node[] $nodes Single node or array of nodes to search in
14
+ * @param callable $filter Filter callback: function(Node $node) : bool
15
+ *
16
+ * @return Node[] Found nodes satisfying the filter callback
17
+ */
18
+ public function find($nodes, callable $filter) : array {
19
+ if (!is_array($nodes)) {
20
+ $nodes = [$nodes];
21
+ }
22
+
23
+ $visitor = new FindingVisitor($filter);
24
+
25
+ $traverser = new NodeTraverser;
26
+ $traverser->addVisitor($visitor);
27
+ $traverser->traverse($nodes);
28
+
29
+ return $visitor->getFoundNodes();
30
+ }
31
+
32
+ /**
33
+ * Find all nodes that are instances of a certain class.
34
+ *
35
+ * @param Node|Node[] $nodes Single node or array of nodes to search in
36
+ * @param string $class Class name
37
+ *
38
+ * @return Node[] Found nodes (all instances of $class)
39
+ */
40
+ public function findInstanceOf($nodes, string $class) : array {
41
+ return $this->find($nodes, function ($node) use ($class) {
42
+ return $node instanceof $class;
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Find first node satisfying a filter callback.
48
+ *
49
+ * @param Node|Node[] $nodes Single node or array of nodes to search in
50
+ * @param callable $filter Filter callback: function(Node $node) : bool
51
+ *
52
+ * @return null|Node Found node (or null if none found)
53
+ */
54
+ public function findFirst($nodes, callable $filter) {
55
+ if (!is_array($nodes)) {
56
+ $nodes = [$nodes];
57
+ }
58
+
59
+ $visitor = new FirstFindingVisitor($filter);
60
+
61
+ $traverser = new NodeTraverser;
62
+ $traverser->addVisitor($visitor);
63
+ $traverser->traverse($nodes);
64
+
65
+ return $visitor->getFoundNode();
66
+ }
67
+
68
+ /**
69
+ * Find first node that is an instance of a certain class.
70
+ *
71
+ * @param Node|Node[] $nodes Single node or array of nodes to search in
72
+ * @param string $class Class name
73
+ *
74
+ * @return null|Node Found node, which is an instance of $class (or null if none found)
75
+ */
76
+ public function findFirstInstanceOf($nodes, string $class) {
77
+ return $this->findFirst($nodes, function ($node) use ($class) {
78
+ return $node instanceof $class;
79
+ });
80
+ }
81
+ }