#!/usr/bin/env php
<?php

/*
 * Generated by Humbug Box 4.3.8@5534406.
 *
 * @link https://github.com/humbug/box
 */

Phar::mapPhar('box-auto-generated-alias-bf813089c051.phar');

require 'phar://box-auto-generated-alias-bf813089c051.phar/.box/bin/check-requirements.php';

require 'phar://box-auto-generated-alias-bf813089c051.phar/bin/cv';

__HALT_COMPILER(); ?>
Uö                   .box/bin/check-requirements.phpú  «F eú  �MÔÚ¤         .box/.requirements.php  «F e  ïJ]ë¤         .box/vendor/autoload.phpï  «F eï  .ó¸´¤      ,   .box/vendor/composer/autoload_namespaces.php‹   «F e‹   Š/t¤         .box/vendor/composer/LICENSE.  «F e.   Õ¤      $   .box/vendor/composer/ClassLoader.php�@  «F e�@  >]×¤      &   .box/vendor/composer/autoload_psr4.php*  «F e*  ÄG)¤      *   .box/vendor/composer/autoload_classmap.php’
  «F e’
   =rë¤      (   .box/vendor/composer/autoload_static.phpu  «F eu  sgÇf¤      &   .box/vendor/composer/autoload_real.php   «F e   ïƒ ¤      #   .box/vendor/composer/semver/LICENSE  «F e  Bhí¤      4   .box/vendor/composer/semver/src/CompilingMatcher.phpÉ  «F eÉ  ¢‘´¤      ,   .box/vendor/composer/semver/src/Interval.phpÎ  «F eÎ  "à(l¤      .   .box/vendor/composer/semver/src/Comparator.php•  «F e•  ÓP_2¤      -   .box/vendor/composer/semver/src/Intervals.phpþ9  «F eþ9  –TÅ@¤      *   .box/vendor/composer/semver/src/Semver.php‚  «F e‚  Å!ä¡¤      1   .box/vendor/composer/semver/src/VersionParser.php1;  «F e1;  6¶ v¤      B   .box/vendor/composer/semver/src/Constraint/ConstraintInterface.php¯  «F e¯  tê$¤      >   .box/vendor/composer/semver/src/Constraint/MultiConstraint.phpX  «F eX  mt$õ¤      9   .box/vendor/composer/semver/src/Constraint/Constraint.phpì&  «F eì&  Sho¤      A   .box/vendor/composer/semver/src/Constraint/MatchAllConstraint.php;  «F e;  J€,È¤      B   .box/vendor/composer/semver/src/Constraint/MatchNoneConstraint.phpY  «F eY  °ÌÒ¤      4   .box/vendor/composer/semver/src/Constraint/Bound.phpn  «F en  ÈåÏ¤      *   .box/vendor/composer/InstalledVersions.phpi  «F ei  V±Ê4¤      "   .box/vendor/composer/installed.phpÀ3  «F eÀ3  KÂ‹¤         .box/src/Terminal.php9  «F e9  hLƒr¤         .box/src/IO.php£  «F e£  cŸb¤      !   .box/src/IsExtensionFulfilled.php»  «F e»  Ç#ì¼¤         .box/src/Checker.php  «F e  N(j£¤      "   .box/src/IsPhpVersionFulfilled.php‹  «F e‹  Ê_×é¤      "   .box/src/RequirementCollection.phpþ  «F eþ  iä…g¤      )   .box/src/IsExtensionConflictFulfilled.phpÍ  «F eÍ  ¼�]¤         .box/src/Printer.php¾  «F e¾  +î¤         .box/src/IsFulfilled.php–   «F e–   R§‚¤         .box/src/Requirement.php¿  «F e¿  m%Z¤         bin/cvÅ  «F eÅ  Q\S¤         lib/src/Util/Filesystem.phpø	  «F eø	   ØŽ¤          lib/src/Util/FilesystemTrait.phpL  «F eL  #DwÁ¤         lib/src/Util/BootTrait.phpµ  «F eµ  “ƒ°æ¤         lib/src/CmsBootstrap.phpO:  «F eO:  î€zŽ¤         lib/src/SiteConfigReader.php  «F e  =Ó=æ¤         lib/src/Bootstrap.phpÞ/  «F eÞ/  BÝáZ¤         lib/src/Config.phpß  «F eß  O‡’O¤         lib/src/BuildkitReader.php  «F e  Ÿ�E„¤         lib/src/Log/Logger.php¤  «F e¤  Ö±žr¤      $   lib/src/Log/SymfonyConsoleLogger.php@  «F e@  ¶›d¤         lib/src/Log/InternalLogger.phpŽ	  «F eŽ	  —aÅ`¤         lib/src/Log/StderrLogger.php.  «F e.  á¤3-¤      #   lib/src/PharOut/PharPolicyTrait.php¹  «F e¹  Ià}Ñ¤         lib/src/PharOut/PharOut.php(  «F e(  ·dùß¤         lib/src/ErrorHandler.phpÊ	  «F eÊ	  <GGK¤         vendor/autoload.php   «F e   ‰@é8¤      G   vendor/lesser-evil/shell-verbosity-is-evil/src/ShellVerbosityIsEvil.php  «F e  Tƒú¤      ,   vendor/nikic/php-parser/grammar/phpyLang.php½  «F e½  Z&çi¤      2   vendor/nikic/php-parser/grammar/rebuildParsers.phpú  «F eú  #»ëª¤      5   vendor/nikic/php-parser/lib/PhpParser/NameContext.phpÊ  «F eÊ  |ú}¤      =   vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php¬  «F e¬  z‘ÎÁ¤      5   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php  «F e  åv
	¤      8   vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php  «F e  Ê8&´¤      D   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php  «F e  žž¾-¤      B   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php“   «F e“   � s¤      I   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.phpd  «F ed  ‡æ¿Ò¤      D   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.phpi  «F ei  ?ˆêÎ¤      M   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php�  «F e�  Yýåx¤      K   vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.phpÀ  «F eÀ  0ª�7¤      0   vendor/nikic/php-parser/lib/PhpParser/Parser.phpŸ   «F eŸ   Ñï¢©¤      F   vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php^   «F e^   †ô1­¤      9   vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.phpô  «F eô  Úa�®¤      O   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php<  «F e<  Y˜ö”¤      M   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php{  «F e{  D…5~¤      S   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.phpV  «F eV  ç†ª¤      S   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php"  «F e"  näÖ	¤      [   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php+  «F e+  mEK¤      M   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.phpƒ  «F eƒ  �K¸0¤      O   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php©  «F e©  7®Sé¤      ]   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php
  «F e
  %:¼¤      W   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php  «F e  z�Ê
¤      M   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php«  «F e«  ”ðÛª¤      W   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.phpW  «F eW  ”ß[ä¤      S   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.phpí  «F eí  ùË¾Æ¤      K   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.phpù  «F eù   J¤      P   vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php´  «F e´  Tµ Q¤      5   vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.phpv   «F ev   (�B ¤      @   vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.phpb�  «F eb�  
•—Ž¤      1   vendor/nikic/php-parser/lib/PhpParser/Builder.phpz   «F ez   …"Pe¤      <   vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.phpV  «F eV  i®¤      ;   vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.phpŒ  «F eŒ  �Iµ#¤      9   vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.phpâ  «F eâ  ·EÖ¤      L   vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php   «F e   ˆ\ä¤      >   vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.phpŒ  «F eŒ  Ç$×Ú¤      4   vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php^  «F e^  `ê‘Ÿ¤      8   vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.phpo  «F eo  k“¤w¤      7   vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php=  «F e=  ºìÉõ¤      7   vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.phpö  «F eö  @ÜL¤      9   vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.phpâ  «F eâ  ®½1¤      5   vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php1L «F e1L ôÀ¤      5   vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.phpb* «F eb* Óu’¤      6   vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.phpu
  «F eu
  >0ot¤      .   vendor/nikic/php-parser/lib/PhpParser/Node.phpm  «F em  B Æ¤      ?   vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php  «F e  +•óÅ¤      A   vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php"  «F e"  c<ñ¤      5   vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php»  «F e»  ÛÑ‹9¤      /   vendor/nikic/php-parser/lib/PhpParser/Error.phpC  «F eC  ýôi¤      1   vendor/nikic/php-parser/lib/PhpParser/Comment.php£  «F e£  ¯ÅSÄ¤      /   vendor/nikic/php-parser/lib/PhpParser/Lexer.phpÄ>  «F eÄ>  ‘p·¤      6   vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.phpˆ   «F eˆ   Âõ}¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.phpã  «F eã  áµ*Ò¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.phpß  «F eß  ìC¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php‹  «F e‹  ùR¯´¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.phpÔ  «F eÔ  7Â)S¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.phpf  «F ef  h¹gh¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.phpM  «F eM  ´‹If¤      Q   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.phpÐ  «F eÐ  Z-{
¤      L   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.phpD  «F eD  Î°Ê¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php“  «F e“  CÂÿ¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php  «F e  Ö{¦ª¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.phpÖ  «F eÖ  !Tv¤      D   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.phpw  «F ew  -}‰¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php  «F e  7tØ¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.phpZ  «F eZ  É¢-¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php  «F e  Z&ö±¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.phpÞ  «F eÞ  ˜�¤ß¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php�  «F e�  žæêS¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.phpÒ  «F eÒ  ðÓ+L¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.phpÂ   «F eÂ   3
P¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.phpà  «F eà  °°$¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.phpá  «F eá  a£sÙ¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.phpÚ  «F eÚ  '§yÔ¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php$  «F e$  æÄë¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.phpù  «F eù  �ÖÒO¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.phpT  «F eT  �tZæ¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php  «F e  ²gƒh¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.phpÔ  «F eÔ  æÉš·¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.phpß  «F eß  ã´Q¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.phpŒ  «F eŒ  5Æ	¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.phpÕ  «F eÕ  ^wÛx¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php:  «F e:  � ¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.phpè  «F eè  +…"¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.phpØ  «F eØ  kSè ¤      7   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.phpÓ  «F eÓ  ît'>¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.phpÜ  «F eÜ  ~3”¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php)  «F e)  ˜£‡Ô¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php!  «F e!  ô—í¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php=  «F e=  e.fú¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.phpÈ  «F eÈ  eqÐ¡¤      7   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php  «F e  œãQ¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.phpš  «F eš  FÚ^†¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.phpÁ  «F eÁ  G�­¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php•  «F e•  3R¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.phpá  «F eá  êê–«¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.phpŸ  «F eŸ  Ë¤R¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php&  «F e&  VÄ ©¤      7   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php  «F e  vô#E¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php„  «F e„  ÖêÈl¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.phpG  «F eG  ë:Ú¤      7   vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php:  «F e:  ®?N¹¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.phpâ  «F eâ  ®ñôè¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.phpÈ  «F eÈ  n’¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.phpš   «F eš   ØÞ	¤      4   vendor/nikic/php-parser/lib/PhpParser/Node/Param.phpô  «F eô  É9Íw¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php=  «F e=  7¸l÷¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php  «F e  /*¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.phpÕ  «F eÕ  ÞÊŸ¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.phpÞ  «F eÞ  IÑ¨5¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.phpú  «F eú  ÝÆ#¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.phpˆ  «F eˆ  iu¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php‘  «F e‘  _¥×Q¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.phpª  «F eª  6"Pl¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.phpÑ  «F eÑ  “ûÆA¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.phpÑ  «F eÑ  økèø¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.phpÍ  «F eÍ  �t§U¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.phpq  «F eq  ìðÄ‰¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.phpØ  «F eØ  PÌÉ¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.phpT  «F eT  àJˆ<¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.phpá   «F eá   Ê3Û©¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.phpç   «F eç   ÚB�Ê¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php4  «F e4  Ý9•¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.phpç   «F eç   ×_Ë5¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.phpå   «F eå   áÍé¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.phpã   «F eã   C¹(¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.phpå   «F eå   _;¬¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.phpÖ  «F eÖ  I#¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.phpÏ  «F eÏ  õ€�¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.phpÚ  «F eÚ  ÃÔŸÏ¤      C   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php”  «F e”  äÉh�¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.phpÚ  «F eÚ  BÓÈ¥¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.phpà  «F eà  È–�õ¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php*  «F e*  7úY¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.phpÏ  «F eÏ  'ëøe¤      I   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php{  «F e{  eùß¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php   «F e   ÌDŠ¥¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php‹  «F e‹  l…þ~¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.phpQ  «F eQ  ™Ð×¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.phpk  «F ek  þvFð¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.phpò   «F eò   ³Ïo0¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.phpþ   «F eþ   ëåDi¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.phpð   «F eð   ¶g¤÷¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.phpð   «F eð   Ä¤¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.phpü   «F eü   2˜ÎË¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.phpô   «F eô   +Ú·Ä¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.phpð   «F eð   ÑGg«¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.phpð   «F eð   €¾{Ò¤      C   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.phpö   «F eö   «l¹E¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.phpü   «F eü   k›ýÎ¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.phpþ   «F eþ   ôƒ¡u¤      E   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.phpú   «F eú   +»Û¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.phpþ   «F eþ   mÛÃš¤      A   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.phpB  «F eB  �¹À¤      D   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.phpH  «F eH  ´(i�¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.phpM  «F eM  5M<á¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.phpN  «F eN   õ¤      D   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.phpH  «F eH   £yÃ¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.phpO  «F eO  ÈÀç(¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.phpM  «F eM  ê•0«¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.phpP  «F eP  ¾SÓ¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.phpE  «F eE  Ù‹Þ ¤      I   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.phpT  «F eT  xË&Œ¤      K   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.phpW  «F eW  qüP¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.phpO  «F eO  µYƒò¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php@  «F e@  9·ëN¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.phpP  «F eP  ßÌ¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php@  «F e@  Äßô¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.phpL  «F eL  Í|>¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.phpD  «F eD  ÉÒ~¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.phpN  «F eN  aÛ#¤      K   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.phpW  «F eW  É¬'o¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.phpA  «F eA  4r›¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php@  «F e@  ,LÞp¤      C   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.phpF  «F eF  †¥Gv¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.phpM  «F eM  €8²0¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.phpN  «F eN  =»kæ¤      E   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.phpK  «F eK  …�Š¤      E   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.phpK  «F eK  =A®	¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.phpN  «F eN  u*¾¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php  «F e  ‘‰ë¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.phpÏ  «F eÏ  OÑWp¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php�  «F e�  `¸ð¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.phpØ  «F eØ  êâK¾¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.phpK  «F eK  /%z¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.phpÑ  «F eÑ  �3õ¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.phpÔ  «F eÔ  §!©¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php"  «F e"  	ªÅS¤      9   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php  «F e   µMN¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.phpÊ  «F eÊ  8¬lÆ¤      F   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.phpa  «F ea  (züV¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php>  «F e>  ±}‰Y¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.phpŠ  «F eŠ  û¤:¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.phpÚ  «F eÚ  ã_ë‹¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.phpÑ  «F eÑ  Y3â0¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.phpÍ  «F eÍ  Û1¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.phpC  «F eC  ö"ù‡¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.phpÉ  «F eÉ  ÆSÚ¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php  «F e  »Ú1Š¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php  «F e  ™¤      :   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.phpÒ  «F eÒ  ªùÀ”¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php/  «F e/  Ò�ˆ¶¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php  «F e  `™ ¤      3   vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php“   «F e“    ®eØ¤      5   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.phpj   «F ej   ^ßU¤      8   vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php»  «F e»  Š=_'¤      5   vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php]  «F e]  ºÍå£¤      ;   vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.phpL  «F eL  ˜YŸ<¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php¬  «F e¬  bN¢¤      <   vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.phpq  «F eq  ¾äºü¤      B   vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.phpt  «F et  Ê3Ÿ�¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.phpÉ   «F eÉ   frw¤      ?   vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.phpì  «F eì  fê°¦¤      3   vendor/nikic/php-parser/lib/PhpParser/Node/Name.php�  «F e�  a÷:÷¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.phpÒ  «F eÒ  ÄŸÿ¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.phpö  «F eö  Z˜Œq¤      K   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php^  «F e^  V˜,{¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.phpR  «F eR  ÷‚¼¤      D   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.phpK  «F eK  Óø{¤      E   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.phpN  «F eN  �…©+¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.phpT  «F eT  (Ç¤      J   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php[  «F e[  ÉG¤      E   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.phpN  «F eN  á¹ŸÏ¤      G   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.phpR  «F eR  gH€¤      @   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php„  «F e„  dÔsÜ¤      =   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php�  «F e�  ¦ng�¤      H   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.phpù  «F eù  E[>˜¤      >   vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php  «F e  ×Ã!Ã¤      3   vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php“   «F e“   w²u¤      2   vendor/nikic/php-parser/lib/PhpParser/Node/Arg.phpø  «F eø  õ>ºè¤      4   vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php  «F e  ÞÊŒó¤      7   vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.phpŸ  «F eŸ  É¿S3¤      :   vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.phpU  «F eU  �ÇWÆ¤      <   vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.phpŸ  «F eŸ  z¯¤      :   vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.phpþ  «F eþ  Ä¨=3¤      8   vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.phpÌ	  «F eÌ	  §h	´¤      7   vendor/nikic/php-parser/lib/PhpParser/Builder/Param.phpº  «F eº  �•ÉH¤      D   vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php4  «F e4  ôˆé¤      8   vendor/nikic/php-parser/lib/PhpParser/Builder/Method.phpÿ  «F eÿ  Ãff\¤      <   vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php0  «F e0  ßäH¤      :   vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php	  «F e	  ‘Üþê¤      =   vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.phpU  «F eU  ·ë¿Q¤      ;   vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.phpË  «F eË  l VÇ¤      6   vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.phpµ  «F eµ  £»ä¤      >   vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.phpû  «F eû  Wxü¤      <   vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php|  «F e|  ^9Ç—¤      8   vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php]  «F e]  …§²Õ¤      7   vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.phpÙ  «F eÙ  îZhn¤      ?   vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.phpœ›  «F eœ›  Óí¼$¤      @   vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php  «F e  «Ê7œ¤      8   vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php9  «F e9  F–µ\¤      '   vendor/composer/autoload_namespaces.php‹   «F e‹   Š/t¤         vendor/composer/LICENSE.  «F e.   Õ¤         vendor/composer/ClassLoader.phpÄ>  «F eÄ>  Æ5Ky¤      !   vendor/composer/autoload_psr4.phpR  «F eR  …?·¹¤      %   vendor/composer/autoload_classmap.phpáU «F eáU lT|H¤      "   vendor/composer/platform_check.php�  «F e�  äÍ%¾¤      #   vendor/composer/autoload_static.phpj€ «F ej€ kùí¤      !   vendor/composer/autoload_real.phpû  «F eû  ^þŸ\¤      "   vendor/composer/autoload_files.phpk  «F ek  Þû“¤      %   vendor/composer/InstalledVersions.phpQ  «F eQ  u¸¬¤         vendor/composer/installed.phpù  «F eù  »–f¤      "   vendor/psy/psysh/src/functions.php²1  «F e²1  d¢k!¤      )   vendor/psy/psysh/src/ExecutionClosure.phpN  «F eN  [óÞ¤      $   vendor/psy/psysh/src/ConfigPaths.phpÍ  «F eÍ  R0±š¤      7   vendor/psy/psysh/src/VersionUpdater/IntervalChecker.phpü  «F eü  pÕB
¤      3   vendor/psy/psysh/src/VersionUpdater/NoopChecker.php  «F e  ¹J`ª¤      /   vendor/psy/psysh/src/VersionUpdater/Checker.php#  «F e#  ”sËø¤      :   vendor/psy/psysh/src/VersionUpdater/Downloader/Factory.phpÕ  «F eÕ  ÑïŠ¤      A   vendor/psy/psysh/src/VersionUpdater/Downloader/CurlDownloader.phpŒ  «F eŒ  l¿åƒ¤      A   vendor/psy/psysh/src/VersionUpdater/Downloader/FileDownloader.phpÜ  «F eÜ  —Å†¤      5   vendor/psy/psysh/src/VersionUpdater/GitHubChecker.php^  «F e^  NÆ	C¤      2   vendor/psy/psysh/src/VersionUpdater/Downloader.php  «F e  jUt¤      2   vendor/psy/psysh/src/VersionUpdater/SelfUpdate.php%  «F e%  áò>i¤      1   vendor/psy/psysh/src/VersionUpdater/Installer.php>	  «F e>	  åUs¤      4   vendor/psy/psysh/src/TabCompletion/AutoCompleter.php$  «F e$  ½ÕÇš¤      F   vendor/psy/psysh/src/TabCompletion/Matcher/ObjectAttributesMatcher.php\  «F e\  âŸé¦¤      O   vendor/psy/psysh/src/TabCompletion/Matcher/FunctionDefaultParametersMatcher.phpï  «F eï  { *¤      J   vendor/psy/psysh/src/TabCompletion/Matcher/AbstractContextAwareMatcher.php	  «F e	  Èô¥û¤      >   vendor/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php4  «F e4  êòK¤      E   vendor/psy/psysh/src/TabCompletion/Matcher/ClassAttributesMatcher.phpæ  «F eæ  Dm�¤      @   vendor/psy/psysh/src/TabCompletion/Matcher/ClassNamesMatcher.phpØ  «F eØ   (ê¤      ?   vendor/psy/psysh/src/TabCompletion/Matcher/ConstantsMatcher.php—  «F e—  #,\&¤      B   vendor/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php{  «F e{  haìû¤      O   vendor/psy/psysh/src/TabCompletion/Matcher/AbstractDefaultParametersMatcher.phpé  «F eé  £²î¤      C   vendor/psy/psysh/src/TabCompletion/Matcher/MongoDatabaseMatcher.phpƒ  «F eƒ  z¿¤      ?   vendor/psy/psysh/src/TabCompletion/Matcher/FunctionsMatcher.php»  «F e»  A˜R�¤      A   vendor/psy/psysh/src/TabCompletion/Matcher/MongoClientMatcher.phpê  «F eê  ìÍ`U¤      C   vendor/psy/psysh/src/TabCompletion/Matcher/ObjectMethodsMatcher.phpo  «F eo  ¬Œ“¤      >   vendor/psy/psysh/src/TabCompletion/Matcher/CommandsMatcher.php*  «F e*  ´‘¶¤      ?   vendor/psy/psysh/src/TabCompletion/Matcher/VariablesMatcher.php&  «F e&  ÅÌ¤      S   vendor/psy/psysh/src/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php-  «F e-  L¤:=¤      >   vendor/psy/psysh/src/TabCompletion/Matcher/AbstractMatcher.php¶  «F e¶  .’8ë¤      R   vendor/psy/psysh/src/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.phpH  «F eH  tK'¬¤      -   vendor/psy/psysh/src/ExecutionLoopClosure.phpS  «F eS  ˜–yå¤      "   vendor/psy/psysh/src/Util/Json.phpé   «F eé   ZJ0L¤      !   vendor/psy/psysh/src/Util/Str.php¾  «F e¾  	ËÚE¤      $   vendor/psy/psysh/src/Util/Mirror.php˜  «F e˜  ‘�w¤      &   vendor/psy/psysh/src/Util/Docblock.php.  «F e.  ¨=Ë¤         vendor/psy/psysh/src/Shell.php”v  «F e”v  |£—É¤      *   vendor/psy/psysh/src/Input/SilentInput.php  «F e  ¤ƒÝß¤      +   vendor/psy/psysh/src/Input/CodeArgument.phpÖ  «F eÖ  Ì+ûÖ¤      )   vendor/psy/psysh/src/Input/ShellInput.phpÓ  «F eÓ  BîE¤      ,   vendor/psy/psysh/src/Input/FilterOptions.phpS
  «F eS
  å´/é¤      2   vendor/psy/psysh/src/CodeCleaner/NoReturnValue.php!  «F e!  çbV¤      7   vendor/psy/psysh/src/CodeCleaner/NamespaceAwarePass.php  «F e  ¨Sˆ?¤      9   vendor/psy/psysh/src/CodeCleaner/ValidConstructorPass.phpþ  «F eþ  ÉAN±¤      6   vendor/psy/psysh/src/CodeCleaner/AbstractClassPass.phpà  «F eà   ùË¤      :   vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php‘  «F e‘  ™ \=¤      <   vendor/psy/psysh/src/CodeCleaner/PassableByReferencePass.php•	  «F e•	  ytr&¤      ;   vendor/psy/psysh/src/CodeCleaner/AssignThisVariablePass.php  «F e  ³\[:¤      @   vendor/psy/psysh/src/CodeCleaner/CallTimePassByReferencePass.php–  «F e–  J…°‹¤      -   vendor/psy/psysh/src/CodeCleaner/ExitPass.phpô  «F eô  F/¤      ;   vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.phpÌ  «F eÌ  ±w!¤      2   vendor/psy/psysh/src/CodeCleaner/NamespacePass.phpl  «F el  5ÃÜ	¤      7   vendor/psy/psysh/src/CodeCleaner/ImplicitReturnPass.phpk	  «F ek	  l<z>¤      0   vendor/psy/psysh/src/CodeCleaner/RequirePass.php{	  «F e{	  îG¤      8   vendor/psy/psysh/src/CodeCleaner/LeavePsyshAlonePass.php¶  «F e¶  ›e‡y¤      E   vendor/psy/psysh/src/CodeCleaner/FunctionReturnInWriteContextPass.php
  «F e
  :©õŠ¤      7   vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php  «F e  ¼Ë‰A¤      3   vendor/psy/psysh/src/CodeCleaner/ReturnTypePass.php±  «F e±  ´”V¤      -   vendor/psy/psysh/src/CodeCleaner/ListPass.phpê	  «F eê	  ‘l‘Œ¤      5   vendor/psy/psysh/src/CodeCleaner/LabelContextPass.phpâ  «F eâ   áJÈ¤      5   vendor/psy/psysh/src/CodeCleaner/UseStatementPass.phpî	  «F eî	  k%}÷¤      4   vendor/psy/psysh/src/CodeCleaner/LoopContextPass.php¨
  «F e¨
  aˆ0Š¤      4   vendor/psy/psysh/src/CodeCleaner/CodeCleanerPass.php“   «F e“   Úù“¤      3   vendor/psy/psysh/src/CodeCleaner/FinalClassPass.phpŸ  «F eŸ  |æ©4¤      7   vendor/psy/psysh/src/CodeCleaner/MagicConstantsPass.phpl  «F el  Šgà¤      4   vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.phpS  «F eS  £yTL¤      3   vendor/psy/psysh/src/CodeCleaner/InstanceOfPass.phpÄ  «F eÄ  …{ä@¤      4   vendor/psy/psysh/src/CodeCleaner/CalledClassPass.phpm  «F em  Î‹U�¤      .   vendor/psy/psysh/src/CodeCleaner/IssetPass.php¼  «F e¼  .RG>¤      8   vendor/psy/psysh/src/CodeCleaner/FunctionContextPass.phpÈ  «F eÈ  NG'¹¤      ,   vendor/psy/psysh/src/Readline/HoaConsole.php¦   «F e¦   ·QŠ¤      -   vendor/psy/psysh/src/Readline/GNUReadline.phpL
  «F eL
  å„÷¤      *   vendor/psy/psysh/src/Readline/Readline.php>  «F e>  À¸(¤      +   vendor/psy/psysh/src/Readline/Transient.php×  «F e×  œ°?H¤      *   vendor/psy/psysh/src/Readline/Userland.phpß
  «F eß
   )u‰¤      7   vendor/psy/psysh/src/Readline/Hoa/AutocompleterWord.php·  «F e·  ×t@¤      .   vendor/psy/psysh/src/Readline/Hoa/StreamIn.php  «F e  ×‰ö‡¤      -   vendor/psy/psysh/src/Readline/Hoa/Ustring.php  «F e  ¿-þ¨¤      3   vendor/psy/psysh/src/Readline/Hoa/StreamContext.php@  «F e@  ÜkŸ¤      <   vendor/psy/psysh/src/Readline/Hoa/AutocompleterAggregate.php—  «F e—  Á>`D¤      +   vendor/psy/psysh/src/Readline/Hoa/Event.php[  «F e[  ÄÂ¤      3   vendor/psy/psysh/src/Readline/Hoa/EventListener.phpÄ  «F eÄ  cã¨×¤      /   vendor/psy/psysh/src/Readline/Hoa/Xcallable.php  «F e  ”s\¤      .   vendor/psy/psysh/src/Readline/Hoa/Protocol.php  «F e  “]\È¤      3   vendor/psy/psysh/src/Readline/Hoa/Autocompleter.php¡   «F e¡   3)9¤      0   vendor/psy/psysh/src/Readline/Hoa/FileFinder.php©'  «F e©'  Ü	ŽM¤      2   vendor/psy/psysh/src/Readline/Hoa/ProtocolNode.php;  «F e;  ¤'{'¤      9   vendor/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.phpì  «F eì  ?Þ¤      4   vendor/psy/psysh/src/Readline/Hoa/StreamStatable.php�  «F e�  £ØM¤      6   vendor/psy/psysh/src/Readline/Hoa/StreamBufferable.phpB  «F eB  º;å¤      ?   vendor/psy/psysh/src/Readline/Hoa/FileDoesNotExistException.phpe   «F ee   2~Ò¤      @   vendor/psy/psysh/src/Readline/Hoa/IteratorRecursiveDirectory.phpÈ  «F eÈ  íV}K¤      *   vendor/psy/psysh/src/Readline/Hoa/File.phpî  «F eî  z¢£¤      .   vendor/psy/psysh/src/Readline/Hoa/FileRead.phpÐ  «F eÐ  Å‡µÂ¤      2   vendor/psy/psysh/src/Readline/Hoa/ConsoleInput.php’  «F e’  9Xg¤      .   vendor/psy/psysh/src/Readline/Hoa/Readline.phpÇQ  «F eÇQ  Öô&¤      6   vendor/psy/psysh/src/Readline/Hoa/ConsoleProcessus.phpb3  «F eb3  „•sV¤      3   vendor/psy/psysh/src/Readline/Hoa/ConsoleCursor.php6  «F e6  JÓÄ2¤      9   vendor/psy/psysh/src/Readline/Hoa/IteratorSplFileInfo.phpÖ  «F eÖ  =x±¤      5   vendor/psy/psysh/src/Readline/Hoa/EventListenable.php›   «F e›   †g¡¤      7   vendor/psy/psysh/src/Readline/Hoa/FileLinkReadWrite.phpÇ  «F eÇ  âÙ3¤      -   vendor/psy/psysh/src/Readline/Hoa/IStream.phpb   «F eb   ð¸Å‘¤      ,   vendor/psy/psysh/src/Readline/Hoa/Stream.php�  «F e�  –†a¤      5   vendor/psy/psysh/src/Readline/Hoa/StreamTouchable.phpî  «F eî  ^‘»	¤      7   vendor/psy/psysh/src/Readline/Hoa/AutocompleterPath.php1
  «F e1
  ß¦zA¤      2   vendor/psy/psysh/src/Readline/Hoa/EventListens.phpá  «F eá  ³öä§¤      7   vendor/psy/psysh/src/Readline/Hoa/ProtocolException.phpY   «F eY   €rçº¤      /   vendor/psy/psysh/src/Readline/Hoa/StreamOut.php;  «F e;  [n;C¤      -   vendor/psy/psysh/src/Readline/Hoa/Console.phpU  «F eU  B‡P€¤      3   vendor/psy/psysh/src/Readline/Hoa/FileException.phpU   «F eU   '�ò÷¤      3   vendor/psy/psysh/src/Readline/Hoa/FileReadWrite.php¿  «F e¿  óˆ‰!¤      1   vendor/psy/psysh/src/Readline/Hoa/FileGeneric.phpX  «F eX  qgDÖ¤      5   vendor/psy/psysh/src/Readline/Hoa/StreamException.phpW   «F eW   ¶R÷¤      3   vendor/psy/psysh/src/Readline/Hoa/ExceptionIdle.php  «F e  Ëæv¤      8   vendor/psy/psysh/src/Readline/Hoa/IteratorFileSystem.php  «F e  u:yº¤      4   vendor/psy/psysh/src/Readline/Hoa/StreamLockable.php  «F e  ê!Eg¤      3   vendor/psy/psysh/src/Readline/Hoa/ConsoleOutput.phpU
  «F eU
  ¢)Z3¤      1   vendor/psy/psysh/src/Readline/Hoa/EventBucket.php  «F e  µp»¤      5   vendor/psy/psysh/src/Readline/Hoa/StreamPointable.phpO  «F eO  ´‚å¤      1   vendor/psy/psysh/src/Readline/Hoa/EventSource.phpE   «F eE   æQ÷‘¤      /   vendor/psy/psysh/src/Readline/Hoa/Exception.phpY  «F eY  ­æ7N¤      3   vendor/psy/psysh/src/Readline/Hoa/FileDirectory.phpã  «F eã  í0¤      5   vendor/psy/psysh/src/Readline/Hoa/ProtocolWrapper.php4  «F e4  /8í¤      4   vendor/psy/psysh/src/Readline/Hoa/StreamPathable.php¯   «F e¯   ªÆÐÙ¤      4   vendor/psy/psysh/src/Readline/Hoa/EventException.phpV   «F eV   ½÷8¤      1   vendor/psy/psysh/src/Readline/Hoa/ConsoleTput.php 7  «F e 7  ;]¿¤      6   vendor/psy/psysh/src/Readline/Hoa/ConsoleException.phpX   «F eX   I“ëö¤      2   vendor/psy/psysh/src/Readline/Hoa/FileLinkRead.phpØ  «F eØ  )Mý–¤      .   vendor/psy/psysh/src/Readline/Hoa/FileLink.php‚  «F e‚  ¯�M¤      3   vendor/psy/psysh/src/Readline/Hoa/ConsoleWindow.phpG   «F eG   Âç#¤      )   vendor/psy/psysh/src/Readline/Libedit.php]  «F e]  Þª¢1¤      %   vendor/psy/psysh/src/ContextAware.phpk   «F ek   ]øâT¤      (   vendor/psy/psysh/src/SuperglobalsEnv.phpú   «F eú   C™ÑO¤      /   vendor/psy/psysh/src/Output/ProcOutputPager.php  «F e  êC¤      +   vendor/psy/psysh/src/Output/OutputPager.php±   «F e±   ÜTƒ7¤      %   vendor/psy/psysh/src/Output/Theme.phpš  «F eš  Þ?²F¤      -   vendor/psy/psysh/src/Output/PassthruPager.php@  «F e@  ›BÏ_¤      +   vendor/psy/psysh/src/Output/ShellOutput.phpç  «F eç  ív¤      &   vendor/psy/psysh/src/Configuration.phpØ  «F eØ  àè¾¤      &   vendor/psy/psysh/src/ParserFactory.php»  «F e»  ïb)¤      1   vendor/psy/psysh/src/Formatter/TraceFormatter.phpE	  «F eE	  R<0¤      0   vendor/psy/psysh/src/Formatter/CodeFormatter.phpb  «F eb  ö¤      ,   vendor/psy/psysh/src/Formatter/Formatter.php[   «F e[   ôúøŽ¤      5   vendor/psy/psysh/src/Formatter/ReflectorFormatter.phpŒ   «F eŒ   s€Èï¤      4   vendor/psy/psysh/src/Formatter/DocblockFormatter.php—  «F e—  uE×J¤      5   vendor/psy/psysh/src/Formatter/SignatureFormatter.phpˆ  «F eˆ  ÂÀ{…¤          vendor/psy/psysh/src/Context.php­  «F e­  ½W`¤      $   vendor/psy/psysh/src/CodeCleaner.php‡  «F e‡  ®Õ¸ã¤      2   vendor/psy/psysh/src/Command/ReflectingCommand.php"  «F e"  ¯-=¤      0   vendor/psy/psysh/src/Command/WhereamiCommand.phpt  «F et  ÒUÜ¼¤      2   vendor/psy/psysh/src/Command/PsyVersionCommand.php,  «F e,  66•d¤      +   vendor/psy/psysh/src/Command/DocCommand.phpÿ  «F eÿ  ß×€Œ¤      D   vendor/psy/psysh/src/Command/ListCommand/ClassConstantEnumerator.php9  «F e9  Ý¦ã¤      ?   vendor/psy/psysh/src/Command/ListCommand/VariableEnumerator.php*	  «F e*	  ¬Ý¤      ?   vendor/psy/psysh/src/Command/ListCommand/PropertyEnumerator.php  «F e  Ñmò¤      E   vendor/psy/psysh/src/Command/ListCommand/GlobalVariableEnumerator.php
  «F e
  ôÂÍ¤      <   vendor/psy/psysh/src/Command/ListCommand/ClassEnumerator.php  «F e  4ú H¤      ?   vendor/psy/psysh/src/Command/ListCommand/ConstantEnumerator.phpÅ  «F eÅ  ›„¤      7   vendor/psy/psysh/src/Command/ListCommand/Enumerator.php»  «F e»  `4¦¤      ?   vendor/psy/psysh/src/Command/ListCommand/FunctionEnumerator.phpE  «F eE  éKÒÎ¤      =   vendor/psy/psysh/src/Command/ListCommand/MethodEnumerator.phpÖ	  «F eÖ	  ÿ/¤      -   vendor/psy/psysh/src/Command/TraceCommand.php¦  «F e¦  i±�¤      ,   vendor/psy/psysh/src/Command/HelpCommand.php{  «F e{  (‡Ï¤      ,   vendor/psy/psysh/src/Command/ExitCommand.php›  «F e›  ¿ž6»¤      ,   vendor/psy/psysh/src/Command/ShowCommand.php�  «F e�  ÏîÑD¤      .   vendor/psy/psysh/src/Command/TimeitCommand.phpO  «F eO  jœ	S¤      /   vendor/psy/psysh/src/Command/ThrowUpCommand.php/  «F e/  UÃº¤      ,   vendor/psy/psysh/src/Command/ListCommand.php�  «F e�  ŽPv‰¤      ,   vendor/psy/psysh/src/Command/EditCommand.phpÛ  «F eÛ  îPÎÀ¤      -   vendor/psy/psysh/src/Command/ClearCommand.php†  «F e†  ˜É©Â¤      .   vendor/psy/psysh/src/Command/BufferCommand.php™  «F e™  —¿qV¤      ,   vendor/psy/psysh/src/Command/SudoCommand.php³  «F e³  OôA€¤      (   vendor/psy/psysh/src/Command/Command.phpµ  «F eµ  n;¢Æ¤      -   vendor/psy/psysh/src/Command/ParseCommand.phpØ  «F eØ  �a‹z¤      <   vendor/psy/psysh/src/Command/TimeitCommand/TimeitVisitor.phpH	  «F eH	  \`év¤      +   vendor/psy/psysh/src/Command/WtfCommand.php¼  «F e¼  Q¹RÐ¤      ,   vendor/psy/psysh/src/Command/DumpCommand.phpD  «F eD   (Y)¤      /   vendor/psy/psysh/src/Command/HistoryCommand.phpF  «F eF  A`H¤      )   vendor/psy/psysh/src/Sudo/SudoVisitor.phpÃ  «F eÃ  ]éNM¤      1   vendor/psy/psysh/src/VarDumper/PresenterAware.php}   «F e}   ÈÀ¤      )   vendor/psy/psysh/src/VarDumper/Cloner.php„  «F e„  IŸùy¤      )   vendor/psy/psysh/src/VarDumper/Dumper.php+
  «F e+
  ¦9¤      ,   vendor/psy/psysh/src/VarDumper/Presenter.php\
  «F e\
  Süñ"¤      1   vendor/psy/psysh/src/Exception/ErrorException.php  «F e  ¶Ak¤      1   vendor/psy/psysh/src/Exception/BreakException.php  «F e  �¤      5   vendor/psy/psysh/src/Exception/TypeErrorException.php«  «F e«  áL¤      <   vendor/psy/psysh/src/Exception/UnexpectedTargetException.php•  «F e•  •IŸ;¤      3   vendor/psy/psysh/src/Exception/RuntimeException.php³  «F e³  ‡v€¤      3   vendor/psy/psysh/src/Exception/ThrowUpException.phpT  «F eT  *=4D¤      6   vendor/psy/psysh/src/Exception/FatalErrorException.php´  «F e´  M~Ð¤      6   vendor/psy/psysh/src/Exception/DeprecatedException.php_   «F e_   ºye’¤      ,   vendor/psy/psysh/src/Exception/Exception.phpe   «F ee   Ç(Ã¤      6   vendor/psy/psysh/src/Exception/ParseErrorException.phpÔ  «F eÔ  H·¤      %   vendor/psy/psysh/src/EnvInterface.php_   «F e_   :]5¤         vendor/psy/psysh/src/Sudo.phpå
  «F eå
  ­V¼z¤      H   vendor/psy/psysh/src/Reflection/ReflectionLanguageConstructParameter.php&  «F e&  ÃR9“¤      ?   vendor/psy/psysh/src/Reflection/ReflectionLanguageConstruct.php(  «F e(  ÀQ#È¤      7   vendor/psy/psysh/src/Reflection/ReflectionNamespace.php  «F e  ªÞc¤      ;   vendor/psy/psysh/src/Reflection/ReflectionClassConstant.php¼	  «F e¼	  [ìú9¤      6   vendor/psy/psysh/src/Reflection/ReflectionConstant.php/  «F e/  ¹wB¾¤      7   vendor/psy/psysh/src/Reflection/ReflectionConstant_.phpâ  «F eâ  ×:,n¤      5   vendor/psy/psysh/src/ExecutionLoop/RunkitReloader.php‚  «F e‚  Ï)ïV¤      7   vendor/psy/psysh/src/ExecutionLoop/AbstractListener.phpå  «F eå  &3M+¤      /   vendor/psy/psysh/src/ExecutionLoop/Listener.php³  «F e³  P¾]¤      4   vendor/psy/psysh/src/ExecutionLoop/ProcessForker.phpd  «F ed  4>â¤      "   vendor/psy/psysh/src/SystemEnv.php4  «F e4  ï�O¤      C   vendor/stecman/symfony-console-completion/src/CompletionHandler.php¦&  «F e¦&  ðh»Z¤      U   vendor/stecman/symfony-console-completion/src/Completion/CompletionAwareInterface.phpv  «F ev  ³ç¤      P   vendor/stecman/symfony-console-completion/src/Completion/ShellPathCompletion.php
  «F e
  ™Âï¤      P   vendor/stecman/symfony-console-completion/src/Completion/CompletionInterface.php€  «F e€  yÜ[×¤      N   vendor/stecman/symfony-console-completion/src/EnvironmentCompletionContext.phpn  «F en  eRnQ¤      C   vendor/stecman/symfony-console-completion/src/CompletionContext.php°  «F e°  Ük:–¤      C   vendor/stecman/symfony-console-completion/src/CompletionCommand.php<  «F e<  ZWó¤      =   vendor/stecman/symfony-console-completion/src/HookFactory.phpC  «F eC  C´²£¤      <   vendor/stecman/symfony-console-completion/src/Completion.php·  «F e·  X;œ¤      7   vendor/psr/container/src/NotFoundExceptionInterface.phpu   «F eu   W�-¤      /   vendor/psr/container/src/ContainerInterface.php…   «F e…   ŠåÀõ¤      8   vendor/psr/container/src/ContainerExceptionInterface.phpR   «F eR   ®�¤      /   vendor/psr/log/Psr/Log/LoggerAwareInterface.php}   «F e}   Q„¤      #   vendor/psr/log/Psr/Log/LogLevel.php  «F e  ‹ú°¤      +   vendor/psr/log/Psr/Log/LoggerAwareTrait.php¸   «F e¸   KK¹1¤      3   vendor/psr/log/Psr/Log/InvalidArgumentException.phpg   «F eg   —IBß¤      %   vendor/psr/log/Psr/Log/NullLogger.phpž   «F ež   •éÆ¬¤      *   vendor/psr/log/Psr/Log/LoggerInterface.php†  «F e†  5†¤      &   vendor/psr/log/Psr/Log/LoggerTrait.php°  «F e°  )håÒ¤      )   vendor/psr/log/Psr/Log/AbstractLogger.php‰  «F e‰  ë«ê¤      '   vendor/symfony/polyfill-php73/Php73.phpË  «F eË  »�_¤      ?   vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php…   «F e…   \qÑ¤      +   vendor/symfony/polyfill-php73/bootstrap.phpˆ  «F eˆ  Ç#§Ã¤      <   vendor/symfony/polyfill-php80/Resources/stubs/ValueError.phpx   «F ex   ¦Þ¤      ;   vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php@  «F e@  Uü¾¤      E   vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php“   «F e“   ™±‚ª¤      <   vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php†   «F e†   %	ì¤      +   vendor/symfony/polyfill-php80/bootstrap.php­  «F e­  
Ê¤      '   vendor/symfony/polyfill-php80/Php80.phpI  «F eI  ·`·?¤      +   vendor/symfony/var-dumper/Cloner/Cursor.phpê  «F eê   gŒ]¤      .   vendor/symfony/var-dumper/Cloner/VarCloner.php$.  «F e$.  Ôj™0¤      4   vendor/symfony/var-dumper/Cloner/ClonerInterface.php   «F e   Dw]¤      4   vendor/symfony/var-dumper/Cloner/DumperInterface.php¡  «F e¡  ý¤      3   vendor/symfony/var-dumper/Cloner/AbstractCloner.php¿N  «F e¿N  §Á[¤      )   vendor/symfony/var-dumper/Cloner/Data.php/  «F e/  ~çîz¤      )   vendor/symfony/var-dumper/Cloner/Stub.php¤  «F e¤  C¬Ø(¤      .   vendor/symfony/var-dumper/Caster/GmpCaster.phpq  «F eq  Ž_£
¤      5   vendor/symfony/var-dumper/Caster/ReflectionCaster.php˜7  «F e˜7  °ý1Z¤      /   vendor/symfony/var-dumper/Caster/StubCaster.phpæ  «F eæ  ]>tï¤      2   vendor/symfony/var-dumper/Caster/SymfonyCaster.phpŠ	  «F eŠ	  Rë¥¤      .   vendor/symfony/var-dumper/Caster/FrameStub.phpn  «F en  ­æÅK¤      7   vendor/symfony/var-dumper/Caster/ProxyManagerCaster.phpÁ  «F eÁ  ¦Äc™¤      /   vendor/symfony/var-dumper/Caster/DateCaster.phpÆ  «F eÆ  yÃ®ˆ¤      .   vendor/symfony/var-dumper/Caster/PdoCaster.php  «F e  ‹Ø—ð¤      6   vendor/symfony/var-dumper/Caster/XmlResourceCaster.phpï  «F eï  ÒÁ�=¤      3   vendor/symfony/var-dumper/Caster/ResourceCaster.php½
  «F e½
  R�¤      4   vendor/symfony/var-dumper/Caster/ExceptionCaster.phpf=  «F ef=  ÏÇ§F¤      -   vendor/symfony/var-dumper/Caster/DsCaster.phpà  «F eà  ©�RU¤      -   vendor/symfony/var-dumper/Caster/LinkStub.phpé  «F eé  ¤dD÷¤      4   vendor/symfony/var-dumper/Caster/MemcachedCaster.php¾  «F e¾  ˆ‡¤      3   vendor/symfony/var-dumper/Caster/DoctrineCaster.phpM  «F eM  @Ï8½¤      2   vendor/symfony/var-dumper/Caster/RdKafkaCaster.php~  «F e~  íÀ×û¤      1   vendor/symfony/var-dumper/Caster/MysqliCaster.php›  «F e›  }ß@¤      ,   vendor/symfony/var-dumper/Caster/ImgStub.phpd  «F ed  BEI¤      .   vendor/symfony/var-dumper/Caster/ClassStub.phpô  «F eô  \éh¤      .   vendor/symfony/var-dumper/Caster/TraceStub.php_  «F e_  Màq¤      1   vendor/symfony/var-dumper/Caster/CutArrayStub.phpˆ  «F eˆ  ÁÆv¥¤      0   vendor/symfony/var-dumper/Caster/PgSqlCaster.php‘  «F e‘  ”‘9,¤      +   vendor/symfony/var-dumper/Caster/Caster.phpl  «F el  øŸ½ï¤      .   vendor/symfony/var-dumper/Caster/SplCaster.php  «F e  Í—Ç¤      .   vendor/symfony/var-dumper/Caster/ConstStub.phpŠ  «F eŠ  ÓëÐ¤      /   vendor/symfony/var-dumper/Caster/DsPairStub.php:  «F e:  ÍK|S¤      /   vendor/symfony/var-dumper/Caster/IntlCaster.php»  «F e»  �òã-¤      0   vendor/symfony/var-dumper/Caster/RedisCaster.php›  «F e›  �«¤      0   vendor/symfony/var-dumper/Caster/FiberCaster.php×  «F e×  .-D<¤      2   vendor/symfony/var-dumper/Caster/ImagineCaster.phpo  «F eo  ~ôå9¤      /   vendor/symfony/var-dumper/Caster/AmqpCaster.phpt  «F et  ¸ÂÑ¿¤      .   vendor/symfony/var-dumper/Caster/DOMCaster.php.   «F e.   |@�¤      /   vendor/symfony/var-dumper/Caster/UuidCaster.php{  «F e{  ÅÃ©¤      4   vendor/symfony/var-dumper/Caster/XmlReaderCaster.php€	  «F e€	  ÷œº¬¤      -   vendor/symfony/var-dumper/Caster/ArgsStub.phpÃ  «F eÃ  ÏàwF¤      -   vendor/symfony/var-dumper/Caster/EnumStub.phpG  «F eG  k‹s¤      ,   vendor/symfony/var-dumper/Caster/CutStub.php-  «F e-  l²µÛ¤      6   vendor/symfony/var-dumper/Resources/functions/dump.phpÂ  «F eÂ  úw@p¤      /   vendor/symfony/var-dumper/Server/Connection.phpj  «F ej  =+l¤      /   vendor/symfony/var-dumper/Server/DumpServer.php  «F e  ÀGp¦¤      7   vendor/symfony/var-dumper/Command/ServerDumpCommand.phpr  «F er  „Ñž¤      H   vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.phpI  «F eI  j_|À¤      >   vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php		  «F e		  7R¯¤      ?   vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php  «F e  i„ã¤      ?   vendor/symfony/var-dumper/Exception/ThrowingCasterException.php/  «F e/  =šáF¤      1   vendor/symfony/var-dumper/Dumper/ServerDumper.php�  «F e�  ÌA¤      8   vendor/symfony/var-dumper/Dumper/DataDumperInterface.php¹   «F e¹   &iÇ¤      M   vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.phpŸ   «F eŸ   ÃÔÅU¤      K   vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php=  «F e=  UÛÐ&¤      G   vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php¹  «F e¹  ÀV—T¤      J   vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php˜  «F e˜  FQžä¤      3   vendor/symfony/var-dumper/Dumper/AbstractDumper.phpM  «F eM  _ùò¤      .   vendor/symfony/var-dumper/Dumper/CliDumper.phpEK  «F eEK  üÂ�*¤      9   vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php8  «F e8  l÷éh¤      /   vendor/symfony/var-dumper/Dumper/HtmlDumper.phpK  «F eK  �:H›¤      '   vendor/symfony/var-dumper/VarDumper.php=  «F e=  &Gê¤      ?   vendor/symfony/service-contracts/ServiceSubscriberInterface.php‘   «F e‘   cÂz…¤      3   vendor/symfony/service-contracts/ResetInterface.phpn   «F en   iícc¤      =   vendor/symfony/service-contracts/ServiceProviderInterface.phpÖ   «F eÖ   ´<ò¤      ;   vendor/symfony/service-contracts/ServiceSubscriberTrait.php„  «F e„  .ÁKá¤      8   vendor/symfony/service-contracts/ServiceLocatorTrait.phpC  «F eC  nj”g¤      +   vendor/symfony/process/ExecutableFinder.php=  «F e=  ­ž†¤      *   vendor/symfony/process/Pipes/UnixPipes.phpÍ
  «F eÍ
  pR‘¤      -   vendor/symfony/process/Pipes/WindowsPipes.phph  «F eh  ,ÇØ�¤      .   vendor/symfony/process/Pipes/AbstractPipes.phpñ  «F eñ  îBP¤      /   vendor/symfony/process/Pipes/PipesInterface.php“  «F e“  aÓ¯¤      &   vendor/symfony/process/InputStream.php‰  «F e‰  BXéü¤      %   vendor/symfony/process/PhpProcess.phpÆ  «F eÆ  ¨Ú,¤      .   vendor/symfony/process/PhpExecutableFinder.phpP  «F eP  �‘wé¤      =   vendor/symfony/process/Exception/ProcessSignaledException.phpW  «F eW  m¶±}¤      3   vendor/symfony/process/Exception/LogicException.php�   «F e�   ,uÞ¤      7   vendor/symfony/process/Exception/ExceptionInterface.phpr   «F er   ¡0¤      ;   vendor/symfony/process/Exception/ProcessFailedException.phpç  «F eç  ºÍ�¤      5   vendor/symfony/process/Exception/RuntimeException.php‘   «F e‘   Û¦,¤      =   vendor/symfony/process/Exception/ProcessTimedOutException.php  «F e  Cär´¤      =   vendor/symfony/process/Exception/InvalidArgumentException.php¡   «F e¡   +DÔ¶¤      '   vendor/symfony/process/ProcessUtils.php'  «F e'  «#áÝ¤      "   vendor/symfony/process/Process.phpv{  «F ev{  L9/¤      (   vendor/symfony/console/ConsoleEvents.phpÏ  «F eÏ  Päì¤      &   vendor/symfony/console/Application.phpV‹  «F eV‹  ÆéM†¤      /   vendor/symfony/console/Logger/ConsoleLogger.php­  «F e­  $ÿÚµ¤      9   vendor/symfony/console/Input/StreamableInputInterface.phpÁ   «F eÁ   <‡uÄ¤      +   vendor/symfony/console/Input/ArrayInput.php©  «F e©  )þ'Z¤      *   vendor/symfony/console/Input/ArgvInput.php+   «F e+   úc¤      .   vendor/symfony/console/Input/InputArgument.phpT  «F eT  #±´G¤      4   vendor/symfony/console/Input/InputAwareInterface.php‘   «F e‘   ×fuÂ¤      ,   vendor/symfony/console/Input/InputOption.php�  «F e�  ¯¢X‰¤      0   vendor/symfony/console/Input/InputDefinition.php  «F e   õ+¤      ,   vendor/symfony/console/Input/StringInput.phpC  «F eC  HªD¤      &   vendor/symfony/console/Input/Input.phpW  «F eW  #ïå¨¤      /   vendor/symfony/console/Input/InputInterface.php˜  «F e˜  0³r¤      #   vendor/symfony/console/Terminal.phpÁ  «F eÁ  )ò¤      5   vendor/symfony/console/Output/TrimmedBufferOutput.phpd  «F ed  åãb ¤      8   vendor/symfony/console/Output/ConsoleOutputInterface.phpÚ   «F eÚ   äýà$¤      0   vendor/symfony/console/Output/BufferedOutput.php§  «F e§  •^(¤      1   vendor/symfony/console/Output/OutputInterface.phpä  «F eä  ƒ‚¡Ÿ¤      (   vendor/symfony/console/Output/Output.php¼  «F e¼  s˜ s¤      6   vendor/symfony/console/Output/ConsoleSectionOutput.php—  «F e—  —ä¤¤      /   vendor/symfony/console/Output/ConsoleOutput.phpP
  «F eP
  ƒ>À¤      ,   vendor/symfony/console/Output/NullOutput.phpe  «F ee  3§yÈ¤      .   vendor/symfony/console/Output/StreamOutput.php¡  «F e¡  =x}¤      ,   vendor/symfony/console/Style/OutputStyle.php‘  «F e‘  ùY‡£¤      -   vendor/symfony/console/Style/SymfonyStyle.php¹.  «F e¹.  "ùd5¤      /   vendor/symfony/console/Style/StyleInterface.phpž  «F ež  ‹�L¤      2   vendor/symfony/console/Question/ChoiceQuestion.php]  «F e]  É‚:¤      ,   vendor/symfony/console/Question/Question.php¨  «F e¨  ]“ú¤      8   vendor/symfony/console/Question/ConfirmationQuestion.php¬  «F e¬  JT ¤      9   vendor/symfony/console/Formatter/OutputFormatterStyle.php  «F e  )ÍMY¤      B   vendor/symfony/console/Formatter/OutputFormatterStyleInterface.phpr  «F er   Å·,¤      =   vendor/symfony/console/Formatter/OutputFormatterInterface.phpq  «F eq  …¬û5¤      4   vendor/symfony/console/Formatter/OutputFormatter.phpÔ  «F eÔ  U@ôG¤      F   vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.phpÏ   «F eÏ   jÊ°d¤      >   vendor/symfony/console/Formatter/OutputFormatterStyleStack.php¥  «F e¥  ©^tf¤      ?   vendor/symfony/console/CommandLoader/CommandLoaderInterface.phpF  «F eF  À9ïí¤      ?   vendor/symfony/console/CommandLoader/ContainerCommandLoader.phpº  «F eº  Òºž¤      =   vendor/symfony/console/CommandLoader/FactoryCommandLoader.php  «F e  c2ïá¤      4   vendor/symfony/console/Descriptor/TextDescriptor.php³+  «F e³+  l¤�¤      <   vendor/symfony/console/Descriptor/ApplicationDescription.php’  «F e’  ÊH¤      3   vendor/symfony/console/Descriptor/XmlDescriptor.phpÍ   «F eÍ   FIn¤      9   vendor/symfony/console/Descriptor/DescriptorInterface.phpó   «F eó   ã ¤      0   vendor/symfony/console/Descriptor/Descriptor.php»  «F e»  ÔM#¤      4   vendor/symfony/console/Descriptor/JsonDescriptor.php`  «F e`  _�öá¤      8   vendor/symfony/console/Descriptor/MarkdownDescriptor.php  «F e  åÈ4¤      /   vendor/symfony/console/Tester/CommandTester.phpŽ  «F eŽ  ~<^1¤      -   vendor/symfony/console/Tester/TesterTrait.php@  «F e@  ˜‘¹D¤      3   vendor/symfony/console/Tester/ApplicationTester.phpe  «F ee  Í¬XW¤      0   vendor/symfony/console/Command/LockableTrait.phpû  «F eû  L(†T¤      .   vendor/symfony/console/Command/HelpCommand.php%  «F e%   ƒ­¤      .   vendor/symfony/console/Command/ListCommand.php¡  «F e¡  6«ÂR¤      *   vendor/symfony/console/Command/Command.php3)  «F e3)  ~%Å¤      ,   vendor/symfony/console/Helper/TableStyle.phpƒ  «F eƒ  •FÅ)¤      +   vendor/symfony/console/Helper/TableRows.php^  «F e^  ºÕs¤      7   vendor/symfony/console/Helper/SymfonyQuestionHelper.phpê	  «F eê	  $Pâ†¤      1   vendor/symfony/console/Helper/HelperInterface.phpÛ   «F eÛ   l¦Õä¤      +   vendor/symfony/console/Helper/TableCell.php•  «F e•  óà²h¤      /   vendor/symfony/console/Helper/ProcessHelper.phpê  «F eê  ëål¤      0   vendor/symfony/console/Helper/TableSeparator.phpÒ   «F eÒ   Ë2@W¤      1   vendor/symfony/console/Helper/FormatterHelper.phpY  «F eY  "�dí¤      -   vendor/symfony/console/Helper/ProgressBar.php8  «F e8  G˜%N¤      6   vendor/symfony/console/Helper/DebugFormatterHelper.php
  «F e
  ƒU¤      +   vendor/symfony/console/Helper/HelperSet.phpE  «F eE  £¹Œ¤      (   vendor/symfony/console/Helper/Dumper.phpõ  «F eõ  w3Ä�¤      2   vendor/symfony/console/Helper/InputAwareHelper.php}  «F e}  "ò¤      0   vendor/symfony/console/Helper/QuestionHelper.php.7  «F e.7  h¾Ï¤      (   vendor/symfony/console/Helper/Helper.php�
  «F e�
  =`™¤      '   vendor/symfony/console/Helper/Table.php X  «F e X  ¬á¤      3   vendor/symfony/console/Helper/ProgressIndicator.php  «F e  ù}ÀR¤      2   vendor/symfony/console/Helper/DescriptorHelper.phpò  «F eò  /\‘ž¤      D   vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.phpÑ  «F eÑ  ú÷‡ì¤      3   vendor/symfony/console/Exception/LogicException.php�   «F e�   ¶Ê”«¤      ;   vendor/symfony/console/Exception/InvalidOptionException.phpŸ   «F eŸ   °St¢¤      7   vendor/symfony/console/Exception/ExceptionInterface.phpr   «F er   åŸÝS¤      5   vendor/symfony/console/Exception/RuntimeException.php‘   «F e‘   Þ¡¤      ?   vendor/symfony/console/Exception/NamespaceNotFoundException.php„   «F e„   �ÀÞÏ¤      =   vendor/symfony/console/Exception/InvalidArgumentException.php¡   «F e¡   7Ï¦¤      :   vendor/symfony/console/Exception/MissingInputException.php•   «F e•   ×g¤      =   vendor/symfony/console/Exception/CommandNotFoundException.phpû  «F eû  Ýb¤      6   vendor/symfony/console/Event/ConsoleTerminateEvent.phpÀ  «F eÀ  yÓÆ¤      2   vendor/symfony/console/Event/ConsoleErrorEvent.php“  «F e“  ¼Pï¤      4   vendor/symfony/console/Event/ConsoleCommandEvent.phpÞ  «F eÞ  àIo¹¤      -   vendor/symfony/console/Event/ConsoleEvent.php2  «F e2  åÅ!¤      6   vendor/symfony/console/EventListener/ErrorListener.php°	  «F e°	  cªË¤      @   vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.phpA  «F eA  /¤ý5¤      F   vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php³  «F e³  ã#–Û¤      @   vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.phpvA  «F evA  õ—…½¤      -   vendor/symfony/polyfill-mbstring/Mbstring.phpÑ]  «F eÑ]  Rp7¤      .   vendor/symfony/polyfill-mbstring/bootstrap.phpÏ  «F eÏ  ¥ó©¤         src/Application.php—  «F e—  t?ð¤         src/Encoder.phpÿ  «F eÿ  ÏƒÍ¤         src/Util/SetupCommandTrait.php¡%  «F e¡%  aïo¤         src/Util/Rand.php›  «F e›  +õ¤         src/Util/SettingTrait.php­  «F e­  ,‡Y•¤      "   src/Util/StructuredOutputTrait.phpÖ  «F eÖ  Õv·¤         src/Util/HeadlessDownloader.php†  «F e†  ÿ`rÏ¤         src/Util/Api4ArgParser.php×  «F e×  |þòä¤         src/Util/CliEditor.phpp  «F ep  æ}®„¤         src/Util/SettingArgParser.phpð  «F eð  ´)\³¤      !   src/Util/DebugDispatcherTrait.php©  «F e©  ?ÉÛ¤         src/Util/UrlCommandTrait.php3  «F e3  è¦ù¤         src/Util/ArrayUtil.phpÂ
  «F eÂ
  ,Á"ö¤         src/Util/SettingCodec.phpÁ  «F eÁ  -g¤         src/Util/AbstractPlusParser.phpÃ  «F eÃ  NùÈq¤         src/Util/PsrLogger.php²  «F e²  ‰á°¤         src/Util/Datasource.php„  «F e„  Þn¤         src/Util/ConsoleQueueRunner.phpm	  «F em	  ôãÐx¤          src/Util/OptionCallbackTrait.phpR  «F eR  ,=½¤         src/Util/Relativizer.phpÚ  «F eÚ  #y:#¤         src/Util/Cv.php–  «F e–  ²’··¤         src/Util/Process.php
  «F e
  ]cu”¤          src/Command/UpgradeDlCommand.php  «F e  G\ÉÖ¤      &   src/Command/ExtensionEnableCommand.php›  «F e›  Ðìª`¤      $   src/Command/CoreUninstallCommand.php'  «F e'  YÚÜ¤      &   src/Command/AngularHtmlListCommand.php  «F e  Ý Y¤         src/Command/UpgradeCommand.phpã  «F eã  ˆÐO?¤         src/Command/ApiBatchCommand.phpB  «F eB  ø~šÎ¤         src/Command/UrlCommand.phpe  «F ee  a$¤      )   src/Command/ExtensionUpgradeDbCommand.phpa  «F ea  Ä$; ¤         src/Command/HttpCommand.php¶  «F e¶  èW/Û¤         src/Command/FillCommand.php;  «F e;  éõæ¤      '   src/Command/ExtensionDisableCommand.phpÆ  «F eÆ  »wO¶¤      %   src/Command/DebugContainerCommand.phpx!  «F ex!  Ì��Ñ¤         src/Command/CliCommand.phpÑ  «F eÑ  ÞÐ¤      !   src/Command/SettingSetCommand.phpü  «F eü  îÁ¤         src/Command/BaseCommand.phpö	  «F eö	  gRQµ¤      "   src/Command/CoreInstallCommand.php  «F e  ´[Ü¤         src/Command/ScriptCommand.phpI	  «F eI	  ™ßU¤         src/Command/ShowCommand.php…  «F e…  �öm¤      $   src/Command/BaseExtensionCommand.php‰  «F e‰  	¶ì¤      (   src/Command/AngularModuleListCommand.php–  «F e–  –0L{¤         src/Command/FlushCommand.phpW  «F eW  á¹Ñ¤      !   src/Command/UpgradeGetCommand.php  «F e  �4EF¤      !   src/Command/SettingGetCommand.phpå  «F eå  $øŽ„¤      )   src/Command/ExtensionUninstallCommand.phpÇ  «F eÇ  µÁ¨|¤         src/Command/EditCommand.php  «F e  ËS‡¤      $   src/Command/UpgradeReportCommand.phpÃ  «F eÃ  �°Ð¤         src/Command/EvalCommand.phpÎ  «F eÎ  ˆ&Ë¤         src/Command/ApiCommand.phpÎ  «F eÎ  âuž¤         src/Command/BootCommand.php}  «F e}  É© |¤      (   src/Command/ExtensionDownloadCommand.php³.  «F e³.  „u}y¤         src/Command/Api4Command.phpî  «F eî  Û²'¤      &   src/Command/DebugDispatcherCommand.phpï  «F eï  éƒ§?¤      $   src/Command/ExtensionListCommand.phpç  «F eç  /é‡¤      &   src/Command/AngularHtmlShowCommand.php>  «F e>  äù1¤         src/Command/SqlCliCommand.php»  «F e»  EfŽ¤      #   src/Command/CoreCheckReqCommand.phpŒ
  «F eŒ
  Ó3q¤      $   src/Command/SettingRevertCommand.php�  «F e�  ]M:¤          src/Command/UpgradeDbCommand.phpÊ  «F eÊ  q¼~ä¤         src/Command/PipeCommand.phpÝ  «F eÝ  Ù­ùË¤         src/Command/PathCommand.php‰  «F e‰  ·XßZ¤      '   src/Exception/ProcessErrorException.php¸  «F e¸  õ°.¤      <?php

namespace HumbugBox436\KevinGH\RequirementChecker;

if (isset($_SERVER['BOX_REQUIREMENT_CHECKER'])) {
    $enableRequirementChecker = $_SERVER['BOX_REQUIREMENT_CHECKER'];
    if (\is_bool($enableRequirementChecker) && !$enableRequirementChecker) {
        return;
    }
    if (\is_string($enableRequirementChecker) && \in_array(\strtolower($enableRequirementChecker), ['false', '0'], \true)) {
        return;
    }
    if (!\is_bool($enableRequirementChecker) && !\is_string($enableRequirementChecker)) {
        echo \PHP_EOL . 'Unhandled value type for "BOX_REQUIREMENT_CHECKER". Got "' . \gettype($enableRequirementChecker) . '". Proceeding with the requirement checks.' . \PHP_EOL;
    }
}
if (\false === \in_array(\PHP_SAPI, array('cli', 'phpdbg', 'embed', 'micro'), \true)) {
    echo \PHP_EOL . 'The application may only be invoked from a command line, got "' . \PHP_SAPI . '"' . \PHP_EOL;
    exit(1);
}
require __DIR__ . '/../vendor/autoload.php';
if (!Checker::checkRequirements()) {
    exit(1);
}
<?php

namespace _HumbugBox89e0edca2b33;

return array (
  0 => 
  array (
    'type' => 'php',
    'condition' => '>=7.3.0',
    'message' => 'The application requires a version matching ">=7.3.0".',
    'helpMessage' => 'The application requires a version matching ">=7.3.0".',
  ),
  1 => 
  array (
    'type' => 'extension',
    'condition' => 'json',
    'message' => 'The application requires the extension "json".',
    'helpMessage' => 'The application requires the extension "json". You either need to enable it or request the application to be shipped with a polyfill for this extension.',
  ),
  2 => 
  array (
    'type' => 'extension',
    'condition' => 'json',
    'message' => 'The package "psy/psysh" requires the extension "json".',
    'helpMessage' => 'The package "psy/psysh" requires the extension "json". You either need to enable it or request the application to be shipped with a polyfill for this extension.',
  ),
  3 => 
  array (
    'type' => 'extension',
    'condition' => 'tokenizer',
    'message' => 'The package "nikic/php-parser" requires the extension "tokenizer".',
    'helpMessage' => 'The package "nikic/php-parser" requires the extension "tokenizer". You either need to enable it or request the application to be shipped with a polyfill for this extension.',
  ),
  4 => 
  array (
    'type' => 'extension',
    'condition' => 'tokenizer',
    'message' => 'The package "psy/psysh" requires the extension "tokenizer".',
    'helpMessage' => 'The package "psy/psysh" requires the extension "tokenizer". You either need to enable it or request the application to be shipped with a polyfill for this extension.',
  ),
);<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
    if (!headers_sent()) {
        header('HTTP/1.1 500 Internal Server Error');
    }
    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    if (!ini_get('display_errors')) {
        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
            fwrite(STDERR, $err);
        } elseif (!headers_sent()) {
            echo $err;
        }
    }
    trigger_error(
        $err,
        E_USER_ERROR
    );
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitHumbugBox436::getLoader();
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
);

Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    https://www.php-fig.org/psr/psr-0/
 * @see    https://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    /** @var \Closure(string):void */
    private static $includeFile;

    /** @var ?string */
    private $vendorDir;

    // PSR-4
    /**
     * @var array[]
     * @psalm-var array<string, array<string, int>>
     */
    private $prefixLengthsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, array<int, string>>
     */
    private $prefixDirsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr4 = array();

    // PSR-0
    /**
     * @var array[]
     * @psalm-var array<string, array<string, string[]>>
     */
    private $prefixesPsr0 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr0 = array();

    /** @var bool */
    private $useIncludePath = false;

    /**
     * @var string[]
     * @psalm-var array<string, string>
     */
    private $classMap = array();

    /** @var bool */
    private $classMapAuthoritative = false;

    /**
     * @var bool[]
     * @psalm-var array<string, bool>
     */
    private $missingClasses = array();

    /** @var ?string */
    private $apcuPrefix;

    /**
     * @var self[]
     */
    private static $registeredLoaders = array();

    /**
     * @param ?string $vendorDir
     */
    public function __construct($vendorDir = null)
    {
        $this->vendorDir = $vendorDir;
        self::initializeIncludeClosure();
    }

    /**
     * @return string[]
     */
    public function getPrefixes()
    {
        if (!empty($this->prefixesPsr0)) {
            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
        }

        return array();
    }

    /**
     * @return array[]
     * @psalm-return array<string, array<int, string>>
     */
    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    /**
     * @return string[] Array of classname => path
     * @psalm-return array<string, string>
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param string[] $classMap Class to filename map
     * @psalm-param array<string, string> $classMap
     *
     * @return void
     */
    public function addClassMap(array $classMap)
    {
        if ($this->classMap) {
            $this->classMap = array_merge($this->classMap, $classMap);
        } else {
            $this->classMap = $classMap;
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix, either
     * appending or prepending to the ones previously set for this prefix.
     *
     * @param string          $prefix  The prefix
     * @param string[]|string $paths   The PSR-0 root directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @return void
     */
    public function add($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            if ($prepend) {
                $this->fallbackDirsPsr0 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr0
                );
            } else {
                $this->fallbackDirsPsr0 = array_merge(
                    $this->fallbackDirsPsr0,
                    (array) $paths
                );
            }

            return;
        }

        $first = $prefix[0];
        if (!isset($this->prefixesPsr0[$first][$prefix])) {
            $this->prefixesPsr0[$first][$prefix] = (array) $paths;

            return;
        }
        if ($prepend) {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                (array) $paths,
                $this->prefixesPsr0[$first][$prefix]
            );
        } else {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                $this->prefixesPsr0[$first][$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace, either
     * appending or prepending to the ones previously set for this namespace.
     *
     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths   The PSR-4 base directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
                $this->fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr4
                );
            } else {
                $this->fallbackDirsPsr4 = array_merge(
                    $this->fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
            // Register directories for a new namespace.
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        } elseif ($prepend) {
            // Prepend directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                (array) $paths,
                $this->prefixDirsPsr4[$prefix]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                $this->prefixDirsPsr4[$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix,
     * replacing any others previously set for this prefix.
     *
     * @param string          $prefix The prefix
     * @param string[]|string $paths  The PSR-0 base directories
     *
     * @return void
     */
    public function set($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr0 = (array) $paths;
        } else {
            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace,
     * replacing any others previously set for this namespace.
     *
     * @param string          $prefix The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths  The PSR-4 base directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function setPsr4($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr4 = (array) $paths;
        } else {
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        }
    }

    /**
     * Turns on searching the include path for class files.
     *
     * @param bool $useIncludePath
     *
     * @return void
     */
    public function setUseIncludePath($useIncludePath)
    {
        $this->useIncludePath = $useIncludePath;
    }

    /**
     * Can be used to check if the autoloader uses the include path to check
     * for classes.
     *
     * @return bool
     */
    public function getUseIncludePath()
    {
        return $this->useIncludePath;
    }

    /**
     * Turns off searching the prefix and fallback directories for classes
     * that have not been registered with the class map.
     *
     * @param bool $classMapAuthoritative
     *
     * @return void
     */
    public function setClassMapAuthoritative($classMapAuthoritative)
    {
        $this->classMapAuthoritative = $classMapAuthoritative;
    }

    /**
     * Should class lookup fail if not found in the current class map?
     *
     * @return bool
     */
    public function isClassMapAuthoritative()
    {
        return $this->classMapAuthoritative;
    }

    /**
     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
     *
     * @param string|null $apcuPrefix
     *
     * @return void
     */
    public function setApcuPrefix($apcuPrefix)
    {
        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
    }

    /**
     * The APCu prefix in use, or null if APCu caching is not enabled.
     *
     * @return string|null
     */
    public function getApcuPrefix()
    {
        return $this->apcuPrefix;
    }

    /**
     * Registers this instance as an autoloader.
     *
     * @param bool $prepend Whether to prepend the autoloader or not
     *
     * @return void
     */
    public function register($prepend = false)
    {
        spl_autoload_register(array($this, 'loadClass'), true, $prepend);

        if (null === $this->vendorDir) {
            return;
        }

        if ($prepend) {
            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
        } else {
            unset(self::$registeredLoaders[$this->vendorDir]);
            self::$registeredLoaders[$this->vendorDir] = $this;
        }
    }

    /**
     * Unregisters this instance as an autoloader.
     *
     * @return void
     */
    public function unregister()
    {
        spl_autoload_unregister(array($this, 'loadClass'));

        if (null !== $this->vendorDir) {
            unset(self::$registeredLoaders[$this->vendorDir]);
        }
    }

    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return true|null True if loaded, null otherwise
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            $includeFile = self::$includeFile;
            $includeFile($file);

            return true;
        }

        return null;
    }

    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile($class)
    {
        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
            return false;
        }
        if (null !== $this->apcuPrefix) {
            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
            if ($hit) {
                return $file;
            }
        }

        $file = $this->findFileWithExtension($class, '.php');

        // Search for Hack files if we are running on HHVM
        if (false === $file && defined('HHVM_VERSION')) {
            $file = $this->findFileWithExtension($class, '.hh');
        }

        if (null !== $this->apcuPrefix) {
            apcu_add($this->apcuPrefix.$class, $file);
        }

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }

    /**
     * Returns the currently registered loaders indexed by their corresponding vendor directories.
     *
     * @return self[]
     */
    public static function getRegisteredLoaders()
    {
        return self::$registeredLoaders;
    }

    /**
     * @param  string       $class
     * @param  string       $ext
     * @return string|false
     */
    private function findFileWithExtension($class, $ext)
    {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

        $first = $class[0];
        if (isset($this->prefixLengthsPsr4[$first])) {
            $subPath = $class;
            while (false !== $lastPos = strrpos($subPath, '\\')) {
                $subPath = substr($subPath, 0, $lastPos);
                $search = $subPath . '\\';
                if (isset($this->prefixDirsPsr4[$search])) {
                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
                        if (file_exists($file = $dir . $pathEnd)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-4 fallback dirs
        foreach ($this->fallbackDirsPsr4 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
                return $file;
            }
        }

        // PSR-0 lookup
        if (false !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
        } else {
            // PEAR-like class name
            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
        }

        if (isset($this->prefixesPsr0[$first])) {
            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
                if (0 === strpos($class, $prefix)) {
                    foreach ($dirs as $dir) {
                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-0 fallback dirs
        foreach ($this->fallbackDirsPsr0 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                return $file;
            }
        }

        // PSR-0 include paths.
        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
            return $file;
        }

        return false;
    }

    /**
     * @return void
     */
    private static function initializeIncludeClosure()
    {
        if (self::$includeFile !== null) {
            return;
        }

        /**
         * Scope isolated include.
         *
         * Prevents access to $this/self from included files.
         *
         * @param  string $file
         * @return void
         */
        self::$includeFile = \Closure::bind(static function($file) {
            include $file;
        }, null, null);
    }
}
<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'HumbugBox436\\KevinGH\\RequirementChecker\\' => array($baseDir . '/src'),
    'HumbugBox436\\Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
);
<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    'HumbugBox436\\Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php',
    'HumbugBox436\\Composer\\Semver\\CompilingMatcher' => $vendorDir . '/composer/semver/src/CompilingMatcher.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\Bound' => $vendorDir . '/composer/semver/src/Constraint/Bound.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\Constraint' => $vendorDir . '/composer/semver/src/Constraint/Constraint.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\ConstraintInterface' => $vendorDir . '/composer/semver/src/Constraint/ConstraintInterface.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\MatchAllConstraint' => $vendorDir . '/composer/semver/src/Constraint/MatchAllConstraint.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\MatchNoneConstraint' => $vendorDir . '/composer/semver/src/Constraint/MatchNoneConstraint.php',
    'HumbugBox436\\Composer\\Semver\\Constraint\\MultiConstraint' => $vendorDir . '/composer/semver/src/Constraint/MultiConstraint.php',
    'HumbugBox436\\Composer\\Semver\\Interval' => $vendorDir . '/composer/semver/src/Interval.php',
    'HumbugBox436\\Composer\\Semver\\Intervals' => $vendorDir . '/composer/semver/src/Intervals.php',
    'HumbugBox436\\Composer\\Semver\\Semver' => $vendorDir . '/composer/semver/src/Semver.php',
    'HumbugBox436\\Composer\\Semver\\VersionParser' => $vendorDir . '/composer/semver/src/VersionParser.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\Checker' => $baseDir . '/src/Checker.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\IO' => $baseDir . '/src/IO.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\IsExtensionConflictFulfilled' => $baseDir . '/src/IsExtensionConflictFulfilled.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => $baseDir . '/src/IsExtensionFulfilled.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\IsFulfilled' => $baseDir . '/src/IsFulfilled.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => $baseDir . '/src/IsPhpVersionFulfilled.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\Printer' => $baseDir . '/src/Printer.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\Requirement' => $baseDir . '/src/Requirement.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\RequirementCollection' => $baseDir . '/src/RequirementCollection.php',
    'HumbugBox436\\KevinGH\\RequirementChecker\\Terminal' => $baseDir . '/src/Terminal.php',
);
<?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInitHumbugBox436
{
    public static $prefixLengthsPsr4 = array (
        'H' => 
        array (
            'HumbugBox436\\KevinGH\\RequirementChecker\\' => 40,
            'HumbugBox436\\Composer\\Semver\\' => 29,
        ),
    );

    public static $prefixDirsPsr4 = array (
        'HumbugBox436\\KevinGH\\RequirementChecker\\' => 
        array (
            0 => __DIR__ . '/../..' . '/src',
        ),
        'HumbugBox436\\Composer\\Semver\\' => 
        array (
            0 => __DIR__ . '/..' . '/composer/semver/src',
        ),
    );

    public static $classMap = array (
        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
        'HumbugBox436\\Composer\\Semver\\Comparator' => __DIR__ . '/..' . '/composer/semver/src/Comparator.php',
        'HumbugBox436\\Composer\\Semver\\CompilingMatcher' => __DIR__ . '/..' . '/composer/semver/src/CompilingMatcher.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\Bound' => __DIR__ . '/..' . '/composer/semver/src/Constraint/Bound.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\Constraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/Constraint.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\ConstraintInterface' => __DIR__ . '/..' . '/composer/semver/src/Constraint/ConstraintInterface.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\MatchAllConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/MatchAllConstraint.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\MatchNoneConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/MatchNoneConstraint.php',
        'HumbugBox436\\Composer\\Semver\\Constraint\\MultiConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/MultiConstraint.php',
        'HumbugBox436\\Composer\\Semver\\Interval' => __DIR__ . '/..' . '/composer/semver/src/Interval.php',
        'HumbugBox436\\Composer\\Semver\\Intervals' => __DIR__ . '/..' . '/composer/semver/src/Intervals.php',
        'HumbugBox436\\Composer\\Semver\\Semver' => __DIR__ . '/..' . '/composer/semver/src/Semver.php',
        'HumbugBox436\\Composer\\Semver\\VersionParser' => __DIR__ . '/..' . '/composer/semver/src/VersionParser.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\Checker' => __DIR__ . '/../..' . '/src/Checker.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\IO' => __DIR__ . '/../..' . '/src/IO.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\IsExtensionConflictFulfilled' => __DIR__ . '/../..' . '/src/IsExtensionConflictFulfilled.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => __DIR__ . '/../..' . '/src/IsExtensionFulfilled.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\IsFulfilled' => __DIR__ . '/../..' . '/src/IsFulfilled.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => __DIR__ . '/../..' . '/src/IsPhpVersionFulfilled.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\Printer' => __DIR__ . '/../..' . '/src/Printer.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\Requirement' => __DIR__ . '/../..' . '/src/Requirement.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\RequirementCollection' => __DIR__ . '/../..' . '/src/RequirementCollection.php',
        'HumbugBox436\\KevinGH\\RequirementChecker\\Terminal' => __DIR__ . '/../..' . '/src/Terminal.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->prefixLengthsPsr4 = ComposerStaticInitHumbugBox436::$prefixLengthsPsr4;
            $loader->prefixDirsPsr4 = ComposerStaticInitHumbugBox436::$prefixDirsPsr4;
            $loader->classMap = ComposerStaticInitHumbugBox436::$classMap;

        }, null, ClassLoader::class);
    }
}
<?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitHumbugBox436
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    /**
     * @return \Composer\Autoload\ClassLoader
     */
    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        spl_autoload_register(array('ComposerAutoloaderInitHumbugBox436', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
        spl_autoload_unregister(array('ComposerAutoloaderInitHumbugBox436', 'loadClassLoader'));

        require __DIR__ . '/autoload_static.php';
        call_user_func(\Composer\Autoload\ComposerStaticInitHumbugBox436::getInitializer($loader));

        $loader->setClassMapAuthoritative(true);
        $loader->register(true);

        return $loader;
    }
}
Copyright (C) 2015 Composer

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\Constraint;
use HumbugBox436\Composer\Semver\Constraint\ConstraintInterface;
class CompilingMatcher
{
    /**
    @phpstan-var
    */
    private static $compiledCheckerCache = array();
    /**
    @phpstan-var
    */
    private static $resultCache = array();
    private static $enabled;
    /**
    @phpstan-var
    */
    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);
    public static function clear()
    {
        self::$resultCache = array();
        self::$compiledCheckerCache = array();
    }
    /**
    @phpstan-param
    */
    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);
    }
}
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\Constraint;
class Interval
{
    private $start;
    private $end;
    public function __construct(Constraint $start, Constraint $end)
    {
        $this->start = $start;
        $this->end = $end;
    }
    public function getStart()
    {
        return $this->start;
    }
    public function getEnd()
    {
        return $this->end;
    }
    public static function fromZero()
    {
        static $zero;
        if (null === $zero) {
            $zero = new Constraint('>=', '0.0.0.0-dev');
        }
        return $zero;
    }
    public static function untilPositiveInfinity()
    {
        static $positiveInfinity;
        if (null === $positiveInfinity) {
            $positiveInfinity = new Constraint('<', \PHP_INT_MAX . '.0.0.0');
        }
        return $positiveInfinity;
    }
    public static function any()
    {
        return new self(self::fromZero(), self::untilPositiveInfinity());
    }
    public static function anyDev()
    {
        return array('names' => array(), 'exclude' => \true);
    }
    public static function noDev()
    {
        return array('names' => array(), 'exclude' => \false);
    }
}
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\Constraint;
class Comparator
{
    public static function greaterThan($version1, $version2)
    {
        return self::compare($version1, '>', $version2);
    }
    public static function greaterThanOrEqualTo($version1, $version2)
    {
        return self::compare($version1, '>=', $version2);
    }
    public static function lessThan($version1, $version2)
    {
        return self::compare($version1, '<', $version2);
    }
    public static function lessThanOrEqualTo($version1, $version2)
    {
        return self::compare($version1, '<=', $version2);
    }
    public static function equalTo($version1, $version2)
    {
        return self::compare($version1, '==', $version2);
    }
    public static function notEqualTo($version1, $version2)
    {
        return self::compare($version1, '!=', $version2);
    }
    /**
    @phpstan-param
    */
    public static function compare($version1, $operator, $version2)
    {
        $constraint = new Constraint($operator, $version2);
        return $constraint->matchSpecific(new Constraint('==', $version1), \true);
    }
}
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\Constraint;
use HumbugBox436\Composer\Semver\Constraint\ConstraintInterface;
use HumbugBox436\Composer\Semver\Constraint\MatchAllConstraint;
use HumbugBox436\Composer\Semver\Constraint\MatchNoneConstraint;
use HumbugBox436\Composer\Semver\Constraint\MultiConstraint;
class Intervals
{
    /**
    @phpstan-var
    */
    private static $intervalsCache = array();
    /**
    @phpstan-var
    */
    private static $opSortOrder = array('>=' => -3, '<' => -2, '>' => 2, '<=' => 3);
    public static function clear()
    {
        self::$intervalsCache = array();
    }
    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;
    }
    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;
    }
    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 ($interval->getEnd()->getOperator() === '<' && $i + 1 < $count) {
                    $nextInterval = $intervals['numeric'][$i + 1];
                    if ($interval->getEnd()->getVersion() === $nextInterval->getStart()->getVersion() && $nextInterval->getStart()->getOperator() === '>') {
                        if (\count($unEqualConstraints) === 0 && (string) $interval->getStart() !== (string) Interval::fromZero()) {
                            $unEqualConstraints[] = $interval->getStart();
                        }
                        $unEqualConstraints[] = new Constraint('!=', $interval->getEnd()->getVersion());
                        continue;
                    }
                }
                if (\count($unEqualConstraints) > 0) {
                    if ((string) $interval->getEnd() !== (string) Interval::untilPositiveInfinity()) {
                        $unEqualConstraints[] = $interval->getEnd();
                    }
                    if (\count($unEqualConstraints) > 1) {
                        $constraints[] = new MultiConstraint($unEqualConstraints, \true);
                    } else {
                        $constraints[] = $unEqualConstraints[0];
                    }
                    $unEqualConstraints = array();
                    continue;
                }
                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();
                }
            }
        } else {
            foreach ($intervals['branches']['names'] as $branchName) {
                if ($intervals['branches']['exclude']) {
                    $devConstraints[] = new Constraint('!=', $branchName);
                } else {
                    $devConstraints[] = new Constraint('==', $branchName);
                }
            }
            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);
            }
            $constraints = \array_merge($constraints, $devConstraints);
        }
        if (\count($constraints) > 1) {
            return new MultiConstraint($constraints, \false);
        }
        if (\count($constraints) === 1) {
            return $constraints[0];
        }
        return new MatchNoneConstraint();
    }
    /**
    @phpstan-return
    */
    public static function get(ConstraintInterface $constraint)
    {
        $key = (string) $constraint;
        if (!isset(self::$intervalsCache[$key])) {
            self::$intervalsCache[$key] = self::generateIntervals($constraint);
        }
        return self::$intervalsCache[$key];
    }
    /**
    @phpstan-return
    */
    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']) {
                        $branches['names'] = \array_intersect($branches['names'], $b['names']);
                    } else {
                        $branches['exclude'] = \true;
                        $branches['names'] = \array_diff($b['names'], $branches['names']);
                    }
                } else {
                    if ($branches['exclude']) {
                        $branches['names'] = \array_diff($branches['names'], $b['names']);
                    } else {
                        $branches['names'] = \array_merge($branches['names'], $b['names']);
                    }
                }
            }
        } else {
            $branches = Interval::anyDev();
            foreach ($constraintBranches as $b) {
                if ($b['exclude']) {
                    if ($branches['exclude']) {
                        $branches['names'] = \array_merge($branches['names'], $b['names']);
                    } else {
                        $branches['names'] = \array_diff($branches['names'], $b['names']);
                    }
                } else {
                    if ($branches['exclude']) {
                        $branches['names'] = \array_diff($b['names'], $branches['names']);
                        $branches['exclude'] = \false;
                    } else {
                        $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) {
                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
    */
    private static function generateSingleConstraintIntervals(Constraint $constraint)
    {
        $op = $constraint->getOperator();
        if (\strpos($constraint->getVersion(), 'dev-') === 0) {
            $intervals = array();
            $branches = array('names' => array(), 'exclude' => \false);
            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 === '!=') {
            return array('numeric' => array(new Interval(Interval::fromZero(), new Constraint('<', $constraint->getVersion())), new Interval(new Constraint('>', $constraint->getVersion()), Interval::untilPositiveInfinity())), 'branches' => Interval::anyDev());
        }
        return array('numeric' => array(new Interval(new Constraint('>=', $constraint->getVersion()), new Constraint('<=', $constraint->getVersion()))), 'branches' => Interval::noDev());
    }
}
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\Constraint;
class Semver
{
    const SORT_ASC = 1;
    const SORT_DESC = -1;
    private static $versionParser;
    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);
    }
    public static function satisfiedBy(array $versions, $constraints)
    {
        $versions = \array_filter($versions, function ($version) use($constraints) {
            return Semver::satisfies($version, $constraints);
        });
        return \array_values($versions);
    }
    public static function sort(array $versions)
    {
        return self::usort($versions, self::SORT_ASC);
    }
    public static function rsort(array $versions)
    {
        return self::usort($versions, self::SORT_DESC);
    }
    private static function usort(array $versions, $direction)
    {
        if (null === self::$versionParser) {
            self::$versionParser = new VersionParser();
        }
        $versionParser = self::$versionParser;
        $normalized = array();
        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;
        });
        $sorted = array();
        foreach ($normalized as $item) {
            $sorted[] = $versions[$item[1]];
        }
        return $sorted;
    }
}
<?php

namespace HumbugBox436\Composer\Semver;

use HumbugBox436\Composer\Semver\Constraint\ConstraintInterface;
use HumbugBox436\Composer\Semver\Constraint\MatchAllConstraint;
use HumbugBox436\Composer\Semver\Constraint\MultiConstraint;
use HumbugBox436\Composer\Semver\Constraint\Constraint;
class VersionParser
{
    private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\\d+)*+)?)?([.-]?dev)?';
    private static $stabilitiesRegex = 'stable|RC|beta|alpha|dev';
    /**
    @phpstan-return
    */
    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';
    }
    public static function normalizeStability($stability)
    {
        $stability = \strtolower((string) $stability);
        return $stability === 'rc' ? 'RC' : $stability;
    }
    public function normalize($version, $fullVersion = null)
    {
        $version = \trim((string) $version);
        $origVersion = $version;
        if (null === $fullVersion) {
            $fullVersion = $version;
        }
        if (\preg_match('{^([^,\\s]++) ++as ++([^,\\s]++)$}', $version, $match)) {
            $version = $match[1];
        }
        if (\preg_match('{@(?:' . self::$stabilitiesRegex . ')$}i', $version, $match)) {
            $version = \substr($version, 0, \strlen($version) - \strlen($match[0]));
        }
        if (\in_array($version, array('master', 'trunk', 'default'), \true)) {
            $version = 'dev-' . $version;
        }
        if (\stripos($version, 'dev-') === 0) {
            return 'dev-' . \substr($version, 4);
        }
        if (\preg_match('{^([^,\\s+]++)\\+[^\\s]++$}', $version, $match)) {
            $version = $match[1];
        }
        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;
        } elseif (\preg_match('{^v?(\\d{4}(?:[.:-]?\\d{2}){1,6}(?:[.:-]?\\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) {
            $version = \preg_replace('{\\D}', '.', $matches[1]);
            $index = 2;
        }
        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;
        }
        if (\preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
            try {
                $normalized = $this->normalizeBranch($match[1]);
                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);
    }
    public function parseNumericAliasPrefix($branch)
    {
        if (\preg_match('{^(?P<version>(\\d++\\.)*\\d++)(?:\\.x)?-dev$}i', (string) $branch, $matches)) {
            return $matches['version'] . '.';
        }
        return \false;
    }
    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;
    }
    public function normalizeDefaultBranch($name)
    {
        if ($name === 'dev-master' || $name === 'dev-default' || $name === 'dev-trunk') {
            return '9999999-dev';
        }
        return (string) $name;
    }
    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 $constraints) {
            $andConstraints = \preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraints);
            if (\false === $andConstraints) {
                throw new \RuntimeException('Failed to preg_split string: ' . $constraints);
            }
            if (\count($andConstraints) > 1) {
                $constraintObjects = array();
                foreach ($andConstraints as $constraint) {
                    foreach ($this->parseConstraint($constraint) as $parsedConstraint) {
                        $constraintObjects[] = $parsedConstraint;
                    }
                }
            } else {
                $constraintObjects = $this->parseConstraint($andConstraints[0]);
            }
            if (1 === \count($constraintObjects)) {
                $constraint = $constraintObjects[0];
            } else {
                $constraint = new MultiConstraint($constraintObjects);
            }
            $orGroups[] = $constraint;
        }
        $constraint = MultiConstraint::create($orGroups, \false);
        $constraint->setPrettyString($prettyConstraint);
        return $constraint;
    }
    /**
    @phpstan-return
    */
    private function parseConstraint($constraint)
    {
        if (\preg_match('{^([^,\\s]++) ++as ++([^,\\s]++)$}', $constraint, $match)) {
            $constraint = $match[1];
        }
        if (\preg_match('{^([^,\\s]*?)@(' . self::$stabilitiesRegex . ')$}i', $constraint, $match)) {
            $constraint = '' !== $match[1] ? $match[1] : '*';
            if ($match[2] !== 'stable') {
                $stabilityModifier = $match[2];
            }
        }
        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]+)?';
        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');
            }
            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;
            }
            if (!empty($matches[8])) {
                $position++;
            }
            $stabilitySuffix = '';
            if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
                $stabilitySuffix .= '-dev';
            }
            $lowVersion = $this->normalize(\substr($constraint . $stabilitySuffix, 1));
            $lowerBound = new Constraint('>=', $lowVersion);
            $highPosition = \max(1, $position - 1);
            $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev';
            $upperBound = new Constraint('<', $highVersion);
            return array($lowerBound, $upperBound);
        }
        if (\preg_match('{^\\^' . $versionRegex . '($)}i', $constraint, $matches)) {
            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;
            }
            $stabilitySuffix = '';
            if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
                $stabilitySuffix .= '-dev';
            }
            $lowVersion = $this->normalize(\substr($constraint . $stabilitySuffix, 1));
            $lowerBound = new Constraint('>=', $lowVersion);
            $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
            $upperBound = new Constraint('<', $highVersion);
            return array($lowerBound, $upperBound);
        }
        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));
        }
        if (\preg_match('{^(?P<from>' . $versionRegex . ') +- +(?P<to>' . $versionRegex . ')($)}i', $constraint, $matches)) {
            $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]);
                $this->normalize($matches['to']);
                $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[12]) ? 1 : 2, 1) . '-dev';
                $upperBound = new Constraint('<', $highVersion);
            }
            return array($lowerBound, $upperBound);
        }
        if (\preg_match('{^(<>|!=|>=?|<=?|==?)?\\s*(.*)}', $constraint, $matches)) {
            try {
                try {
                    $version = $this->normalize($matches[2]);
                } catch (\UnexpectedValueException $e) {
                    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);
    }
    /**
    @phpstan-param
    */
    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] < 0) {
                    $matches[$i] = $pad;
                    --$position;
                    if ($i === 1) {
                        return null;
                    }
                }
            }
        }
        return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4];
    }
    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;
        }
    }
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

interface ConstraintInterface
{
    public function matches(ConstraintInterface $provider);
    /**
    @phpstan-param
    */
    public function compile($otherOperator);
    public function getUpperBound();
    public function getLowerBound();
    public function getPrettyString();
    public function setPrettyString($prettyString);
    public function __toString();
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

class MultiConstraint implements ConstraintInterface
{
    /**
    @phpstan-var
    */
    protected $constraints;
    protected $prettyString;
    protected $string;
    protected $conjunctive;
    protected $lowerBound;
    protected $upperBound;
    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;
    }
    public function getConstraints()
    {
        return $this->constraints;
    }
    public function isConjunctive()
    {
        return $this->conjunctive;
    }
    public function isDisjunctive()
    {
        return !$this->conjunctive;
    }
    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);
    }
    public function matches(ConstraintInterface $provider)
    {
        if (\false === $this->conjunctive) {
            foreach ($this->constraints as $constraint) {
                if ($provider->matches($constraint)) {
                    return \true;
                }
            }
            return \false;
        }
        if ($provider instanceof MultiConstraint && $provider->isDisjunctive()) {
            return $provider->matches($this);
        }
        foreach ($this->constraints as $constraint) {
            if (!$provider->matches($constraint)) {
                return \false;
            }
        }
        return \true;
    }
    public function setPrettyString($prettyString)
    {
        $this->prettyString = $prettyString;
    }
    public function getPrettyString()
    {
        if ($this->prettyString) {
            return $this->prettyString;
        }
        return (string) $this;
    }
    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) . ']';
    }
    public function getLowerBound()
    {
        $this->extractBounds();
        if (null === $this->lowerBound) {
            throw new \LogicException('extractBounds should have populated the lowerBound property');
        }
        return $this->lowerBound;
    }
    public function getUpperBound()
    {
        $this->extractBounds();
        if (null === $this->upperBound) {
            throw new \LogicException('extractBounds should have populated the upperBound property');
        }
        return $this->upperBound;
    }
    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);
    }
    /**
    @phpstan-return
    */
    private static function optimizeConstraints(array $constraints, $conjunctive)
    {
        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);
            }
        }
        return null;
    }
    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();
            }
        }
    }
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

class Constraint implements ConstraintInterface
{
    const OP_EQ = 0;
    const OP_LT = 1;
    const OP_LE = 2;
    const OP_GT = 3;
    const OP_GE = 4;
    const OP_NE = 5;
    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 = '<>';
    /**
    @phpstan-var
    */
    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);
    /**
    @phpstan-var
    */
    private static $transOpInt = array(self::OP_EQ => '==', self::OP_LT => '<', self::OP_LE => '<=', self::OP_GT => '>', self::OP_GE => '>=', self::OP_NE => '!=');
    /**
    @phpstan-var
    */
    protected $operator;
    protected $version;
    protected $prettyString;
    protected $lowerBound;
    protected $upperBound;
    /**
    @phpstan-param
    */
    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;
    }
    public function getVersion()
    {
        return $this->version;
    }
    /**
    @phpstan-return
    */
    public function getOperator()
    {
        return self::$transOpInt[$this->operator];
    }
    public function matches(ConstraintInterface $provider)
    {
        if ($provider instanceof self) {
            return $this->matchSpecific($provider);
        }
        return $provider->matches($this);
    }
    public function setPrettyString($prettyString)
    {
        $this->prettyString = $prettyString;
    }
    public function getPrettyString()
    {
        if ($this->prettyString) {
            return $this->prettyString;
        }
        return $this->__toString();
    }
    /**
    @phpstan-return
    */
    public static function getSupportedOperators()
    {
        return \array_keys(self::$transOpStr);
    }
    /**
    @phpstan-param
    @phpstan-return
    */
    public static function getOperatorConstant($operator)
    {
        return self::$transOpStr[$operator];
    }
    /**
    @phpstan-param
    */
    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;
        }
        if (!$compareBranches && ($aIsBranch || $bIsBranch)) {
            return \false;
        }
        return \version_compare($a, $b, $operator);
    }
    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 {
            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);
    }
    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;
        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);
        }
        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)) {
            return !(self::$transOpInt[$provider->operator] === $providerNoEqualOp && self::$transOpInt[$this->operator] !== $noEqualOp && \version_compare($provider->version, $this->version, '=='));
        }
        return \false;
    }
    public function __toString()
    {
        return self::$transOpInt[$this->operator] . ' ' . $this->version;
    }
    public function getLowerBound()
    {
        $this->extractBounds();
        return $this->lowerBound;
    }
    public function getUpperBound()
    {
        $this->extractBounds();
        return $this->upperBound;
    }
    private function extractBounds()
    {
        if (null !== $this->lowerBound) {
            return;
        }
        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;
        }
    }
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

class MatchAllConstraint implements ConstraintInterface
{
    protected $prettyString;
    public function matches(ConstraintInterface $provider)
    {
        return \true;
    }
    public function compile($otherOperator)
    {
        return 'true';
    }
    public function setPrettyString($prettyString)
    {
        $this->prettyString = $prettyString;
    }
    public function getPrettyString()
    {
        if ($this->prettyString) {
            return $this->prettyString;
        }
        return (string) $this;
    }
    public function __toString()
    {
        return '*';
    }
    public function getUpperBound()
    {
        return Bound::positiveInfinity();
    }
    public function getLowerBound()
    {
        return Bound::zero();
    }
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

class MatchNoneConstraint implements ConstraintInterface
{
    protected $prettyString;
    public function matches(ConstraintInterface $provider)
    {
        return \false;
    }
    public function compile($otherOperator)
    {
        return 'false';
    }
    public function setPrettyString($prettyString)
    {
        $this->prettyString = $prettyString;
    }
    public function getPrettyString()
    {
        if ($this->prettyString) {
            return $this->prettyString;
        }
        return (string) $this;
    }
    public function __toString()
    {
        return '[]';
    }
    public function getUpperBound()
    {
        return new Bound('0.0.0.0-dev', \false);
    }
    public function getLowerBound()
    {
        return new Bound('0.0.0.0-dev', \false);
    }
}
<?php

namespace HumbugBox436\Composer\Semver\Constraint;

class Bound
{
    private $version;
    private $isInclusive;
    public function __construct($version, $isInclusive)
    {
        $this->version = $version;
        $this->isInclusive = $isInclusive;
    }
    public function getVersion()
    {
        return $this->version;
    }
    public function isInclusive()
    {
        return $this->isInclusive;
    }
    public function isZero()
    {
        return $this->getVersion() === '0.0.0.0-dev' && $this->isInclusive();
    }
    public function isPositiveInfinity()
    {
        return $this->getVersion() === \PHP_INT_MAX . '.0.0.0' && !$this->isInclusive();
    }
    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 ($this == $other) {
            return \false;
        }
        $compareResult = \version_compare($this->getVersion(), $other->getVersion());
        if (0 !== $compareResult) {
            return ('>' === $operator ? 1 : -1) === $compareResult;
        }
        return '>' === $operator ? $other->isInclusive() : !$other->isInclusive();
    }
    public function __toString()
    {
        return \sprintf('%s [%s]', $this->getVersion(), $this->isInclusive() ? 'inclusive' : 'exclusive');
    }
    public static function zero()
    {
        return new Bound('0.0.0.0-dev', \true);
    }
    public static function positiveInfinity()
    {
        return new Bound(\PHP_INT_MAX . '.0.0.0', \false);
    }
}
<?php

namespace HumbugBox436\Composer;

use HumbugBox436\Composer\Autoload\ClassLoader;
use HumbugBox436\Composer\Semver\VersionParser;
class InstalledVersions
{
    /**
    @psalm-var
    */
    private static $installed;
    private static $canGetVendors;
    /**
    @psalm-var
    */
    private static $installedByVendor = array();
    /**
    @psalm-return
    */
    public static function getInstalledPackages()
    {
        $packages = array();
        foreach (self::getInstalled() as $installed) {
            $packages[] = \array_keys($installed['versions']);
        }
        if (1 === \count($packages)) {
            return $packages[0];
        }
        return \array_keys(\array_flip(\call_user_func_array('array_merge', $packages)));
    }
    /**
    @psalm-return
    */
    public static function getInstalledPackagesByType($type)
    {
        $packagesByType = array();
        foreach (self::getInstalled() as $installed) {
            foreach ($installed['versions'] as $name => $package) {
                if (isset($package['type']) && $package['type'] === $type) {
                    $packagesByType[] = $name;
                }
            }
        }
        return $packagesByType;
    }
    public static function isInstalled($packageName, $includeDevRequirements = \true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }
        return \false;
    }
    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    {
        $constraint = $parser->parseConstraints($constraint);
        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
        return $provided->matches($constraint);
    }
    public static function getVersionRanges($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            $ranges = array();
            if (isset($installed['versions'][$packageName]['pretty_version'])) {
                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
            }
            if (\array_key_exists('aliases', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['aliases']);
            }
            if (\array_key_exists('replaced', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['replaced']);
            }
            if (\array_key_exists('provided', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['provided']);
            }
            return \implode(' || ', $ranges);
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['version'])) {
                return null;
            }
            return $installed['versions'][$packageName]['version'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getPrettyVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
                return null;
            }
            return $installed['versions'][$packageName]['pretty_version'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getReference($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['reference'])) {
                return null;
            }
            return $installed['versions'][$packageName]['reference'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getInstallPath($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    /**
    @psalm-return
    */
    public static function getRootPackage()
    {
        $installed = self::getInstalled();
        return $installed[0]['root'];
    }
    /**
    @psalm-return
    */
    public static function getRawData()
    {
        @\trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', \E_USER_DEPRECATED);
        if (null === self::$installed) {
            if (\substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = (include __DIR__ . '/installed.php');
            } else {
                self::$installed = array();
            }
        }
        return self::$installed;
    }
    /**
    @psalm-return
    */
    public static function getAllRawData()
    {
        return self::getInstalled();
    }
    /**
    @psalm-param
    */
    public static function reload($data)
    {
        self::$installed = $data;
        self::$installedByVendor = array();
    }
    /**
    @psalm-return
    */
    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = \method_exists('HumbugBox436\\Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');
        }
        $installed = array();
        if (self::$canGetVendors) {
            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
                if (isset(self::$installedByVendor[$vendorDir])) {
                    $installed[] = self::$installedByVendor[$vendorDir];
                } elseif (\is_file($vendorDir . '/composer/installed.php')) {
                    $installed[] = self::$installedByVendor[$vendorDir] = (require $vendorDir . '/composer/installed.php');
                    if (null === self::$installed && \strtr($vendorDir . '/composer', '\\', '/') === \strtr(__DIR__, '\\', '/')) {
                        self::$installed = $installed[\count($installed) - 1];
                    }
                }
            }
        }
        if (null === self::$installed) {
            if (\substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = (require __DIR__ . '/installed.php');
            } else {
                self::$installed = array();
            }
        }
        $installed[] = self::$installed;
        return $installed;
    }
}
<?php

namespace HumbugBox436;

return array('root' => array('name' => 'humbug/requirement-checker', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '85545a4ada048b26040bc54ee81e2b87e84a3ebc', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \true), 'versions' => array('composer/semver' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/instantiator' => array('pretty_version' => '1.4.1', 'version' => '1.4.1.0', 'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/instantiator', 'aliases' => array(), 'dev_requirement' => \true), 'ergebnis/composer-normalize' => array('pretty_version' => '2.29.0', 'version' => '2.29.0.0', 'reference' => 'fad0e99b16c625817a5bfd910e4d7e31999c53b2', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../ergebnis/composer-normalize', 'aliases' => array(), 'dev_requirement' => \true), 'ergebnis/json-normalizer' => array('pretty_version' => '2.1.0', 'version' => '2.1.0.0', 'reference' => '2039eb11131a243b9204bf51219baa08935e6b1d', 'type' => 'library', 'install_path' => __DIR__ . '/../ergebnis/json-normalizer', 'aliases' => array(), 'dev_requirement' => \true), 'ergebnis/json-printer' => array('pretty_version' => '3.3.0', 'version' => '3.3.0.0', 'reference' => '18920367473b099633f644f0ca6dc8794345148f', 'type' => 'library', 'install_path' => __DIR__ . '/../ergebnis/json-printer', 'aliases' => array(), 'dev_requirement' => \true), 'ergebnis/json-schema-validator' => array('pretty_version' => '2.0.0', 'version' => '2.0.0.0', 'reference' => 'dacd8a47c1cc2c426ec71e952da3609ebe901fac', 'type' => 'library', 'install_path' => __DIR__ . '/../ergebnis/json-schema-validator', 'aliases' => array(), 'dev_requirement' => \true), 'fidry/makefile' => array('pretty_version' => '0.2.1', 'version' => '0.2.1.0', 'reference' => '50abe0df37018458b1ab355e56063618d5ba8d10', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/makefile', 'aliases' => array(), 'dev_requirement' => \true), 'humbug/requirement-checker' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '85545a4ada048b26040bc54ee81e2b87e84a3ebc', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'justinrainbow/json-schema' => array('pretty_version' => '5.2.12', 'version' => '5.2.12.0', 'reference' => 'ad87d5a5ca981228e0e205c2bc7dfb8e24559b60', 'type' => 'library', 'install_path' => __DIR__ . '/../justinrainbow/json-schema', 'aliases' => array(), 'dev_requirement' => \true), 'localheinz/diff' => array('pretty_version' => '1.1.1', 'version' => '1.1.1.0', 'reference' => '851bb20ea8358c86f677f5f111c4ab031b1c764c', 'type' => 'library', 'install_path' => __DIR__ . '/../localheinz/diff', 'aliases' => array(), 'dev_requirement' => \true), 'myclabs/deep-copy' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), 'dev_requirement' => \true), 'nikic/php-parser' => array('pretty_version' => 'v4.14.0', 'version' => '4.14.0.0', 'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \true), 'phar-io/manifest' => array('pretty_version' => '2.0.3', 'version' => '2.0.3.0', 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/manifest', 'aliases' => array(), 'dev_requirement' => \true), 'phar-io/version' => array('pretty_version' => '3.2.1', 'version' => '3.2.1.0', 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/version', 'aliases' => array(), 'dev_requirement' => \true), 'phpdocumentor/reflection-common' => array('pretty_version' => '2.2.0', 'version' => '2.2.0.0', 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', 'type' => 'library', 'install_path' => __DIR__ . '/../phpdocumentor/reflection-common', 'aliases' => array(), 'dev_requirement' => \true), 'phpdocumentor/reflection-docblock' => array('pretty_version' => '5.3.0', 'version' => '5.3.0.0', 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', 'type' => 'library', 'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock', 'aliases' => array(), 'dev_requirement' => \true), 'phpdocumentor/type-resolver' => array('pretty_version' => '1.6.1', 'version' => '1.6.1.0', 'reference' => '77a32518733312af16a44300404e945338981de3', 'type' => 'library', 'install_path' => __DIR__ . '/../phpdocumentor/type-resolver', 'aliases' => array(), 'dev_requirement' => \true), 'phpspec/prophecy' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13', 'type' => 'library', 'install_path' => __DIR__ . '/../phpspec/prophecy', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/php-code-coverage' => array('pretty_version' => '9.2.15', 'version' => '9.2.15.0', 'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/php-file-iterator' => array('pretty_version' => '3.0.6', 'version' => '3.0.6.0', 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/php-invoker' => array('pretty_version' => '3.1.1', 'version' => '3.1.1.0', 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-invoker', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/php-text-template' => array('pretty_version' => '2.0.4', 'version' => '2.0.4.0', 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-text-template', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/php-timer' => array('pretty_version' => '5.0.3', 'version' => '5.0.3.0', 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-timer', 'aliases' => array(), 'dev_requirement' => \true), 'phpunit/phpunit' => array('pretty_version' => '9.5.21', 'version' => '9.5.21.0', 'reference' => '0e32b76be457de00e83213528f6bb37e2a38fcb1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/phpunit', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/cli-parser' => array('pretty_version' => '1.0.1', 'version' => '1.0.1.0', 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/cli-parser', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/code-unit' => array('pretty_version' => '1.0.8', 'version' => '1.0.8.0', 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/code-unit-reverse-lookup' => array('pretty_version' => '2.0.3', 'version' => '2.0.3.0', 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/comparator' => array('pretty_version' => '4.0.6', 'version' => '4.0.6.0', 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/comparator', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/complexity' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/complexity', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/diff' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/environment' => array('pretty_version' => '5.1.4', 'version' => '5.1.4.0', 'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/environment', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/exporter' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/exporter', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/global-state' => array('pretty_version' => '5.0.5', 'version' => '5.0.5.0', 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/global-state', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/lines-of-code' => array('pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/lines-of-code', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/object-enumerator' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-enumerator', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/object-reflector' => array('pretty_version' => '2.0.4', 'version' => '2.0.4.0', 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-reflector', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/recursion-context' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/recursion-context', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/resource-operations' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/resource-operations', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/type' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'b233b84bc4465aff7b57cf1c4bc75c86d00d6dad', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/type', 'aliases' => array(), 'dev_requirement' => \true), 'sebastian/version' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/version', 'aliases' => array(), 'dev_requirement' => \true), 'symfony/polyfill-ctype' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => \true), 'symfony/polyfill-php80' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), 'dev_requirement' => \true), 'symfony/polyfill-php81' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), 'dev_requirement' => \true), 'symfony/yaml' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => '2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \true), 'thecodingmachine/safe' => array('pretty_version' => 'v2.4.0', 'version' => '2.4.0.0', 'reference' => 'e788f3d09dcd36f806350aedb77eac348fafadd3', 'type' => 'library', 'install_path' => __DIR__ . '/../thecodingmachine/safe', 'aliases' => array(), 'dev_requirement' => \true), 'theseer/tokenizer' => array('pretty_version' => '1.2.1', 'version' => '1.2.1.0', 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', 'type' => 'library', 'install_path' => __DIR__ . '/../theseer/tokenizer', 'aliases' => array(), 'dev_requirement' => \true), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \true)));
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use function exec;
use function fclose;
use function fopen;
use function function_exists;
use function getenv;
use function is_resource;
use function preg_match;
use function proc_close;
use function proc_open;
use function sapi_windows_vt100_support;
use function stream_get_contents;
use function trim;
use const DIRECTORY_SEPARATOR;
class Terminal
{
    private static $width;
    private static $height;
    private static $stty;
    public function getWidth() : int
    {
        $width = getenv('COLUMNS');
        if (\false !== $width) {
            return (int) trim($width);
        }
        if (!isset(self::$width)) {
            self::initDimensions();
        }
        return self::$width ?: 80;
    }
    public function getHeight() : int
    {
        $height = getenv('LINES');
        if (\false !== $height) {
            return (int) trim($height);
        }
        if (!isset(self::$height)) {
            self::initDimensions();
        }
        return self::$height ?: 50;
    }
    public static function hasSttyAvailable() : bool
    {
        if (isset(self::$stty)) {
            return self::$stty;
        }
        if (!function_exists('exec')) {
            return \false;
        }
        exec('stty 2>&1', $output, $exitcode);
        return self::$stty = 0 === $exitcode;
    }
    private static function initDimensions() : void
    {
        if ('\\' === DIRECTORY_SEPARATOR) {
            if (preg_match('/^(\\d+)x(\\d+)(?: \\((\\d+)x(\\d+)\\))?$/', trim(getenv('ANSICON')), $matches)) {
                self::$width = (int) $matches[1];
                self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
            } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) {
                self::initDimensionsUsingStty();
            } elseif (null !== ($dimensions = self::getConsoleMode())) {
                self::$width = (int) $dimensions[0];
                self::$height = (int) $dimensions[1];
            }
        } else {
            self::initDimensionsUsingStty();
        }
    }
    private static function hasVt100Support() : bool
    {
        return function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'wb'));
    }
    private static function initDimensionsUsingStty() : void
    {
        if ($sttyString = self::getSttyColumns()) {
            if (preg_match('/rows.(\\d+);.columns.(\\d+);/i', $sttyString, $matches)) {
                self::$width = (int) $matches[2];
                self::$height = (int) $matches[1];
            } elseif (preg_match('/;.(\\d+).rows;.(\\d+).columns/i', $sttyString, $matches)) {
                self::$width = (int) $matches[2];
                self::$height = (int) $matches[1];
            }
        }
    }
    private static function getConsoleMode() : ?array
    {
        $info = self::readFromProcess('mode CON');
        if (null === $info || !preg_match('/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/', $info, $matches)) {
            return null;
        }
        return [(int) $matches[2], (int) $matches[1]];
    }
    private static function getSttyColumns() : ?string
    {
        return self::readFromProcess('stty -a | grep columns');
    }
    private static function readFromProcess(string $command) : ?string
    {
        if (!function_exists('proc_open')) {
            return null;
        }
        $descriptorspec = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
        $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => \true]);
        if (!is_resource($process)) {
            return null;
        }
        $info = stream_get_contents($pipes[1]);
        fclose($pipes[1]);
        fclose($pipes[2]);
        proc_close($process);
        return $info;
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use function fstat;
use function function_exists;
use function getenv;
use function implode;
use function posix_isatty;
use function preg_match;
use function preg_quote;
use function sapi_windows_vt100_support;
use function sprintf;
use function str_replace;
use function stream_isatty;
use const DIRECTORY_SEPARATOR;
use const STDOUT;
final class IO
{
    public const VERBOSITY_QUIET = 16;
    public const VERBOSITY_NORMAL = 32;
    public const VERBOSITY_VERBOSE = 64;
    public const VERBOSITY_VERY_VERBOSE = 128;
    public const VERBOSITY_DEBUG = 256;
    private $interactive;
    private $verbosity = self::VERBOSITY_NORMAL;
    private $colorSupport;
    private $options;
    public function __construct()
    {
        $this->options = implode(' ', $_SERVER['argv']);
        $shellVerbosity = $this->configureVerbosity();
        $this->interactive = $this->checkInteractivity($shellVerbosity);
        $this->colorSupport = $this->checkColorSupport();
    }
    public function isInteractive() : bool
    {
        return $this->interactive;
    }
    public function getVerbosity() : int
    {
        return $this->verbosity;
    }
    public function hasColorSupport() : bool
    {
        return $this->colorSupport;
    }
    public function hasParameter($values) : bool
    {
        $values = (array) $values;
        foreach ($values as $value) {
            $regexp = sprintf('/\\s%s\\b/', str_replace(' ', '\\s+', preg_quote($value, '/')));
            if (1 === preg_match($regexp, $this->options)) {
                return \true;
            }
        }
        return \false;
    }
    private function checkInteractivity(int $shellVerbosity) : bool
    {
        if (-1 === $shellVerbosity) {
            return \false;
        }
        if (\true === $this->hasParameter(['--no-interaction', '-n'])) {
            return \false;
        }
        if (function_exists('posix_isatty') && !@posix_isatty(STDOUT) && \false === getenv('SHELL_INTERACTIVE')) {
            return \false;
        }
        return \true;
    }
    private function configureVerbosity() : int
    {
        switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) {
            case -1:
                $this->verbosity = self::VERBOSITY_QUIET;
                break;
            case 1:
                $this->verbosity = self::VERBOSITY_VERBOSE;
                break;
            case 2:
                $this->verbosity = self::VERBOSITY_VERY_VERBOSE;
                break;
            case 3:
                $this->verbosity = self::VERBOSITY_DEBUG;
                break;
            default:
                $shellVerbosity = 0;
                break;
        }
        if ($this->hasParameter(['--quiet', '-q'])) {
            $this->verbosity = self::VERBOSITY_QUIET;
            $shellVerbosity = -1;
        } elseif ($this->hasParameter(['-vvv', '--verbose=3', '--verbose 3'])) {
            $this->verbosity = self::VERBOSITY_DEBUG;
            $shellVerbosity = 3;
        } elseif ($this->hasParameter(['-vv', '--verbose=2', '--verbose 2'])) {
            $this->verbosity = self::VERBOSITY_VERY_VERBOSE;
            $shellVerbosity = 2;
        } elseif ($this->hasParameter(['-v', '--verbose=1', '--verbose 1', '--verbose'])) {
            $this->verbosity = self::VERBOSITY_VERBOSE;
            $shellVerbosity = 1;
        }
        return $shellVerbosity;
    }
    private function checkColorSupport() : bool
    {
        if ($this->hasParameter(['--ansi'])) {
            return \true;
        }
        if ($this->hasParameter(['--no-ansi'])) {
            return \false;
        }
        if (DIRECTORY_SEPARATOR === '\\') {
            return function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT) || \false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
        }
        if (function_exists('stream_isatty')) {
            return stream_isatty(STDOUT);
        }
        if (function_exists('posix_isatty')) {
            return posix_isatty(STDOUT);
        }
        $stat = fstat(STDOUT);
        return $stat ? 020000 === ($stat['mode'] & 0170000) : \false;
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use function extension_loaded;
final class IsExtensionFulfilled implements IsFulfilled
{
    private $requiredExtension;
    public function __construct(string $requiredExtension)
    {
        $this->requiredExtension = $requiredExtension;
    }
    public function __invoke() : bool
    {
        return extension_loaded($this->requiredExtension);
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use InvalidArgumentException;
use function count;
use function sprintf;
final class Checker
{
    private static $requirementsConfig;
    public static function checkRequirements() : bool
    {
        $requirements = self::retrieveRequirements();
        $checkPassed = $requirements->evaluateRequirements();
        $io = new IO();
        self::printCheck($checkPassed, new Printer($io->getVerbosity(), $io->hasColorSupport()), $requirements);
        return $checkPassed;
    }
    public static function printCheck($checkPassed, Printer $printer, RequirementCollection $requirements) : void
    {
        if (\false === $checkPassed && IO::VERBOSITY_VERY_VERBOSE > $printer->getVerbosity()) {
            $printer->setVerbosity(IO::VERBOSITY_VERY_VERBOSE);
        }
        $verbosity = IO::VERBOSITY_VERY_VERBOSE;
        $iniPath = $requirements->getPhpIniPath();
        $printer->title('Box Requirements Checker', $verbosity);
        $printer->printv('> Using PHP ', $verbosity);
        $printer->printvln(\PHP_VERSION, $verbosity, 'green');
        $printer->printvln('> PHP is using the following php.ini file:', $verbosity);
        if ($iniPath) {
            $printer->printvln('  ' . $iniPath, $verbosity, 'green');
        } else {
            $printer->printvln('  WARNING: No configuration file (php.ini) used by PHP!', $verbosity, 'yellow');
        }
        $printer->printvln('', $verbosity);
        if (count($requirements) > 0) {
            $printer->printvln('> Checking Box requirements:', $verbosity);
            $printer->printv('  ', $verbosity);
        } else {
            $printer->printvln('> No requirements found.', $verbosity);
        }
        $errorMessages = [];
        foreach ($requirements->getRequirements() as $requirement) {
            if ($errorMessage = $printer->getRequirementErrorMessage($requirement)) {
                if (IO::VERBOSITY_DEBUG === $printer->getVerbosity()) {
                    $printer->printvln('âœ˜ ' . $requirement->getTestMessage(), IO::VERBOSITY_DEBUG, 'red');
                    $printer->printv('  ', IO::VERBOSITY_DEBUG);
                    $errorMessages[] = $errorMessage;
                } else {
                    $printer->printv('E', $verbosity, 'red');
                    $errorMessages[] = $errorMessage;
                }
                continue;
            }
            if (IO::VERBOSITY_DEBUG === $printer->getVerbosity()) {
                $printer->printvln('âœ” ' . $requirement->getTestMessage(), IO::VERBOSITY_DEBUG, 'green');
                $printer->printv('  ', IO::VERBOSITY_DEBUG);
            } else {
                $printer->printv('.', $verbosity, 'green');
            }
        }
        if (IO::VERBOSITY_DEBUG !== $printer->getVerbosity() && count($requirements) > 0) {
            $printer->printvln('', $verbosity);
        }
        if ($requirements->evaluateRequirements()) {
            $printer->block('OK', 'Your system is ready to run the application.', $verbosity, 'success');
        } else {
            $printer->block('ERROR', 'Your system is not ready to run the application.', $verbosity, 'error');
            $printer->title('Fix the following mandatory requirements:', $verbosity, 'red');
            foreach ($errorMessages as $errorMessage) {
                $printer->printv(' * ' . $errorMessage, $verbosity);
            }
        }
        $printer->printvln('', $verbosity);
    }
    private static function retrieveRequirements() : RequirementCollection
    {
        if (null === self::$requirementsConfig) {
            self::$requirementsConfig = __DIR__ . '/../.requirements.php';
        }
        $config = (require self::$requirementsConfig);
        $requirements = new RequirementCollection();
        foreach ($config as $constraint) {
            $requirements->addRequirement(self::createCondition($constraint['type'], $constraint['condition']), $constraint['message'], $constraint['helpMessage']);
        }
        return $requirements;
    }
    private static function createCondition($type, $condition) : IsFulfilled
    {
        switch ($type) {
            case 'php':
                return new IsPhpVersionFulfilled($condition);
            case 'extension':
                return new IsExtensionFulfilled($condition);
            case 'extension-conflict':
                return new IsExtensionConflictFulfilled($condition);
            default:
                throw new InvalidArgumentException(sprintf('Unknown requirement type "%s".', $type));
        }
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use HumbugBox436\Composer\Semver\Semver;
use function sprintf;
use const PHP_MAJOR_VERSION;
use const PHP_MINOR_VERSION;
use const PHP_RELEASE_VERSION;
final class IsPhpVersionFulfilled implements IsFulfilled
{
    private $requiredPhpVersion;
    public function __construct(string $requiredPhpVersion)
    {
        $this->requiredPhpVersion = $requiredPhpVersion;
    }
    public function __invoke() : bool
    {
        return Semver::satisfies(sprintf('%d.%d.%d', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION), $this->requiredPhpVersion);
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use ArrayIterator;
use Countable;
use IteratorAggregate;
use Traversable;
use function count;
use function get_cfg_var;
final class RequirementCollection implements IteratorAggregate, Countable
{
    private $requirements = [];
    public function getIterator() : Traversable
    {
        return new ArrayIterator($this->requirements);
    }
    public function count() : int
    {
        return count($this->requirements);
    }
    public function add(Requirement $requirement) : void
    {
        $this->requirements[] = $requirement;
    }
    public function addRequirement(IsFulfilled $checkIsFulfilled, string $testMessage, string $helpText) : void
    {
        $this->add(new Requirement($checkIsFulfilled, $testMessage, $helpText));
    }
    public function getRequirements() : array
    {
        return $this->requirements;
    }
    public function getPhpIniPath()
    {
        return get_cfg_var('cfg_file_path');
    }
    public function evaluateRequirements()
    {
        return \array_reduce($this->requirements, function (bool $checkPassed, Requirement $requirement) : bool {
            return $checkPassed && $requirement->isFulfilled();
        }, \true);
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use function extension_loaded;
final class IsExtensionConflictFulfilled implements IsFulfilled
{
    private $conflictingExtension;
    public function __construct(string $requiredExtension)
    {
        $this->conflictingExtension = $requiredExtension;
    }
    public function __invoke() : bool
    {
        return !extension_loaded($this->conflictingExtension);
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

use function array_shift;
use function count;
use function explode;
use function ltrim;
use function min;
use function sprintf;
use function str_pad;
use function str_repeat;
use function strlen;
use function trim;
use function wordwrap;
use const PHP_EOL;
final class Printer
{
    private $styles = ['reset' => "\x1b[0m", 'red' => "\x1b[31m", 'green' => "\x1b[32m", 'yellow' => "\x1b[33m", 'title' => "\x1b[33m", 'error' => "\x1b[37;41m", 'success' => "\x1b[30;42m"];
    private $verbosity;
    private $supportColors;
    private $width;
    public function __construct(int $verbosity, bool $supportColors, ?int $width = null)
    {
        if (null === $width) {
            $terminal = new Terminal();
            $width = $terminal->getWidth();
        }
        $this->verbosity = $verbosity;
        $this->supportColors = $supportColors;
        $this->width = $width ?: 80;
    }
    public function getVerbosity() : int
    {
        return $this->verbosity;
    }
    public function setVerbosity($verbosity) : void
    {
        $this->verbosity = $verbosity;
    }
    public function title(string $title, int $verbosity, ?string $style = null) : void
    {
        if (null === $style) {
            $style = 'title';
        }
        $this->printvln('', $verbosity, $style);
        $this->printvln($title, $verbosity, $style);
        $this->printvln(str_repeat('=', min(strlen($title), $this->width)), $verbosity, $style);
        $this->printvln('', $verbosity, $style);
    }
    public function getRequirementErrorMessage(Requirement $requirement) : ?string
    {
        if ($requirement->isFulfilled()) {
            return null;
        }
        return wordwrap($requirement->getHelpText(), $this->width - 3, PHP_EOL . '   ') . PHP_EOL;
    }
    public function block(string $title, string $message, int $verbosity, ?string $style = null) : void
    {
        $prefix = ' [' . $title . '] ';
        $lineLength = $this->width - strlen($prefix) - 1;
        if ($lineLength < 0) {
            $lineLength = 0;
        }
        $message = $prefix . trim($message);
        $lines = [];
        $remainingMessage = $message;
        $wrapped = wordwrap($remainingMessage, $lineLength, 'Â¬');
        $wrapped = explode('Â¬', $wrapped);
        do {
            $line = array_shift($wrapped);
            if ($lines && $lineLength > 0) {
                $line = str_repeat(' ', strlen($prefix)) . ltrim($line);
            }
            $lines[] = str_pad($line, $this->width, ' ', \STR_PAD_RIGHT);
        } while (count($wrapped));
        $this->printvln('', $verbosity);
        $this->printvln(str_repeat(' ', $this->width), $verbosity, $style);
        foreach ($lines as $line) {
            $this->printvln($line, $verbosity, $style);
        }
        $this->printv(str_repeat(' ', $this->width), $verbosity, $style);
        $this->printvln('', $verbosity);
    }
    public function printvln(string $message, int $verbosity, ?string $style = null) : void
    {
        $this->printv($message, $verbosity, $style);
        $this->printv(PHP_EOL, $verbosity, null);
    }
    public function printv(string $message, int $verbosity, ?string $style = null) : void
    {
        if ($verbosity > $this->verbosity) {
            return;
        }
        $message = wordwrap($message, $this->width);
        $message = sprintf('%s%s%s', $this->supportColors && isset($this->styles[$style]) ? $this->styles[$style] : '', $message, $this->supportColors ? $this->styles['reset'] : '');
        if ('1' === \getenv('BOX_REQUIREMENTS_CHECKER_LOG_TO_STDOUT')) {
            echo $message;
        } else {
            \fwrite(\STDERR, $message);
        }
    }
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

interface IsFulfilled
{
    public function __invoke() : bool;
}
<?php

declare (strict_types=1);
namespace HumbugBox436\KevinGH\RequirementChecker;

final class Requirement
{
    private $checkIsFulfilled;
    private $fulfilled;
    private $testMessage;
    private $helpText;
    public function __construct(IsFulfilled $checkIsFulfilled, string $testMessage, string $helpText)
    {
        $this->checkIsFulfilled = $checkIsFulfilled;
        $this->testMessage = $testMessage;
        $this->helpText = $helpText;
    }
    public function isFulfilled() : bool
    {
        if (!isset($this->fulfilled)) {
            $this->fulfilled = $this->checkIsFulfilled->__invoke();
        }
        return $this->fulfilled;
    }
    public function getIsFullfilledChecker() : IsFulfilled
    {
        return $this->checkIsFulfilled;
    }
    public function getTestMessage() : string
    {
        return $this->testMessage;
    }
    public function getHelpText() : string
    {
        return $this->helpText;
    }
}
<?php

namespace Cvphar;

\ini_set('display_errors', 'stderr');
if (\PHP_SAPI !== 'cli') {
    \printf("cv is a command-line tool. It is designed to run with PHP_SAPI \"%s\". The active PHP_SAPI is \"%s\".\n", 'cli', \PHP_SAPI);
    \printf("TIP: In a typical shell environment, the \"php\" command should execute php-cli - not php-cgi or similar.\n");
    exit(1);
}
if (\version_compare(\PHP_VERSION, '5.4', '<')) {
    echo "cv requires PHP 5.4+\n";
    exit(2);
}
$found = 0;
$autoloaders = array(\dirname(__DIR__) . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php', \dirname(\dirname(\dirname(__DIR__))) . \DIRECTORY_SEPARATOR . 'autoload.php');
foreach ($autoloaders as $autoloader) {
    if (\file_exists($autoloader)) {
        require_once $autoloader;
        \define('CV_AUTOLOAD', $autoloader);
        $found = 1;
        break;
    }
}
if (!$found) {
    die("Failed to find autoloader");
}
\Civi\Cv\Application::main(__DIR__);
<?php

namespace Civi\Cv\Util;

class Filesystem
{
    use \Civi\Cv\Util\FilesystemTrait;
    public static function exists(?string $path) : bool
    {
        return $path !== NULL && \file_exists($path);
    }
    public function pwd()
    {
        if (\strtoupper(\substr(\PHP_OS, 0, 3)) === 'WIN') {
            return \getcwd();
        } else {
            \exec('pwd', $output);
            return \trim(\implode("\n", $output));
        }
    }
    public function toAbsolutePath($path)
    {
        if (empty($path)) {
            $res = $this->pwd();
        } elseif ($this->isAbsolutePath($path)) {
            $res = $path;
        } else {
            $res = $this->pwd() . \DIRECTORY_SEPARATOR . $path;
        }
        if (\is_dir($res)) {
            return \realpath($res);
        } else {
            return $res;
        }
    }
    public function toAbsolutePaths($paths)
    {
        $result = array();
        foreach ($paths as $path) {
            $result[] = $this->toAbsolutePath($path);
        }
        return $result;
    }
    public function isDescendent($child, $parent)
    {
        $parent = \rtrim($parent, \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
        $child = \rtrim($child, \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
        if (\strlen($parent) >= \strlen($child)) {
            return \FALSE;
        }
        return $parent == \substr($child, 0, \strlen($parent));
    }
    public function update($file, $filter, $maxWait = 5.0)
    {
        $mode = \file_exists($file) ? 'r+' : 'w+';
        if (!($fh = \fopen($file, $mode))) {
            throw new \RuntimeException("Failed to open");
        }
        $start = \microtime(\TRUE);
        do {
            $locked = \flock($fh, \LOCK_EX | \LOCK_NB);
            if (!$locked && \microtime(\TRUE) - $start > $maxWait) {
                throw new \RuntimeException("Failed to lock");
            }
            if (!$locked) {
                \usleep(\rand(20, 100) * 1000);
            }
        } while (!$locked);
        $buf = '';
        while (!\feof($fh)) {
            $buf .= \fread($fh, 1024 * 1024);
        }
        $rawOut = \call_user_func($filter, $buf);
        if (!\rewind($fh)) {
            throw new \RuntimeException('Bad rewind');
        }
        if (!\ftruncate($fh, 0)) {
            throw new \RuntimeException('Bad truncate');
        }
        if (!\fwrite($fh, $rawOut)) {
            throw new \RuntimeException('Bad write');
        }
        \flock($fh, \LOCK_UN);
        return \fclose($fh);
    }
}
<?php

namespace Civi\Cv\Util;

trait FilesystemTrait
{
    private static $lastError;
    public function isAbsolutePath($file)
    {
        return '' !== (string) $file && (\strspn($file, '/\\', 0, 1) || \strlen($file) > 3 && \ctype_alpha($file[0]) && ':' === $file[1] && \strspn($file, '/\\', 2, 1) || NULL !== \parse_url($file, \PHP_URL_SCHEME));
    }
    public function remove($files)
    {
        if ($files instanceof \Traversable) {
            $files = \iterator_to_array($files, \FALSE);
        } elseif (!\is_array($files)) {
            $files = [$files];
        }
        $files = \array_reverse($files);
        foreach ($files as $file) {
            if (\is_link($file)) {
                if (!(self::box('unlink', $file) || '\\' !== \DIRECTORY_SEPARATOR || self::box('rmdir', $file)) && \file_exists($file)) {
                    throw new \RuntimeException(\sprintf('Failed to remove symlink "%s": ', $file) . self::$lastError);
                }
            } elseif (\is_dir($file)) {
                $this->remove(new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS));
                if (!self::box('rmdir', $file) && \file_exists($file)) {
                    throw new \RuntimeException(\sprintf('Failed to remove directory "%s": ', $file) . self::$lastError);
                }
            } elseif (!self::box('unlink', $file) && (\str_contains(self::$lastError, 'Permission denied') || \file_exists($file))) {
                throw new \RuntimeException(\sprintf('Failed to remove file "%s": ', $file) . self::$lastError);
            }
        }
    }
    private static function box(callable $func, ...$args)
    {
        self::$lastError = NULL;
        \set_error_handler(__CLASS__ . '::handleError');
        try {
            $result = $func(...$args);
            \restore_error_handler();
            return $result;
        } catch (\Throwable $e) {
        }
        \restore_error_handler();
        throw $e;
    }
    public static function handleError(int $type, string $msg)
    {
        self::$lastError = $msg;
    }
}
<?php

namespace Civi\Cv\Util;

use Civi\Cv\ErrorHandler;
use Civi\Cv\Log\InternalLogger;
use Civi\Cv\Log\SymfonyConsoleLogger;
use Civi\Cv\PharOut\PharOut;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait BootTrait
{
    public function configureBootOptions($defaultLevel = 'full|cms-full')
    {
        $this->addOption('level', NULL, InputOption::VALUE_REQUIRED, 'Bootstrap level (none,classloader,settings,full,cms-only,cms-full)', $defaultLevel);
        $this->addOption('hostname', NULL, InputOption::VALUE_REQUIRED, 'Hostname (for a multisite system)');
        $this->addOption('test', 't', InputOption::VALUE_NONE, 'Bootstrap the test database (CIVICRM_UF=UnitTests)');
        $this->addOption('user', 'U', InputOption::VALUE_REQUIRED, 'CMS user');
    }
    public function boot(InputInterface $input, OutputInterface $output)
    {
        $logger = $this->bootLogger($output);
        $logger->debug('Start');
        $this->setupErrorHandling($output);
        if ($input->hasOption('test') && $input->getOption('test')) {
            $logger->debug('Use test mode');
            \putenv('CIVICRM_UF=UnitTests');
            $_ENV['CIVICRM_UF'] = 'UnitTests';
        }
        if ($input->getOption('level') === 'full|cms-full') {
            if (\getenv('CIVICRM_UF') === 'UnitTests') {
                $input->setOption('level', 'full');
            } elseif (\getenv('CIVICRM_BOOT')) {
                $input->setOption('level', 'cms-full');
            } elseif (\getenv('CIVICRM_SETTINGS')) {
                $input->setOption('level', 'full');
            } else {
                $input->setOption('level', 'full');
            }
        }
        if (\getenv('CIVICRM_UF') === 'UnitTests' && \preg_match('/^cms-/', $input->getOption('level'))) {
            throw new \Exception("UnitTest bootstrapping is not compatible with CMS bootstrapping");
        }
        $func = '_boot_' . \strtr($input->getOption('level'), '-', '_');
        if (\is_callable([$this, $func])) {
            \call_user_func([$this, $func], $input, $output);
        } else {
            throw new \Exception("Unrecognized bootstrap level");
        }
        ErrorHandler::pushHandler();
        $logger->debug('Finished');
    }
    public function _boot_none(InputInterface $input, OutputInterface $output)
    {
        $this->bootLogger($output)->debug('Skip');
    }
    public function _boot_classloader(InputInterface $input, OutputInterface $output)
    {
        $this->bootLogger($output)->debug('Call basic cv bootstrap (' . $input->getOption('level') . ')');
        \Civi\Cv\Bootstrap::singleton()->boot($this->createBootParams($input, $output) + array('prefetch' => \FALSE));
    }
    public function _boot_settings(InputInterface $input, OutputInterface $output)
    {
        $this->bootLogger($output)->debug('Call basic cv bootstrap (' . $input->getOption('level') . ')');
        \Civi\Cv\Bootstrap::singleton()->boot($this->createBootParams($input, $output) + array('prefetch' => \FALSE));
    }
    public function _boot_full(InputInterface $input, OutputInterface $output)
    {
        PharOut::prepare();
        $logger = $this->bootLogger($output);
        $logger->debug('Call standard cv bootstrap');
        \Civi\Cv\Bootstrap::singleton()->boot($this->createBootParams($input, $output));
        $logger->debug('Call core bootstrap');
        \CRM_Core_Config::singleton();
        $logger->debug('Call CMS bootstrap');
        \CRM_Utils_System::loadBootStrap(array(), \FALSE);
        if ($input->getOption('user')) {
            $logger->debug('Set system user');
            if (\is_callable(array(\CRM_Core_Config::singleton()->userSystem, 'loadUser'))) {
                if (!\CRM_Core_Config::singleton()->userSystem->loadUser($input->getOption('user')) || !$this->ensureUserContact($output)) {
                    throw new \Exception("Failed to determine contactID for user=" . $input->getOption('user'));
                }
            } else {
                $output->getErrorOutput()->writeln("<error>Failed to set user. Feature not supported by UF (" . CIVICRM_UF . ")</error>");
            }
        }
        if (\is_callable([\CRM_Core_Config::singleton()->userSystem, 'setMySQLTimeZone'])) {
            $logger->debug('Set active MySQL timezone');
            \CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone();
        }
        if (CIVICRM_UF === 'Joomla') {
            PharOut::reset();
        }
    }
    public function _boot_cms_only(InputInterface $input, OutputInterface $output)
    {
        $bootstrap = $this->createCmsBootstrap($input, $output);
        $this->bootLogger($output)->debug('Call CMS bootstrap');
        $bootstrap->bootCms();
        return $bootstrap;
    }
    public function _boot_cms_full(InputInterface $input, OutputInterface $output)
    {
        $bootstrap = $this->_boot_cms_only($input, $output);
        $this->bootLogger($output)->debug('Call Civi bootstrap');
        $bootstrap->bootCivi();
        return $bootstrap;
    }
    protected function createCmsBootstrap(InputInterface $input, OutputInterface $output)
    {
        if ($output->isDebug()) {
            $boot_params = array('output' => $output);
        } else {
            $boot_params = array();
        }
        if ($input->getOption('user')) {
            $boot_params['user'] = $input->getOption('user');
        }
        if ($input->getOption('hostname')) {
            $boot_params['httpHost'] = $input->getOption('hostname');
        }
        return \Civi\Cv\CmsBootstrap::singleton()->addOptions($boot_params);
    }
    public function ensureUserContact(OutputInterface $output)
    {
        if ($cid = \CRM_Core_Session::getLoggedInContactID()) {
            return $cid;
        }
        switch (CIVICRM_UF) {
            case 'Drupal':
            case 'Drupal6':
            case 'Backdrop':
                \CRM_Core_BAO_UFMatch::synchronize($GLOBALS['user'], \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'Drupal8':
                $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
                \CRM_Core_BAO_UFMatch::synchronize($user, \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'Joomla':
                \CRM_Core_BAO_UFMatch::synchronize(\JFactory::getUser(), \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'Standalone':
                if (empty($GLOBALS['loggedInUser'])) {
                    $this->bootLogger($output)->error('Failed to sync user/contact. You may be running a pre-release of civicrm-standalone.');
                } else {
                    \CRM_Core_BAO_UFMatch::synchronize($GLOBALS['loggedInUser'], \TRUE, CIVICRM_UF, 'Individual');
                }
                break;
            case 'WordPress':
                \CRM_Core_BAO_UFMatch::synchronize($GLOBALS['current_user'], \TRUE, CIVICRM_UF, 'Individual');
                break;
            default:
                $this->bootLogger($output)->error("Unrecognized UF: " . CIVICRM_UF);
        }
        return \CRM_Core_Session::getLoggedInContactID();
    }
    protected function setupErrorHandling(OutputInterface $output)
    {
        $this->bootLogger($output)->debug('Attempting to set verbose error reporting');
        \error_reporting(\E_ALL | \E_STRICT);
        \ini_set('display_errors', 'stderr');
        \ini_set('display_startup_errors', \TRUE);
    }
    protected function createBootParams(InputInterface $input, OutputInterface $output)
    {
        $boot_params = [];
        if ($output->isDebug()) {
            $boot_params['output'] = $output;
        }
        if ($input->getOption('hostname')) {
            $boot_params['httpHost'] = $input->getOption('hostname');
        }
        return $boot_params;
    }
    private function bootLogger(OutputInterface $output) : InternalLogger
    {
        return new SymfonyConsoleLogger('BootTrait', $output);
    }
}
<?php

namespace Civi\Cv;

class CmsBootstrap
{
    protected static $singleton = NULL;
    protected $options = array();
    protected $log = NULL;
    protected $bootedCms = NULL;
    protected $deferredUserToLogin = NULL;
    public function writeln($text, $level = 32)
    {
        $this->log->info($text);
    }
    public static function singleton()
    {
        if (self::$singleton === NULL) {
            self::$singleton = new \Civi\Cv\CmsBootstrap(array('env' => 'CIVICRM_BOOT', 'search' => \TRUE, 'httpHost' => \array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'localhost', 'user' => NULL));
        }
        return self::$singleton;
    }
    public function __construct($options = array())
    {
        $this->addOptions($options);
    }
    public function generate(array $actions = []) : string
    {
        $instanceExpr = '\\' . \get_class($this) . '::singleton()';
        $code = '';
        $code .= \sprintf("require_once %s;\n", \var_export(CV_AUTOLOAD, \TRUE));
        $code .= \sprintf("%s->addOptions(%s);\n", $instanceExpr, \var_export($this->getOptions(), \TRUE));
        foreach ($actions as $action) {
            $code .= \sprintf("%s->%s()->bootCivi();\n", $instanceExpr, $action);
        }
        return $code;
    }
    public function bootCms()
    {
        $this->log->debug("Options: " . \json_encode($this->options, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
        if ($this->options['env'] && \getenv($this->options['env'])) {
            $cmsExpr = \getenv($this->options['env']);
            $this->log->debug("Parse CMS options ({$cmsExpr})");
            $cms = array('type' => \parse_url($cmsExpr, \PHP_URL_SCHEME), 'path' => '/' . \parse_url($cmsExpr, \PHP_URL_HOST) . \parse_url($cmsExpr, \PHP_URL_PATH));
            $cms['path'] = \preg_replace(';^//+;', '/', $cms['path']);
            if ($cms['type'] === 'Auto') {
                $isAutoPath = \trim($cms['path'], '/') === '.';
                $cms = $this->findCmsRoot($isAutoPath ? $this->getSearchDir() : $cms['path']);
            }
            if (!isset($this->options['user']) && \parse_url($cmsExpr, \PHP_URL_USER)) {
                $this->options['user'] = \parse_url($cmsExpr, \PHP_URL_USER);
            }
            if (\parse_url($cmsExpr, \PHP_URL_QUERY)) {
                \parse_str(\parse_url($cmsExpr, \PHP_URL_QUERY), $query);
                if (!empty($query['host'])) {
                    $this->options['httpHost'] = $query['host'];
                }
            }
        } else {
            $this->log->debug("Find CMS...");
            $cms = $this->findCmsRoot($this->getSearchDir());
        }
        $this->log->debug("CMS: " . \json_encode($cms, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
        if (empty($cms['path']) || empty($cms['type']) || !\file_exists($cms['path'])) {
            $cmsJson = \json_encode($cms, \JSON_UNESCAPED_SLASHES);
            throw new \Exception("Failed to parse or find a CMS {$cmsJson}");
        }
        if (\PHP_SAPI === "cli") {
            $this->log->debug("Simulate web environment in CLI");
            $this->simulateWebEnv($this->options['httpHost'], $cms['path'] . '/index.php');
        }
        $func = 'boot' . $cms['type'];
        if (!\is_callable([$this, $func])) {
            throw new \Exception("Failed to locate boot function ({$func})");
        }
        \call_user_func([$this, $func], $cms['path'], $this->options['user'], $this->options['httpHost']);
        if (\PHP_SAPI === "cli") {
            \error_reporting(1);
        }
        $this->log->debug("Finished");
        $this->bootedCms = $cms;
        return $this;
    }
    public function getBootedCmsType()
    {
        return isset($this->bootedCms['type']) ? $this->bootedCms['type'] : NULL;
    }
    public function getBootedCmsPath()
    {
        return isset($this->bootedCms['path']) ? $this->bootedCms['path'] : NULL;
    }
    public function bootCivi()
    {
        if (\function_exists('civicrm_initialize')) {
            \civicrm_initialize();
        } elseif (\class_exists('Drupal')) {
            \Drupal::service('civicrm')->initialize();
        } elseif ($this->bootedCms['type'] === 'Standalone') {
            $this->log->debug("Hello there Standalone, come join us!");
            \Civi\Cv\Bootstrap::singleton()->boot();
            $this->loginStandaloneUser();
        } else {
            throw new \Exception("This system does not appear to have CiviCRM");
        }
        if (!empty($this->options['user'])) {
            $this->ensureUserContact();
        }
        if (\is_callable([\CRM_Core_Config::singleton()->userSystem, 'setMySQLTimeZone'])) {
            \CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone();
        }
        $GLOBALS['_CV'] = $this->buildCv();
        return $this;
    }
    protected function buildCv() : array
    {
        $settings = \constant('CIVICRM_SETTINGS_PATH');
        if ($settings && \class_exists('Civi\\Cv\\SiteConfigReader')) {
            $this->log->debug("Load supplemental configuration for \"{$settings}\"");
            $reader = new \Civi\Cv\SiteConfigReader($settings);
            return $reader->compile(array('buildkit', 'home'));
        } else {
            $this->log->debug("Warning: Not loading supplemental configuration for \"{$settings}\". SiteConfigReader is missing.");
            return [];
        }
    }
    protected function loginStandaloneUser()
    {
        if (!empty($this->deferredUserToLogin)) {
            global $loggedInUserId;
            if (\class_exists(\Civi\Api4\User::class)) {
                $userID = \Civi\Api4\User::get(\FALSE)->addWhere('username', '=', $this->deferredUserToLogin)->addWhere('is_active', '=', 1)->execute()->single();
                \CRM_Core_Session::singleton()->set('ufId', $userID);
                $loggedInUserId = $userID['contact_id'];
            }
            if (empty($loggedInUserId)) {
                throw new \RuntimeException("Unable to login as '{$this->deferredUserToLogin}'");
            }
        }
    }
    public function bootBackdrop($cmsPath, $cmsUser)
    {
        if (!\file_exists("{$cmsPath}/core/includes/bootstrap.inc")) {
            throw new \Exception('Sorry, could not locate Backdrop\'s bootstrap.inc');
        }
        \chdir($cmsPath);
        \define('BACKDROP_ROOT', $cmsPath);
        require_once "{$cmsPath}/core/includes/bootstrap.inc";
        require_once "{$cmsPath}/core/includes/config.inc";
        \backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL);
        if (!\function_exists('module_exists')) {
            throw new \Exception('Sorry, could not bootstrap Backdrop.');
        }
        if ($cmsUser) {
            global $user;
            $user = \user_load(array('name' => $cmsUser));
        }
        return $this;
    }
    public function bootDrupal($cmsPath, $cmsUser)
    {
        if (!\file_exists("{$cmsPath}/includes/bootstrap.inc")) {
            throw new \Exception('Sorry, could not locate Drupal\'s bootstrap.inc');
        }
        \chdir($cmsPath);
        \define('DRUPAL_ROOT', $cmsPath);
        require_once 'includes/bootstrap.inc';
        \drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
        if (!\function_exists('module_exists')) {
            throw new \Exception('Sorry, could not bootstrap Drupal.');
        }
        if ($cmsUser) {
            global $user;
            $user = \user_load_by_name($cmsUser);
        }
        return $this;
    }
    public function bootDrupal8($cmsRootPath, $cmsUser)
    {
        if (!\file_exists("{$cmsRootPath}/core/core.services.yml")) {
            throw new \Exception('Sorry, could not locate Drupal8\'s core.services.yml');
        }
        \chdir($cmsRootPath);
        \define('DRUPAL_DIR', $cmsRootPath);
        $autoloader = (require_once DRUPAL_DIR . '/autoload.php');
        $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
        $kernel = \Drupal\Core\DrupalKernel::createFromRequest($request, $autoloader, 'prod');
        $kernel->boot();
        $kernel->preHandle($request);
        $container = $kernel->rebuildContainer();
        $request->attributes->set(\Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT, new \Symfony\Component\Routing\Route('<none>'));
        $request->attributes->set(\Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME, '<none>');
        $container->get('request_stack')->push($request);
        $container->get('router.request_context')->fromRequest($request);
        if (!\function_exists('t')) {
            throw new \Exception('Sorry, could not bootstrap Drupal8.');
        }
        if ($cmsUser) {
            if (\method_exists('Drupal', 'entityManager')) {
                $entity_manager = \Drupal::entityManager();
                $users = $entity_manager->getStorage($entity_manager->getEntityTypeFromClass('Drupal\\user\\Entity\\User'))->loadByProperties(array('name' => $cmsUser));
            } else {
                $entity_manager = \Drupal::entityTypeManager();
                $users = $entity_manager->getStorage(\Drupal::service('entity_type.repository')->getEntityTypeFromClass('Drupal\\user\\Entity\\User'))->loadByProperties(['name' => $cmsUser]);
            }
            if (\count($users) == 1) {
                foreach ($users as $uid => $user) {
                    \user_login_finalize($user);
                }
            } elseif (empty($users)) {
                throw new \Exception(\sprintf("Failed to find Drupal8 user (%s)", $cmsUser));
            } else {
                throw new \Exception(\sprintf("Found too many Drupal8 users (%d)", \count($users)));
            }
        }
        return $this;
    }
    public function bootWordPress($cmsRootPath, $cmsUser)
    {
        if (!\file_exists($cmsRootPath . \DIRECTORY_SEPARATOR . 'wp-load.php')) {
            throw new \Exception('Sorry, could not locate WordPress\'s wp-load.php.');
        }
        \chdir($cmsRootPath);
        require_once $cmsRootPath . \DIRECTORY_SEPARATOR . 'wp-load.php';
        if (!\function_exists('wp_set_current_user')) {
            throw new \Exception('Sorry, could not bootstrap WordPress.');
        }
        if ($cmsUser) {
            \wp_set_current_user(NULL, $cmsUser);
        }
        return $this;
    }
    public function bootStandalone($cmsPath, $cmsUser)
    {
        $candidates = [$cmsPath . '/vendor/autoload.php', $cmsPath . '/web/core/vendor/autoload.php', \dirname($cmsPath) . '/vendor/autoload.php'];
        $autoloader = NULL;
        foreach ($candidates as $candidate) {
            if (\file_exists($candidate)) {
                $autoloader = $candidate;
                break;
            }
        }
        if (!$autoloader) {
            throw new \RuntimeException("Failed to find autoloader. Possibilities: " . \implode(', ', $candidates));
        }
        require_once $autoloader;
        $this->deferredUserToLogin = $cmsUser ?? NULL;
        return $this;
    }
    public function getOptions()
    {
        return $this->options;
    }
    public function addOptions($options)
    {
        $this->options = \array_merge($this->options, $options);
        $this->log = \Civi\Cv\Log\Logger::resolve($options, 'CmsBootstrap');
        return $this;
    }
    protected function findCmsRoot($searchDir)
    {
        $cmsPatterns = array('WordPress' => array('wp-load.php'), 'Joomla' => array('administrator/components/com_users/users.php'), 'Drupal' => array('modules/system/system.module'), 'Drupal8' => array('core/core.services.yml'), 'Backdrop' => array('core/modules/layout/layout.module'), 'Standalone' => array('civicrm.config.php.standalone'));
        $parts = \explode('/', \str_replace('\\', '/', $searchDir));
        while (!empty($parts)) {
            $basePath = \implode('/', $parts);
            foreach ($cmsPatterns as $cmsType => $relPaths) {
                if (!empty($this->options['cmsType']) && $this->options['cmsType'] != $cmsType) {
                    continue;
                }
                foreach ($relPaths as $relPath) {
                    $matches = \glob("{$basePath}/{$relPath}");
                    if (!empty($matches)) {
                        return array('path' => $basePath, 'type' => $cmsType);
                    }
                    $matches = \glob("{$basePath}/web/{$relPath}");
                    if (!empty($matches)) {
                        return array('path' => "{$basePath}/web", 'type' => $cmsType);
                    }
                    if ($cmsType === 'Standalone') {
                        $matches = \glob("{$basePath}/srv/{$relPath}");
                        if (!empty($matches)) {
                            return array('path' => "{$basePath}/srv", 'type' => $cmsType);
                        }
                    }
                }
            }
            \array_pop($parts);
        }
        return NULL;
    }
    protected function getSearchDir()
    {
        if ($this->options['search'] === \TRUE) {
            if (\strtoupper(\substr(\PHP_OS, 0, 3)) === 'WIN') {
                return \getcwd();
            } else {
                \exec('pwd', $output);
                return \trim(\implode("\n", $output));
            }
        } else {
            return $this->options['search'];
        }
    }
    protected function simulateWebEnv($host, $scriptFile)
    {
        $_SERVER['SCRIPT_FILENAME'] = $scriptFile;
        $_SERVER['REMOTE_ADDR'] = "127.0.0.1";
        $_SERVER['SERVER_SOFTWARE'] = NULL;
        $_SERVER['REQUEST_METHOD'] = 'GET';
        $_SERVER['SERVER_NAME'] = $host;
        $_SERVER['HTTP_HOST'] = $host;
        if (\ord($_SERVER['SCRIPT_NAME']) != 47) {
            $_SERVER['SCRIPT_NAME'] = '/' . $_SERVER['SCRIPT_NAME'];
        }
    }
    protected function ensureUserContact()
    {
        if ($cid = \CRM_Core_Session::getLoggedInContactID()) {
            return $cid;
        }
        switch (CIVICRM_UF) {
            case 'Drupal':
            case 'Drupal6':
            case 'Backdrop':
                \CRM_Core_BAO_UFMatch::synchronize($GLOBALS['user'], \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'Drupal8':
                $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
                \CRM_Core_BAO_UFMatch::synchronize($user, \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'Joomla':
                \CRM_Core_BAO_UFMatch::synchronize(\JFactory::getUser(), \TRUE, CIVICRM_UF, 'Individual');
                break;
            case 'WordPress':
                \CRM_Core_BAO_UFMatch::synchronize($GLOBALS['current_user'], \TRUE, CIVICRM_UF, 'Individual');
                break;
            default:
                $this->log->error("Unrecognized UF: " . CIVICRM_UF);
        }
        return \CRM_Core_Session::getLoggedInContactID();
    }
}
<?php

namespace Civi\Cv;

class SiteConfigReader
{
    protected $settingsFile;
    protected $cache = array();
    public function __construct($settingsFile)
    {
        $this->settingsFile = $settingsFile;
    }
    public function compile($parts)
    {
        $data = array();
        foreach ($parts as $part) {
            switch ($part) {
                case 'buildkit':
                    $data = \array_merge($data, $this->readBuildkitConfig());
                    break;
                case 'home':
                    $data = \array_merge($data, $this->readHomeConfig());
                    break;
                case 'active':
                    $data = \array_merge($data, $this->readActiveConfig());
                    break;
            }
        }
        return $this->clean($data);
    }
    public function readBuildkitConfig()
    {
        if (!isset($this->cache['buildkit'])) {
            $shFile = \Civi\Cv\BuildkitReader::findShFile($this->settingsFile);
            $this->cache['buildkit'] = $shFile ? \Civi\Cv\BuildkitReader::readShFile($shFile) : array();
        }
        return $this->cache['buildkit'];
    }
    public function readHomeConfig()
    {
        if (!isset($this->cache['home'])) {
            $config = \Civi\Cv\Config::read();
            $this->cache['home'] = isset($config['sites'][$this->settingsFile]) ? $config['sites'][$this->settingsFile] : array();
        }
        return $this->cache['home'];
    }
    public function readActiveConfig()
    {
        if (!\defined('CIVICRM_SETTINGS_PATH') || CIVICRM_SETTINGS_PATH !== $this->settingsFile) {
            return array();
        }
        $paths = \is_callable(array('Civi', 'paths')) ? \Civi::paths() : NULL;
        $data = array('CMS_DB_DSN' => CIVICRM_UF_DSN, 'CMS_VERSION' => \CRM_Core_Config::singleton()->userSystem->getVersion(), 'CIVI_DB_DSN' => CIVICRM_DSN, 'CIVI_SITE_KEY' => CIVICRM_SITE_KEY, 'CIVI_VERSION' => \CRM_Utils_System::version(), 'CIVI_SETTINGS' => CIVICRM_SETTINGS_PATH, 'CIVI_TEMPLATEC' => \CRM_Core_Config::singleton()->templateCompileDir, 'CIVI_LOG' => \CRM_Core_Error::createDebugLogger()->_filename, 'CIVI_UF' => \CRM_Core_Config::singleton()->userFramework, 'IS_INSTALLED' => '1', 'SITE_TYPE' => 'cv-auto');
        if (\is_callable(array('Civi', 'paths'))) {
            $data += ['CMS_URL' => \Civi::paths()->getUrl('[cms.root]/', 'absolute'), 'CMS_ROOT' => \Civi::paths()->getPath('[cms.root]/.'), 'CIVI_CORE' => \Civi::paths()->getPath('[civicrm.root]/.'), 'CIVI_URL' => \Civi::paths()->getUrl('[civicrm.root]/', 'absolute'), 'CIVI_FILES' => \Civi::paths()->getPath('[civicrm.files]/.')];
        } else {
            $data += ['CMS_URL' => \CRM_Utils_System::languageNegotiationURL(\CRM_Utils_System::baseCMSURL(), \FALSE, \TRUE), 'CMS_ROOT' => \CRM_Core_Config::singleton()->userSystem->cmsRootPath(), 'CIVI_CORE' => $GLOBALS['civicrm_root'], 'CIVI_URL' => '', 'CIVI_FILES' => \dirname(\CRM_Core_Config::singleton()->templateCompileDir)];
        }
        return $data;
    }
    /**
    @parm
    */
    public function clean($data)
    {
        $this->cleanPaths($data);
        $this->cleanUrls($data);
        $this->cleanDbs($data);
        \ksort($data);
        return $data;
    }
    protected function cleanPaths(&$data)
    {
        $paths = array('CIVI_CORE', 'CIVI_FILES', 'CIVI_TEMPLATEC', 'CMS_ROOT');
        foreach ($paths as $path) {
            if (!empty($data[$path])) {
                $data[$path] = \rtrim($data[$path], \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
            }
        }
    }
    protected function cleanUrls(&$data)
    {
        $urls = array('CMS_URL', 'CIVI_URL');
        foreach ($urls as $url) {
            if (isset($data[$url])) {
                $data[$url] = \rtrim($data[$url], '/') . '/';
            }
        }
    }
    protected function cleanDbs(&$data)
    {
        foreach (array('CIVI', 'CMS', 'TEST') as $prefix) {
            if (isset($data["{$prefix}_DB_DSN"])) {
                $data = \array_merge($data, $this->parseDsn($prefix, $data["{$prefix}_DB_DSN"]));
            }
        }
    }
    protected function parseDsn($prefix, $dsn)
    {
        $url = \parse_url($dsn);
        $parts = array();
        if (!empty($url['host'])) {
            $parts[] = '-h';
            $parts[] = $url['host'];
        }
        if (!empty($url['user'])) {
            $parts[] = '-u';
            $parts[] = $url['user'];
        }
        if (!empty($url['pass'])) {
            $parts[] = '-p' . $url['user'];
        }
        if (!empty($url['port'])) {
            $parts[] = '-P';
            $parts[] = $url['port'];
        }
        if (!empty($url['path'])) {
            $parts[] = \trim($url['path'], '/');
        }
        foreach ($parts as $part) {
            if (!\preg_match('/^[a-zA-Z0-9\\._+\\-]*$/', $part)) {
                throw new \InvalidArgumentException("Cannot format DB CLI arguments ({$dsn})");
            }
        }
        return array("{$prefix}_DB_USER" => empty($url['user']) ? '' : $url['user'], "{$prefix}_DB_PASS" => empty($url['pass']) ? '' : $url['pass'], "{$prefix}_DB_HOST" => empty($url['host']) ? '' : $url['host'], "{$prefix}_DB_PORT" => empty($url['port']) ? '' : $url['port'], "{$prefix}_DB_NAME" => empty($url['path']) ? '' : \trim($url['path'], '/'), "{$prefix}_DB_ARGS" => \implode(' ', $parts));
    }
}
<?php

namespace Civi\Cv;

class Bootstrap
{
    const PHP_RECOMMENDED_MIN = '7.0.0';
    protected static $singleton = NULL;
    protected $options = array();
    protected $log = NULL;
    public function writeln($text, $level = 32)
    {
        $this->log->info($text);
    }
    public static function singleton()
    {
        if (self::$singleton === NULL) {
            self::$singleton = new \Civi\Cv\Bootstrap(array('dynamicSettingsFile' => \dirname(__DIR__) . '/settings_location.php', 'env' => 'CIVICRM_SETTINGS', 'prefetch' => \TRUE, 'settingsFile' => NULL, 'search' => \TRUE, 'cmsType' => NULL, 'httpHost' => \array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : ''));
        }
        return self::$singleton;
    }
    public function __construct($options = array())
    {
        $this->options = $options;
    }
    public function boot($options = array())
    {
        $this->log = \Civi\Cv\Log\Logger::resolve($options, 'Bootstrap');
        $isBooting = \TRUE;
        \register_shutdown_function(function () use(&$isBooting) {
            if (!$isBooting) {
                return;
            }
            $last_error = \error_get_last();
            switch ($last_error['type'] ?? NULL) {
                case \E_ERROR:
                case \E_PARSE:
                case \E_COMPILE_ERROR:
                    $errMsg = \sprintf("PHP Error: %s\nat line %s in %s", $last_error['message'], $last_error['line'], $last_error['file']);
                    if (!\version_compare(\PHP_VERSION, self::PHP_RECOMMENDED_MIN, '>=')) {
                        $errMsg .= \sprintf("\n\nWARNING: cv recommends PHP %s+ for use with current CiviCRM versions. This command is running PHP %s.", self::PHP_RECOMMENDED_MIN, \PHP_VERSION);
                    }
                    if ($this->log) {
                        $this->log->error($errMsg);
                    } else {
                        \fwrite(\STDERR, "{$errMsg}\n");
                    }
                    break;
            }
        });
        if (!\defined('CIVICRM_SETTINGS_PATH')) {
            $this->options = $options = \array_merge($this->options, $options);
            $this->log->debug("Options: " . \json_encode($options, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
            $this->log->debug("Find settings file");
            $settings = $this->getCivicrmSettingsPhp($options);
            if (empty($settings) || !\file_exists($settings)) {
                throw new \Exception("Failed to locate civicrm.settings.php." . " By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php." . " Symlinks and multisite configurations may interfere." . " To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php.");
            }
            if (\class_exists('Civi\\Cv\\SiteConfigReader')) {
                $this->log->debug("Load supplemental configuration for \"{$settings}\"");
                $reader = new \Civi\Cv\SiteConfigReader($settings);
                $GLOBALS['_CV'] = $reader->compile(array('buildkit', 'home'));
            } else {
                $this->log->debug("Warning: Not loading supplemental configuration for \"{$settings}\". SiteConfigReader is missing.");
                $GLOBALS['_CV'] = [];
            }
            $this->log->notice("Find CMS root for \"" . $this->getSearchDir() . "\"");
            list($cmsType, $cmsBasePath) = $this->findCmsRoot($this->getSearchDir());
            $this->log->notice("Found \"{$cmsType}\" in \"{$cmsBasePath}\"");
            if (\PHP_SAPI === "cli") {
                $this->log->notice("Simulate web environment in CLI");
                $_SERVER['SCRIPT_FILENAME'] = $cmsBasePath . '/index.php';
                $_SERVER['REMOTE_ADDR'] = "127.0.0.1";
                $_SERVER['SERVER_SOFTWARE'] = NULL;
                $_SERVER['REQUEST_METHOD'] = 'GET';
                if (!empty($options['httpHost'])) {
                    $_SERVER['HTTP_HOST'] = $options['httpHost'];
                }
                if (\ord($_SERVER['SCRIPT_NAME']) != 47) {
                    $_SERVER['SCRIPT_NAME'] = '/' . $_SERVER['SCRIPT_NAME'];
                }
            }
            $this->log->debug("Load settings file \"" . $settings . "\"");
            \define('CIVICRM_SETTINGS_PATH', $settings);
            $error = @(include_once $settings);
            if ($error == \FALSE) {
                $this->log->notice("Failed to load settings file");
                throw new \Exception("Could not load the CiviCRM settings file: {$settings}");
            }
        }
        $this->log->notice("Initialize class loader");
        global $civicrm_root;
        require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
        \CRM_Core_ClassLoader::singleton()->register();
        if (!empty($options['prefetch'])) {
            $this->log->notice("Call core bootstrap");
            \CRM_Core_Config::singleton();
        }
        $this->log->debug("Finished");
        $isBooting = \FALSE;
    }
    public function generate()
    {
        $code = array();
        $code[] = 'if (PHP_SAPI === "cli") {';
        $srvVars = array('SCRIPT_FILENAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'REQUEST_METHOD', 'SCRIPT_NAME');
        foreach ($srvVars as $srvVar) {
            $code[] = \sprintf('$_SERVER["%s"] = %s;', $srvVar, \var_export($_SERVER[$srvVar], 1));
        }
        foreach (array('CIVICRM_UF') as $envVar) {
            if (\getenv($envVar)) {
                $code[] = \sprintf('putenv("%s=" . %s);', $envVar, \var_export(\getenv($envVar), 1));
                $code[] = \sprintf('$_ENV["%s"] = %s;', $envVar, \var_export(\getenv($envVar), 1));
            }
        }
        $code[] = '}';
        $code[] = \sprintf('$GLOBALS[\'_CV\'] = %s;', \var_export($GLOBALS['_CV'], 1));
        $code[] = \sprintf('define("CIVICRM_SETTINGS_PATH", %s);', \var_export(CIVICRM_SETTINGS_PATH, 1));
        $code[] = '$error = @include_once CIVICRM_SETTINGS_PATH;';
        $code[] = 'if ($error == FALSE) {';
        $code[] = '  throw new \\Exception("Could not load the CiviCRM settings file: {$settings}");';
        $code[] = '}';
        $code[] = 'require_once $GLOBALS["civicrm_root"] . "/CRM/Core/ClassLoader.php";';
        $code[] = '\\CRM_Core_ClassLoader::singleton()->register();';
        return \implode("\n", $code);
    }
    public function getOptions()
    {
        return $this->options;
    }
    public function setOptions($options)
    {
        $this->options = $options;
    }
    public function getCivicrmSettingsPhp($options)
    {
        if (!empty($options['dynamicSettingsFile']) && \file_exists($options['dynamicSettingsFile'])) {
            include $options['dynamicSettingsFile'];
        }
        $settings = NULL;
        if (\defined('CIVICRM_CONFDIR') && \file_exists(CIVICRM_CONFDIR . '/civicrm.settings.php')) {
            $settings = CIVICRM_CONFDIR . '/civicrm.settings.php';
        } elseif (!empty($options['env']) && \getenv($options['env']) && \getenv($options['env']) !== 'Auto' && \file_exists(\getenv($options['env']))) {
            $settings = \getenv($options['env']);
        } elseif (!empty($options['settingsFile']) && \file_exists($options['settingsFile'])) {
            $settings = $options['settingsFile'];
        } elseif (!empty($options['search'])) {
            list(, , $settings) = $this->findCivicrmSettingsPhp($this->getSearchDir());
        }
        return $settings;
    }
    protected function findCivicrmSettingsPhp($searchDir)
    {
        list($cmsType, $cmsRoot) = $this->findCmsRoot($searchDir);
        $settings = NULL;
        switch ($cmsType) {
            case 'backdrop':
                $settings = $this->findFirstFile(\array_merge($this->findDrupalDirs($cmsRoot, $searchDir), array($cmsRoot)), 'civicrm.settings.php');
                break;
            case 'drupal':
                $settings = $this->findFirstFile($this->findDrupalDirs($cmsRoot, $searchDir), 'civicrm.settings.php');
                break;
            case 'joomla':
                $settings = $cmsRoot . '/administrator/components/com_civicrm/civicrm.settings.php';
                break;
            case 'wp':
                $wpDirs = array($cmsRoot . '/*/uploads/civicrm', $cmsRoot . '/*/plugins/civicrm', $cmsRoot . '/*/uploads/sites/*/civicrm', $cmsRoot . '/*/blogs.dir/*/files/civicrm');
                $settings = $this->findFirstFile($wpDirs, 'civicrm.settings.php');
                break;
            case 'standalone':
                $settings = $cmsRoot . '/data/civicrm.settings.php';
                break;
        }
        return array($cmsType, $cmsRoot, $settings);
    }
    protected function findDrupalDirs($cmsRoot, $searchDir)
    {
        $sitesRoot = "{$cmsRoot}/sites";
        $sitesRootQt = \preg_quote($sitesRoot, ';');
        if (empty($this->options['httpHost']) && \preg_match(";^({$sitesRootQt}/[^/]+);", $searchDir, $m)) {
            if (\basename($m[1]) !== 'all') {
                return [$m[1]];
            }
        }
        $sites = array();
        if (\file_exists("{$cmsRoot}/sites/sites.php")) {
            include "{$cmsRoot}/sites/sites.php";
        }
        $dirs = array();
        $server = \explode('.', \implode('.', \array_reverse(\explode(':', \rtrim($this->options['httpHost'], '.')))));
        for ($j = \count($server); $j > 0; $j--) {
            $s = \implode('.', \array_slice($server, -$j));
            if (isset($sites[$s]) && \file_exists("{$cmsRoot}/sites/" . $sites[$s])) {
                $s = $sites[$s];
            }
            $dirs[] = "{$cmsRoot}/sites/{$s}";
        }
        $dirs[] = "{$cmsRoot}/sites/default";
        return $dirs;
    }
    protected function findCmsRoot($searchDir)
    {
        $cmsPatterns = array('wp' => array('wp-includes/version.php'), 'joomla' => array('administrator/components/com_civicrm/civicrm/civicrm-version.php', 'administrator/components/com_users/users.php'), 'drupal' => array('modules/system/system.module', 'core/core.services.yml'), 'backdrop' => array('core/modules/layout/layout.module'), 'standalone' => array('civicrm.config.php.standalone'));
        $parts = \explode('/', \str_replace('\\', '/', $searchDir));
        while (!empty($parts)) {
            $basePath = \implode('/', $parts);
            foreach ($cmsPatterns as $cmsType => $relPaths) {
                if (!empty($this->options['cmsType']) && $this->options['cmsType'] != $cmsType) {
                    continue;
                }
                foreach ($relPaths as $relPath) {
                    $matches = \glob("{$basePath}/{$relPath}");
                    if (!empty($matches)) {
                        return array($cmsType, $basePath);
                    }
                    $matches = \glob("{$basePath}/web/{$relPath}");
                    if (!empty($matches)) {
                        return array($cmsType, "{$basePath}/web");
                    }
                    if ($cmsType === 'standalone') {
                        $matches = \glob("{$basePath}/srv/{$relPath}");
                        if (!empty($matches)) {
                            return array($cmsType, "{$basePath}/srv");
                        }
                    }
                }
            }
            \array_pop($parts);
        }
        return array(NULL, NULL);
    }
    protected function findFirstFile($dirs, $items)
    {
        $dirs = (array) $dirs;
        $items = (array) $items;
        foreach ($dirs as $dir) {
            foreach ($items as $item) {
                $matches = (array) \glob("{$dir}/{$item}");
                if (isset($matches[0])) {
                    return $matches[0];
                }
            }
        }
        return NULL;
    }
    protected function getSearchDir()
    {
        if ($this->options['search'] === \TRUE) {
            if (\strtoupper(\substr(\PHP_OS, 0, 3)) === 'WIN') {
                return \getcwd();
            } else {
                \exec('pwd', $output);
                return \trim(\implode("\n", $output));
            }
        } else {
            return $this->options['search'];
        }
    }
}
<?php

namespace Civi\Cv;

use Civi\Cv\Util\Filesystem;
class Config
{
    public static function read()
    {
        $file = self::getFileName();
        if ($file && \file_exists($file)) {
            $buf = \file_get_contents($file);
            $config = \json_decode($buf, \TRUE);
            if (!empty($buf) && $config === NULL) {
                throw new \RuntimeException("Config file ({$file}) contains malformed JSON.");
            }
            return $config;
        } else {
            return array();
        }
    }
    public static function update($filter)
    {
        $fs = new Filesystem();
        return $fs->update(self::getFileName(), function ($rawIn) use($filter) {
            $data = empty($rawIn) ? array() : \json_decode($rawIn, \TRUE);
            $data = \call_user_func($filter, $data);
            return \Civi\Cv\Encoder::encode($data, 'json-pretty');
        });
    }
    public static function getFileName()
    {
        if (\getenv('CV_CONFIG')) {
            return \getenv('CV_CONFIG');
        } elseif (\getenv('HOME')) {
            return \getenv('HOME') . '/.cv.json';
        } else {
            throw new \RuntimeException("Failed to determine file path for 'cv.json'.");
        }
    }
}
<?php

namespace Civi\Cv;

use Civi\Cv\Util\Filesystem;
class BuildkitReader
{
    public static function findShFile($settingsFile)
    {
        $fs = new Filesystem();
        $settingsFile = $fs->toAbsolutePath($settingsFile);
        $parts = \explode('/', \str_replace('\\', '/', $settingsFile));
        while (!empty($parts)) {
            $last = \array_pop($parts);
            $basePath = \implode('/', $parts);
            $shFile = "{$basePath}/{$last}.sh";
            if (\is_dir("{$basePath}/{$last}") && \file_exists($shFile)) {
                if (\preg_match('/ADMIN_USER=/', \file_get_contents($shFile))) {
                    return $shFile;
                }
            }
        }
        return NULL;
    }
    public static function readShFile($shFile)
    {
        $lines = \explode("\n", \file_get_contents($shFile));
        $result = array();
        foreach ($lines as $line) {
            if (empty($line) || $line[0] == '#') {
                continue;
            }
            if (\preg_match('/^([A-Z0-9_]+)=\\"(.*)\\"$/', $line, $matches)) {
                $result[$matches[1]] = \stripcslashes($matches[2]);
            } else {
                throw new \RuntimeException("Malformed line [{$line}]");
            }
        }
        return $result;
    }
}
<?php

namespace Civi\Cv\Log;

class Logger
{
    public static function resolve(array $options, string $topic)
    {
        if (!empty($options['log'])) {
            return $options['log'];
        } elseif (!empty($options['output'])) {
            return new \Civi\Cv\Log\SymfonyConsoleLogger($topic, $options['output']);
        } else {
            return new \Civi\Cv\Log\StderrLogger($topic);
        }
    }
}
<?php

namespace Civi\Cv\Log;

use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SymfonyConsoleLogger extends \Civi\Cv\Log\InternalLogger
{
    private $verbosityLevelMap;
    protected $output;
    public function __construct(string $topic, $output)
    {
        parent::__construct($topic);
        $this->output = $output;
        $this->verbosityLevelMap = ['emergency' => OutputInterface::VERBOSITY_NORMAL, 'alert' => OutputInterface::VERBOSITY_NORMAL, 'critical' => OutputInterface::VERBOSITY_NORMAL, 'error' => OutputInterface::VERBOSITY_NORMAL, 'warning' => OutputInterface::VERBOSITY_NORMAL, 'notice' => OutputInterface::VERBOSITY_VERBOSE, 'info' => OutputInterface::VERBOSITY_VERY_VERBOSE, 'debug' => OutputInterface::VERBOSITY_DEBUG];
    }
    public function log($level, $message, array $context = [])
    {
        $output = $this->output;
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }
        if ($this->isAnomolous($level)) {
            $template = '<error>[%s:%s]</error> %s';
        } else {
            $template = '<info>[%s:%s]</info> %s';
        }
        if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) {
            $output->writeln(\sprintf($template, $this->topic, $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]);
        }
    }
    protected function decorateInterpolatedValue(string $value) : string
    {
        return "<comment>{$value}</comment>";
    }
}
<?php

namespace Civi\Cv\Log;

abstract class InternalLogger
{
    protected $topic;
    public function __construct(string $topic)
    {
        $this->topic = $topic;
    }
    protected function interpolate(string $message, array $context) : string
    {
        if (\strpos($message, '{') === \FALSE) {
            return $message;
        }
        $replacements = [];
        foreach ($context as $key => $val) {
            if (NULL === $val || \is_scalar($val) || \is_object($val) && \method_exists($val, '__toString')) {
                $replacements["{{$key}}"] = $val;
            } elseif ($val instanceof \DateTimeInterface) {
                $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339);
            } elseif (\is_object($val)) {
                $replacements["{{$key}}"] = '[object ' . \get_class($val) . ']';
            } else {
                $replacements["{{$key}}"] = '[' . \gettype($val) . ']';
            }
            $replacements["{{$key}}"] = $this->decorateInterpolatedValue($replacements["{{$key}}"]);
        }
        return \strtr($message, $replacements);
    }
    protected function decorateInterpolatedValue(string $value) : string
    {
        return $value;
    }
    protected function isAnomolous($level) : bool
    {
        return \in_array($level, ['warning', 'error', 'emergency', 'critical']);
    }
    public abstract function log($level, $message, array $context = array());
    public function emergency($message, array $context = array())
    {
        $this->log('emergency', $message, $context);
    }
    public function alert($message, array $context = array())
    {
        $this->log('alert', $message, $context);
    }
    public function critical($message, array $context = array())
    {
        $this->log('critical', $message, $context);
    }
    public function error($message, array $context = array())
    {
        $this->log('error', $message, $context);
    }
    public function warning($message, array $context = array())
    {
        $this->log('warning', $message, $context);
    }
    public function notice($message, array $context = array())
    {
        $this->log('notice', $message, $context);
    }
    public function info($message, array $context = array())
    {
        $this->log('info', $message, $context);
    }
    public function debug($message, array $context = array())
    {
        $this->log('debug', $message, $context);
    }
}
<?php

namespace Civi\Cv\Log;

class StderrLogger extends \Civi\Cv\Log\InternalLogger
{
    protected $verbose;
    public function __construct(string $topic, bool $verbose = \FALSE)
    {
        parent::__construct($topic);
        $this->verbose = $verbose;
    }
    public function log($level, $message, array $context = [])
    {
        if ($this->isAnomolous($level) || $this->verbose) {
            $template = "[%s:%s] %s\n";
            \fprintf(\STDERR, $template, $this->topic, $level, $this->interpolate($message, $context));
        }
    }
}
<?php

namespace Civi\Cv\PharOut;

use TYPO3\PharStreamWrapper\Helper;
use TYPO3\PharStreamWrapper\Exception;
trait PharPolicyTrait
{
    private $mainFile;
    public function assert($path, $command) : bool
    {
        if ($this->mainFile === NULL) {
            $this->mainFile = $this->findMainFile();
        }
        $baseFile = Helper::determineBaseFile($path);
        if ($baseFile === NULL) {
            throw new Exception(\sprintf('Failed to identify origin of "%s"', $path), 1535198703);
        }
        if ($baseFile === $this->mainFile || \strtolower(\pathinfo($baseFile, \PATHINFO_EXTENSION)) === 'phar') {
            return \TRUE;
        }
        throw new Exception(\sprintf('File "%s" does not resolve to approved PHAR location.', $path), 1535198703);
    }
    private function findMainFile()
    {
        if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'])) {
            return NULL;
        }
        $backtrace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
        do {
            $caller = \array_pop($backtrace);
        } while (empty($caller['file']) && !empty($backtrace));
        return isset($caller['file']) ? Helper::determineBaseFile($caller['file']) : NULL;
    }
}
<?php

namespace Civi\Cv\PharOut;

class PharOut
{
    public static function prepare()
    {
        require_once __DIR__ . '/PharPolicyTrait.php';
    }
    public static function reset()
    {
        if (!\class_exists('\\TYPO3\\PharStreamWrapper\\Manager')) {
            return;
        }
        \TYPO3\PharStreamWrapper\Manager::destroy();
        \TYPO3\PharStreamWrapper\Manager::initialize((new \TYPO3\PharStreamWrapper\Behavior())->withAssertion(new class implements \TYPO3\PharStreamWrapper\Assertable
        {
            use \Civi\Cv\PharOut\PharPolicyTrait;
        }));
        if (\in_array('phar', \stream_get_wrappers())) {
            \stream_wrapper_unregister('phar');
            \stream_wrapper_register('phar', \TYPO3\PharStreamWrapper\PharStreamWrapper::class);
        }
    }
}
<?php

namespace Civi\Cv;

class ErrorHandler
{
    private static $hasShutdown = \FALSE;
    private static $count = 0;
    private static $renderer = NULL;
    public static function pushHandler()
    {
        static::$count++;
        if (!static::$hasShutdown) {
            static::$hasShutdown = \TRUE;
            \register_shutdown_function([static::class, 'onShutdown']);
        }
        \set_error_handler([static::class, 'onError']);
        \set_exception_handler([static::class, 'onException']);
    }
    public static function popHandler()
    {
        static::$count--;
        \restore_error_handler();
        \restore_exception_handler();
    }
    public static function onShutdown()
    {
        if (static::$count > 0) {
            $error = \error_get_last();
            if (isset($error['type']) && $error['type'] & (\E_ERROR | \E_PARSE | \E_CORE_ERROR | \E_COMPILE_ERROR | \E_USER_ERROR | \E_RECOVERABLE_ERROR)) {
                exit(255);
            }
        }
    }
    public static function onError($errorLevel, $message, $filename, $line)
    {
        if ($errorLevel & \error_reporting()) {
            $errorType = static::getErrorTypes()[$errorLevel] ?: "Unknown[{$errorLevel}]";
            \fprintf(\STDERR, "[%s] %s at %s:%d\n", $errorType, $message, $filename, $line);
            return \TRUE;
        } else {
            return \FALSE;
        }
    }
    public static function onException($exception)
    {
        if (isset(static::$renderer)) {
            \call_user_func(static::$renderer, $exception);
        } else {
            \fprintf(\STDERR, "Exception: %s (%s)\n%s", $exception->getMessage(), \get_class($exception), $exception->getTraceAsString());
        }
        exit(255);
    }
    public static function setRenderer(?callable $renderer) : void
    {
        self::$renderer = $renderer;
    }
    protected static function getErrorTypes() : array
    {
        return [\E_ERROR => 'PHP Error', \E_WARNING => 'PHP Warning', \E_PARSE => 'PHP Parse Error', \E_NOTICE => 'PHP Notice', \E_CORE_ERROR => 'PHP Core Error', \E_CORE_WARNING => 'PHP Core Warning', \E_COMPILE_ERROR => 'PHP Compile Error', \E_COMPILE_WARNING => 'PHP Compile Warning', \E_USER_ERROR => 'PHP User Error', \E_USER_WARNING => 'PHP User Warning', \E_USER_NOTICE => 'PHP User Notice', \E_STRICT => 'PHP Strict Warning', \E_RECOVERABLE_ERROR => 'PHP Recoverable Fatal Error', \E_DEPRECATED => 'PHP Deprecation', \E_USER_DEPRECATED => 'PHP User Deprecation'];
    }
}
<?php

// @generated by Humbug Box

// Backup the autoloaded Composer files
if (isset($GLOBALS['__composer_autoload_files'])) {
    $existingComposerAutoloadFiles = $GLOBALS['__composer_autoload_files'];
}

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    exit(1);
}

require_once __DIR__ . '/composer/autoload_real.php';

$loader = ComposerAutoloaderInit96d604555834bcf22f002764f3450e45::getLoader();

// Ensure InstalledVersions is available
$installedVersionsPath = __DIR__.'/composer/InstalledVersions.php';
if (file_exists($installedVersionsPath)) require_once $installedVersionsPath;

// Restore the backup
if (isset($existingComposerAutoloadFiles)) {
    $GLOBALS['__composer_autoload_files'] = $existingComposerAutoloadFiles;
} else {
    unset($GLOBALS['__composer_autoload_files']);
}

// Class aliases. For more information see:
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#class-aliases
if (!function_exists('humbug_phpscoper_expose_class')) {
    function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void {
        if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
            spl_autoload_call($prefixed);
        }
    }
}
humbug_phpscoper_expose_class('ComposerAutoloaderInit96d604555834bcf22f002764f3450e45', 'Cvphar\ComposerAutoloaderInit96d604555834bcf22f002764f3450e45');
humbug_phpscoper_expose_class('JsonException', 'Cvphar\JsonException');
humbug_phpscoper_expose_class('ValueError', 'Cvphar\ValueError');
humbug_phpscoper_expose_class('Attribute', 'Cvphar\Attribute');
humbug_phpscoper_expose_class('UnhandledMatchError', 'Cvphar\UnhandledMatchError');
humbug_phpscoper_expose_class('Stringable', 'Cvphar\Stringable');

// Function aliases. For more information see:
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#function-aliases
if (!function_exists('array_key_first')) { function array_key_first() { return \Cvphar\array_key_first(...func_get_args()); } }
if (!function_exists('array_key_last')) { function array_key_last() { return \Cvphar\array_key_last(...func_get_args()); } }
if (!function_exists('fdiv')) { function fdiv() { return \Cvphar\fdiv(...func_get_args()); } }
if (!function_exists('get_debug_type')) { function get_debug_type() { return \Cvphar\get_debug_type(...func_get_args()); } }
if (!function_exists('get_resource_id')) { function get_resource_id() { return \Cvphar\get_resource_id(...func_get_args()); } }
if (!function_exists('hrtime')) { function hrtime() { return \Cvphar\hrtime(...func_get_args()); } }
if (!function_exists('is_countable')) { function is_countable() { return \Cvphar\is_countable(...func_get_args()); } }
if (!function_exists('mb_check_encoding')) { function mb_check_encoding() { return \Cvphar\mb_check_encoding(...func_get_args()); } }
if (!function_exists('mb_chr')) { function mb_chr() { return \Cvphar\mb_chr(...func_get_args()); } }
if (!function_exists('mb_convert_case')) { function mb_convert_case() { return \Cvphar\mb_convert_case(...func_get_args()); } }
if (!function_exists('mb_convert_encoding')) { function mb_convert_encoding() { return \Cvphar\mb_convert_encoding(...func_get_args()); } }
if (!function_exists('mb_convert_variables')) { function mb_convert_variables() { return \Cvphar\mb_convert_variables(...func_get_args()); } }
if (!function_exists('mb_decode_mimeheader')) { function mb_decode_mimeheader() { return \Cvphar\mb_decode_mimeheader(...func_get_args()); } }
if (!function_exists('mb_decode_numericentity')) { function mb_decode_numericentity() { return \Cvphar\mb_decode_numericentity(...func_get_args()); } }
if (!function_exists('mb_detect_encoding')) { function mb_detect_encoding() { return \Cvphar\mb_detect_encoding(...func_get_args()); } }
if (!function_exists('mb_detect_order')) { function mb_detect_order() { return \Cvphar\mb_detect_order(...func_get_args()); } }
if (!function_exists('mb_encode_mimeheader')) { function mb_encode_mimeheader() { return \Cvphar\mb_encode_mimeheader(...func_get_args()); } }
if (!function_exists('mb_encode_numericentity')) { function mb_encode_numericentity() { return \Cvphar\mb_encode_numericentity(...func_get_args()); } }
if (!function_exists('mb_encoding_aliases')) { function mb_encoding_aliases() { return \Cvphar\mb_encoding_aliases(...func_get_args()); } }
if (!function_exists('mb_get_info')) { function mb_get_info() { return \Cvphar\mb_get_info(...func_get_args()); } }
if (!function_exists('mb_http_input')) { function mb_http_input() { return \Cvphar\mb_http_input(...func_get_args()); } }
if (!function_exists('mb_http_output')) { function mb_http_output() { return \Cvphar\mb_http_output(...func_get_args()); } }
if (!function_exists('mb_internal_encoding')) { function mb_internal_encoding() { return \Cvphar\mb_internal_encoding(...func_get_args()); } }
if (!function_exists('mb_language')) { function mb_language() { return \Cvphar\mb_language(...func_get_args()); } }
if (!function_exists('mb_list_encodings')) { function mb_list_encodings() { return \Cvphar\mb_list_encodings(...func_get_args()); } }
if (!function_exists('mb_ord')) { function mb_ord() { return \Cvphar\mb_ord(...func_get_args()); } }
if (!function_exists('mb_output_handler')) { function mb_output_handler() { return \Cvphar\mb_output_handler(...func_get_args()); } }
if (!function_exists('mb_parse_str')) { function mb_parse_str() { return \Cvphar\mb_parse_str(...func_get_args()); } }
if (!function_exists('mb_scrub')) { function mb_scrub() { return \Cvphar\mb_scrub(...func_get_args()); } }
if (!function_exists('mb_str_split')) { function mb_str_split() { return \Cvphar\mb_str_split(...func_get_args()); } }
if (!function_exists('mb_stripos')) { function mb_stripos() { return \Cvphar\mb_stripos(...func_get_args()); } }
if (!function_exists('mb_stristr')) { function mb_stristr() { return \Cvphar\mb_stristr(...func_get_args()); } }
if (!function_exists('mb_strlen')) { function mb_strlen() { return \Cvphar\mb_strlen(...func_get_args()); } }
if (!function_exists('mb_strpos')) { function mb_strpos() { return \Cvphar\mb_strpos(...func_get_args()); } }
if (!function_exists('mb_strrchr')) { function mb_strrchr() { return \Cvphar\mb_strrchr(...func_get_args()); } }
if (!function_exists('mb_strrichr')) { function mb_strrichr() { return \Cvphar\mb_strrichr(...func_get_args()); } }
if (!function_exists('mb_strripos')) { function mb_strripos() { return \Cvphar\mb_strripos(...func_get_args()); } }
if (!function_exists('mb_strrpos')) { function mb_strrpos() { return \Cvphar\mb_strrpos(...func_get_args()); } }
if (!function_exists('mb_strstr')) { function mb_strstr() { return \Cvphar\mb_strstr(...func_get_args()); } }
if (!function_exists('mb_strtolower')) { function mb_strtolower() { return \Cvphar\mb_strtolower(...func_get_args()); } }
if (!function_exists('mb_strtoupper')) { function mb_strtoupper() { return \Cvphar\mb_strtoupper(...func_get_args()); } }
if (!function_exists('mb_strwidth')) { function mb_strwidth() { return \Cvphar\mb_strwidth(...func_get_args()); } }
if (!function_exists('mb_substitute_character')) { function mb_substitute_character() { return \Cvphar\mb_substitute_character(...func_get_args()); } }
if (!function_exists('mb_substr')) { function mb_substr() { return \Cvphar\mb_substr(...func_get_args()); } }
if (!function_exists('mb_substr_count')) { function mb_substr_count() { return \Cvphar\mb_substr_count(...func_get_args()); } }
if (!function_exists('preg_last_error_msg')) { function preg_last_error_msg() { return \Cvphar\preg_last_error_msg(...func_get_args()); } }
if (!function_exists('str_contains')) { function str_contains() { return \Cvphar\str_contains(...func_get_args()); } }
if (!function_exists('str_ends_with')) { function str_ends_with() { return \Cvphar\str_ends_with(...func_get_args()); } }
if (!function_exists('str_starts_with')) { function str_starts_with() { return \Cvphar\str_starts_with(...func_get_args()); } }

return $loader;
<?php

namespace Cvphar\LesserEvil;

class ShellVerbosityIsEvil
{
    public static function doWithoutEvil($callback)
    {
        try {
            static::removeEvil();
            return $callback();
        } finally {
            static::removeEvil();
        }
    }
    public static function removeEvil() : void
    {
        if (\function_exists('putenv')) {
            @\putenv('SHELL_VERBOSITY=');
        }
        unset($_ENV['SHELL_VERBOSITY']);
        unset($_SERVER['SHELL_VERBOSITY']);
    }
}
<?php

namespace Cvphar;

\define('LIB', '(?(DEFINE)
    (?<singleQuotedString>\'[^\\\\\']*+(?:\\\\.[^\\\\\']*+)*+\')
    (?<doubleQuotedString>"[^\\\\"]*+(?:\\\\.[^\\\\"]*+)*+")
    (?<string>(?&singleQuotedString)|(?&doubleQuotedString))
    (?<comment>/\\*[^*]*+(?:\\*(?!/)[^*]*+)*+\\*/)
    (?<code>\\{[^\'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\'"/{}]*+)*+})
)');
\define('PARAMS', '\\[(?<params>[^[\\]]*+(?:\\[(?&params)\\][^[\\]]*+)*+)\\]');
\define('ARGS', '\\((?<args>[^()]*+(?:\\((?&args)\\)[^()]*+)*+)\\)');
function preprocessGrammar($code)
{
    $code = resolveNodes($code);
    $code = resolveMacros($code);
    $code = resolveStackAccess($code);
    return $code;
}
function resolveNodes($code)
{
    return \preg_replace_callback('~\\b(?<name>[A-Z][a-zA-Z_\\\\]++)\\s*' . \PARAMS . '~', function ($matches) {
        $matches['params'] = resolveNodes($matches['params']);
        $params = magicSplit('(?:' . \PARAMS . '|' . \ARGS . ')(*SKIP)(*FAIL)|,', $matches['params']);
        $paramCode = '';
        foreach ($params as $param) {
            $paramCode .= $param . ', ';
        }
        return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())';
    }, $code);
}
function resolveMacros($code)
{
    return \preg_replace_callback('~\\b(?<!::|->)(?!array\\()(?<name>[a-z][A-Za-z]++)' . \ARGS . '~', function ($matches) {
        $matches['args'] = resolveMacros($matches['args']);
        $name = $matches['name'];
        $args = magicSplit('(?:' . \PARAMS . '|' . \ARGS . ')(*SKIP)(*FAIL)|,', $matches['args']);
        if ('attributes' === $name) {
            assertArgs(0, $args, $name);
            return '$this->startAttributeStack[#1] + $this->endAttributes';
        }
        if ('stackAttributes' === $name) {
            assertArgs(1, $args, $name);
            return '$this->startAttributeStack[' . $args[0] . ']' . ' + $this->endAttributeStack[' . $args[0] . ']';
        }
        if ('init' === $name) {
            return '$$ = array(' . \implode(', ', $args) . ')';
        }
        if ('push' === $name) {
            assertArgs(2, $args, $name);
            return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0];
        }
        if ('pushNormalizing' === $name) {
            assertArgs(2, $args, $name);
            return 'if (is_array(' . $args[1] . ')) { $$ = array_merge(' . $args[0] . ', ' . $args[1] . '); }' . ' else { ' . $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0] . '; }';
        }
        if ('toArray' == $name) {
            assertArgs(1, $args, $name);
            return 'is_array(' . $args[0] . ') ? ' . $args[0] . ' : array(' . $args[0] . ')';
        }
        if ('parseVar' === $name) {
            assertArgs(1, $args, $name);
            return 'substr(' . $args[0] . ', 1)';
        }
        if ('parseEncapsed' === $name) {
            assertArgs(3, $args, $name);
            return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\\Scalar\\EncapsedStringPart) {' . ' $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }';
        }
        if ('makeNop' === $name) {
            assertArgs(3, $args, $name);
            return '$startAttributes = ' . $args[1] . ';' . ' if (isset($startAttributes[\'comments\']))' . ' { ' . $args[0] . ' = new Stmt\\Nop($startAttributes + ' . $args[2] . '); }' . ' else { ' . $args[0] . ' = null; }';
        }
        if ('makeZeroLengthNop' == $name) {
            assertArgs(2, $args, $name);
            return '$startAttributes = ' . $args[1] . ';' . ' if (isset($startAttributes[\'comments\']))' . ' { ' . $args[0] . ' = new Stmt\\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }' . ' else { ' . $args[0] . ' = null; }';
        }
        if ('prependLeadingComments' === $name) {
            assertArgs(1, $args, $name);
            return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; ' . 'if (!empty($attrs[\'comments\'])) {' . '$stmts[0]->setAttribute(\'comments\', ' . 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }';
        }
        return $matches[0];
    }, $code);
}
function assertArgs($num, $args, $name)
{
    if ($num != \count($args)) {
        die('Wrong argument count for ' . $name . '().');
    }
}
function resolveStackAccess($code)
{
    $code = \preg_replace('/\\$\\d+/', '$this->semStack[$0]', $code);
    $code = \preg_replace('/#(\\d+)/', '$$1', $code);
    return $code;
}
function removeTrailingWhitespace($code)
{
    $lines = \explode("\n", $code);
    $lines = \array_map('rtrim', $lines);
    return \implode("\n", $lines);
}
function regex($regex)
{
    return '~' . \LIB . '(?:' . \str_replace('~', '\\~', $regex) . ')~';
}
function magicSplit($regex, $string)
{
    $pieces = \preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string);
    foreach ($pieces as &$piece) {
        $piece = \trim($piece);
    }
    if ($pieces === ['']) {
        return [];
    }
    return $pieces;
}
<?php

namespace Cvphar;

require __DIR__ . '/phpyLang.php';
$grammarFileToName = [__DIR__ . '/php5.y' => 'Php5', __DIR__ . '/php7.y' => 'Php7'];
$tokensFile = __DIR__ . '/tokens.y';
$tokensTemplate = __DIR__ . '/tokens.template';
$skeletonFile = __DIR__ . '/parser.template';
$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy';
$tmpResultFile = __DIR__ . '/tmp_parser.php';
$resultDir = __DIR__ . '/../lib/PhpParser/Parser';
$tokensResultsFile = $resultDir . '/Tokens.php';
$kmyacc = \getenv('KMYACC');
if (!$kmyacc) {
    $kmyacc = __DIR__ . '/../vendor/bin/phpyacc';
}
$options = \array_flip($argv);
$optionDebug = isset($options['--debug']);
$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']);
$tokens = \file_get_contents($tokensFile);
foreach ($grammarFileToName as $grammarFile => $name) {
    echo "Building temporary {$name} grammar file.\n";
    $grammarCode = \file_get_contents($grammarFile);
    $grammarCode = \str_replace('%tokens', $tokens, $grammarCode);
    $grammarCode = preprocessGrammar($grammarCode);
    \file_put_contents($tmpGrammarFile, $grammarCode);
    $additionalArgs = $optionDebug ? '-t -v' : '';
    echo "Building {$name} parser.\n";
    $output = execCmd("{$kmyacc} {$additionalArgs} -m {$skeletonFile} -p {$name} {$tmpGrammarFile}");
    $resultCode = \file_get_contents($tmpResultFile);
    $resultCode = removeTrailingWhitespace($resultCode);
    ensureDirExists($resultDir);
    \file_put_contents("{$resultDir}/{$name}.php", $resultCode);
    \unlink($tmpResultFile);
    echo "Building token definition.\n";
    $output = execCmd("{$kmyacc} -m {$tokensTemplate} {$tmpGrammarFile}");
    \rename($tmpResultFile, $tokensResultsFile);
    if (!$optionKeepTmpGrammar) {
        \unlink($tmpGrammarFile);
    }
}
function ensureDirExists($dir)
{
    if (!\is_dir($dir)) {
        \mkdir($dir, 0777, \true);
    }
}
function execCmd($cmd)
{
    $output = \trim(\shell_exec("{$cmd} 2>&1"));
    if ($output !== "") {
        echo "> " . $cmd . "\n";
        echo $output;
    }
    return $output;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Name\FullyQualified;
use Cvphar\PhpParser\Node\Stmt;
class NameContext
{
    protected $namespace;
    protected $aliases = [];
    protected $origAliases = [];
    protected $errorHandler;
    public function __construct(ErrorHandler $errorHandler)
    {
        $this->errorHandler = $errorHandler;
    }
    public function startNamespace(Name $namespace = null)
    {
        $this->namespace = $namespace;
        $this->origAliases = $this->aliases = [Stmt\Use_::TYPE_NORMAL => [], Stmt\Use_::TYPE_FUNCTION => [], Stmt\Use_::TYPE_CONSTANT => []];
    }
    public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = [])
    {
        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;
    }
    public function getNamespace()
    {
        return $this->namespace;
    }
    public function getResolvedName(Name $name, int $type)
    {
        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;
        }
        if ($name->isFullyQualified()) {
            return $name;
        }
        if (null !== ($resolvedName = $this->resolveAlias($name, $type))) {
            return $resolvedName;
        }
        if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) {
            if (null === $this->namespace) {
                return new FullyQualified($name, $name->getAttributes());
            }
            return null;
        }
        return FullyQualified::concat($this->namespace, $name, $name->getAttributes());
    }
    public function getResolvedClassName(Name $name) : Name
    {
        return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL);
    }
    public function getPossibleNames(string $name, int $type) : array
    {
        $lcName = \strtolower($name);
        if ($type === Stmt\Use_::TYPE_NORMAL) {
            if ($lcName === "self" || $lcName === "parent" || $lcName === "static") {
                return [new Name($name)];
            }
        }
        $possibleNames = [new FullyQualified($name)];
        if (null !== ($nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type))) {
            if (null === $this->resolveAlias($nsRelativeName, $type)) {
                $possibleNames[] = $nsRelativeName;
            }
        }
        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)));
            }
        }
        foreach ($this->origAliases[$type] as $alias => $orig) {
            if ($type === Stmt\Use_::TYPE_CONSTANT) {
                $normalizedOrig = $this->normalizeConstName($orig->toString());
                if ($normalizedOrig === $this->normalizeConstName($name)) {
                    $possibleNames[] = new Name($alias);
                }
            } else {
                if ($orig->toLowerString() === $lcName) {
                    $possibleNames[] = new Name($alias);
                }
            }
        }
        return $possibleNames;
    }
    public function getShortName(string $name, int $type) : Name
    {
        $possibleNames = $this->getPossibleNames($name, $type);
        $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, $type)
    {
        $firstPart = $name->getFirst();
        if ($name->isQualified()) {
            $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()) {
            $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : \strtolower($firstPart);
            if (isset($this->aliases[$type][$checkName])) {
                return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes());
            }
        }
        return null;
    }
    private function getNamespaceRelativeName(string $name, string $lcName, int $type)
    {
        if (null === $this->namespace) {
            return new Name($name);
        }
        if ($type === Stmt\Use_::TYPE_CONSTANT) {
            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)
    {
        $nsSep = \strrpos($name, '\\');
        if (\false === $nsSep) {
            return $name;
        }
        $ns = \substr($name, 0, $nsSep);
        $shortName = \substr($name, $nsSep + 1);
        return \strtolower($ns) . '\\' . $shortName;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class NodeVisitorAbstract implements NodeVisitor
{
    public function beforeTraverse(array $nodes)
    {
        return null;
    }
    public function enterNode(Node $node)
    {
        return null;
    }
    public function leaveNode(Node $node)
    {
        return null;
    }
    public function afterTraverse(array $nodes)
    {
        return null;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface NodeVisitor
{
    public function beforeTraverse(array $nodes);
    public function enterNode(Node $node);
    public function leaveNode(Node $node);
    public function afterTraverse(array $nodes);
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Node\ComplexType;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\NullableType;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Stmt;
final class BuilderHelpers
{
    public static function normalizeNode($node) : Node
    {
        if ($node instanceof Builder) {
            return $node->getNode();
        }
        if ($node instanceof Node) {
            return $node;
        }
        throw new \LogicException('Expected node or builder object');
    }
    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');
    }
    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');
    }
    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');
    }
    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');
    }
    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);
    }
    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;
    }
    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\LNumber($value);
        }
        if (\is_float($value)) {
            return new Scalar\DNumber($value);
        }
        if (\is_string($value)) {
            return new Scalar\String_($value);
        }
        if (\is_array($value)) {
            $items = [];
            $lastKey = -1;
            foreach ($value as $itemKey => $itemValue) {
                if (null !== $lastKey && ++$lastKey === $itemKey) {
                    $items[] = new Expr\ArrayItem(self::normalizeValue($itemValue));
                } else {
                    $lastKey = null;
                    $items[] = new Expr\ArrayItem(self::normalizeValue($itemValue), self::normalizeValue($itemKey));
                }
            }
            return new Expr\Array_($items);
        }
        throw new \LogicException('Invalid value');
    }
    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');
    }
    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]);
    }
    public static function addModifier(int $modifiers, int $modifier) : int
    {
        Stmt\Class_::verifyModifier($modifiers, $modifier);
        return $modifiers | $modifier;
    }
    public static function addClassModifier(int $existingModifiers, int $modifierToSet) : int
    {
        Stmt\Class_::verifyClassModifier($existingModifiers, $modifierToSet);
        return $existingModifiers | $modifierToSet;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeVisitorAbstract;
class FindingVisitor extends NodeVisitorAbstract
{
    protected $filterCallback;
    protected $foundNodes;
    public function __construct(callable $filterCallback)
    {
        $this->filterCallback = $filterCallback;
    }
    public function getFoundNodes() : array
    {
        return $this->foundNodes;
    }
    public function beforeTraverse(array $nodes)
    {
        $this->foundNodes = [];
        return null;
    }
    public function enterNode(Node $node)
    {
        $filterCallback = $this->filterCallback;
        if ($filterCallback($node)) {
            $this->foundNodes[] = $node;
        }
        return null;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use Cvphar\PhpParser\ErrorHandler;
use Cvphar\PhpParser\NameContext;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Name\FullyQualified;
use Cvphar\PhpParser\Node\Stmt;
use Cvphar\PhpParser\NodeVisitorAbstract;
class NameResolver extends NodeVisitorAbstract
{
    protected $nameContext;
    protected $preserveOriginalNames;
    protected $replaceNodes;
    public function __construct(ErrorHandler $errorHandler = null, array $options = [])
    {
        $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing());
        $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? \false;
        $this->replaceNodes = $options['replaceNodes'] ?? \true;
    }
    public function getNameContext() : NameContext
    {
        return $this->nameContext;
    }
    public function beforeTraverse(array $nodes)
    {
        $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);
            }
        } 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);
            if (null !== $node->name) {
                $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);
            }
        } else {
            if ($node instanceof Stmt\ClassConst) {
                $this->resolveAttrGroups($node);
            } else {
                if ($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;
    }
    private function addAlias(Stmt\UseUse $use, int $type, Name $prefix = null)
    {
        $name = $prefix ? Name::concat($prefix, $use->name) : $use->name;
        $type |= $use->type;
        $this->nameContext->addAlias($name, (string) $use->getAlias(), $type, $use->getAttributes());
    }
    private function resolveSignature($node)
    {
        foreach ($node->params as $param) {
            $param->type = $this->resolveType($param->type);
            $this->resolveAttrGroups($param);
        }
        $node->returnType = $this->resolveType($node->returnType);
    }
    private function resolveType($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;
    }
    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) {
            $originalName = $name;
            $name = clone $originalName;
            $name->setAttribute('originalName', $originalName);
        }
        $resolvedName = $this->nameContext->getResolvedName($name, $type);
        if (null !== $resolvedName) {
            return $resolvedName;
        }
        $name->setAttribute('namespacedName', FullyQualified::concat($this->nameContext->getNamespace(), $name, $name->getAttributes()));
        return $name;
    }
    protected function resolveClassName(Name $name)
    {
        return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL);
    }
    protected function addNamespacedName(Node $node)
    {
        $node->namespacedName = Name::concat($this->nameContext->getNamespace(), (string) $node->name);
    }
    protected function resolveAttrGroups(Node $node)
    {
        foreach ($node->attrGroups as $attrGroup) {
            foreach ($attrGroup->attrs as $attr) {
                $attr->name = $this->resolveClassName($attr->name);
            }
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeTraverser;
use Cvphar\PhpParser\NodeVisitorAbstract;
class FirstFindingVisitor extends NodeVisitorAbstract
{
    protected $filterCallback;
    protected $foundNode;
    public function __construct(callable $filterCallback)
    {
        $this->filterCallback = $filterCallback;
    }
    public function getFoundNode()
    {
        return $this->foundNode;
    }
    public function beforeTraverse(array $nodes)
    {
        $this->foundNode = null;
        return null;
    }
    public function enterNode(Node $node)
    {
        $filterCallback = $this->filterCallback;
        if ($filterCallback($node)) {
            $this->foundNode = $node;
            return NodeTraverser::STOP_TRAVERSAL;
        }
        return null;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeVisitorAbstract;
class CloningVisitor extends NodeVisitorAbstract
{
    public function enterNode(Node $origNode)
    {
        $node = clone $origNode;
        $node->setAttribute('origNode', $origNode);
        return $node;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use function array_pop;
use function count;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeVisitorAbstract;
final class ParentConnectingVisitor extends NodeVisitorAbstract
{
    private $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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\NodeVisitor;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeVisitorAbstract;
final class NodeConnectingVisitor extends NodeVisitorAbstract
{
    private $stack = [];
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface Parser
{
    public function parse(string $code, ErrorHandler $errorHandler = null);
}
<?php

namespace Cvphar\PhpParser;

class ConstExprEvaluationException extends \Exception
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\ErrorHandler;
use Cvphar\PhpParser\Lexer;
use Cvphar\PhpParser\Lexer\TokenEmulator\AttributeEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\EnumTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\CoaleseEqualTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\ExplicitOctalEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\FlexibleDocStringEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\FnTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\MatchTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\NullsafeTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\NumericLiteralSeparatorEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\ReadonlyFunctionTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\ReadonlyTokenEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\ReverseEmulator;
use Cvphar\PhpParser\Lexer\TokenEmulator\TokenEmulator;
class Emulative extends Lexer
{
    const PHP_7_3 = '7.3dev';
    const PHP_7_4 = '7.4dev';
    const PHP_8_0 = '8.0dev';
    const PHP_8_1 = '8.1dev';
    const PHP_8_2 = '8.2dev';
    private $patches = [];
    private $emulators = [];
    private $targetPhpVersion;
    public function __construct(array $options = [])
    {
        $this->targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_2;
        unset($options['phpVersion']);
        parent::__construct($options);
        $emulators = [new FlexibleDocStringEmulator(), new FnTokenEmulator(), new MatchTokenEmulator(), new CoaleseEqualTokenEmulator(), new NumericLiteralSeparatorEmulator(), new NullsafeTokenEmulator(), new AttributeEmulator(), new EnumTokenEmulator(), new ReadonlyTokenEmulator(), new ExplicitOctalEmulator(), new ReadonlyFunctionTokenEmulator()];
        foreach ($emulators as $emulator) {
            $emulatorPhpVersion = $emulator->getPhpVersion();
            if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) {
                $this->emulators[] = $emulator;
            } else {
                if ($this->isReverseEmulationNeeded($emulatorPhpVersion)) {
                    $this->emulators[] = new ReverseEmulator($emulator);
                }
            }
        }
    }
    public function startLexing(string $code, ErrorHandler $errorHandler = null)
    {
        $emulators = \array_filter($this->emulators, function ($emulator) use($code) {
            return $emulator->isEmulationNeeded($code);
        });
        if (empty($emulators)) {
            parent::startLexing($code, $errorHandler);
            return;
        }
        $this->patches = [];
        foreach ($emulators as $emulator) {
            $code = $emulator->preprocessCode($code, $this->patches);
        }
        $collector = new ErrorHandler\Collecting();
        parent::startLexing($code, $collector);
        $this->sortPatches();
        $this->fixupTokens();
        $errors = $collector->getErrors();
        if (!empty($errors)) {
            $this->fixupErrors($errors);
            foreach ($errors as $error) {
                $errorHandler->handleError($error);
            }
        }
        foreach ($emulators as $emulator) {
            $this->tokens = $emulator->emulate($code, $this->tokens);
        }
    }
    private function isForwardEmulationNeeded(string $emulatorPhpVersion) : bool
    {
        return \version_compare(\PHP_VERSION, $emulatorPhpVersion, '<') && \version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>=');
    }
    private function isReverseEmulationNeeded(string $emulatorPhpVersion) : bool
    {
        return \version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=') && \version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<');
    }
    private function sortPatches()
    {
        \usort($this->patches, function ($p1, $p2) {
            return $p1[0] <=> $p2[0];
        });
    }
    private function fixupTokens()
    {
        if (\count($this->patches) === 0) {
            return;
        }
        $patchIdx = 0;
        list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
        $pos = 0;
        for ($i = 0, $c = \count($this->tokens); $i < $c; $i++) {
            $token = $this->tokens[$i];
            if (\is_string($token)) {
                if ($patchPos === $pos) {
                    \assert($patchType === 'replace');
                    $this->tokens[$i] = $patchText;
                    $patchIdx++;
                    if ($patchIdx >= \count($this->patches)) {
                        return;
                    }
                    list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
                }
                $pos += \strlen($token);
                continue;
            }
            $len = \strlen($token[1]);
            $posDelta = 0;
            while ($patchPos >= $pos && $patchPos < $pos + $len) {
                $patchTextLen = \strlen($patchText);
                if ($patchType === 'remove') {
                    if ($patchPos === $pos && $patchTextLen === $len) {
                        \array_splice($this->tokens, $i, 1, []);
                        $i--;
                        $c--;
                    } else {
                        $this->tokens[$i][1] = \substr_replace($token[1], '', $patchPos - $pos + $posDelta, $patchTextLen);
                        $posDelta -= $patchTextLen;
                    }
                } elseif ($patchType === 'add') {
                    $this->tokens[$i][1] = \substr_replace($token[1], $patchText, $patchPos - $pos + $posDelta, 0);
                    $posDelta += $patchTextLen;
                } else {
                    if ($patchType === 'replace') {
                        $this->tokens[$i][1] = \substr_replace($token[1], $patchText, $patchPos - $pos + $posDelta, $patchTextLen);
                    } else {
                        \assert(\false);
                    }
                }
                $patchIdx++;
                if ($patchIdx >= \count($this->patches)) {
                    return;
                }
                list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
                $token = $this->tokens[$i];
            }
            $pos += $len;
        }
        \assert(\false);
    }
    private function fixupErrors(array $errors)
    {
        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']) {
                    break;
                }
                if ($patchType === 'add') {
                    $posDelta += \strlen($patchText);
                    $lineDelta += \substr_count($patchText, "\n");
                } else {
                    if ($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);
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class AttributeEmulator extends TokenEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_0;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos($code, '#[') !== \false;
    }
    public function emulate(string $code, array $tokens) : array
    {
        $line = 1;
        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
            if ($tokens[$i] === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1] === '[') {
                \array_splice($tokens, $i, 2, [[\T_ATTRIBUTE, '#[', $line]]);
                $c--;
                continue;
            }
            if (\is_array($tokens[$i])) {
                $line += \substr_count($tokens[$i][1], "\n");
            }
        }
        return $tokens;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
    public function preprocessCode(string $code, array &$patches) : string
    {
        $pos = 0;
        while (\false !== ($pos = \strpos($code, '#[', $pos))) {
            $code[$pos] = '%';
            $patches[] = [$pos, 'replace', '#'];
            $pos += 2;
        }
        return $code;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

final class ReverseEmulator extends TokenEmulator
{
    private $emulator;
    public function __construct(TokenEmulator $emulator)
    {
        $this->emulator = $emulator;
    }
    public function getPhpVersion() : string
    {
        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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
class ExplicitOctalEmulator extends TokenEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_1;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos($code, '0o') !== \false || \strpos($code, '0O') !== \false;
    }
    public function emulate(string $code, array $tokens) : array
    {
        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
            if ($tokens[$i][0] == \T_LNUMBER && $tokens[$i][1] === '0' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] == \T_STRING && \preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1][1])) {
                $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1][1]);
                \array_splice($tokens, $i, 2, [[$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]]]);
                $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
    {
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class ReadonlyTokenEmulator extends KeywordEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_1;
    }
    public function getKeywordString() : string
    {
        return 'readonly';
    }
    public function getKeywordToken() : int
    {
        return \T_READONLY;
    }
    protected function isKeywordContext(array $tokens, int $pos) : bool
    {
        if (!parent::isKeywordContext($tokens, $pos)) {
            return \false;
        }
        return !(isset($tokens[$pos + 1]) && ($tokens[$pos + 1][0] === '(' || $tokens[$pos + 1][0] === \T_WHITESPACE && isset($tokens[$pos + 2]) && $tokens[$pos + 2][0] === '('));
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
class ReadonlyFunctionTokenEmulator extends KeywordEmulator
{
    public function getKeywordString() : string
    {
        return 'readonly';
    }
    public function getKeywordToken() : int
    {
        return \T_READONLY;
    }
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_2;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

abstract class KeywordEmulator extends TokenEmulator
{
    abstract function getKeywordString() : string;
    abstract function getKeywordToken() : int;
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos(\strtolower($code), $this->getKeywordString()) !== \false;
    }
    protected function isKeywordContext(array $tokens, int $pos) : bool
    {
        $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos);
        return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR;
    }
    public function emulate(string $code, array $tokens) : array
    {
        $keywordString = $this->getKeywordString();
        foreach ($tokens as $i => $token) {
            if ($token[0] === \T_STRING && \strtolower($token[1]) === $keywordString && $this->isKeywordContext($tokens, $i)) {
                $tokens[$i][0] = $this->getKeywordToken();
            }
        }
        return $tokens;
    }
    private function getPreviousNonSpaceToken(array $tokens, int $start)
    {
        for ($i = $start - 1; $i >= 0; --$i) {
            if ($tokens[$i][0] === \T_WHITESPACE) {
                continue;
            }
            return $tokens[$i];
        }
        return null;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        $keywordToken = $this->getKeywordToken();
        foreach ($tokens as $i => $token) {
            if ($token[0] === $keywordToken) {
                $tokens[$i][0] = \T_STRING;
            }
        }
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class EnumTokenEmulator extends KeywordEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_1;
    }
    public function getKeywordString() : string
    {
        return 'enum';
    }
    public function getKeywordToken() : int
    {
        return \T_ENUM;
    }
    protected function isKeywordContext(array $tokens, int $pos) : bool
    {
        return parent::isKeywordContext($tokens, $pos) && isset($tokens[$pos + 2]) && $tokens[$pos + 1][0] === \T_WHITESPACE && $tokens[$pos + 2][0] === \T_STRING;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class NumericLiteralSeparatorEmulator extends TokenEmulator
{
    const BIN = '(?:0b[01]+(?:_[01]+)*)';
    const HEX = '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)';
    const DEC = '(?:[0-9]+(?:_[0-9]+)*)';
    const SIMPLE_FLOAT = '(?:' . self::DEC . '\\.' . self::DEC . '?|\\.' . self::DEC . ')';
    const EXP = '(?:e[+-]?' . self::DEC . ')';
    const FLOAT = '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')';
    const NUMBER = '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA';
    public function getPhpVersion() : string
    {
        return Emulative::PHP_7_4;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \preg_match('~[0-9]_[0-9]~', $code) || \preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code);
    }
    public function emulate(string $code, array $tokens) : array
    {
        $codeOffset = 0;
        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
            $token = $tokens[$i];
            $tokenLen = \strlen(\is_array($token) ? $token[1] : $token);
            if ($token[0] !== \T_LNUMBER && $token[0] !== \T_DNUMBER) {
                $codeOffset += $tokenLen;
                continue;
            }
            $res = \preg_match(self::NUMBER, $code, $matches, 0, $codeOffset);
            \assert($res, "No number at number token position");
            $match = $matches[0];
            $matchLen = \strlen($match);
            if ($matchLen === $tokenLen) {
                $codeOffset += $tokenLen;
                continue;
            }
            $tokenKind = $this->resolveIntegerOrFloatToken($match);
            $newTokens = [[$tokenKind, $match, $token[2]]];
            $numTokens = 1;
            $len = $tokenLen;
            while ($matchLen > $len) {
                $nextToken = $tokens[$i + $numTokens];
                $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken;
                $nextTokenLen = \strlen($nextTokenText);
                $numTokens++;
                if ($matchLen < $len + $nextTokenLen) {
                    \assert(\is_array($nextToken), "Partial token should be an array token");
                    $partialText = \substr($nextTokenText, $matchLen - $len);
                    $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]];
                    break;
                }
                $len += $nextTokenLen;
            }
            \array_splice($tokens, $i, $numTokens, $newTokens);
            $c -= $numTokens - \count($newTokens);
            $codeOffset += $matchLen;
        }
        return $tokens;
    }
    private function resolveIntegerOrFloatToken(string $str) : int
    {
        $str = \str_replace('_', '', $str);
        if (\stripos($str, '0b') === 0) {
            $num = \bindec($str);
        } elseif (\stripos($str, '0x') === 0) {
            $num = \hexdec($str);
        } elseif (\stripos($str, '0') === 0 && \ctype_digit($str)) {
            $num = \octdec($str);
        } else {
            $num = +$str;
        }
        return \is_float($num) ? \T_DNUMBER : \T_LNUMBER;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class FlexibleDocStringEmulator extends TokenEmulator
{
    const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX'
/<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n
(?:.*\r?\n)*?
(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
REGEX;
    public function getPhpVersion() : string
    {
        return Emulative::PHP_7_3;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos($code, '<<<') !== \false;
    }
    public function emulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
    public function preprocessCode(string $code, array &$patches) : string
    {
        if (!\preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE)) {
            return $code;
        }
        $posDelta = 0;
        foreach ($matches as $match) {
            $indentation = $match['indentation'][0];
            $indentationStart = $match['indentation'][1];
            $separator = $match['separator'][0];
            $separatorStart = $match['separator'][1];
            if ($indentation === '' && $separator !== '') {
                continue;
            }
            if ($indentation !== '') {
                $indentationLen = \strlen($indentation);
                $code = \substr_replace($code, '', $indentationStart + $posDelta, $indentationLen);
                $patches[] = [$indentationStart + $posDelta, 'add', $indentation];
                $posDelta -= $indentationLen;
            }
            if ($separator === '') {
                $code = \substr_replace($code, "\n", $separatorStart + $posDelta, 0);
                $patches[] = [$separatorStart + $posDelta, 'remove', "\n"];
                $posDelta += 1;
            }
        }
        return $code;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class FnTokenEmulator extends KeywordEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_7_4;
    }
    public function getKeywordString() : string
    {
        return 'fn';
    }
    public function getKeywordToken() : int
    {
        return \T_FN;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class CoaleseEqualTokenEmulator extends TokenEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_7_4;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos($code, '??=') !== \false;
    }
    public function emulate(string $code, array $tokens) : array
    {
        $line = 1;
        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
            if (isset($tokens[$i + 1])) {
                if ($tokens[$i][0] === \T_COALESCE && $tokens[$i + 1] === '=') {
                    \array_splice($tokens, $i, 2, [[\T_COALESCE_EQUAL, '??=', $line]]);
                    $c--;
                    continue;
                }
            }
            if (\is_array($tokens[$i])) {
                $line += \substr_count($tokens[$i][1], "\n");
            }
        }
        return $tokens;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class NullsafeTokenEmulator extends TokenEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_0;
    }
    public function isEmulationNeeded(string $code) : bool
    {
        return \strpos($code, '?->') !== \false;
    }
    public function emulate(string $code, array $tokens) : array
    {
        $line = 1;
        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
            if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) {
                \array_splice($tokens, $i, 2, [[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line]]);
                $c--;
                continue;
            }
            if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) && $tokens[$i - 1][0] === \T_VARIABLE && \preg_match('/^\\?->([a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)/', $tokens[$i][1], $matches)) {
                $replacement = [[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line], [\T_STRING, $matches[1], $line]];
                if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) {
                    $replacement[] = [\T_ENCAPSED_AND_WHITESPACE, \substr($tokens[$i][1], \strlen($matches[0])), $line];
                }
                \array_splice($tokens, $i, 1, $replacement);
                $c += \count($replacement) - 1;
                continue;
            }
            if (\is_array($tokens[$i])) {
                $line += \substr_count($tokens[$i][1], "\n");
            }
        }
        return $tokens;
    }
    public function reverseEmulate(string $code, array $tokens) : array
    {
        return $tokens;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

abstract class TokenEmulator
{
    public abstract function getPhpVersion() : string;
    public abstract function isEmulationNeeded(string $code) : bool;
    public abstract function emulate(string $code, array $tokens) : array;
    public abstract function reverseEmulate(string $code, array $tokens) : array;
    public function preprocessCode(string $code, array &$patches) : string
    {
        return $code;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Lexer\TokenEmulator;

use Cvphar\PhpParser\Lexer\Emulative;
final class MatchTokenEmulator extends KeywordEmulator
{
    public function getPhpVersion() : string
    {
        return Emulative::PHP_8_0;
    }
    public function getKeywordString() : string
    {
        return 'match';
    }
    public function getKeywordToken() : int
    {
        return \T_MATCH;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Comment;

class Doc extends \Cvphar\PhpParser\Comment
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\PrettyPrinter;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\AssignOp;
use Cvphar\PhpParser\Node\Expr\BinaryOp;
use Cvphar\PhpParser\Node\Expr\Cast;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Scalar\MagicConst;
use Cvphar\PhpParser\Node\Stmt;
use Cvphar\PhpParser\PrettyPrinterAbstract;
class Standard extends PrettyPrinterAbstract
{
    protected function pParam(Node\Param $node)
    {
        return $this->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)
    {
        return ($node->name ? $node->name->toString() . ': ' : '') . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value);
    }
    protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node)
    {
        return '...';
    }
    protected function pConst(Node\Const_ $node)
    {
        return $node->name . ' = ' . $this->p($node->value);
    }
    protected function pNullableType(Node\NullableType $node)
    {
        return '?' . $this->p($node->type);
    }
    protected function pUnionType(Node\UnionType $node)
    {
        $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)
    {
        return $this->pImplode($node->types, '&');
    }
    protected function pIdentifier(Node\Identifier $node)
    {
        return $node->name;
    }
    protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node)
    {
        return '$' . $node->name;
    }
    protected function pAttribute(Node\Attribute $node)
    {
        return $this->p($node->name) . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : '');
    }
    protected function pAttributeGroup(Node\AttributeGroup $node)
    {
        return '#[' . $this->pCommaSeparated($node->attrs) . ']';
    }
    protected function pName(Name $node)
    {
        return \implode('\\', $node->parts);
    }
    protected function pName_FullyQualified(Name\FullyQualified $node)
    {
        return '\\' . \implode('\\', $node->parts);
    }
    protected function pName_Relative(Name\Relative $node)
    {
        return 'namespace\\' . \implode('\\', $node->parts);
    }
    protected function pScalar_MagicConst_Class(MagicConst\Class_ $node)
    {
        return '__CLASS__';
    }
    protected function pScalar_MagicConst_Dir(MagicConst\Dir $node)
    {
        return '__DIR__';
    }
    protected function pScalar_MagicConst_File(MagicConst\File $node)
    {
        return '__FILE__';
    }
    protected function pScalar_MagicConst_Function(MagicConst\Function_ $node)
    {
        return '__FUNCTION__';
    }
    protected function pScalar_MagicConst_Line(MagicConst\Line $node)
    {
        return '__LINE__';
    }
    protected function pScalar_MagicConst_Method(MagicConst\Method $node)
    {
        return '__METHOD__';
    }
    protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node)
    {
        return '__NAMESPACE__';
    }
    protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node)
    {
        return '__TRAIT__';
    }
    protected function pScalar_String(Scalar\String_ $node)
    {
        $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)) {
                    if ($node->value === '') {
                        return "<<<'{$label}'\n{$label}" . $this->docStringEndToken;
                    }
                    return "<<<'{$label}'\n{$node->value}\n{$label}" . $this->docStringEndToken;
                }
            case Scalar\String_::KIND_SINGLE_QUOTED:
                return $this->pSingleQuotedString($node->value);
            case Scalar\String_::KIND_HEREDOC:
                $label = $node->getAttribute('docLabel');
                if ($label && !$this->containsEndLabel($node->value, $label)) {
                    if ($node->value === '') {
                        return "<<<{$label}\n{$label}" . $this->docStringEndToken;
                    }
                    $escaped = $this->escapeString($node->value, null);
                    return "<<<{$label}\n" . $escaped . "\n{$label}" . $this->docStringEndToken;
                }
            case Scalar\String_::KIND_DOUBLE_QUOTED:
                return '"' . $this->escapeString($node->value, '"') . '"';
        }
        throw new \Exception('Invalid string kind');
    }
    protected function pScalar_Encapsed(Scalar\Encapsed $node)
    {
        if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) {
            $label = $node->getAttribute('docLabel');
            if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) {
                if (\count($node->parts) === 1 && $node->parts[0] instanceof Scalar\EncapsedStringPart && $node->parts[0]->value === '') {
                    return "<<<{$label}\n{$label}" . $this->docStringEndToken;
                }
                return "<<<{$label}\n" . $this->pEncapsList($node->parts, null) . "\n{$label}" . $this->docStringEndToken;
            }
        }
        return '"' . $this->pEncapsList($node->parts, '"') . '"';
    }
    protected function pScalar_LNumber(Scalar\LNumber $node)
    {
        if ($node->value === -\PHP_INT_MAX - 1) {
            return '(-' . \PHP_INT_MAX . '-1)';
        }
        $kind = $node->getAttribute('kind', Scalar\LNumber::KIND_DEC);
        if (Scalar\LNumber::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\LNumber::KIND_BIN:
                return $sign . '0b' . \base_convert($str, 10, 2);
            case Scalar\LNumber::KIND_OCT:
                return $sign . '0' . \base_convert($str, 10, 8);
            case Scalar\LNumber::KIND_HEX:
                return $sign . '0x' . \base_convert($str, 10, 16);
        }
        throw new \Exception('Invalid number kind');
    }
    protected function pScalar_DNumber(Scalar\DNumber $node)
    {
        if (!\is_finite($node->value)) {
            if ($node->value === \INF) {
                return '\\INF';
            } elseif ($node->value === -\INF) {
                return '-\\INF';
            } else {
                return '\\NAN';
            }
        }
        $stringValue = \sprintf('%.16G', $node->value);
        if ($node->value !== (double) $stringValue) {
            $stringValue = \sprintf('%.17G', $node->value);
        }
        $stringValue = \str_replace(',', '.', $stringValue);
        return \preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue;
    }
    protected function pScalar_EncapsedStringPart(Scalar\EncapsedStringPart $node)
    {
        throw new \LogicException('Cannot directly print EncapsedStringPart');
    }
    protected function pExpr_Assign(Expr\Assign $node)
    {
        return $this->pInfixOp(Expr\Assign::class, $node->var, ' = ', $node->expr);
    }
    protected function pExpr_AssignRef(Expr\AssignRef $node)
    {
        return $this->pInfixOp(Expr\AssignRef::class, $node->var, ' =& ', $node->expr);
    }
    protected function pExpr_AssignOp_Plus(AssignOp\Plus $node)
    {
        return $this->pInfixOp(AssignOp\Plus::class, $node->var, ' += ', $node->expr);
    }
    protected function pExpr_AssignOp_Minus(AssignOp\Minus $node)
    {
        return $this->pInfixOp(AssignOp\Minus::class, $node->var, ' -= ', $node->expr);
    }
    protected function pExpr_AssignOp_Mul(AssignOp\Mul $node)
    {
        return $this->pInfixOp(AssignOp\Mul::class, $node->var, ' *= ', $node->expr);
    }
    protected function pExpr_AssignOp_Div(AssignOp\Div $node)
    {
        return $this->pInfixOp(AssignOp\Div::class, $node->var, ' /= ', $node->expr);
    }
    protected function pExpr_AssignOp_Concat(AssignOp\Concat $node)
    {
        return $this->pInfixOp(AssignOp\Concat::class, $node->var, ' .= ', $node->expr);
    }
    protected function pExpr_AssignOp_Mod(AssignOp\Mod $node)
    {
        return $this->pInfixOp(AssignOp\Mod::class, $node->var, ' %= ', $node->expr);
    }
    protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node)
    {
        return $this->pInfixOp(AssignOp\BitwiseAnd::class, $node->var, ' &= ', $node->expr);
    }
    protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node)
    {
        return $this->pInfixOp(AssignOp\BitwiseOr::class, $node->var, ' |= ', $node->expr);
    }
    protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node)
    {
        return $this->pInfixOp(AssignOp\BitwiseXor::class, $node->var, ' ^= ', $node->expr);
    }
    protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node)
    {
        return $this->pInfixOp(AssignOp\ShiftLeft::class, $node->var, ' <<= ', $node->expr);
    }
    protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node)
    {
        return $this->pInfixOp(AssignOp\ShiftRight::class, $node->var, ' >>= ', $node->expr);
    }
    protected function pExpr_AssignOp_Pow(AssignOp\Pow $node)
    {
        return $this->pInfixOp(AssignOp\Pow::class, $node->var, ' **= ', $node->expr);
    }
    protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node)
    {
        return $this->pInfixOp(AssignOp\Coalesce::class, $node->var, ' ??= ', $node->expr);
    }
    protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node)
    {
        return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right);
    }
    protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node)
    {
        return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right);
    }
    protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node)
    {
        return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right);
    }
    protected function pExpr_BinaryOp_Div(BinaryOp\Div $node)
    {
        return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right);
    }
    protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node)
    {
        return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right);
    }
    protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node)
    {
        return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right);
    }
    protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node)
    {
        return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right);
    }
    protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node)
    {
        return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right);
    }
    protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node)
    {
        return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right);
    }
    protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node)
    {
        return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right);
    }
    protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node)
    {
        return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right);
    }
    protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node)
    {
        return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right);
    }
    protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node)
    {
        return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right);
    }
    protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node)
    {
        return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right);
    }
    protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node)
    {
        return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right);
    }
    protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node)
    {
        return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right);
    }
    protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node)
    {
        return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right);
    }
    protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node)
    {
        return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right);
    }
    protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node)
    {
        return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right);
    }
    protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node)
    {
        return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right);
    }
    protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node)
    {
        return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right);
    }
    protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node)
    {
        return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right);
    }
    protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node)
    {
        return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right);
    }
    protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node)
    {
        return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right);
    }
    protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node)
    {
        return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right);
    }
    protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node)
    {
        return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right);
    }
    protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node)
    {
        return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right);
    }
    protected function pExpr_Instanceof(Expr\Instanceof_ $node)
    {
        list($precedence, $associativity) = $this->precedenceMap[Expr\Instanceof_::class];
        return $this->pPrec($node->expr, $precedence, $associativity, -1) . ' instanceof ' . $this->pNewVariable($node->class);
    }
    protected function pExpr_BooleanNot(Expr\BooleanNot $node)
    {
        return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr);
    }
    protected function pExpr_BitwiseNot(Expr\BitwiseNot $node)
    {
        return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr);
    }
    protected function pExpr_UnaryMinus(Expr\UnaryMinus $node)
    {
        if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) {
            return '-(' . $this->p($node->expr) . ')';
        }
        return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr);
    }
    protected function pExpr_UnaryPlus(Expr\UnaryPlus $node)
    {
        if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) {
            return '+(' . $this->p($node->expr) . ')';
        }
        return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr);
    }
    protected function pExpr_PreInc(Expr\PreInc $node)
    {
        return $this->pPrefixOp(Expr\PreInc::class, '++', $node->var);
    }
    protected function pExpr_PreDec(Expr\PreDec $node)
    {
        return $this->pPrefixOp(Expr\PreDec::class, '--', $node->var);
    }
    protected function pExpr_PostInc(Expr\PostInc $node)
    {
        return $this->pPostfixOp(Expr\PostInc::class, $node->var, '++');
    }
    protected function pExpr_PostDec(Expr\PostDec $node)
    {
        return $this->pPostfixOp(Expr\PostDec::class, $node->var, '--');
    }
    protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node)
    {
        return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr);
    }
    protected function pExpr_YieldFrom(Expr\YieldFrom $node)
    {
        return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr);
    }
    protected function pExpr_Print(Expr\Print_ $node)
    {
        return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr);
    }
    protected function pExpr_Cast_Int(Cast\Int_ $node)
    {
        return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr);
    }
    protected function pExpr_Cast_Double(Cast\Double $node)
    {
        $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE);
        if ($kind === Cast\Double::KIND_DOUBLE) {
            $cast = '(double)';
        } elseif ($kind === Cast\Double::KIND_FLOAT) {
            $cast = '(float)';
        } elseif ($kind === Cast\Double::KIND_REAL) {
            $cast = '(real)';
        }
        return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr);
    }
    protected function pExpr_Cast_String(Cast\String_ $node)
    {
        return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr);
    }
    protected function pExpr_Cast_Array(Cast\Array_ $node)
    {
        return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr);
    }
    protected function pExpr_Cast_Object(Cast\Object_ $node)
    {
        return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr);
    }
    protected function pExpr_Cast_Bool(Cast\Bool_ $node)
    {
        return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr);
    }
    protected function pExpr_Cast_Unset(Cast\Unset_ $node)
    {
        return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr);
    }
    protected function pExpr_FuncCall(Expr\FuncCall $node)
    {
        return $this->pCallLhs($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
    }
    protected function pExpr_MethodCall(Expr\MethodCall $node)
    {
        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
    }
    protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node)
    {
        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
    }
    protected function pExpr_StaticCall(Expr\StaticCall $node)
    {
        return $this->pDereferenceLhs($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)
    {
        return 'empty(' . $this->p($node->expr) . ')';
    }
    protected function pExpr_Isset(Expr\Isset_ $node)
    {
        return 'isset(' . $this->pCommaSeparated($node->vars) . ')';
    }
    protected function pExpr_Eval(Expr\Eval_ $node)
    {
        return 'eval(' . $this->p($node->expr) . ')';
    }
    protected function pExpr_Include(Expr\Include_ $node)
    {
        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 $map[$node->type] . ' ' . $this->p($node->expr);
    }
    protected function pExpr_List(Expr\List_ $node)
    {
        return 'list(' . $this->pCommaSeparated($node->items) . ')';
    }
    protected function pExpr_Error(Expr\Error $node)
    {
        throw new \LogicException('Cannot pretty-print AST with Error nodes');
    }
    protected function pExpr_Variable(Expr\Variable $node)
    {
        if ($node->name instanceof Expr) {
            return '${' . $this->p($node->name) . '}';
        } else {
            return '$' . $node->name;
        }
    }
    protected function pExpr_Array(Expr\Array_ $node)
    {
        $syntax = $node->getAttribute('kind', $this->options['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 pExpr_ArrayItem(Expr\ArrayItem $node)
    {
        return (null !== $node->key ? $this->p($node->key) . ' => ' : '') . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value);
    }
    protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node)
    {
        return $this->pDereferenceLhs($node->var) . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']';
    }
    protected function pExpr_ConstFetch(Expr\ConstFetch $node)
    {
        return $this->p($node->name);
    }
    protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node)
    {
        return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name);
    }
    protected function pExpr_PropertyFetch(Expr\PropertyFetch $node)
    {
        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name);
    }
    protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node)
    {
        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name);
    }
    protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node)
    {
        return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name);
    }
    protected function pExpr_ShellExec(Expr\ShellExec $node)
    {
        return '`' . $this->pEncapsList($node->parts, '`') . '`';
    }
    protected function pExpr_Closure(Expr\Closure $node)
    {
        return $this->pAttrGroups($node->attrGroups, \true) . ($node->static ? 'static ' : '') . 'function ' . ($node->byRef ? '&' : '') . '(' . $this->pCommaSeparated($node->params) . ')' . (!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)
    {
        return 'match (' . $this->p($node->cond) . ') {' . $this->pCommaSeparatedMultiline($node->arms, \true) . $this->nl . '}';
    }
    protected function pMatchArm(Node\MatchArm $node)
    {
        return ($node->conds ? $this->pCommaSeparated($node->conds) : 'default') . ' => ' . $this->p($node->body);
    }
    protected function pExpr_ArrowFunction(Expr\ArrowFunction $node)
    {
        return $this->pAttrGroups($node->attrGroups, \true) . ($node->static ? 'static ' : '') . 'fn' . ($node->byRef ? '&' : '') . '(' . $this->pCommaSeparated($node->params) . ')' . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . ' => ' . $this->p($node->expr);
    }
    protected function pExpr_ClosureUse(Expr\ClosureUse $node)
    {
        return ($node->byRef ? '&' : '') . $this->p($node->var);
    }
    protected function pExpr_New(Expr\New_ $node)
    {
        if ($node->class instanceof Stmt\Class_) {
            $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : '';
            return 'new ' . $this->pClassCommon($node->class, $args);
        }
        return 'new ' . $this->pNewVariable($node->class) . '(' . $this->pMaybeMultiline($node->args) . ')';
    }
    protected function pExpr_Clone(Expr\Clone_ $node)
    {
        return 'clone ' . $this->p($node->expr);
    }
    protected function pExpr_Ternary(Expr\Ternary $node)
    {
        return $this->pInfixOp(Expr\Ternary::class, $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else);
    }
    protected function pExpr_Exit(Expr\Exit_ $node)
    {
        $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)
    {
        return 'throw ' . $this->p($node->expr);
    }
    protected function pExpr_Yield(Expr\Yield_ $node)
    {
        if ($node->value === null) {
            return 'yield';
        } else {
            return '(yield ' . ($node->key !== null ? $this->p($node->key) . ' => ' : '') . $this->p($node->value) . ')';
        }
    }
    protected function pStmt_Namespace(Stmt\Namespace_ $node)
    {
        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)
    {
        return 'use ' . $this->pUseType($node->type) . $this->pCommaSeparated($node->uses) . ';';
    }
    protected function pStmt_GroupUse(Stmt\GroupUse $node)
    {
        return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) . '\\{' . $this->pCommaSeparated($node->uses) . '};';
    }
    protected function pStmt_UseUse(Stmt\UseUse $node)
    {
        return $this->pUseType($node->type) . $this->p($node->name) . (null !== $node->alias ? ' as ' . $node->alias : '');
    }
    protected function pUseType($type)
    {
        return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : '');
    }
    protected function pStmt_Interface(Stmt\Interface_ $node)
    {
        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)
    {
        return $this->pAttrGroups($node->attrGroups) . 'enum ' . $node->name . ($node->scalarType ? " : {$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)
    {
        return $this->pClassCommon($node, ' ' . $node->name);
    }
    protected function pStmt_Trait(Stmt\Trait_ $node)
    {
        return $this->pAttrGroups($node->attrGroups) . 'trait ' . $node->name . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_EnumCase(Stmt\EnumCase $node)
    {
        return $this->pAttrGroups($node->attrGroups) . 'case ' . $node->name . ($node->expr ? ' = ' . $this->p($node->expr) : '') . ';';
    }
    protected function pStmt_TraitUse(Stmt\TraitUse $node)
    {
        return 'use ' . $this->pCommaSeparated($node->traits) . (empty($node->adaptations) ? ';' : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}');
    }
    protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node)
    {
        return $this->p($node->trait) . '::' . $node->method . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';';
    }
    protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node)
    {
        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)
    {
        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 pStmt_PropertyProperty(Stmt\PropertyProperty $node)
    {
        return '$' . $node->name . (null !== $node->default ? ' = ' . $this->p($node->default) : '');
    }
    protected function pStmt_ClassMethod(Stmt\ClassMethod $node)
    {
        return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) . 'function ' . ($node->byRef ? '&' : '') . $node->name . '(' . $this->pMaybeMultiline($node->params) . ')' . (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)
    {
        return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) . 'const ' . $this->pCommaSeparated($node->consts) . ';';
    }
    protected function pStmt_Function(Stmt\Function_ $node)
    {
        return $this->pAttrGroups($node->attrGroups) . 'function ' . ($node->byRef ? '&' : '') . $node->name . '(' . $this->pCommaSeparated($node->params) . ')' . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_Const(Stmt\Const_ $node)
    {
        return 'const ' . $this->pCommaSeparated($node->consts) . ';';
    }
    protected function pStmt_Declare(Stmt\Declare_ $node)
    {
        return 'declare (' . $this->pCommaSeparated($node->declares) . ')' . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';');
    }
    protected function pStmt_DeclareDeclare(Stmt\DeclareDeclare $node)
    {
        return $node->key . '=' . $this->p($node->value);
    }
    protected function pStmt_If(Stmt\If_ $node)
    {
        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)
    {
        return 'elseif (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_Else(Stmt\Else_ $node)
    {
        return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_For(Stmt\For_ $node)
    {
        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)
    {
        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)
    {
        return 'while (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_Do(Stmt\Do_ $node)
    {
        return 'do {' . $this->pStmts($node->stmts) . $this->nl . '} while (' . $this->p($node->cond) . ');';
    }
    protected function pStmt_Switch(Stmt\Switch_ $node)
    {
        return 'switch (' . $this->p($node->cond) . ') {' . $this->pStmts($node->cases) . $this->nl . '}';
    }
    protected function pStmt_Case(Stmt\Case_ $node)
    {
        return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' . $this->pStmts($node->stmts);
    }
    protected function pStmt_TryCatch(Stmt\TryCatch $node)
    {
        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)
    {
        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)
    {
        return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}';
    }
    protected function pStmt_Break(Stmt\Break_ $node)
    {
        return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';
    }
    protected function pStmt_Continue(Stmt\Continue_ $node)
    {
        return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';
    }
    protected function pStmt_Return(Stmt\Return_ $node)
    {
        return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';';
    }
    protected function pStmt_Throw(Stmt\Throw_ $node)
    {
        return 'throw ' . $this->p($node->expr) . ';';
    }
    protected function pStmt_Label(Stmt\Label $node)
    {
        return $node->name . ':';
    }
    protected function pStmt_Goto(Stmt\Goto_ $node)
    {
        return 'goto ' . $node->name . ';';
    }
    protected function pStmt_Expression(Stmt\Expression $node)
    {
        return $this->p($node->expr) . ';';
    }
    protected function pStmt_Echo(Stmt\Echo_ $node)
    {
        return 'echo ' . $this->pCommaSeparated($node->exprs) . ';';
    }
    protected function pStmt_Static(Stmt\Static_ $node)
    {
        return 'static ' . $this->pCommaSeparated($node->vars) . ';';
    }
    protected function pStmt_Global(Stmt\Global_ $node)
    {
        return 'global ' . $this->pCommaSeparated($node->vars) . ';';
    }
    protected function pStmt_StaticVar(Stmt\StaticVar $node)
    {
        return $this->p($node->var) . (null !== $node->default ? ' = ' . $this->p($node->default) : '');
    }
    protected function pStmt_Unset(Stmt\Unset_ $node)
    {
        return 'unset(' . $this->pCommaSeparated($node->vars) . ');';
    }
    protected function pStmt_InlineHTML(Stmt\InlineHTML $node)
    {
        $newline = $node->getAttribute('hasLeadingNewline', \true) ? "\n" : '';
        return '?>' . $newline . $node->value . '<?php ';
    }
    protected function pStmt_HaltCompiler(Stmt\HaltCompiler $node)
    {
        return '__halt_compiler();' . $node->remaining;
    }
    protected function pStmt_Nop(Stmt\Nop $node)
    {
        return '';
    }
    protected function pClassCommon(Stmt\Class_ $node, $afterClassToken)
    {
        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)
    {
        if ($node instanceof Expr) {
            return '{' . $this->p($node) . '}';
        } else {
            return $node;
        }
    }
    protected function pEncapsList(array $encapsList, $quote)
    {
        $return = '';
        foreach ($encapsList as $element) {
            if ($element instanceof Scalar\EncapsedStringPart) {
                $return .= $this->escapeString($element->value, $quote);
            } else {
                $return .= '{' . $this->p($element) . '}';
            }
        }
        return $return;
    }
    protected function pSingleQuotedString(string $string)
    {
        return '\'' . \addcslashes($string, '\'\\') . '\'';
    }
    protected function escapeString($string, $quote)
    {
        if (null === $quote) {
            $escaped = \addcslashes($string, "\t\f\v\$\\");
        } else {
            $escaped = \addcslashes($string, "\n\r\t\f\v\$" . $quote . "\\");
        }
        $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
            | (?<![\\xC2-\\xDF]|[\\xE0-\\xEF]|[\\xE0-\\xEF][\\x80-\\xBF]|[\\xF0-\\xF4]|[\\xF0-\\xF4][\\x80-\\xBF]|[\\xF0-\\xF4][\\x80-\\xBF]{2})[\\x80-\\xBF] # Overlong Sequence
            | (?<=[\\xE0-\\xEF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 3 byte sequence
            | (?<=[\\xF0-\\xF4])[\\x80-\\xBF](?![\\x80-\\xBF]{2}) # Short 4 byte sequence
            | (?<=[\\xF0-\\xF4][\\x80-\\xBF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 4 byte sequence (2)
        )/x';
        return \preg_replace_callback($regex, function ($matches) {
            \assert(\strlen($matches[0]) === 1);
            $hex = \dechex(\ord($matches[0]));
            return '\\x' . \str_pad($hex, 2, '0', \STR_PAD_LEFT);
        }, $escaped);
    }
    protected function containsEndLabel($string, $label, $atStart = \true, $atEnd = \true)
    {
        $start = $atStart ? '(?:^|[\\r\\n])' : '[\\r\\n]';
        $end = $atEnd ? '(?:$|[;\\r\\n])' : '[;\\r\\n]';
        return \false !== \strpos($string, $label) && \preg_match('/' . $start . $label . $end . '/', $string);
    }
    protected function encapsedContainsEndLabel(array $parts, $label)
    {
        foreach ($parts as $i => $part) {
            $atStart = $i === 0;
            $atEnd = $i === \count($parts) - 1;
            if ($part instanceof Scalar\EncapsedStringPart && $this->containsEndLabel($part->value, $label, $atStart, $atEnd)) {
                return \true;
            }
        }
        return \false;
    }
    protected function pDereferenceLhs(Node $node)
    {
        if (!$this->dereferenceLhsRequiresParens($node)) {
            return $this->p($node);
        } else {
            return '(' . $this->p($node) . ')';
        }
    }
    protected function pCallLhs(Node $node)
    {
        if (!$this->callLhsRequiresParens($node)) {
            return $this->p($node);
        } else {
            return '(' . $this->p($node) . ')';
        }
    }
    protected function pNewVariable(Node $node)
    {
        return $this->pDereferenceLhs($node);
    }
    protected function hasNodeWithComments(array $nodes)
    {
        foreach ($nodes as $node) {
            if ($node && $node->getComments()) {
                return \true;
            }
        }
        return \false;
    }
    protected function pMaybeMultiline(array $nodes, bool $trailingComma = \false)
    {
        if (!$this->hasNodeWithComments($nodes)) {
            return $this->pCommaSeparated($nodes);
        } else {
            return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;
        }
    }
    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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface Builder
{
    public function getNode() : Node;
}
<?php

namespace Cvphar\PhpParser;

use function array_merge;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Scalar;
class ConstExprEvaluator
{
    private $fallbackEvaluator;
    public function __construct(callable $fallbackEvaluator = null)
    {
        $this->fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) {
            throw new ConstExprEvaluationException("Expression of type {$expr->getType()} cannot be evaluated");
        };
    }
    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();
        }
    }
    public function evaluateDirectly(Expr $expr)
    {
        return $this->evaluate($expr);
    }
    private function evaluate(Expr $expr)
    {
        if ($expr instanceof Scalar\LNumber || $expr instanceof Scalar\DNumber || $expr instanceof Scalar\String_) {
            return $expr->value;
        }
        if ($expr instanceof Expr\Array_) {
            return $this->evaluateArray($expr);
        }
        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 = [];
        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;
    }
    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);
    }
    private function evaluateBinaryOp(Expr\BinaryOp $expr)
    {
        if ($expr instanceof Expr\BinaryOp\Coalesce && $expr->left instanceof Expr\ArrayDimFetch) {
            return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] ?? $this->evaluate($expr->right);
        }
        $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');
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Internal;

class DiffElem
{
    const TYPE_KEEP = 0;
    const TYPE_REMOVE = 1;
    const TYPE_ADD = 2;
    const TYPE_REPLACE = 3;
    public $type;
    public $old;
    public $new;
    public function __construct(int $type, $old, $new)
    {
        $this->type = $type;
        $this->old = $old;
        $this->new = $new;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Internal;

class Differ
{
    private $isEqual;
    public function __construct(callable $isEqual)
    {
        $this->isEqual = $isEqual;
    }
    public function diff(array $old, array $new)
    {
        list($trace, $x, $y) = $this->calculateTrace($old, $new);
        return $this->extractDiff($trace, $x, $y, $old, $new);
    }
    public function diffWithReplacements(array $old, array $new)
    {
        return $this->coalesceReplacements($this->diff($old, $new));
    }
    private function calculateTrace(array $a, array $b)
    {
        $n = \count($a);
        $m = \count($b);
        $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)($a[$x], $b[$y])) {
                    $x++;
                    $y++;
                }
                $v[$k] = $x;
                if ($x >= $n && $y >= $m) {
                    return [$trace, $x, $y];
                }
            }
        }
        throw new \Exception('Should not happen');
    }
    private function extractDiff(array $trace, int $x, int $y, array $a, array $b)
    {
        $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, $a[$x - 1], $b[$y - 1]);
                $x--;
                $y--;
            }
            if ($d === 0) {
                break;
            }
            while ($x > $prevX) {
                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x - 1], null);
                $x--;
            }
            while ($y > $prevY) {
                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y - 1]);
                $y--;
            }
        }
        return \array_reverse($result);
    }
    private function coalesceReplacements(array $diff)
    {
        $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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Internal;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
class PrintableNewAnonClassNode extends Expr
{
    public $attrGroups;
    public $args;
    public $extends;
    public $implements;
    public $stmts;
    public function __construct(array $attrGroups, array $args, Node\Name $extends = null, array $implements, array $stmts, array $attributes)
    {
        parent::__construct($attributes);
        $this->attrGroups = $attrGroups;
        $this->args = $args;
        $this->extends = $extends;
        $this->implements = $implements;
        $this->stmts = $stmts;
    }
    public static function fromNewNode(Expr\New_ $newNode)
    {
        $class = $newNode->class;
        \assert($class instanceof Node\Stmt\Class_);
        return new self($class->attrGroups, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes());
    }
    public function getType() : string
    {
        return 'Expr_PrintableNewAnonClass';
    }
    public function getSubNodeNames() : array
    {
        return ['attrGroups', 'args', 'extends', 'implements', 'stmts'];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Internal;

class TokenStream
{
    private $tokens;
    private $indentMap;
    public function __construct(array $tokens)
    {
        $this->tokens = $tokens;
        $this->indentMap = $this->calcIndentMap();
    }
    public function haveParens(int $startPos, int $endPos) : bool
    {
        return $this->haveTokenImmediatelyBefore($startPos, '(') && $this->haveTokenImmediatelyAfter($endPos, ')');
    }
    public function haveBraces(int $startPos, int $endPos) : bool
    {
        return ($this->haveTokenImmediatelyBefore($startPos, '{') || $this->haveTokenImmediatelyBefore($startPos, \T_CURLY_OPEN)) && $this->haveTokenImmediatelyAfter($endPos, '}');
    }
    public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool
    {
        $tokens = $this->tokens;
        $pos--;
        for (; $pos >= 0; $pos--) {
            $tokenType = $tokens[$pos][0];
            if ($tokenType === $expectedTokenType) {
                return \true;
            }
            if ($tokenType !== \T_WHITESPACE && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
                break;
            }
        }
        return \false;
    }
    public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool
    {
        $tokens = $this->tokens;
        $pos++;
        for (; $pos < \count($tokens); $pos++) {
            $tokenType = $tokens[$pos][0];
            if ($tokenType === $expectedTokenType) {
                return \true;
            }
            if ($tokenType !== \T_WHITESPACE && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
                break;
            }
        }
        return \false;
    }
    public function skipLeft(int $pos, $skipTokenType)
    {
        $tokens = $this->tokens;
        $pos = $this->skipLeftWhitespace($pos);
        if ($skipTokenType === \T_WHITESPACE) {
            return $pos;
        }
        if ($tokens[$pos][0] !== $skipTokenType) {
            throw new \Exception('Encountered unexpected token');
        }
        $pos--;
        return $this->skipLeftWhitespace($pos);
    }
    public function skipRight(int $pos, $skipTokenType)
    {
        $tokens = $this->tokens;
        $pos = $this->skipRightWhitespace($pos);
        if ($skipTokenType === \T_WHITESPACE) {
            return $pos;
        }
        if ($tokens[$pos][0] !== $skipTokenType) {
            throw new \Exception('Encountered unexpected token');
        }
        $pos++;
        return $this->skipRightWhitespace($pos);
    }
    public function skipLeftWhitespace(int $pos)
    {
        $tokens = $this->tokens;
        for (; $pos >= 0; $pos--) {
            $type = $tokens[$pos][0];
            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
                break;
            }
        }
        return $pos;
    }
    public function skipRightWhitespace(int $pos)
    {
        $tokens = $this->tokens;
        for ($count = \count($tokens); $pos < $count; $pos++) {
            $type = $tokens[$pos][0];
            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
                break;
            }
        }
        return $pos;
    }
    public function findRight(int $pos, $findTokenType)
    {
        $tokens = $this->tokens;
        for ($count = \count($tokens); $pos < $count; $pos++) {
            $type = $tokens[$pos][0];
            if ($type === $findTokenType) {
                return $pos;
            }
        }
        return -1;
    }
    public function haveTokenInRange(int $startPos, int $endPos, $tokenType)
    {
        $tokens = $this->tokens;
        for ($pos = $startPos; $pos < $endPos; $pos++) {
            if ($tokens[$pos][0] === $tokenType) {
                return \true;
            }
        }
        return \false;
    }
    public function haveBracesInRange(int $startPos, int $endPos)
    {
        return $this->haveTokenInRange($startPos, $endPos, '{') || $this->haveTokenInRange($startPos, $endPos, \T_CURLY_OPEN) || $this->haveTokenInRange($startPos, $endPos, '}');
    }
    public function haveTagInRange(int $startPos, int $endPos) : bool
    {
        return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG);
    }
    public function getIndentationBefore(int $pos) : int
    {
        return $this->indentMap[$pos];
    }
    public function getTokenCode(int $from, int $to, int $indent) : string
    {
        $tokens = $this->tokens;
        $result = '';
        for ($pos = $from; $pos < $to; $pos++) {
            $token = $tokens[$pos];
            if (\is_array($token)) {
                $type = $token[0];
                $content = $token[1];
                if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) {
                    $result .= $content;
                } else {
                    if ($indent < 0) {
                        $result .= \str_replace("\n" . \str_repeat(" ", -$indent), "\n", $content);
                    } elseif ($indent > 0) {
                        $result .= \str_replace("\n", "\n" . \str_repeat(" ", $indent), $content);
                    } else {
                        $result .= $content;
                    }
                }
            } else {
                $result .= $token;
            }
        }
        return $result;
    }
    private function calcIndentMap()
    {
        $indentMap = [];
        $indent = 0;
        foreach ($this->tokens as $token) {
            $indentMap[] = $indent;
            if ($token[0] === \T_WHITESPACE) {
                $content = $token[1];
                $newlinePos = \strrpos($content, "\n");
                if (\false !== $newlinePos) {
                    $indent = \strlen($content) - $newlinePos - 1;
                }
            }
        }
        $indentMap[] = $indent;
        return $indentMap;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Node\Expr\Include_;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\GroupUse;
use Cvphar\PhpParser\Node\Stmt\Use_;
use Cvphar\PhpParser\Node\Stmt\UseUse;
class NodeDumper
{
    private $dumpComments;
    private $dumpPositions;
    private $code;
    public function __construct(array $options = [])
    {
        $this->dumpComments = !empty($options['dumpComments']);
        $this->dumpPositions = !empty($options['dumpPositions']);
    }
    public function dump($node, string $code = null) : string
    {
        $this->code = $code;
        return $this->dumpRecursive($node);
    }
    protected function dumpRecursive($node)
    {
        if ($node instanceof Node) {
            $r = $node->getType();
            if ($this->dumpPositions && null !== ($p = $this->dumpPosition($node))) {
                $r .= $p;
            }
            $r .= '(';
            foreach ($node->getSubNodeNames() as $key) {
                $r .= "\n    " . $key . ': ';
                $value = $node->{$key};
                if (null === $value) {
                    $r .= 'null';
                } elseif (\false === $value) {
                    $r .= 'false';
                } elseif (\true === $value) {
                    $r .= 'true';
                } elseif (\is_scalar($value)) {
                    if ('flags' === $key || 'newModifier' === $key) {
                        $r .= $this->dumpFlags($value);
                    } elseif ('type' === $key && $node instanceof Include_) {
                        $r .= $this->dumpIncludeType($value);
                    } elseif ('type' === $key && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) {
                        $r .= $this->dumpUseType($value);
                    } else {
                        $r .= $value;
                    }
                } else {
                    $r .= \str_replace("\n", "\n    ", $this->dumpRecursive($value));
                }
            }
            if ($this->dumpComments && ($comments = $node->getComments())) {
                $r .= "\n    comments: " . \str_replace("\n", "\n    ", $this->dumpRecursive($comments));
            }
        } elseif (\is_array($node)) {
            $r = 'array(';
            foreach ($node as $key => $value) {
                $r .= "\n    " . $key . ': ';
                if (null === $value) {
                    $r .= 'null';
                } elseif (\false === $value) {
                    $r .= 'false';
                } elseif (\true === $value) {
                    $r .= 'true';
                } elseif (\is_scalar($value)) {
                    $r .= $value;
                } else {
                    $r .= \str_replace("\n", "\n    ", $this->dumpRecursive($value));
                }
            }
        } elseif ($node instanceof Comment) {
            return $node->getReformattedText();
        } else {
            throw new \InvalidArgumentException('Can only dump nodes and arrays.');
        }
        return $r . "\n)";
    }
    protected function dumpFlags($flags)
    {
        $strs = [];
        if ($flags & Class_::MODIFIER_PUBLIC) {
            $strs[] = 'MODIFIER_PUBLIC';
        }
        if ($flags & Class_::MODIFIER_PROTECTED) {
            $strs[] = 'MODIFIER_PROTECTED';
        }
        if ($flags & Class_::MODIFIER_PRIVATE) {
            $strs[] = 'MODIFIER_PRIVATE';
        }
        if ($flags & Class_::MODIFIER_ABSTRACT) {
            $strs[] = 'MODIFIER_ABSTRACT';
        }
        if ($flags & Class_::MODIFIER_STATIC) {
            $strs[] = 'MODIFIER_STATIC';
        }
        if ($flags & Class_::MODIFIER_FINAL) {
            $strs[] = 'MODIFIER_FINAL';
        }
        if ($flags & Class_::MODIFIER_READONLY) {
            $strs[] = 'MODIFIER_READONLY';
        }
        if ($strs) {
            return \implode(' | ', $strs) . ' (' . $flags . ')';
        } else {
            return $flags;
        }
    }
    protected function dumpIncludeType($type)
    {
        $map = [Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE'];
        if (!isset($map[$type])) {
            return $type;
        }
        return $map[$type] . ' (' . $type . ')';
    }
    protected function dumpUseType($type)
    {
        $map = [Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', Use_::TYPE_NORMAL => 'TYPE_NORMAL', Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', Use_::TYPE_CONSTANT => 'TYPE_CONSTANT'];
        if (!isset($map[$type])) {
            return $type;
        }
        return $map[$type] . ' (' . $type . ')';
    }
    protected function dumpPosition(Node $node)
    {
        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}]";
    }
    private function toColumn($code, $pos)
    {
        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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\Cast\Double;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Param;
use Cvphar\PhpParser\Node\Scalar\Encapsed;
use Cvphar\PhpParser\Node\Scalar\LNumber;
use Cvphar\PhpParser\Node\Scalar\String_;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\ClassConst;
use Cvphar\PhpParser\Node\Stmt\ClassMethod;
use Cvphar\PhpParser\Node\Stmt\Else_;
use Cvphar\PhpParser\Node\Stmt\ElseIf_;
use Cvphar\PhpParser\Node\Stmt\Enum_;
use Cvphar\PhpParser\Node\Stmt\Interface_;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
use Cvphar\PhpParser\Node\Stmt\Nop;
use Cvphar\PhpParser\Node\Stmt\Property;
use Cvphar\PhpParser\Node\Stmt\TryCatch;
use Cvphar\PhpParser\Node\Stmt\UseUse;
use Cvphar\PhpParser\Node\VarLikeIdentifier;
abstract class ParserAbstract implements Parser
{
    const SYMBOL_NONE = -1;
    protected $tokenToSymbolMapSize;
    protected $actionTableSize;
    protected $gotoTableSize;
    protected $invalidSymbol;
    protected $errorSymbol;
    protected $defaultAction;
    protected $unexpectedTokenRule;
    protected $YY2TBLSTATE;
    protected $numNonLeafStates;
    protected $tokenToSymbol;
    protected $symbolToName;
    protected $productions;
    protected $actionBase;
    protected $action;
    protected $actionCheck;
    protected $actionDefault;
    protected $reduceCallbacks;
    protected $gotoBase;
    protected $goto;
    protected $gotoCheck;
    protected $gotoDefault;
    protected $ruleToNonTerminal;
    protected $ruleToLength;
    protected $lexer;
    protected $semValue;
    protected $semStack;
    protected $startAttributeStack;
    protected $endAttributeStack;
    protected $endAttributes;
    protected $lookaheadStartAttributes;
    protected $errorHandler;
    protected $errorState;
    protected abstract function initReduceCallbacks();
    public function __construct(Lexer $lexer, array $options = [])
    {
        $this->lexer = $lexer;
        if (isset($options['throwOnError'])) {
            throw new \LogicException('"throwOnError" is no longer supported, use "errorHandler" instead');
        }
        $this->initReduceCallbacks();
    }
    public function parse(string $code, ErrorHandler $errorHandler = null)
    {
        $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing();
        $this->lexer->startLexing($code, $this->errorHandler);
        $result = $this->doParse();
        $this->startAttributeStack = [];
        $this->endAttributeStack = [];
        $this->semStack = [];
        $this->semValue = null;
        return $result;
    }
    protected function doParse()
    {
        $symbol = self::SYMBOL_NONE;
        $startAttributes = [];
        $endAttributes = [];
        $this->endAttributes = $endAttributes;
        $this->startAttributeStack = [];
        $this->endAttributeStack = [$endAttributes];
        $state = 0;
        $stateStack = [$state];
        $this->semStack = [];
        $stackPos = 0;
        $this->errorState = 0;
        for (;;) {
            if ($this->actionBase[$state] === 0) {
                $rule = $this->actionDefault[$state];
            } else {
                if ($symbol === self::SYMBOL_NONE) {
                    $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes);
                    $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize ? $this->tokenToSymbol[$tokenId] : $this->invalidSymbol;
                    if ($symbol === $this->invalidSymbol) {
                        throw new \RangeException(\sprintf('The lexer returned an invalid token (id=%d, value=%s)', $tokenId, $tokenValue));
                    }
                    $this->lookaheadStartAttributes = $startAttributes;
                }
                $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) {
                    if ($action > 0) {
                        ++$stackPos;
                        $stateStack[$stackPos] = $state = $action;
                        $this->semStack[$stackPos] = $tokenValue;
                        $this->startAttributeStack[$stackPos] = $startAttributes;
                        $this->endAttributeStack[$stackPos] = $endAttributes;
                        $this->endAttributes = $endAttributes;
                        $symbol = self::SYMBOL_NONE;
                        if ($this->errorState) {
                            --$this->errorState;
                        }
                        if ($action < $this->numNonLeafStates) {
                            continue;
                        }
                        $rule = $action - $this->numNonLeafStates;
                    } else {
                        $rule = -$action;
                    }
                } else {
                    $rule = $this->actionDefault[$state];
                }
            }
            for (;;) {
                if ($rule === 0) {
                    return $this->semValue;
                } elseif ($rule !== $this->unexpectedTokenRule) {
                    try {
                        $this->reduceCallbacks[$rule]($stackPos);
                    } catch (Error $e) {
                        if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) {
                            $e->setStartLine($startAttributes['startLine']);
                        }
                        $this->emitError($e);
                        return null;
                    }
                    $lastEndAttributes = $this->endAttributeStack[$stackPos];
                    $ruleLength = $this->ruleToLength[$rule];
                    $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->endAttributeStack[$stackPos] = $lastEndAttributes;
                    if ($ruleLength === 0) {
                        $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
                    }
                } else {
                    switch ($this->errorState) {
                        case 0:
                            $msg = $this->getErrorMessage($symbol, $state);
                            $this->emitError(new Error($msg, $startAttributes + $endAttributes));
                        case 1:
                        case 2:
                            $this->errorState = 3;
                            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) {
                                if ($stackPos <= 0) {
                                    return null;
                                }
                                $state = $stateStack[--$stackPos];
                            }
                            ++$stackPos;
                            $stateStack[$stackPos] = $state = $action;
                            $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
                            $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1];
                            $this->endAttributes = $this->endAttributeStack[$stackPos - 1];
                            break;
                        case 3:
                            if ($symbol === 0) {
                                return null;
                            }
                            $symbol = self::SYMBOL_NONE;
                            break 2;
                    }
                }
                if ($state < $this->numNonLeafStates) {
                    break;
                }
                $rule = $state - $this->numNonLeafStates;
            }
        }
        throw new \RuntimeException('Reached end of parser loop');
    }
    protected function emitError(Error $error)
    {
        $this->errorHandler->handleError($error);
    }
    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;
    }
    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) {
                        return [];
                    }
                    $expected[] = $name;
                }
            }
        }
        return $expected;
    }
    protected function handleNamespaces(array $stmts) : array
    {
        $hasErrored = \false;
        $style = $this->getNamespacingStyle($stmts);
        if (null === $style) {
            return $stmts;
        } elseif ('brace' === $style) {
            $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;
                }
            }
            return $stmts;
        } else {
            $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 {
                        $resultStmts[] = $stmt;
                        $targetStmts =& $resultStmts;
                    }
                    $lastNs = $stmt;
                } elseif ($stmt instanceof Node\Stmt\HaltCompiler) {
                    $resultStmts[] = $stmt;
                } else {
                    $targetStmts[] = $stmt;
                }
            }
            if ($lastNs !== null) {
                $this->fixupNamespaceAttributes($lastNs);
            }
            return $resultStmts;
        }
    }
    private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt)
    {
        if (empty($stmt->stmts)) {
            return;
        }
        $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));
            }
        }
    }
    private function getNamespacingStyle(array $stmts)
    {
        $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', $stmt->getLine()));
                    }
                } elseif ($style !== $currentStyle) {
                    $this->emitError(new Error('Cannot mix bracketed namespace declarations with unbracketed namespace declarations', $stmt->getLine()));
                    return 'semicolon';
                }
                continue;
            }
            if ($stmt instanceof Node\Stmt\Declare_ || $stmt instanceof Node\Stmt\HaltCompiler || $stmt instanceof Node\Stmt\Nop) {
                continue;
            }
            if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && \preg_match('/\\A#!.*\\r?\\n\\z/', $stmt->value)) {
                continue;
            }
            $hasNotAllowedStmts = \true;
        }
        return $style;
    }
    protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall
    {
        if ($prop instanceof Node\Expr\StaticPropertyFetch) {
            $name = $prop->name instanceof VarLikeIdentifier ? $prop->name->toString() : $prop->name;
            $var = new Expr\Variable($name, $prop->name->getAttributes());
            return new Expr\StaticCall($prop->class, $var, $args, $attributes);
        } elseif ($prop instanceof Node\Expr\ArrayDimFetch) {
            $tmp = $prop;
            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
                $tmp = $tmp->var;
            }
            $staticProp = $tmp->var;
            $tmp = $prop;
            $this->fixupStartAttributes($tmp, $staticProp->name);
            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
                $tmp = $tmp->var;
                $this->fixupStartAttributes($tmp, $staticProp->name);
            }
            $name = $staticProp->name instanceof VarLikeIdentifier ? $staticProp->name->toString() : $staticProp->name;
            $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes());
            return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes);
        } else {
            throw new \Exception();
        }
    }
    protected function fixupStartAttributes(Node $to, Node $from)
    {
        $startAttributes = ['startLine', 'startFilePos', 'startTokenPos'];
        foreach ($startAttributes as $startAttribute) {
            if ($from->hasAttribute($startAttribute)) {
                $to->setAttribute($startAttribute, $from->getAttribute($startAttribute));
            }
        }
    }
    protected function handleBuiltinTypes(Name $name)
    {
        $builtinTypes = ['bool' => \true, 'int' => \true, 'float' => \true, 'string' => \true, 'iterable' => \true, 'void' => \true, 'object' => \true, 'null' => \true, 'false' => \true, 'mixed' => \true, 'never' => \true, 'true' => \true];
        if (!$name->isUnqualified()) {
            return $name;
        }
        $lowerName = $name->toLowerString();
        if (!isset($builtinTypes[$lowerName])) {
            return $name;
        }
        return new Node\Identifier($lowerName, $name->getAttributes());
    }
    protected function getAttributesAt(int $pos) : array
    {
        return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos];
    }
    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;
    }
    protected function parseLNumber($str, $attributes, $allowInvalidOctal = \false)
    {
        try {
            return LNumber::fromString($str, $attributes, $allowInvalidOctal);
        } catch (Error $error) {
            $this->emitError($error);
            return new LNumber(0, $attributes);
        }
    }
    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 LNumber($num, $attributes);
    }
    protected function stripIndentation(string $string, int $indentLen, string $indentChar, bool $newlineAtStart, bool $newlineAtEnd, array $attributes)
    {
        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);
    }
    protected function parseDocString(string $startToken, $contents, string $endToken, array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape)
    {
        $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));
            $indentation = '';
        }
        $indentLen = \strlen($indentation);
        $indentChar = $indentHasSpaces ? " " : "\t";
        if (\is_string($contents)) {
            if ($contents === '') {
                return new String_('', $attributes);
            }
            $contents = $this->stripIndentation($contents, $indentLen, $indentChar, \true, \true, $attributes);
            $contents = \preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $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\Scalar\EncapsedStringPart) {
                $this->stripIndentation('', $indentLen, $indentChar, \true, \false, $contents[0]->getAttributes());
            }
            $newContents = [];
            foreach ($contents as $i => $part) {
                if ($part instanceof Node\Scalar\EncapsedStringPart) {
                    $isLast = $i === \count($contents) - 1;
                    $part->value = $this->stripIndentation($part->value, $indentLen, $indentChar, $i === 0, $isLast, $part->getAttributes());
                    $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape);
                    if ($isLast) {
                        $part->value = \preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $part->value);
                    }
                    if ('' === $part->value) {
                        continue;
                    }
                }
                $newContents[] = $part;
            }
            return new Encapsed($newContents, $attributes);
        }
    }
    protected function createCommentNopAttributes(array $comments)
    {
        $comment = $comments[\count($comments) - 1];
        $commentEndLine = $comment->getEndLine();
        $commentEndFilePos = $comment->getEndFilePos();
        $commentEndTokenPos = $comment->getEndTokenPos();
        $attributes = ['comments' => $comments];
        if (-1 !== $commentEndLine) {
            $attributes['startLine'] = $commentEndLine;
            $attributes['endLine'] = $commentEndLine;
        }
        if (-1 !== $commentEndFilePos) {
            $attributes['startFilePos'] = $commentEndFilePos + 1;
            $attributes['endFilePos'] = $commentEndFilePos;
        }
        if (-1 !== $commentEndTokenPos) {
            $attributes['startTokenPos'] = $commentEndTokenPos + 1;
            $attributes['endTokenPos'] = $commentEndTokenPos;
        }
        return $attributes;
    }
    protected function fixupAlternativeElse($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($a, $b, $modifierPos)
    {
        try {
            Class_::verifyClassModifier($a, $b);
        } catch (Error $error) {
            $error->setAttributes($this->getAttributesAt($modifierPos));
            $this->emitError($error);
        }
    }
    protected function checkModifier($a, $b, $modifierPos)
    {
        try {
            Class_::verifyModifier($a, $b);
        } catch (Error $error) {
            $error->setAttributes($this->getAttributesAt($modifierPos));
            $this->emitError($error);
        }
    }
    protected function checkParam(Param $node)
    {
        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)
    {
        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)
    {
        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($name, $namePos)
    {
        if (null !== $name && $name->isSpecialClassName()) {
            $this->emitError(new Error(\sprintf('Cannot use \'%s\' as class name as it is reserved', $name), $this->getAttributesAt($namePos)));
        }
    }
    private function checkImplementedInterfaces(array $interfaces)
    {
        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, $namePos)
    {
        $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, $namePos)
    {
        $this->checkClassName($node->name, $namePos);
        $this->checkImplementedInterfaces($node->extends);
    }
    protected function checkEnum(Enum_ $node, $namePos)
    {
        $this->checkClassName($node->name, $namePos);
        $this->checkImplementedInterfaces($node->implements);
    }
    protected function checkClassMethod(ClassMethod $node, $modifierPos)
    {
        if ($node->flags & Class_::MODIFIER_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 & Class_::MODIFIER_READONLY) {
            $this->emitError(new Error(\sprintf('Method %s() cannot be readonly', $node->name), $this->getAttributesAt($modifierPos)));
        }
    }
    protected function checkClassConst(ClassConst $node, $modifierPos)
    {
        if ($node->flags & Class_::MODIFIER_STATIC) {
            $this->emitError(new Error("Cannot use 'static' as constant modifier", $this->getAttributesAt($modifierPos)));
        }
        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
            $this->emitError(new Error("Cannot use 'abstract' as constant modifier", $this->getAttributesAt($modifierPos)));
        }
        if ($node->flags & Class_::MODIFIER_READONLY) {
            $this->emitError(new Error("Cannot use 'readonly' as constant modifier", $this->getAttributesAt($modifierPos)));
        }
    }
    protected function checkProperty(Property $node, $modifierPos)
    {
        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
            $this->emitError(new Error('Properties cannot be declared abstract', $this->getAttributesAt($modifierPos)));
        }
        if ($node->flags & Class_::MODIFIER_FINAL) {
            $this->emitError(new Error('Properties cannot be declared final', $this->getAttributesAt($modifierPos)));
        }
    }
    protected function checkUseUse(UseUse $node, $namePos)
    {
        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)));
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class ParserFactory
{
    const PREFER_PHP7 = 1;
    const PREFER_PHP5 = 2;
    const ONLY_PHP7 = 3;
    const ONLY_PHP5 = 4;
    public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser
    {
        if (null === $lexer) {
            $lexer = new Lexer\Emulative();
        }
        switch ($kind) {
            case self::PREFER_PHP7:
                return new Parser\Multiple([new Parser\Php7($lexer, $parserOptions), new Parser\Php5($lexer, $parserOptions)]);
            case self::PREFER_PHP5:
                return new Parser\Multiple([new Parser\Php5($lexer, $parserOptions), new Parser\Php7($lexer, $parserOptions)]);
            case self::ONLY_PHP7:
                return new Parser\Php7($lexer, $parserOptions);
            case self::ONLY_PHP5:
                return new Parser\Php5($lexer, $parserOptions);
            default:
                throw new \LogicException('Kind must be one of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5');
        }
    }
}
<?php

namespace Cvphar\PhpParser\Parser;

final class Tokens
{
    const YYERRTOK = 256;
    const T_THROW = 257;
    const T_INCLUDE = 258;
    const T_INCLUDE_ONCE = 259;
    const T_EVAL = 260;
    const T_REQUIRE = 261;
    const T_REQUIRE_ONCE = 262;
    const T_LOGICAL_OR = 263;
    const T_LOGICAL_XOR = 264;
    const T_LOGICAL_AND = 265;
    const T_PRINT = 266;
    const T_YIELD = 267;
    const T_DOUBLE_ARROW = 268;
    const T_YIELD_FROM = 269;
    const T_PLUS_EQUAL = 270;
    const T_MINUS_EQUAL = 271;
    const T_MUL_EQUAL = 272;
    const T_DIV_EQUAL = 273;
    const T_CONCAT_EQUAL = 274;
    const T_MOD_EQUAL = 275;
    const T_AND_EQUAL = 276;
    const T_OR_EQUAL = 277;
    const T_XOR_EQUAL = 278;
    const T_SL_EQUAL = 279;
    const T_SR_EQUAL = 280;
    const T_POW_EQUAL = 281;
    const T_COALESCE_EQUAL = 282;
    const T_COALESCE = 283;
    const T_BOOLEAN_OR = 284;
    const T_BOOLEAN_AND = 285;
    const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 286;
    const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 287;
    const T_IS_EQUAL = 288;
    const T_IS_NOT_EQUAL = 289;
    const T_IS_IDENTICAL = 290;
    const T_IS_NOT_IDENTICAL = 291;
    const T_SPACESHIP = 292;
    const T_IS_SMALLER_OR_EQUAL = 293;
    const T_IS_GREATER_OR_EQUAL = 294;
    const T_SL = 295;
    const T_SR = 296;
    const T_INSTANCEOF = 297;
    const T_INC = 298;
    const T_DEC = 299;
    const T_INT_CAST = 300;
    const T_DOUBLE_CAST = 301;
    const T_STRING_CAST = 302;
    const T_ARRAY_CAST = 303;
    const T_OBJECT_CAST = 304;
    const T_BOOL_CAST = 305;
    const T_UNSET_CAST = 306;
    const T_POW = 307;
    const T_NEW = 308;
    const T_CLONE = 309;
    const T_EXIT = 310;
    const T_IF = 311;
    const T_ELSEIF = 312;
    const T_ELSE = 313;
    const T_ENDIF = 314;
    const T_LNUMBER = 315;
    const T_DNUMBER = 316;
    const T_STRING = 317;
    const T_STRING_VARNAME = 318;
    const T_VARIABLE = 319;
    const T_NUM_STRING = 320;
    const T_INLINE_HTML = 321;
    const T_ENCAPSED_AND_WHITESPACE = 322;
    const T_CONSTANT_ENCAPSED_STRING = 323;
    const T_ECHO = 324;
    const T_DO = 325;
    const T_WHILE = 326;
    const T_ENDWHILE = 327;
    const T_FOR = 328;
    const T_ENDFOR = 329;
    const T_FOREACH = 330;
    const T_ENDFOREACH = 331;
    const T_DECLARE = 332;
    const T_ENDDECLARE = 333;
    const T_AS = 334;
    const T_SWITCH = 335;
    const T_MATCH = 336;
    const T_ENDSWITCH = 337;
    const T_CASE = 338;
    const T_DEFAULT = 339;
    const T_BREAK = 340;
    const T_CONTINUE = 341;
    const T_GOTO = 342;
    const T_FUNCTION = 343;
    const T_FN = 344;
    const T_CONST = 345;
    const T_RETURN = 346;
    const T_TRY = 347;
    const T_CATCH = 348;
    const T_FINALLY = 349;
    const T_USE = 350;
    const T_INSTEADOF = 351;
    const T_GLOBAL = 352;
    const T_STATIC = 353;
    const T_ABSTRACT = 354;
    const T_FINAL = 355;
    const T_PRIVATE = 356;
    const T_PROTECTED = 357;
    const T_PUBLIC = 358;
    const T_READONLY = 359;
    const T_VAR = 360;
    const T_UNSET = 361;
    const T_ISSET = 362;
    const T_EMPTY = 363;
    const T_HALT_COMPILER = 364;
    const T_CLASS = 365;
    const T_TRAIT = 366;
    const T_INTERFACE = 367;
    const T_ENUM = 368;
    const T_EXTENDS = 369;
    const T_IMPLEMENTS = 370;
    const T_OBJECT_OPERATOR = 371;
    const T_NULLSAFE_OBJECT_OPERATOR = 372;
    const T_LIST = 373;
    const T_ARRAY = 374;
    const T_CALLABLE = 375;
    const T_CLASS_C = 376;
    const T_TRAIT_C = 377;
    const T_METHOD_C = 378;
    const T_FUNC_C = 379;
    const T_LINE = 380;
    const T_FILE = 381;
    const T_START_HEREDOC = 382;
    const T_END_HEREDOC = 383;
    const T_DOLLAR_OPEN_CURLY_BRACES = 384;
    const T_CURLY_OPEN = 385;
    const T_PAAMAYIM_NEKUDOTAYIM = 386;
    const T_NAMESPACE = 387;
    const T_NS_C = 388;
    const T_DIR = 389;
    const T_NS_SEPARATOR = 390;
    const T_ELLIPSIS = 391;
    const T_NAME_FULLY_QUALIFIED = 392;
    const T_NAME_QUALIFIED = 393;
    const T_NAME_RELATIVE = 394;
    const T_ATTRIBUTE = 395;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Parser;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\ErrorHandler;
use Cvphar\PhpParser\Parser;
class Multiple implements Parser
{
    private $parsers;
    public function __construct(array $parsers)
    {
        $this->parsers = $parsers;
    }
    public function parse(string $code, ErrorHandler $errorHandler = null)
    {
        if (null === $errorHandler) {
            $errorHandler = new ErrorHandler\Throwing();
        }
        list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code);
        if ($firstError === null) {
            return $firstStmts;
        }
        for ($i = 1, $c = \count($this->parsers); $i < $c; ++$i) {
            list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code);
            if ($error === null) {
                return $stmts;
            }
        }
        throw $firstError;
    }
    private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code)
    {
        $stmts = null;
        $error = null;
        try {
            $stmts = $parser->parse($code, $errorHandler);
        } catch (Error $error) {
        }
        return [$stmts, $error];
    }
}
<?php

namespace Cvphar\PhpParser\Parser;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Stmt;
class Php7 extends \Cvphar\PhpParser\ParserAbstract
{
    protected $tokenToSymbolMapSize = 396;
    protected $actionTableSize = 1223;
    protected $gotoTableSize = 626;
    protected $invalidSymbol = 168;
    protected $errorSymbol = 1;
    protected $defaultAction = -32766;
    protected $unexpectedTokenRule = 32767;
    protected $YY2TBLSTATE = 429;
    protected $numNonLeafStates = 726;
    protected $symbolToName = array("EOF", "error", "T_THROW", "T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE", "','", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_YIELD", "T_DOUBLE_ARROW", "T_YIELD_FROM", "'='", "T_PLUS_EQUAL", "T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL", "T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL", "T_POW_EQUAL", "T_COALESCE_EQUAL", "'?'", "':'", "T_COALESCE", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "'|'", "'^'", "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_SPACESHIP", "'<'", "T_IS_SMALLER_OR_EQUAL", "'>'", "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 $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, 163, 164, 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, 161, 35, 162, 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 $action = array(132, 133, 134, 575, 135, 136, 0, 738, 739, 740, 137, 37, 850, 825, 851, 476, -32766, -32766, -32766, -32767, -32767, -32767, -32767, 101, 102, 103, 104, 105, 1097, 1098, 1099, 1096, 1095, 1094, 1100, 732, 731, -32766, 1289, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, -32767, 1022, 377, 376, 2, 741, -32766, -32766, -32766, -32766, -32766, 822, 417, -32766, -32766, -32766, -32766, -32766, -32766, 267, 138, 399, 745, 746, 747, 748, 287, -32766, 423, -32766, -32766, -32766, -32766, -32766, -32766, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 779, 576, 780, 781, 782, 783, 771, 772, 340, 341, 774, 775, 760, 761, 762, 764, 765, 766, 351, 806, 807, 808, 809, 810, 577, 767, 768, 578, 579, 800, 791, 789, 790, 803, 786, 787, -327, 423, 580, 581, 785, 582, 583, 584, 585, 586, 587, 605, -590, 477, -86, 814, 788, 588, 589, -590, 139, -32766, -32766, -32766, 132, 133, 134, 575, 135, 136, 1046, 738, 739, 740, 137, 37, 323, 1013, 823, 824, 1334, 1324, -32766, 1335, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 1097, 1098, 1099, 1096, 1095, 1094, 1100, -587, 732, 731, -32766, -32766, -32766, 12, -587, 81, -32766, -32766, -32766, 945, 946, 322, 927, 34, 947, 1224, 1223, 1225, 741, -86, 942, -32766, 1075, -32766, -32766, -32766, -32766, -32766, 239, -32766, -32766, -32766, 267, 138, 399, 745, 746, 747, 748, 461, 462, 423, 35, 247, 103, 104, 105, 128, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 779, 576, 780, 781, 782, 783, 771, 772, 340, 341, 774, 775, 760, 761, 762, 764, 765, 766, 351, 806, 807, 808, 809, 810, 577, 767, 768, 578, 579, 800, 791, 789, 790, 803, 786, 787, -327, 144, 580, 581, 785, 582, 583, 584, 585, 586, 587, 1222, 82, 83, 84, -590, 788, 588, 589, -590, 148, 763, 733, 734, 735, 736, 737, 1309, 738, 739, 740, 776, 777, 36, 1308, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 288, 271, -587, -193, 375, 376, -587, 976, -32766, 1021, 453, 454, 455, 109, 417, 945, 946, 741, 712, 819, 947, -32766, -32766, -32766, -271, 1073, 941, 1224, 1223, 1225, 288, 742, 743, 744, 745, 746, 747, 748, -192, -365, 812, -365, -32766, 599, -32766, -32766, 549, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 779, 802, 780, 781, 782, 783, 771, 772, 773, 801, 774, 775, 760, 761, 762, 764, 765, 766, 805, 806, 807, 808, 809, 810, 811, 767, 768, 769, 770, 800, 791, 789, 790, 803, 786, 787, 251, 820, 778, 784, 785, 792, 793, 795, 794, 796, 797, 732, 731, 1261, 1022, 1019, 788, 799, 798, 49, 50, 51, 507, 52, 53, 1009, 1008, 1007, 1010, 54, 55, -111, 56, 816, 1045, 14, -111, 1022, -111, 287, 1305, 977, 306, 302, 1022, 238, -111, -111, -111, -111, -111, -111, -111, -111, 106, 107, 108, 1089, 271, -32766, -32766, -32766, 280, 284, 126, -193, 929, 57, 58, 287, 109, 1019, -541, 59, 308, 60, 244, 245, 61, 62, 63, 64, 65, 66, 67, 68, 1229, 27, 269, 69, 439, 508, -341, 1022, 929, 1255, 1256, 509, 907, 823, -192, 150, 907, 1253, 41, 24, 510, 352, 511, 818, 512, 386, 513, 11, 699, 514, 515, 648, 25, 814, 43, 44, 440, 372, 371, 907, 45, 516, 702, 1220, 667, 668, 363, 334, -540, 357, -541, -541, 320, 1215, 1249, 518, 519, 520, -581, 1074, 335, 724, -581, 1019, -32766, -541, 336, 521, 522, 703, 1243, 1244, 1245, 1246, 1240, 1241, 294, -541, 850, -547, 851, 823, 1247, 1242, 365, 1022, 1224, 1223, 1225, 295, -153, -153, -153, 369, 70, 897, 318, 319, 322, 897, 384, 149, 402, 373, 374, -153, 435, -153, 436, -153, 280, -153, -540, -540, 141, 1220, 378, 379, 639, 640, 322, 370, 897, 907, 437, 438, 829, -540, -88, 151, 732, 731, 945, 946, 153, 823, -32766, 517, -51, -540, 154, -546, 883, 941, -111, -111, -111, 31, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 155, 74, 27, 157, 32, 322, -85, 123, 124, 909, 129, 697, 130, 909, 823, 697, -153, 143, 1253, 158, -32766, -544, 1229, -542, 159, 160, 1222, 161, -79, 1134, 1136, -75, 285, -32766, -32766, -32766, 909, -32766, 697, -32766, -539, -32766, -301, -73, -32766, 897, -72, -71, 1220, -32766, -32766, -32766, -16, 140, 1215, -32766, -32766, 732, 731, 322, -70, -32766, 414, -69, -4, 907, -68, -67, 521, 522, -32766, 1243, 1244, 1245, 1246, 1240, 1241, -66, -47, -18, 147, 270, 281, 1247, 1242, -544, -544, -542, -542, 732, 731, 713, 716, 906, -32766, 72, 146, 907, 319, 322, 1222, -297, -542, 823, -539, -539, 276, -32766, -32766, -32766, 277, -32766, -544, -32766, -542, -32766, 282, 283, -32766, -539, 909, 328, 697, -32766, -32766, -32766, -32766, 704, 286, -32766, -32766, -539, 1222, 923, 289, -32766, 414, 1220, 290, -32766, -32766, -32766, 271, -32766, -32766, -32766, 47, -32766, 897, -111, -32766, 677, 109, 814, 145, -32766, -32766, -32766, -32766, 823, 131, -32766, -32766, 1336, -32766, 654, 670, -32766, 414, 1104, 370, 637, 430, 551, 73, 13, -32766, 293, 555, 295, 897, 945, 946, 649, 74, 434, 517, 458, 322, 487, 690, 842, 941, -111, -111, -111, 301, 1022, 561, 655, 671, 1260, 300, -32766, -539, -32766, 907, 603, 303, 1222, 296, 297, 39, 1262, 9, 40, -32766, -32766, -32766, 0, -32766, 907, -32766, 909, -32766, 697, -4, -32766, 0, 1229, 907, 0, -32766, -32766, -32766, -32766, 307, 125, -32766, -32766, 0, 1222, 907, 0, -32766, 414, 0, 0, -32766, -32766, -32766, 707, -32766, -32766, -32766, 962, -32766, 697, -505, -32766, 714, -495, 7, 482, -32766, -32766, -32766, -32766, -539, -539, -32766, -32766, 16, 1222, 567, 367, -32766, 414, 925, 295, -32766, -32766, -32766, -539, -32766, -32766, -32766, 822, -32766, 897, 721, -32766, 722, -575, 888, -539, -32766, -32766, -32766, 986, 963, 970, -32766, -32766, 897, -249, -249, -249, -32766, 414, 823, 370, 960, 897, 971, 886, 958, -32766, 1078, 1081, 718, 1082, 945, 946, 1079, 897, 1080, 517, 1086, 33, 1250, 834, 883, 941, -111, -111, -111, 27, 1275, 1293, 1327, -248, -248, -248, 1220, 642, 884, 370, 317, 823, 366, 698, 701, 1253, 1331, 705, -111, 706, 945, 946, 708, 709, 710, 517, 909, -32766, 697, -249, 883, 941, -111, -111, -111, 711, 715, 700, -509, 1333, 845, 909, 48, 697, -573, 1220, 844, 853, 295, 935, 909, 1215, 697, 74, 978, 852, 1332, 322, 934, 932, 933, 936, 909, 1206, 697, -248, 522, 916, 1243, 1244, 1245, 1246, 1240, 1241, 926, 914, 968, 969, 1330, 1287, 1247, 1242, 1276, 1294, -32766, 1300, 1303, 1191, -547, -546, 1222, -545, 72, -489, 1, 319, 322, -32766, -32766, -32766, 28, -32766, 29, -32766, 38, -32766, 298, 299, -32766, 42, 46, 71, 75, -32766, -32766, -32766, 76, 77, 78, -32766, -32766, 368, 79, 80, 142, -32766, 414, 152, 156, 243, 324, 352, 353, 127, -32766, -274, 354, 355, 356, 357, 358, 359, 360, 361, 362, 364, 431, 0, -272, -271, 18, 19, 20, 21, 23, 401, 478, 479, 486, 489, 490, 491, 492, 496, 497, 498, 505, 684, 1233, 1174, 1251, 1048, 1047, 1028, 0, 1210, 1024, -276, -103, 17, 22, 26, 292, 400, 596, 600, 628, 689, 1178, 1228, 1175, 1306, 0, 0, 1254, 0, 322);
    protected $actionCheck = array(2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 138, 106, 107, 8, 57, 9, 10, 11, 9, 10, 155, 116, 9, 10, 11, 9, 10, 11, 71, 72, 73, 74, 75, 76, 77, 163, 30, 80, 32, 33, 34, 35, 36, 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, 127, 128, 129, 130, 131, 132, 133, 8, 80, 136, 137, 138, 139, 140, 141, 142, 143, 144, 51, 1, 161, 31, 80, 150, 151, 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, 6, 7, 164, 9, 10, 11, 12, 13, 70, 1, 82, 159, 80, 85, 30, 83, 32, 33, 34, 35, 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, 1, 37, 38, 9, 10, 11, 8, 8, 161, 9, 10, 11, 117, 118, 167, 1, 8, 122, 155, 156, 157, 57, 97, 128, 30, 162, 32, 33, 34, 35, 30, 14, 32, 33, 34, 71, 72, 73, 74, 75, 76, 77, 134, 135, 80, 147, 148, 50, 51, 52, 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, 127, 128, 129, 130, 131, 132, 133, 164, 8, 136, 137, 138, 139, 140, 141, 142, 143, 144, 80, 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 30, 57, 160, 8, 106, 107, 164, 31, 9, 137, 129, 130, 131, 69, 116, 117, 118, 57, 161, 80, 122, 9, 10, 11, 164, 1, 128, 155, 156, 157, 30, 71, 72, 73, 74, 75, 76, 77, 8, 106, 80, 108, 30, 1, 32, 33, 85, 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, 8, 156, 136, 137, 138, 139, 140, 141, 142, 143, 144, 37, 38, 146, 138, 116, 150, 151, 152, 2, 3, 4, 5, 6, 7, 119, 120, 121, 122, 12, 13, 101, 15, 80, 1, 101, 106, 138, 108, 163, 1, 159, 8, 113, 138, 97, 116, 117, 118, 119, 120, 121, 122, 123, 53, 54, 55, 123, 57, 9, 10, 11, 163, 30, 14, 164, 122, 50, 51, 163, 69, 116, 70, 56, 8, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, 73, 74, 162, 138, 122, 78, 79, 80, 1, 82, 164, 14, 1, 86, 87, 88, 89, 163, 91, 156, 93, 106, 95, 108, 161, 98, 99, 75, 76, 80, 103, 104, 105, 106, 107, 1, 109, 110, 31, 116, 75, 76, 115, 116, 70, 163, 134, 135, 8, 122, 1, 124, 125, 126, 160, 159, 8, 161, 164, 116, 137, 149, 8, 136, 137, 31, 139, 140, 141, 142, 143, 144, 145, 161, 106, 163, 108, 82, 151, 152, 8, 138, 155, 156, 157, 158, 75, 76, 77, 8, 163, 84, 165, 166, 167, 84, 8, 101, 102, 106, 107, 90, 8, 92, 8, 94, 163, 96, 134, 135, 161, 116, 106, 107, 111, 112, 167, 106, 84, 1, 8, 8, 8, 149, 31, 14, 37, 38, 117, 118, 14, 82, 137, 122, 31, 161, 14, 163, 127, 128, 129, 130, 131, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 14, 163, 70, 14, 14, 167, 31, 16, 16, 159, 16, 161, 16, 159, 82, 161, 162, 16, 86, 16, 74, 70, 1, 70, 16, 16, 80, 16, 31, 59, 60, 31, 37, 87, 88, 89, 159, 91, 161, 93, 70, 95, 35, 31, 98, 84, 31, 31, 116, 103, 104, 105, 31, 161, 122, 109, 110, 37, 38, 167, 31, 115, 116, 31, 0, 1, 31, 31, 136, 137, 124, 139, 140, 141, 142, 143, 144, 31, 31, 31, 31, 31, 31, 151, 152, 134, 135, 134, 135, 37, 38, 31, 31, 31, 74, 163, 31, 1, 166, 167, 80, 35, 149, 82, 134, 135, 35, 87, 88, 89, 35, 91, 161, 93, 161, 95, 35, 35, 98, 149, 159, 35, 161, 103, 104, 105, 74, 31, 37, 109, 110, 161, 80, 38, 37, 115, 116, 116, 37, 87, 88, 89, 57, 91, 124, 93, 70, 95, 84, 128, 98, 77, 69, 80, 70, 103, 104, 105, 137, 82, 31, 109, 110, 83, 85, 96, 94, 115, 116, 82, 106, 113, 108, 85, 154, 97, 124, 113, 89, 158, 84, 117, 118, 90, 163, 128, 122, 97, 167, 97, 92, 127, 128, 129, 130, 131, 133, 138, 153, 100, 100, 146, 132, 74, 70, 137, 1, 153, 114, 80, 134, 135, 159, 146, 150, 159, 87, 88, 89, -1, 91, 1, 93, 159, 95, 161, 162, 98, -1, 1, 1, -1, 103, 104, 105, 74, 132, 161, 109, 110, -1, 80, 1, -1, 115, 116, -1, -1, 87, 88, 89, 31, 91, 124, 93, 159, 95, 161, 149, 98, 31, 149, 149, 102, 103, 104, 105, 74, 134, 135, 109, 110, 149, 80, 81, 149, 115, 116, 154, 158, 87, 88, 89, 149, 91, 124, 93, 155, 95, 84, 159, 98, 159, 163, 159, 161, 103, 104, 105, 159, 159, 159, 109, 110, 84, 100, 101, 102, 115, 116, 82, 106, 159, 84, 159, 159, 159, 124, 159, 159, 162, 159, 117, 118, 159, 84, 159, 122, 159, 161, 160, 160, 127, 128, 129, 130, 131, 70, 160, 160, 160, 100, 101, 102, 116, 160, 162, 106, 161, 82, 161, 161, 161, 86, 162, 161, 128, 161, 117, 118, 161, 161, 161, 122, 159, 137, 161, 162, 127, 128, 129, 130, 131, 161, 161, 161, 165, 162, 162, 159, 70, 161, 163, 116, 162, 162, 158, 162, 159, 122, 161, 163, 162, 162, 162, 167, 162, 162, 162, 162, 159, 162, 161, 162, 137, 162, 139, 140, 141, 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, 152, 162, 162, 74, 162, 162, 165, 163, 163, 80, 163, 163, 163, 163, 166, 167, 87, 88, 89, 163, 91, 163, 93, 163, 95, 134, 135, 98, 163, 163, 163, 163, 103, 104, 105, 163, 163, 163, 109, 110, 149, 163, 163, 163, 115, 116, 163, 163, 163, 163, 163, 163, 161, 124, 164, 163, 163, 163, 163, 163, 163, 163, 163, 163, 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, 164, 164, 164, -1, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, -1, -1, 166, -1, 167);
    protected $actionBase = array(0, -2, 154, 542, 752, 893, 929, 580, 53, 394, 855, 307, 307, 67, 307, 307, 307, 565, 908, 908, 917, 908, 538, 784, 649, 649, 649, 708, 708, 708, 708, 740, 740, 849, 849, 881, 817, 634, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 12, 323, 389, 678, 1044, 1050, 1046, 1051, 1042, 1041, 1045, 1047, 1052, 942, 943, 753, 946, 947, 949, 950, 1048, 873, 1043, 1049, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 346, 491, 50, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 54, 54, 54, 620, 620, 359, 190, 184, 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, 658, 47, 144, 144, 7, 7, 7, 7, 7, 371, -25, -25, -25, -25, 709, 347, 916, 474, 526, 375, 280, 317, 245, 340, 340, 187, 187, 396, 396, -87, -87, 396, 396, 396, 747, 747, 747, 747, 443, 505, -94, 308, 454, 480, 480, 480, 480, 454, 454, 454, 454, 755, 1054, 454, 454, 454, 641, 822, 822, 998, 442, 442, 442, 822, 499, 776, 88, 499, 88, 37, 92, 756, 85, -54, 425, 756, 639, 764, 189, 143, 820, 524, 820, 1040, 385, 767, 413, 735, 688, 857, 902, 1053, 787, 940, 788, 941, 228, 98, 685, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1055, 415, 1040, 286, 1055, 1055, 1055, 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, 534, 286, 483, 496, 286, 774, 415, 12, 800, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 736, -16, 12, 323, 204, 204, 427, 168, 204, 204, 204, 204, 12, 12, 12, 524, 773, 733, 537, 742, 377, 773, 773, 773, 115, 124, 207, 342, 695, 754, 446, 761, 761, 775, 957, 957, 761, 765, 761, 775, 973, 761, 761, 957, 957, 809, 232, 625, 579, 612, 627, 957, 475, 761, 761, 761, 761, 792, 643, 761, 433, 281, 761, 761, 792, 758, 739, 46, 751, 957, 957, 957, 792, 603, 751, 751, 751, 819, 821, 746, 738, 571, 507, 645, 198, 783, 738, 738, 761, 619, 746, 738, 746, 738, 812, 738, 738, 738, 746, 738, 765, 585, 738, 691, 644, 188, 738, 6, 974, 975, 624, 979, 967, 980, 1009, 981, 985, 878, 956, 992, 972, 986, 965, 963, 750, 679, 680, 801, 797, 954, 771, 771, 771, 951, 771, 771, 771, 771, 771, 771, 771, 771, 679, 858, 814, 745, 777, 995, 682, 684, 743, 872, 899, 948, 994, 1030, 987, 741, 689, 1016, 999, 846, 875, 1000, 1001, 1017, 1031, 1032, 880, 772, 903, 904, 859, 1003, 879, 771, 974, 985, 663, 972, 986, 965, 963, 734, 724, 720, 723, 717, 704, 700, 703, 737, 1033, 907, 818, 866, 1002, 952, 679, 867, 1012, 856, 1018, 1019, 877, 778, 768, 868, 910, 1004, 1005, 1006, 882, 1034, 884, 744, 1013, 997, 1020, 780, 911, 1021, 1022, 1023, 1024, 887, 913, 888, 889, 823, 781, 1010, 757, 918, 528, 769, 770, 789, 1008, 642, 993, 900, 919, 920, 1025, 1026, 1027, 922, 923, 990, 828, 1014, 760, 1015, 1011, 829, 830, 647, 785, 1035, 759, 763, 779, 653, 674, 924, 925, 927, 991, 748, 762, 841, 843, 1037, 683, 1038, 931, 677, 844, 696, 938, 1029, 697, 699, 786, 901, 811, 782, 766, 1007, 749, 845, 939, 847, 848, 850, 1028, 853, 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, 458, 458, 458, 458, 458, 458, 307, 307, 307, 307, 0, 0, 307, 0, 0, 0, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 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, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 219, 219, 291, 291, 291, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0, 291, 291, 291, 291, 291, 291, 291, 291, 809, 442, 442, 442, 442, 219, 219, 219, 219, 219, -88, -88, 219, 809, 219, 219, 442, 442, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0, 0, 286, 88, 219, 765, 765, 765, 765, 219, 219, 219, 219, 88, 88, 219, 219, 219, 0, 0, 0, 0, 0, 0, 0, 0, 286, 88, 0, 286, 0, 765, 765, 219, 0, 809, 314, 219, 0, 0, 0, 0, 286, 765, 286, 415, 761, 88, 761, 415, 415, 204, 12, 314, 527, 527, 527, 527, 0, 0, 524, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 765, 0, 809, 0, 765, 765, 765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 765, 0, 0, 957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 973, 0, 0, 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, 0, 771, 778, 0, 778, 0, 771, 771, 771, 0, 0, 0, 0, 785, 683);
    protected $actionDefault = array(3, 32767, 103, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 101, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 593, 593, 593, 593, 32767, 32767, 253, 103, 32767, 32767, 467, 385, 385, 385, 32767, 32767, 537, 537, 537, 537, 537, 537, 32767, 32767, 32767, 32767, 32767, 32767, 467, 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, 101, 32767, 32767, 32767, 37, 7, 8, 10, 11, 50, 17, 323, 32767, 32767, 32767, 32767, 103, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 586, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 471, 450, 451, 453, 454, 384, 538, 592, 326, 589, 383, 146, 338, 328, 241, 329, 257, 472, 258, 473, 476, 477, 214, 286, 380, 150, 414, 468, 416, 466, 470, 415, 390, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 388, 389, 469, 447, 446, 445, 32767, 32767, 412, 413, 417, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 103, 32767, 387, 420, 418, 419, 436, 437, 434, 435, 438, 32767, 439, 440, 441, 442, 32767, 315, 32767, 32767, 32767, 364, 362, 315, 112, 32767, 32767, 427, 428, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 531, 444, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 103, 32767, 101, 533, 409, 411, 501, 422, 423, 421, 391, 32767, 508, 32767, 103, 510, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 532, 32767, 539, 539, 32767, 494, 101, 194, 32767, 32767, 32767, 194, 194, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 600, 494, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 32767, 194, 111, 32767, 32767, 32767, 101, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 189, 32767, 267, 269, 103, 554, 194, 32767, 513, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 506, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 494, 432, 139, 32767, 139, 539, 424, 425, 426, 496, 539, 539, 539, 311, 288, 32767, 32767, 32767, 32767, 511, 511, 101, 101, 101, 101, 506, 32767, 32767, 32767, 32767, 112, 100, 100, 100, 100, 100, 104, 102, 32767, 32767, 32767, 32767, 222, 100, 32767, 102, 102, 32767, 32767, 222, 224, 211, 102, 226, 32767, 558, 559, 222, 102, 226, 226, 226, 246, 246, 483, 317, 102, 100, 102, 102, 196, 317, 317, 32767, 102, 483, 317, 483, 317, 198, 317, 317, 317, 483, 317, 32767, 102, 317, 213, 100, 100, 317, 32767, 32767, 32767, 496, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 221, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 526, 32767, 543, 556, 430, 431, 433, 541, 455, 456, 457, 458, 459, 460, 461, 463, 588, 32767, 500, 32767, 32767, 32767, 32767, 337, 598, 32767, 598, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 599, 32767, 539, 32767, 32767, 32767, 32767, 429, 9, 76, 489, 43, 44, 52, 58, 517, 518, 519, 520, 514, 515, 521, 516, 32767, 32767, 522, 564, 32767, 32767, 540, 591, 32767, 32767, 32767, 32767, 32767, 32767, 139, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 526, 32767, 137, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 539, 32767, 32767, 32767, 32767, 313, 310, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 539, 32767, 32767, 32767, 32767, 32767, 290, 32767, 307, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 285, 32767, 32767, 379, 32767, 32767, 32767, 32767, 358, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 152, 152, 3, 3, 340, 152, 152, 152, 340, 340, 152, 340, 340, 340, 152, 152, 152, 152, 152, 152, 279, 184, 261, 264, 246, 246, 152, 350, 152);
    protected $goto = array(194, 194, 685, 425, 653, 346, 614, 650, 419, 310, 311, 331, 569, 316, 424, 332, 426, 630, 1200, 930, 693, 1051, 1201, 1204, 931, 1205, 165, 165, 165, 165, 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, 188, 189, 190, 215, 213, 216, 529, 530, 415, 531, 533, 534, 535, 536, 537, 538, 539, 540, 1120, 166, 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, 176, 212, 214, 217, 235, 240, 241, 242, 254, 255, 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, 278, 279, 313, 314, 315, 420, 421, 422, 574, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, 236, 186, 187, 188, 189, 190, 215, 1120, 199, 180, 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, 211, 275, 275, 275, 275, 843, 593, 646, 647, 560, 664, 665, 666, 720, 629, 631, 840, 418, 651, 604, 841, 350, 675, 679, 996, 683, 691, 992, 616, 616, 817, 350, 350, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1092, 1093, 350, 350, 874, 350, 848, 1337, 896, 891, 892, 905, 849, 893, 846, 894, 895, 847, 548, 900, 899, 901, 350, 391, 394, 554, 594, 598, 1270, 1270, 1072, 1068, 1069, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1268, 1268, 815, 347, 348, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1221, 1020, 1221, 1020, 1221, 836, 5, 1020, 6, 1020, 1020, 1281, 961, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 349, 349, 349, 349, 1221, 460, 460, 566, 678, 1221, 1221, 1221, 1221, 344, 460, 1221, 1221, 1221, 1302, 1302, 1302, 1302, 602, 617, 620, 621, 622, 623, 643, 644, 645, 695, 836, 912, 553, 546, 1310, 913, 548, 532, 532, 821, 856, 982, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 543, 473, 543, 868, 543, 928, 855, 928, 389, 475, 337, 546, 553, 562, 563, 339, 572, 595, 609, 610, 1320, 1320, 249, 249, 1026, 1025, 15, 821, 450, 821, 494, 565, 495, 955, 955, 955, 955, 1320, 501, 450, 949, 956, 839, 652, 1321, 1321, 1169, 1214, 246, 246, 246, 246, 248, 250, 1323, 985, 959, 959, 957, 959, 719, 1321, 545, 994, 989, 470, 1295, 1296, 953, 405, 692, 917, 1108, 432, 541, 541, 541, 541, 612, 597, 452, 444, 1029, 1030, 1001, 658, 444, 1292, 444, 1292, 674, 1292, 860, 833, 656, 980, 836, 861, 547, 557, 854, 321, 305, 547, 333, 557, 1297, 1298, 392, 456, 570, 607, 1211, 944, 398, 858, 1304, 1304, 1304, 1304, 463, 573, 464, 465, 608, 1004, 866, 403, 404, 1328, 1329, 1057, 662, 1212, 663, 471, 407, 408, 409, 723, 676, 870, 1288, 410, 624, 626, 627, 342, 427, 1216, 869, 857, 1056, 1060, 427, 864, 1061, 1103, 966, 0, 0, 964, 1027, 1027, 0, 0, 0, 657, 1038, 1034, 1035, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 0, 1059, 444, 954, 0, 1290, 1290, 1059, 592, 1085, 0, 696, 682, 682, 0, 502, 688, 1083, 0, 0, 0, 1217, 1218, 272, 428, 1101, 873, 0, 544, 831, 544, 0, 0, 0, 673, 938, 0, 0, 1015, 1031, 1032, 0, 0, 0, 0, 0, 0, 1219, 1278, 1279, 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, 252, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 999, 999);
    protected $gotoCheck = array(42, 42, 72, 65, 65, 96, 55, 55, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 78, 78, 9, 126, 78, 78, 78, 78, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 23, 23, 23, 23, 15, 129, 85, 85, 48, 85, 85, 85, 48, 48, 48, 26, 13, 48, 13, 27, 14, 48, 48, 48, 48, 48, 48, 107, 107, 7, 14, 14, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 143, 143, 14, 14, 45, 14, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 64, 15, 64, 14, 58, 58, 58, 58, 58, 168, 168, 15, 15, 15, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 6, 96, 96, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 72, 72, 72, 72, 72, 22, 46, 72, 46, 72, 72, 14, 49, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 24, 24, 24, 24, 72, 148, 148, 170, 14, 72, 72, 72, 72, 177, 148, 72, 72, 72, 9, 9, 9, 9, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 22, 72, 75, 75, 179, 72, 14, 171, 171, 12, 35, 102, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 19, 83, 19, 35, 19, 9, 35, 9, 61, 83, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 180, 180, 5, 5, 117, 117, 75, 12, 19, 12, 154, 103, 154, 19, 19, 19, 19, 180, 154, 19, 19, 19, 25, 63, 181, 181, 150, 14, 5, 5, 5, 5, 5, 5, 180, 25, 25, 25, 25, 25, 25, 181, 25, 25, 25, 174, 174, 174, 92, 92, 92, 17, 17, 112, 106, 106, 106, 106, 17, 106, 82, 23, 118, 118, 17, 119, 23, 129, 23, 129, 115, 129, 17, 18, 17, 17, 22, 39, 9, 9, 17, 167, 167, 9, 29, 9, 176, 176, 9, 9, 2, 2, 17, 91, 28, 37, 129, 129, 129, 129, 9, 9, 9, 9, 79, 109, 9, 81, 81, 9, 9, 128, 81, 159, 81, 156, 81, 81, 81, 98, 81, 41, 129, 81, 84, 84, 84, 81, 116, 20, 16, 16, 16, 16, 116, 9, 131, 146, 95, -1, -1, 16, 116, 116, -1, -1, -1, 116, 116, 116, 116, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, -1, 129, 23, 16, -1, 129, 129, 129, 8, 8, -1, 8, 8, 8, -1, 8, 8, 8, -1, -1, -1, 20, 20, 24, 88, 16, 16, -1, 24, 20, 24, -1, -1, -1, 88, 88, -1, -1, 88, 88, 88, -1, -1, -1, -1, -1, -1, 20, 20, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, 106);
    protected $gotoBase = array(0, 0, -250, 0, 0, 360, 235, 181, 522, 7, 0, 0, 33, -156, -113, -178, 43, -49, 126, 72, 100, 0, -9, 158, 282, 377, 172, 176, 120, 150, 0, 0, 0, 0, 0, -39, 0, 119, 0, 116, 0, 45, -1, 0, 0, 195, -456, 0, -529, 250, 0, 0, 0, 0, 0, -33, 0, 0, 182, 0, 0, 306, 0, 143, 203, -235, 0, 0, 0, 0, 0, 0, -6, 0, 0, -21, 0, 0, -385, 124, -46, -19, 144, -123, 10, -538, 0, 0, 275, 0, 0, 127, 106, 0, 0, 60, -472, 0, 76, 0, 0, 0, 294, 328, 0, 0, 386, -50, 0, 99, 0, 0, 138, 0, 0, 149, 219, 87, 139, 137, 0, 0, 0, 0, 0, 0, 19, 0, 101, 159, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, 0, 0, 58, 0, 257, 0, 114, 0, 0, 0, -120, 0, 40, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 122, -7, 8, 264, 86, 0, 0, 107, 0, 78, 269, 0, 291, 55, 79, 0, 0);
    protected $gotoDefault = array(-32768, 506, 727, 4, 728, 921, 804, 813, 590, 523, 694, 343, 618, 416, 1286, 898, 1107, 571, 832, 1230, 1238, 451, 835, 326, 717, 880, 881, 882, 395, 381, 387, 393, 641, 619, 488, 867, 447, 859, 480, 862, 446, 871, 162, 413, 504, 875, 3, 877, 550, 908, 382, 885, 383, 669, 887, 556, 889, 890, 390, 396, 397, 1112, 564, 615, 902, 253, 558, 903, 380, 904, 911, 385, 388, 680, 459, 499, 493, 406, 1087, 559, 601, 638, 441, 467, 613, 625, 611, 474, 1023, 411, 325, 943, 951, 481, 457, 965, 345, 973, 725, 1119, 632, 483, 981, 633, 988, 991, 524, 525, 472, 1003, 268, 1006, 484, 1044, 659, 1017, 1018, 660, 634, 1040, 635, 661, 636, 1042, 466, 591, 1050, 448, 1058, 1274, 449, 1062, 262, 1065, 274, 412, 429, 1070, 1071, 8, 1077, 686, 687, 10, 273, 503, 1102, 681, 445, 1118, 433, 1188, 1190, 552, 485, 1208, 1207, 672, 500, 1213, 442, 1277, 443, 526, 468, 312, 527, 304, 329, 309, 542, 291, 330, 528, 469, 1283, 1291, 327, 30, 1311, 1322, 338, 568, 606);
    protected $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, 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, 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, 68, 68, 71, 71, 70, 69, 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 26, 26, 27, 27, 27, 27, 27, 87, 87, 89, 89, 82, 82, 90, 90, 91, 91, 91, 83, 83, 86, 86, 84, 84, 92, 93, 93, 56, 56, 64, 64, 67, 67, 67, 66, 94, 94, 95, 57, 57, 57, 57, 96, 96, 97, 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, 54, 54, 50, 50, 104, 52, 52, 105, 51, 51, 53, 53, 63, 63, 63, 63, 80, 80, 108, 108, 110, 110, 111, 111, 111, 111, 109, 109, 109, 113, 113, 113, 113, 88, 88, 116, 116, 116, 117, 117, 114, 114, 118, 118, 120, 120, 121, 121, 115, 122, 122, 119, 123, 123, 123, 123, 112, 112, 81, 81, 81, 20, 20, 20, 125, 124, 124, 126, 126, 126, 126, 59, 127, 127, 128, 60, 130, 130, 131, 131, 132, 132, 85, 133, 133, 133, 133, 133, 133, 138, 138, 139, 139, 140, 140, 140, 140, 140, 141, 142, 142, 137, 137, 134, 134, 136, 136, 144, 144, 143, 143, 143, 143, 143, 143, 143, 135, 145, 145, 147, 146, 146, 61, 103, 148, 148, 55, 55, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 155, 149, 149, 154, 154, 157, 158, 158, 159, 160, 161, 161, 161, 161, 19, 19, 72, 72, 72, 72, 150, 150, 150, 150, 163, 163, 151, 151, 153, 153, 153, 156, 156, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 107, 171, 171, 171, 171, 152, 152, 152, 152, 152, 152, 152, 152, 58, 58, 166, 166, 166, 166, 172, 172, 162, 162, 162, 173, 173, 173, 173, 173, 173, 73, 73, 65, 65, 65, 65, 129, 129, 129, 129, 176, 175, 165, 165, 165, 165, 165, 165, 165, 164, 164, 164, 174, 174, 174, 174, 106, 170, 178, 178, 177, 177, 179, 179, 179, 179, 179, 179, 179, 179, 167, 167, 167, 167, 181, 182, 180, 180, 180, 180, 180, 180, 180, 180, 183, 183, 183, 183);
    protected $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, 1, 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, 0, 1, 1, 1, 1, 1, 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, 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, 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, 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, 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, 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()
    {
        $this->reduceCallbacks = [0 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 1 => function ($stackPos) {
            $this->semValue = $this->handleNamespaces($this->semStack[$stackPos - (1 - 1)]);
        }, 2 => function ($stackPos) {
            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
            } else {
                $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) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 5 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 6 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 7 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 8 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 9 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 10 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 11 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 12 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 13 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 14 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 15 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 16 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 17 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 18 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 19 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 20 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 21 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 22 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 23 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 24 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 25 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 26 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 27 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 28 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 29 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 30 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 31 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 32 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 33 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 34 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 35 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 36 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 37 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 38 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 39 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 40 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 41 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 42 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 43 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 44 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 45 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 46 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 47 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 48 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 49 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 50 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 51 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 52 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 53 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 54 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 55 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 56 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 57 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 58 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 59 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 60 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 61 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 62 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 63 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 64 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 65 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 66 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 67 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 68 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 69 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 70 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 71 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 72 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 73 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 74 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 75 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 76 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 77 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 78 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 79 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 80 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 81 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 82 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 83 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 84 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 85 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 86 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 87 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 88 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 89 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 90 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 91 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 92 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 93 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 94 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 95 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 96 => function ($stackPos) {
            $this->semValue = new Name(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 97 => function ($stackPos) {
            $this->semValue = new Expr\Variable(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 98 => function ($stackPos) {
        }, 99 => function ($stackPos) {
        }, 100 => function ($stackPos) {
        }, 101 => function ($stackPos) {
            $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
        }, 102 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 103 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 104 => function ($stackPos) {
            $this->semValue = new Node\Attribute($this->semStack[$stackPos - (1 - 1)], [], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 105 => function ($stackPos) {
            $this->semValue = new Node\Attribute($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 106 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 107 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 108 => function ($stackPos) {
            $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 109 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 110 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 111 => function ($stackPos) {
            $this->semValue = [];
        }, 112 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 113 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 114 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 115 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 116 => function ($stackPos) {
            $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 117 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (3 - 2)], null, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
            $this->checkNamespace($this->semValue);
        }, 118 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
            $this->checkNamespace($this->semValue);
        }, 119 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
            $this->checkNamespace($this->semValue);
        }, 120 => function ($stackPos) {
            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (3 - 2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 121 => function ($stackPos) {
            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 122 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 123 => function ($stackPos) {
            $this->semValue = new Stmt\Const_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 124 => function ($stackPos) {
            $this->semValue = Stmt\Use_::TYPE_FUNCTION;
        }, 125 => function ($stackPos) {
            $this->semValue = Stmt\Use_::TYPE_CONSTANT;
        }, 126 => function ($stackPos) {
            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->semStack[$stackPos - (7 - 2)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 127 => function ($stackPos) {
            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 128 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 129 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 130 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 131 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 132 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 133 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 134 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 135 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 136 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 137 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
        }, 138 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
        }, 139 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
        }, 140 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
        }, 141 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
            $this->semValue->type = Stmt\Use_::TYPE_NORMAL;
        }, 142 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue->type = $this->semStack[$stackPos - (2 - 1)];
        }, 143 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 144 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 145 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 146 => function ($stackPos) {
            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 147 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 148 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 149 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 150 => function ($stackPos) {
            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 151 => function ($stackPos) {
            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
            } else {
                $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) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 154 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 155 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 156 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 157 => function ($stackPos) {
            throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 158 => function ($stackPos) {
            if ($this->semStack[$stackPos - (3 - 2)]) {
                $this->semValue = $this->semStack[$stackPos - (3 - 2)];
                $attrs = $this->startAttributeStack[$stackPos - (3 - 1)];
                $stmts = $this->semValue;
                if (!empty($attrs['comments'])) {
                    $stmts[0]->setAttribute('comments', \array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', [])));
                }
            } else {
                $startAttributes = $this->startAttributeStack[$stackPos - (3 - 1)];
                if (isset($startAttributes['comments'])) {
                    $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
                } else {
                    $this->semValue = null;
                }
                if (null === $this->semValue) {
                    $this->semValue = array();
                }
            }
        }, 159 => function ($stackPos) {
            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (7 - 3)], ['stmts' => \is_array($this->semStack[$stackPos - (7 - 5)]) ? $this->semStack[$stackPos - (7 - 5)] : array($this->semStack[$stackPos - (7 - 5)]), 'elseifs' => $this->semStack[$stackPos - (7 - 6)], 'else' => $this->semStack[$stackPos - (7 - 7)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 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->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
        }, 161 => function ($stackPos) {
            $this->semValue = new Stmt\While_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 162 => function ($stackPos) {
            $this->semValue = new Stmt\Do_($this->semStack[$stackPos - (7 - 5)], \is_array($this->semStack[$stackPos - (7 - 2)]) ? $this->semStack[$stackPos - (7 - 2)] : array($this->semStack[$stackPos - (7 - 2)]), $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 164 => function ($stackPos) {
            $this->semValue = new Stmt\Switch_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 165 => function ($stackPos) {
            $this->semValue = new Stmt\Break_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 166 => function ($stackPos) {
            $this->semValue = new Stmt\Continue_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 167 => function ($stackPos) {
            $this->semValue = new Stmt\Return_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 168 => function ($stackPos) {
            $this->semValue = new Stmt\Global_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 169 => function ($stackPos) {
            $this->semValue = new Stmt\Static_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 170 => function ($stackPos) {
            $this->semValue = new Stmt\Echo_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 171 => function ($stackPos) {
            $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 172 => function ($stackPos) {
            $e = $this->semStack[$stackPos - (2 - 1)];
            if ($e instanceof Expr\Throw_) {
                $this->semValue = new Stmt\Throw_($e->expr, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
            } else {
                $this->semValue = new Stmt\Expression($e, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
            }
        }, 173 => function ($stackPos) {
            $this->semValue = new Stmt\Unset_($this->semStack[$stackPos - (5 - 3)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 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->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 176 => function ($stackPos) {
            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (6 - 3)], new Expr\Error($this->startAttributeStack[$stackPos - (6 - 4)] + $this->endAttributeStack[$stackPos - (6 - 4)]), ['stmts' => $this->semStack[$stackPos - (6 - 6)]], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 177 => function ($stackPos) {
            $this->semValue = new Stmt\Declare_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 178 => function ($stackPos) {
            $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 5)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
            $this->checkTryCatch($this->semValue);
        }, 179 => function ($stackPos) {
            $this->semValue = new Stmt\Goto_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 180 => function ($stackPos) {
            $this->semValue = new Stmt\Label($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 181 => function ($stackPos) {
            $this->semValue = array();
        }, 182 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 183 => function ($stackPos) {
            $startAttributes = $this->startAttributeStack[$stackPos - (1 - 1)];
            if (isset($startAttributes['comments'])) {
                $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
            } else {
                $this->semValue = null;
            }
            if ($this->semValue === null) {
                $this->semValue = array();
            }
        }, 184 => function ($stackPos) {
            $this->semValue = array();
        }, 185 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 186 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 187 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 188 => function ($stackPos) {
            $this->semValue = new Stmt\Catch_($this->semStack[$stackPos - (8 - 3)], $this->semStack[$stackPos - (8 - 4)], $this->semStack[$stackPos - (8 - 7)], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 189 => function ($stackPos) {
            $this->semValue = null;
        }, 190 => function ($stackPos) {
            $this->semValue = new Stmt\Finally_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 191 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 192 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 193 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 194 => function ($stackPos) {
            $this->semValue = \false;
        }, 195 => function ($stackPos) {
            $this->semValue = \true;
        }, 196 => function ($stackPos) {
            $this->semValue = \false;
        }, 197 => function ($stackPos) {
            $this->semValue = \true;
        }, 198 => function ($stackPos) {
            $this->semValue = \false;
        }, 199 => function ($stackPos) {
            $this->semValue = \true;
        }, 200 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 201 => function ($stackPos) {
            $this->semValue = [];
        }, 202 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 203 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 204 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 205 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 206 => 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->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
            $this->checkClass($this->semValue, $stackPos - (7 - 2));
        }, 207 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
            $this->checkClass($this->semValue, $stackPos - (8 - 3));
        }, 208 => 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->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
            $this->checkInterface($this->semValue, $stackPos - (7 - 3));
        }, 209 => 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->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 210 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
            $this->checkEnum($this->semValue, $stackPos - (8 - 3));
        }, 211 => function ($stackPos) {
            $this->semValue = null;
        }, 212 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 213 => function ($stackPos) {
            $this->semValue = null;
        }, 214 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 215 => function ($stackPos) {
            $this->semValue = 0;
        }, 216 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 217 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 218 => 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)];
        }, 219 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
        }, 220 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
        }, 221 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_READONLY;
        }, 222 => function ($stackPos) {
            $this->semValue = null;
        }, 223 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 224 => function ($stackPos) {
            $this->semValue = array();
        }, 225 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 226 => function ($stackPos) {
            $this->semValue = array();
        }, 227 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 228 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 229 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 230 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 231 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 232 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 233 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 234 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 235 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 236 => function ($stackPos) {
            $this->semValue = null;
        }, 237 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 238 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 239 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 240 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 241 => function ($stackPos) {
            $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 242 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 243 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
        }, 244 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 245 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (5 - 3)];
        }, 246 => function ($stackPos) {
            $this->semValue = array();
        }, 247 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 248 => function ($stackPos) {
            $this->semValue = new Stmt\Case_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 249 => function ($stackPos) {
            $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 250 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 251 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 252 => function ($stackPos) {
            $this->semValue = new Expr\Match_($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 253 => function ($stackPos) {
            $this->semValue = [];
        }, 254 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 255 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 256 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 257 => function ($stackPos) {
            $this->semValue = new Node\MatchArm($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 258 => function ($stackPos) {
            $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 259 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 260 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 261 => function ($stackPos) {
            $this->semValue = array();
        }, 262 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 263 => function ($stackPos) {
            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (5 - 3)], \is_array($this->semStack[$stackPos - (5 - 5)]) ? $this->semStack[$stackPos - (5 - 5)] : array($this->semStack[$stackPos - (5 - 5)]), $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 264 => function ($stackPos) {
            $this->semValue = array();
        }, 265 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 266 => function ($stackPos) {
            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
            $this->fixupAlternativeElse($this->semValue);
        }, 267 => function ($stackPos) {
            $this->semValue = null;
        }, 268 => function ($stackPos) {
            $this->semValue = new Stmt\Else_(\is_array($this->semStack[$stackPos - (2 - 2)]) ? $this->semStack[$stackPos - (2 - 2)] : array($this->semStack[$stackPos - (2 - 2)]), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 269 => function ($stackPos) {
            $this->semValue = null;
        }, 270 => function ($stackPos) {
            $this->semValue = new Stmt\Else_($this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->fixupAlternativeElse($this->semValue);
        }, 271 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
        }, 272 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (2 - 2)], \true);
        }, 273 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
        }, 274 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
        }, 275 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 276 => function ($stackPos) {
            $this->semValue = array();
        }, 277 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 278 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 279 => function ($stackPos) {
            $this->semValue = 0;
        }, 280 => 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)];
        }, 281 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
        }, 282 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
        }, 283 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
        }, 284 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_READONLY;
        }, 285 => 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->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 1)]);
            $this->checkParam($this->semValue);
        }, 286 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (8 - 2)], $this->semStack[$stackPos - (8 - 1)]);
            $this->checkParam($this->semValue);
        }, 287 => function ($stackPos) {
            $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes), null, $this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 1)]);
        }, 288 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 289 => function ($stackPos) {
            $this->semValue = new Node\NullableType($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 290 => function ($stackPos) {
            $this->semValue = new Node\UnionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 291 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 292 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 293 => function ($stackPos) {
            $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 294 => function ($stackPos) {
            $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos - (1 - 1)]);
        }, 295 => function ($stackPos) {
            $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 296 => function ($stackPos) {
            $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 297 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 298 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 299 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 300 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 301 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 302 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 303 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 304 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 305 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 306 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 307 => function ($stackPos) {
            $this->semValue = new Node\IntersectionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 308 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 309 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 310 => function ($stackPos) {
            $this->semValue = new Node\IntersectionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 311 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 312 => function ($stackPos) {
            $this->semValue = new Node\NullableType($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 313 => function ($stackPos) {
            $this->semValue = new Node\UnionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 314 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 315 => function ($stackPos) {
            $this->semValue = null;
        }, 316 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 317 => function ($stackPos) {
            $this->semValue = null;
        }, 318 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 319 => function ($stackPos) {
            $this->semValue = null;
        }, 320 => function ($stackPos) {
            $this->semValue = array();
        }, 321 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 322 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 2)]);
        }, 323 => function ($stackPos) {
            $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 324 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 325 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 326 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (1 - 1)], \false, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 327 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \true, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 328 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \false, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 329 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (3 - 3)], \false, \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (3 - 1)]);
        }, 330 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 331 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 332 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 333 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 334 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 335 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 336 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 337 => function ($stackPos) {
            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 338 => function ($stackPos) {
            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 339 => 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)];
            }
        }, 340 => function ($stackPos) {
            $this->semValue = array();
        }, 341 => function ($stackPos) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 342 => function ($stackPos) {
            $this->semValue = new Stmt\Property($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 1)]);
            $this->checkProperty($this->semValue, $stackPos - (5 - 2));
        }, 343 => function ($stackPos) {
            $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos - (5 - 4)], $this->semStack[$stackPos - (5 - 2)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (5 - 1)]);
            $this->checkClassConst($this->semValue, $stackPos - (5 - 2));
        }, 344 => 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->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
            $this->checkClassMethod($this->semValue, $stackPos - (10 - 2));
        }, 345 => function ($stackPos) {
            $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 346 => function ($stackPos) {
            $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 4)], $this->semStack[$stackPos - (5 - 1)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 347 => function ($stackPos) {
            $this->semValue = null;
        }, 348 => function ($stackPos) {
            $this->semValue = array();
        }, 349 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 350 => function ($stackPos) {
            $this->semValue = array();
        }, 351 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 352 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 353 => 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->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 354 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 355 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 356 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 357 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 358 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 359 => function ($stackPos) {
            $this->semValue = array(null, $this->semStack[$stackPos - (1 - 1)]);
        }, 360 => function ($stackPos) {
            $this->semValue = null;
        }, 361 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 362 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 363 => function ($stackPos) {
            $this->semValue = 0;
        }, 364 => function ($stackPos) {
            $this->semValue = 0;
        }, 365 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 366 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 367 => 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)];
        }, 368 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
        }, 369 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
        }, 370 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
        }, 371 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_STATIC;
        }, 372 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
        }, 373 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
        }, 374 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_READONLY;
        }, 375 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 376 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 377 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 378 => function ($stackPos) {
            $this->semValue = new Node\VarLikeIdentifier(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 379 => function ($stackPos) {
            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 380 => function ($stackPos) {
            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 381 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 382 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 383 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 384 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 385 => function ($stackPos) {
            $this->semValue = array();
        }, 386 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 387 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 388 => function ($stackPos) {
            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 389 => function ($stackPos) {
            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 390 => function ($stackPos) {
            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 391 => function ($stackPos) {
            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 392 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 393 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 394 => function ($stackPos) {
            $this->semValue = new Expr\Clone_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 395 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 396 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 397 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 398 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 399 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 400 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 401 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 402 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 403 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 404 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 405 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 406 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 407 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 408 => function ($stackPos) {
            $this->semValue = new Expr\PostInc($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 409 => function ($stackPos) {
            $this->semValue = new Expr\PreInc($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 410 => function ($stackPos) {
            $this->semValue = new Expr\PostDec($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 411 => function ($stackPos) {
            $this->semValue = new Expr\PreDec($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 412 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 413 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 414 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 415 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 416 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 417 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 418 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 419 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 420 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 421 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 422 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 423 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 424 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 425 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 426 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 427 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 428 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 429 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 430 => function ($stackPos) {
            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 431 => function ($stackPos) {
            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 432 => function ($stackPos) {
            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 433 => function ($stackPos) {
            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 434 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 435 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 436 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 437 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 438 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 439 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 440 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 441 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 442 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 443 => function ($stackPos) {
            $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 444 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 445 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 446 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 447 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 448 => function ($stackPos) {
            $this->semValue = new Expr\Isset_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 449 => function ($stackPos) {
            $this->semValue = new Expr\Empty_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 450 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 451 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 452 => function ($stackPos) {
            $this->semValue = new Expr\Eval_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 453 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 454 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 455 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 456 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
            $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos - (2 - 1)]);
            $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos - (2 - 2)], $attrs);
        }, 457 => function ($stackPos) {
            $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 458 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 459 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 460 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 461 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 462 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
            $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);
        }, 463 => function ($stackPos) {
            $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 464 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 465 => function ($stackPos) {
            $this->semValue = new Expr\ShellExec($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 466 => function ($stackPos) {
            $this->semValue = new Expr\Print_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 467 => function ($stackPos) {
            $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 468 => function ($stackPos) {
            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (2 - 2)], null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 469 => function ($stackPos) {
            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 470 => function ($stackPos) {
            $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 471 => function ($stackPos) {
            $this->semValue = new Expr\Throw_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 472 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 473 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 474 => 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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 475 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 476 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 477 => 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->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
        }, 478 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 479 => 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->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
        }, 480 => function ($stackPos) {
            $this->semValue = array(new Stmt\Class_(null, ['type' => 0, '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->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes), $this->semStack[$stackPos - (8 - 3)]);
            $this->checkClass($this->semValue[0], -1);
        }, 481 => function ($stackPos) {
            $this->semValue = new Expr\New_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 482 => function ($stackPos) {
            list($class, $ctorArgs) = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 483 => function ($stackPos) {
            $this->semValue = array();
        }, 484 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
        }, 485 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 486 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 487 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 488 => function ($stackPos) {
            $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos - (2 - 2)], $this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 489 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 490 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 491 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 492 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 493 => function ($stackPos) {
            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 494 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 495 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 496 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 497 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 498 => function ($stackPos) {
            $this->semValue = new Name\FullyQualified(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 499 => function ($stackPos) {
            $this->semValue = new Name\Relative(\substr($this->semStack[$stackPos - (1 - 1)], 10), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 500 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 501 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 502 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 503 => function ($stackPos) {
            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->errorState = 2;
        }, 504 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 505 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 506 => function ($stackPos) {
            $this->semValue = null;
        }, 507 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 508 => function ($stackPos) {
            $this->semValue = array();
        }, 509 => function ($stackPos) {
            $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos - (1 - 1)], '`'), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
        }, 510 => function ($stackPos) {
            foreach ($this->semStack[$stackPos - (1 - 1)] as $s) {
                if ($s instanceof Node\Scalar\EncapsedStringPart) {
                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', \true);
                }
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 511 => function ($stackPos) {
            $this->semValue = array();
        }, 512 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 513 => function ($stackPos) {
            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 514 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 515 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 516 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 517 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 518 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 519 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 520 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 521 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 522 => function ($stackPos) {
            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 523 => function ($stackPos) {
            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], new Expr\Error($this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)]), $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->errorState = 2;
        }, 524 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
            $attrs['kind'] = Expr\Array_::KIND_SHORT;
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $attrs);
        }, 525 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes;
            $attrs['kind'] = Expr\Array_::KIND_LONG;
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $attrs);
        }, 526 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 527 => function ($stackPos) {
            $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 528 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
            $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
            foreach ($this->semStack[$stackPos - (3 - 2)] as $s) {
                if ($s instanceof Node\Scalar\EncapsedStringPart) {
                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', \true);
                }
            }
            $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos - (3 - 2)], $attrs);
        }, 529 => function ($stackPos) {
            $this->semValue = $this->parseLNumber($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 530 => function ($stackPos) {
            $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 531 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 532 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 533 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 534 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
        }, 535 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (2 - 1)], '', $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (2 - 2)] + $this->endAttributeStack[$stackPos - (2 - 2)], \true);
        }, 536 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
        }, 537 => function ($stackPos) {
            $this->semValue = null;
        }, 538 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 539 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 540 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 541 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 542 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 543 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 544 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 545 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 546 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 547 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 548 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 549 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 550 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 551 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 552 => function ($stackPos) {
            $this->semValue = new Expr\MethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 553 => function ($stackPos) {
            $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 554 => function ($stackPos) {
            $this->semValue = null;
        }, 555 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 556 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 557 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 558 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 559 => function ($stackPos) {
            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 560 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 561 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 562 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 563 => function ($stackPos) {
            $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
            $this->errorState = 2;
        }, 564 => function ($stackPos) {
            $var = $this->semStack[$stackPos - (1 - 1)]->name;
            $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes) : $var;
        }, 565 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 566 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 567 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 568 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 569 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 570 => function ($stackPos) {
            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 571 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 572 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 573 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 574 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 575 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 576 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 577 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 578 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 579 => function ($stackPos) {
            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->errorState = 2;
        }, 580 => function ($stackPos) {
            $this->semValue = new Expr\List_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 581 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
            $end = \count($this->semValue) - 1;
            if ($this->semValue[$end] === null) {
                \array_pop($this->semValue);
            }
        }, 582 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 583 => function ($stackPos) {
        }, 584 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 585 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 586 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 587 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 588 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 589 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 590 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 1)], \true, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 591 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 592 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 593 => function ($stackPos) {
            $this->semValue = null;
        }, 594 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 595 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 596 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 597 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
        }, 598 => function ($stackPos) {
            $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 599 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 600 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 601 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 602 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 603 => function ($stackPos) {
            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 604 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 605 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 606 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 4)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 607 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 608 => function ($stackPos) {
            $this->semValue = new Scalar\String_($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 609 => function ($stackPos) {
            $this->semValue = $this->parseNumString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 610 => function ($stackPos) {
            $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 611 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }];
    }
}
<?php

namespace Cvphar\PhpParser\Parser;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Stmt;
class Php5 extends \Cvphar\PhpParser\ParserAbstract
{
    protected $tokenToSymbolMapSize = 396;
    protected $actionTableSize = 1099;
    protected $gotoTableSize = 640;
    protected $invalidSymbol = 168;
    protected $errorSymbol = 1;
    protected $defaultAction = -32766;
    protected $unexpectedTokenRule = 32767;
    protected $YY2TBLSTATE = 415;
    protected $numNonLeafStates = 663;
    protected $symbolToName = array("EOF", "error", "T_THROW", "T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE", "','", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_YIELD", "T_DOUBLE_ARROW", "T_YIELD_FROM", "'='", "T_PLUS_EQUAL", "T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL", "T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL", "T_POW_EQUAL", "T_COALESCE_EQUAL", "'?'", "':'", "T_COALESCE", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "'|'", "'^'", "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_SPACESHIP", "'<'", "T_IS_SMALLER_OR_EQUAL", "'>'", "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_EXTENDS", "T_IMPLEMENTS", "T_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_ENUM", "T_NULLSAFE_OBJECT_OPERATOR", "T_ATTRIBUTE");
    protected $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, 164, 168, 161, 55, 168, 168, 159, 160, 53, 50, 8, 51, 52, 54, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 31, 156, 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, 163, 36, 168, 162, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 157, 35, 158, 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, 165, 131, 132, 133, 166, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 167);
    protected $action = array(700, 670, 671, 672, 673, 674, 286, 675, 676, 677, 713, 714, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, 245, 246, 242, 243, 244, -32766, -32766, 678, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 1229, 245, 246, 1230, 679, 680, 681, 682, 683, 684, 685, 899, 900, 747, -32766, -32766, -32766, -32766, -32766, -32766, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 716, 739, 717, 718, 719, 720, 708, 709, 710, 738, 711, 712, 697, 698, 699, 701, 702, 703, 741, 742, 743, 744, 745, 746, 875, 704, 705, 706, 707, 737, 728, 726, 727, 723, 724, 1046, 715, 721, 722, 729, 730, 732, 731, 733, 734, 55, 56, 425, 57, 58, 725, 736, 735, 755, 59, 60, -226, 61, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 337, -32767, -32767, -32767, -32767, 29, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 620, -32766, -32766, -32766, -32766, 62, 63, 1046, -32766, -32766, -32766, 64, 419, 65, 294, 295, 66, 67, 68, 69, 70, 71, 72, 73, 823, 25, 302, 74, 418, 984, 986, 669, 668, 1100, 1101, 1078, 755, 755, 767, 1220, 768, 470, -32766, -32766, -32766, 341, 749, 824, 54, -32767, -32767, -32767, -32767, 98, 99, 100, 101, 102, 220, 221, 222, 362, 876, -32766, 27, -32766, -32766, -32766, -32766, -32766, 1046, 493, 126, 1080, 1079, 1081, 370, 1068, 930, 207, 478, 479, 952, 953, 954, 951, 950, 949, 128, 480, 481, 803, 1106, 1107, 1108, 1109, 1103, 1104, 319, 32, 297, 10, 211, -515, 1110, 1105, 669, 668, 1080, 1079, 1081, 220, 221, 222, 41, 364, 341, 334, 421, 336, 426, -128, -128, -128, 313, 1046, 469, -4, 824, 54, 812, 770, 207, 40, 21, 427, -128, 471, -128, 472, -128, 473, -128, 1046, 428, 220, 221, 222, -32766, 33, 34, 429, 361, 327, 52, 35, 474, -32766, -32766, -32766, 342, 357, 358, 475, 476, 48, 207, 249, 669, 668, 477, 443, 300, 795, 846, 430, 431, 28, -32766, 814, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, -32767, 952, 953, 954, 951, 950, 949, 422, 755, 424, 426, 826, 634, -128, -32766, -32766, 469, 824, 54, 288, 812, 1151, 755, 40, 21, 427, 317, 471, 345, 472, 129, 473, 9, 1186, 428, 769, 360, 324, 905, 33, 34, 429, 361, 1046, 415, 35, 474, 944, 1068, 315, 125, 357, 358, 475, 476, -32766, -32766, -32766, 926, 302, 477, 121, 1068, 759, 846, 430, 431, 669, 668, 423, 755, 1152, 809, 1046, 480, 766, -32766, 805, -32766, -32766, -32766, -32766, -261, 127, 347, 436, 841, 341, 1078, 1200, 426, 446, 826, 634, -4, 807, 469, 824, 54, 436, 812, 341, 755, 40, 21, 427, 444, 471, 130, 472, 1068, 473, 346, 767, 428, 768, -211, -211, -211, 33, 34, 429, 361, 308, 1076, 35, 474, -32766, -32766, -32766, 1046, 357, 358, 475, 476, -32766, -32766, -32766, 906, 120, 477, 539, 1068, 795, 846, 430, 431, 436, -32766, 341, -32766, -32766, -32766, 1046, 480, 810, -32766, 925, -32766, -32766, 754, 1080, 1079, 1081, 49, -32766, -32766, -32766, 749, 751, 426, 1201, 826, 634, -211, 30, 469, 669, 668, 436, 812, 341, 75, 40, 21, 427, -32766, 471, 1064, 472, 124, 473, 669, 668, 428, 212, -210, -210, -210, 33, 34, 429, 361, 51, 1186, 35, 474, 755, -32766, -32766, -32766, 357, 358, 475, 476, 213, 824, 54, 221, 222, 477, 20, 581, 795, 846, 430, 431, 220, 221, 222, 755, 222, 247, 78, 79, 80, 81, 341, 207, 517, 103, 104, 105, 752, 307, 131, 637, 1068, 207, 341, 207, 122, 826, 634, -210, 36, 106, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 1112, 307, 346, 436, 214, 341, 824, 54, 426, 123, 250, 129, 134, 106, 469, -32766, 572, 1112, 812, 245, 246, 40, 21, 427, 251, 471, 252, 472, 341, 473, 453, 22, 428, 207, 899, 900, 638, 33, 34, 429, 824, 54, -86, 35, 474, 220, 221, 222, 314, 357, 358, 100, 101, 102, 239, 240, 241, 645, 477, -230, 458, 589, 135, 374, 596, 597, 207, 760, 640, 648, 642, 941, 654, 929, 662, 822, 133, 307, 837, 426, -32766, 106, 749, 43, 44, 469, 45, 442, 46, 812, 826, 634, 40, 21, 427, 47, 471, 50, 472, 53, 473, 132, 608, 428, 302, 604, -280, -32766, 33, 34, 429, 824, 54, 426, 35, 474, 755, 957, -84, 469, 357, 358, 521, 812, 628, 363, 40, 21, 427, 477, 471, 575, 472, -515, 473, 847, 616, 428, -423, -32766, 11, 646, 33, 34, 429, 824, 54, 445, 35, 474, 462, 285, 578, 1111, 357, 358, 593, 369, 848, 594, 290, 826, 634, 477, 0, 0, 532, 0, 0, 325, 0, 0, 0, 0, 0, 651, 0, 0, 0, 322, 326, 0, 0, 0, 426, 0, 0, 0, 0, 323, 469, 316, 318, -516, 812, 862, 634, 40, 21, 427, 0, 471, 0, 472, 0, 473, 1158, 0, 428, 0, -414, 6, 7, 33, 34, 429, 824, 54, 426, 35, 474, 12, 14, 373, 469, 357, 358, -424, 812, 563, 754, 40, 21, 427, 477, 471, 248, 472, 839, 473, 38, 39, 428, 657, 658, 765, 813, 33, 34, 429, 821, 800, 815, 35, 474, 215, 216, 878, 869, 357, 358, 217, 870, 218, 798, 863, 826, 634, 477, 860, 858, 936, 937, 934, 820, 209, 804, 806, 808, 811, 933, 763, 764, 1100, 1101, 935, 659, 78, 335, 426, 359, 1102, 635, 639, 641, 469, 643, 644, 647, 812, 826, 634, 40, 21, 427, 649, 471, 650, 472, 652, 473, 653, 636, 428, 796, 1226, 1228, 762, 33, 34, 429, 215, 216, 845, 35, 474, 761, 217, 844, 218, 357, 358, 1227, 843, 1060, 831, 1048, 842, 1049, 477, 559, 209, 1106, 1107, 1108, 1109, 1103, 1104, 398, 1100, 1101, 829, 942, 867, 1110, 1105, 868, 1102, 457, 1225, 1194, 1192, 1177, 1157, 219, 1190, 1091, 917, 1198, 1188, 0, 826, 634, 24, -433, 26, 31, 37, 42, 76, 77, 210, 287, 292, 293, 308, 309, 310, 311, 339, 356, 416, 0, -227, -226, 16, 17, 18, 393, 454, 461, 463, 467, 553, 625, 1051, 559, 1054, 1106, 1107, 1108, 1109, 1103, 1104, 398, 907, 1116, 1050, 1026, 564, 1110, 1105, 1025, 1093, 1055, 0, 1044, 0, 1057, 1056, 219, 1059, 1058, 1075, 0, 1191, 1176, 1172, 1189, 1090, 1223, 1117, 1171, 600);
    protected $actionCheck = array(2, 3, 4, 5, 6, 7, 14, 9, 10, 11, 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, 53, 54, 55, 9, 10, 57, 30, 116, 32, 33, 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, 72, 73, 74, 75, 76, 77, 135, 136, 80, 33, 34, 35, 36, 37, 38, 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, 31, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 13, 134, 135, 136, 137, 138, 139, 140, 141, 142, 3, 4, 5, 6, 7, 148, 149, 150, 82, 12, 13, 160, 15, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 8, 44, 45, 46, 47, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 80, 33, 34, 35, 36, 50, 51, 13, 9, 10, 11, 56, 128, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, 73, 59, 60, 37, 38, 78, 79, 80, 82, 82, 106, 85, 108, 86, 9, 10, 11, 161, 80, 1, 2, 44, 45, 46, 47, 48, 49, 50, 51, 52, 9, 10, 11, 106, 156, 30, 8, 32, 33, 34, 35, 36, 13, 116, 8, 153, 154, 155, 8, 122, 158, 30, 125, 126, 116, 117, 118, 119, 120, 121, 31, 134, 135, 156, 137, 138, 139, 140, 141, 142, 143, 145, 146, 8, 8, 133, 149, 150, 37, 38, 153, 154, 155, 9, 10, 11, 159, 8, 161, 162, 8, 164, 74, 75, 76, 77, 8, 13, 80, 0, 1, 2, 84, 158, 30, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 13, 98, 9, 10, 11, 9, 103, 104, 105, 106, 8, 70, 109, 110, 9, 10, 11, 8, 115, 116, 117, 118, 70, 30, 31, 37, 38, 124, 31, 8, 127, 128, 129, 130, 8, 30, 156, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 116, 117, 118, 119, 120, 121, 8, 82, 8, 74, 156, 157, 158, 33, 34, 80, 1, 2, 8, 84, 163, 82, 87, 88, 89, 133, 91, 70, 93, 152, 95, 108, 82, 98, 158, 8, 113, 160, 103, 104, 105, 106, 13, 108, 109, 110, 123, 122, 113, 157, 115, 116, 117, 118, 9, 10, 11, 156, 71, 124, 157, 122, 127, 128, 129, 130, 37, 38, 8, 82, 160, 156, 13, 134, 156, 30, 156, 32, 33, 34, 35, 158, 157, 148, 159, 122, 161, 80, 1, 74, 133, 156, 157, 158, 156, 80, 1, 2, 159, 84, 161, 82, 87, 88, 89, 157, 91, 157, 93, 122, 95, 161, 106, 98, 108, 100, 101, 102, 103, 104, 105, 106, 159, 116, 109, 110, 9, 10, 11, 13, 115, 116, 117, 118, 9, 10, 11, 160, 16, 124, 81, 122, 127, 128, 129, 130, 159, 30, 161, 32, 33, 34, 13, 134, 156, 30, 156, 32, 33, 153, 153, 154, 155, 70, 9, 10, 11, 80, 80, 74, 160, 156, 157, 158, 14, 80, 37, 38, 159, 84, 161, 152, 87, 88, 89, 30, 91, 160, 93, 14, 95, 37, 38, 98, 16, 100, 101, 102, 103, 104, 105, 106, 70, 82, 109, 110, 82, 33, 34, 35, 115, 116, 117, 118, 16, 1, 2, 10, 11, 124, 160, 85, 127, 128, 129, 130, 9, 10, 11, 82, 11, 14, 157, 9, 10, 11, 161, 30, 85, 53, 54, 55, 154, 57, 157, 31, 122, 30, 161, 30, 157, 156, 157, 158, 30, 69, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 144, 57, 161, 159, 16, 161, 1, 2, 74, 157, 16, 152, 157, 69, 80, 116, 161, 144, 84, 69, 70, 87, 88, 89, 16, 91, 16, 93, 161, 95, 75, 76, 98, 30, 135, 136, 31, 103, 104, 105, 1, 2, 31, 109, 110, 9, 10, 11, 31, 115, 116, 50, 51, 52, 50, 51, 52, 31, 124, 160, 75, 76, 101, 102, 111, 112, 30, 156, 157, 31, 31, 156, 157, 156, 157, 31, 31, 57, 38, 74, 33, 69, 80, 70, 70, 80, 70, 89, 70, 84, 156, 157, 87, 88, 89, 70, 91, 70, 93, 70, 95, 70, 96, 98, 71, 77, 82, 85, 103, 104, 105, 1, 2, 74, 109, 110, 82, 82, 97, 80, 115, 116, 85, 84, 92, 106, 87, 88, 89, 124, 91, 90, 93, 133, 95, 128, 94, 98, 147, 116, 97, 31, 103, 104, 105, 1, 2, 97, 109, 110, 97, 97, 100, 144, 115, 116, 100, 106, 128, 113, 161, 156, 157, 124, -1, -1, 151, -1, -1, 114, -1, -1, -1, -1, -1, 31, -1, -1, -1, 131, 131, -1, -1, -1, 74, -1, -1, -1, -1, 132, 80, 133, 133, 133, 84, 156, 157, 87, 88, 89, -1, 91, -1, 93, -1, 95, 144, -1, 98, -1, 147, 147, 147, 103, 104, 105, 1, 2, 74, 109, 110, 147, 147, 147, 80, 115, 116, 147, 84, 151, 153, 87, 88, 89, 124, 91, 31, 93, 152, 95, 156, 156, 98, 156, 156, 156, 156, 103, 104, 105, 156, 156, 156, 109, 110, 50, 51, 156, 156, 115, 116, 56, 156, 58, 156, 156, 156, 157, 124, 156, 156, 156, 156, 156, 156, 70, 156, 156, 156, 156, 156, 156, 156, 78, 79, 156, 158, 157, 157, 74, 157, 86, 157, 157, 157, 80, 157, 157, 157, 84, 156, 157, 87, 88, 89, 157, 91, 157, 93, 157, 95, 157, 157, 98, 158, 158, 158, 158, 103, 104, 105, 50, 51, 158, 109, 110, 158, 56, 158, 58, 115, 116, 158, 158, 158, 158, 158, 158, 158, 124, 135, 70, 137, 138, 139, 140, 141, 142, 143, 78, 79, 158, 158, 158, 149, 150, 158, 86, 158, 158, 158, 158, 158, 164, 159, 158, 158, 158, 158, 158, -1, 156, 157, 159, 162, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, -1, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 135, 160, 137, 138, 139, 140, 141, 142, 143, 160, 160, 160, 160, 160, 149, 150, 160, 160, 163, -1, 162, -1, 163, 163, 159, 163, 163, 163, -1, 163, 163, 163, 163, 163, 163, 163, 163, 163);
    protected $actionBase = array(0, 229, 310, 390, 470, 103, 325, 325, 784, -2, -2, 149, -2, -2, -2, 660, 765, 799, 765, 589, 694, 870, 870, 870, 252, 404, 404, 404, 514, 177, 177, 918, 434, 118, 295, 313, 240, 491, 491, 491, 491, 138, 138, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 89, 206, 773, 550, 535, 775, 776, 777, 912, 709, 913, 856, 857, 700, 858, 859, 862, 863, 864, 855, 865, 935, 866, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 322, 592, 285, 319, 232, 44, 691, 691, 691, 691, 691, 691, 691, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 582, 530, 530, 530, 594, 860, 658, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 500, -21, -21, 492, 702, 420, 355, 216, 549, 151, 26, 26, 331, 331, 331, 331, 331, 46, 46, 5, 5, 5, 5, 153, 188, 188, 188, 188, 121, 121, 121, 121, 314, 314, 394, 394, 362, 300, 298, 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, 67, 656, 656, 659, 659, 522, 554, 554, 554, 554, 679, -59, -59, 381, 462, 462, 462, 528, 717, 854, 382, 382, 382, 382, 382, 382, 561, 561, 561, -3, -3, -3, 692, 115, 137, 115, 137, 678, 732, 450, 732, 338, 677, -15, 510, 810, 468, 707, 850, 711, 853, 572, 735, 267, 529, 654, 674, 463, 529, 529, 529, 529, 654, 610, 640, 608, 463, 529, 463, 718, 323, 496, 89, 570, 507, 675, 778, 293, 670, 780, 290, 373, 332, 566, 278, 435, 733, 781, 914, 917, 385, 715, 675, 675, 675, 352, 511, 278, -8, 605, 605, 605, 605, 156, 605, 605, 605, 605, 251, 276, 375, 402, 779, 657, 657, 690, 872, 869, 869, 657, 689, 657, 690, 874, 874, 874, 874, 657, 657, 657, 657, 869, 869, 869, 688, 869, 239, 703, 704, 704, 874, 742, 743, 657, 657, 712, 869, 869, 869, 712, 695, 874, 701, 741, 277, 869, 874, 672, 689, 672, 657, 701, 672, 689, 689, 672, 22, 666, 668, 873, 875, 887, 790, 662, 685, 879, 880, 876, 878, 871, 699, 744, 745, 497, 669, 671, 673, 680, 719, 682, 713, 674, 667, 667, 667, 655, 720, 655, 667, 667, 667, 667, 667, 667, 667, 667, 916, 646, 731, 714, 653, 749, 553, 573, 791, 664, 811, 900, 893, 867, 919, 881, 898, 655, 920, 739, 247, 643, 882, 783, 786, 655, 883, 655, 792, 655, 902, 812, 686, 813, 814, 667, 910, 921, 923, 924, 925, 927, 928, 929, 930, 684, 931, 750, 696, 894, 299, 877, 718, 729, 705, 788, 751, 820, 328, 932, 823, 655, 655, 794, 785, 655, 795, 756, 740, 890, 757, 895, 933, 664, 708, 896, 655, 706, 825, 934, 328, 681, 683, 888, 661, 761, 886, 911, 885, 796, 649, 663, 829, 830, 831, 693, 763, 891, 892, 889, 764, 803, 665, 805, 697, 832, 807, 884, 768, 833, 834, 899, 676, 730, 710, 698, 687, 809, 835, 897, 769, 770, 771, 848, 772, 849, 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, 138, 138, 138, 138, -2, -2, -2, -2, 0, 0, -2, 0, 0, 0, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 0, 0, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 599, -21, -21, -21, -21, 599, -21, -21, -21, -21, -21, -21, -21, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, -21, 599, 599, 599, -21, 382, -21, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 599, 0, 0, 599, -21, 599, -21, 599, -21, -21, 599, 599, 599, 599, 599, 599, 599, -21, -21, -21, -21, -21, -21, 0, 561, 561, 561, 561, -21, -21, -21, -21, 382, 382, 382, 382, 382, 382, 259, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 561, 561, -3, -3, 382, 382, 382, 382, 382, 259, 382, 382, 463, 689, 689, 689, 137, 137, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 463, 0, 463, 0, 382, 463, 689, 463, 657, 137, 689, 689, 463, 869, 616, 616, 616, 616, 328, 278, 0, 0, 689, 689, 0, 0, 0, 0, 0, 689, 0, 0, 0, 0, 0, 0, 869, 0, 0, 0, 0, 0, 667, 247, 0, 705, 335, 0, 0, 0, 0, 0, 0, 705, 335, 347, 347, 0, 684, 667, 667, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328);
    protected $actionDefault = array(3, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 544, 544, 499, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 299, 299, 299, 32767, 32767, 32767, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 32767, 32767, 32767, 32767, 32767, 32767, 383, 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, 32767, 32767, 32767, 32767, 32767, 32767, 389, 549, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 364, 365, 367, 368, 298, 552, 533, 247, 390, 548, 297, 249, 327, 503, 32767, 32767, 32767, 329, 122, 258, 203, 502, 125, 296, 234, 382, 384, 328, 303, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 302, 458, 361, 360, 359, 460, 32767, 459, 496, 496, 499, 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, 325, 487, 486, 326, 456, 330, 457, 333, 461, 464, 331, 332, 349, 350, 347, 348, 351, 462, 463, 480, 481, 478, 479, 301, 352, 353, 354, 355, 482, 483, 484, 485, 32767, 32767, 543, 543, 32767, 32767, 282, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 340, 341, 471, 472, 32767, 238, 238, 238, 238, 283, 238, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 335, 336, 334, 466, 467, 465, 432, 32767, 32767, 32767, 434, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 504, 32767, 32767, 32767, 32767, 32767, 517, 421, 171, 32767, 413, 32767, 171, 171, 171, 171, 32767, 222, 224, 167, 32767, 171, 32767, 490, 32767, 32767, 32767, 32767, 522, 345, 32767, 32767, 116, 32767, 32767, 32767, 559, 32767, 517, 32767, 116, 32767, 32767, 32767, 32767, 358, 337, 338, 339, 32767, 32767, 521, 515, 474, 475, 476, 477, 32767, 468, 469, 470, 473, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 429, 435, 435, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 520, 519, 32767, 414, 498, 188, 186, 186, 32767, 208, 208, 32767, 32767, 190, 491, 510, 32767, 190, 173, 32767, 400, 175, 498, 32767, 32767, 240, 32767, 240, 32767, 400, 240, 32767, 32767, 240, 32767, 415, 439, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 379, 380, 493, 506, 32767, 507, 32767, 413, 343, 344, 346, 322, 32767, 324, 369, 370, 371, 372, 373, 374, 375, 377, 32767, 419, 32767, 422, 32767, 32767, 32767, 257, 32767, 557, 32767, 32767, 306, 557, 32767, 32767, 32767, 551, 32767, 32767, 300, 32767, 32767, 32767, 32767, 253, 32767, 169, 32767, 541, 32767, 558, 32767, 515, 32767, 342, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 516, 32767, 32767, 32767, 32767, 229, 32767, 452, 32767, 116, 32767, 32767, 32767, 189, 32767, 32767, 304, 248, 32767, 32767, 550, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 114, 32767, 170, 32767, 32767, 32767, 191, 32767, 32767, 515, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 295, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 515, 32767, 32767, 233, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 415, 32767, 276, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 127, 127, 3, 127, 127, 260, 3, 260, 127, 260, 260, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 216, 219, 208, 208, 164, 127, 127, 268);
    protected $goto = array(166, 140, 140, 140, 166, 187, 168, 144, 147, 141, 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 138, 159, 160, 161, 162, 184, 139, 185, 494, 495, 377, 496, 500, 501, 502, 503, 504, 505, 506, 507, 970, 164, 145, 146, 148, 171, 176, 186, 203, 253, 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, 395, 396, 543, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, 158, 136, 621, 561, 757, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 1113, 629, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 758, 520, 531, 509, 656, 556, 1183, 750, 509, 592, 786, 1183, 888, 612, 613, 884, 617, 618, 624, 626, 631, 633, 817, 855, 855, 855, 855, 850, 856, 174, 891, 891, 1205, 1205, 177, 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, 498, 498, 498, 498, 498, 498, 861, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 510, 586, 538, 601, 602, 510, 545, 546, 547, 548, 549, 550, 551, 552, 554, 587, 1209, 560, 350, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 400, 607, 537, 537, 569, 533, 909, 535, 535, 497, 499, 525, 541, 570, 573, 584, 591, 298, 296, 296, 296, 298, 289, 299, 611, 378, 511, 614, 595, 947, 375, 511, 437, 437, 437, 437, 437, 437, 1163, 437, 437, 437, 437, 437, 437, 437, 437, 437, 437, 1077, 948, 338, 1175, 321, 1077, 898, 898, 898, 898, 606, 898, 898, 1217, 1217, 1202, 753, 576, 605, 756, 1077, 1077, 1077, 1077, 1077, 1077, 1069, 384, 384, 384, 391, 1217, 877, 859, 857, 859, 655, 466, 512, 886, 881, 753, 384, 753, 384, 968, 384, 895, 385, 588, 353, 414, 384, 1231, 1019, 542, 1197, 1197, 1197, 568, 1094, 386, 386, 386, 904, 915, 515, 1029, 19, 15, 372, 389, 915, 940, 448, 450, 632, 340, 1216, 1216, 1114, 615, 938, 840, 555, 775, 386, 913, 1070, 1073, 1074, 399, 1069, 1182, 660, 23, 1216, 773, 1182, 544, 603, 1066, 1219, 1071, 1174, 1071, 519, 1199, 1199, 1199, 1089, 1088, 1072, 343, 523, 534, 519, 519, 772, 351, 352, 13, 579, 583, 627, 1061, 388, 782, 562, 771, 515, 783, 1181, 3, 4, 918, 956, 865, 451, 574, 1160, 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 514, 529, 0, 0, 0, 0, 514, 0, 529, 0, 0, 0, 0, 610, 513, 516, 439, 440, 1067, 619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 780, 1224, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 778, 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, 301, 301);
    protected $gotoCheck = array(43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 57, 69, 15, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 128, 9, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 102, 32, 69, 32, 32, 120, 6, 69, 32, 29, 120, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 50, 69, 69, 69, 69, 69, 69, 27, 77, 77, 77, 77, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 119, 119, 119, 119, 119, 119, 33, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 67, 110, 67, 67, 119, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 142, 57, 72, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 51, 51, 51, 51, 51, 51, 84, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 5, 5, 5, 5, 5, 5, 5, 63, 46, 124, 63, 129, 98, 63, 124, 57, 57, 57, 57, 57, 57, 133, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 98, 127, 82, 127, 57, 57, 57, 57, 57, 49, 57, 57, 144, 144, 140, 11, 40, 40, 14, 57, 57, 57, 57, 57, 57, 82, 13, 13, 13, 48, 144, 14, 14, 14, 14, 14, 57, 14, 14, 14, 11, 13, 11, 13, 102, 13, 79, 11, 70, 70, 70, 13, 13, 103, 2, 9, 9, 9, 2, 34, 125, 125, 125, 81, 13, 13, 34, 34, 34, 34, 17, 13, 8, 8, 8, 8, 18, 143, 143, 8, 8, 8, 9, 34, 25, 125, 85, 82, 82, 82, 125, 82, 121, 74, 34, 143, 24, 121, 47, 34, 116, 143, 82, 82, 82, 47, 121, 121, 121, 126, 126, 82, 58, 58, 58, 47, 47, 23, 72, 72, 58, 62, 62, 62, 114, 12, 23, 12, 23, 13, 26, 121, 30, 30, 86, 100, 71, 65, 66, 132, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, 9, -1, 9, -1, -1, -1, -1, 13, 9, 9, 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, -1, 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5);
    protected $gotoBase = array(0, 0, -172, 0, 0, 353, 201, 0, 477, 149, 0, 110, 195, 117, 426, 112, 203, 140, 171, 0, 0, 0, 0, 168, 164, 157, 119, 27, 0, 205, -118, 0, -428, 266, 51, 0, 0, 0, 0, 0, 388, 0, 0, -24, 0, 0, 345, 484, 146, 133, 209, 75, 0, 0, 0, 0, 0, 107, 161, 0, 0, 0, 222, -77, 0, 106, 97, -343, 0, -94, 135, 123, -129, 0, 129, 0, 0, -50, 0, 143, 0, 159, 64, 0, 338, 132, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 121, 0, 165, 156, 0, 0, 0, 0, 0, 87, 273, 259, 0, 0, 114, 0, 150, 0, 0, -5, -91, 200, 0, 0, 84, 154, 202, 77, -48, 178, 0, 0, 93, 187, 0, 0, 0, 0, 0, 0, 136, 0, 286, 167, 102, 0, 0);
    protected $gotoDefault = array(-32768, 468, 664, 2, 665, 835, 740, 748, 598, 482, 630, 582, 380, 1193, 792, 793, 794, 381, 368, 483, 379, 410, 405, 781, 774, 776, 784, 172, 411, 787, 1, 789, 518, 825, 1020, 365, 797, 366, 590, 799, 527, 801, 802, 137, 382, 383, 528, 484, 390, 577, 816, 276, 387, 818, 367, 819, 828, 371, 465, 455, 460, 530, 557, 609, 432, 447, 571, 565, 536, 1086, 566, 864, 349, 872, 661, 880, 883, 485, 558, 894, 452, 902, 1099, 397, 908, 914, 919, 291, 922, 417, 412, 585, 927, 928, 5, 932, 622, 623, 8, 312, 955, 599, 969, 420, 1039, 1041, 486, 487, 522, 459, 508, 526, 488, 1062, 441, 413, 1065, 433, 489, 490, 434, 435, 1083, 355, 1168, 354, 449, 320, 1155, 580, 1118, 456, 1208, 1164, 348, 491, 492, 376, 1187, 392, 1203, 438, 1210, 1218, 344, 540, 567);
    protected $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, 8, 8, 9, 10, 11, 11, 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 14, 14, 54, 54, 56, 55, 55, 48, 48, 58, 58, 59, 59, 60, 60, 61, 61, 15, 16, 16, 16, 64, 64, 64, 65, 65, 68, 68, 66, 66, 70, 70, 41, 41, 50, 50, 53, 53, 53, 52, 52, 71, 42, 42, 42, 42, 72, 72, 73, 73, 74, 74, 39, 39, 35, 35, 75, 37, 37, 76, 36, 36, 38, 38, 49, 49, 49, 62, 62, 78, 78, 79, 79, 81, 81, 81, 80, 80, 63, 63, 82, 82, 82, 83, 83, 84, 84, 84, 44, 44, 85, 85, 85, 45, 45, 86, 86, 87, 87, 67, 88, 88, 88, 88, 93, 93, 94, 94, 95, 95, 95, 95, 95, 96, 97, 97, 92, 92, 89, 89, 91, 91, 99, 99, 98, 98, 98, 98, 98, 98, 90, 90, 101, 100, 100, 46, 46, 40, 40, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 34, 34, 47, 47, 106, 106, 107, 107, 107, 107, 113, 102, 102, 109, 109, 115, 115, 116, 117, 118, 118, 118, 118, 118, 118, 118, 69, 69, 57, 57, 57, 57, 103, 103, 122, 122, 119, 119, 123, 123, 123, 123, 104, 104, 104, 108, 108, 108, 114, 114, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 27, 27, 27, 27, 27, 27, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 112, 112, 105, 105, 105, 105, 129, 129, 132, 132, 131, 131, 133, 133, 51, 51, 51, 51, 135, 135, 134, 134, 134, 134, 134, 136, 136, 121, 121, 124, 124, 120, 120, 138, 137, 137, 137, 137, 125, 125, 125, 125, 111, 111, 126, 126, 126, 126, 77, 139, 139, 140, 140, 140, 110, 110, 141, 141, 142, 142, 142, 142, 142, 127, 127, 127, 127, 144, 145, 143, 143, 143, 143, 143, 143, 143, 146, 146, 146);
    protected $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, 3, 5, 4, 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, 3, 0, 1, 0, 1, 0, 1, 1, 1, 10, 7, 6, 5, 1, 2, 2, 0, 2, 0, 2, 0, 2, 1, 3, 1, 4, 1, 4, 1, 1, 4, 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, 1, 1, 1, 4, 0, 2, 3, 0, 2, 4, 0, 2, 0, 3, 1, 2, 1, 1, 0, 1, 3, 4, 6, 1, 1, 1, 0, 1, 0, 2, 2, 3, 3, 1, 3, 1, 2, 2, 3, 1, 1, 2, 4, 3, 1, 1, 3, 2, 0, 1, 3, 3, 9, 3, 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, 1, 1, 1, 3, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 0, 1, 1, 3, 3, 4, 4, 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, 1, 3, 5, 4, 3, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, 2, 1, 2, 10, 11, 3, 3, 2, 4, 4, 3, 4, 4, 4, 4, 7, 3, 2, 0, 4, 1, 3, 2, 1, 2, 2, 4, 6, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 0, 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 3, 1, 4, 3, 1, 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, 5, 4, 4, 3, 1, 3, 1, 1, 3, 3, 0, 2, 0, 1, 3, 1, 3, 1, 1, 1, 1, 1, 6, 4, 3, 4, 2, 4, 4, 1, 3, 1, 2, 1, 1, 4, 1, 1, 3, 6, 4, 4, 4, 4, 1, 4, 0, 1, 1, 3, 1, 1, 4, 3, 1, 1, 1, 0, 0, 2, 3, 1, 3, 1, 4, 2, 2, 2, 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, 6, 3, 1, 1, 1);
    protected function initReduceCallbacks()
    {
        $this->reduceCallbacks = [0 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 1 => function ($stackPos) {
            $this->semValue = $this->handleNamespaces($this->semStack[$stackPos - (1 - 1)]);
        }, 2 => function ($stackPos) {
            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
            } else {
                $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) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 5 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 6 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 7 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 8 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 9 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 10 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 11 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 12 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 13 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 14 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 15 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 16 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 17 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 18 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 19 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 20 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 21 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 22 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 23 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 24 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 25 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 26 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 27 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 28 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 29 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 30 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 31 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 32 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 33 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 34 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 35 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 36 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 37 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 38 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 39 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 40 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 41 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 42 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 43 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 44 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 45 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 46 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 47 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 48 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 49 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 50 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 51 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 52 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 53 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 54 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 55 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 56 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 57 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 58 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 59 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 60 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 61 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 62 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 63 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 64 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 65 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 66 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 67 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 68 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 69 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 70 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 71 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 72 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 73 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 74 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 75 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 76 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 77 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 78 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 79 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 80 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 81 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 82 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 83 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 84 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 85 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 86 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 87 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 88 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 89 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 90 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 91 => function ($stackPos) {
            $this->semValue = new Name(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 92 => function ($stackPos) {
            $this->semValue = new Expr\Variable(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 93 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 94 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 95 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 96 => function ($stackPos) {
            $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 97 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (3 - 2)], null, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
            $this->checkNamespace($this->semValue);
        }, 98 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
            $this->checkNamespace($this->semValue);
        }, 99 => function ($stackPos) {
            $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
            $this->checkNamespace($this->semValue);
        }, 100 => function ($stackPos) {
            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (3 - 2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 101 => function ($stackPos) {
            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 102 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 103 => function ($stackPos) {
            $this->semValue = new Stmt\Const_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 104 => function ($stackPos) {
            $this->semValue = Stmt\Use_::TYPE_FUNCTION;
        }, 105 => function ($stackPos) {
            $this->semValue = Stmt\Use_::TYPE_CONSTANT;
        }, 106 => function ($stackPos) {
            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->semStack[$stackPos - (7 - 2)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 107 => function ($stackPos) {
            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 108 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 109 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 110 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 111 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 112 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 113 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 114 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
        }, 115 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
        }, 116 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
        }, 117 => function ($stackPos) {
            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
        }, 118 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
            $this->semValue->type = Stmt\Use_::TYPE_NORMAL;
        }, 119 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue->type = $this->semStack[$stackPos - (2 - 1)];
        }, 120 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 121 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 122 => function ($stackPos) {
            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 123 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 124 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 125 => function ($stackPos) {
            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 126 => function ($stackPos) {
            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
            } else {
                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
            }
        }, 127 => function ($stackPos) {
            $this->semValue = array();
        }, 128 => function ($stackPos) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 129 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 130 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 131 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 132 => function ($stackPos) {
            throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 133 => function ($stackPos) {
            if ($this->semStack[$stackPos - (3 - 2)]) {
                $this->semValue = $this->semStack[$stackPos - (3 - 2)];
                $attrs = $this->startAttributeStack[$stackPos - (3 - 1)];
                $stmts = $this->semValue;
                if (!empty($attrs['comments'])) {
                    $stmts[0]->setAttribute('comments', \array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', [])));
                }
            } else {
                $startAttributes = $this->startAttributeStack[$stackPos - (3 - 1)];
                if (isset($startAttributes['comments'])) {
                    $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
                } else {
                    $this->semValue = null;
                }
                if (null === $this->semValue) {
                    $this->semValue = array();
                }
            }
        }, 134 => function ($stackPos) {
            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (5 - 2)], ['stmts' => \is_array($this->semStack[$stackPos - (5 - 3)]) ? $this->semStack[$stackPos - (5 - 3)] : array($this->semStack[$stackPos - (5 - 3)]), 'elseifs' => $this->semStack[$stackPos - (5 - 4)], 'else' => $this->semStack[$stackPos - (5 - 5)]], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 135 => function ($stackPos) {
            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (8 - 2)], ['stmts' => $this->semStack[$stackPos - (8 - 4)], 'elseifs' => $this->semStack[$stackPos - (8 - 5)], 'else' => $this->semStack[$stackPos - (8 - 6)]], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 136 => function ($stackPos) {
            $this->semValue = new Stmt\While_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 137 => function ($stackPos) {
            $this->semValue = new Stmt\Do_($this->semStack[$stackPos - (5 - 4)], \is_array($this->semStack[$stackPos - (5 - 2)]) ? $this->semStack[$stackPos - (5 - 2)] : array($this->semStack[$stackPos - (5 - 2)]), $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 138 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 139 => function ($stackPos) {
            $this->semValue = new Stmt\Switch_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 140 => function ($stackPos) {
            $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 141 => function ($stackPos) {
            $this->semValue = new Stmt\Break_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 142 => function ($stackPos) {
            $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 143 => function ($stackPos) {
            $this->semValue = new Stmt\Continue_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 144 => function ($stackPos) {
            $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 145 => function ($stackPos) {
            $this->semValue = new Stmt\Return_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 146 => function ($stackPos) {
            $this->semValue = new Stmt\Global_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 147 => function ($stackPos) {
            $this->semValue = new Stmt\Static_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 148 => function ($stackPos) {
            $this->semValue = new Stmt\Echo_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 149 => function ($stackPos) {
            $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 150 => function ($stackPos) {
            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 151 => function ($stackPos) {
            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 152 => function ($stackPos) {
            $this->semValue = new Stmt\Unset_($this->semStack[$stackPos - (5 - 3)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 153 => 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->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
        }, 154 => 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->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
        }, 155 => function ($stackPos) {
            $this->semValue = new Stmt\Declare_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 156 => function ($stackPos) {
            $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 5)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
            $this->checkTryCatch($this->semValue);
        }, 157 => function ($stackPos) {
            $this->semValue = new Stmt\Throw_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 158 => function ($stackPos) {
            $this->semValue = new Stmt\Goto_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 159 => function ($stackPos) {
            $this->semValue = new Stmt\Label($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 160 => function ($stackPos) {
            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 161 => function ($stackPos) {
            $this->semValue = array();
        }, 162 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 163 => function ($stackPos) {
            $startAttributes = $this->startAttributeStack[$stackPos - (1 - 1)];
            if (isset($startAttributes['comments'])) {
                $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
            } else {
                $this->semValue = null;
            }
            if ($this->semValue === null) {
                $this->semValue = array();
            }
        }, 164 => function ($stackPos) {
            $this->semValue = array();
        }, 165 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 166 => function ($stackPos) {
            $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos - (8 - 3)]), $this->semStack[$stackPos - (8 - 4)], $this->semStack[$stackPos - (8 - 7)], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
        }, 167 => function ($stackPos) {
            $this->semValue = null;
        }, 168 => function ($stackPos) {
            $this->semValue = new Stmt\Finally_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 169 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 170 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 171 => function ($stackPos) {
            $this->semValue = \false;
        }, 172 => function ($stackPos) {
            $this->semValue = \true;
        }, 173 => function ($stackPos) {
            $this->semValue = \false;
        }, 174 => function ($stackPos) {
            $this->semValue = \true;
        }, 175 => function ($stackPos) {
            $this->semValue = \false;
        }, 176 => function ($stackPos) {
            $this->semValue = \true;
        }, 177 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 178 => function ($stackPos) {
            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 179 => function ($stackPos) {
            $this->semValue = new Stmt\Function_($this->semStack[$stackPos - (10 - 3)], ['byRef' => $this->semStack[$stackPos - (10 - 2)], 'params' => $this->semStack[$stackPos - (10 - 5)], 'returnType' => $this->semStack[$stackPos - (10 - 7)], 'stmts' => $this->semStack[$stackPos - (10 - 9)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
        }, 180 => 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)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
            $this->checkClass($this->semValue, $stackPos - (7 - 2));
        }, 181 => function ($stackPos) {
            $this->semValue = new Stmt\Interface_($this->semStack[$stackPos - (6 - 2)], ['extends' => $this->semStack[$stackPos - (6 - 3)], 'stmts' => $this->semStack[$stackPos - (6 - 5)]], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
            $this->checkInterface($this->semValue, $stackPos - (6 - 2));
        }, 182 => function ($stackPos) {
            $this->semValue = new Stmt\Trait_($this->semStack[$stackPos - (5 - 2)], ['stmts' => $this->semStack[$stackPos - (5 - 4)]], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 183 => function ($stackPos) {
            $this->semValue = 0;
        }, 184 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
        }, 185 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
        }, 186 => function ($stackPos) {
            $this->semValue = null;
        }, 187 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 188 => function ($stackPos) {
            $this->semValue = array();
        }, 189 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 190 => function ($stackPos) {
            $this->semValue = array();
        }, 191 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 192 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 193 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 194 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 195 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 196 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 197 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 198 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 199 => function ($stackPos) {
            $this->semValue = null;
        }, 200 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 201 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 202 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 203 => function ($stackPos) {
            $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 204 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 205 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
        }, 206 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 207 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (5 - 3)];
        }, 208 => function ($stackPos) {
            $this->semValue = array();
        }, 209 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 210 => function ($stackPos) {
            $this->semValue = new Stmt\Case_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 211 => function ($stackPos) {
            $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 212 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 213 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 214 => function ($stackPos) {
            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
        }, 215 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
        }, 216 => function ($stackPos) {
            $this->semValue = array();
        }, 217 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 218 => function ($stackPos) {
            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (3 - 2)], \is_array($this->semStack[$stackPos - (3 - 3)]) ? $this->semStack[$stackPos - (3 - 3)] : array($this->semStack[$stackPos - (3 - 3)]), $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 219 => function ($stackPos) {
            $this->semValue = array();
        }, 220 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 221 => function ($stackPos) {
            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 222 => function ($stackPos) {
            $this->semValue = null;
        }, 223 => function ($stackPos) {
            $this->semValue = new Stmt\Else_(\is_array($this->semStack[$stackPos - (2 - 2)]) ? $this->semStack[$stackPos - (2 - 2)] : array($this->semStack[$stackPos - (2 - 2)]), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 224 => function ($stackPos) {
            $this->semValue = null;
        }, 225 => function ($stackPos) {
            $this->semValue = new Stmt\Else_($this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 226 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
        }, 227 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (2 - 2)], \true);
        }, 228 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
        }, 229 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 230 => function ($stackPos) {
            $this->semValue = array();
        }, 231 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 232 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 233 => function ($stackPos) {
            $this->semValue = new Node\Param($this->semStack[$stackPos - (4 - 4)], null, $this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
            $this->checkParam($this->semValue);
        }, 234 => function ($stackPos) {
            $this->semValue = new Node\Param($this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 6)], $this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 3)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
            $this->checkParam($this->semValue);
        }, 235 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 236 => function ($stackPos) {
            $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 237 => function ($stackPos) {
            $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 238 => function ($stackPos) {
            $this->semValue = null;
        }, 239 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 240 => function ($stackPos) {
            $this->semValue = null;
        }, 241 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
        }, 242 => function ($stackPos) {
            $this->semValue = array();
        }, 243 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 244 => function ($stackPos) {
            $this->semValue = array(new Node\Arg($this->semStack[$stackPos - (3 - 2)], \false, \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes));
        }, 245 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 246 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 247 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (1 - 1)], \false, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 248 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \true, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 249 => function ($stackPos) {
            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \false, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 250 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 251 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 252 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 253 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 254 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 255 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 256 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 257 => function ($stackPos) {
            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 258 => function ($stackPos) {
            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 259 => 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)];
            }
        }, 260 => function ($stackPos) {
            $this->semValue = array();
        }, 261 => function ($stackPos) {
            $startAttributes = $this->lookaheadStartAttributes;
            if (isset($startAttributes['comments'])) {
                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
            } else {
                $nop = null;
            }
            if ($nop !== null) {
                $this->semStack[$stackPos - (1 - 1)][] = $nop;
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 262 => function ($stackPos) {
            $this->semValue = new Stmt\Property($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
            $this->checkProperty($this->semValue, $stackPos - (3 - 1));
        }, 263 => function ($stackPos) {
            $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos - (3 - 2)], 0, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 264 => function ($stackPos) {
            $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos - (9 - 4)], ['type' => $this->semStack[$stackPos - (9 - 1)], 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 6)], 'returnType' => $this->semStack[$stackPos - (9 - 8)], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
            $this->checkClassMethod($this->semValue, $stackPos - (9 - 1));
        }, 265 => function ($stackPos) {
            $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 266 => function ($stackPos) {
            $this->semValue = array();
        }, 267 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 268 => function ($stackPos) {
            $this->semValue = array();
        }, 269 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 270 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 271 => 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->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 272 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 273 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 274 => 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->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 275 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
        }, 276 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 277 => function ($stackPos) {
            $this->semValue = array(null, $this->semStack[$stackPos - (1 - 1)]);
        }, 278 => function ($stackPos) {
            $this->semValue = null;
        }, 279 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 280 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 281 => function ($stackPos) {
            $this->semValue = 0;
        }, 282 => function ($stackPos) {
            $this->semValue = 0;
        }, 283 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 284 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 285 => 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)];
        }, 286 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
        }, 287 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
        }, 288 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
        }, 289 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_STATIC;
        }, 290 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
        }, 291 => function ($stackPos) {
            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
        }, 292 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 293 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 294 => function ($stackPos) {
            $this->semValue = new Node\VarLikeIdentifier(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 295 => function ($stackPos) {
            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 296 => function ($stackPos) {
            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 297 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 298 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 299 => function ($stackPos) {
            $this->semValue = array();
        }, 300 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 301 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 302 => function ($stackPos) {
            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 303 => function ($stackPos) {
            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 304 => function ($stackPos) {
            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 305 => function ($stackPos) {
            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 306 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 307 => function ($stackPos) {
            $this->semValue = new Expr\Clone_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 308 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 309 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 310 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 311 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 312 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 313 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 314 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 315 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 316 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 317 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 318 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 319 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 320 => function ($stackPos) {
            $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 321 => function ($stackPos) {
            $this->semValue = new Expr\PostInc($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 322 => function ($stackPos) {
            $this->semValue = new Expr\PreInc($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 323 => function ($stackPos) {
            $this->semValue = new Expr\PostDec($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 324 => function ($stackPos) {
            $this->semValue = new Expr\PreDec($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 325 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 326 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 327 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 328 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 329 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 330 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 331 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 332 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 333 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 334 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 335 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 336 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 337 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 338 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 339 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 340 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 341 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 342 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 343 => function ($stackPos) {
            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 344 => function ($stackPos) {
            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 345 => function ($stackPos) {
            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 346 => function ($stackPos) {
            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 347 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 348 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 349 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 350 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 351 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 352 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 353 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 354 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 355 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 356 => function ($stackPos) {
            $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 357 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 358 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 359 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 360 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 361 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 362 => function ($stackPos) {
            $this->semValue = new Expr\Isset_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 363 => function ($stackPos) {
            $this->semValue = new Expr\Empty_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 364 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 365 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 366 => function ($stackPos) {
            $this->semValue = new Expr\Eval_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 367 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 368 => function ($stackPos) {
            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 369 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 370 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
            $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos - (2 - 1)]);
            $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos - (2 - 2)], $attrs);
        }, 371 => function ($stackPos) {
            $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 372 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 373 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 374 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 375 => function ($stackPos) {
            $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 376 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
            $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);
        }, 377 => function ($stackPos) {
            $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 378 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 379 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 380 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 381 => function ($stackPos) {
            $this->semValue = new Expr\ShellExec($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 382 => function ($stackPos) {
            $this->semValue = new Expr\Print_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 383 => function ($stackPos) {
            $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 384 => function ($stackPos) {
            $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 385 => function ($stackPos) {
            $this->semValue = new Expr\Closure(['static' => \false, 'byRef' => $this->semStack[$stackPos - (10 - 2)], 'params' => $this->semStack[$stackPos - (10 - 4)], 'uses' => $this->semStack[$stackPos - (10 - 6)], 'returnType' => $this->semStack[$stackPos - (10 - 7)], 'stmts' => $this->semStack[$stackPos - (10 - 9)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
        }, 386 => function ($stackPos) {
            $this->semValue = new Expr\Closure(['static' => \true, 'byRef' => $this->semStack[$stackPos - (11 - 3)], 'params' => $this->semStack[$stackPos - (11 - 5)], 'uses' => $this->semStack[$stackPos - (11 - 7)], 'returnType' => $this->semStack[$stackPos - (11 - 8)], 'stmts' => $this->semStack[$stackPos - (11 - 10)]], $this->startAttributeStack[$stackPos - (11 - 1)] + $this->endAttributes);
        }, 387 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 388 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 389 => function ($stackPos) {
            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (2 - 2)], null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 390 => function ($stackPos) {
            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 391 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes;
            $attrs['kind'] = Expr\Array_::KIND_LONG;
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $attrs);
        }, 392 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
            $attrs['kind'] = Expr\Array_::KIND_SHORT;
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $attrs);
        }, 393 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 394 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch(Scalar\String_::fromString($this->semStack[$stackPos - (4 - 1)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes), $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 395 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 396 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 397 => function ($stackPos) {
            $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos - (7 - 3)], 'implements' => $this->semStack[$stackPos - (7 - 4)], 'stmts' => $this->semStack[$stackPos - (7 - 6)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes), $this->semStack[$stackPos - (7 - 2)]);
            $this->checkClass($this->semValue[0], -1);
        }, 398 => function ($stackPos) {
            $this->semValue = new Expr\New_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 399 => function ($stackPos) {
            list($class, $ctorArgs) = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 400 => function ($stackPos) {
            $this->semValue = array();
        }, 401 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
        }, 402 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 403 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 404 => function ($stackPos) {
            $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos - (2 - 2)], $this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 405 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 406 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 407 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 408 => function ($stackPos) {
            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 409 => function ($stackPos) {
            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 410 => function ($stackPos) {
            $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 411 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 412 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 413 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 414 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 415 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 416 => function ($stackPos) {
            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 417 => function ($stackPos) {
            $this->semValue = new Name\FullyQualified(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 418 => function ($stackPos) {
            $this->semValue = new Name\Relative(\substr($this->semStack[$stackPos - (1 - 1)], 10), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 419 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 420 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 421 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 422 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 423 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 424 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 425 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 426 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 427 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 428 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 429 => function ($stackPos) {
            $this->semValue = null;
        }, 430 => function ($stackPos) {
            $this->semValue = null;
        }, 431 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 432 => function ($stackPos) {
            $this->semValue = array();
        }, 433 => function ($stackPos) {
            $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos - (1 - 1)], '`', \false), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
        }, 434 => function ($stackPos) {
            foreach ($this->semStack[$stackPos - (1 - 1)] as $s) {
                if ($s instanceof Node\Scalar\EncapsedStringPart) {
                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', \false);
                }
            }
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 435 => function ($stackPos) {
            $this->semValue = array();
        }, 436 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 437 => function ($stackPos) {
            $this->semValue = $this->parseLNumber($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes, \true);
        }, 438 => function ($stackPos) {
            $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 439 => function ($stackPos) {
            $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes, \false);
        }, 440 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 441 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 442 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 443 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 444 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 445 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 446 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 447 => function ($stackPos) {
            $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 448 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \false);
        }, 449 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (2 - 1)], '', $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (2 - 2)] + $this->endAttributeStack[$stackPos - (2 - 2)], \false);
        }, 450 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 451 => function ($stackPos) {
            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 452 => function ($stackPos) {
            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 453 => function ($stackPos) {
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 454 => function ($stackPos) {
            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 455 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 456 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 457 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 458 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 459 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 460 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 461 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 462 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 463 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 464 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 465 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 466 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 467 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 468 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 469 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 470 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 471 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 472 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 473 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 474 => function ($stackPos) {
            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 475 => function ($stackPos) {
            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 476 => function ($stackPos) {
            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 477 => function ($stackPos) {
            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 478 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 479 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 480 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 481 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 482 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 483 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 484 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 485 => function ($stackPos) {
            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 486 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
        }, 487 => function ($stackPos) {
            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 488 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 489 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 490 => function ($stackPos) {
            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 491 => function ($stackPos) {
            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 492 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 493 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 494 => function ($stackPos) {
            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
            $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
            foreach ($this->semStack[$stackPos - (3 - 2)] as $s) {
                if ($s instanceof Node\Scalar\EncapsedStringPart) {
                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', \true);
                }
            }
            $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos - (3 - 2)], $attrs);
        }, 495 => function ($stackPos) {
            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
        }, 496 => function ($stackPos) {
            $this->semValue = array();
        }, 497 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 498 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 499 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos];
        }, 500 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 501 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 502 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 503 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 504 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 505 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 506 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 507 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 508 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 509 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 510 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 511 => function ($stackPos) {
            $this->semValue = new Expr\MethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 512 => function ($stackPos) {
            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 513 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 514 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 515 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 516 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 517 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 518 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 519 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 520 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 521 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 522 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 523 => function ($stackPos) {
            $var = \substr($this->semStack[$stackPos - (1 - 1)], 1);
            $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes) : $var;
        }, 524 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 525 => function ($stackPos) {
            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 526 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 527 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 528 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 529 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 530 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 531 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 532 => function ($stackPos) {
            $this->semValue = null;
        }, 533 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 534 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 535 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 536 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 537 => function ($stackPos) {
            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
            $this->errorState = 2;
        }, 538 => function ($stackPos) {
            $this->semValue = new Expr\List_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 539 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 540 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 541 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 542 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 543 => function ($stackPos) {
            $this->semValue = null;
        }, 544 => function ($stackPos) {
            $this->semValue = array();
        }, 545 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 546 => function ($stackPos) {
            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
        }, 547 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 548 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 549 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 550 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 1)], \true, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 551 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 552 => function ($stackPos) {
            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
        }, 553 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 554 => function ($stackPos) {
            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
        }, 555 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
        }, 556 => function ($stackPos) {
            $this->semValue = array($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
        }, 557 => function ($stackPos) {
            $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 558 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 559 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }, 560 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
        }, 561 => function ($stackPos) {
            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 562 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 563 => function ($stackPos) {
            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
        }, 564 => function ($stackPos) {
            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 4)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
        }, 565 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
        }, 566 => function ($stackPos) {
            $this->semValue = new Scalar\String_($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 567 => function ($stackPos) {
            $this->semValue = $this->parseNumString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
        }, 568 => function ($stackPos) {
            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
        }];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

abstract class NodeAbstract implements Node, \JsonSerializable
{
    protected $attributes;
    public function __construct(array $attributes = [])
    {
        $this->attributes = $attributes;
    }
    public function getLine() : int
    {
        return $this->attributes['startLine'] ?? -1;
    }
    public function getStartLine() : int
    {
        return $this->attributes['startLine'] ?? -1;
    }
    public function getEndLine() : int
    {
        return $this->attributes['endLine'] ?? -1;
    }
    public function getStartTokenPos() : int
    {
        return $this->attributes['startTokenPos'] ?? -1;
    }
    public function getEndTokenPos() : int
    {
        return $this->attributes['endTokenPos'] ?? -1;
    }
    public function getStartFilePos() : int
    {
        return $this->attributes['startFilePos'] ?? -1;
    }
    public function getEndFilePos() : int
    {
        return $this->attributes['endFilePos'] ?? -1;
    }
    public function getComments() : array
    {
        return $this->attributes['comments'] ?? [];
    }
    public function getDocComment()
    {
        $comments = $this->getComments();
        for ($i = \count($comments) - 1; $i >= 0; $i--) {
            $comment = $comments[$i];
            if ($comment instanceof Comment\Doc) {
                return $comment;
            }
        }
        return null;
    }
    public function setDocComment(Comment\Doc $docComment)
    {
        $comments = $this->getComments();
        for ($i = \count($comments) - 1; $i >= 0; $i--) {
            if ($comments[$i] instanceof Comment\Doc) {
                $comments[$i] = $docComment;
                $this->setAttribute('comments', $comments);
                return;
            }
        }
        $comments[] = $docComment;
        $this->setAttribute('comments', $comments);
    }
    public function setAttribute(string $key, $value)
    {
        $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)
    {
        $this->attributes = $attributes;
    }
    public function jsonSerialize() : array
    {
        return ['nodeType' => $this->getType()] + \get_object_vars($this);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface Node
{
    public function getType() : string;
    public function getSubNodeNames() : array;
    public function getLine() : int;
    public function getStartLine() : int;
    public function getEndLine() : int;
    public function getStartTokenPos() : int;
    public function getEndTokenPos() : int;
    public function getStartFilePos() : int;
    public function getEndFilePos() : int;
    public function getComments() : array;
    public function getDocComment();
    public function setDocComment(Comment\Doc $docComment);
    public function setAttribute(string $key, $value);
    public function hasAttribute(string $key) : bool;
    public function getAttribute(string $key, $default = null);
    public function getAttributes() : array;
    public function setAttributes(array $attributes);
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\ErrorHandler;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\ErrorHandler;
class Throwing implements ErrorHandler
{
    public function handleError(Error $error)
    {
        throw $error;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\ErrorHandler;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\ErrorHandler;
class Collecting implements ErrorHandler
{
    private $errors = [];
    public function handleError(Error $error)
    {
        $this->errors[] = $error;
    }
    public function getErrors() : array
    {
        return $this->errors;
    }
    public function hasErrors() : bool
    {
        return !empty($this->errors);
    }
    public function clearErrors()
    {
        $this->errors = [];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class JsonDecoder
{
    private $reflectionClassCache;
    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);
    }
    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);
    }
    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];
    }
    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}\"");
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class Error extends \RuntimeException
{
    protected $rawMessage;
    protected $attributes;
    public function __construct(string $message, $attributes = [])
    {
        $this->rawMessage = $message;
        if (\is_array($attributes)) {
            $this->attributes = $attributes;
        } else {
            $this->attributes = ['startLine' => $attributes];
        }
        $this->updateMessage();
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
    public function getStartLine() : int
    {
        return $this->attributes['startLine'] ?? -1;
    }
    public function getEndLine() : int
    {
        return $this->attributes['endLine'] ?? -1;
    }
    public function getAttributes() : array
    {
        return $this->attributes;
    }
    public function setAttributes(array $attributes)
    {
        $this->attributes = $attributes;
        $this->updateMessage();
    }
    public function setRawMessage(string $message)
    {
        $this->rawMessage = $message;
        $this->updateMessage();
    }
    public function setStartLine(int $line)
    {
        $this->attributes['startLine'] = $line;
        $this->updateMessage();
    }
    public function hasColumnInfo() : bool
    {
        return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']);
    }
    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']);
    }
    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']);
    }
    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));
    }
    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;
    }
    protected function updateMessage()
    {
        $this->message = $this->rawMessage;
        if (-1 === $this->getStartLine()) {
            $this->message .= ' on unknown line';
        } else {
            $this->message .= ' on line ' . $this->getStartLine();
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class Comment implements \JsonSerializable
{
    protected $text;
    protected $startLine;
    protected $startFilePos;
    protected $startTokenPos;
    protected $endLine;
    protected $endFilePos;
    protected $endTokenPos;
    public function __construct(string $text, int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1, int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1)
    {
        $this->text = $text;
        $this->startLine = $startLine;
        $this->startFilePos = $startFilePos;
        $this->startTokenPos = $startTokenPos;
        $this->endLine = $endLine;
        $this->endFilePos = $endFilePos;
        $this->endTokenPos = $endTokenPos;
    }
    public function getText() : string
    {
        return $this->text;
    }
    public function getStartLine() : int
    {
        return $this->startLine;
    }
    public function getStartFilePos() : int
    {
        return $this->startFilePos;
    }
    public function getStartTokenPos() : int
    {
        return $this->startTokenPos;
    }
    public function getEndLine() : int
    {
        return $this->endLine;
    }
    public function getEndFilePos() : int
    {
        return $this->endFilePos;
    }
    public function getEndTokenPos() : int
    {
        return $this->endTokenPos;
    }
    public function getLine() : int
    {
        return $this->startLine;
    }
    public function getFilePos() : int
    {
        return $this->startFilePos;
    }
    public function getTokenPos() : int
    {
        return $this->startTokenPos;
    }
    public function __toString() : string
    {
        return $this->text;
    }
    public function getReformattedText()
    {
        $text = \trim($this->text);
        $newlinePos = \strpos($text, "\n");
        if (\false === $newlinePos) {
            return $text;
        } elseif (\preg_match('((*BSR_ANYCRLF)(*ANYCRLF)^.*(?:\\R\\s+\\*.*)+$)', $text)) {
            return \preg_replace('(^\\s+\\*)m', ' *', $this->text);
        } elseif (\preg_match('(^/\\*\\*?\\s*[\\r\\n])', $text) && \preg_match('(\\n(\\s*)\\*/$)', $text, $matches)) {
            return \preg_replace('(^' . \preg_quote($matches[1]) . ')m', '', $text);
        } elseif (\preg_match('(^/\\*\\*?\\s*(?!\\s))', $text, $matches)) {
            $prefixLen = $this->getShortestWhitespacePrefixLen(\substr($text, $newlinePos + 1));
            $removeLen = $prefixLen - \strlen($matches[0]);
            return \preg_replace('(^\\s{' . $removeLen . '})m', '', $text);
        }
        return $text;
    }
    private function getShortestWhitespacePrefixLen(string $str) : int
    {
        $lines = \explode("\n", $str);
        $shortestPrefixLen = \INF;
        foreach ($lines as $line) {
            \preg_match('(^\\s*)', $line, $matches);
            $prefixLen = \strlen($matches[0]);
            if ($prefixLen < $shortestPrefixLen) {
                $shortestPrefixLen = $prefixLen;
            }
        }
        return $shortestPrefixLen;
    }
    /**
    @psalm-return
    */
    public function jsonSerialize() : array
    {
        $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment';
        return ['nodeType' => $type, 'text' => $this->text, 'line' => $this->startLine, 'filePos' => $this->startFilePos, 'tokenPos' => $this->startTokenPos, 'endLine' => $this->endLine, 'endFilePos' => $this->endFilePos, 'endTokenPos' => $this->endTokenPos];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Parser\Tokens;
class Lexer
{
    protected $code;
    protected $tokens;
    protected $pos;
    protected $line;
    protected $filePos;
    protected $prevCloseTagHasNewline;
    protected $tokenMap;
    protected $dropTokens;
    protected $identifierTokens;
    private $attributeStartLineUsed;
    private $attributeEndLineUsed;
    private $attributeStartTokenPosUsed;
    private $attributeEndTokenPosUsed;
    private $attributeStartFilePosUsed;
    private $attributeEndFilePosUsed;
    private $attributeCommentsUsed;
    public function __construct(array $options = [])
    {
        $this->defineCompatibilityTokens();
        $this->tokenMap = $this->createTokenMap();
        $this->identifierTokens = $this->createIdentifierTokenMap();
        $this->dropTokens = \array_fill_keys([\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1);
        $defaultAttributes = ['comments', 'startLine', 'endLine'];
        $usedAttributes = \array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, \true);
        $this->attributeStartLineUsed = isset($usedAttributes['startLine']);
        $this->attributeEndLineUsed = isset($usedAttributes['endLine']);
        $this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']);
        $this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']);
        $this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']);
        $this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']);
        $this->attributeCommentsUsed = isset($usedAttributes['comments']);
    }
    public function startLexing(string $code, ErrorHandler $errorHandler = null)
    {
        if (null === $errorHandler) {
            $errorHandler = new ErrorHandler\Throwing();
        }
        $this->code = $code;
        $this->pos = -1;
        $this->line = 1;
        $this->filePos = 0;
        $this->prevCloseTagHasNewline = \true;
        $scream = \ini_set('xdebug.scream', '0');
        $this->tokens = @\token_get_all($code);
        $this->postprocessTokens($errorHandler);
        if (\false !== $scream) {
            \ini_set('xdebug.scream', $scream);
        }
    }
    private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler)
    {
        $tokens = [];
        for ($i = $start; $i < $end; $i++) {
            $chr = $this->code[$i];
            if ($chr === "\x00") {
                $errorMsg = 'Unexpected null byte';
            } else {
                $errorMsg = \sprintf('Unexpected character "%s" (ASCII %d)', $chr, \ord($chr));
            }
            $tokens[] = [\T_BAD_CHARACTER, $chr, $line];
            $errorHandler->handleError(new Error($errorMsg, ['startLine' => $line, 'endLine' => $line, 'startFilePos' => $i, 'endFilePos' => $i]));
        }
        return $tokens;
    }
    private function isUnterminatedComment($token) : bool
    {
        return ($token[0] === \T_COMMENT || $token[0] === \T_DOC_COMMENT) && \substr($token[1], 0, 2) === '/*' && \substr($token[1], -2) !== '*/';
    }
    protected function postprocessTokens(ErrorHandler $errorHandler)
    {
        $filePos = 0;
        $line = 1;
        $numTokens = \count($this->tokens);
        for ($i = 0; $i < $numTokens; $i++) {
            $token = $this->tokens[$i];
            if ($token[0] === \T_BAD_CHARACTER) {
                $this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler);
            }
            if ($token[0] === \T_COMMENT && \substr($token[1], 0, 2) !== '/*' && \preg_match('/(\\r\\n|\\n|\\r)$/D', $token[1], $matches)) {
                $trailingNewline = $matches[0];
                $token[1] = \substr($token[1], 0, -\strlen($trailingNewline));
                $this->tokens[$i] = $token;
                if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) {
                    $this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1];
                    $this->tokens[$i + 1][2]--;
                } else {
                    \array_splice($this->tokens, $i + 1, 0, [[\T_WHITESPACE, $trailingNewline, $line]]);
                    $numTokens++;
                }
            }
            if (\is_array($token) && ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) {
                $lastWasSeparator = $token[0] === \T_NS_SEPARATOR;
                $text = $token[1];
                for ($j = $i + 1; isset($this->tokens[$j]); $j++) {
                    if ($lastWasSeparator) {
                        if (!isset($this->identifierTokens[$this->tokens[$j][0]])) {
                            break;
                        }
                        $lastWasSeparator = \false;
                    } else {
                        if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) {
                            break;
                        }
                        $lastWasSeparator = \true;
                    }
                    $text .= $this->tokens[$j][1];
                }
                if ($lastWasSeparator) {
                    $j--;
                    $text = \substr($text, 0, -1);
                }
                if ($j > $i + 1) {
                    if ($token[0] === \T_NS_SEPARATOR) {
                        $type = \T_NAME_FULLY_QUALIFIED;
                    } else {
                        if ($token[0] === \T_NAMESPACE) {
                            $type = \T_NAME_RELATIVE;
                        } else {
                            $type = \T_NAME_QUALIFIED;
                        }
                    }
                    $token = [$type, $text, $line];
                    \array_splice($this->tokens, $i, $j - $i, [$token]);
                    $numTokens -= $j - $i - 1;
                }
            }
            if ($token === '&') {
                $next = $i + 1;
                while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) {
                    $next++;
                }
                $followedByVarOrVarArg = isset($this->tokens[$next]) && ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS);
                $this->tokens[$i] = $token = [$followedByVarOrVarArg ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, '&', $line];
            }
            $tokenValue = \is_string($token) ? $token : $token[1];
            $tokenLen = \strlen($tokenValue);
            if (\substr($this->code, $filePos, $tokenLen) !== $tokenValue) {
                $nextFilePos = \strpos($this->code, $tokenValue, $filePos);
                $badCharTokens = $this->handleInvalidCharacterRange($filePos, $nextFilePos, $line, $errorHandler);
                $filePos = (int) $nextFilePos;
                \array_splice($this->tokens, $i, 0, $badCharTokens);
                $numTokens += \count($badCharTokens);
                $i += \count($badCharTokens);
            }
            $filePos += $tokenLen;
            $line += \substr_count($tokenValue, "\n");
        }
        if ($filePos !== \strlen($this->code)) {
            if (\substr($this->code, $filePos, 2) === '/*') {
                $comment = \substr($this->code, $filePos);
                $errorHandler->handleError(new Error('Unterminated comment', ['startLine' => $line, 'endLine' => $line + \substr_count($comment, "\n"), 'startFilePos' => $filePos, 'endFilePos' => $filePos + \strlen($comment)]));
                $isDocComment = isset($comment[3]) && $comment[3] === '*';
                $this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line];
            } else {
                $badCharTokens = $this->handleInvalidCharacterRange($filePos, \strlen($this->code), $line, $errorHandler);
                $this->tokens = \array_merge($this->tokens, $badCharTokens);
            }
            return;
        }
        if (\count($this->tokens) > 0) {
            $lastToken = $this->tokens[\count($this->tokens) - 1];
            if ($this->isUnterminatedComment($lastToken)) {
                $errorHandler->handleError(new Error('Unterminated comment', ['startLine' => $line - \substr_count($lastToken[1], "\n"), 'endLine' => $line, 'startFilePos' => $filePos - \strlen($lastToken[1]), 'endFilePos' => $filePos]));
            }
        }
    }
    public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int
    {
        $startAttributes = [];
        $endAttributes = [];
        while (1) {
            if (isset($this->tokens[++$this->pos])) {
                $token = $this->tokens[$this->pos];
            } else {
                $token = "\x00";
            }
            if ($this->attributeStartLineUsed) {
                $startAttributes['startLine'] = $this->line;
            }
            if ($this->attributeStartTokenPosUsed) {
                $startAttributes['startTokenPos'] = $this->pos;
            }
            if ($this->attributeStartFilePosUsed) {
                $startAttributes['startFilePos'] = $this->filePos;
            }
            if (\is_string($token)) {
                $value = $token;
                if (isset($token[1])) {
                    $this->filePos += 2;
                    $id = \ord('"');
                } else {
                    $this->filePos += 1;
                    $id = \ord($token);
                }
            } elseif (!isset($this->dropTokens[$token[0]])) {
                $value = $token[1];
                $id = $this->tokenMap[$token[0]];
                if (\T_CLOSE_TAG === $token[0]) {
                    $this->prevCloseTagHasNewline = \false !== \strpos($token[1], "\n") || \false !== \strpos($token[1], "\r");
                } elseif (\T_INLINE_HTML === $token[0]) {
                    $startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline;
                }
                $this->line += \substr_count($value, "\n");
                $this->filePos += \strlen($value);
            } else {
                $origLine = $this->line;
                $origFilePos = $this->filePos;
                $this->line += \substr_count($token[1], "\n");
                $this->filePos += \strlen($token[1]);
                if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) {
                    if ($this->attributeCommentsUsed) {
                        $comment = \T_DOC_COMMENT === $token[0] ? new Comment\Doc($token[1], $origLine, $origFilePos, $this->pos, $this->line, $this->filePos - 1, $this->pos) : new Comment($token[1], $origLine, $origFilePos, $this->pos, $this->line, $this->filePos - 1, $this->pos);
                        $startAttributes['comments'][] = $comment;
                    }
                }
                continue;
            }
            if ($this->attributeEndLineUsed) {
                $endAttributes['endLine'] = $this->line;
            }
            if ($this->attributeEndTokenPosUsed) {
                $endAttributes['endTokenPos'] = $this->pos;
            }
            if ($this->attributeEndFilePosUsed) {
                $endAttributes['endFilePos'] = $this->filePos - 1;
            }
            return $id;
        }
        throw new \RuntimeException('Reached end of lexer loop');
    }
    public function getTokens() : array
    {
        return $this->tokens;
    }
    public function handleHaltCompiler() : string
    {
        $textAfter = \substr($this->code, $this->filePos);
        if (!\preg_match('~^\\s*\\(\\s*\\)\\s*(?:;|\\?>\\r?\\n?)~', $textAfter, $matches)) {
            throw new Error('__HALT_COMPILER must be followed by "();"');
        }
        $this->pos = \count($this->tokens);
        return \substr($textAfter, \strlen($matches[0]));
    }
    private function defineCompatibilityTokens()
    {
        static $compatTokensDefined = \false;
        if ($compatTokensDefined) {
            return;
        }
        $compatTokens = ['T_BAD_CHARACTER', 'T_FN', 'T_COALESCE_EQUAL', 'T_NAME_QUALIFIED', 'T_NAME_FULLY_QUALIFIED', 'T_NAME_RELATIVE', 'T_MATCH', 'T_NULLSAFE_OBJECT_OPERATOR', 'T_ATTRIBUTE', 'T_ENUM', 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 'T_READONLY'];
        $usedTokenIds = [];
        foreach ($compatTokens as $token) {
            if (\defined($token)) {
                $tokenId = \constant($token);
                $clashingToken = $usedTokenIds[$tokenId] ?? null;
                if ($clashingToken !== null) {
                    throw new \Error(\sprintf('Token %s has same ID as token %s, ' . 'you may be using a library with broken token emulation', $token, $clashingToken));
                }
                $usedTokenIds[$tokenId] = $token;
            }
        }
        $newTokenId = -1;
        foreach ($compatTokens as $token) {
            if (!\defined($token)) {
                while (isset($usedTokenIds[$newTokenId])) {
                    $newTokenId--;
                }
                \define($token, $newTokenId);
                $newTokenId--;
            }
        }
        $compatTokensDefined = \true;
    }
    protected function createTokenMap() : array
    {
        $tokenMap = [];
        for ($i = 256; $i < 1000; ++$i) {
            if (\T_DOUBLE_COLON === $i) {
                $tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM;
            } elseif (\T_OPEN_TAG_WITH_ECHO === $i) {
                $tokenMap[$i] = Tokens::T_ECHO;
            } elseif (\T_CLOSE_TAG === $i) {
                $tokenMap[$i] = \ord(';');
            } elseif ('UNKNOWN' !== ($name = \token_name($i))) {
                if ('T_HASHBANG' === $name) {
                    $tokenMap[$i] = Tokens::T_INLINE_HTML;
                } elseif (\defined($name = Tokens::class . '::' . $name)) {
                    $tokenMap[$i] = \constant($name);
                }
            }
        }
        if (\defined('T_ONUMBER')) {
            $tokenMap[\T_ONUMBER] = Tokens::T_DNUMBER;
        }
        if (\defined('T_COMPILER_HALT_OFFSET')) {
            $tokenMap[\T_COMPILER_HALT_OFFSET] = Tokens::T_STRING;
        }
        $tokenMap[\T_FN] = Tokens::T_FN;
        $tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL;
        $tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED;
        $tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED;
        $tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE;
        $tokenMap[\T_MATCH] = Tokens::T_MATCH;
        $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR;
        $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE;
        $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;
        $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG;
        $tokenMap[\T_ENUM] = Tokens::T_ENUM;
        $tokenMap[\T_READONLY] = Tokens::T_READONLY;
        return $tokenMap;
    }
    private function createIdentifierTokenMap() : array
    {
        return \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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface ErrorHandler
{
    public function handleError(Error $error);
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\AttributeGroup;
class EnumCase extends Node\Stmt
{
    public $name;
    public $expr;
    public $attrGroups;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Expression extends Node\Stmt
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
class UseUse extends Node\Stmt
{
    public $type;
    public $name;
    public $alias;
    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'];
    }
    public function getAlias() : Identifier
    {
        if (null !== $this->alias) {
            return $this->alias;
        }
        return new Identifier($this->name->getLast());
    }
    public function getType() : string
    {
        return 'Stmt_UseUse';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Global_ extends Node\Stmt
{
    public $vars;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Namespace_ extends Node\Stmt
{
    const KIND_SEMICOLON = 1;
    const KIND_BRACED = 2;
    public $name;
    public $stmts;
    public function __construct(Node\Name $name = null, $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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class TraitUse extends Node\Stmt
{
    public $traits;
    public $adaptations;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt\TraitUseAdaptation;

use Cvphar\PhpParser\Node;
class Precedence extends Node\Stmt\TraitUseAdaptation
{
    public $insteadof;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt\TraitUseAdaptation;

use Cvphar\PhpParser\Node;
class Alias extends Node\Stmt\TraitUseAdaptation
{
    public $newModifier;
    public $newName;
    public function __construct($trait, $method, $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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
class Catch_ extends Node\Stmt
{
    public $types;
    public $var;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\Node;
class Class_ extends ClassLike
{
    const MODIFIER_PUBLIC = 1;
    const MODIFIER_PROTECTED = 2;
    const MODIFIER_PRIVATE = 4;
    const MODIFIER_STATIC = 8;
    const MODIFIER_ABSTRACT = 16;
    const MODIFIER_FINAL = 32;
    const MODIFIER_READONLY = 64;
    const VISIBILITY_MODIFIER_MASK = 7;
    public $flags;
    public $extends;
    public $implements;
    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'];
    }
    public function isAbstract() : bool
    {
        return (bool) ($this->flags & self::MODIFIER_ABSTRACT);
    }
    public function isFinal() : bool
    {
        return (bool) ($this->flags & self::MODIFIER_FINAL);
    }
    public function isReadonly() : bool
    {
        return (bool) ($this->flags & self::MODIFIER_READONLY);
    }
    public function isAnonymous() : bool
    {
        return null === $this->name;
    }
    public static function verifyClassModifier($a, $b)
    {
        if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) {
            throw new Error('Multiple abstract modifiers are not allowed');
        }
        if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) {
            throw new Error('Multiple final modifiers are not allowed');
        }
        if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) {
            throw new Error('Multiple readonly modifiers are not allowed');
        }
        if ($a & 48 && $b & 48) {
            throw new Error('Cannot use the final modifier on an abstract class');
        }
    }
    public static function verifyModifier($a, $b)
    {
        if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) {
            throw new Error('Multiple access type modifiers are not allowed');
        }
        if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) {
            throw new Error('Multiple abstract modifiers are not allowed');
        }
        if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) {
            throw new Error('Multiple static modifiers are not allowed');
        }
        if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) {
            throw new Error('Multiple final modifiers are not allowed');
        }
        if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) {
            throw new Error('Multiple readonly modifiers are not allowed');
        }
        if ($a & 48 && $b & 48) {
            throw new Error('Cannot use the final modifier on an abstract class member');
        }
    }
    public function getType() : string
    {
        return 'Stmt_Class';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Throw_ extends Node\Stmt
{
    public $expr;
    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_Throw';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class PropertyProperty extends Node\Stmt
{
    public $name;
    public $default;
    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 'Stmt_PropertyProperty';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Stmt;
class Label extends Stmt
{
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
class StaticVar extends Node\Stmt
{
    public $var;
    public $default;
    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 'Stmt_StaticVar';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Case_ extends Node\Stmt
{
    public $cond;
    public $stmts;
    public function __construct($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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Continue_ extends Node\Stmt
{
    public $num;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\FunctionLike;
class ClassMethod extends Node\Stmt implements FunctionLike
{
    public $flags;
    public $byRef;
    public $name;
    public $params;
    public $returnType;
    public $stmts;
    public $attrGroups;
    private static $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];
    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'] ?? [];
        $returnType = $subNodes['returnType'] ?? null;
        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
        $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()
    {
        return $this->stmts;
    }
    public function getAttrGroups() : array
    {
        return $this->attrGroups;
    }
    public function isPublic() : bool
    {
        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
    }
    public function isProtected() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
    }
    public function isPrivate() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
    }
    public function isAbstract() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT);
    }
    public function isFinal() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_FINAL);
    }
    public function isStatic() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_STATIC);
    }
    public function isMagic() : bool
    {
        return isset(self::$magicNames[$this->name->toLowerString()]);
    }
    public function getType() : string
    {
        return 'Stmt_ClassMethod';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Unset_ extends Node\Stmt
{
    public $vars;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
abstract class TraitUseAdaptation extends Node\Stmt
{
    public $trait;
    public $method;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Finally_ extends Node\Stmt
{
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Interface_ extends ClassLike
{
    public $extends;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Else_ extends Node\Stmt
{
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class While_ extends Node\Stmt
{
    public $cond;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Stmt;
class HaltCompiler extends Stmt
{
    public $remaining;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class DeclareDeclare extends Node\Stmt
{
    public $key;
    public $value;
    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 'Stmt_DeclareDeclare';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Stmt;
class Goto_ extends Stmt
{
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Stmt;
class Static_ extends Stmt
{
    public $vars;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Return_ extends Node\Stmt
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class TryCatch extends Node\Stmt
{
    public $stmts;
    public $catches;
    public $finally;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Echo_ extends Node\Stmt
{
    public $exprs;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Declare_ extends Node\Stmt
{
    public $declares;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\ComplexType;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
class Property extends Node\Stmt
{
    public $flags;
    public $props;
    public $type;
    public $attrGroups;
    public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = [])
    {
        $this->attributes = $attributes;
        $this->flags = $flags;
        $this->props = $props;
        $this->type = \is_string($type) ? new Identifier($type) : $type;
        $this->attrGroups = $attrGroups;
    }
    public function getSubNodeNames() : array
    {
        return ['attrGroups', 'flags', 'type', 'props'];
    }
    public function isPublic() : bool
    {
        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
    }
    public function isProtected() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
    }
    public function isPrivate() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
    }
    public function isStatic() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_STATIC);
    }
    public function isReadonly() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_READONLY);
    }
    public function getType() : string
    {
        return 'Stmt_Property';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Break_ extends Node\Stmt
{
    public $num;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class If_ extends Node\Stmt
{
    public $cond;
    public $stmts;
    public $elseifs;
    public $else;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Const_ extends Node\Stmt
{
    public $consts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\FunctionLike;
class Function_ extends Node\Stmt implements FunctionLike
{
    public $byRef;
    public $name;
    public $params;
    public $returnType;
    public $stmts;
    public $attrGroups;
    public $namespacedName;
    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'] ?? [];
        $returnType = $subNodes['returnType'] ?? null;
        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
        $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;
    }
    public function getStmts() : array
    {
        return $this->stmts;
    }
    public function getType() : string
    {
        return 'Stmt_Function';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Switch_ extends Node\Stmt
{
    public $cond;
    public $cases;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Foreach_ extends Node\Stmt
{
    public $expr;
    public $keyVar;
    public $byRef;
    public $valueVar;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class For_ extends Node\Stmt
{
    public $init;
    public $cond;
    public $loop;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Do_ extends Node\Stmt
{
    public $stmts;
    public $cond;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt;
class GroupUse extends Stmt
{
    public $type;
    public $prefix;
    public $uses;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
abstract class ClassLike extends Node\Stmt
{
    public $name;
    public $stmts;
    public $attrGroups;
    public $namespacedName;
    public function getTraitUses() : array
    {
        $traitUses = [];
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof TraitUse) {
                $traitUses[] = $stmt;
            }
        }
        return $traitUses;
    }
    public function getConstants() : array
    {
        $constants = [];
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof ClassConst) {
                $constants[] = $stmt;
            }
        }
        return $constants;
    }
    public function getProperties() : array
    {
        $properties = [];
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof Property) {
                $properties[] = $stmt;
            }
        }
        return $properties;
    }
    public function getProperty(string $name)
    {
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof Property) {
                foreach ($stmt->props as $prop) {
                    if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) {
                        return $stmt;
                    }
                }
            }
        }
        return null;
    }
    public function getMethods() : array
    {
        $methods = [];
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof ClassMethod) {
                $methods[] = $stmt;
            }
        }
        return $methods;
    }
    public function getMethod(string $name)
    {
        $lowerName = \strtolower($name);
        foreach ($this->stmts as $stmt) {
            if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) {
                return $stmt;
            }
        }
        return null;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Stmt;
class Use_ extends Stmt
{
    const TYPE_UNKNOWN = 0;
    const TYPE_NORMAL = 1;
    const TYPE_FUNCTION = 2;
    const TYPE_CONSTANT = 3;
    public $type;
    public $uses;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node\Stmt;
class InlineHTML extends Stmt
{
    public $value;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class ClassConst extends Node\Stmt
{
    public $flags;
    public $consts;
    public $attrGroups;
    public function __construct(array $consts, int $flags = 0, array $attributes = [], array $attrGroups = [])
    {
        $this->attributes = $attributes;
        $this->flags = $flags;
        $this->consts = $consts;
        $this->attrGroups = $attrGroups;
    }
    public function getSubNodeNames() : array
    {
        return ['attrGroups', 'flags', 'consts'];
    }
    public function isPublic() : bool
    {
        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
    }
    public function isProtected() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
    }
    public function isPrivate() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
    }
    public function isFinal() : bool
    {
        return (bool) ($this->flags & Class_::MODIFIER_FINAL);
    }
    public function getType() : string
    {
        return 'Stmt_ClassConst';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class ElseIf_ extends Node\Stmt
{
    public $cond;
    public $stmts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Nop extends Node\Stmt
{
    public function getSubNodeNames() : array
    {
        return [];
    }
    public function getType() : string
    {
        return 'Stmt_Nop';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Trait_ extends ClassLike
{
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Stmt;

use Cvphar\PhpParser\Node;
class Enum_ extends ClassLike
{
    public $scalarType;
    public $implements;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeAbstract;
class MatchArm extends NodeAbstract
{
    public $conds;
    public $body;
    public function __construct($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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

class NullableType extends ComplexType
{
    public $type;
    public function __construct($type, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->type = \is_string($type) ? new Identifier($type) : $type;
    }
    public function getSubNodeNames() : array
    {
        return ['type'];
    }
    public function getType() : string
    {
        return 'NullableType';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class Identifier extends NodeAbstract
{
    public $name;
    private static $specialClassNames = ['self' => \true, 'parent' => \true, 'static' => \true];
    public function __construct(string $name, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->name = $name;
    }
    public function getSubNodeNames() : array
    {
        return ['name'];
    }
    public function toString() : string
    {
        return $this->name;
    }
    public function toLowerString() : string
    {
        return \strtolower($this->name);
    }
    public function isSpecialClassName() : bool
    {
        return isset(self::$specialClassNames[\strtolower($this->name)]);
    }
    public function __toString() : string
    {
        return $this->name;
    }
    public function getType() : string
    {
        return 'Identifier';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
abstract class ComplexType extends NodeAbstract
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class Param extends NodeAbstract
{
    public $type;
    public $byRef;
    public $variadic;
    public $var;
    public $default;
    public $flags;
    public $attrGroups;
    public function __construct($var, Expr $default = null, $type = null, bool $byRef = \false, bool $variadic = \false, array $attributes = [], int $flags = 0, array $attrGroups = [])
    {
        $this->attributes = $attributes;
        $this->type = \is_string($type) ? new Identifier($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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeAbstract;
class Attribute extends NodeAbstract
{
    public $name;
    public $args;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
abstract class BinaryOp extends Expr
{
    public $left;
    public $right;
    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'];
    }
    public abstract function getOperatorSigil() : string;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class List_ extends Expr
{
    public $items;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class ShellExec extends Expr
{
    public $parts;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
class ConstFetch extends Expr
{
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
abstract class Cast extends Expr
{
    public $expr;
    public function __construct(Expr $expr, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->expr = $expr;
    }
    public function getSubNodeNames() : array
    {
        return ['expr'];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Include_ extends Expr
{
    const TYPE_INCLUDE = 1;
    const TYPE_INCLUDE_ONCE = 2;
    const TYPE_REQUIRE = 3;
    const TYPE_REQUIRE_ONCE = 4;
    public $expr;
    public $type;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\VarLikeIdentifier;
class StaticPropertyFetch extends Expr
{
    public $class;
    public $name;
    public function __construct($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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Variable extends Expr
{
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Print_ extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class PreInc extends Expr
{
    public $var;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
class StaticCall extends CallLike
{
    public $class;
    public $name;
    public $args;
    public function __construct($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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class YieldFrom extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\FunctionLike;
class Closure extends Expr implements FunctionLike
{
    public $static;
    public $byRef;
    public $params;
    public $uses;
    public $returnType;
    public $stmts;
    public $attrGroups;
    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'] ?? [];
        $returnType = $subNodes['returnType'] ?? null;
        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
        $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;
    }
    public function getStmts() : array
    {
        return $this->stmts;
    }
    public function getAttrGroups() : array
    {
        return $this->attrGroups;
    }
    public function getType() : string
    {
        return 'Expr_Closure';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Int_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_Int';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Object_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_Object';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Double extends Cast
{
    const KIND_DOUBLE = 1;
    const KIND_FLOAT = 2;
    const KIND_REAL = 3;
    public function getType() : string
    {
        return 'Expr_Cast_Double';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class String_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_String';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Unset_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_Unset';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Bool_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_Bool';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\Cast;

use Cvphar\PhpParser\Node\Expr\Cast;
class Array_ extends Cast
{
    public function getType() : string
    {
        return 'Expr_Cast_Array';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
class Throw_ extends Node\Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class PostDec extends Expr
{
    public $var;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class UnaryMinus extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
class ClassConstFetch extends Expr
{
    public $class;
    public $name;
    public function __construct($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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class BitwiseNot extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class ErrorSuppress extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\FunctionLike;
class ArrowFunction extends Expr implements FunctionLike
{
    public $static;
    public $byRef;
    public $params = [];
    public $returnType;
    public $expr;
    public $attrGroups;
    public function __construct(array $subNodes = [], array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->static = $subNodes['static'] ?? \false;
        $this->byRef = $subNodes['byRef'] ?? \false;
        $this->params = $subNodes['params'] ?? [];
        $returnType = $subNodes['returnType'] ?? null;
        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
        $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;
    }
    public function getStmts() : array
    {
        return [new Node\Stmt\Return_($this->expr)];
    }
    public function getType() : string
    {
        return 'Expr_ArrowFunction';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Eval_ extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
class NullsafePropertyFetch extends Expr
{
    public $var;
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class ArrayDimFetch extends Expr
{
    public $var;
    public $dim;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
abstract class CallLike extends Expr
{
    public abstract function getRawArgs() : array;
    public function isFirstClassCallable() : bool
    {
        foreach ($this->getRawArgs() as $arg) {
            if ($arg instanceof VariadicPlaceholder) {
                return \true;
            }
        }
        return \false;
    }
    public function getArgs() : array
    {
        \assert(!$this->isFirstClassCallable());
        return $this->getRawArgs();
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
class MethodCall extends CallLike
{
    public $var;
    public $name;
    public $args;
    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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
class PropertyFetch extends Expr
{
    public $var;
    public $name;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Plus extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Plus';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class ShiftRight extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_ShiftRight';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Div extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Div';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Mod extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Mod';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class BitwiseOr extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_BitwiseOr';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Minus extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Minus';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Pow extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Pow';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Mul extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Mul';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Concat extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Concat';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class ShiftLeft extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_ShiftLeft';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class BitwiseXor extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_BitwiseXor';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class Coalesce extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_Coalesce';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\AssignOp;

use Cvphar\PhpParser\Node\Expr\AssignOp;
class BitwiseAnd extends AssignOp
{
    public function getType() : string
    {
        return 'Expr_AssignOp_BitwiseAnd';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Plus extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '+';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Plus';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Greater extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '>';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Greater';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class LogicalOr extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return 'or';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_LogicalOr';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Spaceship extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '<=>';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Spaceship';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Smaller extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '<';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Smaller';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class ShiftRight extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '>>';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_ShiftRight';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class BooleanOr extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '||';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_BooleanOr';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class LogicalAnd extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return 'and';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_LogicalAnd';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Equal extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '==';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Equal';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class NotIdentical extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '!==';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_NotIdentical';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class SmallerOrEqual extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '<=';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_SmallerOrEqual';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class BooleanAnd extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '&&';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_BooleanAnd';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Div extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '/';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Div';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class LogicalXor extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return 'xor';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_LogicalXor';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Mod extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '%';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Mod';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class BitwiseOr extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '|';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_BitwiseOr';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Minus extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '-';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Minus';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Identical extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '===';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Identical';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class GreaterOrEqual extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '>=';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_GreaterOrEqual';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Pow extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '**';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Pow';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Mul extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '*';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Mul';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Concat extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '.';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Concat';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class ShiftLeft extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '<<';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_ShiftLeft';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class BitwiseXor extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '^';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_BitwiseXor';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class Coalesce extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '??';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_Coalesce';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class NotEqual extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '!=';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_NotEqual';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr\BinaryOp;

use Cvphar\PhpParser\Node\Expr\BinaryOp;
class BitwiseAnd extends BinaryOp
{
    public function getOperatorSigil() : string
    {
        return '&';
    }
    public function getType() : string
    {
        return 'Expr_BinaryOp_BitwiseAnd';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Assign extends Expr
{
    public $var;
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class PostInc extends Expr
{
    public $var;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Error extends Expr
{
    public function __construct(array $attributes = [])
    {
        $this->attributes = $attributes;
    }
    public function getSubNodeNames() : array
    {
        return [];
    }
    public function getType() : string
    {
        return 'Expr_Error';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class UnaryPlus extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Ternary extends Expr
{
    public $cond;
    public $if;
    public $else;
    public function __construct(Expr $cond, $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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Empty_ extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
class New_ extends CallLike
{
    public $class;
    public $args;
    public function __construct($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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Yield_ extends Expr
{
    public $key;
    public $value;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Exit_ extends Expr
{
    const KIND_EXIT = 1;
    const KIND_DIE = 2;
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
abstract class AssignOp extends Expr
{
    public $var;
    public $expr;
    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'];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
class NullsafeMethodCall extends CallLike
{
    public $var;
    public $name;
    public $args;
    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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Name;
class Instanceof_ extends Expr
{
    public $expr;
    public $class;
    public function __construct(Expr $expr, $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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
class FuncCall extends CallLike
{
    public $name;
    public $args;
    public function __construct($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;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class BooleanNot extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Clone_ extends Expr
{
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class PreDec extends Expr
{
    public $var;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\MatchArm;
class Match_ extends Node\Expr
{
    public $cond;
    public $arms;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class ArrayItem extends Expr
{
    public $key;
    public $value;
    public $byRef;
    public $unpack;
    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 'Expr_ArrayItem';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Array_ extends Expr
{
    const KIND_LONG = 1;
    const KIND_SHORT = 2;
    public $items;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class AssignRef extends Expr
{
    public $var;
    public $expr;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class Isset_ extends Expr
{
    public $vars;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Expr;

use Cvphar\PhpParser\Node\Expr;
class ClosureUse extends Expr
{
    public $var;
    public $byRef;
    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 'Expr_ClosureUse';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\NodeAbstract;
class AttributeGroup extends NodeAbstract
{
    public $attrs;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
abstract class Expr extends NodeAbstract
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

abstract class Scalar extends Expr
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

class UnionType extends ComplexType
{
    public $types;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class Const_ extends NodeAbstract
{
    public $name;
    public $value;
    public $namespacedName;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\Node;
interface FunctionLike extends Node
{
    public function returnsByRef() : bool;
    public function getParams() : array;
    public function getReturnType();
    public function getStmts();
    public function getAttrGroups() : array;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class VariadicPlaceholder extends NodeAbstract
{
    public function __construct(array $attributes = [])
    {
        $this->attributes = $attributes;
    }
    public function getType() : string
    {
        return 'VariadicPlaceholder';
    }
    public function getSubNodeNames() : array
    {
        return [];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Name;

class Relative extends \Cvphar\PhpParser\Node\Name
{
    public function isUnqualified() : bool
    {
        return \false;
    }
    public function isQualified() : bool
    {
        return \false;
    }
    public function isFullyQualified() : bool
    {
        return \false;
    }
    public function isRelative() : bool
    {
        return \true;
    }
    public function toCodeString() : string
    {
        return 'namespace\\' . $this->toString();
    }
    public function getType() : string
    {
        return 'Name_Relative';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Name;

class FullyQualified extends \Cvphar\PhpParser\Node\Name
{
    public function isUnqualified() : bool
    {
        return \false;
    }
    public function isQualified() : bool
    {
        return \false;
    }
    public function isFullyQualified() : bool
    {
        return \true;
    }
    public function isRelative() : bool
    {
        return \false;
    }
    public function toCodeString() : string
    {
        return '\\' . $this->toString();
    }
    public function getType() : string
    {
        return 'Name_FullyQualified';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

class VarLikeIdentifier extends Identifier
{
    public function getType() : string
    {
        return 'VarLikeIdentifier';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class IntersectionType extends ComplexType
{
    public $types;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
class Name extends NodeAbstract
{
    public $parts;
    private static $specialClassNames = ['self' => \true, 'parent' => \true, 'static' => \true];
    public function __construct($name, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->parts = self::prepareName($name);
    }
    public function getSubNodeNames() : array
    {
        return ['parts'];
    }
    public function getFirst() : string
    {
        return $this->parts[0];
    }
    public function getLast() : string
    {
        return $this->parts[\count($this->parts) - 1];
    }
    public function isUnqualified() : bool
    {
        return 1 === \count($this->parts);
    }
    public function isQualified() : bool
    {
        return 1 < \count($this->parts);
    }
    public function isFullyQualified() : bool
    {
        return \false;
    }
    public function isRelative() : bool
    {
        return \false;
    }
    public function toString() : string
    {
        return \implode('\\', $this->parts);
    }
    public function toCodeString() : string
    {
        return $this->toString();
    }
    public function toLowerString() : string
    {
        return \strtolower(\implode('\\', $this->parts));
    }
    public function isSpecialClassName() : bool
    {
        return \count($this->parts) === 1 && isset(self::$specialClassNames[\strtolower($this->parts[0])]);
    }
    public function __toString() : string
    {
        return \implode('\\', $this->parts);
    }
    public function slice(int $offset, int $length = null)
    {
        $numParts = \count($this->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) {
            return null;
        }
        return new static(\array_slice($this->parts, $realOffset, $realLength), $this->attributes);
    }
    public static function concat($name1, $name2, array $attributes = [])
    {
        if (null === $name1 && null === $name2) {
            return null;
        } elseif (null === $name1) {
            return new static(self::prepareName($name2), $attributes);
        } elseif (null === $name2) {
            return new static(self::prepareName($name1), $attributes);
        } else {
            return new static(\array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes);
        }
    }
    private static function prepareName($name) : array
    {
        if (\is_string($name)) {
            if ('' === $name) {
                throw new \InvalidArgumentException('Name cannot be empty');
            }
            return \explode('\\', $name);
        } elseif (\is_array($name)) {
            if (empty($name)) {
                throw new \InvalidArgumentException('Name cannot be empty');
            }
            return $name;
        } elseif ($name instanceof self) {
            return $name->parts;
        }
        throw new \InvalidArgumentException('Expected string, array of parts or Name instance');
    }
    public function getType() : string
    {
        return 'Name';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Node\Scalar;
class DNumber extends Scalar
{
    public $value;
    public function __construct(float $value, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->value = $value;
    }
    public function getSubNodeNames() : array
    {
        return ['value'];
    }
    public static function fromString(string $str, array $attributes = []) : DNumber
    {
        $attributes['rawValue'] = $str;
        $float = self::parse($str);
        return new DNumber($float, $attributes);
    }
    public static function parse(string $str) : float
    {
        $str = \str_replace('_', '', $str);
        if ('0' === $str[0]) {
            if ('x' === $str[1] || 'X' === $str[1]) {
                return \hexdec($str);
            }
            if ('b' === $str[1] || 'B' === $str[1]) {
                return \bindec($str);
            }
            if (\false === \strpbrk($str, '.eE')) {
                return \octdec(\substr($str, 0, \strcspn($str, '89')));
            }
        }
        return (float) $str;
    }
    public function getType() : string
    {
        return 'Scalar_DNumber';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\Node\Scalar;
class String_ extends Scalar
{
    const KIND_SINGLE_QUOTED = 1;
    const KIND_DOUBLE_QUOTED = 2;
    const KIND_HEREDOC = 3;
    const KIND_NOWDOC = 4;
    public $value;
    protected static $replacements = ['\\' => '\\', '$' => '$', 'n' => "\n", 'r' => "\r", 't' => "\t", 'f' => "\f", 'v' => "\v", 'e' => "\x1b"];
    public function __construct(string $value, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->value = $value;
    }
    public function getSubNodeNames() : array
    {
        return ['value'];
    }
    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);
    }
    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);
        }
    }
    public static function parseEscapeSequences(string $str, $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];
            } elseif ('x' === $str[0] || 'X' === $str[0]) {
                return \chr(\hexdec(\substr($str, 1)));
            } elseif ('u' === $str[0]) {
                return self::codePointToUtf8(\hexdec($matches[2]));
            } else {
                return \chr(\octdec($str));
            }
        }, $str);
    }
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Namespace_ extends MagicConst
{
    public function getName() : string
    {
        return '__NAMESPACE__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Namespace';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Class_ extends MagicConst
{
    public function getName() : string
    {
        return '__CLASS__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Class';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Dir extends MagicConst
{
    public function getName() : string
    {
        return '__DIR__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Dir';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class File extends MagicConst
{
    public function getName() : string
    {
        return '__FILE__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_File';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Method extends MagicConst
{
    public function getName() : string
    {
        return '__METHOD__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Method';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Function_ extends MagicConst
{
    public function getName() : string
    {
        return '__FUNCTION__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Function';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Line extends MagicConst
{
    public function getName() : string
    {
        return '__LINE__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Line';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar\MagicConst;

use Cvphar\PhpParser\Node\Scalar\MagicConst;
class Trait_ extends MagicConst
{
    public function getName() : string
    {
        return '__TRAIT__';
    }
    public function getType() : string
    {
        return 'Scalar_MagicConst_Trait';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Node\Scalar;
abstract class MagicConst extends Scalar
{
    public function __construct(array $attributes = [])
    {
        $this->attributes = $attributes;
    }
    public function getSubNodeNames() : array
    {
        return [];
    }
    public abstract function getName() : string;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Error;
use Cvphar\PhpParser\Node\Scalar;
class LNumber extends Scalar
{
    const KIND_BIN = 2;
    const KIND_OCT = 8;
    const KIND_DEC = 10;
    const KIND_HEX = 16;
    public $value;
    public function __construct(int $value, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->value = $value;
    }
    public function getSubNodeNames() : array
    {
        return ['value'];
    }
    public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = \false) : LNumber
    {
        $attributes['rawValue'] = $str;
        $str = \str_replace('_', '', $str);
        if ('0' !== $str[0] || '0' === $str) {
            $attributes['kind'] = LNumber::KIND_DEC;
            return new LNumber((int) $str, $attributes);
        }
        if ('x' === $str[1] || 'X' === $str[1]) {
            $attributes['kind'] = LNumber::KIND_HEX;
            return new LNumber(\hexdec($str), $attributes);
        }
        if ('b' === $str[1] || 'B' === $str[1]) {
            $attributes['kind'] = LNumber::KIND_BIN;
            return new LNumber(\bindec($str), $attributes);
        }
        if (!$allowInvalidOctal && \strpbrk($str, '89')) {
            throw new Error('Invalid numeric literal', $attributes);
        }
        if ('o' === $str[1] || 'O' === $str[1]) {
            $str = \substr($str, 2);
        }
        $attributes['kind'] = LNumber::KIND_OCT;
        return new LNumber(\intval($str, 8), $attributes);
    }
    public function getType() : string
    {
        return 'Scalar_LNumber';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Node\Scalar;
class EncapsedStringPart extends Scalar
{
    public $value;
    public function __construct(string $value, array $attributes = [])
    {
        $this->attributes = $attributes;
        $this->value = $value;
    }
    public function getSubNodeNames() : array
    {
        return ['value'];
    }
    public function getType() : string
    {
        return 'Scalar_EncapsedStringPart';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node\Scalar;

use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Scalar;
class Encapsed extends Scalar
{
    public $parts;
    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_Encapsed';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\NodeAbstract;
abstract class Stmt extends NodeAbstract
{
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Node;

use Cvphar\PhpParser\Node\VariadicPlaceholder;
use Cvphar\PhpParser\NodeAbstract;
class Arg extends NodeAbstract
{
    public $name;
    public $value;
    public $byRef;
    public $unpack;
    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';
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\NodeVisitor\FindingVisitor;
use Cvphar\PhpParser\NodeVisitor\FirstFindingVisitor;
class NodeFinder
{
    public function find($nodes, callable $filter) : array
    {
        if (!\is_array($nodes)) {
            $nodes = [$nodes];
        }
        $visitor = new FindingVisitor($filter);
        $traverser = new NodeTraverser();
        $traverser->addVisitor($visitor);
        $traverser->traverse($nodes);
        return $visitor->getFoundNodes();
    }
    public function findInstanceOf($nodes, string $class) : array
    {
        return $this->find($nodes, function ($node) use($class) {
            return $node instanceof $class;
        });
    }
    public function findFirst($nodes, callable $filter)
    {
        if (!\is_array($nodes)) {
            $nodes = [$nodes];
        }
        $visitor = new FirstFindingVisitor($filter);
        $traverser = new NodeTraverser();
        $traverser->addVisitor($visitor);
        $traverser->traverse($nodes);
        return $visitor->getFoundNode();
    }
    public function findFirstInstanceOf($nodes, string $class)
    {
        return $this->findFirst($nodes, function ($node) use($class) {
            return $node instanceof $class;
        });
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

class NodeTraverser implements NodeTraverserInterface
{
    const DONT_TRAVERSE_CHILDREN = 1;
    const STOP_TRAVERSAL = 2;
    const REMOVE_NODE = 3;
    const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;
    protected $visitors = [];
    protected $stopTraversal;
    public function __construct()
    {
    }
    public function addVisitor(NodeVisitor $visitor)
    {
        $this->visitors[] = $visitor;
    }
    public function removeVisitor(NodeVisitor $visitor)
    {
        foreach ($this->visitors as $index => $storedVisitor) {
            if ($storedVisitor === $visitor) {
                unset($this->visitors[$index]);
                break;
            }
        }
    }
    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);
        foreach ($this->visitors as $visitor) {
            if (null !== ($return = $visitor->afterTraverse($nodes))) {
                $nodes = $return;
            }
        }
        return $nodes;
    }
    protected function traverseNode(Node $node) : Node
    {
        foreach ($node->getSubNodeNames() as $name) {
            $subNode =& $node->{$name};
            if (\is_array($subNode)) {
                $subNode = $this->traverseArray($subNode);
                if ($this->stopTraversal) {
                    break;
                }
            } elseif ($subNode instanceof Node) {
                $traverseChildren = \true;
                $breakVisitorIndex = null;
                foreach ($this->visitors as $visitorIndex => $visitor) {
                    $return = $visitor->enterNode($subNode);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $this->ensureReplacementReasonable($subNode, $return);
                            $subNode = $return;
                        } elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
                            $traverseChildren = \false;
                        } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
                            $traverseChildren = \false;
                            $breakVisitorIndex = $visitorIndex;
                            break;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = \true;
                            break 2;
                        } else {
                            throw new \LogicException('enterNode() returned invalid value of type ' . \gettype($return));
                        }
                    }
                }
                if ($traverseChildren) {
                    $subNode = $this->traverseNode($subNode);
                    if ($this->stopTraversal) {
                        break;
                    }
                }
                foreach ($this->visitors as $visitorIndex => $visitor) {
                    $return = $visitor->leaveNode($subNode);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $this->ensureReplacementReasonable($subNode, $return);
                            $subNode = $return;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = \true;
                            break 2;
                        } 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));
                        }
                    }
                    if ($breakVisitorIndex === $visitorIndex) {
                        break;
                    }
                }
            }
        }
        return $node;
    }
    protected function traverseArray(array $nodes) : array
    {
        $doNodes = [];
        foreach ($nodes as $i => &$node) {
            if ($node instanceof Node) {
                $traverseChildren = \true;
                $breakVisitorIndex = null;
                foreach ($this->visitors as $visitorIndex => $visitor) {
                    $return = $visitor->enterNode($node);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $this->ensureReplacementReasonable($node, $return);
                            $node = $return;
                        } elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
                            $traverseChildren = \false;
                        } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
                            $traverseChildren = \false;
                            $breakVisitorIndex = $visitorIndex;
                            break;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = \true;
                            break 2;
                        } else {
                            throw new \LogicException('enterNode() returned invalid value of type ' . \gettype($return));
                        }
                    }
                }
                if ($traverseChildren) {
                    $node = $this->traverseNode($node);
                    if ($this->stopTraversal) {
                        break;
                    }
                }
                foreach ($this->visitors as $visitorIndex => $visitor) {
                    $return = $visitor->leaveNode($node);
                    if (null !== $return) {
                        if ($return instanceof Node) {
                            $this->ensureReplacementReasonable($node, $return);
                            $node = $return;
                        } elseif (\is_array($return)) {
                            $doNodes[] = [$i, $return];
                            break;
                        } elseif (self::REMOVE_NODE === $return) {
                            $doNodes[] = [$i, []];
                            break;
                        } elseif (self::STOP_TRAVERSAL === $return) {
                            $this->stopTraversal = \true;
                            break 2;
                        } elseif (\false === $return) {
                            throw new \LogicException('bool(false) return from leaveNode() no longer supported. ' . 'Return NodeTraverser::REMOVE_NODE instead');
                        } else {
                            throw new \LogicException('leaveNode() returned invalid value of type ' . \gettype($return));
                        }
                    }
                    if ($breakVisitorIndex === $visitorIndex) {
                        break;
                    }
                }
            } 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($old, $new)
    {
        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()})");
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Stmt;
class EnumCase implements PhpParser\Builder
{
    protected $name;
    protected $value = null;
    protected $attributes = [];
    protected $attributeGroups = [];
    public function __construct($name)
    {
        $this->name = $name;
    }
    public function setValue($value)
    {
        $this->value = BuilderHelpers::normalizeValue($value);
        return $this;
    }
    public function setDocComment($docComment)
    {
        $this->attributes = ['comments' => [BuilderHelpers::normalizeDocComment($docComment)]];
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    public function getNode() : PhpParser\Node
    {
        return new Stmt\EnumCase($this->name, $this->value, $this->attributeGroups, $this->attributes);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class Namespace_ extends Declaration
{
    private $name;
    private $stmts = [];
    public function __construct($name)
    {
        $this->name = null !== $name ? BuilderHelpers::normalizeName($name) : null;
    }
    public function addStmt($stmt)
    {
        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
        return $this;
    }
    public function getNode() : Node
    {
        return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser\Builder;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class TraitUse implements Builder
{
    protected $traits = [];
    protected $adaptations = [];
    public function __construct(...$traits)
    {
        foreach ($traits as $trait) {
            $this->and($trait);
        }
    }
    public function and($trait)
    {
        $this->traits[] = BuilderHelpers::normalizeName($trait);
        return $this;
    }
    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;
    }
    public function getNode() : Node
    {
        return new Stmt\TraitUse($this->traits, $this->adaptations);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt;
class Class_ extends Declaration
{
    protected $name;
    protected $extends = null;
    protected $implements = [];
    protected $flags = 0;
    protected $uses = [];
    protected $constants = [];
    protected $properties = [];
    protected $methods = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function extend($class)
    {
        $this->extends = BuilderHelpers::normalizeName($class);
        return $this;
    }
    public function implement(...$interfaces)
    {
        foreach ($interfaces as $interface) {
            $this->implements[] = BuilderHelpers::normalizeName($interface);
        }
        return $this;
    }
    public function makeAbstract()
    {
        $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT);
        return $this;
    }
    public function makeFinal()
    {
        $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
        return $this;
    }
    public function makeReadonly()
    {
        $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_READONLY);
        return $this;
    }
    public function addStmt($stmt)
    {
        $stmt = BuilderHelpers::normalizeNode($stmt);
        $targets = [Stmt\TraitUse::class => &$this->uses, Stmt\ClassConst::class => &$this->constants, Stmt\Property::class => &$this->properties, Stmt\ClassMethod::class => &$this->methods];
        $class = \get_class($stmt);
        if (!isset($targets[$class])) {
            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
        }
        $targets[$class][] = $stmt;
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
class Param implements PhpParser\Builder
{
    protected $name;
    protected $default = null;
    protected $type = null;
    protected $byRef = \false;
    protected $variadic = \false;
    protected $flags = 0;
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function setDefault($value)
    {
        $this->default = BuilderHelpers::normalizeValue($value);
        return $this;
    }
    public function setType($type)
    {
        $this->type = BuilderHelpers::normalizeType($type);
        if ($this->type == 'void') {
            throw new \LogicException('Parameter type cannot be void');
        }
        return $this;
    }
    public function setTypeHint($type)
    {
        return $this->setType($type);
    }
    public function makeByRef()
    {
        $this->byRef = \true;
        return $this;
    }
    public function makeVariadic()
    {
        $this->variadic = \true;
        return $this;
    }
    public function makePublic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PUBLIC);
        return $this;
    }
    public function makeProtected()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PROTECTED);
        return $this;
    }
    public function makePrivate()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PRIVATE);
        return $this;
    }
    public function makeReadonly()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_READONLY);
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser\Builder;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class TraitUseAdaptation implements Builder
{
    const TYPE_UNDEFINED = 0;
    const TYPE_ALIAS = 1;
    const TYPE_PRECEDENCE = 2;
    protected $type;
    protected $trait;
    protected $method;
    protected $modifier = null;
    protected $alias = null;
    protected $insteadof = [];
    public function __construct($trait, $method)
    {
        $this->type = self::TYPE_UNDEFINED;
        $this->trait = \is_null($trait) ? null : BuilderHelpers::normalizeName($trait);
        $this->method = BuilderHelpers::normalizeIdentifier($method);
    }
    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 = $alias;
        return $this;
    }
    public function makePublic()
    {
        $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC);
        return $this;
    }
    public function makeProtected()
    {
        $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED);
        return $this;
    }
    public function makePrivate()
    {
        $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE);
        return $this;
    }
    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)
    {
        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');
        }
    }
    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');
        }
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class Method extends FunctionLike
{
    protected $name;
    protected $flags = 0;
    protected $stmts = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function makePublic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
        return $this;
    }
    public function makeProtected()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
        return $this;
    }
    public function makePrivate()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
        return $this;
    }
    public function makeStatic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC);
        return $this;
    }
    public function makeAbstract()
    {
        if (!empty($this->stmts)) {
            throw new \LogicException('Cannot make method with statements abstract');
        }
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT);
        $this->stmts = null;
        return $this;
    }
    public function makeFinal()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
        return $this;
    }
    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;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt;
class Interface_ extends Declaration
{
    protected $name;
    protected $extends = [];
    protected $constants = [];
    protected $methods = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function extend(...$interfaces)
    {
        foreach ($interfaces as $interface) {
            $this->extends[] = BuilderHelpers::normalizeName($interface);
        }
        return $this;
    }
    public function addStmt($stmt)
    {
        $stmt = BuilderHelpers::normalizeNode($stmt);
        if ($stmt instanceof Stmt\ClassConst) {
            $this->constants[] = $stmt;
        } elseif ($stmt instanceof Stmt\ClassMethod) {
            $stmt->stmts = null;
            $this->methods[] = $stmt;
        } else {
            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
        }
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt;
use Cvphar\PhpParser\Node\ComplexType;
class Property implements PhpParser\Builder
{
    protected $name;
    protected $flags = 0;
    protected $default = null;
    protected $attributes = [];
    protected $type;
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function makePublic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
        return $this;
    }
    public function makeProtected()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
        return $this;
    }
    public function makePrivate()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
        return $this;
    }
    public function makeStatic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC);
        return $this;
    }
    public function makeReadonly()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY);
        return $this;
    }
    public function setDefault($value)
    {
        $this->default = BuilderHelpers::normalizeValue($value);
        return $this;
    }
    public function setDocComment($docComment)
    {
        $this->attributes = ['comments' => [BuilderHelpers::normalizeDocComment($docComment)]];
        return $this;
    }
    public function setType($type)
    {
        $this->type = BuilderHelpers::normalizeType($type);
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    public function getNode() : PhpParser\Node
    {
        return new Stmt\Property($this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC, [new Stmt\PropertyProperty($this->name, $this->default)], $this->attributes, $this->type, $this->attributeGroups);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
abstract class Declaration implements PhpParser\Builder
{
    protected $attributes = [];
    public abstract function addStmt($stmt);
    public function addStmts(array $stmts)
    {
        foreach ($stmts as $stmt) {
            $this->addStmt($stmt);
        }
        return $this;
    }
    public function setDocComment($docComment)
    {
        $this->attributes['comments'] = [BuilderHelpers::normalizeDocComment($docComment)];
        return $this;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class Function_ extends FunctionLike
{
    protected $name;
    protected $stmts = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function addStmt($stmt)
    {
        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser\Builder;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class Use_ implements Builder
{
    protected $name;
    protected $type;
    protected $alias = null;
    public function __construct($name, int $type)
    {
        $this->name = BuilderHelpers::normalizeName($name);
        $this->type = $type;
    }
    public function as(string $alias)
    {
        $this->alias = $alias;
        return $this;
    }
    public function getNode() : Node
    {
        return new Stmt\Use_([new Stmt\UseUse($this->name, $this->alias)], $this->type);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
abstract class FunctionLike extends Declaration
{
    protected $returnByRef = \false;
    protected $params = [];
    protected $returnType = null;
    public function makeReturnByRef()
    {
        $this->returnByRef = \true;
        return $this;
    }
    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;
    }
    public function addParams(array $params)
    {
        foreach ($params as $param) {
            $this->addParam($param);
        }
        return $this;
    }
    public function setReturnType($type)
    {
        $this->returnType = BuilderHelpers::normalizeType($type);
        return $this;
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Const_;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Stmt;
class ClassConst implements PhpParser\Builder
{
    protected $flags = 0;
    protected $attributes = [];
    protected $constants = [];
    protected $attributeGroups = [];
    public function __construct($name, $value)
    {
        $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))];
    }
    public function addConst($name, $value)
    {
        $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value));
        return $this;
    }
    public function makePublic()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
        return $this;
    }
    public function makeProtected()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
        return $this;
    }
    public function makePrivate()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
        return $this;
    }
    public function makeFinal()
    {
        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
        return $this;
    }
    public function setDocComment($docComment)
    {
        $this->attributes = ['comments' => [BuilderHelpers::normalizeDocComment($docComment)]];
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    public function getNode() : PhpParser\Node
    {
        return new Stmt\ClassConst($this->constants, $this->flags, $this->attributes, $this->attributeGroups);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt;
class Trait_ extends Declaration
{
    protected $name;
    protected $uses = [];
    protected $properties = [];
    protected $methods = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    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;
        } else {
            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
        }
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    public function getNode() : PhpParser\Node
    {
        return new Stmt\Trait_($this->name, ['stmts' => \array_merge($this->uses, $this->properties, $this->methods), 'attrGroups' => $this->attributeGroups], $this->attributes);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser\Builder;

use Cvphar\PhpParser;
use Cvphar\PhpParser\BuilderHelpers;
use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt;
class Enum_ extends Declaration
{
    protected $name;
    protected $scalarType = null;
    protected $implements = [];
    protected $uses = [];
    protected $enumCases = [];
    protected $constants = [];
    protected $methods = [];
    protected $attributeGroups = [];
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function setScalarType($scalarType)
    {
        $this->scalarType = BuilderHelpers::normalizeType($scalarType);
        return $this;
    }
    public function implement(...$interfaces)
    {
        foreach ($interfaces as $interface) {
            $this->implements[] = BuilderHelpers::normalizeName($interface);
        }
        return $this;
    }
    public function addStmt($stmt)
    {
        $stmt = BuilderHelpers::normalizeNode($stmt);
        $targets = [Stmt\TraitUse::class => &$this->uses, Stmt\EnumCase::class => &$this->enumCases, Stmt\ClassConst::class => &$this->constants, Stmt\ClassMethod::class => &$this->methods];
        $class = \get_class($stmt);
        if (!isset($targets[$class])) {
            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
        }
        $targets[$class][] = $stmt;
        return $this;
    }
    public function addAttribute($attribute)
    {
        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
        return $this;
    }
    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);
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Internal\DiffElem;
use Cvphar\PhpParser\Internal\PrintableNewAnonClassNode;
use Cvphar\PhpParser\Internal\TokenStream;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\AssignOp;
use Cvphar\PhpParser\Node\Expr\BinaryOp;
use Cvphar\PhpParser\Node\Expr\Cast;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Stmt;
abstract class PrettyPrinterAbstract
{
    const FIXUP_PREC_LEFT = 0;
    const FIXUP_PREC_RIGHT = 1;
    const FIXUP_CALL_LHS = 2;
    const FIXUP_DEREF_LHS = 3;
    const FIXUP_BRACED_NAME = 4;
    const FIXUP_VAR_BRACED_NAME = 5;
    const FIXUP_ENCAPSED = 6;
    protected $precedenceMap = [BinaryOp\Pow::class => [0, 1], Expr\BitwiseNot::class => [10, 1], Expr\PreInc::class => [10, 1], Expr\PreDec::class => [10, 1], Expr\PostInc::class => [10, -1], Expr\PostDec::class => [10, -1], Expr\UnaryPlus::class => [10, 1], Expr\UnaryMinus::class => [10, 1], Cast\Int_::class => [10, 1], Cast\Double::class => [10, 1], Cast\String_::class => [10, 1], Cast\Array_::class => [10, 1], Cast\Object_::class => [10, 1], Cast\Bool_::class => [10, 1], Cast\Unset_::class => [10, 1], Expr\ErrorSuppress::class => [10, 1], Expr\Instanceof_::class => [20, 0], Expr\BooleanNot::class => [30, 1], BinaryOp\Mul::class => [40, -1], BinaryOp\Div::class => [40, -1], BinaryOp\Mod::class => [40, -1], BinaryOp\Plus::class => [50, -1], BinaryOp\Minus::class => [50, -1], BinaryOp\Concat::class => [50, -1], BinaryOp\ShiftLeft::class => [60, -1], BinaryOp\ShiftRight::class => [60, -1], BinaryOp\Smaller::class => [70, 0], BinaryOp\SmallerOrEqual::class => [70, 0], BinaryOp\Greater::class => [70, 0], BinaryOp\GreaterOrEqual::class => [70, 0], BinaryOp\Equal::class => [80, 0], BinaryOp\NotEqual::class => [80, 0], BinaryOp\Identical::class => [80, 0], BinaryOp\NotIdentical::class => [80, 0], BinaryOp\Spaceship::class => [80, 0], BinaryOp\BitwiseAnd::class => [90, -1], BinaryOp\BitwiseXor::class => [100, -1], BinaryOp\BitwiseOr::class => [110, -1], BinaryOp\BooleanAnd::class => [120, -1], BinaryOp\BooleanOr::class => [130, -1], BinaryOp\Coalesce::class => [140, 1], Expr\Ternary::class => [150, 0], Expr\Assign::class => [160, 1], Expr\AssignRef::class => [160, 1], AssignOp\Plus::class => [160, 1], AssignOp\Minus::class => [160, 1], AssignOp\Mul::class => [160, 1], AssignOp\Div::class => [160, 1], AssignOp\Concat::class => [160, 1], AssignOp\Mod::class => [160, 1], AssignOp\BitwiseAnd::class => [160, 1], AssignOp\BitwiseOr::class => [160, 1], AssignOp\BitwiseXor::class => [160, 1], AssignOp\ShiftLeft::class => [160, 1], AssignOp\ShiftRight::class => [160, 1], AssignOp\Pow::class => [160, 1], AssignOp\Coalesce::class => [160, 1], Expr\YieldFrom::class => [165, 1], Expr\Print_::class => [168, 1], BinaryOp\LogicalAnd::class => [170, -1], BinaryOp\LogicalXor::class => [180, -1], BinaryOp\LogicalOr::class => [190, -1], Expr\Include_::class => [200, -1]];
    protected $indentLevel;
    protected $nl;
    protected $docStringEndToken;
    protected $canUseSemicolonNamespaces;
    protected $options;
    protected $origTokens;
    protected $nodeListDiffer;
    protected $labelCharMap;
    protected $fixupMap;
    protected $removalMap;
    protected $insertionMap;
    protected $listInsertionMap;
    protected $emptyListInsertionMap;
    protected $modifierChangeMap;
    public function __construct(array $options = [])
    {
        $this->docStringEndToken = '_DOC_STRING_END_' . \mt_rand();
        $defaultOptions = ['shortArraySyntax' => \false];
        $this->options = $options + $defaultOptions;
    }
    protected function resetState()
    {
        $this->indentLevel = 0;
        $this->nl = "\n";
        $this->origTokens = null;
    }
    protected function setIndentLevel(int $level)
    {
        $this->indentLevel = $level;
        $this->nl = "\n" . \str_repeat(' ', $level);
    }
    protected function indent()
    {
        $this->indentLevel += 4;
        $this->nl .= '    ';
    }
    protected function outdent()
    {
        \assert($this->indentLevel >= 4);
        $this->indentLevel -= 4;
        $this->nl = "\n" . \str_repeat(' ', $this->indentLevel);
    }
    public function prettyPrint(array $stmts) : string
    {
        $this->resetState();
        $this->preprocessNodes($stmts);
        return \ltrim($this->handleMagicTokens($this->pStmts($stmts, \false)));
    }
    public function prettyPrintExpr(Expr $node) : string
    {
        $this->resetState();
        return $this->handleMagicTokens($this->p($node));
    }
    public function prettyPrintFile(array $stmts) : string
    {
        if (!$stmts) {
            return "<?php\n\n";
        }
        $p = "<?php\n\n" . $this->prettyPrint($stmts);
        if ($stmts[0] instanceof Stmt\InlineHTML) {
            $p = \preg_replace('/^<\\?php\\s+\\?>\\n?/', '', $p);
        }
        if ($stmts[\count($stmts) - 1] instanceof Stmt\InlineHTML) {
            $p = \preg_replace('/<\\?php$/', '', \rtrim($p));
        }
        return $p;
    }
    protected function preprocessNodes(array $nodes)
    {
        $this->canUseSemicolonNamespaces = \true;
        foreach ($nodes as $node) {
            if ($node instanceof Stmt\Namespace_ && null === $node->name) {
                $this->canUseSemicolonNamespaces = \false;
                break;
            }
        }
    }
    protected function handleMagicTokens(string $str) : string
    {
        $str = \str_replace($this->docStringEndToken . ";\n", ";\n", $str);
        $str = \str_replace($this->docStringEndToken, "\n", $str);
        return $str;
    }
    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;
    }
    protected function pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode) : string
    {
        list($precedence, $associativity) = $this->precedenceMap[$class];
        return $this->pPrec($leftNode, $precedence, $associativity, -1) . $operatorString . $this->pPrec($rightNode, $precedence, $associativity, 1);
    }
    protected function pPrefixOp(string $class, string $operatorString, Node $node) : string
    {
        list($precedence, $associativity) = $this->precedenceMap[$class];
        return $operatorString . $this->pPrec($node, $precedence, $associativity, 1);
    }
    protected function pPostfixOp(string $class, Node $node, string $operatorString) : string
    {
        list($precedence, $associativity) = $this->precedenceMap[$class];
        return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString;
    }
    protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string
    {
        $class = \get_class($node);
        if (isset($this->precedenceMap[$class])) {
            $childPrecedence = $this->precedenceMap[$class][0];
            if ($childPrecedence > $parentPrecedence || $parentPrecedence === $childPrecedence && $parentAssociativity !== $childPosition) {
                return '(' . $this->p($node) . ')';
            }
        }
        return $this->p($node);
    }
    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);
    }
    protected function pCommaSeparated(array $nodes) : string
    {
        return $this->pImplode($nodes, ', ');
    }
    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;
    }
    protected function pComments(array $comments) : string
    {
        $formattedComments = [];
        foreach ($comments as $comment) {
            $formattedComments[] = \str_replace("\n", $this->nl, $comment->getReformattedText());
        }
        return \implode($this->nl, $formattedComments);
    }
    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), 0);
        } else {
            $result = "<?php\n" . $this->pStmts($stmts, \false);
        }
        return \ltrim($this->handleMagicTokens($result));
    }
    protected function pFallback(Node $node)
    {
        return $this->{'p' . $node->getType()}($node);
    }
    protected function p(Node $node, $parentFormatPreserved = \false) : string
    {
        if (!$this->origTokens) {
            return $this->{'p' . $node->getType()}($node);
        }
        $origNode = $node->getAttribute('origNode');
        if (null === $origNode) {
            return $this->pFallback($node);
        }
        $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_) {
            $node = PrintableNewAnonClassNode::fromNewNode($node);
            $origNode = PrintableNewAnonClassNode::fromNewNode($origNode);
        }
        if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) {
            return $this->pFallback($fallbackNode);
        }
        $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) {
                    continue;
                }
                if (\is_array($subNode) && \is_array($origSubNode)) {
                    $listResult = $this->pArray($subNode, $origSubNode, $pos, $indentAdjustment, $type, $subNodeName, $fixupInfo[$subNodeName] ?? null);
                    if (null === $listResult) {
                        return $this->pFallback($fallbackNode);
                    }
                    $result .= $listResult;
                    continue;
                }
                if (\is_int($subNode) && \is_int($origSubNode)) {
                    $key = $type . '->' . $subNodeName;
                    if (!isset($this->modifierChangeMap[$key])) {
                        return $this->pFallback($fallbackNode);
                    }
                    $findToken = $this->modifierChangeMap[$key];
                    $result .= $this->pModifiers($subNode);
                    $pos = $this->origTokens->findRight($pos, $findToken);
                    continue;
                }
                return $this->pFallback($fallbackNode);
            }
            $extraLeft = '';
            $extraRight = '';
            if ($origSubNode !== null) {
                $subStartPos = $origSubNode->getStartTokenPos();
                $subEndPos = $origSubNode->getEndTokenPos();
                \assert($subStartPos >= 0 && $subEndPos >= 0);
            } else {
                if ($subNode === null) {
                    continue;
                }
                $key = $type . '->' . $subNodeName;
                if (!isset($this->insertionMap[$key])) {
                    return $this->pFallback($fallbackNode);
                }
                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) {
                    $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos);
                }
                $subEndPos = $subStartPos - 1;
            }
            if (null === $subNode) {
                $key = $type . '->' . $subNodeName;
                if (!isset($this->removalMap[$key])) {
                    return $this->pFallback($fallbackNode);
                }
                $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 (isset($fixupInfo[$subNodeName]) && $subNode->getAttribute('origNode') !== $origSubNode) {
                    $fixup = $fixupInfo[$subNodeName];
                    $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos);
                } else {
                    $res = $this->p($subNode, \true);
                }
                $this->safeAppend($result, $res);
                $this->setIndentLevel($origIndentLevel);
                $result .= $extraRight;
            }
            $pos = $subEndPos + 1;
        }
        $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment);
        return $result;
    }
    protected function pArray(array $nodes, array $origNodes, int &$pos, int $indentAdjustment, string $parentNodeType, string $subNodeName, $fixup)
    {
        $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes);
        $mapKey = $parentNodeType . '->' . $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)) {
                return null;
            }
        }
        $result = '';
        foreach ($diff as $i => $diffElem) {
            $diffType = $diffElem->type;
            $arrItem = $diffElem->new;
            $origArrItem = $diffElem->old;
            if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) {
                $beforeFirstKeepOrReplace = \false;
                if ($origArrItem === null || $arrItem === null) {
                    if ($origArrItem === $arrItem) {
                        continue;
                    }
                    return null;
                }
                if (!$arrItem instanceof Node || !$origArrItem instanceof Node) {
                    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) {
                    $commentStartPos = $itemStartPos;
                }
                if ($skipRemovedNode) {
                    if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || $this->origTokens->haveTagInRange($pos, $itemStartPos))) {
                        $this->setIndentLevel($origIndentLevel);
                        return null;
                    }
                } else {
                    $result .= $this->origTokens->getTokenCode($pos, $commentStartPos, $indentAdjustment);
                }
                if (!empty($delayedAdd)) {
                    foreach ($delayedAdd as $delayedAddNode) {
                        if ($insertNewline) {
                            $delayedAddComments = $delayedAddNode->getComments();
                            if ($delayedAddComments) {
                                $result .= $this->pComments($delayedAddComments) . $this->nl;
                            }
                        }
                        $this->safeAppend($result, $this->p($delayedAddNode, \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);
                }
                $skipRemovedNode = \false;
            } elseif ($diffType === DiffElem::TYPE_ADD) {
                if (null === $insertStr) {
                    return null;
                }
                if ($insertStr === ', ' && ($this->isMultiline($origNodes) || $arrItem->getComments())) {
                    $insertStr = ',';
                    $insertNewline = \true;
                }
                if ($beforeFirstKeepOrReplace) {
                    $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) {
                    return null;
                }
                $itemStartPos = $origArrItem->getStartTokenPos();
                $itemEndPos = $origArrItem->getEndTokenPos();
                \assert($itemStartPos >= 0 && $itemEndPos >= 0);
                $origComments = $origArrItem->getComments();
                if ($origComments) {
                    $itemStartPos = $origComments[0]->getStartTokenPos();
                }
                if ($i === 0) {
                    $result .= $this->origTokens->getTokenCode($pos, $itemStartPos, $indentAdjustment);
                    $skipRemovedNode = \true;
                } else {
                    if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || $this->origTokens->haveTagInRange($pos, $itemStartPos))) {
                        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, \true);
            }
            $this->safeAppend($result, $res);
            $this->setIndentLevel($origIndentLevel);
            $pos = $itemEndPos + 1;
        }
        if ($skipRemovedNode) {
            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, \true);
                $first = \false;
            }
            $result .= $extraRight === "\n" ? $this->nl : $extraRight;
        }
        return $result;
    }
    protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string
    {
        switch ($fixup) {
            case self::FIXUP_PREC_LEFT:
            case self::FIXUP_PREC_RIGHT:
                if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) {
                    list($precedence, $associativity) = $this->precedenceMap[$parentClass];
                    return $this->pPrec($subNode, $precedence, $associativity, $fixup === self::FIXUP_PREC_LEFT ? -1 : 1);
                }
                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_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 Scalar\EncapsedStringPart && !$this->origTokens->haveBraces($subStartPos, $subEndPos)) {
                    return '{' . $this->p($subNode) . '}';
                }
                break;
            default:
                throw new \Exception('Cannot happen');
        }
        return $this->p($subNode);
    }
    protected function safeAppend(string &$str, string $append)
    {
        if ($str === "") {
            $str = $append;
            return;
        }
        if ($append === "") {
            return;
        }
        if (!$this->labelCharMap[$append[0]] || !$this->labelCharMap[$str[\strlen($str) - 1]]) {
            $str .= $append;
        } else {
            $str .= " " . $append;
        }
    }
    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_);
    }
    protected function dereferenceLhsRequiresParens(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\ConstFetch || $node instanceof Expr\ClassConstFetch);
    }
    protected function pModifiers(int $modifiers)
    {
        return ($modifiers & Stmt\Class_::MODIFIER_PUBLIC ? 'public ' : '') . ($modifiers & Stmt\Class_::MODIFIER_PROTECTED ? 'protected ' : '') . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : '');
    }
    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")) {
                    return \false;
                }
            }
            $pos = $endPos;
        }
        return \true;
    }
    protected function initializeLabelCharMap()
    {
        if ($this->labelCharMap) {
            return;
        }
        $this->labelCharMap = [];
        for ($i = 0; $i < 256; $i++) {
            $chr = \chr($i);
            $this->labelCharMap[$chr] = $i >= 0x7f || \ctype_alnum($chr);
        }
    }
    protected function initializeNodeListDiffer()
    {
        if ($this->nodeListDiffer) {
            return;
        }
        $this->nodeListDiffer = new Internal\Differ(function ($a, $b) {
            if ($a instanceof Node && $b instanceof Node) {
                return $a === $b->getAttribute('origNode');
            }
            return $a === null && $b === null;
        });
    }
    protected function initializeFixupMap()
    {
        if ($this->fixupMap) {
            return;
        }
        $this->fixupMap = [Expr\PreInc::class => ['var' => self::FIXUP_PREC_RIGHT], Expr\PreDec::class => ['var' => self::FIXUP_PREC_RIGHT], Expr\PostInc::class => ['var' => self::FIXUP_PREC_LEFT], Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], Expr\Instanceof_::class => ['expr' => self::FIXUP_PREC_LEFT, 'class' => self::FIXUP_PREC_RIGHT], Expr\Ternary::class => ['cond' => self::FIXUP_PREC_LEFT, 'else' => self::FIXUP_PREC_RIGHT], Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], 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_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\Encapsed::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];
        }
        $assignOps = [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];
        foreach ($assignOps as $assignOp) {
            $this->fixupMap[$assignOp] = ['var' => self::FIXUP_PREC_LEFT, 'expr' => self::FIXUP_PREC_RIGHT];
        }
        $prefixOps = [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];
        foreach ($prefixOps as $prefixOp) {
            $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_RIGHT];
        }
    }
    protected function initializeRemovalMap()
    {
        if ($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, 'Expr_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_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, 'Stmt_PropertyProperty->default' => $stripEquals, 'Stmt_Return->expr' => $stripBoth, 'Stmt_StaticVar->default' => $stripEquals, 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, 'Stmt_TryCatch->finally' => $stripLeft];
    }
    protected function initializeInsertionMap()
    {
        if ($this->insertionMap) {
            return;
        }
        $this->insertionMap = ['Expr_ArrayDimFetch->dim' => ['[', \false, null, null], 'Expr_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_Class->extends' => [null, \false, ' extends ', null], 'Stmt_Enum->scalarType' => [null, \false, ' : ', null], 'Stmt_EnumCase->expr' => [null, \false, ' = ', null], 'Expr_PrintableNewAnonClass->extends' => [null, ' 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, ' '], 'Stmt_PropertyProperty->default' => [null, \false, ' = ', null], 'Stmt_Return->expr' => [\T_RETURN, \false, ' ', null], 'Stmt_StaticVar->default' => [null, \false, ' = ', null], 'Stmt_TryCatch->finally' => [null, \false, ' ', null]];
    }
    protected function initializeListInsertionMap()
    {
        if ($this->listInsertionMap) {
            return;
        }
        $this->listInsertionMap = ['Stmt_Catch->types' => '|', 'UnionType->types' => '|', 'IntersectionType->types' => '&', 'Stmt_If->elseifs' => ' ', 'Stmt_TryCatch->catches' => ' ', 'Expr_Array->items' => ', ', 'Expr_ArrowFunction->params' => ', ', 'Expr_Closure->params' => ', ', 'Expr_Closure->uses' => ', ', 'Expr_FuncCall->args' => ', ', 'Expr_Isset->vars' => ', ', 'Expr_List->items' => ', ', 'Expr_MethodCall->args' => ', ', 'Expr_NullsafeMethodCall->args' => ', ', 'Expr_New->args' => ', ', 'Expr_PrintableNewAnonClass->args' => ', ', 'Expr_StaticCall->args' => ', ', 'Stmt_ClassConst->consts' => ', ', 'Stmt_ClassMethod->params' => ', ', 'Stmt_Class->implements' => ', ', 'Stmt_Enum->implements' => ', ', 'Expr_PrintableNewAnonClass->implements' => ', ', 'Stmt_Const->consts' => ', ', 'Stmt_Declare->declares' => ', ', 'Stmt_Echo->exprs' => ', ', 'Stmt_For->init' => ', ', 'Stmt_For->cond' => ', ', 'Stmt_For->loop' => ', ', 'Stmt_Function->params' => ', ', 'Stmt_Global->vars' => ', ', 'Stmt_GroupUse->uses' => ', ', 'Stmt_Interface->extends' => ', ', 'Stmt_Match->arms' => ', ', 'Stmt_Property->props' => ', ', 'Stmt_StaticVar->vars' => ', ', 'Stmt_TraitUse->traits' => ', ', 'Stmt_TraitUseAdaptation_Precedence->insteadof' => ', ', 'Stmt_Unset->vars' => ', ', 'Stmt_Use->uses' => ', ', 'MatchArm->conds' => ', ', 'AttributeGroup->attrs' => ', ', 'Expr_Closure->stmts' => "\n", 'Stmt_Case->stmts' => "\n", 'Stmt_Catch->stmts' => "\n", 'Stmt_Class->stmts' => "\n", 'Stmt_Enum->stmts' => "\n", 'Expr_PrintableNewAnonClass->stmts' => "\n", 'Stmt_Interface->stmts' => "\n", 'Stmt_Trait->stmts' => "\n", 'Stmt_ClassMethod->stmts' => "\n", 'Stmt_Declare->stmts' => "\n", 'Stmt_Do->stmts' => "\n", 'Stmt_ElseIf->stmts' => "\n", 'Stmt_Else->stmts' => "\n", 'Stmt_Finally->stmts' => "\n", 'Stmt_Foreach->stmts' => "\n", 'Stmt_For->stmts' => "\n", 'Stmt_Function->stmts' => "\n", 'Stmt_If->stmts' => "\n", 'Stmt_Namespace->stmts' => "\n", 'Stmt_Class->attrGroups' => "\n", 'Stmt_Enum->attrGroups' => "\n", 'Stmt_EnumCase->attrGroups' => "\n", 'Stmt_Interface->attrGroups' => "\n", 'Stmt_Trait->attrGroups' => "\n", 'Stmt_Function->attrGroups' => "\n", 'Stmt_ClassMethod->attrGroups' => "\n", 'Stmt_ClassConst->attrGroups' => "\n", 'Stmt_Property->attrGroups' => "\n", 'Expr_PrintableNewAnonClass->attrGroups' => ' ', 'Expr_Closure->attrGroups' => ' ', 'Expr_ArrowFunction->attrGroups' => ' ', 'Param->attrGroups' => ' ', 'Stmt_Switch->cases' => "\n", 'Stmt_TraitUse->adaptations' => "\n", 'Stmt_TryCatch->stmts' => "\n", 'Stmt_While->stmts' => "\n", 'File->stmts' => "\n"];
    }
    protected function initializeEmptyListInsertionMap()
    {
        if ($this->emptyListInsertionMap) {
            return;
        }
        $this->emptyListInsertionMap = ['Expr_ArrowFunction->params' => ['(', '', ''], 'Expr_Closure->uses' => [')', ' use(', ')'], 'Expr_Closure->params' => ['(', '', ''], 'Expr_FuncCall->args' => ['(', '', ''], 'Expr_MethodCall->args' => ['(', '', ''], 'Expr_NullsafeMethodCall->args' => ['(', '', ''], 'Expr_New->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], 'Expr_StaticCall->args' => ['(', '', ''], 'Stmt_Class->implements' => [null, ' implements ', ''], 'Stmt_Enum->implements' => [null, ' implements ', ''], 'Stmt_ClassMethod->params' => ['(', '', ''], 'Stmt_Interface->extends' => [null, ' extends ', ''], 'Stmt_Function->params' => ['(', '', ''], 'Stmt_Interface->attrGroups' => [null, '', "\n"], 'Stmt_Class->attrGroups' => [null, '', "\n"], 'Stmt_ClassConst->attrGroups' => [null, '', "\n"], 'Stmt_ClassMethod->attrGroups' => [null, '', "\n"], 'Stmt_Function->attrGroups' => [null, '', "\n"], 'Stmt_Property->attrGroups' => [null, '', "\n"], 'Stmt_Trait->attrGroups' => [null, '', "\n"], 'Expr_ArrowFunction->attrGroups' => [null, '', ' '], 'Expr_Closure->attrGroups' => [null, '', ' '], 'Expr_PrintableNewAnonClass->attrGroups' => [\T_NEW, ' ', '']];
    }
    protected function initializeModifierChangeMap()
    {
        if ($this->modifierChangeMap) {
            return;
        }
        $this->modifierChangeMap = ['Stmt_ClassConst->flags' => \T_CONST, 'Stmt_ClassMethod->flags' => \T_FUNCTION, 'Stmt_Class->flags' => \T_CLASS, 'Stmt_Property->flags' => \T_VARIABLE, 'Param->flags' => \T_VARIABLE];
    }
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

interface NodeTraverserInterface
{
    public function addVisitor(NodeVisitor $visitor);
    public function removeVisitor(NodeVisitor $visitor);
    public function traverse(array $nodes) : array;
}
<?php

declare (strict_types=1);
namespace Cvphar\PhpParser;

use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\BinaryOp\Concat;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Scalar\String_;
use Cvphar\PhpParser\Node\Stmt\Use_;
class BuilderFactory
{
    public function attribute($name, array $args = []) : Node\Attribute
    {
        return new Node\Attribute(BuilderHelpers::normalizeName($name), $this->args($args));
    }
    public function namespace($name) : Builder\Namespace_
    {
        return new Builder\Namespace_($name);
    }
    public function class(string $name) : Builder\Class_
    {
        return new Builder\Class_($name);
    }
    public function interface(string $name) : Builder\Interface_
    {
        return new Builder\Interface_($name);
    }
    public function trait(string $name) : Builder\Trait_
    {
        return new Builder\Trait_($name);
    }
    public function enum(string $name) : Builder\Enum_
    {
        return new Builder\Enum_($name);
    }
    public function useTrait(...$traits) : Builder\TraitUse
    {
        return new Builder\TraitUse(...$traits);
    }
    public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation
    {
        if ($method === null) {
            $method = $trait;
            $trait = null;
        }
        return new Builder\TraitUseAdaptation($trait, $method);
    }
    public function method(string $name) : Builder\Method
    {
        return new Builder\Method($name);
    }
    public function param(string $name) : Builder\Param
    {
        return new Builder\Param($name);
    }
    public function property(string $name) : Builder\Property
    {
        return new Builder\Property($name);
    }
    public function function(string $name) : Builder\Function_
    {
        return new Builder\Function_($name);
    }
    public function use($name) : Builder\Use_
    {
        return new Builder\Use_($name, Use_::TYPE_NORMAL);
    }
    public function useFunction($name) : Builder\Use_
    {
        return new Builder\Use_($name, Use_::TYPE_FUNCTION);
    }
    public function useConst($name) : Builder\Use_
    {
        return new Builder\Use_($name, Use_::TYPE_CONSTANT);
    }
    public function classConst($name, $value) : Builder\ClassConst
    {
        return new Builder\ClassConst($name, $value);
    }
    public function enumCase($name) : Builder\EnumCase
    {
        return new Builder\EnumCase($name);
    }
    public function val($value) : Expr
    {
        return BuilderHelpers::normalizeValue($value);
    }
    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);
    }
    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;
    }
    public function funcCall($name, array $args = []) : Expr\FuncCall
    {
        return new Expr\FuncCall(BuilderHelpers::normalizeNameOrExpr($name), $this->args($args));
    }
    public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall
    {
        return new Expr\MethodCall($var, BuilderHelpers::normalizeIdentifierOrExpr($name), $this->args($args));
    }
    public function staticCall($class, $name, array $args = []) : Expr\StaticCall
    {
        return new Expr\StaticCall(BuilderHelpers::normalizeNameOrExpr($class), BuilderHelpers::normalizeIdentifierOrExpr($name), $this->args($args));
    }
    public function new($class, array $args = []) : Expr\New_
    {
        return new Expr\New_(BuilderHelpers::normalizeNameOrExpr($class), $this->args($args));
    }
    public function constFetch($name) : Expr\ConstFetch
    {
        return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
    }
    public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch
    {
        return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));
    }
    public function classConstFetch($class, $name) : Expr\ClassConstFetch
    {
        return new Expr\ClassConstFetch(BuilderHelpers::normalizeNameOrExpr($class), BuilderHelpers::normalizeIdentifier($name));
    }
    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;
    }
    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');
    }
}
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
);

Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    https://www.php-fig.org/psr/psr-0/
 * @see    https://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    /** @var ?string */
    private $vendorDir;

    // PSR-4
    /**
     * @var array[]
     * @psalm-var array<string, array<string, int>>
     */
    private $prefixLengthsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, array<int, string>>
     */
    private $prefixDirsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr4 = array();

    // PSR-0
    /**
     * @var array[]
     * @psalm-var array<string, array<string, string[]>>
     */
    private $prefixesPsr0 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr0 = array();

    /** @var bool */
    private $useIncludePath = false;

    /**
     * @var string[]
     * @psalm-var array<string, string>
     */
    private $classMap = array();

    /** @var bool */
    private $classMapAuthoritative = false;

    /**
     * @var bool[]
     * @psalm-var array<string, bool>
     */
    private $missingClasses = array();

    /** @var ?string */
    private $apcuPrefix;

    /**
     * @var self[]
     */
    private static $registeredLoaders = array();

    /**
     * @param ?string $vendorDir
     */
    public function __construct($vendorDir = null)
    {
        $this->vendorDir = $vendorDir;
    }

    /**
     * @return string[]
     */
    public function getPrefixes()
    {
        if (!empty($this->prefixesPsr0)) {
            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
        }

        return array();
    }

    /**
     * @return array[]
     * @psalm-return array<string, array<int, string>>
     */
    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    /**
     * @return string[] Array of classname => path
     * @psalm-return array<string, string>
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param string[] $classMap Class to filename map
     * @psalm-param array<string, string> $classMap
     *
     * @return void
     */
    public function addClassMap(array $classMap)
    {
        if ($this->classMap) {
            $this->classMap = array_merge($this->classMap, $classMap);
        } else {
            $this->classMap = $classMap;
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix, either
     * appending or prepending to the ones previously set for this prefix.
     *
     * @param string          $prefix  The prefix
     * @param string[]|string $paths   The PSR-0 root directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @return void
     */
    public function add($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            if ($prepend) {
                $this->fallbackDirsPsr0 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr0
                );
            } else {
                $this->fallbackDirsPsr0 = array_merge(
                    $this->fallbackDirsPsr0,
                    (array) $paths
                );
            }

            return;
        }

        $first = $prefix[0];
        if (!isset($this->prefixesPsr0[$first][$prefix])) {
            $this->prefixesPsr0[$first][$prefix] = (array) $paths;

            return;
        }
        if ($prepend) {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                (array) $paths,
                $this->prefixesPsr0[$first][$prefix]
            );
        } else {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                $this->prefixesPsr0[$first][$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace, either
     * appending or prepending to the ones previously set for this namespace.
     *
     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths   The PSR-4 base directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
                $this->fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr4
                );
            } else {
                $this->fallbackDirsPsr4 = array_merge(
                    $this->fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
            // Register directories for a new namespace.
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        } elseif ($prepend) {
            // Prepend directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                (array) $paths,
                $this->prefixDirsPsr4[$prefix]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                $this->prefixDirsPsr4[$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix,
     * replacing any others previously set for this prefix.
     *
     * @param string          $prefix The prefix
     * @param string[]|string $paths  The PSR-0 base directories
     *
     * @return void
     */
    public function set($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr0 = (array) $paths;
        } else {
            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace,
     * replacing any others previously set for this namespace.
     *
     * @param string          $prefix The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths  The PSR-4 base directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function setPsr4($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr4 = (array) $paths;
        } else {
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        }
    }

    /**
     * Turns on searching the include path for class files.
     *
     * @param bool $useIncludePath
     *
     * @return void
     */
    public function setUseIncludePath($useIncludePath)
    {
        $this->useIncludePath = $useIncludePath;
    }

    /**
     * Can be used to check if the autoloader uses the include path to check
     * for classes.
     *
     * @return bool
     */
    public function getUseIncludePath()
    {
        return $this->useIncludePath;
    }

    /**
     * Turns off searching the prefix and fallback directories for classes
     * that have not been registered with the class map.
     *
     * @param bool $classMapAuthoritative
     *
     * @return void
     */
    public function setClassMapAuthoritative($classMapAuthoritative)
    {
        $this->classMapAuthoritative = $classMapAuthoritative;
    }

    /**
     * Should class lookup fail if not found in the current class map?
     *
     * @return bool
     */
    public function isClassMapAuthoritative()
    {
        return $this->classMapAuthoritative;
    }

    /**
     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
     *
     * @param string|null $apcuPrefix
     *
     * @return void
     */
    public function setApcuPrefix($apcuPrefix)
    {
        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
    }

    /**
     * The APCu prefix in use, or null if APCu caching is not enabled.
     *
     * @return string|null
     */
    public function getApcuPrefix()
    {
        return $this->apcuPrefix;
    }

    /**
     * Registers this instance as an autoloader.
     *
     * @param bool $prepend Whether to prepend the autoloader or not
     *
     * @return void
     */
    public function register($prepend = false)
    {
        spl_autoload_register(array($this, 'loadClass'), true, $prepend);

        if (null === $this->vendorDir) {
            return;
        }

        if ($prepend) {
            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
        } else {
            unset(self::$registeredLoaders[$this->vendorDir]);
            self::$registeredLoaders[$this->vendorDir] = $this;
        }
    }

    /**
     * Unregisters this instance as an autoloader.
     *
     * @return void
     */
    public function unregister()
    {
        spl_autoload_unregister(array($this, 'loadClass'));

        if (null !== $this->vendorDir) {
            unset(self::$registeredLoaders[$this->vendorDir]);
        }
    }

    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return true|null True if loaded, null otherwise
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            includeFile($file);

            return true;
        }

        return null;
    }

    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile($class)
    {
        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
            return false;
        }
        if (null !== $this->apcuPrefix) {
            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
            if ($hit) {
                return $file;
            }
        }

        $file = $this->findFileWithExtension($class, '.php');

        // Search for Hack files if we are running on HHVM
        if (false === $file && defined('HHVM_VERSION')) {
            $file = $this->findFileWithExtension($class, '.hh');
        }

        if (null !== $this->apcuPrefix) {
            apcu_add($this->apcuPrefix.$class, $file);
        }

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }

    /**
     * Returns the currently registered loaders indexed by their corresponding vendor directories.
     *
     * @return self[]
     */
    public static function getRegisteredLoaders()
    {
        return self::$registeredLoaders;
    }

    /**
     * @param  string       $class
     * @param  string       $ext
     * @return string|false
     */
    private function findFileWithExtension($class, $ext)
    {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

        $first = $class[0];
        if (isset($this->prefixLengthsPsr4[$first])) {
            $subPath = $class;
            while (false !== $lastPos = strrpos($subPath, '\\')) {
                $subPath = substr($subPath, 0, $lastPos);
                $search = $subPath . '\\';
                if (isset($this->prefixDirsPsr4[$search])) {
                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
                        if (file_exists($file = $dir . $pathEnd)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-4 fallback dirs
        foreach ($this->fallbackDirsPsr4 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
                return $file;
            }
        }

        // PSR-0 lookup
        if (false !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
        } else {
            // PEAR-like class name
            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
        }

        if (isset($this->prefixesPsr0[$first])) {
            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
                if (0 === strpos($class, $prefix)) {
                    foreach ($dirs as $dir) {
                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-0 fallback dirs
        foreach ($this->fallbackDirsPsr0 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                return $file;
            }
        }

        // PSR-0 include paths.
        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
            return $file;
        }

        return false;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 *
 * @param  string $file
 * @return void
 * @private
 */
function includeFile($file)
{
    include $file;
}
<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'Cvphar\\Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
    'Cvphar\\Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
    'Cvphar\\Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
    'Cvphar\\Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
    'Cvphar\\Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
    'Cvphar\\Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
    'Cvphar\\Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => array($vendorDir . '/stecman/symfony-console-completion/src'),
    'Cvphar\\Psy\\' => array($vendorDir . '/psy/psysh/src'),
    'Cvphar\\Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
    'Cvphar\\Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
    'Cvphar\\PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
    'Cvphar\\LesserEvil\\' => array($vendorDir . '/lesser-evil/shell-verbosity-is-evil/src'),
    'Civi\\Cv\\' => array($baseDir . '/lib/src', $baseDir . '/src'),
);
<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'Civi\\Cv\\Application' => $baseDir . '/src/Application.php',
    'Civi\\Cv\\Bootstrap' => $baseDir . '/lib/src/Bootstrap.php',
    'Civi\\Cv\\BuildkitReader' => $baseDir . '/lib/src/BuildkitReader.php',
    'Civi\\Cv\\CmsBootstrap' => $baseDir . '/lib/src/CmsBootstrap.php',
    'Civi\\Cv\\Command\\AngularHtmlListCommand' => $baseDir . '/src/Command/AngularHtmlListCommand.php',
    'Civi\\Cv\\Command\\AngularHtmlShowCommand' => $baseDir . '/src/Command/AngularHtmlShowCommand.php',
    'Civi\\Cv\\Command\\AngularModuleListCommand' => $baseDir . '/src/Command/AngularModuleListCommand.php',
    'Civi\\Cv\\Command\\Api4Command' => $baseDir . '/src/Command/Api4Command.php',
    'Civi\\Cv\\Command\\ApiBatchCommand' => $baseDir . '/src/Command/ApiBatchCommand.php',
    'Civi\\Cv\\Command\\ApiCommand' => $baseDir . '/src/Command/ApiCommand.php',
    'Civi\\Cv\\Command\\BaseCommand' => $baseDir . '/src/Command/BaseCommand.php',
    'Civi\\Cv\\Command\\BaseExtensionCommand' => $baseDir . '/src/Command/BaseExtensionCommand.php',
    'Civi\\Cv\\Command\\BootCommand' => $baseDir . '/src/Command/BootCommand.php',
    'Civi\\Cv\\Command\\CliCommand' => $baseDir . '/src/Command/CliCommand.php',
    'Civi\\Cv\\Command\\CoreCheckReqCommand' => $baseDir . '/src/Command/CoreCheckReqCommand.php',
    'Civi\\Cv\\Command\\CoreInstallCommand' => $baseDir . '/src/Command/CoreInstallCommand.php',
    'Civi\\Cv\\Command\\CoreUninstallCommand' => $baseDir . '/src/Command/CoreUninstallCommand.php',
    'Civi\\Cv\\Command\\DebugContainerCommand' => $baseDir . '/src/Command/DebugContainerCommand.php',
    'Civi\\Cv\\Command\\DebugDispatcherCommand' => $baseDir . '/src/Command/DebugDispatcherCommand.php',
    'Civi\\Cv\\Command\\EditCommand' => $baseDir . '/src/Command/EditCommand.php',
    'Civi\\Cv\\Command\\EvalCommand' => $baseDir . '/src/Command/EvalCommand.php',
    'Civi\\Cv\\Command\\ExtensionDisableCommand' => $baseDir . '/src/Command/ExtensionDisableCommand.php',
    'Civi\\Cv\\Command\\ExtensionDownloadCommand' => $baseDir . '/src/Command/ExtensionDownloadCommand.php',
    'Civi\\Cv\\Command\\ExtensionEnableCommand' => $baseDir . '/src/Command/ExtensionEnableCommand.php',
    'Civi\\Cv\\Command\\ExtensionListCommand' => $baseDir . '/src/Command/ExtensionListCommand.php',
    'Civi\\Cv\\Command\\ExtensionUninstallCommand' => $baseDir . '/src/Command/ExtensionUninstallCommand.php',
    'Civi\\Cv\\Command\\ExtensionUpgradeDbCommand' => $baseDir . '/src/Command/ExtensionUpgradeDbCommand.php',
    'Civi\\Cv\\Command\\FillCommand' => $baseDir . '/src/Command/FillCommand.php',
    'Civi\\Cv\\Command\\FlushCommand' => $baseDir . '/src/Command/FlushCommand.php',
    'Civi\\Cv\\Command\\HttpCommand' => $baseDir . '/src/Command/HttpCommand.php',
    'Civi\\Cv\\Command\\PathCommand' => $baseDir . '/src/Command/PathCommand.php',
    'Civi\\Cv\\Command\\PipeCommand' => $baseDir . '/src/Command/PipeCommand.php',
    'Civi\\Cv\\Command\\ScriptCommand' => $baseDir . '/src/Command/ScriptCommand.php',
    'Civi\\Cv\\Command\\SettingGetCommand' => $baseDir . '/src/Command/SettingGetCommand.php',
    'Civi\\Cv\\Command\\SettingRevertCommand' => $baseDir . '/src/Command/SettingRevertCommand.php',
    'Civi\\Cv\\Command\\SettingSetCommand' => $baseDir . '/src/Command/SettingSetCommand.php',
    'Civi\\Cv\\Command\\ShowCommand' => $baseDir . '/src/Command/ShowCommand.php',
    'Civi\\Cv\\Command\\SqlCliCommand' => $baseDir . '/src/Command/SqlCliCommand.php',
    'Civi\\Cv\\Command\\UpgradeCommand' => $baseDir . '/src/Command/UpgradeCommand.php',
    'Civi\\Cv\\Command\\UpgradeDbCommand' => $baseDir . '/src/Command/UpgradeDbCommand.php',
    'Civi\\Cv\\Command\\UpgradeDlCommand' => $baseDir . '/src/Command/UpgradeDlCommand.php',
    'Civi\\Cv\\Command\\UpgradeGetCommand' => $baseDir . '/src/Command/UpgradeGetCommand.php',
    'Civi\\Cv\\Command\\UpgradeReportCommand' => $baseDir . '/src/Command/UpgradeReportCommand.php',
    'Civi\\Cv\\Command\\UrlCommand' => $baseDir . '/src/Command/UrlCommand.php',
    'Civi\\Cv\\Config' => $baseDir . '/lib/src/Config.php',
    'Civi\\Cv\\Encoder' => $baseDir . '/src/Encoder.php',
    'Civi\\Cv\\ErrorHandler' => $baseDir . '/lib/src/ErrorHandler.php',
    'Civi\\Cv\\Exception\\ProcessErrorException' => $baseDir . '/src/Exception/ProcessErrorException.php',
    'Civi\\Cv\\Log\\InternalLogger' => $baseDir . '/lib/src/Log/InternalLogger.php',
    'Civi\\Cv\\Log\\Logger' => $baseDir . '/lib/src/Log/Logger.php',
    'Civi\\Cv\\Log\\StderrLogger' => $baseDir . '/lib/src/Log/StderrLogger.php',
    'Civi\\Cv\\Log\\SymfonyConsoleLogger' => $baseDir . '/lib/src/Log/SymfonyConsoleLogger.php',
    'Civi\\Cv\\PharOut\\PharOut' => $baseDir . '/lib/src/PharOut/PharOut.php',
    'Civi\\Cv\\PharOut\\PharPolicyTrait' => $baseDir . '/lib/src/PharOut/PharPolicyTrait.php',
    'Civi\\Cv\\SiteConfigReader' => $baseDir . '/lib/src/SiteConfigReader.php',
    'Civi\\Cv\\Util\\AbstractPlusParser' => $baseDir . '/src/Util/AbstractPlusParser.php',
    'Civi\\Cv\\Util\\Api4ArgParser' => $baseDir . '/src/Util/Api4ArgParser.php',
    'Civi\\Cv\\Util\\ArrayUtil' => $baseDir . '/src/Util/ArrayUtil.php',
    'Civi\\Cv\\Util\\BootTrait' => $baseDir . '/lib/src/Util/BootTrait.php',
    'Civi\\Cv\\Util\\CliEditor' => $baseDir . '/src/Util/CliEditor.php',
    'Civi\\Cv\\Util\\ConsoleQueueRunner' => $baseDir . '/src/Util/ConsoleQueueRunner.php',
    'Civi\\Cv\\Util\\Cv' => $baseDir . '/src/Util/Cv.php',
    'Civi\\Cv\\Util\\Datasource' => $baseDir . '/src/Util/Datasource.php',
    'Civi\\Cv\\Util\\DebugDispatcherTrait' => $baseDir . '/src/Util/DebugDispatcherTrait.php',
    'Civi\\Cv\\Util\\Filesystem' => $baseDir . '/lib/src/Util/Filesystem.php',
    'Civi\\Cv\\Util\\FilesystemTrait' => $baseDir . '/lib/src/Util/FilesystemTrait.php',
    'Civi\\Cv\\Util\\HeadlessDownloader' => $baseDir . '/src/Util/HeadlessDownloader.php',
    'Civi\\Cv\\Util\\OptionCallbackTrait' => $baseDir . '/src/Util/OptionCallbackTrait.php',
    'Civi\\Cv\\Util\\Process' => $baseDir . '/src/Util/Process.php',
    'Civi\\Cv\\Util\\PsrLogger' => $baseDir . '/src/Util/PsrLogger.php',
    'Civi\\Cv\\Util\\Rand' => $baseDir . '/src/Util/Rand.php',
    'Civi\\Cv\\Util\\Relativizer' => $baseDir . '/src/Util/Relativizer.php',
    'Civi\\Cv\\Util\\SettingArgParser' => $baseDir . '/src/Util/SettingArgParser.php',
    'Civi\\Cv\\Util\\SettingCodec' => $baseDir . '/src/Util/SettingCodec.php',
    'Civi\\Cv\\Util\\SettingTrait' => $baseDir . '/src/Util/SettingTrait.php',
    'Civi\\Cv\\Util\\SetupCommandTrait' => $baseDir . '/src/Util/SetupCommandTrait.php',
    'Civi\\Cv\\Util\\StructuredOutputTrait' => $baseDir . '/src/Util/StructuredOutputTrait.php',
    'Civi\\Cv\\Util\\UrlCommandTrait' => $baseDir . '/src/Util/UrlCommandTrait.php',
    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    'Cvphar\\Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
    'Cvphar\\JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
    'Cvphar\\LesserEvil\\ShellVerbosityIsEvil' => $vendorDir . '/lesser-evil/shell-verbosity-is-evil/src/ShellVerbosityIsEvil.php',
    'Cvphar\\PhpParser\\Builder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder.php',
    'Cvphar\\PhpParser\\BuilderFactory' => $vendorDir . '/nikic/php-parser/lib/PhpParser/BuilderFactory.php',
    'Cvphar\\PhpParser\\BuilderHelpers' => $vendorDir . '/nikic/php-parser/lib/PhpParser/BuilderHelpers.php',
    'Cvphar\\PhpParser\\Builder\\ClassConst' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php',
    'Cvphar\\PhpParser\\Builder\\Class_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Class_.php',
    'Cvphar\\PhpParser\\Builder\\Declaration' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Declaration.php',
    'Cvphar\\PhpParser\\Builder\\EnumCase' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php',
    'Cvphar\\PhpParser\\Builder\\Enum_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Enum_.php',
    'Cvphar\\PhpParser\\Builder\\FunctionLike' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php',
    'Cvphar\\PhpParser\\Builder\\Function_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Function_.php',
    'Cvphar\\PhpParser\\Builder\\Interface_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Interface_.php',
    'Cvphar\\PhpParser\\Builder\\Method' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Method.php',
    'Cvphar\\PhpParser\\Builder\\Namespace_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php',
    'Cvphar\\PhpParser\\Builder\\Param' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Param.php',
    'Cvphar\\PhpParser\\Builder\\Property' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Property.php',
    'Cvphar\\PhpParser\\Builder\\TraitUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php',
    'Cvphar\\PhpParser\\Builder\\TraitUseAdaptation' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php',
    'Cvphar\\PhpParser\\Builder\\Trait_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Trait_.php',
    'Cvphar\\PhpParser\\Builder\\Use_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Builder/Use_.php',
    'Cvphar\\PhpParser\\Comment' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Comment.php',
    'Cvphar\\PhpParser\\Comment\\Doc' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Comment/Doc.php',
    'Cvphar\\PhpParser\\ConstExprEvaluationException' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php',
    'Cvphar\\PhpParser\\ConstExprEvaluator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php',
    'Cvphar\\PhpParser\\Error' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Error.php',
    'Cvphar\\PhpParser\\ErrorHandler' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ErrorHandler.php',
    'Cvphar\\PhpParser\\ErrorHandler\\Collecting' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php',
    'Cvphar\\PhpParser\\ErrorHandler\\Throwing' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php',
    'Cvphar\\PhpParser\\Internal\\DiffElem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php',
    'Cvphar\\PhpParser\\Internal\\Differ' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/Differ.php',
    'Cvphar\\PhpParser\\Internal\\PrintableNewAnonClassNode' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php',
    'Cvphar\\PhpParser\\Internal\\TokenStream' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php',
    'Cvphar\\PhpParser\\JsonDecoder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/JsonDecoder.php',
    'Cvphar\\PhpParser\\Lexer' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer.php',
    'Cvphar\\PhpParser\\Lexer\\Emulative' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyFunctionTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php',
    'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php',
    'Cvphar\\PhpParser\\NameContext' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NameContext.php',
    'Cvphar\\PhpParser\\Node' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node.php',
    'Cvphar\\PhpParser\\NodeAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeAbstract.php',
    'Cvphar\\PhpParser\\NodeDumper' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeDumper.php',
    'Cvphar\\PhpParser\\NodeFinder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeFinder.php',
    'Cvphar\\PhpParser\\NodeTraverser' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeTraverser.php',
    'Cvphar\\PhpParser\\NodeTraverserInterface' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php',
    'Cvphar\\PhpParser\\NodeVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor.php',
    'Cvphar\\PhpParser\\NodeVisitorAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php',
    'Cvphar\\PhpParser\\NodeVisitor\\CloningVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php',
    'Cvphar\\PhpParser\\NodeVisitor\\FindingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php',
    'Cvphar\\PhpParser\\NodeVisitor\\FirstFindingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php',
    'Cvphar\\PhpParser\\NodeVisitor\\NameResolver' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php',
    'Cvphar\\PhpParser\\NodeVisitor\\NodeConnectingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php',
    'Cvphar\\PhpParser\\NodeVisitor\\ParentConnectingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php',
    'Cvphar\\PhpParser\\Node\\Arg' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Arg.php',
    'Cvphar\\PhpParser\\Node\\Attribute' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Attribute.php',
    'Cvphar\\PhpParser\\Node\\AttributeGroup' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php',
    'Cvphar\\PhpParser\\Node\\ComplexType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/ComplexType.php',
    'Cvphar\\PhpParser\\Node\\Const_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Const_.php',
    'Cvphar\\PhpParser\\Node\\Expr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ArrayDimFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ArrayItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Array_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ArrowFunction' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Assign' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseAnd' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseOr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseXor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Coalesce' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Concat' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Div' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Minus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Mod' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Mul' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Plus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Pow' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\ShiftLeft' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\ShiftRight' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php',
    'Cvphar\\PhpParser\\Node\\Expr\\AssignRef' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseAnd' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseOr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseXor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanAnd' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanOr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Coalesce' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Concat' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Div' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Equal' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Greater' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\GreaterOrEqual' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Identical' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalAnd' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalOr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalXor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Minus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Mod' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Mul' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\NotEqual' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Plus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Pow' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftLeft' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftRight' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Smaller' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\SmallerOrEqual' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Spaceship' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BitwiseNot' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php',
    'Cvphar\\PhpParser\\Node\\Expr\\BooleanNot' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php',
    'Cvphar\\PhpParser\\Node\\Expr\\CallLike' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Array_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Bool_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Double' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Int_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Object_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\String_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Unset_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ClassConstFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Clone_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Closure' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ClosureUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ConstFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Empty_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Error' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ErrorSuppress' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Eval_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Exit_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\FuncCall' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Include_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Instanceof_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Isset_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\List_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Match_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\MethodCall' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php',
    'Cvphar\\PhpParser\\Node\\Expr\\New_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\NullsafeMethodCall' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php',
    'Cvphar\\PhpParser\\Node\\Expr\\NullsafePropertyFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\PostDec' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php',
    'Cvphar\\PhpParser\\Node\\Expr\\PostInc' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php',
    'Cvphar\\PhpParser\\Node\\Expr\\PreDec' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php',
    'Cvphar\\PhpParser\\Node\\Expr\\PreInc' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Print_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\PropertyFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\ShellExec' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php',
    'Cvphar\\PhpParser\\Node\\Expr\\StaticCall' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php',
    'Cvphar\\PhpParser\\Node\\Expr\\StaticPropertyFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Ternary' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Throw_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php',
    'Cvphar\\PhpParser\\Node\\Expr\\UnaryMinus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\UnaryPlus' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Variable' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php',
    'Cvphar\\PhpParser\\Node\\Expr\\YieldFrom' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php',
    'Cvphar\\PhpParser\\Node\\Expr\\Yield_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php',
    'Cvphar\\PhpParser\\Node\\FunctionLike' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php',
    'Cvphar\\PhpParser\\Node\\Identifier' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Identifier.php',
    'Cvphar\\PhpParser\\Node\\IntersectionType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php',
    'Cvphar\\PhpParser\\Node\\MatchArm' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/MatchArm.php',
    'Cvphar\\PhpParser\\Node\\Name' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Name.php',
    'Cvphar\\PhpParser\\Node\\Name\\FullyQualified' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php',
    'Cvphar\\PhpParser\\Node\\Name\\Relative' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php',
    'Cvphar\\PhpParser\\Node\\NullableType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/NullableType.php',
    'Cvphar\\PhpParser\\Node\\Param' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Param.php',
    'Cvphar\\PhpParser\\Node\\Scalar' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\DNumber' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\Encapsed' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\EncapsedStringPart' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\LNumber' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Class_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Dir' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\File' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Function_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Line' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Method' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php',
    'Cvphar\\PhpParser\\Node\\Scalar\\String_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php',
    'Cvphar\\PhpParser\\Node\\Stmt' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Break_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Case_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Catch_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\ClassConst' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\ClassLike' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\ClassMethod' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Class_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Const_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Continue_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\DeclareDeclare' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Declare_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Do_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Echo_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\ElseIf_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Else_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\EnumCase' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Enum_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Expression' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Finally_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\For_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Foreach_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Function_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Global_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Goto_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\GroupUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\HaltCompiler' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\If_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\InlineHTML' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Interface_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Label' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Namespace_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Nop' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Property' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\PropertyProperty' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Return_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\StaticVar' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Static_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Switch_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Throw_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\TraitUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Precedence' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Trait_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\TryCatch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Unset_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\UseUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\Use_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php',
    'Cvphar\\PhpParser\\Node\\Stmt\\While_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php',
    'Cvphar\\PhpParser\\Node\\UnionType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/UnionType.php',
    'Cvphar\\PhpParser\\Node\\VarLikeIdentifier' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php',
    'Cvphar\\PhpParser\\Node\\VariadicPlaceholder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php',
    'Cvphar\\PhpParser\\Parser' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser.php',
    'Cvphar\\PhpParser\\ParserAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ParserAbstract.php',
    'Cvphar\\PhpParser\\ParserFactory' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ParserFactory.php',
    'Cvphar\\PhpParser\\Parser\\Multiple' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Multiple.php',
    'Cvphar\\PhpParser\\Parser\\Php5' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Php5.php',
    'Cvphar\\PhpParser\\Parser\\Php7' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Php7.php',
    'Cvphar\\PhpParser\\Parser\\Tokens' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Tokens.php',
    'Cvphar\\PhpParser\\PrettyPrinterAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php',
    'Cvphar\\PhpParser\\PrettyPrinter\\Standard' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php',
    'Cvphar\\Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
    'Cvphar\\Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
    'Cvphar\\Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
    'Cvphar\\Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
    'Cvphar\\Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
    'Cvphar\\Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
    'Cvphar\\Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
    'Cvphar\\Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
    'Cvphar\\Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
    'Cvphar\\Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
    'Cvphar\\Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
    'Cvphar\\Psy\\CodeCleaner' => $vendorDir . '/psy/psysh/src/CodeCleaner.php',
    'Cvphar\\Psy\\CodeCleaner\\AbstractClassPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/AbstractClassPass.php',
    'Cvphar\\Psy\\CodeCleaner\\AssignThisVariablePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/AssignThisVariablePass.php',
    'Cvphar\\Psy\\CodeCleaner\\CallTimePassByReferencePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/CallTimePassByReferencePass.php',
    'Cvphar\\Psy\\CodeCleaner\\CalledClassPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/CalledClassPass.php',
    'Cvphar\\Psy\\CodeCleaner\\CodeCleanerPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/CodeCleanerPass.php',
    'Cvphar\\Psy\\CodeCleaner\\EmptyArrayDimFetchPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php',
    'Cvphar\\Psy\\CodeCleaner\\ExitPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ExitPass.php',
    'Cvphar\\Psy\\CodeCleaner\\FinalClassPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/FinalClassPass.php',
    'Cvphar\\Psy\\CodeCleaner\\FunctionContextPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/FunctionContextPass.php',
    'Cvphar\\Psy\\CodeCleaner\\FunctionReturnInWriteContextPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/FunctionReturnInWriteContextPass.php',
    'Cvphar\\Psy\\CodeCleaner\\ImplicitReturnPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php',
    'Cvphar\\Psy\\CodeCleaner\\InstanceOfPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/InstanceOfPass.php',
    'Cvphar\\Psy\\CodeCleaner\\IssetPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/IssetPass.php',
    'Cvphar\\Psy\\CodeCleaner\\LabelContextPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/LabelContextPass.php',
    'Cvphar\\Psy\\CodeCleaner\\LeavePsyshAlonePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/LeavePsyshAlonePass.php',
    'Cvphar\\Psy\\CodeCleaner\\ListPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ListPass.php',
    'Cvphar\\Psy\\CodeCleaner\\LoopContextPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/LoopContextPass.php',
    'Cvphar\\Psy\\CodeCleaner\\MagicConstantsPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/MagicConstantsPass.php',
    'Cvphar\\Psy\\CodeCleaner\\NamespaceAwarePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/NamespaceAwarePass.php',
    'Cvphar\\Psy\\CodeCleaner\\NamespacePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/NamespacePass.php',
    'Cvphar\\Psy\\CodeCleaner\\NoReturnValue' => $vendorDir . '/psy/psysh/src/CodeCleaner/NoReturnValue.php',
    'Cvphar\\Psy\\CodeCleaner\\PassableByReferencePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/PassableByReferencePass.php',
    'Cvphar\\Psy\\CodeCleaner\\RequirePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/RequirePass.php',
    'Cvphar\\Psy\\CodeCleaner\\ReturnTypePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ReturnTypePass.php',
    'Cvphar\\Psy\\CodeCleaner\\StrictTypesPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/StrictTypesPass.php',
    'Cvphar\\Psy\\CodeCleaner\\UseStatementPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/UseStatementPass.php',
    'Cvphar\\Psy\\CodeCleaner\\ValidClassNamePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ValidClassNamePass.php',
    'Cvphar\\Psy\\CodeCleaner\\ValidConstructorPass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ValidConstructorPass.php',
    'Cvphar\\Psy\\CodeCleaner\\ValidFunctionNamePass' => $vendorDir . '/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php',
    'Cvphar\\Psy\\Command\\BufferCommand' => $vendorDir . '/psy/psysh/src/Command/BufferCommand.php',
    'Cvphar\\Psy\\Command\\ClearCommand' => $vendorDir . '/psy/psysh/src/Command/ClearCommand.php',
    'Cvphar\\Psy\\Command\\Command' => $vendorDir . '/psy/psysh/src/Command/Command.php',
    'Cvphar\\Psy\\Command\\DocCommand' => $vendorDir . '/psy/psysh/src/Command/DocCommand.php',
    'Cvphar\\Psy\\Command\\DumpCommand' => $vendorDir . '/psy/psysh/src/Command/DumpCommand.php',
    'Cvphar\\Psy\\Command\\EditCommand' => $vendorDir . '/psy/psysh/src/Command/EditCommand.php',
    'Cvphar\\Psy\\Command\\ExitCommand' => $vendorDir . '/psy/psysh/src/Command/ExitCommand.php',
    'Cvphar\\Psy\\Command\\HelpCommand' => $vendorDir . '/psy/psysh/src/Command/HelpCommand.php',
    'Cvphar\\Psy\\Command\\HistoryCommand' => $vendorDir . '/psy/psysh/src/Command/HistoryCommand.php',
    'Cvphar\\Psy\\Command\\ListCommand' => $vendorDir . '/psy/psysh/src/Command/ListCommand.php',
    'Cvphar\\Psy\\Command\\ListCommand\\ClassConstantEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/ClassConstantEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\ClassEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/ClassEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\ConstantEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/ConstantEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\Enumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/Enumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\FunctionEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/FunctionEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\GlobalVariableEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/GlobalVariableEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\MethodEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/MethodEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\PropertyEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/PropertyEnumerator.php',
    'Cvphar\\Psy\\Command\\ListCommand\\VariableEnumerator' => $vendorDir . '/psy/psysh/src/Command/ListCommand/VariableEnumerator.php',
    'Cvphar\\Psy\\Command\\ParseCommand' => $vendorDir . '/psy/psysh/src/Command/ParseCommand.php',
    'Cvphar\\Psy\\Command\\PsyVersionCommand' => $vendorDir . '/psy/psysh/src/Command/PsyVersionCommand.php',
    'Cvphar\\Psy\\Command\\ReflectingCommand' => $vendorDir . '/psy/psysh/src/Command/ReflectingCommand.php',
    'Cvphar\\Psy\\Command\\ShowCommand' => $vendorDir . '/psy/psysh/src/Command/ShowCommand.php',
    'Cvphar\\Psy\\Command\\SudoCommand' => $vendorDir . '/psy/psysh/src/Command/SudoCommand.php',
    'Cvphar\\Psy\\Command\\ThrowUpCommand' => $vendorDir . '/psy/psysh/src/Command/ThrowUpCommand.php',
    'Cvphar\\Psy\\Command\\TimeitCommand' => $vendorDir . '/psy/psysh/src/Command/TimeitCommand.php',
    'Cvphar\\Psy\\Command\\TimeitCommand\\TimeitVisitor' => $vendorDir . '/psy/psysh/src/Command/TimeitCommand/TimeitVisitor.php',
    'Cvphar\\Psy\\Command\\TraceCommand' => $vendorDir . '/psy/psysh/src/Command/TraceCommand.php',
    'Cvphar\\Psy\\Command\\WhereamiCommand' => $vendorDir . '/psy/psysh/src/Command/WhereamiCommand.php',
    'Cvphar\\Psy\\Command\\WtfCommand' => $vendorDir . '/psy/psysh/src/Command/WtfCommand.php',
    'Cvphar\\Psy\\ConfigPaths' => $vendorDir . '/psy/psysh/src/ConfigPaths.php',
    'Cvphar\\Psy\\Configuration' => $vendorDir . '/psy/psysh/src/Configuration.php',
    'Cvphar\\Psy\\Context' => $vendorDir . '/psy/psysh/src/Context.php',
    'Cvphar\\Psy\\ContextAware' => $vendorDir . '/psy/psysh/src/ContextAware.php',
    'Cvphar\\Psy\\EnvInterface' => $vendorDir . '/psy/psysh/src/EnvInterface.php',
    'Cvphar\\Psy\\Exception\\BreakException' => $vendorDir . '/psy/psysh/src/Exception/BreakException.php',
    'Cvphar\\Psy\\Exception\\DeprecatedException' => $vendorDir . '/psy/psysh/src/Exception/DeprecatedException.php',
    'Cvphar\\Psy\\Exception\\ErrorException' => $vendorDir . '/psy/psysh/src/Exception/ErrorException.php',
    'Cvphar\\Psy\\Exception\\Exception' => $vendorDir . '/psy/psysh/src/Exception/Exception.php',
    'Cvphar\\Psy\\Exception\\FatalErrorException' => $vendorDir . '/psy/psysh/src/Exception/FatalErrorException.php',
    'Cvphar\\Psy\\Exception\\ParseErrorException' => $vendorDir . '/psy/psysh/src/Exception/ParseErrorException.php',
    'Cvphar\\Psy\\Exception\\RuntimeException' => $vendorDir . '/psy/psysh/src/Exception/RuntimeException.php',
    'Cvphar\\Psy\\Exception\\ThrowUpException' => $vendorDir . '/psy/psysh/src/Exception/ThrowUpException.php',
    'Cvphar\\Psy\\Exception\\TypeErrorException' => $vendorDir . '/psy/psysh/src/Exception/TypeErrorException.php',
    'Cvphar\\Psy\\Exception\\UnexpectedTargetException' => $vendorDir . '/psy/psysh/src/Exception/UnexpectedTargetException.php',
    'Cvphar\\Psy\\ExecutionClosure' => $vendorDir . '/psy/psysh/src/ExecutionClosure.php',
    'Cvphar\\Psy\\ExecutionLoopClosure' => $vendorDir . '/psy/psysh/src/ExecutionLoopClosure.php',
    'Cvphar\\Psy\\ExecutionLoop\\AbstractListener' => $vendorDir . '/psy/psysh/src/ExecutionLoop/AbstractListener.php',
    'Cvphar\\Psy\\ExecutionLoop\\Listener' => $vendorDir . '/psy/psysh/src/ExecutionLoop/Listener.php',
    'Cvphar\\Psy\\ExecutionLoop\\ProcessForker' => $vendorDir . '/psy/psysh/src/ExecutionLoop/ProcessForker.php',
    'Cvphar\\Psy\\ExecutionLoop\\RunkitReloader' => $vendorDir . '/psy/psysh/src/ExecutionLoop/RunkitReloader.php',
    'Cvphar\\Psy\\Formatter\\CodeFormatter' => $vendorDir . '/psy/psysh/src/Formatter/CodeFormatter.php',
    'Cvphar\\Psy\\Formatter\\DocblockFormatter' => $vendorDir . '/psy/psysh/src/Formatter/DocblockFormatter.php',
    'Cvphar\\Psy\\Formatter\\Formatter' => $vendorDir . '/psy/psysh/src/Formatter/Formatter.php',
    'Cvphar\\Psy\\Formatter\\ReflectorFormatter' => $vendorDir . '/psy/psysh/src/Formatter/ReflectorFormatter.php',
    'Cvphar\\Psy\\Formatter\\SignatureFormatter' => $vendorDir . '/psy/psysh/src/Formatter/SignatureFormatter.php',
    'Cvphar\\Psy\\Formatter\\TraceFormatter' => $vendorDir . '/psy/psysh/src/Formatter/TraceFormatter.php',
    'Cvphar\\Psy\\Input\\CodeArgument' => $vendorDir . '/psy/psysh/src/Input/CodeArgument.php',
    'Cvphar\\Psy\\Input\\FilterOptions' => $vendorDir . '/psy/psysh/src/Input/FilterOptions.php',
    'Cvphar\\Psy\\Input\\ShellInput' => $vendorDir . '/psy/psysh/src/Input/ShellInput.php',
    'Cvphar\\Psy\\Input\\SilentInput' => $vendorDir . '/psy/psysh/src/Input/SilentInput.php',
    'Cvphar\\Psy\\Output\\OutputPager' => $vendorDir . '/psy/psysh/src/Output/OutputPager.php',
    'Cvphar\\Psy\\Output\\PassthruPager' => $vendorDir . '/psy/psysh/src/Output/PassthruPager.php',
    'Cvphar\\Psy\\Output\\ProcOutputPager' => $vendorDir . '/psy/psysh/src/Output/ProcOutputPager.php',
    'Cvphar\\Psy\\Output\\ShellOutput' => $vendorDir . '/psy/psysh/src/Output/ShellOutput.php',
    'Cvphar\\Psy\\Output\\Theme' => $vendorDir . '/psy/psysh/src/Output/Theme.php',
    'Cvphar\\Psy\\ParserFactory' => $vendorDir . '/psy/psysh/src/ParserFactory.php',
    'Cvphar\\Psy\\Readline\\GNUReadline' => $vendorDir . '/psy/psysh/src/Readline/GNUReadline.php',
    'Cvphar\\Psy\\Readline\\HoaConsole' => $vendorDir . '/psy/psysh/src/Readline/HoaConsole.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Autocompleter' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Autocompleter.php',
    'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterAggregate' => $vendorDir . '/psy/psysh/src/Readline/Hoa/AutocompleterAggregate.php',
    'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterPath' => $vendorDir . '/psy/psysh/src/Readline/Hoa/AutocompleterPath.php',
    'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterWord' => $vendorDir . '/psy/psysh/src/Readline/Hoa/AutocompleterWord.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Console' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Console.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleCursor' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleCursor.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleInput' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleInput.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleOutput' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleOutput.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleProcessus' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleProcessus.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleTput' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleTput.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ConsoleWindow' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ConsoleWindow.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Event' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Event.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventBucket' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventBucket.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventListenable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventListenable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventListener' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventListener.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventListens' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventListens.php',
    'Cvphar\\Psy\\Readline\\Hoa\\EventSource' => $vendorDir . '/psy/psysh/src/Readline/Hoa/EventSource.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Exception' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Exception.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ExceptionIdle' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ExceptionIdle.php',
    'Cvphar\\Psy\\Readline\\Hoa\\File' => $vendorDir . '/psy/psysh/src/Readline/Hoa/File.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileDirectory' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileDirectory.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileDoesNotExistException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileDoesNotExistException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileFinder' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileFinder.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileGeneric' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileGeneric.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileLink' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileLink.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileLinkRead' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileLinkRead.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileLinkReadWrite' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileLinkReadWrite.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileRead' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileRead.php',
    'Cvphar\\Psy\\Readline\\Hoa\\FileReadWrite' => $vendorDir . '/psy/psysh/src/Readline/Hoa/FileReadWrite.php',
    'Cvphar\\Psy\\Readline\\Hoa\\IStream' => $vendorDir . '/psy/psysh/src/Readline/Hoa/IStream.php',
    'Cvphar\\Psy\\Readline\\Hoa\\IteratorFileSystem' => $vendorDir . '/psy/psysh/src/Readline/Hoa/IteratorFileSystem.php',
    'Cvphar\\Psy\\Readline\\Hoa\\IteratorRecursiveDirectory' => $vendorDir . '/psy/psysh/src/Readline/Hoa/IteratorRecursiveDirectory.php',
    'Cvphar\\Psy\\Readline\\Hoa\\IteratorSplFileInfo' => $vendorDir . '/psy/psysh/src/Readline/Hoa/IteratorSplFileInfo.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Protocol' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Protocol.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ProtocolException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ProtocolException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ProtocolNode' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ProtocolNode.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ProtocolNodeLibrary' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php',
    'Cvphar\\Psy\\Readline\\Hoa\\ProtocolWrapper' => $vendorDir . '/psy/psysh/src/Readline/Hoa/ProtocolWrapper.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Readline' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Readline.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Stream' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Stream.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamBufferable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamBufferable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamContext' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamContext.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamException' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamException.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamIn' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamIn.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamLockable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamLockable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamOut' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamOut.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamPathable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamPathable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamPointable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamPointable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamStatable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamStatable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\StreamTouchable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/StreamTouchable.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Ustring' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Ustring.php',
    'Cvphar\\Psy\\Readline\\Hoa\\Xcallable' => $vendorDir . '/psy/psysh/src/Readline/Hoa/Xcallable.php',
    'Cvphar\\Psy\\Readline\\Libedit' => $vendorDir . '/psy/psysh/src/Readline/Libedit.php',
    'Cvphar\\Psy\\Readline\\Readline' => $vendorDir . '/psy/psysh/src/Readline/Readline.php',
    'Cvphar\\Psy\\Readline\\Transient' => $vendorDir . '/psy/psysh/src/Readline/Transient.php',
    'Cvphar\\Psy\\Readline\\Userland' => $vendorDir . '/psy/psysh/src/Readline/Userland.php',
    'Cvphar\\Psy\\Reflection\\ReflectionClassConstant' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionClassConstant.php',
    'Cvphar\\Psy\\Reflection\\ReflectionConstant' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionConstant.php',
    'Cvphar\\Psy\\Reflection\\ReflectionConstant_' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionConstant_.php',
    'Cvphar\\Psy\\Reflection\\ReflectionLanguageConstruct' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionLanguageConstruct.php',
    'Cvphar\\Psy\\Reflection\\ReflectionLanguageConstructParameter' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionLanguageConstructParameter.php',
    'Cvphar\\Psy\\Reflection\\ReflectionNamespace' => $vendorDir . '/psy/psysh/src/Reflection/ReflectionNamespace.php',
    'Cvphar\\Psy\\Shell' => $vendorDir . '/psy/psysh/src/Shell.php',
    'Cvphar\\Psy\\Sudo' => $vendorDir . '/psy/psysh/src/Sudo.php',
    'Cvphar\\Psy\\Sudo\\SudoVisitor' => $vendorDir . '/psy/psysh/src/Sudo/SudoVisitor.php',
    'Cvphar\\Psy\\SuperglobalsEnv' => $vendorDir . '/psy/psysh/src/SuperglobalsEnv.php',
    'Cvphar\\Psy\\SystemEnv' => $vendorDir . '/psy/psysh/src/SystemEnv.php',
    'Cvphar\\Psy\\TabCompletion\\AutoCompleter' => $vendorDir . '/psy/psysh/src/TabCompletion/AutoCompleter.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractContextAwareMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/AbstractContextAwareMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractDefaultParametersMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/AbstractDefaultParametersMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/AbstractMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassAttributesMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ClassAttributesMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassMethodDefaultParametersMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassMethodsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassNamesMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ClassNamesMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\CommandsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/CommandsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ConstantsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ConstantsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\FunctionDefaultParametersMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/FunctionDefaultParametersMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\FunctionsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/FunctionsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\KeywordsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\MongoClientMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/MongoClientMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\MongoDatabaseMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/MongoDatabaseMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectAttributesMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ObjectAttributesMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectMethodDefaultParametersMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectMethodsMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/ObjectMethodsMatcher.php',
    'Cvphar\\Psy\\TabCompletion\\Matcher\\VariablesMatcher' => $vendorDir . '/psy/psysh/src/TabCompletion/Matcher/VariablesMatcher.php',
    'Cvphar\\Psy\\Util\\Docblock' => $vendorDir . '/psy/psysh/src/Util/Docblock.php',
    'Cvphar\\Psy\\Util\\Json' => $vendorDir . '/psy/psysh/src/Util/Json.php',
    'Cvphar\\Psy\\Util\\Mirror' => $vendorDir . '/psy/psysh/src/Util/Mirror.php',
    'Cvphar\\Psy\\Util\\Str' => $vendorDir . '/psy/psysh/src/Util/Str.php',
    'Cvphar\\Psy\\VarDumper\\Cloner' => $vendorDir . '/psy/psysh/src/VarDumper/Cloner.php',
    'Cvphar\\Psy\\VarDumper\\Dumper' => $vendorDir . '/psy/psysh/src/VarDumper/Dumper.php',
    'Cvphar\\Psy\\VarDumper\\Presenter' => $vendorDir . '/psy/psysh/src/VarDumper/Presenter.php',
    'Cvphar\\Psy\\VarDumper\\PresenterAware' => $vendorDir . '/psy/psysh/src/VarDumper/PresenterAware.php',
    'Cvphar\\Psy\\VersionUpdater\\Checker' => $vendorDir . '/psy/psysh/src/VersionUpdater/Checker.php',
    'Cvphar\\Psy\\VersionUpdater\\Downloader' => $vendorDir . '/psy/psysh/src/VersionUpdater/Downloader.php',
    'Cvphar\\Psy\\VersionUpdater\\Downloader\\CurlDownloader' => $vendorDir . '/psy/psysh/src/VersionUpdater/Downloader/CurlDownloader.php',
    'Cvphar\\Psy\\VersionUpdater\\Downloader\\Factory' => $vendorDir . '/psy/psysh/src/VersionUpdater/Downloader/Factory.php',
    'Cvphar\\Psy\\VersionUpdater\\Downloader\\FileDownloader' => $vendorDir . '/psy/psysh/src/VersionUpdater/Downloader/FileDownloader.php',
    'Cvphar\\Psy\\VersionUpdater\\GitHubChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/GitHubChecker.php',
    'Cvphar\\Psy\\VersionUpdater\\Installer' => $vendorDir . '/psy/psysh/src/VersionUpdater/Installer.php',
    'Cvphar\\Psy\\VersionUpdater\\IntervalChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/IntervalChecker.php',
    'Cvphar\\Psy\\VersionUpdater\\NoopChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/NoopChecker.php',
    'Cvphar\\Psy\\VersionUpdater\\SelfUpdate' => $vendorDir . '/psy/psysh/src/VersionUpdater/SelfUpdate.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion' => $vendorDir . '/stecman/symfony-console-completion/src/Completion.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionCommand' => $vendorDir . '/stecman/symfony-console-completion/src/CompletionCommand.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionContext' => $vendorDir . '/stecman/symfony-console-completion/src/CompletionContext.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionHandler' => $vendorDir . '/stecman/symfony-console-completion/src/CompletionHandler.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\CompletionAwareInterface' => $vendorDir . '/stecman/symfony-console-completion/src/Completion/CompletionAwareInterface.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\CompletionInterface' => $vendorDir . '/stecman/symfony-console-completion/src/Completion/CompletionInterface.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\ShellPathCompletion' => $vendorDir . '/stecman/symfony-console-completion/src/Completion/ShellPathCompletion.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\EnvironmentCompletionContext' => $vendorDir . '/stecman/symfony-console-completion/src/EnvironmentCompletionContext.php',
    'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\HookFactory' => $vendorDir . '/stecman/symfony-console-completion/src/HookFactory.php',
    'Cvphar\\Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
    'Cvphar\\Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php',
    'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
    'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/FactoryCommandLoader.php',
    'Cvphar\\Symfony\\Component\\Console\\Command\\Command' => $vendorDir . '/symfony/console/Command/Command.php',
    'Cvphar\\Symfony\\Component\\Console\\Command\\HelpCommand' => $vendorDir . '/symfony/console/Command/HelpCommand.php',
    'Cvphar\\Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Command/ListCommand.php',
    'Cvphar\\Symfony\\Component\\Console\\Command\\LockableTrait' => $vendorDir . '/symfony/console/Command/LockableTrait.php',
    'Cvphar\\Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php',
    'Cvphar\\Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => $vendorDir . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Descriptor/ApplicationDescription.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Descriptor/Descriptor.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Descriptor/DescriptorInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => $vendorDir . '/symfony/console/Descriptor/JsonDescriptor.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Descriptor/MarkdownDescriptor.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Descriptor/TextDescriptor.php',
    'Cvphar\\Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Descriptor/XmlDescriptor.php',
    'Cvphar\\Symfony\\Component\\Console\\EventListener\\ErrorListener' => $vendorDir . '/symfony/console/EventListener/ErrorListener.php',
    'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => $vendorDir . '/symfony/console/Event/ConsoleCommandEvent.php',
    'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => $vendorDir . '/symfony/console/Event/ConsoleErrorEvent.php',
    'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Event/ConsoleEvent.php',
    'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Event/ConsoleTerminateEvent.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => $vendorDir . '/symfony/console/Exception/CommandNotFoundException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/console/Exception/ExceptionInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/console/Exception/InvalidArgumentException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\InvalidOptionException' => $vendorDir . '/symfony/console/Exception/InvalidOptionException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\MissingInputException' => $vendorDir . '/symfony/console/Exception/MissingInputException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => $vendorDir . '/symfony/console/Exception/NamespaceNotFoundException.php',
    'Cvphar\\Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Formatter/OutputFormatter.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyle.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleStack.php',
    'Cvphar\\Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => $vendorDir . '/symfony/console/Helper/DebugFormatterHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Helper/DescriptorHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\Dumper' => $vendorDir . '/symfony/console/Helper/Dumper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Helper/FormatterHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Helper/Helper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Helper/HelperInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\HelperSet' => $vendorDir . '/symfony/console/Helper/HelperSet.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\InputAwareHelper' => $vendorDir . '/symfony/console/Helper/InputAwareHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\ProcessHelper' => $vendorDir . '/symfony/console/Helper/ProcessHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\ProgressBar' => $vendorDir . '/symfony/console/Helper/ProgressBar.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\ProgressIndicator' => $vendorDir . '/symfony/console/Helper/ProgressIndicator.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\QuestionHelper' => $vendorDir . '/symfony/console/Helper/QuestionHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => $vendorDir . '/symfony/console/Helper/SymfonyQuestionHelper.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\Table' => $vendorDir . '/symfony/console/Helper/Table.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\TableCell' => $vendorDir . '/symfony/console/Helper/TableCell.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\TableRows' => $vendorDir . '/symfony/console/Helper/TableRows.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php',
    'Cvphar\\Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\ArrayInput' => $vendorDir . '/symfony/console/Input/ArrayInput.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\Input' => $vendorDir . '/symfony/console/Input/Input.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\InputArgument' => $vendorDir . '/symfony/console/Input/InputArgument.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\InputAwareInterface' => $vendorDir . '/symfony/console/Input/InputAwareInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\InputDefinition' => $vendorDir . '/symfony/console/Input/InputDefinition.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\InputInterface' => $vendorDir . '/symfony/console/Input/InputInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\InputOption' => $vendorDir . '/symfony/console/Input/InputOption.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\StreamableInputInterface' => $vendorDir . '/symfony/console/Input/StreamableInputInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Input/StringInput.php',
    'Cvphar\\Symfony\\Component\\Console\\Logger\\ConsoleLogger' => $vendorDir . '/symfony/console/Logger/ConsoleLogger.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\BufferedOutput' => $vendorDir . '/symfony/console/Output/BufferedOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Output/ConsoleOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => $vendorDir . '/symfony/console/Output/ConsoleOutputInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => $vendorDir . '/symfony/console/Output/ConsoleSectionOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\NullOutput' => $vendorDir . '/symfony/console/Output/NullOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\Output' => $vendorDir . '/symfony/console/Output/Output.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\OutputInterface' => $vendorDir . '/symfony/console/Output/OutputInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\StreamOutput' => $vendorDir . '/symfony/console/Output/StreamOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => $vendorDir . '/symfony/console/Output/TrimmedBufferOutput.php',
    'Cvphar\\Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php',
    'Cvphar\\Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php',
    'Cvphar\\Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php',
    'Cvphar\\Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php',
    'Cvphar\\Symfony\\Component\\Console\\Style\\StyleInterface' => $vendorDir . '/symfony/console/Style/StyleInterface.php',
    'Cvphar\\Symfony\\Component\\Console\\Style\\SymfonyStyle' => $vendorDir . '/symfony/console/Style/SymfonyStyle.php',
    'Cvphar\\Symfony\\Component\\Console\\Terminal' => $vendorDir . '/symfony/console/Terminal.php',
    'Cvphar\\Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Tester/ApplicationTester.php',
    'Cvphar\\Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Tester/CommandTester.php',
    'Cvphar\\Symfony\\Component\\Console\\Tester\\TesterTrait' => $vendorDir . '/symfony/console/Tester/TesterTrait.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/process/Exception/ExceptionInterface.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/process/Exception/InvalidArgumentException.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\LogicException' => $vendorDir . '/symfony/process/Exception/LogicException.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessFailedException' => $vendorDir . '/symfony/process/Exception/ProcessFailedException.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => $vendorDir . '/symfony/process/Exception/ProcessSignaledException.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php',
    'Cvphar\\Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php',
    'Cvphar\\Symfony\\Component\\Process\\ExecutableFinder' => $vendorDir . '/symfony/process/ExecutableFinder.php',
    'Cvphar\\Symfony\\Component\\Process\\InputStream' => $vendorDir . '/symfony/process/InputStream.php',
    'Cvphar\\Symfony\\Component\\Process\\PhpExecutableFinder' => $vendorDir . '/symfony/process/PhpExecutableFinder.php',
    'Cvphar\\Symfony\\Component\\Process\\PhpProcess' => $vendorDir . '/symfony/process/PhpProcess.php',
    'Cvphar\\Symfony\\Component\\Process\\Pipes\\AbstractPipes' => $vendorDir . '/symfony/process/Pipes/AbstractPipes.php',
    'Cvphar\\Symfony\\Component\\Process\\Pipes\\PipesInterface' => $vendorDir . '/symfony/process/Pipes/PipesInterface.php',
    'Cvphar\\Symfony\\Component\\Process\\Pipes\\UnixPipes' => $vendorDir . '/symfony/process/Pipes/UnixPipes.php',
    'Cvphar\\Symfony\\Component\\Process\\Pipes\\WindowsPipes' => $vendorDir . '/symfony/process/Pipes/WindowsPipes.php',
    'Cvphar\\Symfony\\Component\\Process\\Process' => $vendorDir . '/symfony/process/Process.php',
    'Cvphar\\Symfony\\Component\\Process\\ProcessUtils' => $vendorDir . '/symfony/process/ProcessUtils.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster' => $vendorDir . '/symfony/var-dumper/Caster/AmqpCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ArgsStub' => $vendorDir . '/symfony/var-dumper/Caster/ArgsStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\Caster' => $vendorDir . '/symfony/var-dumper/Caster/Caster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ClassStub' => $vendorDir . '/symfony/var-dumper/Caster/ClassStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ConstStub' => $vendorDir . '/symfony/var-dumper/Caster/ConstStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => $vendorDir . '/symfony/var-dumper/Caster/CutArrayStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutStub' => $vendorDir . '/symfony/var-dumper/Caster/CutStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => $vendorDir . '/symfony/var-dumper/Caster/DOMCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster' => $vendorDir . '/symfony/var-dumper/Caster/DateCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => $vendorDir . '/symfony/var-dumper/Caster/DoctrineCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster' => $vendorDir . '/symfony/var-dumper/Caster/DsCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => $vendorDir . '/symfony/var-dumper/Caster/DsPairStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\EnumStub' => $vendorDir . '/symfony/var-dumper/Caster/EnumStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ExceptionCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FiberCaster' => $vendorDir . '/symfony/var-dumper/Caster/FiberCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FrameStub' => $vendorDir . '/symfony/var-dumper/Caster/FrameStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\GmpCaster' => $vendorDir . '/symfony/var-dumper/Caster/GmpCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ImagineCaster' => $vendorDir . '/symfony/var-dumper/Caster/ImagineCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ImgStub' => $vendorDir . '/symfony/var-dumper/Caster/ImgStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster' => $vendorDir . '/symfony/var-dumper/Caster/IntlCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\LinkStub' => $vendorDir . '/symfony/var-dumper/Caster/LinkStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster' => $vendorDir . '/symfony/var-dumper/Caster/MemcachedCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MysqliCaster' => $vendorDir . '/symfony/var-dumper/Caster/MysqliCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => $vendorDir . '/symfony/var-dumper/Caster/PdoCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => $vendorDir . '/symfony/var-dumper/Caster/PgSqlCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster' => $vendorDir . '/symfony/var-dumper/Caster/ProxyManagerCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster' => $vendorDir . '/symfony/var-dumper/Caster/RdKafkaCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster' => $vendorDir . '/symfony/var-dumper/Caster/RedisCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ReflectionCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/ResourceCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster' => $vendorDir . '/symfony/var-dumper/Caster/SplCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster' => $vendorDir . '/symfony/var-dumper/Caster/StubCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster' => $vendorDir . '/symfony/var-dumper/Caster/SymfonyCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\TraceStub' => $vendorDir . '/symfony/var-dumper/Caster/TraceStub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\UuidCaster' => $vendorDir . '/symfony/var-dumper/Caster/UuidCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster' => $vendorDir . '/symfony/var-dumper/Caster/XmlReaderCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/XmlResourceCaster.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => $vendorDir . '/symfony/var-dumper/Cloner/AbstractCloner.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\ClonerInterface' => $vendorDir . '/symfony/var-dumper/Cloner/ClonerInterface.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Cursor' => $vendorDir . '/symfony/var-dumper/Cloner/Cursor.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Data' => $vendorDir . '/symfony/var-dumper/Cloner/Data.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\DumperInterface' => $vendorDir . '/symfony/var-dumper/Cloner/DumperInterface.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Stub' => $vendorDir . '/symfony/var-dumper/Cloner/Stub.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\VarCloner' => $vendorDir . '/symfony/var-dumper/Cloner/VarCloner.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\CliDescriptor' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/CliDescriptor.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\DumpDescriptorInterface' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\HtmlDescriptor' => $vendorDir . '/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Command\\ServerDumpCommand' => $vendorDir . '/symfony/var-dumper/Command/ServerDumpCommand.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\AbstractDumper' => $vendorDir . '/symfony/var-dumper/Dumper/AbstractDumper.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\CliDumper' => $vendorDir . '/symfony/var-dumper/Dumper/CliDumper.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\CliContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\RequestContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\SourceContextProvider' => $vendorDir . '/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextualizedDumper' => $vendorDir . '/symfony/var-dumper/Dumper/ContextualizedDumper.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => $vendorDir . '/symfony/var-dumper/Dumper/DataDumperInterface.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => $vendorDir . '/symfony/var-dumper/Dumper/HtmlDumper.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ServerDumper' => $vendorDir . '/symfony/var-dumper/Dumper/ServerDumper.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => $vendorDir . '/symfony/var-dumper/Exception/ThrowingCasterException.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Server\\Connection' => $vendorDir . '/symfony/var-dumper/Server/Connection.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\Server\\DumpServer' => $vendorDir . '/symfony/var-dumper/Server/DumpServer.php',
    'Cvphar\\Symfony\\Component\\VarDumper\\VarDumper' => $vendorDir . '/symfony/var-dumper/VarDumper.php',
    'Cvphar\\Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php',
    'Cvphar\\Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php',
    'Cvphar\\Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php',
    'Cvphar\\Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php',
    'Cvphar\\Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php',
    'Cvphar\\Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
    'Cvphar\\Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php',
    'Cvphar\\Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php',
    'Cvphar\\UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
    'Cvphar\\ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
<?php

// platform_check.php @generated by Composer

$issues = array();

if (!(PHP_VERSION_ID >= 70300)) {
    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
}

if ($issues) {
    if (!headers_sent()) {
        header('HTTP/1.1 500 Internal Server Error');
    }
    if (!ini_get('display_errors')) {
        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
        } elseif (!headers_sent()) {
            echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
        }
    }
    trigger_error(
        'Composer detected issues in your platform: ' . implode(' ', $issues),
        E_USER_ERROR
    );
}
<?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInit96d604555834bcf22f002764f3450e45
{
    public static $files = array (
        'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
        '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
        '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
        '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
        '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php',
    );

    public static $prefixLengthsPsr4 = array (
        'C' => 
        array (
            'Cvphar\\Symfony\\Polyfill\\Php80\\' => 30,
            'Cvphar\\Symfony\\Polyfill\\Php73\\' => 30,
            'Cvphar\\Symfony\\Polyfill\\Mbstring\\' => 33,
            'Cvphar\\Symfony\\Contracts\\Service\\' => 33,
            'Cvphar\\Symfony\\Component\\VarDumper\\' => 35,
            'Cvphar\\Symfony\\Component\\Process\\' => 33,
            'Cvphar\\Symfony\\Component\\Console\\' => 33,
            'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => 56,
            'Cvphar\\Psy\\' => 11,
            'Cvphar\\Psr\\Log\\' => 15,
            'Cvphar\\Psr\\Container\\' => 21,
            'Cvphar\\PhpParser\\' => 17,
            'Cvphar\\LesserEvil\\' => 18,
            'Civi\\Cv\\' => 8,
        ),
    );

    public static $prefixDirsPsr4 = array (
        'Cvphar\\Symfony\\Polyfill\\Php80\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
        ),
        'Cvphar\\Symfony\\Polyfill\\Php73\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
        ),
        'Cvphar\\Symfony\\Polyfill\\Mbstring\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
        ),
        'Cvphar\\Symfony\\Contracts\\Service\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/service-contracts',
        ),
        'Cvphar\\Symfony\\Component\\VarDumper\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/var-dumper',
        ),
        'Cvphar\\Symfony\\Component\\Process\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/process',
        ),
        'Cvphar\\Symfony\\Component\\Console\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/console',
        ),
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => 
        array (
            0 => __DIR__ . '/..' . '/stecman/symfony-console-completion/src',
        ),
        'Cvphar\\Psy\\' => 
        array (
            0 => __DIR__ . '/..' . '/psy/psysh/src',
        ),
        'Cvphar\\Psr\\Log\\' => 
        array (
            0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
        ),
        'Cvphar\\Psr\\Container\\' => 
        array (
            0 => __DIR__ . '/..' . '/psr/container/src',
        ),
        'Cvphar\\PhpParser\\' => 
        array (
            0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser',
        ),
        'Cvphar\\LesserEvil\\' => 
        array (
            0 => __DIR__ . '/..' . '/lesser-evil/shell-verbosity-is-evil/src',
        ),
        'Civi\\Cv\\' => 
        array (
            0 => __DIR__ . '/../..' . '/lib/src',
            1 => __DIR__ . '/../..' . '/src',
        ),
    );

    public static $classMap = array (
        'Civi\\Cv\\Application' => __DIR__ . '/../..' . '/src/Application.php',
        'Civi\\Cv\\Bootstrap' => __DIR__ . '/../..' . '/lib/src/Bootstrap.php',
        'Civi\\Cv\\BuildkitReader' => __DIR__ . '/../..' . '/lib/src/BuildkitReader.php',
        'Civi\\Cv\\CmsBootstrap' => __DIR__ . '/../..' . '/lib/src/CmsBootstrap.php',
        'Civi\\Cv\\Command\\AngularHtmlListCommand' => __DIR__ . '/../..' . '/src/Command/AngularHtmlListCommand.php',
        'Civi\\Cv\\Command\\AngularHtmlShowCommand' => __DIR__ . '/../..' . '/src/Command/AngularHtmlShowCommand.php',
        'Civi\\Cv\\Command\\AngularModuleListCommand' => __DIR__ . '/../..' . '/src/Command/AngularModuleListCommand.php',
        'Civi\\Cv\\Command\\Api4Command' => __DIR__ . '/../..' . '/src/Command/Api4Command.php',
        'Civi\\Cv\\Command\\ApiBatchCommand' => __DIR__ . '/../..' . '/src/Command/ApiBatchCommand.php',
        'Civi\\Cv\\Command\\ApiCommand' => __DIR__ . '/../..' . '/src/Command/ApiCommand.php',
        'Civi\\Cv\\Command\\BaseCommand' => __DIR__ . '/../..' . '/src/Command/BaseCommand.php',
        'Civi\\Cv\\Command\\BaseExtensionCommand' => __DIR__ . '/../..' . '/src/Command/BaseExtensionCommand.php',
        'Civi\\Cv\\Command\\BootCommand' => __DIR__ . '/../..' . '/src/Command/BootCommand.php',
        'Civi\\Cv\\Command\\CliCommand' => __DIR__ . '/../..' . '/src/Command/CliCommand.php',
        'Civi\\Cv\\Command\\CoreCheckReqCommand' => __DIR__ . '/../..' . '/src/Command/CoreCheckReqCommand.php',
        'Civi\\Cv\\Command\\CoreInstallCommand' => __DIR__ . '/../..' . '/src/Command/CoreInstallCommand.php',
        'Civi\\Cv\\Command\\CoreUninstallCommand' => __DIR__ . '/../..' . '/src/Command/CoreUninstallCommand.php',
        'Civi\\Cv\\Command\\DebugContainerCommand' => __DIR__ . '/../..' . '/src/Command/DebugContainerCommand.php',
        'Civi\\Cv\\Command\\DebugDispatcherCommand' => __DIR__ . '/../..' . '/src/Command/DebugDispatcherCommand.php',
        'Civi\\Cv\\Command\\EditCommand' => __DIR__ . '/../..' . '/src/Command/EditCommand.php',
        'Civi\\Cv\\Command\\EvalCommand' => __DIR__ . '/../..' . '/src/Command/EvalCommand.php',
        'Civi\\Cv\\Command\\ExtensionDisableCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionDisableCommand.php',
        'Civi\\Cv\\Command\\ExtensionDownloadCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionDownloadCommand.php',
        'Civi\\Cv\\Command\\ExtensionEnableCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionEnableCommand.php',
        'Civi\\Cv\\Command\\ExtensionListCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionListCommand.php',
        'Civi\\Cv\\Command\\ExtensionUninstallCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionUninstallCommand.php',
        'Civi\\Cv\\Command\\ExtensionUpgradeDbCommand' => __DIR__ . '/../..' . '/src/Command/ExtensionUpgradeDbCommand.php',
        'Civi\\Cv\\Command\\FillCommand' => __DIR__ . '/../..' . '/src/Command/FillCommand.php',
        'Civi\\Cv\\Command\\FlushCommand' => __DIR__ . '/../..' . '/src/Command/FlushCommand.php',
        'Civi\\Cv\\Command\\HttpCommand' => __DIR__ . '/../..' . '/src/Command/HttpCommand.php',
        'Civi\\Cv\\Command\\PathCommand' => __DIR__ . '/../..' . '/src/Command/PathCommand.php',
        'Civi\\Cv\\Command\\PipeCommand' => __DIR__ . '/../..' . '/src/Command/PipeCommand.php',
        'Civi\\Cv\\Command\\ScriptCommand' => __DIR__ . '/../..' . '/src/Command/ScriptCommand.php',
        'Civi\\Cv\\Command\\SettingGetCommand' => __DIR__ . '/../..' . '/src/Command/SettingGetCommand.php',
        'Civi\\Cv\\Command\\SettingRevertCommand' => __DIR__ . '/../..' . '/src/Command/SettingRevertCommand.php',
        'Civi\\Cv\\Command\\SettingSetCommand' => __DIR__ . '/../..' . '/src/Command/SettingSetCommand.php',
        'Civi\\Cv\\Command\\ShowCommand' => __DIR__ . '/../..' . '/src/Command/ShowCommand.php',
        'Civi\\Cv\\Command\\SqlCliCommand' => __DIR__ . '/../..' . '/src/Command/SqlCliCommand.php',
        'Civi\\Cv\\Command\\UpgradeCommand' => __DIR__ . '/../..' . '/src/Command/UpgradeCommand.php',
        'Civi\\Cv\\Command\\UpgradeDbCommand' => __DIR__ . '/../..' . '/src/Command/UpgradeDbCommand.php',
        'Civi\\Cv\\Command\\UpgradeDlCommand' => __DIR__ . '/../..' . '/src/Command/UpgradeDlCommand.php',
        'Civi\\Cv\\Command\\UpgradeGetCommand' => __DIR__ . '/../..' . '/src/Command/UpgradeGetCommand.php',
        'Civi\\Cv\\Command\\UpgradeReportCommand' => __DIR__ . '/../..' . '/src/Command/UpgradeReportCommand.php',
        'Civi\\Cv\\Command\\UrlCommand' => __DIR__ . '/../..' . '/src/Command/UrlCommand.php',
        'Civi\\Cv\\Config' => __DIR__ . '/../..' . '/lib/src/Config.php',
        'Civi\\Cv\\Encoder' => __DIR__ . '/../..' . '/src/Encoder.php',
        'Civi\\Cv\\ErrorHandler' => __DIR__ . '/../..' . '/lib/src/ErrorHandler.php',
        'Civi\\Cv\\Exception\\ProcessErrorException' => __DIR__ . '/../..' . '/src/Exception/ProcessErrorException.php',
        'Civi\\Cv\\Log\\InternalLogger' => __DIR__ . '/../..' . '/lib/src/Log/InternalLogger.php',
        'Civi\\Cv\\Log\\Logger' => __DIR__ . '/../..' . '/lib/src/Log/Logger.php',
        'Civi\\Cv\\Log\\StderrLogger' => __DIR__ . '/../..' . '/lib/src/Log/StderrLogger.php',
        'Civi\\Cv\\Log\\SymfonyConsoleLogger' => __DIR__ . '/../..' . '/lib/src/Log/SymfonyConsoleLogger.php',
        'Civi\\Cv\\PharOut\\PharOut' => __DIR__ . '/../..' . '/lib/src/PharOut/PharOut.php',
        'Civi\\Cv\\PharOut\\PharPolicyTrait' => __DIR__ . '/../..' . '/lib/src/PharOut/PharPolicyTrait.php',
        'Civi\\Cv\\SiteConfigReader' => __DIR__ . '/../..' . '/lib/src/SiteConfigReader.php',
        'Civi\\Cv\\Util\\AbstractPlusParser' => __DIR__ . '/../..' . '/src/Util/AbstractPlusParser.php',
        'Civi\\Cv\\Util\\Api4ArgParser' => __DIR__ . '/../..' . '/src/Util/Api4ArgParser.php',
        'Civi\\Cv\\Util\\ArrayUtil' => __DIR__ . '/../..' . '/src/Util/ArrayUtil.php',
        'Civi\\Cv\\Util\\BootTrait' => __DIR__ . '/../..' . '/lib/src/Util/BootTrait.php',
        'Civi\\Cv\\Util\\CliEditor' => __DIR__ . '/../..' . '/src/Util/CliEditor.php',
        'Civi\\Cv\\Util\\ConsoleQueueRunner' => __DIR__ . '/../..' . '/src/Util/ConsoleQueueRunner.php',
        'Civi\\Cv\\Util\\Cv' => __DIR__ . '/../..' . '/src/Util/Cv.php',
        'Civi\\Cv\\Util\\Datasource' => __DIR__ . '/../..' . '/src/Util/Datasource.php',
        'Civi\\Cv\\Util\\DebugDispatcherTrait' => __DIR__ . '/../..' . '/src/Util/DebugDispatcherTrait.php',
        'Civi\\Cv\\Util\\Filesystem' => __DIR__ . '/../..' . '/lib/src/Util/Filesystem.php',
        'Civi\\Cv\\Util\\FilesystemTrait' => __DIR__ . '/../..' . '/lib/src/Util/FilesystemTrait.php',
        'Civi\\Cv\\Util\\HeadlessDownloader' => __DIR__ . '/../..' . '/src/Util/HeadlessDownloader.php',
        'Civi\\Cv\\Util\\OptionCallbackTrait' => __DIR__ . '/../..' . '/src/Util/OptionCallbackTrait.php',
        'Civi\\Cv\\Util\\Process' => __DIR__ . '/../..' . '/src/Util/Process.php',
        'Civi\\Cv\\Util\\PsrLogger' => __DIR__ . '/../..' . '/src/Util/PsrLogger.php',
        'Civi\\Cv\\Util\\Rand' => __DIR__ . '/../..' . '/src/Util/Rand.php',
        'Civi\\Cv\\Util\\Relativizer' => __DIR__ . '/../..' . '/src/Util/Relativizer.php',
        'Civi\\Cv\\Util\\SettingArgParser' => __DIR__ . '/../..' . '/src/Util/SettingArgParser.php',
        'Civi\\Cv\\Util\\SettingCodec' => __DIR__ . '/../..' . '/src/Util/SettingCodec.php',
        'Civi\\Cv\\Util\\SettingTrait' => __DIR__ . '/../..' . '/src/Util/SettingTrait.php',
        'Civi\\Cv\\Util\\SetupCommandTrait' => __DIR__ . '/../..' . '/src/Util/SetupCommandTrait.php',
        'Civi\\Cv\\Util\\StructuredOutputTrait' => __DIR__ . '/../..' . '/src/Util/StructuredOutputTrait.php',
        'Civi\\Cv\\Util\\UrlCommandTrait' => __DIR__ . '/../..' . '/src/Util/UrlCommandTrait.php',
        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
        'Cvphar\\Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
        'Cvphar\\JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
        'Cvphar\\LesserEvil\\ShellVerbosityIsEvil' => __DIR__ . '/..' . '/lesser-evil/shell-verbosity-is-evil/src/ShellVerbosityIsEvil.php',
        'Cvphar\\PhpParser\\Builder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder.php',
        'Cvphar\\PhpParser\\BuilderFactory' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/BuilderFactory.php',
        'Cvphar\\PhpParser\\BuilderHelpers' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/BuilderHelpers.php',
        'Cvphar\\PhpParser\\Builder\\ClassConst' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php',
        'Cvphar\\PhpParser\\Builder\\Class_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Class_.php',
        'Cvphar\\PhpParser\\Builder\\Declaration' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Declaration.php',
        'Cvphar\\PhpParser\\Builder\\EnumCase' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php',
        'Cvphar\\PhpParser\\Builder\\Enum_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Enum_.php',
        'Cvphar\\PhpParser\\Builder\\FunctionLike' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php',
        'Cvphar\\PhpParser\\Builder\\Function_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Function_.php',
        'Cvphar\\PhpParser\\Builder\\Interface_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Interface_.php',
        'Cvphar\\PhpParser\\Builder\\Method' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Method.php',
        'Cvphar\\PhpParser\\Builder\\Namespace_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php',
        'Cvphar\\PhpParser\\Builder\\Param' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Param.php',
        'Cvphar\\PhpParser\\Builder\\Property' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Property.php',
        'Cvphar\\PhpParser\\Builder\\TraitUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php',
        'Cvphar\\PhpParser\\Builder\\TraitUseAdaptation' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php',
        'Cvphar\\PhpParser\\Builder\\Trait_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Trait_.php',
        'Cvphar\\PhpParser\\Builder\\Use_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Builder/Use_.php',
        'Cvphar\\PhpParser\\Comment' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Comment.php',
        'Cvphar\\PhpParser\\Comment\\Doc' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Comment/Doc.php',
        'Cvphar\\PhpParser\\ConstExprEvaluationException' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php',
        'Cvphar\\PhpParser\\ConstExprEvaluator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php',
        'Cvphar\\PhpParser\\Error' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Error.php',
        'Cvphar\\PhpParser\\ErrorHandler' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ErrorHandler.php',
        'Cvphar\\PhpParser\\ErrorHandler\\Collecting' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php',
        'Cvphar\\PhpParser\\ErrorHandler\\Throwing' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php',
        'Cvphar\\PhpParser\\Internal\\DiffElem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php',
        'Cvphar\\PhpParser\\Internal\\Differ' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/Differ.php',
        'Cvphar\\PhpParser\\Internal\\PrintableNewAnonClassNode' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php',
        'Cvphar\\PhpParser\\Internal\\TokenStream' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php',
        'Cvphar\\PhpParser\\JsonDecoder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/JsonDecoder.php',
        'Cvphar\\PhpParser\\Lexer' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer.php',
        'Cvphar\\PhpParser\\Lexer\\Emulative' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyFunctionTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php',
        'Cvphar\\PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php',
        'Cvphar\\PhpParser\\NameContext' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NameContext.php',
        'Cvphar\\PhpParser\\Node' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node.php',
        'Cvphar\\PhpParser\\NodeAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeAbstract.php',
        'Cvphar\\PhpParser\\NodeDumper' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeDumper.php',
        'Cvphar\\PhpParser\\NodeFinder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeFinder.php',
        'Cvphar\\PhpParser\\NodeTraverser' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeTraverser.php',
        'Cvphar\\PhpParser\\NodeTraverserInterface' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php',
        'Cvphar\\PhpParser\\NodeVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor.php',
        'Cvphar\\PhpParser\\NodeVisitorAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php',
        'Cvphar\\PhpParser\\NodeVisitor\\CloningVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php',
        'Cvphar\\PhpParser\\NodeVisitor\\FindingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php',
        'Cvphar\\PhpParser\\NodeVisitor\\FirstFindingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php',
        'Cvphar\\PhpParser\\NodeVisitor\\NameResolver' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php',
        'Cvphar\\PhpParser\\NodeVisitor\\NodeConnectingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php',
        'Cvphar\\PhpParser\\NodeVisitor\\ParentConnectingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php',
        'Cvphar\\PhpParser\\Node\\Arg' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Arg.php',
        'Cvphar\\PhpParser\\Node\\Attribute' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Attribute.php',
        'Cvphar\\PhpParser\\Node\\AttributeGroup' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php',
        'Cvphar\\PhpParser\\Node\\ComplexType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/ComplexType.php',
        'Cvphar\\PhpParser\\Node\\Const_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Const_.php',
        'Cvphar\\PhpParser\\Node\\Expr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ArrayDimFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ArrayItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Array_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ArrowFunction' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Assign' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseAnd' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseOr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseXor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Coalesce' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Concat' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Div' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Minus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Mod' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Mul' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Plus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\Pow' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\ShiftLeft' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignOp\\ShiftRight' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php',
        'Cvphar\\PhpParser\\Node\\Expr\\AssignRef' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseAnd' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseOr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseXor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanAnd' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanOr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Coalesce' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Concat' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Div' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Equal' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Greater' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\GreaterOrEqual' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Identical' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalAnd' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalOr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalXor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Minus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Mod' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Mul' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\NotEqual' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Plus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Pow' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftLeft' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftRight' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Smaller' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\SmallerOrEqual' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BinaryOp\\Spaceship' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BitwiseNot' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php',
        'Cvphar\\PhpParser\\Node\\Expr\\BooleanNot' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php',
        'Cvphar\\PhpParser\\Node\\Expr\\CallLike' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Array_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Bool_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Double' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Int_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Object_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\String_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Cast\\Unset_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ClassConstFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Clone_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Closure' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ClosureUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ConstFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Empty_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Error' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ErrorSuppress' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Eval_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Exit_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\FuncCall' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Include_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Instanceof_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Isset_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\List_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Match_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\MethodCall' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php',
        'Cvphar\\PhpParser\\Node\\Expr\\New_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\NullsafeMethodCall' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php',
        'Cvphar\\PhpParser\\Node\\Expr\\NullsafePropertyFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\PostDec' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php',
        'Cvphar\\PhpParser\\Node\\Expr\\PostInc' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php',
        'Cvphar\\PhpParser\\Node\\Expr\\PreDec' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php',
        'Cvphar\\PhpParser\\Node\\Expr\\PreInc' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Print_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\PropertyFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\ShellExec' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php',
        'Cvphar\\PhpParser\\Node\\Expr\\StaticCall' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php',
        'Cvphar\\PhpParser\\Node\\Expr\\StaticPropertyFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Ternary' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Throw_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php',
        'Cvphar\\PhpParser\\Node\\Expr\\UnaryMinus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\UnaryPlus' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Variable' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php',
        'Cvphar\\PhpParser\\Node\\Expr\\YieldFrom' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php',
        'Cvphar\\PhpParser\\Node\\Expr\\Yield_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php',
        'Cvphar\\PhpParser\\Node\\FunctionLike' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php',
        'Cvphar\\PhpParser\\Node\\Identifier' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Identifier.php',
        'Cvphar\\PhpParser\\Node\\IntersectionType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php',
        'Cvphar\\PhpParser\\Node\\MatchArm' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/MatchArm.php',
        'Cvphar\\PhpParser\\Node\\Name' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Name.php',
        'Cvphar\\PhpParser\\Node\\Name\\FullyQualified' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php',
        'Cvphar\\PhpParser\\Node\\Name\\Relative' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php',
        'Cvphar\\PhpParser\\Node\\NullableType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/NullableType.php',
        'Cvphar\\PhpParser\\Node\\Param' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Param.php',
        'Cvphar\\PhpParser\\Node\\Scalar' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\DNumber' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\Encapsed' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\EncapsedStringPart' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\LNumber' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Class_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Dir' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\File' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Function_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Line' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Method' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php',
        'Cvphar\\PhpParser\\Node\\Scalar\\String_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php',
        'Cvphar\\PhpParser\\Node\\Stmt' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Break_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Case_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Catch_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\ClassConst' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\ClassLike' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\ClassMethod' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Class_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Const_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Continue_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\DeclareDeclare' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Declare_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Do_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Echo_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\ElseIf_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Else_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\EnumCase' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Enum_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Expression' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Finally_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\For_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Foreach_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Function_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Global_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Goto_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\GroupUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\HaltCompiler' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\If_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\InlineHTML' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Interface_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Label' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Namespace_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Nop' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Property' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\PropertyProperty' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Return_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\StaticVar' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Static_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Switch_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Throw_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\TraitUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Precedence' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Trait_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\TryCatch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Unset_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\UseUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\Use_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php',
        'Cvphar\\PhpParser\\Node\\Stmt\\While_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php',
        'Cvphar\\PhpParser\\Node\\UnionType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/UnionType.php',
        'Cvphar\\PhpParser\\Node\\VarLikeIdentifier' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php',
        'Cvphar\\PhpParser\\Node\\VariadicPlaceholder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php',
        'Cvphar\\PhpParser\\Parser' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser.php',
        'Cvphar\\PhpParser\\ParserAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ParserAbstract.php',
        'Cvphar\\PhpParser\\ParserFactory' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ParserFactory.php',
        'Cvphar\\PhpParser\\Parser\\Multiple' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Multiple.php',
        'Cvphar\\PhpParser\\Parser\\Php5' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Php5.php',
        'Cvphar\\PhpParser\\Parser\\Php7' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Php7.php',
        'Cvphar\\PhpParser\\Parser\\Tokens' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Tokens.php',
        'Cvphar\\PhpParser\\PrettyPrinterAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php',
        'Cvphar\\PhpParser\\PrettyPrinter\\Standard' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php',
        'Cvphar\\Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
        'Cvphar\\Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
        'Cvphar\\Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
        'Cvphar\\Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
        'Cvphar\\Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
        'Cvphar\\Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
        'Cvphar\\Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
        'Cvphar\\Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
        'Cvphar\\Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
        'Cvphar\\Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
        'Cvphar\\Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
        'Cvphar\\Psy\\CodeCleaner' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner.php',
        'Cvphar\\Psy\\CodeCleaner\\AbstractClassPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/AbstractClassPass.php',
        'Cvphar\\Psy\\CodeCleaner\\AssignThisVariablePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/AssignThisVariablePass.php',
        'Cvphar\\Psy\\CodeCleaner\\CallTimePassByReferencePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/CallTimePassByReferencePass.php',
        'Cvphar\\Psy\\CodeCleaner\\CalledClassPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/CalledClassPass.php',
        'Cvphar\\Psy\\CodeCleaner\\CodeCleanerPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/CodeCleanerPass.php',
        'Cvphar\\Psy\\CodeCleaner\\EmptyArrayDimFetchPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php',
        'Cvphar\\Psy\\CodeCleaner\\ExitPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ExitPass.php',
        'Cvphar\\Psy\\CodeCleaner\\FinalClassPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/FinalClassPass.php',
        'Cvphar\\Psy\\CodeCleaner\\FunctionContextPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/FunctionContextPass.php',
        'Cvphar\\Psy\\CodeCleaner\\FunctionReturnInWriteContextPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/FunctionReturnInWriteContextPass.php',
        'Cvphar\\Psy\\CodeCleaner\\ImplicitReturnPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php',
        'Cvphar\\Psy\\CodeCleaner\\InstanceOfPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/InstanceOfPass.php',
        'Cvphar\\Psy\\CodeCleaner\\IssetPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/IssetPass.php',
        'Cvphar\\Psy\\CodeCleaner\\LabelContextPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/LabelContextPass.php',
        'Cvphar\\Psy\\CodeCleaner\\LeavePsyshAlonePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/LeavePsyshAlonePass.php',
        'Cvphar\\Psy\\CodeCleaner\\ListPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ListPass.php',
        'Cvphar\\Psy\\CodeCleaner\\LoopContextPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/LoopContextPass.php',
        'Cvphar\\Psy\\CodeCleaner\\MagicConstantsPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/MagicConstantsPass.php',
        'Cvphar\\Psy\\CodeCleaner\\NamespaceAwarePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/NamespaceAwarePass.php',
        'Cvphar\\Psy\\CodeCleaner\\NamespacePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/NamespacePass.php',
        'Cvphar\\Psy\\CodeCleaner\\NoReturnValue' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/NoReturnValue.php',
        'Cvphar\\Psy\\CodeCleaner\\PassableByReferencePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/PassableByReferencePass.php',
        'Cvphar\\Psy\\CodeCleaner\\RequirePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/RequirePass.php',
        'Cvphar\\Psy\\CodeCleaner\\ReturnTypePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ReturnTypePass.php',
        'Cvphar\\Psy\\CodeCleaner\\StrictTypesPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/StrictTypesPass.php',
        'Cvphar\\Psy\\CodeCleaner\\UseStatementPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/UseStatementPass.php',
        'Cvphar\\Psy\\CodeCleaner\\ValidClassNamePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ValidClassNamePass.php',
        'Cvphar\\Psy\\CodeCleaner\\ValidConstructorPass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ValidConstructorPass.php',
        'Cvphar\\Psy\\CodeCleaner\\ValidFunctionNamePass' => __DIR__ . '/..' . '/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php',
        'Cvphar\\Psy\\Command\\BufferCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/BufferCommand.php',
        'Cvphar\\Psy\\Command\\ClearCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ClearCommand.php',
        'Cvphar\\Psy\\Command\\Command' => __DIR__ . '/..' . '/psy/psysh/src/Command/Command.php',
        'Cvphar\\Psy\\Command\\DocCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/DocCommand.php',
        'Cvphar\\Psy\\Command\\DumpCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/DumpCommand.php',
        'Cvphar\\Psy\\Command\\EditCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/EditCommand.php',
        'Cvphar\\Psy\\Command\\ExitCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ExitCommand.php',
        'Cvphar\\Psy\\Command\\HelpCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/HelpCommand.php',
        'Cvphar\\Psy\\Command\\HistoryCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/HistoryCommand.php',
        'Cvphar\\Psy\\Command\\ListCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand.php',
        'Cvphar\\Psy\\Command\\ListCommand\\ClassConstantEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/ClassConstantEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\ClassEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/ClassEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\ConstantEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/ConstantEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\Enumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/Enumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\FunctionEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/FunctionEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\GlobalVariableEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/GlobalVariableEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\MethodEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/MethodEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\PropertyEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/PropertyEnumerator.php',
        'Cvphar\\Psy\\Command\\ListCommand\\VariableEnumerator' => __DIR__ . '/..' . '/psy/psysh/src/Command/ListCommand/VariableEnumerator.php',
        'Cvphar\\Psy\\Command\\ParseCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ParseCommand.php',
        'Cvphar\\Psy\\Command\\PsyVersionCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/PsyVersionCommand.php',
        'Cvphar\\Psy\\Command\\ReflectingCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ReflectingCommand.php',
        'Cvphar\\Psy\\Command\\ShowCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ShowCommand.php',
        'Cvphar\\Psy\\Command\\SudoCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/SudoCommand.php',
        'Cvphar\\Psy\\Command\\ThrowUpCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/ThrowUpCommand.php',
        'Cvphar\\Psy\\Command\\TimeitCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/TimeitCommand.php',
        'Cvphar\\Psy\\Command\\TimeitCommand\\TimeitVisitor' => __DIR__ . '/..' . '/psy/psysh/src/Command/TimeitCommand/TimeitVisitor.php',
        'Cvphar\\Psy\\Command\\TraceCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/TraceCommand.php',
        'Cvphar\\Psy\\Command\\WhereamiCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/WhereamiCommand.php',
        'Cvphar\\Psy\\Command\\WtfCommand' => __DIR__ . '/..' . '/psy/psysh/src/Command/WtfCommand.php',
        'Cvphar\\Psy\\ConfigPaths' => __DIR__ . '/..' . '/psy/psysh/src/ConfigPaths.php',
        'Cvphar\\Psy\\Configuration' => __DIR__ . '/..' . '/psy/psysh/src/Configuration.php',
        'Cvphar\\Psy\\Context' => __DIR__ . '/..' . '/psy/psysh/src/Context.php',
        'Cvphar\\Psy\\ContextAware' => __DIR__ . '/..' . '/psy/psysh/src/ContextAware.php',
        'Cvphar\\Psy\\EnvInterface' => __DIR__ . '/..' . '/psy/psysh/src/EnvInterface.php',
        'Cvphar\\Psy\\Exception\\BreakException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/BreakException.php',
        'Cvphar\\Psy\\Exception\\DeprecatedException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/DeprecatedException.php',
        'Cvphar\\Psy\\Exception\\ErrorException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/ErrorException.php',
        'Cvphar\\Psy\\Exception\\Exception' => __DIR__ . '/..' . '/psy/psysh/src/Exception/Exception.php',
        'Cvphar\\Psy\\Exception\\FatalErrorException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/FatalErrorException.php',
        'Cvphar\\Psy\\Exception\\ParseErrorException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/ParseErrorException.php',
        'Cvphar\\Psy\\Exception\\RuntimeException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/RuntimeException.php',
        'Cvphar\\Psy\\Exception\\ThrowUpException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/ThrowUpException.php',
        'Cvphar\\Psy\\Exception\\TypeErrorException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/TypeErrorException.php',
        'Cvphar\\Psy\\Exception\\UnexpectedTargetException' => __DIR__ . '/..' . '/psy/psysh/src/Exception/UnexpectedTargetException.php',
        'Cvphar\\Psy\\ExecutionClosure' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionClosure.php',
        'Cvphar\\Psy\\ExecutionLoopClosure' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionLoopClosure.php',
        'Cvphar\\Psy\\ExecutionLoop\\AbstractListener' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionLoop/AbstractListener.php',
        'Cvphar\\Psy\\ExecutionLoop\\Listener' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionLoop/Listener.php',
        'Cvphar\\Psy\\ExecutionLoop\\ProcessForker' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionLoop/ProcessForker.php',
        'Cvphar\\Psy\\ExecutionLoop\\RunkitReloader' => __DIR__ . '/..' . '/psy/psysh/src/ExecutionLoop/RunkitReloader.php',
        'Cvphar\\Psy\\Formatter\\CodeFormatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/CodeFormatter.php',
        'Cvphar\\Psy\\Formatter\\DocblockFormatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/DocblockFormatter.php',
        'Cvphar\\Psy\\Formatter\\Formatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/Formatter.php',
        'Cvphar\\Psy\\Formatter\\ReflectorFormatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/ReflectorFormatter.php',
        'Cvphar\\Psy\\Formatter\\SignatureFormatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/SignatureFormatter.php',
        'Cvphar\\Psy\\Formatter\\TraceFormatter' => __DIR__ . '/..' . '/psy/psysh/src/Formatter/TraceFormatter.php',
        'Cvphar\\Psy\\Input\\CodeArgument' => __DIR__ . '/..' . '/psy/psysh/src/Input/CodeArgument.php',
        'Cvphar\\Psy\\Input\\FilterOptions' => __DIR__ . '/..' . '/psy/psysh/src/Input/FilterOptions.php',
        'Cvphar\\Psy\\Input\\ShellInput' => __DIR__ . '/..' . '/psy/psysh/src/Input/ShellInput.php',
        'Cvphar\\Psy\\Input\\SilentInput' => __DIR__ . '/..' . '/psy/psysh/src/Input/SilentInput.php',
        'Cvphar\\Psy\\Output\\OutputPager' => __DIR__ . '/..' . '/psy/psysh/src/Output/OutputPager.php',
        'Cvphar\\Psy\\Output\\PassthruPager' => __DIR__ . '/..' . '/psy/psysh/src/Output/PassthruPager.php',
        'Cvphar\\Psy\\Output\\ProcOutputPager' => __DIR__ . '/..' . '/psy/psysh/src/Output/ProcOutputPager.php',
        'Cvphar\\Psy\\Output\\ShellOutput' => __DIR__ . '/..' . '/psy/psysh/src/Output/ShellOutput.php',
        'Cvphar\\Psy\\Output\\Theme' => __DIR__ . '/..' . '/psy/psysh/src/Output/Theme.php',
        'Cvphar\\Psy\\ParserFactory' => __DIR__ . '/..' . '/psy/psysh/src/ParserFactory.php',
        'Cvphar\\Psy\\Readline\\GNUReadline' => __DIR__ . '/..' . '/psy/psysh/src/Readline/GNUReadline.php',
        'Cvphar\\Psy\\Readline\\HoaConsole' => __DIR__ . '/..' . '/psy/psysh/src/Readline/HoaConsole.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Autocompleter' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Autocompleter.php',
        'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterAggregate' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/AutocompleterAggregate.php',
        'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterPath' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/AutocompleterPath.php',
        'Cvphar\\Psy\\Readline\\Hoa\\AutocompleterWord' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/AutocompleterWord.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Console' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Console.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleCursor' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleCursor.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleInput' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleInput.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleOutput' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleOutput.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleProcessus' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleProcessus.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleTput' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleTput.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ConsoleWindow' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ConsoleWindow.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Event' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Event.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventBucket' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventBucket.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventListenable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventListenable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventListener' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventListener.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventListens' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventListens.php',
        'Cvphar\\Psy\\Readline\\Hoa\\EventSource' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/EventSource.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Exception' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Exception.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ExceptionIdle' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ExceptionIdle.php',
        'Cvphar\\Psy\\Readline\\Hoa\\File' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/File.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileDirectory' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileDirectory.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileDoesNotExistException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileDoesNotExistException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileFinder' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileFinder.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileGeneric' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileGeneric.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileLink' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileLink.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileLinkRead' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileLinkRead.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileLinkReadWrite' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileLinkReadWrite.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileRead' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileRead.php',
        'Cvphar\\Psy\\Readline\\Hoa\\FileReadWrite' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/FileReadWrite.php',
        'Cvphar\\Psy\\Readline\\Hoa\\IStream' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/IStream.php',
        'Cvphar\\Psy\\Readline\\Hoa\\IteratorFileSystem' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/IteratorFileSystem.php',
        'Cvphar\\Psy\\Readline\\Hoa\\IteratorRecursiveDirectory' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/IteratorRecursiveDirectory.php',
        'Cvphar\\Psy\\Readline\\Hoa\\IteratorSplFileInfo' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/IteratorSplFileInfo.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Protocol' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Protocol.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ProtocolException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ProtocolException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ProtocolNode' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ProtocolNode.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ProtocolNodeLibrary' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php',
        'Cvphar\\Psy\\Readline\\Hoa\\ProtocolWrapper' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/ProtocolWrapper.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Readline' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Readline.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Stream' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Stream.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamBufferable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamBufferable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamContext' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamContext.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamException' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamException.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamIn' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamIn.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamLockable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamLockable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamOut' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamOut.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamPathable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamPathable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamPointable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamPointable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamStatable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamStatable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\StreamTouchable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/StreamTouchable.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Ustring' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Ustring.php',
        'Cvphar\\Psy\\Readline\\Hoa\\Xcallable' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Hoa/Xcallable.php',
        'Cvphar\\Psy\\Readline\\Libedit' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Libedit.php',
        'Cvphar\\Psy\\Readline\\Readline' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Readline.php',
        'Cvphar\\Psy\\Readline\\Transient' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Transient.php',
        'Cvphar\\Psy\\Readline\\Userland' => __DIR__ . '/..' . '/psy/psysh/src/Readline/Userland.php',
        'Cvphar\\Psy\\Reflection\\ReflectionClassConstant' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionClassConstant.php',
        'Cvphar\\Psy\\Reflection\\ReflectionConstant' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionConstant.php',
        'Cvphar\\Psy\\Reflection\\ReflectionConstant_' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionConstant_.php',
        'Cvphar\\Psy\\Reflection\\ReflectionLanguageConstruct' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionLanguageConstruct.php',
        'Cvphar\\Psy\\Reflection\\ReflectionLanguageConstructParameter' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionLanguageConstructParameter.php',
        'Cvphar\\Psy\\Reflection\\ReflectionNamespace' => __DIR__ . '/..' . '/psy/psysh/src/Reflection/ReflectionNamespace.php',
        'Cvphar\\Psy\\Shell' => __DIR__ . '/..' . '/psy/psysh/src/Shell.php',
        'Cvphar\\Psy\\Sudo' => __DIR__ . '/..' . '/psy/psysh/src/Sudo.php',
        'Cvphar\\Psy\\Sudo\\SudoVisitor' => __DIR__ . '/..' . '/psy/psysh/src/Sudo/SudoVisitor.php',
        'Cvphar\\Psy\\SuperglobalsEnv' => __DIR__ . '/..' . '/psy/psysh/src/SuperglobalsEnv.php',
        'Cvphar\\Psy\\SystemEnv' => __DIR__ . '/..' . '/psy/psysh/src/SystemEnv.php',
        'Cvphar\\Psy\\TabCompletion\\AutoCompleter' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/AutoCompleter.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractContextAwareMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/AbstractContextAwareMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractDefaultParametersMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/AbstractDefaultParametersMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\AbstractMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/AbstractMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassAttributesMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ClassAttributesMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassMethodDefaultParametersMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ClassMethodDefaultParametersMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassMethodsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ClassNamesMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ClassNamesMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\CommandsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/CommandsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ConstantsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ConstantsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\FunctionDefaultParametersMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/FunctionDefaultParametersMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\FunctionsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/FunctionsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\KeywordsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\MongoClientMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/MongoClientMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\MongoDatabaseMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/MongoDatabaseMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectAttributesMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ObjectAttributesMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectMethodDefaultParametersMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ObjectMethodDefaultParametersMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\ObjectMethodsMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/ObjectMethodsMatcher.php',
        'Cvphar\\Psy\\TabCompletion\\Matcher\\VariablesMatcher' => __DIR__ . '/..' . '/psy/psysh/src/TabCompletion/Matcher/VariablesMatcher.php',
        'Cvphar\\Psy\\Util\\Docblock' => __DIR__ . '/..' . '/psy/psysh/src/Util/Docblock.php',
        'Cvphar\\Psy\\Util\\Json' => __DIR__ . '/..' . '/psy/psysh/src/Util/Json.php',
        'Cvphar\\Psy\\Util\\Mirror' => __DIR__ . '/..' . '/psy/psysh/src/Util/Mirror.php',
        'Cvphar\\Psy\\Util\\Str' => __DIR__ . '/..' . '/psy/psysh/src/Util/Str.php',
        'Cvphar\\Psy\\VarDumper\\Cloner' => __DIR__ . '/..' . '/psy/psysh/src/VarDumper/Cloner.php',
        'Cvphar\\Psy\\VarDumper\\Dumper' => __DIR__ . '/..' . '/psy/psysh/src/VarDumper/Dumper.php',
        'Cvphar\\Psy\\VarDumper\\Presenter' => __DIR__ . '/..' . '/psy/psysh/src/VarDumper/Presenter.php',
        'Cvphar\\Psy\\VarDumper\\PresenterAware' => __DIR__ . '/..' . '/psy/psysh/src/VarDumper/PresenterAware.php',
        'Cvphar\\Psy\\VersionUpdater\\Checker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Checker.php',
        'Cvphar\\Psy\\VersionUpdater\\Downloader' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Downloader.php',
        'Cvphar\\Psy\\VersionUpdater\\Downloader\\CurlDownloader' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Downloader/CurlDownloader.php',
        'Cvphar\\Psy\\VersionUpdater\\Downloader\\Factory' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Downloader/Factory.php',
        'Cvphar\\Psy\\VersionUpdater\\Downloader\\FileDownloader' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Downloader/FileDownloader.php',
        'Cvphar\\Psy\\VersionUpdater\\GitHubChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/GitHubChecker.php',
        'Cvphar\\Psy\\VersionUpdater\\Installer' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/Installer.php',
        'Cvphar\\Psy\\VersionUpdater\\IntervalChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/IntervalChecker.php',
        'Cvphar\\Psy\\VersionUpdater\\NoopChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/NoopChecker.php',
        'Cvphar\\Psy\\VersionUpdater\\SelfUpdate' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/SelfUpdate.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/Completion.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionCommand' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/CompletionCommand.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionContext' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/CompletionContext.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\CompletionHandler' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/CompletionHandler.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\CompletionAwareInterface' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/Completion/CompletionAwareInterface.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\CompletionInterface' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/Completion/CompletionInterface.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\Completion\\ShellPathCompletion' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/Completion/ShellPathCompletion.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\EnvironmentCompletionContext' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/EnvironmentCompletionContext.php',
        'Cvphar\\Stecman\\Component\\Symfony\\Console\\BashCompletion\\HookFactory' => __DIR__ . '/..' . '/stecman/symfony-console-completion/src/HookFactory.php',
        'Cvphar\\Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
        'Cvphar\\Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php',
        'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
        'Cvphar\\Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/FactoryCommandLoader.php',
        'Cvphar\\Symfony\\Component\\Console\\Command\\Command' => __DIR__ . '/..' . '/symfony/console/Command/Command.php',
        'Cvphar\\Symfony\\Component\\Console\\Command\\HelpCommand' => __DIR__ . '/..' . '/symfony/console/Command/HelpCommand.php',
        'Cvphar\\Symfony\\Component\\Console\\Command\\ListCommand' => __DIR__ . '/..' . '/symfony/console/Command/ListCommand.php',
        'Cvphar\\Symfony\\Component\\Console\\Command\\LockableTrait' => __DIR__ . '/..' . '/symfony/console/Command/LockableTrait.php',
        'Cvphar\\Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php',
        'Cvphar\\Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => __DIR__ . '/..' . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => __DIR__ . '/..' . '/symfony/console/Descriptor/ApplicationDescription.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\Descriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/Descriptor.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => __DIR__ . '/..' . '/symfony/console/Descriptor/DescriptorInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/JsonDescriptor.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/MarkdownDescriptor.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/TextDescriptor.php',
        'Cvphar\\Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/XmlDescriptor.php',
        'Cvphar\\Symfony\\Component\\Console\\EventListener\\ErrorListener' => __DIR__ . '/..' . '/symfony/console/EventListener/ErrorListener.php',
        'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleCommandEvent.php',
        'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleErrorEvent.php',
        'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleEvent.php',
        'Cvphar\\Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleTerminateEvent.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/CommandNotFoundException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/console/Exception/ExceptionInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidArgumentException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\InvalidOptionException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidOptionException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\MissingInputException' => __DIR__ . '/..' . '/symfony/console/Exception/MissingInputException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/NamespaceNotFoundException.php',
        'Cvphar\\Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatter.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyle.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleStack.php',
        'Cvphar\\Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DebugFormatterHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\DescriptorHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DescriptorHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\Dumper' => __DIR__ . '/..' . '/symfony/console/Helper/Dumper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\FormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/FormatterHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\Helper' => __DIR__ . '/..' . '/symfony/console/Helper/Helper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\HelperInterface' => __DIR__ . '/..' . '/symfony/console/Helper/HelperInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\HelperSet' => __DIR__ . '/..' . '/symfony/console/Helper/HelperSet.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\InputAwareHelper' => __DIR__ . '/..' . '/symfony/console/Helper/InputAwareHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\ProcessHelper' => __DIR__ . '/..' . '/symfony/console/Helper/ProcessHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\ProgressBar' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressBar.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\ProgressIndicator' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressIndicator.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\QuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/QuestionHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/SymfonyQuestionHelper.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\Table' => __DIR__ . '/..' . '/symfony/console/Helper/Table.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\TableCell' => __DIR__ . '/..' . '/symfony/console/Helper/TableCell.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\TableRows' => __DIR__ . '/..' . '/symfony/console/Helper/TableRows.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php',
        'Cvphar\\Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\ArrayInput' => __DIR__ . '/..' . '/symfony/console/Input/ArrayInput.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\Input' => __DIR__ . '/..' . '/symfony/console/Input/Input.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\InputArgument' => __DIR__ . '/..' . '/symfony/console/Input/InputArgument.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\InputAwareInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputAwareInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\InputDefinition' => __DIR__ . '/..' . '/symfony/console/Input/InputDefinition.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\InputInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\InputOption' => __DIR__ . '/..' . '/symfony/console/Input/InputOption.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\StreamableInputInterface' => __DIR__ . '/..' . '/symfony/console/Input/StreamableInputInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Input\\StringInput' => __DIR__ . '/..' . '/symfony/console/Input/StringInput.php',
        'Cvphar\\Symfony\\Component\\Console\\Logger\\ConsoleLogger' => __DIR__ . '/..' . '/symfony/console/Logger/ConsoleLogger.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\BufferedOutput' => __DIR__ . '/..' . '/symfony/console/Output/BufferedOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutputInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleSectionOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\NullOutput' => __DIR__ . '/..' . '/symfony/console/Output/NullOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\Output' => __DIR__ . '/..' . '/symfony/console/Output/Output.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\OutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/OutputInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\StreamOutput' => __DIR__ . '/..' . '/symfony/console/Output/StreamOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => __DIR__ . '/..' . '/symfony/console/Output/TrimmedBufferOutput.php',
        'Cvphar\\Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php',
        'Cvphar\\Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php',
        'Cvphar\\Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php',
        'Cvphar\\Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php',
        'Cvphar\\Symfony\\Component\\Console\\Style\\StyleInterface' => __DIR__ . '/..' . '/symfony/console/Style/StyleInterface.php',
        'Cvphar\\Symfony\\Component\\Console\\Style\\SymfonyStyle' => __DIR__ . '/..' . '/symfony/console/Style/SymfonyStyle.php',
        'Cvphar\\Symfony\\Component\\Console\\Terminal' => __DIR__ . '/..' . '/symfony/console/Terminal.php',
        'Cvphar\\Symfony\\Component\\Console\\Tester\\ApplicationTester' => __DIR__ . '/..' . '/symfony/console/Tester/ApplicationTester.php',
        'Cvphar\\Symfony\\Component\\Console\\Tester\\CommandTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandTester.php',
        'Cvphar\\Symfony\\Component\\Console\\Tester\\TesterTrait' => __DIR__ . '/..' . '/symfony/console/Tester/TesterTrait.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/process/Exception/ExceptionInterface.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/process/Exception/InvalidArgumentException.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/process/Exception/LogicException.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessFailedException.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessSignaledException.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessTimedOutException.php',
        'Cvphar\\Symfony\\Component\\Process\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/process/Exception/RuntimeException.php',
        'Cvphar\\Symfony\\Component\\Process\\ExecutableFinder' => __DIR__ . '/..' . '/symfony/process/ExecutableFinder.php',
        'Cvphar\\Symfony\\Component\\Process\\InputStream' => __DIR__ . '/..' . '/symfony/process/InputStream.php',
        'Cvphar\\Symfony\\Component\\Process\\PhpExecutableFinder' => __DIR__ . '/..' . '/symfony/process/PhpExecutableFinder.php',
        'Cvphar\\Symfony\\Component\\Process\\PhpProcess' => __DIR__ . '/..' . '/symfony/process/PhpProcess.php',
        'Cvphar\\Symfony\\Component\\Process\\Pipes\\AbstractPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/AbstractPipes.php',
        'Cvphar\\Symfony\\Component\\Process\\Pipes\\PipesInterface' => __DIR__ . '/..' . '/symfony/process/Pipes/PipesInterface.php',
        'Cvphar\\Symfony\\Component\\Process\\Pipes\\UnixPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/UnixPipes.php',
        'Cvphar\\Symfony\\Component\\Process\\Pipes\\WindowsPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/WindowsPipes.php',
        'Cvphar\\Symfony\\Component\\Process\\Process' => __DIR__ . '/..' . '/symfony/process/Process.php',
        'Cvphar\\Symfony\\Component\\Process\\ProcessUtils' => __DIR__ . '/..' . '/symfony/process/ProcessUtils.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/AmqpCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ArgsStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ArgsStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\Caster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/Caster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ClassStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ClassStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ConstStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ConstStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/CutArrayStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/CutStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DOMCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DateCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DoctrineCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DsCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DsPairStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\EnumStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/EnumStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ExceptionCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FiberCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/FiberCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FrameStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/FrameStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\GmpCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/GmpCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ImagineCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ImagineCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ImgStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ImgStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/IntlCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\LinkStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/LinkStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/MemcachedCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MysqliCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/MysqliCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PdoCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PgSqlCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ProxyManagerCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/RdKafkaCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/RedisCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ReflectionCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ResourceCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/SplCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/StubCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/SymfonyCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\TraceStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/TraceStub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\UuidCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/UuidCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/XmlReaderCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/XmlResourceCaster.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/AbstractCloner.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\ClonerInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/ClonerInterface.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Cursor' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/Cursor.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Data' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/Data.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\DumperInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/DumperInterface.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\Stub' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/Stub.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\VarCloner' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/VarCloner.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\CliDescriptor' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/CliDescriptor.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\DumpDescriptorInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Command\\Descriptor\\HtmlDescriptor' => __DIR__ . '/..' . '/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Command\\ServerDumpCommand' => __DIR__ . '/..' . '/symfony/var-dumper/Command/ServerDumpCommand.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\AbstractDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/AbstractDumper.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\CliDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/CliDumper.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\CliContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\RequestContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\SourceContextProvider' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ContextualizedDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ContextualizedDumper.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/DataDumperInterface.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/HtmlDumper.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Dumper\\ServerDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/ServerDumper.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => __DIR__ . '/..' . '/symfony/var-dumper/Exception/ThrowingCasterException.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Server\\Connection' => __DIR__ . '/..' . '/symfony/var-dumper/Server/Connection.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\Server\\DumpServer' => __DIR__ . '/..' . '/symfony/var-dumper/Server/DumpServer.php',
        'Cvphar\\Symfony\\Component\\VarDumper\\VarDumper' => __DIR__ . '/..' . '/symfony/var-dumper/VarDumper.php',
        'Cvphar\\Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php',
        'Cvphar\\Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php',
        'Cvphar\\Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php',
        'Cvphar\\Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php',
        'Cvphar\\Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php',
        'Cvphar\\Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
        'Cvphar\\Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php',
        'Cvphar\\Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php',
        'Cvphar\\UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
        'Cvphar\\ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->prefixLengthsPsr4 = ComposerStaticInit96d604555834bcf22f002764f3450e45::$prefixLengthsPsr4;
            $loader->prefixDirsPsr4 = ComposerStaticInit96d604555834bcf22f002764f3450e45::$prefixDirsPsr4;
            $loader->classMap = ComposerStaticInit96d604555834bcf22f002764f3450e45::$classMap;

        }, null, ClassLoader::class);
    }
}
<?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit96d604555834bcf22f002764f3450e45
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    /**
     * @return \Composer\Autoload\ClassLoader
     */
    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        require __DIR__ . '/platform_check.php';

        spl_autoload_register(array('ComposerAutoloaderInit96d604555834bcf22f002764f3450e45', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
        spl_autoload_unregister(array('ComposerAutoloaderInit96d604555834bcf22f002764f3450e45', 'loadClassLoader'));

        require __DIR__ . '/autoload_static.php';
        call_user_func(\Composer\Autoload\ComposerStaticInit96d604555834bcf22f002764f3450e45::getInitializer($loader));

        $loader->setClassMapAuthoritative(true);
        $loader->register(true);

        $includeFiles = \Composer\Autoload\ComposerStaticInit96d604555834bcf22f002764f3450e45::$files;
        foreach ($includeFiles as $fileIdentifier => $file) {
            composerRequire96d604555834bcf22f002764f3450e45($fileIdentifier, $file);
        }

        return $loader;
    }
}

/**
 * @param string $fileIdentifier
 * @param string $file
 * @return void
 */
function composerRequire96d604555834bcf22f002764f3450e45($fileIdentifier, $file)
{
    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

        require $file;
    }
}
<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
    '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
    '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
    '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
    '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
);
<?php

namespace Cvphar\Composer;

use Cvphar\Composer\Autoload\ClassLoader;
use Cvphar\Composer\Semver\VersionParser;
class InstalledVersions
{
    /**
    @psalm-var
    */
    private static $installed;
    private static $canGetVendors;
    /**
    @psalm-var
    */
    private static $installedByVendor = array();
    /**
    @psalm-return
    */
    public static function getInstalledPackages()
    {
        $packages = array();
        foreach (self::getInstalled() as $installed) {
            $packages[] = \array_keys($installed['versions']);
        }
        if (1 === \count($packages)) {
            return $packages[0];
        }
        return \array_keys(\array_flip(\call_user_func_array('array_merge', $packages)));
    }
    /**
    @psalm-return
    */
    public static function getInstalledPackagesByType($type)
    {
        $packagesByType = array();
        foreach (self::getInstalled() as $installed) {
            foreach ($installed['versions'] as $name => $package) {
                if (isset($package['type']) && $package['type'] === $type) {
                    $packagesByType[] = $name;
                }
            }
        }
        return $packagesByType;
    }
    public static function isInstalled($packageName, $includeDevRequirements = \true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }
        return \false;
    }
    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    {
        $constraint = $parser->parseConstraints($constraint);
        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
        return $provided->matches($constraint);
    }
    public static function getVersionRanges($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            $ranges = array();
            if (isset($installed['versions'][$packageName]['pretty_version'])) {
                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
            }
            if (\array_key_exists('aliases', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['aliases']);
            }
            if (\array_key_exists('replaced', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['replaced']);
            }
            if (\array_key_exists('provided', $installed['versions'][$packageName])) {
                $ranges = \array_merge($ranges, $installed['versions'][$packageName]['provided']);
            }
            return \implode(' || ', $ranges);
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['version'])) {
                return null;
            }
            return $installed['versions'][$packageName]['version'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getPrettyVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
                return null;
            }
            return $installed['versions'][$packageName]['pretty_version'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getReference($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            if (!isset($installed['versions'][$packageName]['reference'])) {
                return null;
            }
            return $installed['versions'][$packageName]['reference'];
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    public static function getInstallPath($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }
            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
        }
        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }
    /**
    @psalm-return
    */
    public static function getRootPackage()
    {
        $installed = self::getInstalled();
        return $installed[0]['root'];
    }
    /**
    @psalm-return
    */
    public static function getRawData()
    {
        @\trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', \E_USER_DEPRECATED);
        if (null === self::$installed) {
            if (\substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = (include __DIR__ . '/installed.php');
            } else {
                self::$installed = array();
            }
        }
        return self::$installed;
    }
    /**
    @psalm-return
    */
    public static function getAllRawData()
    {
        return self::getInstalled();
    }
    /**
    @psalm-param
    */
    public static function reload($data)
    {
        self::$installed = $data;
        self::$installedByVendor = array();
    }
    /**
    @psalm-return
    */
    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = \method_exists('Cvphar\\Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');
        }
        $installed = array();
        if (self::$canGetVendors) {
            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
                if (isset(self::$installedByVendor[$vendorDir])) {
                    $installed[] = self::$installedByVendor[$vendorDir];
                } elseif (\is_file($vendorDir . '/composer/installed.php')) {
                    $installed[] = self::$installedByVendor[$vendorDir] = (require $vendorDir . '/composer/installed.php');
                    if (null === self::$installed && \strtr($vendorDir . '/composer', '\\', '/') === \strtr(__DIR__, '\\', '/')) {
                        self::$installed = $installed[\count($installed) - 1];
                    }
                }
            }
        }
        if (null === self::$installed) {
            if (\substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = (require __DIR__ . '/installed.php');
            } else {
                self::$installed = array();
            }
        }
        $installed[] = self::$installed;
        return $installed;
    }
}
<?php

namespace Cvphar;

return array('root' => array('name' => 'civicrm/cv', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'af01e9c33697af5c01858e7db5688c538f624a6b', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('civicrm/cv' => array('pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'af01e9c33697af5c01858e7db5688c538f624a6b', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'civicrm/cv-lib' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-master')), 'lesser-evil/shell-verbosity-is-evil' => array('pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', 'reference' => '4195bce7e3adaeda6d4747a1f3ec3c39b124f169', 'type' => 'library', 'install_path' => __DIR__ . '/../lesser-evil/shell-verbosity-is-evil', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.5', 'version' => '4.15.5.0', 'reference' => '11e2663a5bc9db5d714eedb4277ee300403b4a9e', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log' => array('pretty_version' => '1.1.4', 'version' => '1.1.4.0', 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0')), 'psy/psysh' => array('pretty_version' => 'v0.11.18', 'version' => '0.11.18.0', 'reference' => '4f00ee9e236fa6a48f4560d1300b9c961a70a7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../psy/psysh', 'aliases' => array(), 'dev_requirement' => \false), 'stecman/symfony-console-completion' => array('pretty_version' => '0.11.0', 'version' => '0.11.0.0', 'reference' => 'a9502dab59405e275a9f264536c4e1cb61fc3518', 'type' => 'library', 'install_path' => __DIR__ . '/../stecman/symfony-console-completion', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v4.4.34', 'version' => '4.4.34.0', 'reference' => '329b3a75cc6b16d435ba1b1a41df54a53382a3f0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => '81ffd3a9c6d707be22e3012b827de1c9775fc5ac', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-php73' => array('pretty_version' => 'v1.23.0', 'version' => '1.23.0.0', 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php73', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-php80' => array('pretty_version' => 'v1.23.1', 'version' => '1.23.1.0', 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v4.4.35', 'version' => '4.4.35.0', 'reference' => 'c2098705326addae6e6742151dfade47ac71da1b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v1.1.11', 'version' => '1.1.11.0', 'reference' => '633df678bec3452e04a7b0337c9bcfe7354124b3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/var-dumper' => array('pretty_version' => 'v5.4.24', 'version' => '5.4.24.0', 'reference' => '8e12706bf9c68a2da633f23bfdc15b4dce5970b3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), 'dev_requirement' => \false)));
<?php

namespace Cvphar\Psy;

use Cvphar\Psy\ExecutionLoop\ProcessForker;
use Cvphar\Psy\VersionUpdater\GitHubChecker;
use Cvphar\Psy\VersionUpdater\Installer;
use Cvphar\Psy\VersionUpdater\SelfUpdate;
use Cvphar\Symfony\Component\Console\Input\ArgvInput;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
if (!\function_exists('Cvphar\\Psy\\sh')) {
    function sh() : string
    {
        if (\version_compare(\PHP_VERSION, '8.0', '<')) {
            return '\\extract(\\Psy\\debug(\\get_defined_vars(), isset($this) ? $this : @\\get_called_class()));';
        }
        return <<<'EOS'
if (isset($this)) {
    \extract(\Psy\debug(\get_defined_vars(), $this));
} else {
    try {
        static::class;
        \extract(\Psy\debug(\get_defined_vars(), static::class));
    } catch (\Error $e) {
        \extract(\Psy\debug(\get_defined_vars()));
    }
}
EOS;
    }
}
if (!\function_exists('Cvphar\\Psy\\debug')) {
    function debug(array $vars = [], $bindTo = null) : array
    {
        echo \PHP_EOL;
        $sh = new Shell();
        $sh->setScopeVariables($vars);
        if ($sh->has('whereami')) {
            $sh->addInput('whereami -n2', \true);
        }
        if (\is_string($bindTo)) {
            $sh->setBoundClass($bindTo);
        } elseif ($bindTo !== null) {
            $sh->setBoundObject($bindTo);
        }
        $sh->run();
        return $sh->getScopeVariables(\false);
    }
}
if (!\function_exists('Cvphar\\Psy\\info')) {
    function info(Configuration $config = null)
    {
        static $lastConfig;
        if ($config !== null) {
            $lastConfig = $config;
            return;
        }
        $prettyPath = function ($path) {
            return $path;
        };
        $homeDir = (new ConfigPaths())->homeDir();
        if ($homeDir && ($homeDir = \rtrim($homeDir, '/'))) {
            $homePattern = '#^' . \preg_quote($homeDir, '#') . '/#';
            $prettyPath = function ($path) use($homePattern) {
                if (\is_string($path)) {
                    return \preg_replace($homePattern, '~/', $path);
                } else {
                    return $path;
                }
            };
        }
        $config = $lastConfig ?: new Configuration();
        $configEnv = isset($_SERVER['PSYSH_CONFIG']) && $_SERVER['PSYSH_CONFIG'] ? $_SERVER['PSYSH_CONFIG'] : \false;
        if ($configEnv === \false && \PHP_SAPI === 'cli-server') {
            $configEnv = \getenv('PSYSH_CONFIG');
        }
        $shellInfo = ['PsySH version' => Shell::VERSION];
        $core = ['PHP version' => \PHP_VERSION, 'OS' => \PHP_OS, 'default includes' => $config->getDefaultIncludes(), 'require semicolons' => $config->requireSemicolons(), 'error logging level' => $config->errorLoggingLevel(), 'config file' => ['default config file' => $prettyPath($config->getConfigFile()), 'local config file' => $prettyPath($config->getLocalConfigFile()), 'PSYSH_CONFIG env' => $prettyPath($configEnv)]];
        $checker = new GitHubChecker();
        $updateAvailable = null;
        $latest = null;
        try {
            $updateAvailable = !$checker->isLatest();
            $latest = $checker->getLatest();
        } catch (\Throwable $e) {
        }
        $updates = ['update available' => $updateAvailable, 'latest release version' => $latest, 'update check interval' => $config->getUpdateCheck(), 'update cache file' => $prettyPath($config->getUpdateCheckCacheFile())];
        $input = ['interactive mode' => $config->interactiveMode(), 'input interactive' => $config->getInputInteractive(), 'yolo' => $config->yolo()];
        if ($config->hasReadline()) {
            $info = \readline_info();
            $readline = ['readline available' => \true, 'readline enabled' => $config->useReadline(), 'readline service' => \get_class($config->getReadline())];
            if (isset($info['library_version'])) {
                $readline['readline library'] = $info['library_version'];
            }
            if (isset($info['readline_name']) && $info['readline_name'] !== '') {
                $readline['readline name'] = $info['readline_name'];
            }
        } else {
            $readline = ['readline available' => \false];
        }
        $output = ['color mode' => $config->colorMode(), 'output decorated' => $config->getOutputDecorated(), 'output verbosity' => $config->verbosity(), 'output pager' => $config->getPager()];
        $theme = $config->theme();
        $output['theme'] = ['compact' => $theme->compact(), 'prompt' => $theme->prompt(), 'bufferPrompt' => $theme->bufferPrompt(), 'replayPrompt' => $theme->replayPrompt(), 'returnValue' => $theme->returnValue()];
        $pcntl = ['pcntl available' => ProcessForker::isPcntlSupported(), 'posix available' => ProcessForker::isPosixSupported()];
        if ($disabledPcntl = ProcessForker::disabledPcntlFunctions()) {
            $pcntl['disabled pcntl functions'] = $disabledPcntl;
        }
        if ($disabledPosix = ProcessForker::disabledPosixFunctions()) {
            $pcntl['disabled posix functions'] = $disabledPosix;
        }
        $pcntl['use pcntl'] = $config->usePcntl();
        $history = ['history file' => $prettyPath($config->getHistoryFile()), 'history size' => $config->getHistorySize(), 'erase duplicates' => $config->getEraseDuplicates()];
        $docs = ['manual db file' => $prettyPath($config->getManualDbFile()), 'sqlite available' => \true];
        try {
            if ($db = $config->getManualDb()) {
                if ($q = $db->query('SELECT * FROM meta;')) {
                    $q->setFetchMode(\PDO::FETCH_KEY_PAIR);
                    $meta = $q->fetchAll();
                    foreach ($meta as $key => $val) {
                        switch ($key) {
                            case 'built_at':
                                $d = new \DateTime('@' . $val);
                                $val = $d->format(\DateTime::RFC2822);
                                break;
                        }
                        $key = 'db ' . \str_replace('_', ' ', $key);
                        $docs[$key] = $val;
                    }
                } else {
                    $docs['db schema'] = '0.1.0';
                }
            }
        } catch (Exception\RuntimeException $e) {
            if ($e->getMessage() === 'SQLite PDO driver not found') {
                $docs['sqlite available'] = \false;
            } else {
                throw $e;
            }
        }
        $autocomplete = ['tab completion enabled' => $config->useTabCompletion(), 'bracketed paste' => $config->useBracketedPaste()];
        try {
            if ($shell = Sudo::fetchProperty($config, 'shell')) {
                $shellClass = \get_class($shell);
                if ($shellClass !== 'Psy\\Shell') {
                    $shellInfo = ['PsySH version' => $shell::VERSION, 'Shell class' => $shellClass];
                }
                try {
                    $core['loop listeners'] = \array_map('get_class', Sudo::fetchProperty($shell, 'loopListeners'));
                } catch (\ReflectionException $e) {
                }
                $core['commands'] = \array_map('get_class', $shell->all());
                try {
                    $autocomplete['custom matchers'] = \array_map('get_class', Sudo::fetchProperty($shell, 'matchers'));
                } catch (\ReflectionException $e) {
                }
            }
        } catch (\ReflectionException $e) {
        }
        return \array_merge($shellInfo, $core, \compact('updates', 'pcntl', 'input', 'readline', 'output', 'history', 'docs', 'autocomplete'));
    }
}
if (!\function_exists('Cvphar\\Psy\\bin')) {
    function bin() : \Closure
    {
        return function () {
            if (!isset($_SERVER['PSYSH_IGNORE_ENV']) || !$_SERVER['PSYSH_IGNORE_ENV']) {
                if (\defined('HHVM_VERSION_ID')) {
                    \fwrite(\STDERR, 'PsySH v0.11 and higher does not support HHVM. Install an older version, or set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.' . \PHP_EOL);
                    exit(1);
                }
                if (\PHP_VERSION_ID < 70000) {
                    \fwrite(\STDERR, 'PHP 7.0.0 or higher is required. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.' . \PHP_EOL);
                    exit(1);
                }
                if (\PHP_VERSION_ID > 89999) {
                    \fwrite(\STDERR, 'PHP 9 or higher is not supported. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.' . \PHP_EOL);
                    exit(1);
                }
                if (!\function_exists('json_encode')) {
                    \fwrite(\STDERR, 'The JSON extension is required. Please install it. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.' . \PHP_EOL);
                    exit(1);
                }
                if (!\function_exists('token_get_all')) {
                    \fwrite(\STDERR, 'The Tokenizer extension is required. Please install it. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.' . \PHP_EOL);
                    exit(1);
                }
            }
            $usageException = null;
            $shellIsPhar = Shell::isPhar();
            $input = new ArgvInput();
            try {
                $input->bind(new InputDefinition(\array_merge(Configuration::getInputOptions(), [new InputOption('help', 'h', InputOption::VALUE_NONE), new InputOption('version', 'V', InputOption::VALUE_NONE), new InputOption('self-update', 'u', InputOption::VALUE_NONE), new InputArgument('include', InputArgument::IS_ARRAY)])));
            } catch (\RuntimeException $e) {
                $usageException = $e;
            }
            try {
                $config = Configuration::fromInput($input);
            } catch (\InvalidArgumentException $e) {
                $usageException = $e;
            }
            if ($usageException !== null || $input->getOption('help')) {
                if ($usageException !== null) {
                    echo $usageException->getMessage() . \PHP_EOL . \PHP_EOL;
                }
                $version = Shell::getVersionHeader(\false);
                $argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : [];
                $name = $argv ? \basename(\reset($argv)) : 'psysh';
                echo <<<EOL
{$version}

Usage:
  {$name} [--version] [--help] [files...]

Options:
  -h, --help            Display this help message.
  -c, --config FILE     Use an alternate PsySH config file location.
      --cwd PATH        Use an alternate working directory.
  -V, --version         Display the PsySH version.

EOL;
                if ($shellIsPhar) {
                    echo <<<EOL
  -u, --self-update     Install a newer version if available.

EOL;
                }
                echo <<<EOL
      --color           Force colors in output.
      --no-color        Disable colors in output.
  -i, --interactive     Force PsySH to run in interactive mode.
  -n, --no-interactive  Run PsySH without interactive input. Requires input from stdin.
  -r, --raw-output      Print var_export-style return values (for non-interactive input)
      --compact         Run PsySH with compact output.
  -q, --quiet           Shhhhhh.
  -v|vv|vvv, --verbose  Increase the verbosity of messages.
      --yolo            Run PsySH without input validation. You don't want this.

EOL;
                exit($usageException === null ? 0 : 1);
            }
            if ($input->getOption('version')) {
                echo Shell::getVersionHeader($config->useUnicode()) . \PHP_EOL;
                exit(0);
            }
            if ($input->getOption('self-update')) {
                if (!$shellIsPhar) {
                    \fwrite(\STDERR, 'The --self-update option can only be used with with a phar based install.' . \PHP_EOL);
                    exit(1);
                }
                $selfUpdate = new SelfUpdate(new GitHubChecker(), new Installer());
                $result = $selfUpdate->run($input, $config->getOutput());
                exit($result);
            }
            $shell = new Shell($config);
            $shell->setIncludes($input->getArgument('include'));
            try {
                $shell->run();
            } catch (\Throwable $e) {
                \fwrite(\STDERR, $e->getMessage() . \PHP_EOL);
            }
        };
    }
}
<?php

namespace Cvphar\Psy;

class ExecutionClosure
{
    const NOOP_INPUT = 'return null;';
    private $closure;
    public function __construct(Shell $__psysh__)
    {
        $this->setClosure($__psysh__, function () use($__psysh__) {
            try {
                \extract($__psysh__->getScopeVariables(\false));
                \ob_start([$__psysh__, 'writeStdout'], 1);
                \set_error_handler([$__psysh__, 'handleError']);
                $_ = eval($__psysh__->onExecute($__psysh__->flushCode() ?: self::NOOP_INPUT));
            } catch (\Throwable $_e) {
                if (\ob_get_level() > 0) {
                    \ob_end_clean();
                }
                throw $_e;
            } finally {
                \restore_error_handler();
            }
            \ob_end_flush();
            $__psysh__->setScopeVariables(\get_defined_vars());
            return $_;
        });
    }
    protected function setClosure(Shell $shell, \Closure $closure)
    {
        $that = $shell->getBoundObject();
        if (\is_object($that)) {
            $this->closure = $closure->bindTo($that, \get_class($that));
        } else {
            $this->closure = $closure->bindTo(null, $shell->getBoundClass());
        }
    }
    public function execute()
    {
        $closure = $this->closure;
        return $closure();
    }
}
<?php

namespace Cvphar\Psy;

class ConfigPaths
{
    private $configDir;
    private $dataDir;
    private $runtimeDir;
    private $env;
    public function __construct(array $overrides = [], EnvInterface $env = null)
    {
        $this->overrideDirs($overrides);
        $this->env = $env ?: (\PHP_SAPI === 'cli-server' ? new SystemEnv() : new SuperglobalsEnv());
    }
    public function overrideDirs(array $overrides)
    {
        if (\array_key_exists('configDir', $overrides)) {
            $this->configDir = $overrides['configDir'] ?: null;
        }
        if (\array_key_exists('dataDir', $overrides)) {
            $this->dataDir = $overrides['dataDir'] ?: null;
        }
        if (\array_key_exists('runtimeDir', $overrides)) {
            $this->runtimeDir = $overrides['runtimeDir'] ?: null;
        }
    }
    public function homeDir()
    {
        if ($homeDir = $this->getEnv('HOME') ?: $this->windowsHomeDir()) {
            return \strtr($homeDir, '\\', '/');
        }
        return null;
    }
    private function windowsHomeDir()
    {
        if (\defined('PHP_WINDOWS_VERSION_MAJOR')) {
            $homeDrive = $this->getEnv('HOMEDRIVE');
            $homePath = $this->getEnv('HOMEPATH');
            if ($homeDrive && $homePath) {
                return $homeDrive . '/' . $homePath;
            }
        }
        return null;
    }
    private function homeConfigDir()
    {
        if ($homeConfigDir = $this->getEnv('XDG_CONFIG_HOME')) {
            return $homeConfigDir;
        }
        $homeDir = $this->homeDir();
        return $homeDir === '/' ? $homeDir . '.config' : $homeDir . '/.config';
    }
    public function configDirs() : array
    {
        if ($this->configDir !== null) {
            return [$this->configDir];
        }
        $configDirs = $this->getEnvArray('XDG_CONFIG_DIRS') ?: ['/etc/xdg'];
        return $this->allDirNames(\array_merge([$this->homeConfigDir()], $configDirs));
    }
    public static function getConfigDirs() : array
    {
        return (new self())->configDirs();
    }
    public static function getHomeConfigDirs() : array
    {
        return self::getConfigDirs();
    }
    public function currentConfigDir() : string
    {
        if ($this->configDir !== null) {
            return $this->configDir;
        }
        $configDirs = $this->allDirNames([$this->homeConfigDir()]);
        foreach ($configDirs as $configDir) {
            if (@\is_dir($configDir)) {
                return $configDir;
            }
        }
        return $configDirs[0];
    }
    public static function getCurrentConfigDir() : string
    {
        return (new self())->currentConfigDir();
    }
    public function configFiles(array $names) : array
    {
        return $this->allRealFiles($this->configDirs(), $names);
    }
    public static function getConfigFiles(array $names, $configDir = null) : array
    {
        return (new self(['configDir' => $configDir]))->configFiles($names);
    }
    public function dataDirs() : array
    {
        if ($this->dataDir !== null) {
            return [$this->dataDir];
        }
        $homeDataDir = $this->getEnv('XDG_DATA_HOME') ?: $this->homeDir() . '/.local/share';
        $dataDirs = $this->getEnvArray('XDG_DATA_DIRS') ?: ['/usr/local/share', '/usr/share'];
        return $this->allDirNames(\array_merge([$homeDataDir], $dataDirs));
    }
    public static function getDataDirs() : array
    {
        return (new self())->dataDirs();
    }
    public function dataFiles(array $names) : array
    {
        return $this->allRealFiles($this->dataDirs(), $names);
    }
    public static function getDataFiles(array $names, $dataDir = null) : array
    {
        return (new self(['dataDir' => $dataDir]))->dataFiles($names);
    }
    public function runtimeDir() : string
    {
        if ($this->runtimeDir !== null) {
            return $this->runtimeDir;
        }
        $runtimeDir = $this->getEnv('XDG_RUNTIME_DIR') ?: \sys_get_temp_dir();
        return \strtr($runtimeDir, '\\', '/') . '/psysh';
    }
    public static function getRuntimeDir() : string
    {
        return (new self())->runtimeDir();
    }
    public function pathDirs() : array
    {
        return $this->getEnvArray('PATH') ?: ['/usr/sbin', '/usr/bin', '/sbin', '/bin'];
    }
    public function which($command)
    {
        foreach ($this->pathDirs() as $path) {
            $fullpath = $path . \DIRECTORY_SEPARATOR . $command;
            if (@\is_file($fullpath) && @\is_executable($fullpath)) {
                return $fullpath;
            }
        }
        return null;
    }
    private function allDirNames(array $baseDirs) : array
    {
        $dirs = \array_map(function ($dir) {
            return \strtr($dir, '\\', '/') . '/psysh';
        }, $baseDirs);
        if ($home = $this->getEnv('HOME')) {
            $dirs[] = \strtr($home, '\\', '/') . '/.psysh';
        }
        if (\defined('PHP_WINDOWS_VERSION_MAJOR')) {
            if ($appData = $this->getEnv('APPDATA')) {
                \array_unshift($dirs, \strtr($appData, '\\', '/') . '/PsySH');
            }
            if ($windowsHomeDir = $this->windowsHomeDir()) {
                $dir = \strtr($windowsHomeDir, '\\', '/') . '/.psysh';
                if (!\in_array($dir, $dirs)) {
                    $dirs[] = $dir;
                }
            }
        }
        return $dirs;
    }
    private function allRealFiles(array $dirNames, array $fileNames) : array
    {
        $files = [];
        foreach ($dirNames as $dir) {
            foreach ($fileNames as $name) {
                $file = $dir . '/' . $name;
                if (@\is_file($file)) {
                    $files[] = $file;
                }
            }
        }
        return $files;
    }
    public static function ensureDir(string $dir) : bool
    {
        if (!\is_dir($dir)) {
            @\mkdir($dir, 0700, \true);
        }
        if (!\is_dir($dir) || !\is_writable($dir)) {
            \trigger_error(\sprintf('Writing to directory %s is not allowed.', $dir), \E_USER_NOTICE);
            return \false;
        }
        return \true;
    }
    public static function touchFileWithMkdir(string $file)
    {
        if (\file_exists($file)) {
            if (\is_writable($file)) {
                return $file;
            }
            \trigger_error(\sprintf('Writing to %s is not allowed.', $file), \E_USER_NOTICE);
            return \false;
        }
        if (!self::ensureDir(\dirname($file))) {
            return \false;
        }
        \touch($file);
        return $file;
    }
    private function getEnv($key)
    {
        return $this->env->get($key);
    }
    private function getEnvArray($key)
    {
        if ($value = $this->getEnv($key)) {
            return \explode(\PATH_SEPARATOR, $value);
        }
        return null;
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

class IntervalChecker extends GitHubChecker
{
    private $cacheFile;
    private $interval;
    public function __construct($cacheFile, $interval)
    {
        $this->cacheFile = $cacheFile;
        $this->interval = $interval;
    }
    public function fetchLatestRelease()
    {
        $cached = \json_decode(@\file_get_contents($this->cacheFile, \false));
        if ($cached && isset($cached->last_check) && isset($cached->release)) {
            $now = new \DateTime();
            $lastCheck = new \DateTime($cached->last_check);
            if ($lastCheck >= $now->sub($this->getDateInterval())) {
                return $cached->release;
            }
        }
        $release = parent::fetchLatestRelease();
        if ($release && isset($release->tag_name)) {
            $this->updateCache($release);
        }
        return $release;
    }
    private function getDateInterval() : \DateInterval
    {
        switch ($this->interval) {
            case Checker::DAILY:
                return new \DateInterval('P1D');
            case Checker::WEEKLY:
                return new \DateInterval('P1W');
            case Checker::MONTHLY:
                return new \DateInterval('P1M');
        }
        throw new \RuntimeException('Invalid interval configured');
    }
    private function updateCache($release)
    {
        $data = ['last_check' => \date(\DATE_ATOM), 'release' => $release];
        \file_put_contents($this->cacheFile, \json_encode($data));
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

use Cvphar\Psy\Shell;
class NoopChecker implements Checker
{
    public function isLatest() : bool
    {
        return \true;
    }
    public function getLatest() : string
    {
        return Shell::VERSION;
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

interface Checker
{
    const ALWAYS = 'always';
    const DAILY = 'daily';
    const WEEKLY = 'weekly';
    const MONTHLY = 'monthly';
    const NEVER = 'never';
    public function isLatest() : bool;
    public function getLatest() : string;
}
<?php

namespace Cvphar\Psy\VersionUpdater\Downloader;

use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\VersionUpdater\Downloader;
class Factory
{
    public static function getDownloader() : Downloader
    {
        if (\extension_loaded('curl')) {
            return new CurlDownloader();
        } elseif (\ini_get('allow_url_fopen')) {
            return new FileDownloader();
        }
        throw new ErrorException('No downloader available.');
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater\Downloader;

use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Shell;
use Cvphar\Psy\VersionUpdater\Downloader;
class CurlDownloader implements Downloader
{
    private $tempDir = null;
    private $outputFile = null;
    public function setTempDir(string $tempDir)
    {
        $this->tempDir = $tempDir;
    }
    public function download(string $url) : bool
    {
        $tempDir = $this->tempDir ?: \sys_get_temp_dir();
        $this->outputFile = \tempnam($tempDir, 'psysh-archive-');
        $targetName = $this->outputFile . '.tar.gz';
        if (!\rename($this->outputFile, $targetName)) {
            return \false;
        }
        $this->outputFile = $targetName;
        $outputHandle = \fopen($this->outputFile, 'w');
        if (!$outputHandle) {
            return \false;
        }
        $curl = \curl_init();
        \curl_setopt_array($curl, [\CURLOPT_FAILONERROR => \true, \CURLOPT_HEADER => 0, \CURLOPT_FOLLOWLOCATION => \true, \CURLOPT_TIMEOUT => 10, \CURLOPT_FILE => $outputHandle, \CURLOPT_HTTPHEADER => ['User-Agent' => 'PsySH/' . Shell::VERSION]]);
        \curl_setopt($curl, \CURLOPT_URL, $url);
        $result = \curl_exec($curl);
        $error = \curl_error($curl);
        \curl_close($curl);
        \fclose($outputHandle);
        if (!$result) {
            throw new ErrorException('cURL Error: ' . $error);
        }
        return (bool) $result;
    }
    public function getFilename() : string
    {
        return $this->outputFile;
    }
    public function cleanup()
    {
        if (\file_exists($this->outputFile)) {
            \unlink($this->outputFile);
        }
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater\Downloader;

use Cvphar\Psy\VersionUpdater\Downloader;
class FileDownloader implements Downloader
{
    private $tempDir = null;
    private $outputFile = null;
    public function setTempDir(string $tempDir)
    {
        $this->tempDir = $tempDir;
    }
    public function download(string $url) : bool
    {
        $tempDir = $this->tempDir ?: \sys_get_temp_dir();
        $this->outputFile = \tempnam($tempDir, 'psysh-archive-');
        $targetName = $this->outputFile . '.tar.gz';
        if (!\rename($this->outputFile, $targetName)) {
            return \false;
        }
        $this->outputFile = $targetName;
        return (bool) \file_put_contents($this->outputFile, \file_get_contents($url));
    }
    public function getFilename() : string
    {
        return $this->outputFile;
    }
    public function cleanup()
    {
        if (\file_exists($this->outputFile)) {
            \unlink($this->outputFile);
        }
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

use Cvphar\Psy\Shell;
class GitHubChecker implements Checker
{
    const URL = 'https://api.github.com/repos/bobthecow/psysh/releases/latest';
    private $latest;
    public function isLatest() : bool
    {
        $version = \preg_replace('/[+-]\\w+/', '', Shell::VERSION);
        return \version_compare($version, $this->getLatest(), '>=');
    }
    public function getLatest() : string
    {
        if (!isset($this->latest)) {
            $this->setLatest($this->getVersionFromTag());
        }
        return $this->latest;
    }
    public function setLatest(string $version)
    {
        $this->latest = $version;
    }
    private function getVersionFromTag()
    {
        $contents = $this->fetchLatestRelease();
        if (!$contents || !isset($contents->tag_name)) {
            throw new \InvalidArgumentException('Unable to check for updates');
        }
        $this->setLatest($contents->tag_name);
        return $this->getLatest();
    }
    public function fetchLatestRelease()
    {
        $context = \stream_context_create(['http' => ['user_agent' => 'PsySH/' . Shell::VERSION, 'timeout' => 1.0]]);
        \set_error_handler(function () {
        });
        $result = @\file_get_contents(self::URL, \false, $context);
        \restore_error_handler();
        return \json_decode($result);
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

use Cvphar\Psy\Exception\ErrorException;
interface Downloader
{
    public function setTempDir(string $tempDir);
    public function download(string $url) : bool;
    public function getFilename() : string;
    public function cleanup();
}
<?php

namespace Cvphar\Psy\VersionUpdater;

use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Shell;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SelfUpdate
{
    const URL_PREFIX = 'https://github.com/bobthecow/psysh/releases/download';
    const SUCCESS = 0;
    const FAILURE = 1;
    private $checker;
    private $installer;
    private $downloader;
    public function __construct(Checker $checker, Installer $installer)
    {
        $this->checker = $checker;
        $this->installer = $installer;
    }
    public function setDownloader(Downloader $downloader)
    {
        $this->downloader = $downloader;
    }
    private function getDownloader() : Downloader
    {
        if (!isset($this->downloader)) {
            return Downloader\Factory::getDownloader();
        }
        return $this->downloader;
    }
    private function getAssetUrl(string $latestVersion) : string
    {
        $versionPostfix = '';
        if (\strpos(Shell::VERSION, '+')) {
            $versionPostfix = '-' . \substr(Shell::VERSION, \strpos(Shell::VERSION, '+') + 1);
        }
        $downloadFilename = \sprintf('psysh-%s%s.tar.gz', $latestVersion, $versionPostfix);
        return \sprintf('%s/%s/%s', self::URL_PREFIX, $latestVersion, $downloadFilename);
    }
    public function run(InputInterface $input, OutputInterface $output) : int
    {
        $currentVersion = Shell::VERSION;
        if ($this->checker->isLatest()) {
            $output->writeln('<info>Current version is up-to-date.</info>');
            return self::SUCCESS;
        }
        if (!$this->installer->isInstallLocationWritable()) {
            $output->writeln('<error>Installed version is not writable.</error>');
            return self::FAILURE;
        }
        if (!$this->installer->isTempDirectoryWritable()) {
            $output->writeln('<error>Temporary directory is not writable.</error>');
            return self::FAILURE;
        }
        $latestVersion = $this->checker->getLatest();
        $downloadUrl = $this->getAssetUrl($latestVersion);
        $output->write("Downloading PsySH {$latestVersion} ...");
        try {
            $downloader = $this->getDownloader();
            $downloader->setTempDir($this->installer->getTempDirectory());
            $downloaded = $downloader->download($downloadUrl);
        } catch (ErrorException $e) {
            $output->write(' <error>Failed.</error>');
            $output->writeln(\sprintf('<error>%s</error>', $e->getMessage()));
            return self::FAILURE;
        }
        if (!$downloaded) {
            $output->writeln('<error>Download failed.</error>');
            $downloader->cleanup();
            return self::FAILURE;
        } else {
            $output->write(' <info>OK</info>' . \PHP_EOL);
        }
        $downloadedFile = $downloader->getFilename();
        if (!$this->installer->isValidSource($downloadedFile)) {
            $downloader->cleanup();
            $output->writeln('<error>Downloaded file is not a valid archive.</error>');
            return self::FAILURE;
        }
        $backupCreated = $this->installer->createBackup($currentVersion);
        if (!$backupCreated) {
            $downloader->cleanup();
            $output->writeln('<error>Failed to create a backup of the current version.</error>');
            return self::FAILURE;
        } elseif ($input->getOption('verbose')) {
            $backupFilename = $this->installer->getBackupFilename($currentVersion);
            $output->writeln('Created backup of current version: ' . $backupFilename);
        }
        if (!$this->installer->install($downloadedFile)) {
            $this->installer->restoreFromBackup($currentVersion);
            $downloader->cleanup();
            $output->writeln("<error>Failed to install new PsySH version {$latestVersion}.</error>");
            return self::FAILURE;
        }
        $downloader->cleanup();
        $output->writeln("Updated PsySH from {$currentVersion} to <info>{$latestVersion}</info>");
        return self::SUCCESS;
    }
}
<?php

namespace Cvphar\Psy\VersionUpdater;

use Cvphar\Psy\Exception\ErrorException;
class Installer
{
    protected $installLocation;
    protected $tempDirectory;
    public function __construct(string $tempDirectory = null)
    {
        $this->tempDirectory = $tempDirectory ?: \sys_get_temp_dir();
        $this->installLocation = \Phar::running(\false);
    }
    public function getTempDirectory() : string
    {
        return $this->tempDirectory;
    }
    public function isInstallLocationWritable() : bool
    {
        return \is_writable($this->installLocation);
    }
    public function isTempDirectoryWritable() : bool
    {
        return \is_writable($this->tempDirectory);
    }
    public function isValidSource(string $sourceArchive) : bool
    {
        if (!\class_exists('\\PharData')) {
            return \false;
        }
        $pharArchive = new \PharData($sourceArchive);
        return $pharArchive->valid();
    }
    public function install(string $sourceArchive) : bool
    {
        $pharArchive = new \PharData($sourceArchive);
        $outputDirectory = \tempnam($this->tempDirectory, 'psysh-');
        if (!\unlink($outputDirectory) || !\mkdir($outputDirectory, 0700)) {
            return \false;
        }
        $pharArchive->extractTo($outputDirectory, ['psysh'], \true);
        $renamed = \rename($outputDirectory . '/psysh', $this->installLocation);
        \rmdir($outputDirectory);
        return $renamed;
    }
    public function createBackup(string $version) : bool
    {
        $backupFilename = $this->getBackupFilename($version);
        if (\file_exists($backupFilename) && !\is_writable($backupFilename)) {
            return \false;
        }
        return \rename($this->installLocation, $backupFilename);
    }
    public function restoreFromBackup(string $version) : bool
    {
        $backupFilename = $this->getBackupFilename($version);
        if (!\file_exists($backupFilename)) {
            throw new ErrorException("Cannot restore from backup. File not found! [{$backupFilename}]");
        }
        return \rename($backupFilename, $this->installLocation);
    }
    public function getBackupFilename(string $version) : string
    {
        $installFilename = \basename($this->installLocation);
        return \sprintf('%s/%s.%s', $this->tempDirectory, $installFilename, $version);
    }
}
<?php

namespace Cvphar\Psy\TabCompletion;

use Cvphar\Psy\TabCompletion\Matcher\AbstractMatcher;
class AutoCompleter
{
    protected $matchers;
    public function addMatcher(AbstractMatcher $matcher)
    {
        $this->matchers[] = $matcher;
    }
    public function activate()
    {
        \readline_completion_function([&$this, 'callback']);
    }
    public function processCallback(string $input, int $index, array $info = []) : array
    {
        $line = $info['line_buffer'];
        if (isset($info['end'])) {
            $line = \substr($line, 0, $info['end']);
        }
        if ($line === '' && $input !== '') {
            $line = $input;
        }
        $tokens = \token_get_all('<?php ' . $line);
        $tokens = \array_filter($tokens, function ($token) {
            return !AbstractMatcher::tokenIs($token, AbstractMatcher::T_WHITESPACE);
        });
        $tokens = \array_values($tokens);
        $matches = [];
        foreach ($this->matchers as $matcher) {
            if ($matcher->hasMatched($tokens)) {
                $matches = \array_merge($matcher->getMatches($tokens), $matches);
            }
        }
        $matches = \array_unique($matches);
        return !empty($matches) ? $matches : [''];
    }
    public function callback(string $input, int $index) : array
    {
        return $this->processCallback($input, $index, \readline_info());
    }
    public function __destruct()
    {
        if (\function_exists('readline_callback_handler_remove')) {
            \readline_callback_handler_remove();
        }
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

use InvalidArgumentException;
class ObjectAttributesMatcher extends AbstractContextAwareMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $objectToken = \array_pop($tokens);
        if (!\is_array($objectToken)) {
            return [];
        }
        $objectName = \str_replace('$', '', $objectToken[1]);
        try {
            $object = $this->getVariable($objectName);
        } catch (InvalidArgumentException $e) {
            return [];
        }
        if (!\is_object($object)) {
            return [];
        }
        return \array_filter(\array_keys(\get_class_vars(\get_class($object))), function ($var) use($input) {
            return AbstractMatcher::startsWith($input, $var);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($token, self::T_OBJECT_OPERATOR):
            case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class FunctionDefaultParametersMatcher extends AbstractDefaultParametersMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        \array_pop($tokens);
        $functionName = \array_pop($tokens);
        try {
            $reflection = new \ReflectionFunction($functionName[1]);
        } catch (\ReflectionException $e) {
            return [];
        }
        $parameters = $reflection->getParameters();
        return $this->getDefaultParameterCompletion($parameters);
    }
    public function hasMatched(array $tokens) : bool
    {
        $openBracket = \array_pop($tokens);
        if ($openBracket !== '(') {
            return \false;
        }
        $functionName = \array_pop($tokens);
        if (!self::tokenIs($functionName, self::T_STRING)) {
            return \false;
        }
        if (!\function_exists($functionName[1])) {
            return \false;
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
abstract class AbstractContextAwareMatcher extends AbstractMatcher implements ContextAware
{
    protected $context;
    public function setContext(Context $context)
    {
        $this->context = $context;
    }
    protected function getVariable(string $var)
    {
        return $this->context->get($var);
    }
    protected function getVariables() : array
    {
        return $this->context->getAll();
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class KeywordsMatcher extends AbstractMatcher
{
    protected $keywords = ['array', 'clone', 'declare', 'die', 'echo', 'empty', 'eval', 'exit', 'include', 'include_once', 'isset', 'list', 'print', 'require', 'require_once', 'unset'];
    protected $mandatoryStartKeywords = ['die', 'echo', 'print', 'unset'];
    public function getKeywords() : array
    {
        return $this->keywords;
    }
    public function isKeyword(string $keyword) : bool
    {
        return \in_array($keyword, $this->keywords);
    }
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        return \array_filter($this->keywords, function ($keyword) use($input) {
            return AbstractMatcher::startsWith($input, $keyword);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $token):
            case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $prevToken) && self::tokenIs($token, self::T_STRING):
            case self::isOperator($token):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ClassAttributesMatcher extends AbstractMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $class = $this->getNamespaceAndClass($tokens);
        try {
            $reflection = new \ReflectionClass($class);
        } catch (\ReflectionException $re) {
            return [];
        }
        $vars = \array_merge(\array_map(function ($var) {
            return '$' . $var;
        }, \array_keys($reflection->getStaticProperties())), \array_keys($reflection->getConstants()));
        return \array_map(function ($name) use($class) {
            $chunks = \explode('\\', $class);
            $className = \array_pop($chunks);
            return $className . '::' . $name;
        }, \array_filter($vars, function ($var) use($input) {
            return AbstractMatcher::startsWith($input, $var);
        }));
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($prevToken, self::T_DOUBLE_COLON) && self::tokenIs($token, self::T_STRING):
            case self::tokenIs($token, self::T_DOUBLE_COLON):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ClassNamesMatcher extends AbstractMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $class = $this->getNamespaceAndClass($tokens);
        if ($class !== '' && $class[0] === '\\') {
            $class = \substr($class, 1, \strlen($class));
        }
        $quotedClass = \preg_quote($class);
        return \array_map(function ($className) use($class) {
            $nsPos = \substr_count($class, '\\');
            $pieces = \explode('\\', $className);
            return \implode('\\', \array_slice($pieces, $nsPos, \count($pieces)));
        }, \array_filter(\array_merge(\get_declared_classes(), \get_declared_interfaces()), function ($className) use($quotedClass) {
            return AbstractMatcher::startsWith($quotedClass, $className);
        }));
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        $ignoredTokens = [self::T_INCLUDE, self::T_INCLUDE_ONCE, self::T_REQUIRE, self::T_REQUIRE_ONCE];
        switch (\true) {
            case self::hasToken([$ignoredTokens], $token):
            case self::hasToken([$ignoredTokens], $prevToken):
            case \is_string($token) && $token === '$':
                return \false;
            case self::hasToken([self::T_NEW, self::T_OPEN_TAG, self::T_NS_SEPARATOR, self::T_STRING], $prevToken):
            case self::hasToken([self::T_NEW, self::T_OPEN_TAG, self::T_NS_SEPARATOR], $token):
            case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $token):
            case self::isOperator($token):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ConstantsMatcher extends AbstractMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $const = $this->getInput($tokens);
        return \array_filter(\array_keys(\get_defined_constants()), function ($constant) use($const) {
            return AbstractMatcher::startsWith($const, $constant);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($prevToken, self::T_NEW):
            case self::tokenIs($prevToken, self::T_NS_SEPARATOR):
                return \false;
            case self::hasToken([self::T_OPEN_TAG, self::T_STRING], $token):
            case self::isOperator($token):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ClassMethodsMatcher extends AbstractMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $class = $this->getNamespaceAndClass($tokens);
        try {
            $reflection = new \ReflectionClass($class);
        } catch (\ReflectionException $re) {
            return [];
        }
        if (self::needCompleteClass($tokens[1])) {
            $methods = $reflection->getMethods();
        } else {
            $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC);
        }
        $methods = \array_map(function (\ReflectionMethod $method) {
            return $method->getName();
        }, $methods);
        return \array_map(function ($name) use($class) {
            $chunks = \explode('\\', $class);
            $className = \array_pop($chunks);
            return $className . '::' . $name;
        }, \array_filter($methods, function ($method) use($input) {
            return AbstractMatcher::startsWith($input, $method);
        }));
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($prevToken, self::T_DOUBLE_COLON) && self::tokenIs($token, self::T_STRING):
            case self::tokenIs($token, self::T_DOUBLE_COLON):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

abstract class AbstractDefaultParametersMatcher extends AbstractContextAwareMatcher
{
    public function getDefaultParameterCompletion(array $reflectionParameters) : array
    {
        $parametersProcessed = [];
        foreach ($reflectionParameters as $parameter) {
            if (!$parameter->isDefaultValueAvailable()) {
                return [];
            }
            $defaultValue = $this->valueToShortString($parameter->getDefaultValue());
            $parametersProcessed[] = \sprintf('$%s = %s', $parameter->getName(), $defaultValue);
        }
        if (empty($parametersProcessed)) {
            return [];
        }
        return [\implode(', ', $parametersProcessed) . ')'];
    }
    private function valueToShortString($value) : string
    {
        if (!\is_array($value)) {
            return \json_encode($value);
        }
        $chunks = [];
        $chunksSequential = [];
        $allSequential = \true;
        foreach ($value as $key => $item) {
            $allSequential = $allSequential && \is_numeric($key) && $key === \count($chunksSequential);
            $keyString = $this->valueToShortString($key);
            $itemString = $this->valueToShortString($item);
            $chunks[] = "{$keyString} => {$itemString}";
            $chunksSequential[] = $itemString;
        }
        $chunksToImplode = $allSequential ? $chunksSequential : $chunks;
        return '[' . \implode(', ', $chunksToImplode) . ']';
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class MongoDatabaseMatcher extends AbstractContextAwareMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $objectToken = \array_pop($tokens);
        $objectName = \str_replace('$', '', $objectToken[1]);
        $object = $this->getVariable($objectName);
        if (!$object instanceof \MongoDB) {
            return [];
        }
        return \array_filter($object->getCollectionNames(), function ($var) use($input) {
            return AbstractMatcher::startsWith($input, $var);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($token, self::T_OBJECT_OPERATOR):
            case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class FunctionsMatcher extends AbstractMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $func = $this->getInput($tokens);
        $functions = \get_defined_functions();
        $allFunctions = \array_merge($functions['user'], $functions['internal']);
        return \array_filter($allFunctions, function ($function) use($func) {
            return AbstractMatcher::startsWith($func, $function);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($prevToken, self::T_NEW):
                return \false;
            case self::hasToken([self::T_OPEN_TAG, self::T_STRING], $token):
            case self::isOperator($token):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class MongoClientMatcher extends AbstractContextAwareMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $objectToken = \array_pop($tokens);
        $objectName = \str_replace('$', '', $objectToken[1]);
        $object = $this->getVariable($objectName);
        if (!$object instanceof \MongoClient) {
            return [];
        }
        $list = $object->listDBs();
        return \array_filter(\array_map(function ($info) {
            return $info['name'];
        }, $list['databases']), function ($var) use($input) {
            return AbstractMatcher::startsWith($input, $var);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($token, self::T_OBJECT_OPERATOR):
            case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

use InvalidArgumentException;
class ObjectMethodsMatcher extends AbstractContextAwareMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            \array_pop($tokens);
        }
        $objectToken = \array_pop($tokens);
        if (!\is_array($objectToken)) {
            return [];
        }
        $objectName = \str_replace('$', '', $objectToken[1]);
        try {
            $object = $this->getVariable($objectName);
        } catch (InvalidArgumentException $e) {
            return [];
        }
        if (!\is_object($object)) {
            return [];
        }
        return \array_filter(\get_class_methods($object), function ($var) use($input) {
            return AbstractMatcher::startsWith($input, $var) && !AbstractMatcher::startsWith('__', $var);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        $prevToken = \array_pop($tokens);
        switch (\true) {
            case self::tokenIs($token, self::T_OBJECT_OPERATOR):
            case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

use Cvphar\Psy\Command\Command;
class CommandsMatcher extends AbstractMatcher
{
    protected $commands = [];
    public function __construct(array $commands)
    {
        $this->setCommands($commands);
    }
    public function setCommands(array $commands)
    {
        $names = [];
        foreach ($commands as $command) {
            $names = \array_merge([$command->getName()], $names);
            $names = \array_merge($command->getAliases(), $names);
        }
        $this->commands = $names;
    }
    protected function isCommand(string $name) : bool
    {
        return \in_array($name, $this->commands);
    }
    protected function matchCommand(string $name) : bool
    {
        foreach ($this->commands as $cmd) {
            if ($this->startsWith($name, $cmd)) {
                return \true;
            }
        }
        return \false;
    }
    public function getMatches(array $tokens, array $info = []) : array
    {
        $input = $this->getInput($tokens);
        return \array_filter($this->commands, function ($command) use($input) {
            return AbstractMatcher::startsWith($input, $command);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        \array_shift($tokens);
        $command = \array_shift($tokens);
        switch (\true) {
            case self::tokenIs($command, self::T_STRING) && !$this->isCommand($command[1]) && $this->matchCommand($command[1]) && empty($tokens):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class VariablesMatcher extends AbstractContextAwareMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $var = \str_replace('$', '', $this->getInput($tokens));
        return \array_filter(\array_keys($this->getVariables()), function ($variable) use($var) {
            return AbstractMatcher::startsWith($var, $variable);
        });
    }
    public function hasMatched(array $tokens) : bool
    {
        $token = \array_pop($tokens);
        switch (\true) {
            case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $token):
            case \is_string($token) && $token === '$':
            case self::isOperator($token):
                return \true;
        }
        return \false;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ObjectMethodDefaultParametersMatcher extends AbstractDefaultParametersMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $openBracket = \array_pop($tokens);
        $functionName = \array_pop($tokens);
        $methodOperator = \array_pop($tokens);
        $objectToken = \array_pop($tokens);
        if (!\is_array($objectToken)) {
            return [];
        }
        $objectName = \str_replace('$', '', $objectToken[1]);
        try {
            $object = $this->getVariable($objectName);
            $reflection = new \ReflectionObject($object);
        } catch (\InvalidArgumentException $e) {
            return [];
        } catch (\ReflectionException $e) {
            return [];
        }
        $methods = $reflection->getMethods();
        foreach ($methods as $method) {
            if ($method->getName() === $functionName[1]) {
                return $this->getDefaultParameterCompletion($method->getParameters());
            }
        }
        return [];
    }
    public function hasMatched(array $tokens) : bool
    {
        $openBracket = \array_pop($tokens);
        if ($openBracket !== '(') {
            return \false;
        }
        $functionName = \array_pop($tokens);
        if (!self::tokenIs($functionName, self::T_STRING)) {
            return \false;
        }
        $operator = \array_pop($tokens);
        if (!self::tokenIs($operator, self::T_OBJECT_OPERATOR)) {
            return \false;
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

abstract class AbstractMatcher
{
    const CONSTANT_SYNTAX = '^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$';
    const VAR_SYNTAX = '^\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$';
    const MISC_OPERATORS = '+-*/^|&';
    const T_OPEN_TAG = 'T_OPEN_TAG';
    const T_VARIABLE = 'T_VARIABLE';
    const T_OBJECT_OPERATOR = 'T_OBJECT_OPERATOR';
    const T_DOUBLE_COLON = 'T_DOUBLE_COLON';
    const T_NEW = 'T_NEW';
    const T_CLONE = 'T_CLONE';
    const T_NS_SEPARATOR = 'T_NS_SEPARATOR';
    const T_STRING = 'T_STRING';
    const T_NAME_QUALIFIED = 'T_NAME_QUALIFIED';
    const T_WHITESPACE = 'T_WHITESPACE';
    const T_AND_EQUAL = 'T_AND_EQUAL';
    const T_BOOLEAN_AND = 'T_BOOLEAN_AND';
    const T_BOOLEAN_OR = 'T_BOOLEAN_OR';
    const T_ENCAPSED_AND_WHITESPACE = 'T_ENCAPSED_AND_WHITESPACE';
    const T_REQUIRE = 'T_REQUIRE';
    const T_REQUIRE_ONCE = 'T_REQUIRE_ONCE';
    const T_INCLUDE = 'T_INCLUDE';
    const T_INCLUDE_ONCE = 'T_INCLUDE_ONCE';
    public function hasMatched(array $tokens) : bool
    {
        return \false;
    }
    protected function getInput(array $tokens) : string
    {
        $var = '';
        $firstToken = \array_pop($tokens);
        if (self::tokenIs($firstToken, self::T_STRING)) {
            $var = $firstToken[1];
        }
        return $var;
    }
    protected function getNamespaceAndClass(array $tokens) : string
    {
        $class = '';
        while (self::hasToken([self::T_NS_SEPARATOR, self::T_STRING, self::T_NAME_QUALIFIED], $token = \array_pop($tokens))) {
            if (self::needCompleteClass($token)) {
                continue;
            }
            $class = $token[1] . $class;
        }
        return $class;
    }
    public abstract function getMatches(array $tokens, array $info = []) : array;
    public static function startsWith(string $prefix, string $word) : bool
    {
        return \preg_match(\sprintf('#^%s#', $prefix), $word);
    }
    public static function hasSyntax($token, string $syntax = self::VAR_SYNTAX) : bool
    {
        if (!\is_array($token)) {
            return \false;
        }
        $regexp = \sprintf('#%s#', $syntax);
        return (bool) \preg_match($regexp, $token[1]);
    }
    public static function tokenIs($token, string $which) : bool
    {
        if (!\is_array($token)) {
            return \false;
        }
        return \token_name($token[0]) === $which;
    }
    public static function isOperator($token) : bool
    {
        if (!\is_string($token)) {
            return \false;
        }
        return \strpos(self::MISC_OPERATORS, $token) !== \false;
    }
    public static function needCompleteClass($token) : bool
    {
        return \in_array($token[1], ['doc', 'ls', 'show']);
    }
    public static function hasToken(array $coll, $token) : bool
    {
        if (!\is_array($token)) {
            return \false;
        }
        return \in_array(\token_name($token[0]), $coll);
    }
}
<?php

namespace Cvphar\Psy\TabCompletion\Matcher;

class ClassMethodDefaultParametersMatcher extends AbstractDefaultParametersMatcher
{
    public function getMatches(array $tokens, array $info = []) : array
    {
        $openBracket = \array_pop($tokens);
        $functionName = \array_pop($tokens);
        $methodOperator = \array_pop($tokens);
        $class = $this->getNamespaceAndClass($tokens);
        try {
            $reflection = new \ReflectionClass($class);
        } catch (\ReflectionException $e) {
            return [];
        }
        $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC);
        foreach ($methods as $method) {
            if ($method->getName() === $functionName[1]) {
                return $this->getDefaultParameterCompletion($method->getParameters());
            }
        }
        return [];
    }
    public function hasMatched(array $tokens) : bool
    {
        $openBracket = \array_pop($tokens);
        if ($openBracket !== '(') {
            return \false;
        }
        $functionName = \array_pop($tokens);
        if (!self::tokenIs($functionName, self::T_STRING)) {
            return \false;
        }
        $operator = \array_pop($tokens);
        if (!self::tokenIs($operator, self::T_DOUBLE_COLON)) {
            return \false;
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy;

use Cvphar\Psy\Exception\BreakException;
use Cvphar\Psy\Exception\ThrowUpException;
class ExecutionLoopClosure extends ExecutionClosure
{
    public function __construct(Shell $__psysh__)
    {
        $this->setClosure($__psysh__, function () use($__psysh__) {
            \extract($__psysh__->getScopeVariables(\false));
            while (\true) {
                $__psysh__->beforeLoop();
                try {
                    $__psysh__->getInput();
                    try {
                        if ($__psysh__->getLastExecSuccess()) {
                            \extract($__psysh__->getScopeVariablesDiff(\get_defined_vars()));
                        }
                        \ob_start([$__psysh__, 'writeStdout'], 1);
                        \set_error_handler([$__psysh__, 'handleError']);
                        $_ = eval($__psysh__->onExecute($__psysh__->flushCode() ?: ExecutionClosure::NOOP_INPUT));
                    } catch (\Throwable $_e) {
                        if (\ob_get_level() > 0) {
                            \ob_end_clean();
                        }
                        throw $_e;
                    } finally {
                        \restore_error_handler();
                    }
                    \ob_end_flush();
                    $__psysh__->setScopeVariables(\get_defined_vars());
                    $__psysh__->writeReturnValue($_);
                } catch (BreakException $_e) {
                    $__psysh__->writeException($_e);
                    return;
                } catch (ThrowUpException $_e) {
                    $__psysh__->writeException($_e);
                    throw $_e;
                } catch (\Throwable $_e) {
                    $__psysh__->writeException($_e);
                }
                $__psysh__->afterLoop();
            }
        });
    }
}
<?php

namespace Cvphar\Psy\Util;

class Json
{
    public static function encode($val, int $opt = 0) : string
    {
        $opt |= \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE;
        return \json_encode($val, $opt);
    }
}
<?php

namespace Cvphar\Psy\Util;

class Str
{
    const UNVIS_RX = <<<'EOS'
/
    \\(?:
        ((?:040)|s)
        | (240)
        | (?: M-(.) )
        | (?: M\^(.) )
        | (?: \^(.) )
    )
/xS
EOS;
    public static function unvis(string $input) : string
    {
        $output = \preg_replace_callback(self::UNVIS_RX, [self::class, 'unvisReplace'], $input);
        return \stripcslashes($output);
    }
    protected static function unvisReplace(array $match) : string
    {
        if (!empty($match[1])) {
            return " ";
        }
        if (!empty($match[2])) {
            return "\xa0";
        }
        if (isset($match[3]) && $match[3] !== '') {
            $chr = $match[3];
            $cp = 0200;
            $cp |= \ord($chr);
            return \chr($cp);
        }
        if (isset($match[4]) && $match[4] !== '') {
            $chr = $match[4];
            $cp = 0200;
            $cp |= $chr === '?' ? 0177 : \ord($chr) & 037;
            return \chr($cp);
        }
        if (isset($match[5]) && $match[5] !== '') {
            $chr = $match[5];
            $cp = 0;
            $cp |= $chr === '?' ? 0177 : \ord($chr) & 037;
            return \chr($cp);
        }
    }
}
<?php

namespace Cvphar\Psy\Util;

use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Reflection\ReflectionClassConstant;
use Cvphar\Psy\Reflection\ReflectionConstant_;
use Cvphar\Psy\Reflection\ReflectionNamespace;
class Mirror
{
    const CONSTANT = 1;
    const METHOD = 2;
    const STATIC_PROPERTY = 4;
    const PROPERTY = 8;
    public static function get($value, string $member = null, int $filter = 15) : \Reflector
    {
        if ($member === null && \is_string($value)) {
            if (\function_exists($value)) {
                return new \ReflectionFunction($value);
            } elseif (\defined($value) || ReflectionConstant_::isMagicConstant($value)) {
                return new ReflectionConstant_($value);
            }
        }
        $class = self::getClass($value);
        if ($member === null) {
            return $class;
        } elseif ($filter & self::CONSTANT && $class->hasConstant($member)) {
            return ReflectionClassConstant::create($value, $member);
        } elseif ($filter & self::METHOD && $class->hasMethod($member)) {
            return $class->getMethod($member);
        } elseif ($filter & self::PROPERTY && $class->hasProperty($member)) {
            return $class->getProperty($member);
        } elseif ($filter & self::STATIC_PROPERTY && $class->hasProperty($member) && $class->getProperty($member)->isStatic()) {
            return $class->getProperty($member);
        } else {
            throw new RuntimeException(\sprintf('Unknown member %s on class %s', $member, \is_object($value) ? \get_class($value) : $value));
        }
    }
    private static function getClass($value)
    {
        if (\is_object($value)) {
            return new \ReflectionObject($value);
        }
        if (!\is_string($value)) {
            throw new \InvalidArgumentException('Mirror expects an object or class');
        }
        if (\class_exists($value) || \interface_exists($value) || \trait_exists($value)) {
            return new \ReflectionClass($value);
        }
        $namespace = \preg_replace('/(^\\\\|\\\\$)/', '', $value);
        if (self::namespaceExists($namespace)) {
            return new ReflectionNamespace($namespace);
        }
        throw new \InvalidArgumentException('Unknown namespace, class or function: ' . $value);
    }
    private static function namespaceExists(string $value) : bool
    {
        return \in_array(\strtolower($value), self::getDeclaredNamespaces());
    }
    private static function getDeclaredNamespaces() : array
    {
        $functions = \get_defined_functions();
        $allNames = \array_merge($functions['internal'], $functions['user'], \get_declared_classes(), \get_declared_interfaces(), \get_declared_traits(), \array_keys(\get_defined_constants()));
        $namespaces = [];
        foreach ($allNames as $name) {
            $chunks = \explode('\\', \strtolower($name));
            \array_pop($chunks);
            while (!empty($chunks)) {
                $namespaces[\implode('\\', $chunks)] = \true;
                \array_pop($chunks);
            }
        }
        $namespaceNames = \array_keys($namespaces);
        \sort($namespaceNames);
        return $namespaceNames;
    }
}
<?php

namespace Cvphar\Psy\Util;

class Docblock
{
    public static $vectors = ['throws' => ['type', 'desc'], 'param' => ['type', 'var', 'desc'], 'return' => ['type', 'desc']];
    protected $reflector;
    public $desc;
    public $tags;
    public $comment;
    public function __construct(\Reflector $reflector)
    {
        $this->reflector = $reflector;
        if ($reflector instanceof \ReflectionClass || $reflector instanceof \ReflectionClassConstant || $reflector instanceof \ReflectionFunctionAbstract || $reflector instanceof \ReflectionProperty) {
            $this->setComment($reflector->getDocComment());
        }
    }
    protected function setComment(string $comment)
    {
        $this->desc = '';
        $this->tags = [];
        $this->comment = $comment;
        $this->parseComment($comment);
    }
    protected static function prefixLength(array $lines) : int
    {
        $lines = \array_filter($lines, function ($line) {
            return \substr($line, \strspn($line, "* \t\n\r\x00\v"));
        });
        \sort($lines);
        $first = \reset($lines);
        $last = \end($lines);
        if (\count($lines) === 1) {
            return \strspn($first, "* \t\n\r\x00\v");
        }
        $count = \min(\strlen($first), \strlen($last));
        for ($i = 0; $i < $count; $i++) {
            if ($first[$i] !== $last[$i]) {
                return $i;
            }
        }
        return $count;
    }
    protected function parseComment(string $comment)
    {
        $comment = \substr($comment, 3, -2);
        $comment = \array_filter(\preg_split('/\\r?\\n\\r?/', $comment));
        $prefixLength = self::prefixLength($comment);
        $comment = \array_map(function ($line) use($prefixLength) {
            return \rtrim(\substr($line, $prefixLength));
        }, $comment);
        $blocks = [];
        $b = -1;
        foreach ($comment as $line) {
            if (self::isTagged($line)) {
                $b++;
                $blocks[] = [];
            } elseif ($b === -1) {
                $b = 0;
                $blocks[] = [];
            }
            $blocks[$b][] = $line;
        }
        foreach ($blocks as $block => $body) {
            $body = \trim(\implode("\n", $body));
            if ($block === 0 && !self::isTagged($body)) {
                $this->desc = $body;
            } else {
                $tag = \substr(self::strTag($body), 1);
                $body = \ltrim(\substr($body, \strlen($tag) + 2));
                if (isset(self::$vectors[$tag])) {
                    $count = \count(self::$vectors[$tag]);
                    if ($body) {
                        $parts = \preg_split('/\\s+/', $body, $count);
                    } else {
                        $parts = [];
                    }
                    $parts = \array_pad($parts, $count, null);
                    $this->tags[$tag][] = \array_combine(self::$vectors[$tag], $parts);
                } else {
                    $this->tags[$tag][] = $body;
                }
            }
        }
    }
    public function hasTag(string $tag) : bool
    {
        return \is_array($this->tags) && \array_key_exists($tag, $this->tags);
    }
    public function tag(string $tag)
    {
        return $this->hasTag($tag) ? $this->tags[$tag] : null;
    }
    public static function isTagged(string $str) : bool
    {
        return isset($str[1]) && $str[0] === '@' && !\preg_match('/[^A-Za-z]/', $str[1]);
    }
    public static function strTag(string $str)
    {
        if (\preg_match('/^@[a-z0-9_]+/', $str, $matches)) {
            return $matches[0];
        }
    }
}
<?php

namespace Cvphar\Psy;

use Cvphar\Psy\CodeCleaner\NoReturnValue;
use Cvphar\Psy\Exception\BreakException;
use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Exception\Exception as PsyException;
use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Exception\ThrowUpException;
use Cvphar\Psy\ExecutionLoop\ProcessForker;
use Cvphar\Psy\ExecutionLoop\RunkitReloader;
use Cvphar\Psy\Formatter\TraceFormatter;
use Cvphar\Psy\Input\ShellInput;
use Cvphar\Psy\Input\SilentInput;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\TabCompletion\Matcher;
use Cvphar\Psy\VarDumper\PresenterAware;
use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command as BaseCommand;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Input\ArrayInput;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Input\StringInput;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Shell extends Application
{
    const VERSION = 'v0.11.18';
    const PROMPT = '>>> ';
    const BUFF_PROMPT = '... ';
    const REPLAY = '--> ';
    const RETVAL = '=> ';
    private $config;
    private $cleaner;
    private $output;
    private $originalVerbosity;
    private $readline;
    private $inputBuffer;
    private $code;
    private $codeBuffer;
    private $codeBufferOpen;
    private $codeStack;
    private $stdoutBuffer;
    private $context;
    private $includes;
    private $outputWantsNewline = \false;
    private $loopListeners;
    private $autoCompleter;
    private $matchers = [];
    private $commandsMatcher;
    private $lastExecSuccess = \true;
    private $nonInteractive = \false;
    private $errorReporting;
    public function __construct(Configuration $config = null)
    {
        $this->config = $config ?: new Configuration();
        $this->cleaner = $this->config->getCodeCleaner();
        $this->context = new Context();
        $this->includes = [];
        $this->readline = $this->config->getReadline();
        $this->inputBuffer = [];
        $this->codeStack = [];
        $this->stdoutBuffer = '';
        $this->loopListeners = $this->getDefaultLoopListeners();
        parent::__construct('Psy Shell', self::VERSION);
        $this->config->setShell($this);
        \Cvphar\Psy\info($this->config);
    }
    public static function isIncluded(array $trace) : bool
    {
        $isIncluded = isset($trace[0]['function']) && \in_array($trace[0]['function'], ['require', 'include', 'require_once', 'include_once']);
        if ($isIncluded && \array_key_exists('_composer_autoload_path', $GLOBALS) && \preg_match('{[\\\\/]psysh$}', $trace[0]['file'])) {
            return isset($trace[1]['function']) && \in_array($trace[1]['function'], ['require', 'include', 'require_once', 'include_once']);
        }
        return $isIncluded;
    }
    public static function isPhar() : bool
    {
        return \class_exists("\\Phar") && \Phar::running() !== '' && \strpos(__FILE__, \Phar::running(\true)) === 0;
    }
    public static function debug(array $vars = [], $bindTo = null) : array
    {
        return \Cvphar\Psy\debug($vars, $bindTo);
    }
    public function add(BaseCommand $command) : BaseCommand
    {
        if ($ret = parent::add($command)) {
            if ($ret instanceof ContextAware) {
                $ret->setContext($this->context);
            }
            if ($ret instanceof PresenterAware) {
                $ret->setPresenter($this->config->getPresenter());
            }
            if (isset($this->commandsMatcher)) {
                $this->commandsMatcher->setCommands($this->all());
            }
        }
        return $ret;
    }
    protected function getDefaultInputDefinition() : InputDefinition
    {
        return new InputDefinition([new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.')]);
    }
    protected function getDefaultCommands() : array
    {
        $sudo = new Command\SudoCommand();
        $sudo->setReadline($this->readline);
        $hist = new Command\HistoryCommand();
        $hist->setReadline($this->readline);
        return [new Command\HelpCommand(), new Command\ListCommand(), new Command\DumpCommand(), new Command\DocCommand(), new Command\ShowCommand(), new Command\WtfCommand(), new Command\WhereamiCommand(), new Command\ThrowUpCommand(), new Command\TimeitCommand(), new Command\TraceCommand(), new Command\BufferCommand(), new Command\ClearCommand(), new Command\EditCommand($this->config->getRuntimeDir()), $sudo, $hist, new Command\ExitCommand()];
    }
    protected function getDefaultMatchers() : array
    {
        $this->commandsMatcher = new Matcher\CommandsMatcher($this->all());
        return [$this->commandsMatcher, new Matcher\KeywordsMatcher(), new Matcher\VariablesMatcher(), new Matcher\ConstantsMatcher(), new Matcher\FunctionsMatcher(), new Matcher\ClassNamesMatcher(), new Matcher\ClassMethodsMatcher(), new Matcher\ClassAttributesMatcher(), new Matcher\ObjectMethodsMatcher(), new Matcher\ObjectAttributesMatcher(), new Matcher\ClassMethodDefaultParametersMatcher(), new Matcher\ObjectMethodDefaultParametersMatcher(), new Matcher\FunctionDefaultParametersMatcher()];
    }
    protected function getTabCompletionMatchers()
    {
        @\trigger_error('getTabCompletionMatchers is no longer used', \E_USER_DEPRECATED);
    }
    protected function getDefaultLoopListeners() : array
    {
        $listeners = [];
        if (ProcessForker::isSupported() && $this->config->usePcntl()) {
            $listeners[] = new ProcessForker();
        }
        if (RunkitReloader::isSupported()) {
            $listeners[] = new RunkitReloader();
        }
        return $listeners;
    }
    public function addMatchers(array $matchers)
    {
        $this->matchers = \array_merge($this->matchers, $matchers);
        if (isset($this->autoCompleter)) {
            $this->addMatchersToAutoCompleter($matchers);
        }
    }
    public function addTabCompletionMatchers(array $matchers)
    {
        $this->addMatchers($matchers);
    }
    public function setOutput(OutputInterface $output)
    {
        $this->output = $output;
        $this->originalVerbosity = $output->getVerbosity();
    }
    public function run(InputInterface $input = null, OutputInterface $output = null) : int
    {
        $input = new ArrayInput([]);
        if ($output === null) {
            $output = $this->config->getOutput();
        }
        $this->setAutoExit(\false);
        $this->setCatchExceptions(\false);
        try {
            return parent::run($input, $output);
        } catch (\Throwable $e) {
            $this->writeException($e);
        }
        return 1;
    }
    public function doRun(InputInterface $input, OutputInterface $output) : int
    {
        $this->setOutput($output);
        $this->resetCodeBuffer();
        if ($input->isInteractive()) {
            return $this->doInteractiveRun();
        } else {
            return $this->doNonInteractiveRun($this->config->rawOutput());
        }
    }
    private function doInteractiveRun() : int
    {
        $this->initializeTabCompletion();
        $this->readline->readHistory();
        $this->output->writeln($this->getHeader());
        $this->writeVersionInfo();
        $this->writeStartupMessage();
        try {
            $this->beforeRun();
            $this->loadIncludes();
            $loop = new ExecutionLoopClosure($this);
            $loop->execute();
            $this->afterRun();
        } catch (ThrowUpException $e) {
            throw $e->getPrevious();
        } catch (BreakException $e) {
        }
        return 0;
    }
    private function doNonInteractiveRun(bool $rawOutput) : int
    {
        $this->nonInteractive = \true;
        if (!$rawOutput && !$this->config->outputIsPiped()) {
            $this->output->writeln($this->getHeader());
            $this->writeVersionInfo();
            $this->writeStartupMessage();
        }
        $this->beforeRun();
        $this->loadIncludes();
        if (!empty($this->inputBuffer) || $this->config->inputIsPiped()) {
            $this->getInput(\false);
        }
        if ($this->hasCode()) {
            $ret = $this->execute($this->flushCode());
            $this->writeReturnValue($ret, $rawOutput);
        }
        $this->afterRun();
        $this->nonInteractive = \false;
        return 0;
    }
    protected function configureIO(InputInterface $input, OutputInterface $output)
    {
        $input->setInteractive($this->config->getInputInteractive());
        if ($this->config->getOutputDecorated() !== null) {
            $output->setDecorated($this->config->getOutputDecorated());
        }
        $output->setVerbosity($this->config->getOutputVerbosity());
    }
    private function loadIncludes()
    {
        $load = function (self $__psysh__) {
            \set_error_handler([$__psysh__, 'handleError']);
            foreach ($__psysh__->getIncludes() as $__psysh_include__) {
                try {
                    include_once $__psysh_include__;
                } catch (\Exception $_e) {
                    $__psysh__->writeException($_e);
                }
            }
            \restore_error_handler();
            unset($__psysh_include__);
            \extract($__psysh__->getScopeVariables(\false));
            $__psysh__->setScopeVariables(\get_defined_vars());
        };
        $load($this);
    }
    public function getInput(bool $interactive = \true)
    {
        $this->codeBufferOpen = \false;
        do {
            $this->output->setVerbosity($this->originalVerbosity);
            $input = $this->readline();
            if ($input === \false) {
                if (!$interactive) {
                    return;
                }
                $this->output->writeln('');
                if ($this->hasCode()) {
                    $this->resetCodeBuffer();
                } else {
                    throw new BreakException('Ctrl+D');
                }
            }
            if (\trim($input) === '' && !$this->codeBufferOpen) {
                continue;
            }
            $input = $this->onInput($input);
            if ($this->hasCommand($input) && !$this->inputInOpenStringOrComment($input)) {
                $this->addHistory($input);
                $this->runCommand($input);
                continue;
            }
            $this->addCode($input);
        } while (!$interactive || !$this->hasValidCode());
    }
    private function inputInOpenStringOrComment(string $input) : bool
    {
        if (!$this->hasCode()) {
            return \false;
        }
        $code = $this->codeBuffer;
        $code[] = $input;
        $tokens = @\token_get_all('<?php ' . \implode("\n", $code));
        $last = \array_pop($tokens);
        return $last === '"' || $last === '`' || \is_array($last) && \in_array($last[0], [\T_ENCAPSED_AND_WHITESPACE, \T_START_HEREDOC, \T_COMMENT]);
    }
    protected function beforeRun()
    {
        foreach ($this->loopListeners as $listener) {
            $listener->beforeRun($this);
        }
    }
    public function beforeLoop()
    {
        foreach ($this->loopListeners as $listener) {
            $listener->beforeLoop($this);
        }
    }
    public function onInput(string $input) : string
    {
        foreach ($this->loopListeners as $listeners) {
            if (($return = $listeners->onInput($this, $input)) !== null) {
                $input = $return;
            }
        }
        return $input;
    }
    public function onExecute(string $code) : string
    {
        $this->errorReporting = \error_reporting();
        foreach ($this->loopListeners as $listener) {
            if (($return = $listener->onExecute($this, $code)) !== null) {
                $code = $return;
            }
        }
        $output = $this->output;
        if ($output instanceof ConsoleOutput) {
            $output = $output->getErrorOutput();
        }
        $output->writeln(\sprintf('<whisper>%s</whisper>', OutputFormatter::escape($code)), ConsoleOutput::VERBOSITY_DEBUG);
        return $code;
    }
    public function afterLoop()
    {
        foreach ($this->loopListeners as $listener) {
            $listener->afterLoop($this);
        }
    }
    protected function afterRun()
    {
        foreach ($this->loopListeners as $listener) {
            $listener->afterRun($this);
        }
    }
    public function setScopeVariables(array $vars)
    {
        $this->context->setAll($vars);
    }
    public function getScopeVariables(bool $includeBoundObject = \true) : array
    {
        $vars = $this->context->getAll();
        if (!$includeBoundObject) {
            unset($vars['this']);
        }
        return $vars;
    }
    public function getSpecialScopeVariables(bool $includeBoundObject = \true) : array
    {
        $vars = $this->context->getSpecialVariables();
        if (!$includeBoundObject) {
            unset($vars['this']);
        }
        return $vars;
    }
    public function getScopeVariablesDiff(array $currentVars) : array
    {
        $newVars = [];
        foreach ($this->getScopeVariables(\false) as $key => $value) {
            if (!\array_key_exists($key, $currentVars) || $currentVars[$key] !== $value) {
                $newVars[$key] = $value;
            }
        }
        return $newVars;
    }
    public function getUnusedCommandScopeVariableNames() : array
    {
        return $this->context->getUnusedCommandScopeVariableNames();
    }
    public function getScopeVariableNames() : array
    {
        return \array_keys($this->context->getAll());
    }
    public function getScopeVariable(string $name)
    {
        return $this->context->get($name);
    }
    public function setBoundObject($boundObject)
    {
        $this->context->setBoundObject($boundObject);
    }
    public function getBoundObject()
    {
        return $this->context->getBoundObject();
    }
    public function setBoundClass($boundClass)
    {
        $this->context->setBoundClass($boundClass);
    }
    public function getBoundClass()
    {
        return $this->context->getBoundClass();
    }
    public function setIncludes(array $includes = [])
    {
        $this->includes = $includes;
    }
    public function getIncludes() : array
    {
        return \array_merge($this->config->getDefaultIncludes(), $this->includes);
    }
    public function hasCode() : bool
    {
        return !empty($this->codeBuffer);
    }
    protected function hasValidCode() : bool
    {
        return !$this->codeBufferOpen && $this->code !== \false;
    }
    public function addCode(string $code, bool $silent = \false)
    {
        try {
            if (\substr(\rtrim($code), -1) === '\\') {
                $this->codeBufferOpen = \true;
                $code = \substr(\rtrim($code), 0, -1);
            } else {
                $this->codeBufferOpen = \false;
            }
            $this->codeBuffer[] = $silent ? new SilentInput($code) : $code;
            $this->code = $this->cleaner->clean($this->codeBuffer, $this->config->requireSemicolons());
        } catch (\Throwable $e) {
            $this->addCodeBufferToHistory();
            throw $e;
        }
    }
    private function setCode(string $code, bool $silent = \false)
    {
        if ($this->hasCode()) {
            $this->codeStack[] = [$this->codeBuffer, $this->codeBufferOpen, $this->code];
        }
        $this->resetCodeBuffer();
        try {
            $this->addCode($code, $silent);
        } catch (\Throwable $e) {
            $this->popCodeStack();
            throw $e;
        }
        if (!$this->hasValidCode()) {
            $this->popCodeStack();
            throw new \InvalidArgumentException('Unexpected end of input');
        }
    }
    public function getCodeBuffer() : array
    {
        return $this->codeBuffer;
    }
    protected function runCommand(string $input)
    {
        $command = $this->getCommand($input);
        if (empty($command)) {
            throw new \InvalidArgumentException('Command not found: ' . $input);
        }
        $input = new ShellInput(\str_replace('\\', '\\\\', \rtrim($input, " \t\n\r\x00\v;")));
        if ($input->hasParameterOption(['--help', '-h'])) {
            $helpCommand = $this->get('help');
            if (!$helpCommand instanceof Command\HelpCommand) {
                throw new RuntimeException('Invalid help command instance');
            }
            $helpCommand->setCommand($command);
            return $helpCommand->run(new StringInput(''), $this->output);
        }
        return $command->run($input, $this->output);
    }
    public function resetCodeBuffer()
    {
        $this->codeBuffer = [];
        $this->code = \false;
    }
    public function addInput($input, bool $silent = \false)
    {
        foreach ((array) $input as $line) {
            $this->inputBuffer[] = $silent ? new SilentInput($line) : $line;
        }
    }
    public function flushCode()
    {
        if ($this->hasValidCode()) {
            $this->addCodeBufferToHistory();
            $code = $this->code;
            $this->popCodeStack();
            return $code;
        }
    }
    private function popCodeStack()
    {
        $this->resetCodeBuffer();
        if (empty($this->codeStack)) {
            return;
        }
        list($codeBuffer, $codeBufferOpen, $code) = \array_pop($this->codeStack);
        $this->codeBuffer = $codeBuffer;
        $this->codeBufferOpen = $codeBufferOpen;
        $this->code = $code;
    }
    private function addHistory($line)
    {
        if ($line instanceof SilentInput) {
            return;
        }
        if (\trim($line) !== '' && \substr($line, 0, 1) !== ' ') {
            $this->readline->addHistory($line);
        }
    }
    private function addCodeBufferToHistory()
    {
        $codeBuffer = \array_filter($this->codeBuffer, function ($line) {
            return !$line instanceof SilentInput;
        });
        $this->addHistory(\implode("\n", $codeBuffer));
    }
    public function getNamespace()
    {
        if ($namespace = $this->cleaner->getNamespace()) {
            return \implode('\\', $namespace);
        }
    }
    public function writeStdout(string $out, int $phase = \PHP_OUTPUT_HANDLER_END)
    {
        if ($phase & \PHP_OUTPUT_HANDLER_START) {
            if ($this->output instanceof ShellOutput) {
                $this->output->startPaging();
            }
        }
        $isCleaning = $phase & \PHP_OUTPUT_HANDLER_CLEAN;
        if ($out !== '' && !$isCleaning) {
            $this->output->write($out, \false, OutputInterface::OUTPUT_RAW);
            $this->outputWantsNewline = \substr($out, -1) !== "\n";
            $this->stdoutBuffer .= $out;
        }
        if ($phase & \PHP_OUTPUT_HANDLER_END) {
            if ($this->outputWantsNewline) {
                if (!$this->config->rawOutput() && !$this->config->outputIsPiped()) {
                    $this->output->writeln(\sprintf('<whisper>%s</whisper>', $this->config->useUnicode() ? 'â�Ž' : '\\n'));
                } else {
                    $this->output->writeln('');
                }
                $this->outputWantsNewline = \false;
            }
            if ($this->stdoutBuffer !== '') {
                $this->context->setLastStdout($this->stdoutBuffer);
                $this->stdoutBuffer = '';
            }
            if ($this->output instanceof ShellOutput) {
                $this->output->stopPaging();
            }
        }
    }
    public function writeReturnValue($ret, bool $rawOutput = \false)
    {
        $this->lastExecSuccess = \true;
        if ($ret instanceof NoReturnValue) {
            return;
        }
        $this->context->setReturnValue($ret);
        if ($rawOutput) {
            $formatted = \var_export($ret, \true);
        } else {
            $prompt = $this->config->theme()->returnValue();
            $indent = \str_repeat(' ', \strlen($prompt));
            $formatted = $this->presentValue($ret);
            $formattedRetValue = \sprintf('<whisper>%s</whisper>', $prompt);
            $formatted = $formattedRetValue . \str_replace(\PHP_EOL, \PHP_EOL . $indent, $formatted);
        }
        if ($this->output instanceof ShellOutput) {
            $this->output->page($formatted . \PHP_EOL);
        } else {
            $this->output->writeln($formatted);
        }
    }
    public function writeException(\Throwable $e)
    {
        if ($e instanceof BreakException && $this->nonInteractive) {
            $this->resetCodeBuffer();
            return;
        }
        if (!$e instanceof BreakException) {
            $this->lastExecSuccess = \false;
            $this->context->setLastException($e);
        }
        $output = $this->output;
        if ($output instanceof ConsoleOutput) {
            $output = $output->getErrorOutput();
        }
        if (!$this->config->theme()->compact()) {
            $output->writeln('');
        }
        $output->writeln($this->formatException($e));
        if (!$this->config->theme()->compact()) {
            $output->writeln('');
        }
        if (!$e instanceof BreakException && $output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $trace = TraceFormatter::formatTrace($e);
            if (\count($trace) !== 0) {
                $output->writeln('--');
                $output->write($trace, \true);
                $output->writeln('');
            }
        }
        $this->resetCodeBuffer();
    }
    public function getLastExecSuccess() : bool
    {
        return $this->lastExecSuccess;
    }
    public function formatException(\Throwable $e) : string
    {
        $indent = $this->config->theme()->compact() ? '' : '  ';
        if ($e instanceof BreakException) {
            return \sprintf('%s<info> INFO </info> %s.', $indent, \rtrim($e->getRawMessage(), '.'));
        } elseif ($e instanceof PsyException) {
            $message = $e->getLine() > 1 ? \sprintf('%s in %s on line %d', $e->getRawMessage(), $e->getFile(), $e->getLine()) : \sprintf('%s in %s', $e->getRawMessage(), $e->getFile());
            $messageLabel = \strtoupper($this->getMessageLabel($e));
        } else {
            $message = $e->getMessage();
            $messageLabel = $this->getMessageLabel($e);
        }
        $message = \preg_replace("#(\\w:)?([\\\\/]\\w+)*[\\\\/]src[\\\\/]Execution(?:Loop)?Closure.php\\(\\d+\\) : eval\\(\\)'d code#", "eval()'d code", $message);
        $message = \str_replace(" in eval()'d code", '', $message);
        $message = \trim($message);
        if (!empty($message) && !\in_array(\substr($message, -1), ['.', '?', '!', ':'])) {
            $message = "{$message}.";
        }
        $message = \str_replace(\getcwd() . \DIRECTORY_SEPARATOR, '', $message);
        $severity = $e instanceof \ErrorException ? $this->getSeverity($e) : 'error';
        return \sprintf('%s<%s> %s </%s> %s', $indent, $severity, $messageLabel, $severity, OutputFormatter::escape($message));
    }
    protected function getSeverity(\ErrorException $e) : string
    {
        $severity = $e->getSeverity();
        if ($severity & \error_reporting()) {
            switch ($severity) {
                case \E_WARNING:
                case \E_NOTICE:
                case \E_CORE_WARNING:
                case \E_COMPILE_WARNING:
                case \E_USER_WARNING:
                case \E_USER_NOTICE:
                case \E_USER_DEPRECATED:
                case \E_DEPRECATED:
                case \E_STRICT:
                    return 'warning';
                default:
                    return 'error';
            }
        } else {
            return 'warning';
        }
    }
    protected function getMessageLabel(\Throwable $e) : string
    {
        if ($e instanceof \ErrorException) {
            $severity = $e->getSeverity();
            if ($severity & \error_reporting()) {
                switch ($severity) {
                    case \E_WARNING:
                        return 'Warning';
                    case \E_NOTICE:
                        return 'Notice';
                    case \E_CORE_WARNING:
                        return 'Core Warning';
                    case \E_COMPILE_WARNING:
                        return 'Compile Warning';
                    case \E_USER_WARNING:
                        return 'User Warning';
                    case \E_USER_NOTICE:
                        return 'User Notice';
                    case \E_USER_DEPRECATED:
                        return 'User Deprecated';
                    case \E_DEPRECATED:
                        return 'Deprecated';
                    case \E_STRICT:
                        return 'Strict';
                }
            }
        }
        if ($e instanceof PsyException) {
            $exceptionShortName = (new \ReflectionClass($e))->getShortName();
            $typeParts = \preg_split('/(?=[A-Z])/', $exceptionShortName);
            \array_pop($typeParts);
            return \trim(\strtoupper(\implode(' ', $typeParts)));
        }
        return \get_class($e);
    }
    public function execute(string $code, bool $throwExceptions = \false)
    {
        $this->setCode($code, \true);
        $closure = new ExecutionClosure($this);
        if ($throwExceptions) {
            return $closure->execute();
        }
        try {
            return $closure->execute();
        } catch (\Throwable $_e) {
            $this->writeException($_e);
        }
    }
    public function handleError($errno, $errstr, $errfile, $errline)
    {
        if ($errno & (\E_ERROR | \E_PARSE | \E_CORE_ERROR | \E_COMPILE_ERROR | \E_USER_ERROR | \E_RECOVERABLE_ERROR)) {
            ErrorException::throwException($errno, $errstr, $errfile, $errline);
        }
        $errorsSuppressed = $this->errorReporting !== null && $this->errorReporting !== \error_reporting();
        if ($errno & \error_reporting() || !$errorsSuppressed && $errno & $this->config->errorLoggingLevel()) {
            $this->writeException(new ErrorException($errstr, 0, $errno, $errfile, $errline));
        }
    }
    protected function presentValue($val) : string
    {
        return $this->config->getPresenter()->present($val);
    }
    protected function getCommand(string $input)
    {
        $input = new StringInput($input);
        if ($name = $input->getFirstArgument()) {
            return $this->get($name);
        }
    }
    protected function hasCommand(string $input) : bool
    {
        if (\preg_match('/([^\\s]+?)(?:\\s|$)/A', \ltrim($input), $match)) {
            return $this->has($match[1]);
        }
        return \false;
    }
    protected function getPrompt()
    {
        if ($this->output->isQuiet()) {
            return null;
        }
        $theme = $this->config->theme();
        if ($this->hasCode()) {
            return $theme->bufferPrompt();
        }
        return $theme->prompt();
    }
    protected function readline(bool $interactive = \true)
    {
        $prompt = $this->config->theme()->replayPrompt();
        if (!empty($this->inputBuffer)) {
            $line = \array_shift($this->inputBuffer);
            if (!$line instanceof SilentInput) {
                $this->output->writeln(\sprintf('<whisper>%s</whisper><aside>%s</aside>', $prompt, OutputFormatter::escape($line)));
            }
            return $line;
        }
        $bracketedPaste = $interactive && $this->config->useBracketedPaste();
        if ($bracketedPaste) {
            \printf("\x1b[?2004h");
        }
        $line = $this->readline->readline($this->getPrompt());
        if ($bracketedPaste) {
            \printf("\x1b[?2004l");
        }
        return $line;
    }
    protected function getHeader() : string
    {
        return \sprintf('<whisper>%s by Justin Hileman</whisper>', $this->getVersion());
    }
    public function getVersion() : string
    {
        return self::getVersionHeader($this->config->useUnicode());
    }
    public static function getVersionHeader(bool $useUnicode = \false) : string
    {
        $separator = $useUnicode ? 'â€”' : '-';
        return \sprintf('Psy Shell %s (PHP %s %s %s)', self::VERSION, \PHP_VERSION, $separator, \PHP_SAPI);
    }
    public function getManualDb()
    {
        return $this->config->getManualDb();
    }
    protected function autocomplete($text)
    {
        @\trigger_error('Tab completion is provided by the AutoCompleter service', \E_USER_DEPRECATED);
    }
    protected function initializeTabCompletion()
    {
        if (!$this->config->useTabCompletion()) {
            return;
        }
        $this->autoCompleter = $this->config->getAutoCompleter();
        $this->addMatchersToAutoCompleter($this->getDefaultMatchers());
        $this->addMatchersToAutoCompleter($this->matchers);
        $this->autoCompleter->activate();
    }
    private function addMatchersToAutoCompleter(array $matchers)
    {
        foreach ($matchers as $matcher) {
            if ($matcher instanceof ContextAware) {
                $matcher->setContext($this->context);
            }
            $this->autoCompleter->addMatcher($matcher);
        }
    }
    protected function writeVersionInfo()
    {
        if (\PHP_SAPI !== 'cli') {
            return;
        }
        try {
            $client = $this->config->getChecker();
            if (!$client->isLatest()) {
                $this->output->writeln(\sprintf('<whisper>New version is available at psysh.org/psysh (current: %s, latest: %s)</whisper>', self::VERSION, $client->getLatest()));
            }
        } catch (\InvalidArgumentException $e) {
            $this->output->writeln($e->getMessage());
        }
    }
    protected function writeStartupMessage()
    {
        $message = $this->config->getStartupMessage();
        if ($message !== null && $message !== '') {
            $this->output->writeln($message);
        }
    }
}
<?php

namespace Cvphar\Psy\Input;

class SilentInput
{
    private $inputString;
    public function __construct(string $inputString)
    {
        $this->inputString = $inputString;
    }
    public function __toString() : string
    {
        return $this->inputString;
    }
}
<?php

namespace Cvphar\Psy\Input;

use Cvphar\Symfony\Component\Console\Input\InputArgument;
class CodeArgument extends InputArgument
{
    public function __construct(string $name, int $mode = null, string $description = '', $default = null)
    {
        if ($mode & InputArgument::IS_ARRAY) {
            throw new \InvalidArgumentException('Argument mode IS_ARRAY is not valid');
        }
        parent::__construct($name, $mode, $description, $default);
    }
}
<?php

namespace Cvphar\Psy\Input;

use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\StringInput;
class ShellInput extends StringInput
{
    private $hasCodeArgument = \false;
    private $tokenPairs;
    private $parsed;
    public function __construct(string $input)
    {
        parent::__construct($input);
        $this->tokenPairs = $this->tokenize($input);
    }
    public function bind(InputDefinition $definition)
    {
        $hasCodeArgument = \false;
        if ($definition->getArgumentCount() > 0) {
            $args = $definition->getArguments();
            $lastArg = \array_pop($args);
            foreach ($args as $arg) {
                if ($arg instanceof CodeArgument) {
                    $msg = \sprintf('Unexpected CodeArgument before the final position: %s', $arg->getName());
                    throw new \InvalidArgumentException($msg);
                }
            }
            if ($lastArg instanceof CodeArgument) {
                $hasCodeArgument = \true;
            }
        }
        $this->hasCodeArgument = $hasCodeArgument;
        return parent::bind($definition);
    }
    private function tokenize(string $input) : array
    {
        $tokens = [];
        $length = \strlen($input);
        $cursor = 0;
        while ($cursor < $length) {
            if (\preg_match('/\\s+/A', $input, $match, 0, $cursor)) {
            } elseif (\preg_match('/([^="\'\\s]+?)(=?)(' . StringInput::REGEX_QUOTED_STRING . '+)/A', $input, $match, 0, $cursor)) {
                $tokens[] = [$match[1] . $match[2] . \stripcslashes(\str_replace(['"\'', '\'"', '\'\'', '""'], '', \substr($match[3], 1, \strlen($match[3]) - 2))), \stripcslashes(\substr($input, $cursor))];
            } elseif (\preg_match('/' . StringInput::REGEX_QUOTED_STRING . '/A', $input, $match, 0, $cursor)) {
                $tokens[] = [\stripcslashes(\substr($match[0], 1, \strlen($match[0]) - 2)), \stripcslashes(\substr($input, $cursor))];
            } elseif (\preg_match('/' . StringInput::REGEX_STRING . '/A', $input, $match, 0, $cursor)) {
                $tokens[] = [\stripcslashes($match[1]), \stripcslashes(\substr($input, $cursor))];
            } else {
                throw new \InvalidArgumentException(\sprintf('Unable to parse input near "... %s ..."', \substr($input, $cursor, 10)));
            }
            $cursor += \strlen($match[0]);
        }
        return $tokens;
    }
    protected function parse()
    {
        $parseOptions = \true;
        $this->parsed = $this->tokenPairs;
        while (null !== ($tokenPair = \array_shift($this->parsed))) {
            list($token, $rest) = $tokenPair;
            if ($parseOptions && '' === $token) {
                $this->parseShellArgument($token, $rest);
            } elseif ($parseOptions && '--' === $token) {
                $parseOptions = \false;
            } elseif ($parseOptions && 0 === \strpos($token, '--')) {
                $this->parseLongOption($token);
            } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
                $this->parseShortOption($token);
            } else {
                $this->parseShellArgument($token, $rest);
            }
        }
    }
    private function parseShellArgument(string $token, string $rest)
    {
        $c = \count($this->arguments);
        if ($this->definition->hasArgument($c)) {
            $arg = $this->definition->getArgument($c);
            if ($arg instanceof CodeArgument) {
                $this->parsed = [];
                $this->arguments[$arg->getName()] = $rest;
            } else {
                $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token;
            }
            return;
        }
        if ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
            $arg = $this->definition->getArgument($c - 1);
            $this->arguments[$arg->getName()][] = $token;
            return;
        }
        $all = $this->definition->getArguments();
        if (\count($all)) {
            throw new \RuntimeException(\sprintf('Too many arguments, expected arguments "%s".', \implode('" "', \array_keys($all))));
        }
        throw new \RuntimeException(\sprintf('No arguments expected, got "%s".', $token));
    }
    private function parseShortOption(string $token)
    {
        $name = \substr($token, 1);
        if (\strlen($name) > 1) {
            if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
                $this->addShortOption($name[0], \substr($name, 1));
            } else {
                $this->parseShortOptionSet($name);
            }
        } else {
            $this->addShortOption($name, null);
        }
    }
    private function parseShortOptionSet(string $name)
    {
        $len = \strlen($name);
        for ($i = 0; $i < $len; $i++) {
            if (!$this->definition->hasShortcut($name[$i])) {
                throw new \RuntimeException(\sprintf('The "-%s" option does not exist.', $name[$i]));
            }
            $option = $this->definition->getOptionForShortcut($name[$i]);
            if ($option->acceptValue()) {
                $this->addLongOption($option->getName(), $i === $len - 1 ? null : \substr($name, $i + 1));
                break;
            } else {
                $this->addLongOption($option->getName(), null);
            }
        }
    }
    private function parseLongOption(string $token)
    {
        $name = \substr($token, 2);
        if (\false !== ($pos = \strpos($name, '='))) {
            if (($value = \substr($name, $pos + 1)) === '') {
                \array_unshift($this->parsed, [$value, null]);
            }
            $this->addLongOption(\substr($name, 0, $pos), $value);
        } else {
            $this->addLongOption($name, null);
        }
    }
    private function addShortOption(string $shortcut, $value)
    {
        if (!$this->definition->hasShortcut($shortcut)) {
            throw new \RuntimeException(\sprintf('The "-%s" option does not exist.', $shortcut));
        }
        $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
    }
    private function addLongOption(string $name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not exist.', $name));
        }
        $option = $this->definition->getOption($name);
        if (null !== $value && !$option->acceptValue()) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name));
        }
        if (\in_array($value, ['', null], \true) && $option->acceptValue() && \count($this->parsed)) {
            $next = \array_shift($this->parsed);
            $nextToken = $next[0];
            if (isset($nextToken[0]) && '-' !== $nextToken[0] || \in_array($nextToken, ['', null], \true)) {
                $value = $nextToken;
            } else {
                \array_unshift($this->parsed, $next);
            }
        }
        if ($value === null) {
            if ($option->isValueRequired()) {
                throw new \RuntimeException(\sprintf('The "--%s" option requires a value.', $name));
            }
            if (!$option->isArray() && !$option->isValueOptional()) {
                $value = \true;
            }
        }
        if ($option->isArray()) {
            $this->options[$name][] = $value;
        } else {
            $this->options[$name] = $value;
        }
    }
}
<?php

namespace Cvphar\Psy\Input;

use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
class FilterOptions
{
    private $filter = \false;
    private $pattern;
    private $insensitive;
    private $invert;
    public static function getOptions() : array
    {
        return [new InputOption('grep', 'G', InputOption::VALUE_REQUIRED, 'Limit to items matching the given pattern (string or regex).'), new InputOption('insensitive', 'i', InputOption::VALUE_NONE, 'Case-insensitive search (requires --grep).'), new InputOption('invert', 'v', InputOption::VALUE_NONE, 'Inverted search (requires --grep).')];
    }
    public function bind(InputInterface $input)
    {
        $this->validateInput($input);
        if (!($pattern = $input->getOption('grep'))) {
            $this->filter = \false;
            return;
        }
        if (!$this->stringIsRegex($pattern)) {
            $pattern = '/' . \preg_quote($pattern, '/') . '/';
        }
        if ($insensitive = $input->getOption('insensitive')) {
            $pattern .= 'i';
        }
        $this->validateRegex($pattern);
        $this->filter = \true;
        $this->pattern = $pattern;
        $this->insensitive = $insensitive;
        $this->invert = $input->getOption('invert');
    }
    public function hasFilter() : bool
    {
        return $this->filter;
    }
    public function match(string $string, array &$matches = null) : bool
    {
        return $this->filter === \false || (\preg_match($this->pattern, $string, $matches) xor $this->invert);
    }
    private function validateInput(InputInterface $input)
    {
        if (!$input->getOption('grep')) {
            foreach (['invert', 'insensitive'] as $option) {
                if ($input->getOption($option)) {
                    throw new RuntimeException('--' . $option . ' does not make sense without --grep');
                }
            }
        }
    }
    private function stringIsRegex(string $string) : bool
    {
        return \substr($string, 0, 1) === '/' && \substr($string, -1) === '/' && \strlen($string) >= 3;
    }
    private function validateRegex(string $pattern)
    {
        \set_error_handler([ErrorException::class, 'throwException']);
        try {
            \preg_match($pattern, '');
        } catch (ErrorException $e) {
            throw new RuntimeException(\str_replace('preg_match(): ', 'Invalid regular expression: ', $e->getRawMessage()));
        } finally {
            \restore_error_handler();
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node\Expr\New_;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
class NoReturnValue
{
    public static function create() : New_
    {
        return new New_(new FullyQualifiedName(self::class));
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
abstract class NamespaceAwarePass extends CodeCleanerPass
{
    protected $namespace;
    protected $currentScope;
    public function beforeTraverse(array $nodes)
    {
        $this->namespace = [];
        $this->currentScope = [];
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof Namespace_) {
            $this->namespace = isset($node->name) ? $node->name->parts : [];
        }
    }
    protected function getFullyQualifiedName($name) : string
    {
        if ($name instanceof FullyQualifiedName) {
            return \implode('\\', $name->parts);
        } elseif ($name instanceof Name) {
            $name = $name->parts;
        } elseif (!\is_array($name)) {
            $name = [$name];
        }
        return \implode('\\', \array_merge($this->namespace, $name));
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\ClassMethod;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
use Cvphar\Psy\Exception\FatalErrorException;
class ValidConstructorPass extends CodeCleanerPass
{
    private $namespace;
    public function beforeTraverse(array $nodes)
    {
        $this->namespace = [];
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof Namespace_) {
            $this->namespace = isset($node->name) ? $node->name->parts : [];
        } elseif ($node instanceof Class_) {
            $constructor = null;
            foreach ($node->stmts as $stmt) {
                if ($stmt instanceof ClassMethod) {
                    if ('__construct' === \strtolower($stmt->name)) {
                        $this->validateConstructor($stmt, $node);
                        return;
                    }
                    if (empty($this->namespace) && \strtolower($node->name) === \strtolower($stmt->name)) {
                        $constructor = $stmt;
                    }
                }
            }
            if ($constructor) {
                $this->validateConstructor($constructor, $node);
            }
        }
    }
    private function validateConstructor(Node $constructor, Node $classNode)
    {
        if ($constructor->isStatic()) {
            $className = $classNode->name instanceof Identifier ? $classNode->name->toString() : $classNode->name;
            $msg = \sprintf('Constructor %s::%s() cannot be static', \implode('\\', \array_merge($this->namespace, (array) $className)), $constructor->name);
            throw new FatalErrorException($msg, 0, \E_ERROR, null, $classNode->getLine());
        }
        if (\method_exists($constructor, 'getReturnType') && $constructor->getReturnType()) {
            $className = $classNode->name instanceof Identifier ? $classNode->name->toString() : $classNode->name;
            $msg = \sprintf('Constructor %s::%s() cannot declare a return type', \implode('\\', \array_merge($this->namespace, (array) $className)), $constructor->name);
            throw new FatalErrorException($msg, 0, \E_ERROR, null, $classNode->getLine());
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\ClassMethod;
use Cvphar\Psy\Exception\FatalErrorException;
class AbstractClassPass extends CodeCleanerPass
{
    private $class;
    private $abstractMethods;
    public function enterNode(Node $node)
    {
        if ($node instanceof Class_) {
            $this->class = $node;
            $this->abstractMethods = [];
        } elseif ($node instanceof ClassMethod) {
            if ($node->isAbstract()) {
                $name = \sprintf('%s::%s', $this->class->name, $node->name);
                $this->abstractMethods[] = $name;
                if ($node->stmts !== null) {
                    $msg = \sprintf('Abstract function %s cannot contain body', $name);
                    throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                }
            }
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof Class_) {
            $count = \count($this->abstractMethods);
            if ($count > 0 && !$node->isAbstract()) {
                $msg = \sprintf('Class %s contains %d abstract method%s must therefore be declared abstract or implement the remaining methods (%s)', $node->name, $count, $count === 1 ? '' : 's', \implode(', ', $this->abstractMethods));
                throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt\Do_;
use Cvphar\PhpParser\Node\Stmt\Function_;
use Cvphar\PhpParser\Node\Stmt\If_;
use Cvphar\PhpParser\Node\Stmt\Switch_;
use Cvphar\PhpParser\Node\Stmt\While_;
use Cvphar\Psy\Exception\FatalErrorException;
class ValidFunctionNamePass extends NamespaceAwarePass
{
    private $conditionalScopes = 0;
    public function enterNode(Node $node)
    {
        parent::enterNode($node);
        if (self::isConditional($node)) {
            $this->conditionalScopes++;
        } elseif ($node instanceof Function_) {
            $name = $this->getFullyQualifiedName($node->name);
            if ($this->conditionalScopes === 0) {
                if (\function_exists($name) || isset($this->currentScope[\strtolower($name)])) {
                    $msg = \sprintf('Cannot redeclare %s()', $name);
                    throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                }
            }
            $this->currentScope[\strtolower($name)] = \true;
        }
    }
    public function leaveNode(Node $node)
    {
        if (self::isConditional($node)) {
            $this->conditionalScopes--;
        }
    }
    private static function isConditional(Node $node)
    {
        return $node instanceof If_ || $node instanceof While_ || $node instanceof Do_ || $node instanceof Switch_;
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\Array_;
use Cvphar\PhpParser\Node\Expr\ArrayDimFetch;
use Cvphar\PhpParser\Node\Expr\ClassConstFetch;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Expr\MethodCall;
use Cvphar\PhpParser\Node\Expr\PropertyFetch;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\Psy\Exception\FatalErrorException;
class PassableByReferencePass extends CodeCleanerPass
{
    const EXCEPTION_MESSAGE = 'Only variables can be passed by reference';
    public function enterNode(Node $node)
    {
        if ($node instanceof FuncCall) {
            if ($node->name instanceof Expr || $node->name instanceof Variable) {
                return;
            }
            $name = (string) $node->name;
            if ($name === 'array_multisort') {
                return $this->validateArrayMultisort($node);
            }
            try {
                $refl = new \ReflectionFunction($name);
            } catch (\ReflectionException $e) {
                return;
            }
            foreach ($refl->getParameters() as $key => $param) {
                if (\array_key_exists($key, $node->args)) {
                    $arg = $node->args[$key];
                    if ($param->isPassedByReference() && !$this->isPassableByReference($arg)) {
                        throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
                    }
                }
            }
        }
    }
    private function isPassableByReference(Node $arg) : bool
    {
        if ($arg->value instanceof Array_) {
            return $arg->unpack;
        }
        return $arg->value instanceof ClassConstFetch || $arg->value instanceof PropertyFetch || $arg->value instanceof Variable || $arg->value instanceof FuncCall || $arg->value instanceof MethodCall || $arg->value instanceof StaticCall || $arg->value instanceof ArrayDimFetch;
    }
    private function validateArrayMultisort(Node $node)
    {
        $nonPassable = 2;
        foreach ($node->args as $arg) {
            if ($this->isPassableByReference($arg)) {
                $nonPassable = 0;
            } elseif (++$nonPassable > 2) {
                throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Assign;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\Psy\Exception\FatalErrorException;
class AssignThisVariablePass extends CodeCleanerPass
{
    public function enterNode(Node $node)
    {
        if ($node instanceof Assign && $node->var instanceof Variable && $node->var->name === 'this') {
            throw new FatalErrorException('Cannot re-assign $this', 0, \E_ERROR, null, $node->getLine());
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Expr\MethodCall;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
use Cvphar\Psy\Exception\FatalErrorException;
class CallTimePassByReferencePass extends CodeCleanerPass
{
    const EXCEPTION_MESSAGE = 'Call-time pass-by-reference has been removed';
    public function enterNode(Node $node)
    {
        if (!$node instanceof FuncCall && !$node instanceof MethodCall && !$node instanceof StaticCall) {
            return;
        }
        foreach ($node->args as $arg) {
            if ($arg instanceof VariadicPlaceholder) {
                continue;
            }
            if ($arg->byRef) {
                throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Exit_;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\Psy\Exception\BreakException;
class ExitPass extends CodeCleanerPass
{
    public function leaveNode(Node $node)
    {
        if ($node instanceof Exit_) {
            return new StaticCall(new FullyQualifiedName(BreakException::class), 'exitShell');
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\ArrayDimFetch;
use Cvphar\PhpParser\Node\Expr\Assign;
use Cvphar\PhpParser\Node\Expr\AssignRef;
use Cvphar\PhpParser\Node\Stmt\Foreach_;
use Cvphar\Psy\Exception\FatalErrorException;
class EmptyArrayDimFetchPass extends CodeCleanerPass
{
    const EXCEPTION_MESSAGE = 'Cannot use [] for reading';
    private $theseOnesAreFine = [];
    public function beforeTraverse(array $nodes)
    {
        $this->theseOnesAreFine = [];
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof Assign && $node->var instanceof ArrayDimFetch) {
            $this->theseOnesAreFine[] = $node->var;
        } elseif ($node instanceof AssignRef && $node->expr instanceof ArrayDimFetch) {
            $this->theseOnesAreFine[] = $node->expr;
        } elseif ($node instanceof Foreach_ && $node->valueVar instanceof ArrayDimFetch) {
            $this->theseOnesAreFine[] = $node->valueVar;
        } elseif ($node instanceof ArrayDimFetch && $node->var instanceof ArrayDimFetch) {
            if (\in_array($node, $this->theseOnesAreFine)) {
                $this->theseOnesAreFine[] = $node->var;
            }
        }
        if ($node instanceof ArrayDimFetch && $node->dim === null) {
            if (!\in_array($node, $this->theseOnesAreFine)) {
                throw new FatalErrorException(self::EXCEPTION_MESSAGE, $node->getLine());
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
use Cvphar\Psy\CodeCleaner;
class NamespacePass extends CodeCleanerPass
{
    private $namespace = null;
    private $cleaner;
    public function __construct(CodeCleaner $cleaner)
    {
        $this->cleaner = $cleaner;
    }
    public function beforeTraverse(array $nodes)
    {
        if (empty($nodes)) {
            return $nodes;
        }
        $last = \end($nodes);
        if ($last instanceof Namespace_) {
            $kind = $last->getAttribute('kind');
            if ($kind === null || $kind === Namespace_::KIND_SEMICOLON) {
                $this->setNamespace($last->name);
            } else {
                $this->setNamespace(null);
            }
            return $nodes;
        }
        return $this->namespace ? [new Namespace_($this->namespace, $nodes)] : $nodes;
    }
    private function setNamespace($namespace)
    {
        $this->namespace = $namespace;
        $this->cleaner->setNamespace($namespace === null ? null : $namespace->parts);
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\Exit_;
use Cvphar\PhpParser\Node\Stmt;
use Cvphar\PhpParser\Node\Stmt\Break_;
use Cvphar\PhpParser\Node\Stmt\Expression;
use Cvphar\PhpParser\Node\Stmt\If_;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
use Cvphar\PhpParser\Node\Stmt\Return_;
use Cvphar\PhpParser\Node\Stmt\Switch_;
class ImplicitReturnPass extends CodeCleanerPass
{
    public function beforeTraverse(array $nodes) : array
    {
        return $this->addImplicitReturn($nodes);
    }
    private function addImplicitReturn(array $nodes) : array
    {
        if (empty($nodes)) {
            return [new Return_(NoReturnValue::create())];
        }
        $last = \end($nodes);
        if ($last instanceof If_) {
            $last->stmts = $this->addImplicitReturn($last->stmts);
            foreach ($last->elseifs as $elseif) {
                $elseif->stmts = $this->addImplicitReturn($elseif->stmts);
            }
            if ($last->else) {
                $last->else->stmts = $this->addImplicitReturn($last->else->stmts);
            }
        } elseif ($last instanceof Switch_) {
            foreach ($last->cases as $case) {
                $caseLast = \end($case->stmts);
                if ($caseLast instanceof Break_) {
                    $case->stmts = $this->addImplicitReturn(\array_slice($case->stmts, 0, -1));
                    $case->stmts[] = $caseLast;
                }
            }
        } elseif ($last instanceof Expr && !$last instanceof Exit_) {
            $nodes[\count($nodes) - 1] = new Return_($last, ['startLine' => $last->getLine(), 'endLine' => $last->getLine()]);
        } elseif ($last instanceof Expression && !$last->expr instanceof Exit_) {
            $nodes[\count($nodes) - 1] = new Return_($last->expr, ['startLine' => $last->getLine(), 'endLine' => $last->getLine()]);
        } elseif ($last instanceof Namespace_) {
            $last->stmts = $this->addImplicitReturn($last->stmts);
        }
        if (self::isNonExpressionStmt($last)) {
            $nodes[] = new Return_(NoReturnValue::create());
        }
        return $nodes;
    }
    private static function isNonExpressionStmt(Node $node) : bool
    {
        return $node instanceof Stmt && !$node instanceof Expression && !$node instanceof Return_ && !$node instanceof Namespace_;
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr\Include_;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Scalar\LNumber;
use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Exception\FatalErrorException;
class RequirePass extends CodeCleanerPass
{
    private static $requireTypes = [Include_::TYPE_REQUIRE, Include_::TYPE_REQUIRE_ONCE];
    public function enterNode(Node $origNode)
    {
        if (!$this->isRequireNode($origNode)) {
            return;
        }
        $node = clone $origNode;
        $node->expr = new StaticCall(new FullyQualifiedName(self::class), 'resolve', [new Arg($origNode->expr), new Arg(new LNumber($origNode->getLine()))], $origNode->getAttributes());
        return $node;
    }
    public static function resolve($file, $lineNumber = null) : string
    {
        $file = (string) $file;
        if ($file === '') {
            if (\E_WARNING & \error_reporting()) {
                ErrorException::throwException(\E_WARNING, 'Filename cannot be empty', null, $lineNumber);
            }
        }
        $resolvedPath = \stream_resolve_include_path($file);
        if ($file === '' || !$resolvedPath) {
            $msg = \sprintf("Failed opening required '%s'", $file);
            throw new FatalErrorException($msg, 0, \E_ERROR, null, $lineNumber);
        }
        if ($resolvedPath !== $file && $file[0] !== '.') {
            $runningPhar = \Phar::running();
            if (\strpos($runningPhar, 'psysh') !== \false && \is_file($runningPhar . \DIRECTORY_SEPARATOR . $file)) {
                foreach (self::getIncludePath() as $prefix) {
                    $resolvedPath = $prefix . \DIRECTORY_SEPARATOR . $file;
                    if (\is_file($resolvedPath)) {
                        return $resolvedPath;
                    }
                }
            }
        }
        return $file;
    }
    private function isRequireNode(Node $node) : bool
    {
        return $node instanceof Include_ && \in_array($node->type, self::$requireTypes);
    }
    private static function getIncludePath() : array
    {
        if (\PATH_SEPARATOR === ':') {
            return \preg_split('#:(?!//)#', \get_include_path());
        }
        return \explode(\PATH_SEPARATOR, \get_include_path());
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\Psy\Exception\RuntimeException;
class LeavePsyshAlonePass extends CodeCleanerPass
{
    public function enterNode(Node $node)
    {
        if ($node instanceof Variable && $node->name === '__psysh__') {
            throw new RuntimeException('Don\'t mess with $__psysh__; bad things will happen');
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Array_;
use Cvphar\PhpParser\Node\Expr\Assign;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Expr\Isset_;
use Cvphar\PhpParser\Node\Expr\MethodCall;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\Stmt\Unset_;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
use Cvphar\Psy\Exception\FatalErrorException;
class FunctionReturnInWriteContextPass extends CodeCleanerPass
{
    const ISSET_MESSAGE = 'Cannot use isset() on the result of an expression (you can use "null !== expression" instead)';
    const EXCEPTION_MESSAGE = "Can't use function return value in write context";
    public function enterNode(Node $node)
    {
        if ($node instanceof Array_ || $this->isCallNode($node)) {
            $items = $node instanceof Array_ ? $node->items : $node->args;
            foreach ($items as $item) {
                if ($item instanceof VariadicPlaceholder) {
                    continue;
                }
                if ($item && $item->byRef && $this->isCallNode($item->value)) {
                    throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
                }
            }
        } elseif ($node instanceof Isset_ || $node instanceof Unset_) {
            foreach ($node->vars as $var) {
                if (!$this->isCallNode($var)) {
                    continue;
                }
                $msg = $node instanceof Isset_ ? self::ISSET_MESSAGE : self::EXCEPTION_MESSAGE;
                throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
            }
        } elseif ($node instanceof Assign && $this->isCallNode($node->var)) {
            throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
        }
    }
    private function isCallNode(Node $node) : bool
    {
        return $node instanceof FuncCall || $node instanceof MethodCall || $node instanceof StaticCall;
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\Ternary;
use Cvphar\PhpParser\Node\Stmt;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\Do_;
use Cvphar\PhpParser\Node\Stmt\If_;
use Cvphar\PhpParser\Node\Stmt\Interface_;
use Cvphar\PhpParser\Node\Stmt\Switch_;
use Cvphar\PhpParser\Node\Stmt\Trait_;
use Cvphar\PhpParser\Node\Stmt\While_;
use Cvphar\Psy\Exception\FatalErrorException;
class ValidClassNamePass extends NamespaceAwarePass
{
    const CLASS_TYPE = 'class';
    const INTERFACE_TYPE = 'interface';
    const TRAIT_TYPE = 'trait';
    private $conditionalScopes = 0;
    public function enterNode(Node $node)
    {
        parent::enterNode($node);
        if (self::isConditional($node)) {
            $this->conditionalScopes++;
            return;
        }
        if ($this->conditionalScopes === 0) {
            if ($node instanceof Class_) {
                $this->validateClassStatement($node);
            } elseif ($node instanceof Interface_) {
                $this->validateInterfaceStatement($node);
            } elseif ($node instanceof Trait_) {
                $this->validateTraitStatement($node);
            }
        }
    }
    public function leaveNode(Node $node)
    {
        if (self::isConditional($node)) {
            $this->conditionalScopes--;
            return;
        }
    }
    private static function isConditional(Node $node) : bool
    {
        return $node instanceof If_ || $node instanceof While_ || $node instanceof Do_ || $node instanceof Switch_ || $node instanceof Ternary;
    }
    protected function validateClassStatement(Class_ $stmt)
    {
        $this->ensureCanDefine($stmt, self::CLASS_TYPE);
        if (isset($stmt->extends)) {
            $this->ensureClassExists($this->getFullyQualifiedName($stmt->extends), $stmt);
        }
        $this->ensureInterfacesExist($stmt->implements, $stmt);
    }
    protected function validateInterfaceStatement(Interface_ $stmt)
    {
        $this->ensureCanDefine($stmt, self::INTERFACE_TYPE);
        $this->ensureInterfacesExist($stmt->extends, $stmt);
    }
    protected function validateTraitStatement(Trait_ $stmt)
    {
        $this->ensureCanDefine($stmt, self::TRAIT_TYPE);
    }
    protected function ensureCanDefine(Stmt $stmt, string $scopeType = self::CLASS_TYPE)
    {
        if ($stmt->name === null) {
            return;
        }
        $name = $this->getFullyQualifiedName($stmt->name);
        $errorType = null;
        if ($this->classExists($name)) {
            $errorType = self::CLASS_TYPE;
        } elseif ($this->interfaceExists($name)) {
            $errorType = self::INTERFACE_TYPE;
        } elseif ($this->traitExists($name)) {
            $errorType = self::TRAIT_TYPE;
        }
        if ($errorType !== null) {
            throw $this->createError(\sprintf('%s named %s already exists', \ucfirst($errorType), $name), $stmt);
        }
        $this->currentScope[\strtolower($name)] = $scopeType;
    }
    protected function ensureClassExists(string $name, Stmt $stmt)
    {
        if (!$this->classExists($name)) {
            throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
        }
    }
    protected function ensureClassOrInterfaceExists(string $name, Stmt $stmt)
    {
        if (!$this->classExists($name) && !$this->interfaceExists($name)) {
            throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
        }
    }
    protected function ensureClassOrTraitExists(string $name, Stmt $stmt)
    {
        if (!$this->classExists($name) && !$this->traitExists($name)) {
            throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
        }
    }
    protected function ensureMethodExists(string $class, string $name, Stmt $stmt)
    {
        $this->ensureClassOrTraitExists($class, $stmt);
        if (\in_array(\strtolower($class), ['self', 'parent', 'static'])) {
            return;
        }
        if ($this->findInScope($class) === self::CLASS_TYPE) {
            return;
        }
        if ($name instanceof Expr) {
            return;
        }
        if (!\method_exists($class, $name) && !\method_exists($class, '__callStatic')) {
            throw $this->createError(\sprintf('Call to undefined method %s::%s()', $class, $name), $stmt);
        }
    }
    protected function ensureInterfacesExist(array $interfaces, Stmt $stmt)
    {
        foreach ($interfaces as $interface) {
            $name = $this->getFullyQualifiedName($interface);
            if (!$this->interfaceExists($name)) {
                throw $this->createError(\sprintf('Interface \'%s\' not found', $name), $stmt);
            }
        }
    }
    protected function getScopeType(Stmt $stmt) : string
    {
        if ($stmt instanceof Class_) {
            return self::CLASS_TYPE;
        } elseif ($stmt instanceof Interface_) {
            return self::INTERFACE_TYPE;
        } elseif ($stmt instanceof Trait_) {
            return self::TRAIT_TYPE;
        }
        throw $this->createError('Unsupported statement type', $stmt);
    }
    protected function classExists(string $name) : bool
    {
        if (\in_array(\strtolower($name), ['self', 'static', 'parent'])) {
            return \true;
        }
        return \class_exists($name) || $this->findInScope($name) === self::CLASS_TYPE;
    }
    protected function interfaceExists(string $name) : bool
    {
        return \interface_exists($name) || $this->findInScope($name) === self::INTERFACE_TYPE;
    }
    protected function traitExists(string $name) : bool
    {
        return \trait_exists($name) || $this->findInScope($name) === self::TRAIT_TYPE;
    }
    protected function findInScope(string $name)
    {
        $name = \strtolower($name);
        if (isset($this->currentScope[$name])) {
            return $this->currentScope[$name];
        }
    }
    protected function createError(string $msg, Stmt $stmt) : FatalErrorException
    {
        return new FatalErrorException($msg, 0, \E_ERROR, null, $stmt->getLine());
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Closure;
use Cvphar\PhpParser\Node\Expr\ConstFetch;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\NullableType;
use Cvphar\PhpParser\Node\Stmt\Function_;
use Cvphar\PhpParser\Node\Stmt\Return_;
use Cvphar\PhpParser\Node\UnionType;
use Cvphar\Psy\Exception\FatalErrorException;
class ReturnTypePass extends CodeCleanerPass
{
    const MESSAGE = 'A function with return type must return a value';
    const NULLABLE_MESSAGE = 'A function with return type must return a value (did you mean "return null;" instead of "return;"?)';
    const VOID_MESSAGE = 'A void function must not return a value';
    const VOID_NULL_MESSAGE = 'A void function must not return a value (did you mean "return;" instead of "return null;"?)';
    const NULLABLE_VOID_MESSAGE = 'Void type cannot be nullable';
    private $atLeastPhp71;
    private $returnTypeStack = [];
    public function __construct()
    {
        $this->atLeastPhp71 = \version_compare(\PHP_VERSION, '7.1', '>=');
    }
    public function enterNode(Node $node)
    {
        if (!$this->atLeastPhp71) {
            return;
        }
        if ($this->isFunctionNode($node)) {
            $this->returnTypeStack[] = $node->returnType;
            return;
        }
        if (!empty($this->returnTypeStack) && $node instanceof Return_) {
            $expectedType = \end($this->returnTypeStack);
            if ($expectedType === null) {
                return;
            }
            $msg = null;
            if ($this->typeName($expectedType) === 'void') {
                if ($expectedType instanceof NullableType) {
                    $msg = self::NULLABLE_VOID_MESSAGE;
                } elseif ($node->expr instanceof ConstFetch && \strtolower($node->expr->name) === 'null') {
                    $msg = self::VOID_NULL_MESSAGE;
                } elseif ($node->expr !== null) {
                    $msg = self::VOID_MESSAGE;
                }
            } else {
                if ($node->expr === null) {
                    $msg = $expectedType instanceof NullableType ? self::NULLABLE_MESSAGE : self::MESSAGE;
                }
            }
            if ($msg !== null) {
                throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
            }
        }
    }
    public function leaveNode(Node $node)
    {
        if (!$this->atLeastPhp71) {
            return;
        }
        if (!empty($this->returnTypeStack) && $this->isFunctionNode($node)) {
            \array_pop($this->returnTypeStack);
        }
    }
    private function isFunctionNode(Node $node) : bool
    {
        return $node instanceof Function_ || $node instanceof Closure;
    }
    private function typeName(Node $node) : string
    {
        if ($node instanceof UnionType) {
            return \implode('|', \array_map([$this, 'typeName'], $node->types));
        }
        if ($node instanceof NullableType) {
            return \strtolower($node->type->name);
        }
        if ($node instanceof Identifier) {
            return \strtolower($node->name);
        }
        throw new \InvalidArgumentException('Unable to find type name');
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\Array_;
use Cvphar\PhpParser\Node\Expr\ArrayDimFetch;
use Cvphar\PhpParser\Node\Expr\ArrayItem;
use Cvphar\PhpParser\Node\Expr\Assign;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Expr\List_;
use Cvphar\PhpParser\Node\Expr\MethodCall;
use Cvphar\PhpParser\Node\Expr\PropertyFetch;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\Psy\Exception\ParseErrorException;
class ListPass extends CodeCleanerPass
{
    private $atLeastPhp71;
    public function __construct()
    {
        $this->atLeastPhp71 = \version_compare(\PHP_VERSION, '7.1', '>=');
    }
    public function enterNode(Node $node)
    {
        if (!$node instanceof Assign) {
            return;
        }
        if (!$node->var instanceof Array_ && !$node->var instanceof List_) {
            return;
        }
        if (!$this->atLeastPhp71 && $node->var instanceof Array_) {
            $msg = "syntax error, unexpected '='";
            throw new ParseErrorException($msg, $node->expr->getLine());
        }
        $items = isset($node->var->items) ? $node->var->items : $node->var->vars;
        if ($items === [] || $items === [null]) {
            throw new ParseErrorException('Cannot use empty list', $node->var->getLine());
        }
        $itemFound = \false;
        foreach ($items as $item) {
            if ($item === null) {
                continue;
            }
            $itemFound = \true;
            if (!$this->atLeastPhp71 && $item instanceof ArrayItem && $item->key !== null) {
                $msg = 'Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting \',\' or \')\'';
                throw new ParseErrorException($msg, $item->key->getLine());
            }
            if (!self::isValidArrayItem($item)) {
                $msg = 'Assignments can only happen to writable values';
                throw new ParseErrorException($msg, $item->getLine());
            }
        }
        if (!$itemFound) {
            throw new ParseErrorException('Cannot use empty list');
        }
    }
    private static function isValidArrayItem(Expr $item) : bool
    {
        $value = $item instanceof ArrayItem ? $item->value : $item;
        while ($value instanceof ArrayDimFetch || $value instanceof PropertyFetch) {
            $value = $value->var;
        }
        return $value instanceof Variable || $value instanceof MethodCall || $value instanceof FuncCall;
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\FunctionLike;
use Cvphar\PhpParser\Node\Stmt\Goto_;
use Cvphar\PhpParser\Node\Stmt\Label;
use Cvphar\Psy\Exception\FatalErrorException;
class LabelContextPass extends CodeCleanerPass
{
    private $functionDepth;
    private $labelDeclarations;
    private $labelGotos;
    public function beforeTraverse(array $nodes)
    {
        $this->functionDepth = 0;
        $this->labelDeclarations = [];
        $this->labelGotos = [];
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth++;
            return;
        }
        if ($this->functionDepth !== 0) {
            return;
        }
        if ($node instanceof Goto_) {
            $this->labelGotos[\strtolower($node->name)] = $node->getLine();
        } elseif ($node instanceof Label) {
            $this->labelDeclarations[\strtolower($node->name)] = $node->getLine();
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth--;
        }
    }
    public function afterTraverse(array $nodes)
    {
        foreach ($this->labelGotos as $name => $line) {
            if (!isset($this->labelDeclarations[$name])) {
                $msg = "'goto' to undefined label '{$name}'";
                throw new FatalErrorException($msg, 0, \E_ERROR, null, $line);
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Stmt\GroupUse;
use Cvphar\PhpParser\Node\Stmt\Namespace_;
use Cvphar\PhpParser\Node\Stmt\Use_;
use Cvphar\PhpParser\Node\Stmt\UseUse;
use Cvphar\PhpParser\NodeTraverser;
class UseStatementPass extends CodeCleanerPass
{
    private $aliases = [];
    private $lastAliases = [];
    private $lastNamespace = null;
    public function enterNode(Node $node)
    {
        if ($node instanceof Namespace_) {
            if (\strtolower($node->name ?: '') === \strtolower($this->lastNamespace ?: '')) {
                $this->aliases = $this->lastAliases;
            }
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof Use_) {
            foreach ($node->uses as $use) {
                $alias = $use->alias ?: \end($use->name->parts);
                $this->aliases[\strtolower($alias)] = $use->name;
            }
            return NodeTraverser::REMOVE_NODE;
        }
        if ($node instanceof GroupUse) {
            foreach ($node->uses as $use) {
                $alias = $use->alias ?: \end($use->name->parts);
                $this->aliases[\strtolower($alias)] = Name::concat($node->prefix, $use->name, ['startLine' => $node->prefix->getAttribute('startLine'), 'endLine' => $use->name->getAttribute('endLine')]);
            }
            return NodeTraverser::REMOVE_NODE;
        }
        if ($node instanceof Namespace_) {
            $this->lastNamespace = $node->name;
            $this->lastAliases = $this->aliases;
            $this->aliases = [];
            return;
        }
        if ($node instanceof UseUse) {
            return;
        }
        foreach ($node as $name => $subNode) {
            if ($subNode instanceof Name) {
                if ($replacement = $this->findAlias($subNode)) {
                    $node->{$name} = $replacement;
                }
            }
        }
        return $node;
    }
    private function findAlias(Name $name)
    {
        $that = \strtolower($name);
        foreach ($this->aliases as $alias => $prefix) {
            if ($that === $alias) {
                return new FullyQualifiedName($prefix->toString());
            } elseif (\substr($that, 0, \strlen($alias) + 1) === $alias . '\\') {
                return new FullyQualifiedName($prefix->toString() . \substr($name, \strlen($alias)));
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Scalar\DNumber;
use Cvphar\PhpParser\Node\Scalar\LNumber;
use Cvphar\PhpParser\Node\Stmt\Break_;
use Cvphar\PhpParser\Node\Stmt\Continue_;
use Cvphar\PhpParser\Node\Stmt\Do_;
use Cvphar\PhpParser\Node\Stmt\For_;
use Cvphar\PhpParser\Node\Stmt\Foreach_;
use Cvphar\PhpParser\Node\Stmt\Switch_;
use Cvphar\PhpParser\Node\Stmt\While_;
use Cvphar\Psy\Exception\FatalErrorException;
class LoopContextPass extends CodeCleanerPass
{
    private $loopDepth;
    public function beforeTraverse(array $nodes)
    {
        $this->loopDepth = 0;
    }
    public function enterNode(Node $node)
    {
        switch (\true) {
            case $node instanceof Do_:
            case $node instanceof For_:
            case $node instanceof Foreach_:
            case $node instanceof Switch_:
            case $node instanceof While_:
                $this->loopDepth++;
                break;
            case $node instanceof Break_:
            case $node instanceof Continue_:
                $operator = $node instanceof Break_ ? 'break' : 'continue';
                if ($this->loopDepth === 0) {
                    $msg = \sprintf("'%s' not in the 'loop' or 'switch' context", $operator);
                    throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                }
                if ($node->num instanceof LNumber || $node->num instanceof DNumber) {
                    $num = $node->num->value;
                    if ($node->num instanceof DNumber || $num < 1) {
                        $msg = \sprintf("'%s' operator accepts only positive numbers", $operator);
                        throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                    }
                    if ($num > $this->loopDepth) {
                        $msg = \sprintf("Cannot '%s' %d levels", $operator, $num);
                        throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                    }
                } elseif ($node->num) {
                    $msg = \sprintf("'%s' operator with non-constant operand is no longer supported", $operator);
                    throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                }
                break;
        }
    }
    public function leaveNode(Node $node)
    {
        switch (\true) {
            case $node instanceof Do_:
            case $node instanceof For_:
            case $node instanceof Foreach_:
            case $node instanceof Switch_:
            case $node instanceof While_:
                $this->loopDepth--;
                break;
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\NodeVisitorAbstract;
abstract class CodeCleanerPass extends NodeVisitorAbstract
{
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\Psy\Exception\FatalErrorException;
class FinalClassPass extends CodeCleanerPass
{
    private $finalClasses;
    public function beforeTraverse(array $nodes)
    {
        $this->finalClasses = [];
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof Class_) {
            if ($node->extends) {
                $extends = (string) $node->extends;
                if ($this->isFinalClass($extends)) {
                    $msg = \sprintf('Class %s may not inherit from final class (%s)', $node->name, $extends);
                    throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
                }
            }
            if ($node->isFinal()) {
                $this->finalClasses[\strtolower($node->name)] = \true;
            }
        }
    }
    private function isFinalClass(string $name) : bool
    {
        if (!\class_exists($name)) {
            return isset($this->finalClasses[\strtolower($name)]);
        }
        $refl = new \ReflectionClass($name);
        return $refl->isFinal();
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Scalar\MagicConst\Dir;
use Cvphar\PhpParser\Node\Scalar\MagicConst\File;
use Cvphar\PhpParser\Node\Scalar\String_;
class MagicConstantsPass extends CodeCleanerPass
{
    public function enterNode(Node $node)
    {
        if ($node instanceof Dir) {
            return new FuncCall(new Name('getcwd'), [], $node->getAttributes());
        } elseif ($node instanceof File) {
            return new String_('', $node->getAttributes());
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Scalar\LNumber;
use Cvphar\PhpParser\Node\Stmt\Declare_;
use Cvphar\PhpParser\Node\Stmt\DeclareDeclare;
use Cvphar\Psy\Exception\FatalErrorException;
class StrictTypesPass extends CodeCleanerPass
{
    const EXCEPTION_MESSAGE = 'strict_types declaration must have 0 or 1 as its value';
    private $strictTypes = \false;
    public function beforeTraverse(array $nodes)
    {
        $prependStrictTypes = $this->strictTypes;
        foreach ($nodes as $node) {
            if ($node instanceof Declare_) {
                foreach ($node->declares as $declare) {
                    $declareKey = $declare->key instanceof Identifier ? $declare->key->toString() : $declare->key;
                    if ($declareKey === 'strict_types') {
                        $value = $declare->value;
                        if (!$value instanceof LNumber || $value->value !== 0 && $value->value !== 1) {
                            throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, \E_ERROR, null, $node->getLine());
                        }
                        $this->strictTypes = $value->value === 1;
                    }
                }
            }
        }
        if ($prependStrictTypes) {
            $first = \reset($nodes);
            if (!$first instanceof Declare_) {
                $declare = new Declare_([new DeclareDeclare('strict_types', new LNumber(1))]);
                \array_unshift($nodes, $declare);
            }
        }
        return $nodes;
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Array_;
use Cvphar\PhpParser\Node\Expr\BinaryOp;
use Cvphar\PhpParser\Node\Expr\ClassConstFetch;
use Cvphar\PhpParser\Node\Expr\ConstFetch;
use Cvphar\PhpParser\Node\Expr\Instanceof_;
use Cvphar\PhpParser\Node\Scalar;
use Cvphar\PhpParser\Node\Scalar\Encapsed;
use Cvphar\Psy\Exception\FatalErrorException;
class InstanceOfPass extends CodeCleanerPass
{
    const EXCEPTION_MSG = 'instanceof expects an object instance, constant given';
    private $atLeastPhp73;
    public function __construct()
    {
        $this->atLeastPhp73 = \version_compare(\PHP_VERSION, '7.3', '>=');
    }
    public function enterNode(Node $node)
    {
        if ($this->atLeastPhp73) {
            return;
        }
        if (!$node instanceof Instanceof_) {
            return;
        }
        if ($node->expr instanceof Scalar && !$node->expr instanceof Encapsed || $node->expr instanceof BinaryOp || $node->expr instanceof Array_ || $node->expr instanceof ConstFetch || $node->expr instanceof ClassConstFetch) {
            throw new FatalErrorException(self::EXCEPTION_MSG, 0, \E_ERROR, null, $node->getLine());
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\ConstFetch;
use Cvphar\PhpParser\Node\Expr\FuncCall;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Stmt\Class_;
use Cvphar\PhpParser\Node\Stmt\Trait_;
use Cvphar\PhpParser\Node\VariadicPlaceholder;
use Cvphar\Psy\Exception\ErrorException;
class CalledClassPass extends CodeCleanerPass
{
    private $inClass;
    public function beforeTraverse(array $nodes)
    {
        $this->inClass = \false;
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof Class_ || $node instanceof Trait_) {
            $this->inClass = \true;
        } elseif ($node instanceof FuncCall && !$this->inClass) {
            if (!empty($node->args) && !$this->isNull($node->args[0])) {
                return;
            }
            if (!$node->name instanceof Name) {
                return;
            }
            $name = \strtolower($node->name);
            if (\in_array($name, ['get_class', 'get_called_class'])) {
                $msg = \sprintf('%s() called without object from outside a class', $name);
                throw new ErrorException($msg, 0, \E_USER_WARNING, null, $node->getLine());
            }
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof Class_) {
            $this->inClass = \false;
        }
    }
    private function isNull(Node $node) : bool
    {
        if ($node instanceof VariadicPlaceholder) {
            return \false;
        }
        return $node->value instanceof ConstFetch && \strtolower($node->value->name) === 'null';
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\ArrayDimFetch;
use Cvphar\PhpParser\Node\Expr\Isset_;
use Cvphar\PhpParser\Node\Expr\NullsafePropertyFetch;
use Cvphar\PhpParser\Node\Expr\PropertyFetch;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\Psy\Exception\FatalErrorException;
class IssetPass extends CodeCleanerPass
{
    const EXCEPTION_MSG = 'Cannot use isset() on the result of an expression (you can use "null !== expression" instead)';
    public function enterNode(Node $node)
    {
        if (!$node instanceof Isset_) {
            return;
        }
        foreach ($node->vars as $var) {
            if (!$var instanceof Variable && !$var instanceof ArrayDimFetch && !$var instanceof PropertyFetch && !$var instanceof NullsafePropertyFetch) {
                throw new FatalErrorException(self::EXCEPTION_MSG, 0, \E_ERROR, null, $node->getLine());
            }
        }
    }
}
<?php

namespace Cvphar\Psy\CodeCleaner;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Expr\Yield_;
use Cvphar\PhpParser\Node\FunctionLike;
use Cvphar\Psy\Exception\FatalErrorException;
class FunctionContextPass extends CodeCleanerPass
{
    private $functionDepth;
    public function beforeTraverse(array $nodes)
    {
        $this->functionDepth = 0;
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth++;
            return;
        }
        if ($this->functionDepth !== 0) {
            return;
        }
        if ($node instanceof Yield_) {
            $msg = 'The "yield" expression can only be used inside a function';
            throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine());
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth--;
        }
    }
}
<?php

namespace Cvphar\Psy\Readline;

/**
 * Hoa\Console Readline implementation.
 *
 * @deprecated, use Userland readline
 */
class HoaConsole extends Userland
{
}
<?php

namespace Cvphar\Psy\Readline;

class GNUReadline implements Readline
{
    protected $historyFile;
    protected $historySize;
    protected $eraseDups;
    public static function isSupported() : bool
    {
        return \function_exists('readline') && \function_exists('readline_list_history');
    }
    public static function supportsBracketedPaste() : bool
    {
        return self::isSupported() && \stripos(\readline_info('library_version') ?: '', 'editline') === \false;
    }
    public function __construct($historyFile = null, $historySize = 0, $eraseDups = \false)
    {
        $this->historyFile = $historyFile !== null ? $historyFile : \false;
        $this->historySize = $historySize;
        $this->eraseDups = $eraseDups;
        \readline_info('readline_name', 'psysh');
    }
    public function addHistory(string $line) : bool
    {
        if ($res = \readline_add_history($line)) {
            $this->writeHistory();
        }
        return $res;
    }
    public function clearHistory() : bool
    {
        if ($res = \readline_clear_history()) {
            $this->writeHistory();
        }
        return $res;
    }
    public function listHistory() : array
    {
        return \readline_list_history();
    }
    public function readHistory() : bool
    {
        \readline_read_history();
        \readline_clear_history();
        return \readline_read_history($this->historyFile);
    }
    public function readline(string $prompt = null)
    {
        return \readline($prompt);
    }
    public function redisplay()
    {
        \readline_redisplay();
    }
    public function writeHistory() : bool
    {
        if ($this->historyFile !== \false) {
            $res = \readline_write_history($this->historyFile);
        } else {
            $res = \true;
        }
        if (!$res || !$this->eraseDups && !$this->historySize > 0) {
            return $res;
        }
        $hist = $this->listHistory();
        if (!$hist) {
            return \true;
        }
        if ($this->eraseDups) {
            $hist = \array_flip(\array_flip($hist));
            \ksort($hist);
        }
        if ($this->historySize > 0) {
            $histsize = \count($hist);
            if ($histsize > $this->historySize) {
                $hist = \array_slice($hist, $histsize - $this->historySize);
            }
        }
        \readline_clear_history();
        foreach ($hist as $line) {
            \readline_add_history($line);
        }
        if ($this->historyFile !== \false) {
            return \readline_write_history($this->historyFile);
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy\Readline;

interface Readline
{
    public function __construct($historyFile = null, $historySize = 0, $eraseDups = \false);
    public static function isSupported() : bool;
    public static function supportsBracketedPaste() : bool;
    public function addHistory(string $line) : bool;
    public function clearHistory() : bool;
    public function listHistory() : array;
    public function readHistory() : bool;
    public function readline(string $prompt = null);
    public function redisplay();
    public function writeHistory() : bool;
}
<?php

namespace Cvphar\Psy\Readline;

use Cvphar\Psy\Exception\BreakException;
class Transient implements Readline
{
    private $history;
    private $historySize;
    private $eraseDups;
    private $stdin;
    public static function isSupported() : bool
    {
        return \true;
    }
    public static function supportsBracketedPaste() : bool
    {
        return \false;
    }
    public function __construct($historyFile = null, $historySize = 0, $eraseDups = \false)
    {
        $this->history = [];
        $this->historySize = $historySize;
        $this->eraseDups = $eraseDups;
    }
    public function addHistory(string $line) : bool
    {
        if ($this->eraseDups) {
            if (($key = \array_search($line, $this->history)) !== \false) {
                unset($this->history[$key]);
            }
        }
        $this->history[] = $line;
        if ($this->historySize > 0) {
            $histsize = \count($this->history);
            if ($histsize > $this->historySize) {
                $this->history = \array_slice($this->history, $histsize - $this->historySize);
            }
        }
        $this->history = \array_values($this->history);
        return \true;
    }
    public function clearHistory() : bool
    {
        $this->history = [];
        return \true;
    }
    public function listHistory() : array
    {
        return $this->history;
    }
    public function readHistory() : bool
    {
        return \true;
    }
    public function readline(string $prompt = null)
    {
        echo $prompt;
        return \rtrim(\fgets($this->getStdin()), "\n\r");
    }
    public function redisplay()
    {
    }
    public function writeHistory() : bool
    {
        return \true;
    }
    private function getStdin()
    {
        if (!isset($this->stdin)) {
            $this->stdin = \fopen('php://stdin', 'r');
        }
        if (\feof($this->stdin)) {
            throw new BreakException('Ctrl+D');
        }
        return $this->stdin;
    }
}
<?php

namespace Cvphar\Psy\Readline;

use Cvphar\Psy\Exception\BreakException;
use Cvphar\Psy\Readline\Hoa\Console as HoaConsole;
use Cvphar\Psy\Readline\Hoa\ConsoleCursor as HoaConsoleCursor;
use Cvphar\Psy\Readline\Hoa\ConsoleInput as HoaConsoleInput;
use Cvphar\Psy\Readline\Hoa\ConsoleOutput as HoaConsoleOutput;
use Cvphar\Psy\Readline\Hoa\ConsoleTput as HoaConsoleTput;
use Cvphar\Psy\Readline\Hoa\Readline as HoaReadline;
use Cvphar\Psy\Readline\Hoa\Ustring as HoaUstring;
class Userland implements Readline
{
    private $hoaReadline;
    private $lastPrompt;
    private $tput;
    private $input;
    private $output;
    public static function isSupported() : bool
    {
        static::bootstrapHoa();
        return HoaUstring::checkMbString() && HoaConsoleTput::isSupported();
    }
    public static function supportsBracketedPaste() : bool
    {
        return \false;
    }
    public function __construct($historyFile = null, $historySize = 0, $eraseDups = \false)
    {
        static::bootstrapHoa(\true);
        $this->hoaReadline = new HoaReadline();
        $this->hoaReadline->addMapping('\\C-l', function () {
            $this->redisplay();
            return HoaReadline::STATE_NO_ECHO;
        });
        $this->tput = new HoaConsoleTput();
        HoaConsole::setTput($this->tput);
        $this->input = new HoaConsoleInput();
        HoaConsole::setInput($this->input);
        $this->output = new HoaConsoleOutput();
        HoaConsole::setOutput($this->output);
    }
    public static function bootstrapHoa(bool $withTerminalResize = \false)
    {
        \class_exists('Cvphar\\Psy\\Readline\\Hoa\\ProtocolWrapper');
        \class_exists('Cvphar\\Psy\\Readline\\Hoa\\Stream');
        $withTerminalResize && \class_exists('Cvphar\\Psy\\Readline\\Hoa\\ConsoleWindow');
    }
    public function addHistory(string $line) : bool
    {
        $this->hoaReadline->addHistory($line);
        return \true;
    }
    public function clearHistory() : bool
    {
        $this->hoaReadline->clearHistory();
        return \true;
    }
    public function listHistory() : array
    {
        $i = 0;
        $list = [];
        while (($item = $this->hoaReadline->getHistory($i++)) !== null) {
            $list[] = $item;
        }
        return $list;
    }
    public function readHistory() : bool
    {
        return \true;
    }
    public function readline(string $prompt = null)
    {
        $this->lastPrompt = $prompt;
        return $this->hoaReadline->readLine($prompt);
    }
    public function redisplay()
    {
        $currentLine = $this->hoaReadline->getLine();
        HoaConsoleCursor::clear('all');
        echo $this->lastPrompt, $currentLine;
    }
    public function writeHistory() : bool
    {
        return \true;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class AutocompleterWord implements Autocompleter
{
    protected $_words = null;
    public function __construct(array $words)
    {
        $this->setWords($words);
    }
    public function complete(&$prefix)
    {
        $out = [];
        $length = \mb_strlen($prefix);
        foreach ($this->getWords() as $word) {
            if (\mb_substr($word, 0, $length) === $prefix) {
                $out[] = $word;
            }
        }
        if (empty($out)) {
            return null;
        }
        if (1 === \count($out)) {
            return $out[0];
        }
        return $out;
    }
    public function getWordDefinition() : string
    {
        return '\\b\\w+';
    }
    public function setWords(array $words)
    {
        $old = $this->_words;
        $this->_words = $words;
        return $old;
    }
    public function getWords() : array
    {
        return $this->_words;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamIn extends IStream
{
    public function eof() : bool;
    public function read(int $length);
    public function readString(int $length);
    public function readCharacter();
    public function readBoolean();
    public function readInteger(int $length = 1);
    public function readFloat(int $length = 1);
    public function readArray();
    public function readLine();
    public function readAll(int $offset = 0);
    public function scanf(string $format) : array;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Ustring
{
    public static function checkMbString() : bool
    {
        return \function_exists('mb_substr');
    }
    public static function getCharWidth(string $char) : int
    {
        $char = (string) $char;
        $c = static::toCode($char);
        if (0x0 === $c) {
            return 0;
        }
        if (0x20 > $c || 0x7f <= $c && $c < 0xa0) {
            return -1;
        }
        if (0xad !== $c && 0 !== \preg_match('#^[\\p{Mn}\\p{Me}\\p{Cf}\\x{1160}-\\x{11ff}\\x{200b}]#u', $char)) {
            return 0;
        }
        return 1 + (0x1100 <= $c && (0x115f >= $c || 0x2329 === $c || 0x232a === $c || 0x2e80 <= $c && 0xa4cf >= $c && 0x303f !== $c || 0xac00 <= $c && 0xd7a3 >= $c || 0xf900 <= $c && 0xfaff >= $c || 0xfe10 <= $c && 0xfe19 >= $c || 0xfe30 <= $c && 0xfe6f >= $c || 0xff00 <= $c && 0xff60 >= $c || 0xffe0 <= $c && 0xffe6 >= $c || 0x20000 <= $c && 0x2fffd >= $c || 0x30000 <= $c && 0x3fffd >= $c));
    }
    public static function isCharPrintable(string $char) : bool
    {
        return 1 <= static::getCharWidth($char);
    }
    public static function toCode(string $char) : int
    {
        $char = (string) $char;
        $code = \ord($char[0]);
        $bytes = 1;
        if (!($code & 0x80)) {
            return $code;
        }
        if (($code & 0xe0) === 0xc0) {
            $bytes = 2;
            $code = $code & ~0xc0;
        } elseif (($code & 0xf0) === 0xe0) {
            $bytes = 3;
            $code = $code & ~0xe0;
        } elseif (($code & 0xf8) === 0xf0) {
            $bytes = 4;
            $code = $code & ~0xf0;
        }
        for ($i = 2; $i <= $bytes; $i++) {
            $code = ($code << 6) + (\ord($char[$i - 1]) & ~0x80);
        }
        return $code;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class StreamContext
{
    protected $_id = null;
    protected $_context;
    protected static $_instances = [];
    protected function __construct($id)
    {
        $this->_id = $id;
        $this->_context = \stream_context_create();
        return;
    }
    public static function getInstance(string $id) : self
    {
        if (\false === static::contextExists($id)) {
            static::$_instances[$id] = new self($id);
        }
        return static::$_instances[$id];
    }
    public function getId() : string
    {
        return $this->_id;
    }
    public static function contextExists(string $id) : bool
    {
        return \array_key_exists($id, static::$_instances);
    }
    public function setOptions(array $options) : bool
    {
        return \stream_context_set_option($this->getContext(), $options);
    }
    public function setParameters(array $parameters) : bool
    {
        return \stream_context_set_params($this->getContext(), $parameters);
    }
    public function getOptions() : array
    {
        return \stream_context_get_options($this->getContext());
    }
    public function getParameters() : array
    {
        return \stream_context_get_params($this->getContext());
    }
    public function getContext()
    {
        return $this->_context;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class AutocompleterAggregate implements Autocompleter
{
    protected $_autocompleters = null;
    public function __construct(array $autocompleters)
    {
        $this->setAutocompleters($autocompleters);
        return;
    }
    public function complete(&$prefix)
    {
        foreach ($this->getAutocompleters() as $autocompleter) {
            $preg = \preg_match('#(' . $autocompleter->getWordDefinition() . ')$#u', $prefix, $match);
            if (0 === $preg) {
                continue;
            }
            $_prefix = $match[0];
            if (null === ($out = $autocompleter->complete($_prefix))) {
                continue;
            }
            $prefix = $_prefix;
            return $out;
        }
        return null;
    }
    protected function setAutocompleters(array $autocompleters)
    {
        $old = $this->_autocompleters;
        $this->_autocompleters = new \ArrayObject($autocompleters);
        return $old;
    }
    public function getAutocompleters()
    {
        return $this->_autocompleters;
    }
    public function getWordDefinition() : string
    {
        return '.*';
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Event
{
    const KEY_EVENT = 0;
    const KEY_SOURCE = 1;
    private static $_register = [];
    protected $_callable = [];
    private function __construct()
    {
        return;
    }
    public static function getEvent(string $eventId) : self
    {
        if (!isset(self::$_register[$eventId][self::KEY_EVENT])) {
            self::$_register[$eventId] = [self::KEY_EVENT => new self(), self::KEY_SOURCE => null];
        }
        return self::$_register[$eventId][self::KEY_EVENT];
    }
    public static function register(string $eventId, $source)
    {
        if (\true === self::eventExists($eventId)) {
            throw new EventException('Cannot redeclare an event with the same ID, i.e. the event ' . 'ID %s already exists.', 0, $eventId);
        }
        if (\is_object($source) && !$source instanceof EventSource) {
            throw new EventException('The source must implement \\Hoa\\Event\\Source ' . 'interface; given %s.', 1, \get_class($source));
        } else {
            $reflection = new \ReflectionClass($source);
            if (\false === $reflection->implementsInterface('Cvphar\\Psy\\Readline\\Hoa\\EventSource')) {
                throw new EventException('The source must implement \\Hoa\\Event\\Source ' . 'interface; given %s.', 2, $source);
            }
        }
        if (!isset(self::$_register[$eventId][self::KEY_EVENT])) {
            self::$_register[$eventId][self::KEY_EVENT] = new self();
        }
        self::$_register[$eventId][self::KEY_SOURCE] = $source;
    }
    public static function unregister(string $eventId, bool $hard = \false)
    {
        if (\false !== $hard) {
            unset(self::$_register[$eventId]);
        } else {
            self::$_register[$eventId][self::KEY_SOURCE] = null;
        }
    }
    public function attach($callable) : self
    {
        $callable = Xcallable::from($callable);
        $this->_callable[$callable->getHash()] = $callable;
        return $this;
    }
    public function detach($callable) : self
    {
        unset($this->_callable[Xcallable::from($callable)->getHash()]);
        return $this;
    }
    public function isListened() : bool
    {
        return !empty($this->_callable);
    }
    public static function notify(string $eventId, EventSource $source, EventBucket $data)
    {
        if (\false === self::eventExists($eventId)) {
            throw new EventException('Event ID %s does not exist, cannot send notification.', 3, $eventId);
        }
        $data->setSource($source);
        $event = self::getEvent($eventId);
        foreach ($event->_callable as $callable) {
            $callable($data);
        }
    }
    public static function eventExists(string $eventId) : bool
    {
        return \array_key_exists($eventId, self::$_register) && self::$_register[$eventId][self::KEY_SOURCE] !== null;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class EventListener
{
    protected $_source = null;
    protected $_callables = [];
    public function __construct(EventListenable $source, array $ids)
    {
        $this->_source = $source;
        $this->addIds($ids);
        return;
    }
    public function addIds(array $ids)
    {
        foreach ($ids as $id) {
            $this->_callables[$id] = [];
        }
    }
    public function attach(string $listenerId, $callable) : self
    {
        if (\false === $this->listenerExists($listenerId)) {
            throw new EventException('Cannot listen %s because it is not defined.', 0, $listenerId);
        }
        $callable = Xcallable::from($callable);
        $this->_callables[$listenerId][$callable->getHash()] = $callable;
        return $this;
    }
    public function detach(string $listenerId, $callable) : self
    {
        unset($this->_callables[$listenerId][Xcallable::from($callable)->getHash()]);
        return $this;
    }
    public function detachAll(string $listenerId) : self
    {
        unset($this->_callables[$listenerId]);
        return $this;
    }
    public function listenerExists(string $listenerId) : bool
    {
        return \array_key_exists($listenerId, $this->_callables);
    }
    public function fire(string $listenerId, EventBucket $data) : array
    {
        if (\false === $this->listenerExists($listenerId)) {
            throw new EventException('Cannot fire on %s because it is not defined.', 1, $listenerId);
        }
        $data->setSource($this->_source);
        $out = [];
        foreach ($this->_callables[$listenerId] as $callable) {
            $out[] = $callable($data);
        }
        return $out;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Xcallable
{
    protected $_callback = null;
    protected $_hash = null;
    public function __construct($call, $able = '')
    {
        if ($call instanceof \Closure) {
            $this->_callback = $call;
            return;
        }
        if (!\is_string($able)) {
            throw new Exception('Bad callback form; the able part must be a string.', 0);
        }
        if ('' === $able) {
            if (\is_string($call)) {
                if (\false === \strpos($call, '::')) {
                    if (!\function_exists($call)) {
                        throw new Exception('Bad callback form; function %s does not exist.', 1, $call);
                    }
                    $this->_callback = $call;
                    return;
                }
                list($call, $able) = \explode('::', $call);
            } elseif (\is_object($call)) {
                if ($call instanceof StreamOut) {
                    $able = null;
                } elseif (\method_exists($call, '__invoke')) {
                    $able = '__invoke';
                } else {
                    throw new Exception('Bad callback form; an object but without a known ' . 'method.', 2);
                }
            } elseif (\is_array($call) && isset($call[0])) {
                if (!isset($call[1])) {
                    $this->__construct($call[0]);
                    return;
                }
                $this->__construct($call[0], $call[1]);
                return;
            } else {
                throw new Exception('Bad callback form.', 3);
            }
        }
        $this->_callback = [$call, $able];
        return;
    }
    public function __invoke(...$arguments)
    {
        $callback = $this->getValidCallback($arguments);
        return $callback(...$arguments);
    }
    public function getValidCallback(array &$arguments = [])
    {
        $callback = $this->_callback;
        $head = null;
        if (isset($arguments[0])) {
            $head =& $arguments[0];
        }
        if (null !== $head && \is_array($callback) && null === $callback[1]) {
            if ($head instanceof EventBucket) {
                $head = $head->getData();
            }
            switch ($type = \gettype($head)) {
                case 'string':
                    if (1 === \strlen($head)) {
                        $method = 'writeCharacter';
                    } else {
                        $method = 'writeString';
                    }
                    break;
                case 'boolean':
                case 'integer':
                case 'array':
                    $method = 'write' . \ucfirst($type);
                    break;
                case 'double':
                    $method = 'writeFloat';
                    break;
                default:
                    $method = 'writeAll';
                    $head = $head . "\n";
            }
            $callback[1] = $method;
        }
        return $callback;
    }
    public function getHash() : string
    {
        if (null !== $this->_hash) {
            return $this->_hash;
        }
        $_ =& $this->_callback;
        if (\is_string($_)) {
            return $this->_hash = 'function#' . $_;
        }
        if (\is_array($_)) {
            return $this->_hash = (\is_object($_[0]) ? 'object(' . \spl_object_hash($_[0]) . ')' . '#' . \get_class($_[0]) : 'class#' . $_[0]) . '::' . (null !== $_[1] ? $_[1] : '???');
        }
        return $this->_hash = 'closure(' . \spl_object_hash($_) . ')';
    }
    public function __toString() : string
    {
        return $this->getHash();
    }
    public static function from($call, $able = '')
    {
        if ($call instanceof self) {
            return $call;
        }
        return new self($call, $able);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Protocol extends ProtocolNode
{
    /**
    @const
    */
    const NO_RESOLUTION = '/hoa/flatland';
    private static $_instance = null;
    private static $_cache = [];
    public function __construct()
    {
        $this->initialize();
        return;
    }
    public static function getInstance() : self
    {
        if (null === static::$_instance) {
            static::$_instance = new self();
        }
        return static::$_instance;
    }
    protected function initialize()
    {
        $root = \dirname(__DIR__, 3);
        $argv0 = \realpath($_SERVER['argv'][0]);
        $cwd = 'cli' === \PHP_SAPI ? \false !== $argv0 ? \dirname($argv0) : '' : \getcwd();
        $this[] = new ProtocolNode('Application', $cwd . \DIRECTORY_SEPARATOR, [new ProtocolNode('Public', 'Public' . \DIRECTORY_SEPARATOR)]);
        $this[] = new ProtocolNode('Data', \dirname($cwd) . \DIRECTORY_SEPARATOR, [new ProtocolNode('Etc', 'Etc' . \DIRECTORY_SEPARATOR, [new ProtocolNode('Configuration', 'Configuration' . \DIRECTORY_SEPARATOR), new ProtocolNode('Locale', 'Locale' . \DIRECTORY_SEPARATOR)]), new ProtocolNode('Lost+found', 'Lost+found' . \DIRECTORY_SEPARATOR), new ProtocolNode('Temporary', 'Temporary' . \DIRECTORY_SEPARATOR), new ProtocolNode('Variable', 'Variable' . \DIRECTORY_SEPARATOR, [new ProtocolNode('Cache', 'Cache' . \DIRECTORY_SEPARATOR), new ProtocolNode('Database', 'Database' . \DIRECTORY_SEPARATOR), new ProtocolNode('Log', 'Log' . \DIRECTORY_SEPARATOR), new ProtocolNode('Private', 'Private' . \DIRECTORY_SEPARATOR), new ProtocolNode('Run', 'Run' . \DIRECTORY_SEPARATOR), new ProtocolNode('Test', 'Test' . \DIRECTORY_SEPARATOR)])]);
        $this[] = new ProtocolNodeLibrary('Library', $root . \DIRECTORY_SEPARATOR . 'Hoathis' . \DIRECTORY_SEPARATOR . ';' . $root . \DIRECTORY_SEPARATOR . 'Hoa' . \DIRECTORY_SEPARATOR);
    }
    public function resolve(string $path, bool $exists = \true, bool $unfold = \false)
    {
        if (\substr($path, 0, 6) !== 'hoa://') {
            if (\true === \is_dir($path)) {
                $path = \rtrim($path, '/\\');
                if ('' === $path) {
                    $path = '/';
                }
            }
            return $path;
        }
        if (isset(self::$_cache[$path])) {
            $handle = self::$_cache[$path];
        } else {
            $out = $this->_resolve($path, $handle);
            if (!\is_array($handle)) {
                return $out;
            }
            $handle = \array_values(\array_unique($handle, \SORT_REGULAR));
            foreach ($handle as &$entry) {
                if (\true === \is_dir($entry)) {
                    $entry = \rtrim($entry, '/\\');
                    if ('' === $entry) {
                        $entry = '/';
                    }
                }
            }
            self::$_cache[$path] = $handle;
        }
        if (\true === $unfold) {
            if (\true !== $exists) {
                return $handle;
            }
            $out = [];
            foreach ($handle as $solution) {
                if (\file_exists($solution)) {
                    $out[] = $solution;
                }
            }
            return $out;
        }
        if (\true !== $exists) {
            return $handle[0];
        }
        foreach ($handle as $solution) {
            if (\file_exists($solution)) {
                return $solution;
            }
        }
        return static::NO_RESOLUTION;
    }
    public static function clearCache()
    {
        self::$_cache = [];
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface Autocompleter
{
    public function complete(&$prefix);
    public function getWordDefinition() : string;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileFinder implements \IteratorAggregate
{
    protected $_splFileInfo = \SplFileInfo::class;
    protected $_paths = [];
    protected $_maxDepth = -1;
    protected $_filters = [];
    protected $_flags = -1;
    protected $_types = [];
    protected $_first = -1;
    protected $_sorts = [];
    public function __construct()
    {
        $this->_flags = IteratorFileSystem::KEY_AS_PATHNAME | IteratorFileSystem::CURRENT_AS_FILEINFO | IteratorFileSystem::SKIP_DOTS;
        $this->_first = \RecursiveIteratorIterator::SELF_FIRST;
        return;
    }
    public function in($paths) : self
    {
        if (!\is_array($paths)) {
            $paths = [$paths];
        }
        foreach ($paths as $path) {
            if (1 === \preg_match('/[\\*\\?\\[\\]]/', $path)) {
                $iterator = new \CallbackFilterIterator(new \GlobIterator(\rtrim($path, \DIRECTORY_SEPARATOR)), function ($current) {
                    return $current->isDir();
                });
                foreach ($iterator as $fileInfo) {
                    $this->_paths[] = $fileInfo->getPathname();
                }
            } else {
                $this->_paths[] = $path;
            }
        }
        return $this;
    }
    public function maxDepth(int $depth) : self
    {
        $this->_maxDepth = $depth;
        return $this;
    }
    public function files() : self
    {
        $this->_types[] = 'file';
        return $this;
    }
    public function directories() : self
    {
        $this->_types[] = 'dir';
        return $this;
    }
    public function links() : self
    {
        $this->_types[] = 'link';
        return $this;
    }
    public function followSymlinks(bool $flag = \true) : self
    {
        if (\true === $flag) {
            $this->_flags ^= IteratorFileSystem::FOLLOW_SYMLINKS;
        } else {
            $this->_flags |= IteratorFileSystem::FOLLOW_SYMLINKS;
        }
        return $this;
    }
    public function name(string $regex) : self
    {
        $this->_filters[] = function (\SplFileInfo $current) use($regex) {
            return 0 !== \preg_match($regex, $current->getBasename());
        };
        return $this;
    }
    public function notIn(string $regex) : self
    {
        $this->_filters[] = function (\SplFileInfo $current) use($regex) {
            foreach (\explode(\DIRECTORY_SEPARATOR, $current->getPathname()) as $part) {
                if (0 !== \preg_match($regex, $part)) {
                    return \false;
                }
            }
            return \true;
        };
        return $this;
    }
    public function size(string $size) : self
    {
        if (0 === \preg_match('#^(<|<=|>|>=|=)\\s*(\\d+)\\s*((?:[KMGTPEZY])b)?$#', $size, $matches)) {
            return $this;
        }
        $number = (float) $matches[2];
        $unit = $matches[3] ?? 'b';
        $operator = $matches[1];
        switch ($unit) {
            case 'b':
                break;
            case 'Kb':
                $number <<= 10;
                break;
            case 'Mb':
                $number <<= 20;
                break;
            case 'Gb':
                $number <<= 30;
                break;
            case 'Tb':
                $number *= 1099511627776;
                break;
            case 'Pb':
                $number *= 1024 ** 5;
                break;
            case 'Eb':
                $number *= 1024 ** 6;
                break;
            case 'Zb':
                $number *= 1024 ** 7;
                break;
            case 'Yb':
                $number *= 1024 ** 8;
                break;
        }
        $filter = null;
        switch ($operator) {
            case '<':
                $filter = function (\SplFileInfo $current) use($number) {
                    return $current->getSize() < $number;
                };
                break;
            case '<=':
                $filter = function (\SplFileInfo $current) use($number) {
                    return $current->getSize() <= $number;
                };
                break;
            case '>':
                $filter = function (\SplFileInfo $current) use($number) {
                    return $current->getSize() > $number;
                };
                break;
            case '>=':
                $filter = function (\SplFileInfo $current) use($number) {
                    return $current->getSize() >= $number;
                };
                break;
            case '=':
                $filter = function (\SplFileInfo $current) use($number) {
                    return $current->getSize() === $number;
                };
                break;
        }
        $this->_filters[] = $filter;
        return $this;
    }
    public function dots(bool $flag = \true) : self
    {
        if (\true === $flag) {
            $this->_flags ^= IteratorFileSystem::SKIP_DOTS;
        } else {
            $this->_flags |= IteratorFileSystem::SKIP_DOTS;
        }
        return $this;
    }
    public function owner(int $owner) : self
    {
        $this->_filters[] = function (\SplFileInfo $current) use($owner) {
            return $current->getOwner() === $owner;
        };
        return $this;
    }
    protected function formatDate(string $date, &$operator) : int
    {
        $operator = -1;
        if (0 === \preg_match('#\\bago\\b#', $date)) {
            $date .= ' ago';
        }
        if (0 !== \preg_match('#^(since|until)\\b(.+)$#', $date, $matches)) {
            $time = \strtotime($matches[2]);
            if ('until' === $matches[1]) {
                $operator = 1;
            }
        } else {
            $time = \strtotime($date);
        }
        return $time;
    }
    public function changed(string $date) : self
    {
        $time = $this->formatDate($date, $operator);
        if (-1 === $operator) {
            $this->_filters[] = function (\SplFileInfo $current) use($time) {
                return $current->getCTime() >= $time;
            };
        } else {
            $this->_filters[] = function (\SplFileInfo $current) use($time) {
                return $current->getCTime() < $time;
            };
        }
        return $this;
    }
    public function modified(string $date) : self
    {
        $time = $this->formatDate($date, $operator);
        if (-1 === $operator) {
            $this->_filters[] = function (\SplFileInfo $current) use($time) {
                return $current->getMTime() >= $time;
            };
        } else {
            $this->_filters[] = function (\SplFileInfo $current) use($time) {
                return $current->getMTime() < $time;
            };
        }
        return $this;
    }
    public function filter($callback) : self
    {
        $this->_filters[] = $callback;
        return $this;
    }
    public function sortByName(string $locale = 'root') : self
    {
        if (\true === \class_exists('Collator', \false)) {
            $collator = new \Collator($locale);
            $this->_sorts[] = function (\SplFileInfo $a, \SplFileInfo $b) use($collator) {
                return $collator->compare($a->getPathname(), $b->getPathname());
            };
        } else {
            $this->_sorts[] = function (\SplFileInfo $a, \SplFileInfo $b) {
                return \strcmp($a->getPathname(), $b->getPathname());
            };
        }
        return $this;
    }
    public function sortBySize() : self
    {
        $this->_sorts[] = function (\SplFileInfo $a, \SplFileInfo $b) {
            return $a->getSize() < $b->getSize();
        };
        return $this;
    }
    public function sort($callable) : self
    {
        $this->_sorts[] = $callable;
        return $this;
    }
    public function childFirst() : self
    {
        $this->_first = \RecursiveIteratorIterator::CHILD_FIRST;
        return $this;
    }
    public function getIterator()
    {
        $_iterator = new \AppendIterator();
        $types = $this->getTypes();
        if (!empty($types)) {
            $this->_filters[] = function (\SplFileInfo $current) use($types) {
                return \in_array($current->getType(), $types);
            };
        }
        $maxDepth = $this->getMaxDepth();
        $splFileInfo = $this->getSplFileInfo();
        foreach ($this->getPaths() as $path) {
            if (1 === $maxDepth) {
                $iterator = new \IteratorIterator(new IteratorRecursiveDirectory($path, $this->getFlags(), $splFileInfo), $this->getFirst());
            } else {
                $iterator = new \RecursiveIteratorIterator(new IteratorRecursiveDirectory($path, $this->getFlags(), $splFileInfo), $this->getFirst());
                if (1 < $maxDepth) {
                    $iterator->setMaxDepth($maxDepth - 1);
                }
            }
            $_iterator->append($iterator);
        }
        foreach ($this->getFilters() as $filter) {
            $_iterator = new \CallbackFilterIterator($_iterator, $filter);
        }
        $sorts = $this->getSorts();
        if (empty($sorts)) {
            return $_iterator;
        }
        $array = \iterator_to_array($_iterator);
        foreach ($sorts as $sort) {
            \uasort($array, $sort);
        }
        return new \ArrayIterator($array);
    }
    public function setSplFileInfo(string $splFileInfo) : string
    {
        $old = $this->_splFileInfo;
        $this->_splFileInfo = $splFileInfo;
        return $old;
    }
    public function getSplFileInfo() : string
    {
        return $this->_splFileInfo;
    }
    protected function getPaths() : array
    {
        return $this->_paths;
    }
    public function getMaxDepth() : int
    {
        return $this->_maxDepth;
    }
    public function getTypes() : array
    {
        return $this->_types;
    }
    protected function getFilters() : array
    {
        return $this->_filters;
    }
    protected function getSorts() : array
    {
        return $this->_sorts;
    }
    public function getFlags() : int
    {
        return $this->_flags;
    }
    public function getFirst() : int
    {
        return $this->_first;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ProtocolNode implements \ArrayAccess, \IteratorAggregate
{
    protected $_name = null;
    protected $_reach = null;
    private $_children = [];
    public function __construct(string $name = null, string $reach = null, array $children = [])
    {
        if (null !== $name) {
            $this->_name = $name;
        }
        if (null !== $reach) {
            $this->_reach = $reach;
        }
        foreach ($children as $child) {
            $this[] = $child;
        }
        return;
    }
    #[\ReturnTypeWillChange]
    public function offsetSet($name, $node)
    {
        if (!$node instanceof self) {
            throw new ProtocolException('Protocol node must extend %s.', 0, __CLASS__);
        }
        if (empty($name)) {
            $name = $node->getName();
        }
        if (empty($name)) {
            throw new ProtocolException('Cannot add a node to the `hoa://` protocol without a name.', 1);
        }
        $this->_children[$name] = $node;
    }
    public function offsetGet($name) : self
    {
        if (!isset($this[$name])) {
            throw new ProtocolException('Node %s does not exist.', 2, $name);
        }
        return $this->_children[$name];
    }
    public function offsetExists($name) : bool
    {
        return \true === \array_key_exists($name, $this->_children);
    }
    #[\ReturnTypeWillChange]
    public function offsetUnset($name)
    {
        unset($this->_children[$name]);
    }
    protected function _resolve(string $path, &$accumulator, string $id = null)
    {
        if (\substr($path, 0, 6) === 'hoa://') {
            $path = \substr($path, 6);
        }
        if (empty($path)) {
            return null;
        }
        if (null === $accumulator) {
            $accumulator = [];
            $posId = \strpos($path, '#');
            if (\false !== $posId) {
                $id = \substr($path, $posId + 1);
                $path = \substr($path, 0, $posId);
            } else {
                $id = null;
            }
        }
        $path = \trim($path, '/');
        $pos = \strpos($path, '/');
        if (\false !== $pos) {
            $next = \substr($path, 0, $pos);
        } else {
            $next = $path;
        }
        if (isset($this[$next])) {
            if (\false === $pos) {
                if (null === $id) {
                    $this->_resolveChoice($this[$next]->reach(), $accumulator);
                    return \true;
                }
                $accumulator = null;
                return $this[$next]->reachId($id);
            }
            $tnext = $this[$next];
            $this->_resolveChoice($tnext->reach(), $accumulator);
            return $tnext->_resolve(\substr($path, $pos + 1), $accumulator, $id);
        }
        $this->_resolveChoice($this->reach($path), $accumulator);
        return \true;
    }
    protected function _resolveChoice($reach, &$accumulator)
    {
        if (null === $reach) {
            $reach = '';
        }
        if (empty($accumulator)) {
            $accumulator = \explode(';', $reach);
            return;
        }
        if (\false === \strpos($reach, ';')) {
            if (\false !== ($pos = \strrpos($reach, "\r"))) {
                $reach = \substr($reach, $pos + 1);
                foreach ($accumulator as &$entry) {
                    $entry = null;
                }
            }
            foreach ($accumulator as &$entry) {
                $entry .= $reach;
            }
            return;
        }
        $choices = \explode(';', $reach);
        $ref = $accumulator;
        $accumulator = [];
        foreach ($choices as $choice) {
            if (\false !== ($pos = \strrpos($choice, "\r"))) {
                $choice = \substr($choice, $pos + 1);
                foreach ($ref as $entry) {
                    $accumulator[] = $choice;
                }
            } else {
                foreach ($ref as $entry) {
                    $accumulator[] = $entry . $choice;
                }
            }
        }
        unset($ref);
        return;
    }
    public function reach(string $queue = null)
    {
        return empty($queue) ? $this->_reach : $queue;
    }
    public function reachId(string $id)
    {
        throw new ProtocolException('The node %s has no ID support (tried to reach #%s).', 4, [$this->getName(), $id]);
    }
    public function setReach(string $reach)
    {
        $old = $this->_reach;
        $this->_reach = $reach;
        return $old;
    }
    public function getName()
    {
        return $this->_name;
    }
    protected function getReach()
    {
        return $this->_reach;
    }
    public function getIterator() : \ArrayIterator
    {
        return new \ArrayIterator($this->_children);
    }
    public static function getRoot() : Protocol
    {
        return Protocol::getInstance();
    }
    public function __toString() : string
    {
        static $i = 0;
        $out = \str_repeat('  ', $i) . $this->getName() . "\n";
        foreach ($this as $node) {
            ++$i;
            $out .= $node;
            --$i;
        }
        return $out;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ProtocolNodeLibrary extends ProtocolNode
{
    public function reach(string $queue = null)
    {
        $withComposer = \class_exists('Cvphar\\Composer\\Autoload\\ClassLoader', \false) || 'cli' === \PHP_SAPI && \file_exists(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'autoload.php');
        if ($withComposer) {
            return parent::reach($queue);
        }
        if (!empty($queue)) {
            $head = $queue;
            if (\false !== ($pos = \strpos($queue, '/'))) {
                $head = \substr($head, 0, $pos);
                $queue = \DIRECTORY_SEPARATOR . \substr($queue, $pos + 1);
            } else {
                $queue = null;
            }
            $out = [];
            foreach (\explode(';', $this->_reach) as $part) {
                $out[] = "\r" . $part . \strtolower($head) . $queue;
            }
            $out[] = "\r" . \dirname(__DIR__, 5) . $queue;
            return \implode(';', $out);
        }
        $out = [];
        foreach (\explode(';', $this->_reach) as $part) {
            $pos = \strrpos(\rtrim($part, \DIRECTORY_SEPARATOR), \DIRECTORY_SEPARATOR) + 1;
            $head = \substr($part, 0, $pos);
            $tail = \substr($part, $pos);
            $out[] = $head . \strtolower($tail);
        }
        $this->_reach = \implode(';', $out);
        return parent::reach($queue);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamStatable extends IStream
{
    const SIZE_UNDEFINED = -1;
    public function getSize() : int;
    public function getStatistic() : array;
    public function getATime() : int;
    public function getCTime() : int;
    public function getMTime() : int;
    public function getGroup() : int;
    public function getOwner() : int;
    public function getPermissions() : int;
    public function isReadable() : bool;
    public function isWritable() : bool;
    public function isExecutable() : bool;
    public function clearStatisticCache();
    public static function clearAllStatisticCaches();
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamBufferable extends IStream
{
    public function newBuffer($callable = null, int $size = null) : int;
    public function flush();
    public function deleteBuffer() : bool;
    public function getBufferLevel() : int;
    public function getBufferSize() : int;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileDoesNotExistException extends FileException
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class IteratorRecursiveDirectory extends \RecursiveDirectoryIterator
{
    protected $_splFileInfoClass = null;
    protected $_relativePath = null;
    public function __construct(string $path, int $flags = null, string $splFileInfoClass = null)
    {
        if (null === $flags) {
            parent::__construct($path);
        } else {
            parent::__construct($path, $flags);
        }
        $this->_relativePath = $path;
        $this->setSplFileInfoClass($splFileInfoClass);
        return;
    }
    #[\ReturnTypeWillChange]
    public function current()
    {
        $out = parent::current();
        if (null !== $this->_splFileInfoClass && $out instanceof \SplFileInfo) {
            $out->setInfoClass($this->_splFileInfoClass);
            $out = $out->getFileInfo();
            if ($out instanceof IteratorSplFileInfo) {
                $out->setRelativePath($this->getRelativePath());
            }
        }
        return $out;
    }
    #[\ReturnTypeWillChange]
    public function getChildren()
    {
        $out = parent::getChildren();
        $out->_relativePath = $this->getRelativePath();
        $out->setSplFileInfoClass($this->_splFileInfoClass);
        return $out;
    }
    public function setSplFileInfoClass($splFileInfoClass)
    {
        $this->_splFileInfoClass = $splFileInfoClass;
    }
    public function getRelativePath() : string
    {
        return $this->_relativePath;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

abstract class File extends FileGeneric implements StreamBufferable, StreamLockable, StreamPointable
{
    const MODE_READ = 'rb';
    const MODE_READ_WRITE = 'r+b';
    const MODE_TRUNCATE_WRITE = 'wb';
    const MODE_TRUNCATE_READ_WRITE = 'w+b';
    const MODE_APPEND_WRITE = 'ab';
    const MODE_APPEND_READ_WRITE = 'a+b';
    const MODE_CREATE_WRITE = 'xb';
    const MODE_CREATE_READ_WRITE = 'x+b';
    public function __construct(string $streamName, string $mode, string $context = null, bool $wait = \false)
    {
        $this->setMode($mode);
        switch ($streamName) {
            case '0':
                $streamName = 'php://stdin';
                break;
            case '1':
                $streamName = 'php://stdout';
                break;
            case '2':
                $streamName = 'php://stderr';
                break;
            default:
                if (\true === \ctype_digit($streamName)) {
                    if (\PHP_VERSION_ID >= 50306) {
                        $streamName = 'php://fd/' . $streamName;
                    } else {
                        throw new FileException('You need PHP5.3.6 to use a file descriptor ' . 'other than 0, 1 or 2 (tried %d with PHP%s).', 0, [$streamName, \PHP_VERSION]);
                    }
                }
        }
        parent::__construct($streamName, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        if (\substr($streamName, 0, 4) === 'file' && \false === \is_dir(\dirname($streamName))) {
            throw new FileException('Directory %s does not exist. Could not open file %s.', 1, [\dirname($streamName), \basename($streamName)]);
        }
        if (null === $context) {
            if (\false === ($out = @\fopen($streamName, $this->getMode(), \true))) {
                throw new FileException('Failed to open stream %s.', 2, $streamName);
            }
            return $out;
        }
        $out = @\fopen($streamName, $this->getMode(), \true, $context->getContext());
        if (\false === $out) {
            throw new FileException('Failed to open stream %s.', 3, $streamName);
        }
        return $out;
    }
    protected function _close() : bool
    {
        return @\fclose($this->getStream());
    }
    public function newBuffer($callable = null, int $size = null) : int
    {
        $this->setStreamBuffer($size);
        return 1;
    }
    public function flush() : bool
    {
        return \fflush($this->getStream());
    }
    public function deleteBuffer() : bool
    {
        return $this->disableStreamBuffer();
    }
    public function getBufferLevel() : int
    {
        return 1;
    }
    public function getBufferSize() : int
    {
        return $this->getStreamBufferSize();
    }
    public function lock(int $operation) : bool
    {
        return \flock($this->getStream(), $operation);
    }
    public function rewind() : bool
    {
        return \rewind($this->getStream());
    }
    public function seek(int $offset, int $whence = StreamPointable::SEEK_SET) : int
    {
        return \fseek($this->getStream(), $offset, $whence);
    }
    public function tell() : int
    {
        $stream = $this->getStream();
        if (null === $stream) {
            return 0;
        }
        return \ftell($stream);
    }
    public static function create(string $name)
    {
        if (\file_exists($name)) {
            return \true;
        }
        return \touch($name);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileRead extends File implements StreamIn
{
    public function __construct(string $streamName, string $mode = parent::MODE_READ, string $context = null, bool $wait = \false)
    {
        parent::__construct($streamName, $mode, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        static $createModes = [parent::MODE_READ];
        if (!\in_array($this->getMode(), $createModes)) {
            throw new FileException('Open mode are not supported; given %d. Only %s are supported.', 0, [$this->getMode(), \implode(', ', $createModes)]);
        }
        \preg_match('#^(\\w+)://#', $streamName, $match);
        if ((isset($match[1]) && $match[1] === 'file' || !isset($match[1])) && !\file_exists($streamName)) {
            throw new FileDoesNotExistException('File %s does not exist.', 1, $streamName);
        }
        $out = parent::_open($streamName, $context);
        return $out;
    }
    public function eof() : bool
    {
        return \feof($this->getStream());
    }
    public function read(int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 2, $length);
        }
        return \fread($this->getStream(), $length);
    }
    public function readString(int $length)
    {
        return $this->read($length);
    }
    public function readCharacter()
    {
        return \fgetc($this->getStream());
    }
    public function readBoolean()
    {
        return (bool) $this->read(1);
    }
    public function readInteger(int $length = 1)
    {
        return (int) $this->read($length);
    }
    public function readFloat(int $length = 1)
    {
        return (float) $this->read($length);
    }
    public function readArray(string $format = null)
    {
        return $this->scanf($format);
    }
    public function readLine()
    {
        return \fgets($this->getStream());
    }
    public function readAll(int $offset = 0)
    {
        return \stream_get_contents($this->getStream(), -1, $offset);
    }
    public function scanf(string $format) : array
    {
        return \fscanf($this->getStream(), $format);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleInput implements StreamIn
{
    protected $_input = null;
    public function __construct(StreamIn $input = null)
    {
        if (null === $input) {
            if (\defined('STDIN') && \false !== @\stream_get_meta_data(\STDIN)) {
                $input = new FileRead('php://stdin');
            } else {
                $input = new FileRead('/dev/tty');
            }
        }
        $this->_input = $input;
        return;
    }
    public function getStream() : StreamIn
    {
        return $this->_input;
    }
    public function eof() : bool
    {
        return $this->_input->eof();
    }
    public function read(int $length)
    {
        return $this->_input->read($length);
    }
    public function readString(int $length)
    {
        return $this->_input->readString($length);
    }
    public function readCharacter()
    {
        return $this->_input->readCharacter();
    }
    public function readBoolean()
    {
        return $this->_input->readBoolean();
    }
    public function readInteger(int $length = 1)
    {
        return $this->_input->readInteger($length);
    }
    public function readFloat(int $length = 1)
    {
        return $this->_input->readFloat($length);
    }
    public function readArray($argument = null)
    {
        return $this->_input->readArray($argument);
    }
    public function readLine()
    {
        return $this->_input->readLine();
    }
    public function readAll(int $offset = 0)
    {
        return $this->_input->readAll($offset);
    }
    public function scanf(string $format) : array
    {
        return $this->_input->scanf($format);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Readline
{
    const STATE_CONTINUE = 1;
    const STATE_BREAK = 2;
    const STATE_NO_ECHO = 4;
    protected $_line = null;
    protected $_lineCurrent = 0;
    protected $_lineLength = 0;
    protected $_buffer = null;
    protected $_mapping = [];
    protected $_history = [];
    protected $_historyCurrent = 0;
    protected $_historySize = 0;
    protected $_prefix = null;
    protected $_autocompleter = null;
    public function __construct()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        $this->_mapping["\x1b[A"] = [$this, '_bindArrowUp'];
        $this->_mapping["\x1b[B"] = [$this, '_bindArrowDown'];
        $this->_mapping["\x1b[C"] = [$this, '_bindArrowRight'];
        $this->_mapping["\x1b[D"] = [$this, '_bindArrowLeft'];
        $this->_mapping["\x01"] = [$this, '_bindControlA'];
        $this->_mapping["\x02"] = [$this, '_bindControlB'];
        $this->_mapping["\x05"] = [$this, '_bindControlE'];
        $this->_mapping["\x06"] = [$this, '_bindControlF'];
        $this->_mapping["\x08"] = $this->_mapping[""] = [$this, '_bindBackspace'];
        $this->_mapping["\x17"] = [$this, '_bindControlW'];
        $this->_mapping["\n"] = [$this, '_bindNewline'];
        $this->_mapping["\t"] = [$this, '_bindTab'];
        return;
    }
    public function readLine(string $prefix = null)
    {
        $input = Console::getInput();
        if (\true === $input->eof()) {
            return \false;
        }
        $direct = Console::isDirect($input->getStream()->getStream());
        $output = Console::getOutput();
        if (\false === $direct || \defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            $out = $input->readLine();
            if (\false === $out) {
                return \false;
            }
            $out = \substr($out, 0, -1);
            if (\true === $direct) {
                $output->writeAll($prefix);
            } else {
                $output->writeAll($prefix . $out . "\n");
            }
            return $out;
        }
        $this->resetLine();
        $this->setPrefix($prefix);
        $read = [$input->getStream()->getStream()];
        $write = $except = [];
        $output->writeAll($prefix);
        while (\true) {
            @\stream_select($read, $write, $except, 30, 0);
            if (empty($read)) {
                $read = [$input->getStream()->getStream()];
                continue;
            }
            $char = $this->_read();
            $this->_buffer = $char;
            $return = $this->_readLine($char);
            if (0 === ($return & self::STATE_NO_ECHO)) {
                $output->writeAll($this->_buffer);
            }
            if (0 !== ($return & self::STATE_BREAK)) {
                break;
            }
        }
        return $this->getLine();
    }
    public function _readLine(string $char)
    {
        if (isset($this->_mapping[$char]) && \is_callable($this->_mapping[$char])) {
            $mapping = $this->_mapping[$char];
            return $mapping($this);
        }
        if (isset($this->_mapping[$char])) {
            $this->_buffer = $this->_mapping[$char];
        } elseif (\false === Ustring::isCharPrintable($char)) {
            ConsoleCursor::bip();
            return static::STATE_CONTINUE | static::STATE_NO_ECHO;
        }
        if ($this->getLineLength() === $this->getLineCurrent()) {
            $this->appendLine($this->_buffer);
            return static::STATE_CONTINUE;
        }
        $this->insertLine($this->_buffer);
        $tail = \mb_substr($this->getLine(), $this->getLineCurrent() - 1);
        $this->_buffer = "\x1b[K" . $tail . \str_repeat("\x1b[D", \mb_strlen($tail) - 1);
        return static::STATE_CONTINUE;
    }
    public function addMappings(array $mappings)
    {
        foreach ($mappings as $key => $mapping) {
            $this->addMapping($key, $mapping);
        }
    }
    public function addMapping(string $key, $mapping)
    {
        if ('\\e[' === \substr($key, 0, 3)) {
            $this->_mapping["\x1b[" . \substr($key, 3)] = $mapping;
        } elseif ('\\C-' === \substr($key, 0, 3)) {
            $_key = \ord(\strtolower(\substr($key, 3))) - 96;
            $this->_mapping[\chr($_key)] = $mapping;
        } else {
            $this->_mapping[$key] = $mapping;
        }
    }
    public function addHistory(string $line = null)
    {
        if (empty($line)) {
            return;
        }
        $this->_history[] = $line;
        $this->_historyCurrent = $this->_historySize++;
    }
    public function clearHistory()
    {
        unset($this->_history);
        $this->_history = [];
        $this->_historyCurrent = 0;
        $this->_historySize = 1;
    }
    public function getHistory(int $i = null)
    {
        if (null === $i) {
            $i = $this->_historyCurrent;
        }
        if (!isset($this->_history[$i])) {
            return null;
        }
        return $this->_history[$i];
    }
    public function previousHistory()
    {
        if (0 >= $this->_historyCurrent) {
            return $this->getHistory(0);
        }
        return $this->getHistory($this->_historyCurrent--);
    }
    public function nextHistory()
    {
        if ($this->_historyCurrent + 1 >= $this->_historySize) {
            return $this->getLine();
        }
        return $this->getHistory(++$this->_historyCurrent);
    }
    public function getLine()
    {
        return $this->_line;
    }
    public function appendLine(string $append)
    {
        $this->_line .= $append;
        $this->_lineLength = \mb_strlen($this->_line);
        $this->_lineCurrent = $this->_lineLength;
    }
    public function insertLine(string $insert)
    {
        if ($this->_lineLength === $this->_lineCurrent) {
            return $this->appendLine($insert);
        }
        $this->_line = \mb_substr($this->_line, 0, $this->_lineCurrent) . $insert . \mb_substr($this->_line, $this->_lineCurrent);
        $this->_lineLength = \mb_strlen($this->_line);
        $this->_lineCurrent += \mb_strlen($insert);
        return;
    }
    protected function resetLine()
    {
        $this->_line = null;
        $this->_lineCurrent = 0;
        $this->_lineLength = 0;
    }
    public function getLineCurrent() : int
    {
        return $this->_lineCurrent;
    }
    public function getLineLength() : int
    {
        return $this->_lineLength;
    }
    public function setPrefix(string $prefix)
    {
        $this->_prefix = $prefix;
    }
    public function getPrefix()
    {
        return $this->_prefix;
    }
    public function getBuffer()
    {
        return $this->_buffer;
    }
    public function setAutocompleter(Autocompleter $autocompleter)
    {
        $old = $this->_autocompleter;
        $this->_autocompleter = $autocompleter;
        return $old;
    }
    public function getAutocompleter()
    {
        return $this->_autocompleter;
    }
    public function _read(int $length = 512) : string
    {
        return Console::getInput()->read($length);
    }
    public function setLine(string $line)
    {
        $this->_line = $line;
        $this->_lineLength = \mb_strlen($this->_line ?: '');
        $this->_lineCurrent = $this->_lineLength;
    }
    public function setLineCurrent(int $current)
    {
        $this->_lineCurrent = $current;
    }
    public function setLineLength(int $length)
    {
        $this->_lineLength = $length;
    }
    public function setBuffer(string $buffer)
    {
        $this->_buffer = $buffer;
    }
    public function _bindArrowUp(self $self) : int
    {
        if (0 === (static::STATE_CONTINUE & static::STATE_NO_ECHO)) {
            ConsoleCursor::clear('â†”');
            Console::getOutput()->writeAll($self->getPrefix());
        }
        $buffer = $self->previousHistory() ?? '';
        $self->setBuffer($buffer);
        $self->setLine($buffer);
        return static::STATE_CONTINUE;
    }
    public function _bindArrowDown(self $self) : int
    {
        if (0 === (static::STATE_CONTINUE & static::STATE_NO_ECHO)) {
            ConsoleCursor::clear('â†”');
            Console::getOutput()->writeAll($self->getPrefix());
        }
        $self->setBuffer($buffer = $self->nextHistory());
        $self->setLine($buffer);
        return static::STATE_CONTINUE;
    }
    public function _bindArrowRight(self $self) : int
    {
        if ($self->getLineLength() > $self->getLineCurrent()) {
            if (0 === (static::STATE_CONTINUE & static::STATE_NO_ECHO)) {
                ConsoleCursor::move('â†’');
            }
            $self->setLineCurrent($self->getLineCurrent() + 1);
        }
        $self->setBuffer('');
        return static::STATE_CONTINUE;
    }
    public function _bindArrowLeft(self $self) : int
    {
        if (0 < $self->getLineCurrent()) {
            if (0 === (static::STATE_CONTINUE & static::STATE_NO_ECHO)) {
                ConsoleCursor::move('â†�');
            }
            $self->setLineCurrent($self->getLineCurrent() - 1);
        }
        $self->setBuffer('');
        return static::STATE_CONTINUE;
    }
    public function _bindBackspace(self $self) : int
    {
        $buffer = '';
        if (0 < $self->getLineCurrent()) {
            if (0 === (static::STATE_CONTINUE & static::STATE_NO_ECHO)) {
                ConsoleCursor::move('â†�');
                ConsoleCursor::clear('â†’');
            }
            if ($self->getLineLength() === ($current = $self->getLineCurrent())) {
                $self->setLine(\mb_substr($self->getLine(), 0, -1));
            } else {
                $line = $self->getLine();
                $current = $self->getLineCurrent();
                $tail = \mb_substr($line, $current);
                $buffer = $tail . \str_repeat("\x1b[D", \mb_strlen($tail));
                $self->setLine(\mb_substr($line, 0, $current - 1) . $tail);
                $self->setLineCurrent($current - 1);
            }
        }
        $self->setBuffer($buffer);
        return static::STATE_CONTINUE;
    }
    public function _bindControlA(self $self) : int
    {
        for ($i = $self->getLineCurrent() - 1; 0 <= $i; --$i) {
            $self->_bindArrowLeft($self);
        }
        return static::STATE_CONTINUE;
    }
    public function _bindControlB(self $self) : int
    {
        $current = $self->getLineCurrent();
        if (0 === $current) {
            return static::STATE_CONTINUE;
        }
        $words = \preg_split('#\\b#u', $self->getLine(), -1, \PREG_SPLIT_OFFSET_CAPTURE | \PREG_SPLIT_NO_EMPTY);
        for ($i = 0, $max = \count($words) - 1; $i < $max && $words[$i + 1][1] < $current; ++$i) {
        }
        for ($j = $words[$i][1] + 1; $current >= $j; ++$j) {
            $self->_bindArrowLeft($self);
        }
        return static::STATE_CONTINUE;
    }
    public function _bindControlE(self $self) : int
    {
        for ($i = $self->getLineCurrent(), $max = $self->getLineLength(); $i < $max; ++$i) {
            $self->_bindArrowRight($self);
        }
        return static::STATE_CONTINUE;
    }
    public function _bindControlF(self $self) : int
    {
        $current = $self->getLineCurrent();
        if ($self->getLineLength() === $current) {
            return static::STATE_CONTINUE;
        }
        $words = \preg_split('#\\b#u', $self->getLine(), -1, \PREG_SPLIT_OFFSET_CAPTURE | \PREG_SPLIT_NO_EMPTY);
        for ($i = 0, $max = \count($words) - 1; $i < $max && $words[$i][1] < $current; ++$i) {
        }
        if (!isset($words[$i + 1])) {
            $words[$i + 1] = [1 => $self->getLineLength()];
        }
        for ($j = $words[$i + 1][1]; $j > $current; --$j) {
            $self->_bindArrowRight($self);
        }
        return static::STATE_CONTINUE;
    }
    public function _bindControlW(self $self) : int
    {
        $current = $self->getLineCurrent();
        if (0 === $current) {
            return static::STATE_CONTINUE;
        }
        $words = \preg_split('#\\b#u', $self->getLine(), -1, \PREG_SPLIT_OFFSET_CAPTURE | \PREG_SPLIT_NO_EMPTY);
        for ($i = 0, $max = \count($words) - 1; $i < $max && $words[$i + 1][1] < $current; ++$i) {
        }
        for ($j = $words[$i][1] + 1; $current >= $j; ++$j) {
            $self->_bindBackspace($self);
        }
        return static::STATE_CONTINUE;
    }
    public function _bindNewline(self $self) : int
    {
        $self->addHistory($self->getLine());
        return static::STATE_BREAK;
    }
    public function _bindTab(self $self) : int
    {
        $output = Console::getOutput();
        $autocompleter = $self->getAutocompleter();
        $state = static::STATE_CONTINUE | static::STATE_NO_ECHO;
        if (null === $autocompleter) {
            return $state;
        }
        $current = $self->getLineCurrent();
        $line = $self->getLine();
        if (0 === $current) {
            return $state;
        }
        $matches = \preg_match_all('#' . $autocompleter->getWordDefinition() . '$#u', \mb_substr($line, 0, $current), $words);
        if (0 === $matches) {
            return $state;
        }
        $word = $words[0][0];
        if ('' === \trim($word)) {
            return $state;
        }
        $solution = $autocompleter->complete($word);
        $length = \mb_strlen($word);
        if (null === $solution) {
            return $state;
        }
        if (\is_array($solution)) {
            $_solution = $solution;
            $count = \count($_solution) - 1;
            $cWidth = 0;
            $window = ConsoleWindow::getSize();
            $wWidth = $window['x'];
            $cursor = ConsoleCursor::getPosition();
            \array_walk($_solution, function (&$value) use(&$cWidth) {
                $handle = \mb_strlen($value);
                if ($handle > $cWidth) {
                    $cWidth = $handle;
                }
                return;
            });
            \array_walk($_solution, function (&$value) use(&$cWidth) {
                $handle = \mb_strlen($value);
                if ($handle >= $cWidth) {
                    return;
                }
                $value .= \str_repeat(' ', $cWidth - $handle);
                return;
            });
            $mColumns = (int) \floor($wWidth / ($cWidth + 2));
            $mLines = (int) \ceil(($count + 1) / $mColumns);
            --$mColumns;
            $i = 0;
            if (0 > $window['y'] - $cursor['y'] - $mLines) {
                ConsoleWindow::scroll('â†‘', $mLines);
                ConsoleCursor::move('â†‘', $mLines);
            }
            ConsoleCursor::save();
            ConsoleCursor::hide();
            ConsoleCursor::move('â†“ LEFT');
            ConsoleCursor::clear('â†“');
            foreach ($_solution as $j => $s) {
                $output->writeAll("\x1b[0m" . $s . "\x1b[0m");
                if ($i++ < $mColumns) {
                    $output->writeAll('  ');
                } else {
                    $i = 0;
                    if (isset($_solution[$j + 1])) {
                        $output->writeAll("\n");
                    }
                }
            }
            ConsoleCursor::restore();
            ConsoleCursor::show();
            ++$mColumns;
            $input = Console::getInput();
            $read = [$input->getStream()->getStream()];
            $write = $except = [];
            $mColumn = -1;
            $mLine = -1;
            $coord = -1;
            $unselect = function () use(&$mColumn, &$mLine, &$coord, &$_solution, &$cWidth, $output) {
                ConsoleCursor::save();
                ConsoleCursor::hide();
                ConsoleCursor::move('â†“ LEFT');
                ConsoleCursor::move('â†’', $mColumn * ($cWidth + 2));
                ConsoleCursor::move('â†“', $mLine);
                $output->writeAll("\x1b[0m" . $_solution[$coord] . "\x1b[0m");
                ConsoleCursor::restore();
                ConsoleCursor::show();
                return;
            };
            $select = function () use(&$mColumn, &$mLine, &$coord, &$_solution, &$cWidth, $output) {
                ConsoleCursor::save();
                ConsoleCursor::hide();
                ConsoleCursor::move('â†“ LEFT');
                ConsoleCursor::move('â†’', $mColumn * ($cWidth + 2));
                ConsoleCursor::move('â†“', $mLine);
                $output->writeAll("\x1b[7m" . $_solution[$coord] . "\x1b[0m");
                ConsoleCursor::restore();
                ConsoleCursor::show();
                return;
            };
            $init = function () use(&$mColumn, &$mLine, &$coord, &$select) {
                $mColumn = 0;
                $mLine = 0;
                $coord = 0;
                $select();
                return;
            };
            while (\true) {
                @\stream_select($read, $write, $except, 30, 0);
                if (empty($read)) {
                    $read = [$input->getStream()->getStream()];
                    continue;
                }
                switch ($char = $self->_read()) {
                    case "\x1b[A":
                        if (-1 === $mColumn && -1 === $mLine) {
                            $init();
                            break;
                        }
                        $unselect();
                        $coord = \max(0, $coord - $mColumns);
                        $mLine = (int) \floor($coord / $mColumns);
                        $mColumn = $coord % $mColumns;
                        $select();
                        break;
                    case "\x1b[B":
                        if (-1 === $mColumn && -1 === $mLine) {
                            $init();
                            break;
                        }
                        $unselect();
                        $coord = \min($count, $coord + $mColumns);
                        $mLine = (int) \floor($coord / $mColumns);
                        $mColumn = $coord % $mColumns;
                        $select();
                        break;
                    case "\t":
                    case "\x1b[C":
                        if (-1 === $mColumn && -1 === $mLine) {
                            $init();
                            break;
                        }
                        $unselect();
                        $coord = \min($count, $coord + 1);
                        $mLine = (int) \floor($coord / $mColumns);
                        $mColumn = $coord % $mColumns;
                        $select();
                        break;
                    case "\x1b[D":
                        if (-1 === $mColumn && -1 === $mLine) {
                            $init();
                            break;
                        }
                        $unselect();
                        $coord = \max(0, $coord - 1);
                        $mLine = (int) \floor($coord / $mColumns);
                        $mColumn = $coord % $mColumns;
                        $select();
                        break;
                    case "\n":
                        if (-1 !== $mColumn && -1 !== $mLine) {
                            $tail = \mb_substr($line, $current);
                            $current -= $length;
                            $self->setLine(\mb_substr($line, 0, $current) . $solution[$coord] . $tail);
                            $self->setLineCurrent($current + \mb_strlen($solution[$coord]));
                            ConsoleCursor::move('â†�', $length);
                            $output->writeAll($solution[$coord]);
                            ConsoleCursor::clear('â†’');
                            $output->writeAll($tail);
                            ConsoleCursor::move('â†�', \mb_strlen($tail));
                        }
                    default:
                        $mColumn = -1;
                        $mLine = -1;
                        $coord = -1;
                        ConsoleCursor::save();
                        ConsoleCursor::move('â†“ LEFT');
                        ConsoleCursor::clear('â†“');
                        ConsoleCursor::restore();
                        if ("\x1b" !== $char && "\n" !== $char) {
                            $self->setBuffer($char);
                            return $self->_readLine($char);
                        }
                        break 2;
                }
            }
            return $state;
        }
        $tail = \mb_substr($line, $current);
        $current -= $length;
        $self->setLine(\mb_substr($line, 0, $current) . $solution . $tail);
        $self->setLineCurrent($current + \mb_strlen($solution));
        ConsoleCursor::move('â†�', $length);
        $output->writeAll($solution);
        ConsoleCursor::clear('â†’');
        $output->writeAll($tail);
        ConsoleCursor::move('â†�', \mb_strlen($tail));
        return $state;
    }
}
Console::advancedInteraction();
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleProcessus extends Stream implements StreamIn, StreamOut, StreamPathable
{
    const SIGHUP = 1;
    const SIGINT = 2;
    const SIGQUIT = 3;
    const SIGILL = 4;
    const SIGTRAP = 5;
    const SIGABRT = 6;
    const SIGEMT = 7;
    const SIGFPE = 8;
    const SIGKILL = 9;
    const SIGBUS = 10;
    const SIGSEGV = 11;
    const SIGSYS = 12;
    const SIGPIPE = 13;
    const SIGALRM = 14;
    const SIGTERM = 15;
    const SIGURG = 16;
    const SIGSTOP = 17;
    const SIGTSTP = 18;
    const SIGCONT = 19;
    const SIGCHLD = 20;
    const SIGTTIN = 21;
    const SIGTTOU = 22;
    const SIGIO = 23;
    const SIGXCPU = 24;
    const SIGXFSZ = 25;
    const SIGVTALRM = 26;
    const SIGPROF = 27;
    const SIGWINCH = 28;
    const SIGINFO = 29;
    const SIGUSR1 = 30;
    const SIGUSR2 = 31;
    protected $_command = null;
    protected $_options = [];
    protected $_cwd = null;
    protected $_environment = null;
    protected $_timeout = 30;
    protected $_descriptors = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
    protected $_pipes = null;
    protected $_seekable = [];
    public function __construct(string $command, array $options = null, array $descriptors = null, string $cwd = null, array $environment = null, int $timeout = 30)
    {
        $this->setCommand($command);
        if (null !== $options) {
            $this->setOptions($options);
        }
        if (null !== $descriptors) {
            $this->_descriptors = [];
            foreach ($descriptors as $descriptor => $nature) {
                if (isset($this->_descriptors[$descriptor])) {
                    throw new ConsoleException('Pipe descriptor %d already exists, cannot ' . 'redefine it.', 0, $descriptor);
                }
                $this->_descriptors[$descriptor] = $nature;
            }
        }
        $this->setCwd($cwd ?: \getcwd());
        if (null !== $environment) {
            $this->setEnvironment($environment);
        }
        $this->setTimeout($timeout);
        parent::__construct($this->getCommandLine(), null, \true);
        $this->getListener()->addIds(['input', 'output', 'timeout', 'start', 'stop']);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        $out = @\proc_open($streamName, $this->_descriptors, $this->_pipes, $this->getCwd(), $this->getEnvironment());
        if (\false === $out) {
            throw new ConsoleException('Something wrong happen when running %s.', 1, $streamName);
        }
        return $out;
    }
    protected function _close() : bool
    {
        foreach ($this->_pipes as $pipe) {
            @\fclose($pipe);
        }
        return (bool) @\proc_close($this->getStream());
    }
    public function run()
    {
        if (\false === $this->isOpened()) {
            $this->open();
        } else {
            $this->_close();
            $this->_setStream($this->_open($this->getStreamName(), $this->getStreamContext()));
        }
        $this->getListener()->fire('start', new EventBucket());
        $_read = [];
        $_write = [];
        $_except = [];
        foreach ($this->_pipes as $p => $pipe) {
            switch ($this->_descriptors[$p][1]) {
                case 'r':
                    \stream_set_blocking($pipe, \false);
                    $_write[] = $pipe;
                    break;
                case 'w':
                case 'a':
                    \stream_set_blocking($pipe, \true);
                    $_read[] = $pipe;
                    break;
            }
        }
        while (\true) {
            foreach ($_read as $i => $r) {
                if (\false === \is_resource($r)) {
                    unset($_read[$i]);
                }
            }
            foreach ($_write as $i => $w) {
                if (\false === \is_resource($w)) {
                    unset($_write[$i]);
                }
            }
            foreach ($_except as $i => $e) {
                if (\false === \is_resource($e)) {
                    unset($_except[$i]);
                }
            }
            if (empty($_read) && empty($_write) && empty($_except)) {
                break;
            }
            $read = $_read;
            $write = $_write;
            $except = $_except;
            $select = \stream_select($read, $write, $except, $this->getTimeout());
            if (0 === $select) {
                $this->getListener()->fire('timeout', new EventBucket());
                break;
            }
            foreach ($read as $i => $_r) {
                $pipe = \array_search($_r, $this->_pipes);
                $line = $this->readLine($pipe);
                if (\false === $line) {
                    $result = [\false];
                } else {
                    $result = $this->getListener()->fire('output', new EventBucket(['pipe' => $pipe, 'line' => $line]));
                }
                if (\true === \feof($_r) || \in_array(\false, $result, \true)) {
                    \fclose($_r);
                    unset($_read[$i]);
                    break;
                }
            }
            foreach ($write as $j => $_w) {
                $result = $this->getListener()->fire('input', new EventBucket(['pipe' => \array_search($_w, $this->_pipes)]));
                if (\true === \feof($_w) || \in_array(\false, $result, \true)) {
                    \fclose($_w);
                    unset($_write[$j]);
                }
            }
            if (empty($_read)) {
                break;
            }
        }
        $this->getListener()->fire('stop', new EventBucket());
        return;
    }
    protected function getPipe(int $pipe)
    {
        if (!isset($this->_pipes[$pipe])) {
            throw new ConsoleException('Pipe descriptor %d does not exist, cannot read from it.', 2, $pipe);
        }
        return $this->_pipes[$pipe];
    }
    protected function isPipeSeekable(int $pipe) : bool
    {
        if (!isset($this->_seekable[$pipe])) {
            $_pipe = $this->getPipe($pipe);
            $data = \stream_get_meta_data($_pipe);
            $this->_seekable[$pipe] = $data['seekable'];
        }
        return $this->_seekable[$pipe];
    }
    public function eof(int $pipe = 1) : bool
    {
        return \feof($this->getPipe($pipe));
    }
    public function read(int $length, int $pipe = 1)
    {
        if (0 > $length) {
            throw new ConsoleException('Length must be greater than 0, given %d.', 3, $length);
        }
        return \fread($this->getPipe($pipe), $length);
    }
    public function readString(int $length, int $pipe = 1)
    {
        return $this->read($length, $pipe);
    }
    public function readCharacter(int $pipe = 1)
    {
        return \fgetc($this->getPipe($pipe));
    }
    public function readBoolean(int $pipe = 1)
    {
        return (bool) $this->read(1, $pipe);
    }
    public function readInteger(int $length = 1, int $pipe = 1)
    {
        return (int) $this->read($length, $pipe);
    }
    public function readFloat(int $length = 1, int $pipe = 1)
    {
        return (float) $this->read($length, $pipe);
    }
    public function readArray(string $format = null, int $pipe = 1)
    {
        return $this->scanf($format, $pipe);
    }
    public function readLine(int $pipe = 1)
    {
        return \stream_get_line($this->getPipe($pipe), 1 << 15, "\n");
    }
    public function readAll(int $offset = -1, int $pipe = 1)
    {
        $_pipe = $this->getPipe($pipe);
        if (\true === $this->isPipeSeekable($pipe)) {
            $offset += \ftell($_pipe);
        } else {
            $offset = -1;
        }
        return \stream_get_contents($_pipe, -1, $offset);
    }
    public function scanf(string $format, int $pipe = 1) : array
    {
        return \fscanf($this->getPipe($pipe), $format);
    }
    public function write(string $string, int $length, int $pipe = 0)
    {
        if (0 > $length) {
            throw new ConsoleException('Length must be greater than 0, given %d.', 4, $length);
        }
        return \fwrite($this->getPipe($pipe), $string, $length);
    }
    public function writeString(string $string, int $pipe = 0)
    {
        $string = (string) $string;
        return $this->write($string, \strlen($string), $pipe);
    }
    public function writeCharacter(string $char, int $pipe = 0)
    {
        return $this->write((string) $char[0], 1, $pipe);
    }
    public function writeBoolean(bool $boolean, int $pipe = 0)
    {
        return $this->write((string) (bool) $boolean, 1, $pipe);
    }
    public function writeInteger(int $integer, int $pipe = 0)
    {
        $integer = (string) (int) $integer;
        return $this->write($integer, \strlen($integer), $pipe);
    }
    public function writeFloat(float $float, int $pipe = 0)
    {
        $float = (string) (float) $float;
        return $this->write($float, \strlen($float), $pipe);
    }
    public function writeArray(array $array, int $pipe = 0)
    {
        $array = \var_export($array, \true);
        return $this->write($array, \strlen($array), $pipe);
    }
    public function writeLine(string $line, int $pipe = 0)
    {
        if (\false === ($n = \strpos($line, "\n"))) {
            return $this->write($line . "\n", \strlen($line) + 1, $pipe);
        }
        ++$n;
        return $this->write(\substr($line, 0, $n), $n, $pipe);
    }
    public function writeAll(string $string, int $pipe = 0)
    {
        return $this->write($string, \strlen($string), $pipe);
    }
    public function truncate(int $size, int $pipe = 0) : bool
    {
        return \ftruncate($this->getPipe($pipe), $size);
    }
    public function getBasename() : string
    {
        return \basename($this->getCommand());
    }
    public function getDirname() : string
    {
        return \dirname($this->getCommand());
    }
    public function getStatus() : array
    {
        return \proc_get_status($this->getStream());
    }
    public function getExitCode() : int
    {
        $handle = $this->getStatus();
        return $handle['exitcode'];
    }
    public function isSuccessful() : bool
    {
        return 0 === $this->getExitCode();
    }
    public function terminate(int $signal = self::SIGTERM) : bool
    {
        return \proc_terminate($this->getStream(), $signal);
    }
    protected function setCommand(string $command)
    {
        $old = $this->_command;
        $this->_command = \escapeshellcmd($command);
        return $old;
    }
    public function getCommand()
    {
        return $this->_command;
    }
    protected function setOptions(array $options) : array
    {
        foreach ($options as &$option) {
            $option = \escapeshellarg($option);
        }
        $old = $this->_options;
        $this->_options = $options;
        return $old;
    }
    public function getOptions() : array
    {
        return $this->_options;
    }
    public function getCommandLine() : string
    {
        $out = $this->getCommand();
        foreach ($this->getOptions() as $key => $value) {
            if (!\is_int($key)) {
                $out .= ' ' . $key . '=' . $value;
            } else {
                $out .= ' ' . $value;
            }
        }
        return $out;
    }
    protected function setCwd(string $cwd)
    {
        $old = $this->_cwd;
        $this->_cwd = $cwd;
        return $old;
    }
    public function getCwd() : string
    {
        return $this->_cwd;
    }
    protected function setEnvironment(array $environment)
    {
        $old = $this->_environment;
        $this->_environment = $environment;
        return $old;
    }
    public function getEnvironment()
    {
        return $this->_environment;
    }
    public function setTimeout(int $timeout)
    {
        $old = $this->_timeout;
        $this->_timeout = $timeout;
        return $old;
    }
    public function getTimeout() : int
    {
        return $this->_timeout;
    }
    public static function setTitle(string $title)
    {
        \cli_set_process_title($title);
    }
    public static function getTitle()
    {
        return \cli_get_process_title();
    }
    public static function locate(string $binary)
    {
        if (isset($_ENV['PATH'])) {
            $separator = ':';
            $path =& $_ENV['PATH'];
        } elseif (isset($_SERVER['PATH'])) {
            $separator = ':';
            $path =& $_SERVER['PATH'];
        } elseif (isset($_SERVER['Path'])) {
            $separator = ';';
            $path =& $_SERVER['Path'];
        } else {
            return null;
        }
        foreach (\explode($separator, $path) as $directory) {
            if (\true === \file_exists($out = $directory . \DIRECTORY_SEPARATOR . $binary)) {
                return $out;
            }
        }
        return null;
    }
    public static function execute(string $commandLine, bool $escape = \true) : string
    {
        if (\true === $escape) {
            $commandLine = \escapeshellcmd($commandLine);
        }
        return \rtrim(\shell_exec($commandLine) ?? '');
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleCursor
{
    public static function move(string $steps, int $repeat = 1)
    {
        if (1 > $repeat) {
            return;
        } elseif (1 === $repeat) {
            $handle = \explode(' ', $steps);
        } else {
            $handle = \explode(' ', $steps, 1);
        }
        $tput = Console::getTput();
        $output = Console::getOutput();
        foreach ($handle as $step) {
            switch ($step) {
                case 'u':
                case 'up':
                case 'â†‘':
                    $output->writeAll(\str_replace('%p1%d', $repeat, $tput->get('parm_up_cursor')));
                    break;
                case 'U':
                case 'UP':
                    static::moveTo(null, 1);
                    break;
                case 'r':
                case 'right':
                case 'â†’':
                    $output->writeAll(\str_replace('%p1%d', $repeat, $tput->get('parm_right_cursor')));
                    break;
                case 'R':
                case 'RIGHT':
                    static::moveTo(9999);
                    break;
                case 'd':
                case 'down':
                case 'â†“':
                    $output->writeAll(\str_replace('%p1%d', $repeat, $tput->get('parm_down_cursor')));
                    break;
                case 'D':
                case 'DOWN':
                    static::moveTo(null, 9999);
                    break;
                case 'l':
                case 'left':
                case 'â†�':
                    $output->writeAll(\str_replace('%p1%d', $repeat, $tput->get('parm_left_cursor')));
                    break;
                case 'L':
                case 'LEFT':
                    static::moveTo(1);
                    break;
            }
        }
    }
    public static function moveTo(int $x = null, int $y = null)
    {
        if (null === $x || null === $y) {
            $position = static::getPosition();
            if (null === $x) {
                $x = $position['x'];
            }
            if (null === $y) {
                $y = $position['y'];
            }
        }
        Console::getOutput()->writeAll(\str_replace(['%i%p1%d', '%p2%d'], [$y, $x], Console::getTput()->get('cursor_address')));
    }
    public static function getPosition() : array
    {
        $tput = Console::getTput();
        $user7 = $tput->get('user7');
        if (null === $user7) {
            return ['x' => 0, 'y' => 0];
        }
        Console::getOutput()->writeAll($user7);
        $input = Console::getInput();
        $input->read(2);
        $x = null;
        $y = null;
        $handle =& $y;
        while (\true) {
            $char = $input->readCharacter();
            switch ($char) {
                case ';':
                    $handle =& $x;
                    break;
                case 'R':
                    break 2;
                default:
                    $handle .= $char;
            }
        }
        return ['x' => (int) $x, 'y' => (int) $y];
    }
    public static function save()
    {
        Console::getOutput()->writeAll(Console::getTput()->get('save_cursor'));
    }
    public static function restore()
    {
        Console::getOutput()->writeAll(Console::getTput()->get('restore_cursor'));
    }
    public static function clear(string $parts = 'all')
    {
        $tput = Console::getTput();
        $output = Console::getOutput();
        foreach (\explode(' ', $parts) as $part) {
            switch ($part) {
                case 'a':
                case 'all':
                case 'â†•':
                    $output->writeAll($tput->get('clear_screen'));
                    static::moveTo(1, 1);
                    break;
                case 'u':
                case 'up':
                case 'â†‘':
                    $output->writeAll("\x1b[1J");
                    break;
                case 'r':
                case 'right':
                case 'â†’':
                    $output->writeAll($tput->get('clr_eol'));
                    break;
                case 'd':
                case 'down':
                case 'â†“':
                    $output->writeAll($tput->get('clr_eos'));
                    break;
                case 'l':
                case 'left':
                case 'â†�':
                    $output->writeAll($tput->get('clr_bol'));
                    break;
                case 'line':
                case 'â†”':
                    $output->writeAll("\r" . $tput->get('clr_eol'));
                    break;
            }
        }
    }
    public static function hide()
    {
        Console::getOutput()->writeAll(Console::getTput()->get('cursor_invisible'));
    }
    public static function show()
    {
        Console::getOutput()->writeAll(Console::getTput()->get('cursor_visible'));
    }
    public static function colorize(string $attributes)
    {
        static $_rgbTo256 = null;
        if (null === $_rgbTo256) {
            $_rgbTo256 = ['000000', '800000', '008000', '808000', '000080', '800080', '008080', 'c0c0c0', '808080', 'ff0000', '00ff00', 'ffff00', '0000ff', 'ff00ff', '00ffff', 'ffffff', '000000', '00005f', '000087', '0000af', '0000d7', '0000ff', '005f00', '005f5f', '005f87', '005faf', '005fd7', '005fff', '008700', '00875f', '008787', '0087af', '0087d7', '0087ff', '00af00', '00af5f', '00af87', '00afaf', '00afd7', '00afff', '00d700', '00d75f', '00d787', '00d7af', '00d7d7', '00d7ff', '00ff00', '00ff5f', '00ff87', '00ffaf', '00ffd7', '00ffff', '5f0000', '5f005f', '5f0087', '5f00af', '5f00d7', '5f00ff', '5f5f00', '5f5f5f', '5f5f87', '5f5faf', '5f5fd7', '5f5fff', '5f8700', '5f875f', '5f8787', '5f87af', '5f87d7', '5f87ff', '5faf00', '5faf5f', '5faf87', '5fafaf', '5fafd7', '5fafff', '5fd700', '5fd75f', '5fd787', '5fd7af', '5fd7d7', '5fd7ff', '5fff00', '5fff5f', '5fff87', '5fffaf', '5fffd7', '5fffff', '870000', '87005f', '870087', '8700af', '8700d7', '8700ff', '875f00', '875f5f', '875f87', '875faf', '875fd7', '875fff', '878700', '87875f', '878787', '8787af', '8787d7', '8787ff', '87af00', '87af5f', '87af87', '87afaf', '87afd7', '87afff', '87d700', '87d75f', '87d787', '87d7af', '87d7d7', '87d7ff', '87ff00', '87ff5f', '87ff87', '87ffaf', '87ffd7', '87ffff', 'af0000', 'af005f', 'af0087', 'af00af', 'af00d7', 'af00ff', 'af5f00', 'af5f5f', 'af5f87', 'af5faf', 'af5fd7', 'af5fff', 'af8700', 'af875f', 'af8787', 'af87af', 'af87d7', 'af87ff', 'afaf00', 'afaf5f', 'afaf87', 'afafaf', 'afafd7', 'afafff', 'afd700', 'afd75f', 'afd787', 'afd7af', 'afd7d7', 'afd7ff', 'afff00', 'afff5f', 'afff87', 'afffaf', 'afffd7', 'afffff', 'd70000', 'd7005f', 'd70087', 'd700af', 'd700d7', 'd700ff', 'd75f00', 'd75f5f', 'd75f87', 'd75faf', 'd75fd7', 'd75fff', 'd78700', 'd7875f', 'd78787', 'd787af', 'd787d7', 'd787ff', 'd7af00', 'd7af5f', 'd7af87', 'd7afaf', 'd7afd7', 'd7afff', 'd7d700', 'd7d75f', 'd7d787', 'd7d7af', 'd7d7d7', 'd7d7ff', 'd7ff00', 'd7ff5f', 'd7ff87', 'd7ffaf', 'd7ffd7', 'd7ffff', 'ff0000', 'ff005f', 'ff0087', 'ff00af', 'ff00d7', 'ff00ff', 'ff5f00', 'ff5f5f', 'ff5f87', 'ff5faf', 'ff5fd7', 'ff5fff', 'ff8700', 'ff875f', 'ff8787', 'ff87af', 'ff87d7', 'ff87ff', 'ffaf00', 'ffaf5f', 'ffaf87', 'ffafaf', 'ffafd7', 'ffafff', 'ffd700', 'ffd75f', 'ffd787', 'ffd7af', 'ffd7d7', 'ffd7ff', 'ffff00', 'ffff5f', 'ffff87', 'ffffaf', 'ffffd7', 'ffffff', '080808', '121212', '1c1c1c', '262626', '303030', '3a3a3a', '444444', '4e4e4e', '585858', '606060', '666666', '767676', '808080', '8a8a8a', '949494', '9e9e9e', 'a8a8a8', 'b2b2b2', 'bcbcbc', 'c6c6c6', 'd0d0d0', 'dadada', 'e4e4e4', 'eeeeee'];
        }
        $tput = Console::getTput();
        if (1 >= $tput->count('max_colors')) {
            return;
        }
        $handle = [];
        foreach (\explode(' ', $attributes) as $attribute) {
            switch ($attribute) {
                case 'n':
                case 'normal':
                    $handle[] = 0;
                    break;
                case 'b':
                case 'bold':
                    $handle[] = 1;
                    break;
                case 'u':
                case 'underlined':
                    $handle[] = 4;
                    break;
                case 'bl':
                case 'blink':
                    $handle[] = 5;
                    break;
                case 'i':
                case 'inverse':
                    $handle[] = 7;
                    break;
                case '!b':
                case '!bold':
                    $handle[] = 22;
                    break;
                case '!u':
                case '!underlined':
                    $handle[] = 24;
                    break;
                case '!bl':
                case '!blink':
                    $handle[] = 25;
                    break;
                case '!i':
                case '!inverse':
                    $handle[] = 27;
                    break;
                default:
                    if (0 === \preg_match('#^([^\\(]+)\\(([^\\)]+)\\)$#', $attribute, $m)) {
                        break;
                    }
                    $shift = 0;
                    switch ($m[1]) {
                        case 'fg':
                        case 'foreground':
                            $shift = 0;
                            break;
                        case 'bg':
                        case 'background':
                            $shift = 10;
                            break;
                        default:
                            break 2;
                    }
                    $_handle = 0;
                    $_keyword = \true;
                    switch ($m[2]) {
                        case 'black':
                            $_handle = 30;
                            break;
                        case 'red':
                            $_handle = 31;
                            break;
                        case 'green':
                            $_handle = 32;
                            break;
                        case 'yellow':
                            $_handle = 33;
                            break;
                        case 'blue':
                            $_handle = 34;
                            break;
                        case 'magenta':
                            $_handle = 35;
                            break;
                        case 'cyan':
                            $_handle = 36;
                            break;
                        case 'white':
                            $_handle = 37;
                            break;
                        case 'default':
                            $_handle = 39;
                            break;
                        default:
                            $_keyword = \false;
                            if (256 <= $tput->count('max_colors') && '#' === $m[2][0]) {
                                $rgb = \hexdec(\substr($m[2], 1));
                                $r = $rgb >> 16 & 255;
                                $g = $rgb >> 8 & 255;
                                $b = $rgb & 255;
                                $distance = null;
                                foreach ($_rgbTo256 as $i => $_rgb) {
                                    $_rgb = \hexdec($_rgb);
                                    $_r = $_rgb >> 16 & 255;
                                    $_g = $_rgb >> 8 & 255;
                                    $_b = $_rgb & 255;
                                    $d = \sqrt(($_r - $r) ** 2 + ($_g - $g) ** 2 + ($_b - $b) ** 2);
                                    if (null === $distance || $d <= $distance) {
                                        $distance = $d;
                                        $_handle = $i;
                                    }
                                }
                            } else {
                                $_handle = (int) $m[2];
                            }
                    }
                    if (\true === $_keyword) {
                        $handle[] = $_handle + $shift;
                    } else {
                        $handle[] = 38 + $shift . ';5;' . $_handle;
                    }
            }
        }
        Console::getOutput()->writeAll("\x1b[" . \implode(';', $handle) . 'm');
        return;
    }
    public static function changeColor(int $fromCode, int $toColor)
    {
        $tput = Console::getTput();
        if (\true !== $tput->has('can_change')) {
            return;
        }
        $r = $toColor >> 16 & 255;
        $g = $toColor >> 8 & 255;
        $b = $toColor & 255;
        Console::getOutput()->writeAll(\str_replace(['%p1%d', 'rgb:', '%p2%{255}%*%{1000}%/%2.2X/', '%p3%{255}%*%{1000}%/%2.2X/', '%p4%{255}%*%{1000}%/%2.2X'], [$fromCode, '', \sprintf('%02x', $r), \sprintf('%02x', $g), \sprintf('%02x', $b)], $tput->get('initialize_color')));
        return;
    }
    public static function setStyle(string $style, bool $blink = \true)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        switch ($style) {
            case 'u':
            case 'underline':
            case '_':
                $_style = 2;
                break;
            case 'v':
            case 'vertical':
            case '|':
                $_style = 5;
                break;
            case 'b':
            case 'block':
            case 'â–‹':
            default:
                $_style = 1;
                break;
        }
        if (\false === $blink) {
            ++$_style;
        }
        Console::getOutput()->writeAll("\x1b[" . $_style . ' q');
        return;
    }
    public static function bip()
    {
        Console::getOutput()->writeAll(Console::getTput()->get('bell'));
    }
}
Console::advancedInteraction();
<?php

namespace Cvphar\Psy\Readline\Hoa;

class IteratorSplFileInfo extends \SplFileInfo
{
    protected $_hash = null;
    protected $_relativePath = null;
    public function __construct(string $filename, string $relativePath = null)
    {
        parent::__construct($filename);
        if (-1 !== ($mtime = $this->getMTime())) {
            $this->_hash = \md5($this->getPathname() . $mtime);
        }
        $this->_relativePath = $relativePath;
        return;
    }
    public function getHash() : string
    {
        return $this->_hash;
    }
    public function getMTime() : int
    {
        try {
            return parent::getMTime();
        } catch (\RuntimeException $e) {
            return -1;
        }
    }
    public function setRelativePath(string $relativePath)
    {
        $old = $this->_relativePath;
        $this->_relativePath = $relativePath;
        return $old;
    }
    public function getRelativePath()
    {
        return $this->_relativePath;
    }
    public function getRelativePathname() : string
    {
        if (null === ($relative = $this->getRelativePath())) {
            return $this->getPathname();
        }
        return \substr($this->getPathname(), \strlen($relative));
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface EventListenable extends EventSource
{
    public function on(string $listenerId, $callable) : self;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileLinkReadWrite extends FileLink implements StreamIn, StreamOut
{
    public function __construct(string $streamName, string $mode = parent::MODE_APPEND_READ_WRITE, string $context = null, bool $wait = \false)
    {
        parent::__construct($streamName, $mode, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        static $createModes = [parent::MODE_READ_WRITE, parent::MODE_TRUNCATE_READ_WRITE, parent::MODE_APPEND_READ_WRITE, parent::MODE_CREATE_READ_WRITE];
        if (!\in_array($this->getMode(), $createModes)) {
            throw new FileException('Open mode are not supported; given %d. Only %s are supported.', 0, [$this->getMode(), \implode(', ', $createModes)]);
        }
        \preg_match('#^(\\w+)://#', $streamName, $match);
        if ((isset($match[1]) && $match[1] === 'file' || !isset($match[1])) && !\file_exists($streamName) && parent::MODE_READ_WRITE === $this->getMode()) {
            throw new FileDoesNotExistException('File %s does not exist.', 1, $streamName);
        }
        $out = parent::_open($streamName, $context);
        return $out;
    }
    public function eof() : bool
    {
        return \feof($this->getStream());
    }
    public function read(int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 2, $length);
        }
        return \fread($this->getStream(), $length);
    }
    public function readString(int $length)
    {
        return $this->read($length);
    }
    public function readCharacter()
    {
        return \fgetc($this->getStream());
    }
    public function readBoolean()
    {
        return (bool) $this->read(1);
    }
    public function readInteger(int $length = 1)
    {
        return (int) $this->read($length);
    }
    public function readFloat(int $length = 1)
    {
        return (float) $this->read($length);
    }
    public function readArray(string $format = null)
    {
        return $this->scanf($format);
    }
    public function readLine()
    {
        return \fgets($this->getStream());
    }
    public function readAll(int $offset = 0)
    {
        return \stream_get_contents($this->getStream(), -1, $offset);
    }
    public function scanf(string $format) : array
    {
        return \fscanf($this->getStream(), $format);
    }
    public function write(string $string, int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 3, $length);
        }
        return \fwrite($this->getStream(), $string, $length);
    }
    public function writeString(string $string)
    {
        $string = (string) $string;
        return $this->write($string, \strlen($string));
    }
    public function writeCharacter(string $char)
    {
        return $this->write((string) $char[0], 1);
    }
    public function writeBoolean(bool $boolean)
    {
        return $this->write((string) (bool) $boolean, 1);
    }
    public function writeInteger(int $integer)
    {
        $integer = (string) (int) $integer;
        return $this->write($integer, \strlen($integer));
    }
    public function writeFloat(float $float)
    {
        $float = (string) (float) $float;
        return $this->write($float, \strlen($float));
    }
    public function writeArray(array $array)
    {
        $array = \var_export($array, \true);
        return $this->write($array, \strlen($array));
    }
    public function writeLine(string $line)
    {
        if (\false === ($n = \strpos($line, "\n"))) {
            return $this->write($line . "\n", \strlen($line) + 1);
        }
        ++$n;
        return $this->write(\substr($line, 0, $n), $n);
    }
    public function writeAll(string $string)
    {
        return $this->write($string, \strlen($string));
    }
    public function truncate(int $size) : bool
    {
        return \ftruncate($this->getStream(), $size);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface IStream
{
    public function getStream();
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

abstract class Stream implements IStream, EventListenable
{
    use EventListens;
    const NAME = 0;
    const HANDLER = 1;
    const RESOURCE = 2;
    const CONTEXT = 3;
    const DEFAULT_BUFFER_SIZE = 8192;
    protected $_bucket = [];
    private static $_register = [];
    protected $_bufferSize = self::DEFAULT_BUFFER_SIZE;
    protected $_streamName = null;
    protected $_context = null;
    protected $_hasBeenDeferred = \false;
    protected $_borrowing = \false;
    public function __construct(string $streamName, string $context = null, bool $wait = \false)
    {
        $this->_streamName = $streamName;
        $this->_context = $context;
        $this->_hasBeenDeferred = $wait;
        $this->setListener(new EventListener($this, ['authrequire', 'authresult', 'complete', 'connect', 'failure', 'mimetype', 'progress', 'redirect', 'resolve', 'size']));
        if (\true === $wait) {
            return;
        }
        $this->open();
        return;
    }
    private static function &_getStream(string $streamName, self $handler, string $context = null) : array
    {
        $name = \md5($streamName);
        if (null !== $context) {
            if (\false === StreamContext::contextExists($context)) {
                throw new StreamException('Context %s was not previously declared, cannot retrieve ' . 'this context.', 0, $context);
            }
            $context = StreamContext::getInstance($context);
        }
        if (!isset(self::$_register[$name])) {
            self::$_register[$name] = [self::NAME => $streamName, self::HANDLER => $handler, self::RESOURCE => $handler->_open($streamName, $context), self::CONTEXT => $context];
            Event::register('hoa://Event/Stream/' . $streamName, $handler);
            Event::register('hoa://Event/Stream/' . $streamName . ':close-before', $handler);
        } else {
            $handler->_borrowing = \true;
        }
        if (null === self::$_register[$name][self::RESOURCE]) {
            self::$_register[$name][self::RESOURCE] = $handler->_open($streamName, $context);
        }
        return self::$_register[$name];
    }
    protected abstract function &_open(string $streamName, StreamContext $context = null);
    protected abstract function _close() : bool;
    public final function open() : self
    {
        $context = $this->_context;
        if (\true === $this->hasBeenDeferred()) {
            if (null === $context) {
                $handle = StreamContext::getInstance(\uniqid());
                $handle->setParameters(['notification' => [$this, '_notify']]);
                $context = $handle->getId();
            } elseif (\true === StreamContext::contextExists($context)) {
                $handle = StreamContext::getInstance($context);
                $parameters = $handle->getParameters();
                if (!isset($parameters['notification'])) {
                    $handle->setParameters(['notification' => [$this, '_notify']]);
                }
            }
        }
        $this->_bufferSize = self::DEFAULT_BUFFER_SIZE;
        $this->_bucket = self::_getStream($this->_streamName, $this, $context);
        return $this;
    }
    public final function close()
    {
        $streamName = $this->getStreamName();
        if (null === $streamName) {
            return;
        }
        $name = \md5($streamName);
        if (!isset(self::$_register[$name])) {
            return;
        }
        Event::notify('hoa://Event/Stream/' . $streamName . ':close-before', $this, new EventBucket());
        if (\false === $this->_close()) {
            return;
        }
        unset(self::$_register[$name]);
        $this->_bucket[self::HANDLER] = null;
        Event::unregister('hoa://Event/Stream/' . $streamName);
        Event::unregister('hoa://Event/Stream/' . $streamName . ':close-before');
        return;
    }
    public function getStreamName()
    {
        if (empty($this->_bucket)) {
            return null;
        }
        return $this->_bucket[self::NAME];
    }
    public function getStream()
    {
        if (empty($this->_bucket)) {
            return null;
        }
        return $this->_bucket[self::RESOURCE];
    }
    public function getStreamContext()
    {
        if (empty($this->_bucket)) {
            return null;
        }
        return $this->_bucket[self::CONTEXT];
    }
    public static function getStreamHandler(string $streamName)
    {
        $name = \md5($streamName);
        if (!isset(self::$_register[$name])) {
            return null;
        }
        return self::$_register[$name][self::HANDLER];
    }
    public function _setStream($stream)
    {
        if (\false === \is_resource($stream) && ('resource' !== \gettype($stream) || 'Unknown' !== \get_resource_type($stream))) {
            throw new StreamException('Try to change the stream resource with an invalid one; ' . 'given %s.', 1, \gettype($stream));
        }
        $old = $this->_bucket[self::RESOURCE];
        $this->_bucket[self::RESOURCE] = $stream;
        return $old;
    }
    public function isOpened() : bool
    {
        return \is_resource($this->getStream());
    }
    public function setStreamTimeout(int $seconds, int $microseconds = 0) : bool
    {
        return \stream_set_timeout($this->getStream(), $seconds, $microseconds);
    }
    protected function hasBeenDeferred()
    {
        return $this->_hasBeenDeferred;
    }
    public function hasTimedOut() : bool
    {
        $metaData = $this->getStreamMetaData();
        return \true === $metaData['timed_out'];
    }
    public function setStreamBlocking(bool $mode) : bool
    {
        return \stream_set_blocking($this->getStream(), $mode);
    }
    public function setStreamBuffer(int $buffer) : bool
    {
        $out = 0 === \stream_set_write_buffer($this->getStream(), $buffer);
        if (\true === $out) {
            $this->_bufferSize = $buffer;
        }
        return $out;
    }
    public function disableStreamBuffer() : bool
    {
        return $this->setStreamBuffer(0);
    }
    public function getStreamBufferSize() : int
    {
        return $this->_bufferSize;
    }
    public function getStreamWrapperName() : string
    {
        if (\false === ($pos = \strpos($this->getStreamName(), '://'))) {
            return 'file';
        }
        return \substr($this->getStreamName(), 0, $pos);
    }
    public function getStreamMetaData() : array
    {
        return \stream_get_meta_data($this->getStream());
    }
    public function isBorrowing() : bool
    {
        return $this->_borrowing;
    }
    public function _notify(int $ncode, int $severity, $message, $code, $transferred, $max)
    {
        static $_map = [\STREAM_NOTIFY_AUTH_REQUIRED => 'authrequire', \STREAM_NOTIFY_AUTH_RESULT => 'authresult', \STREAM_NOTIFY_COMPLETED => 'complete', \STREAM_NOTIFY_CONNECT => 'connect', \STREAM_NOTIFY_FAILURE => 'failure', \STREAM_NOTIFY_MIME_TYPE_IS => 'mimetype', \STREAM_NOTIFY_PROGRESS => 'progress', \STREAM_NOTIFY_REDIRECTED => 'redirect', \STREAM_NOTIFY_RESOLVE => 'resolve', \STREAM_NOTIFY_FILE_SIZE_IS => 'size'];
        $this->getListener()->fire($_map[$ncode], new EventBucket(['code' => $code, 'severity' => $severity, 'message' => $message, 'transferred' => $transferred, 'max' => $max]));
    }
    public static final function _Hoa_Stream()
    {
        foreach (self::$_register as $entry) {
            $entry[self::HANDLER]->close();
        }
        return;
    }
    public function __toString() : string
    {
        return $this->getStreamName();
    }
    public function __destruct()
    {
        if (\false === $this->isOpened()) {
            return;
        }
        $this->close();
        return;
    }
}
class _Protocol extends ProtocolNode
{
    protected $_name = 'Stream';
    public function reachId(string $id)
    {
        return Stream::getStreamHandler($id);
    }
}
\register_shutdown_function([Stream::class, '_Hoa_Stream']);
$protocol = Protocol::getInstance();
$protocol['Library'][] = new _Protocol();
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamTouchable extends IStream
{
    const OVERWRITE = \true;
    const DO_NOT_OVERWRITE = \false;
    const MAKE_DIRECTORY = \true;
    const DO_NOT_MAKE_DIRECTORY = \false;
    public function touch(int $time = -1, int $atime = -1) : bool;
    public function copy(string $to, bool $force = self::DO_NOT_OVERWRITE) : bool;
    public function move(string $name, bool $force = self::DO_NOT_OVERWRITE, bool $mkdir = self::DO_NOT_MAKE_DIRECTORY) : bool;
    public function delete() : bool;
    public function changeGroup($group) : bool;
    public function changeMode(int $mode) : bool;
    public function changeOwner($user) : bool;
    public static function umask(int $umask = null) : int;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class AutocompleterPath implements Autocompleter
{
    const PWD = null;
    protected $_root = null;
    protected $_iteratorFactory = null;
    public function __construct(string $root = null, \Closure $iteratorFactory = null)
    {
        if (null === $root) {
            $root = static::PWD;
        }
        if (null !== $root) {
            $this->setRoot($root);
        }
        if (null !== $iteratorFactory) {
            $this->setIteratorFactory($iteratorFactory);
        }
    }
    public function complete(&$prefix)
    {
        $root = $this->getRoot();
        if (static::PWD === $root) {
            $root = \getcwd();
        }
        $path = $root . \DIRECTORY_SEPARATOR . $prefix;
        if (!\is_dir($path)) {
            $path = \dirname($path) . \DIRECTORY_SEPARATOR;
            $prefix = \basename($prefix);
        } else {
            $prefix = null;
        }
        $iteratorFactory = $this->getIteratorFactory() ?: static::getDefaultIteratorFactory();
        try {
            $iterator = $iteratorFactory($path);
            $out = [];
            $length = \mb_strlen($prefix);
            foreach ($iterator as $fileinfo) {
                $filename = $fileinfo->getFilename();
                if (null === $prefix || \mb_substr($filename, 0, $length) === $prefix) {
                    if ($fileinfo->isDir()) {
                        $out[] = $filename . '/';
                    } else {
                        $out[] = $filename;
                    }
                }
            }
        } catch (\Exception $e) {
            return null;
        }
        $count = \count($out);
        if (1 === $count) {
            return $out[0];
        }
        if (0 === $count) {
            return null;
        }
        return $out;
    }
    public function getWordDefinition() : string
    {
        return '/?[\\w\\d\\_\\-\\.]+(/[\\w\\d\\_\\-\\.]*)*';
    }
    public function setRoot(string $root)
    {
        $old = $this->_root;
        $this->_root = $root;
        return $old;
    }
    public function getRoot()
    {
        return $this->_root;
    }
    public function setIteratorFactory(\Closure $iteratorFactory)
    {
        $old = $this->_iteratorFactory;
        $this->_iteratorFactory = $iteratorFactory;
        return $old;
    }
    public function getIteratorFactory()
    {
        return $this->_iteratorFactory;
    }
    public static function getDefaultIteratorFactory()
    {
        return function ($path) {
            return new \DirectoryIterator($path);
        };
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

trait EventListens
{
    protected $_listener = null;
    public function on(string $listenerId, $callable) : EventListenable
    {
        $listener = $this->getListener();
        if (null === $listener) {
            throw new EventException('Cannot attach a callable to the listener %s because ' . 'it has not been initialized yet.', 0, static::class);
        }
        $listener->attach($listenerId, $callable);
        return $this;
    }
    protected function setListener(EventListener $listener)
    {
        $old = $this->_listener;
        $this->_listener = $listener;
        return $old;
    }
    protected function getListener()
    {
        return $this->_listener;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ProtocolException extends Exception
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamOut extends IStream
{
    public function write(string $string, int $length);
    public function writeString(string $string);
    public function writeCharacter(string $character);
    public function writeBoolean(bool $boolean);
    public function writeInteger(int $integer);
    public function writeFloat(float $float);
    public function writeArray(array $array);
    public function writeLine(string $line);
    public function writeAll(string $string);
    public function truncate(int $size) : bool;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Console
{
    const IS_FIFO = 0;
    const IS_CHARACTER = 1;
    const IS_DIRECTORY = 2;
    const IS_BLOCK = 3;
    const IS_REGULAR = 4;
    const IS_LINK = 5;
    const IS_SOCKET = 6;
    const IS_WHITEOUT = 7;
    private static $_advanced = null;
    private static $_old = null;
    protected static $_mode = [];
    protected static $_input = null;
    protected static $_output = null;
    protected static $_tput = null;
    public static function advancedInteraction(bool $force = \false) : bool
    {
        if (null !== self::$_advanced) {
            return self::$_advanced;
        }
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return self::$_advanced = \false;
        }
        if (\false === $force && \true === \defined('STDIN') && \false === self::isDirect(\STDIN)) {
            return self::$_advanced = \false;
        }
        self::$_old = ConsoleProcessus::execute('stty -g < /dev/tty', \false);
        ConsoleProcessus::execute('stty -echo -icanon min 1 time 0 < /dev/tty', \false);
        return self::$_advanced = \true;
    }
    public static function restoreInteraction()
    {
        if (null === self::$_old) {
            return;
        }
        ConsoleProcessus::execute('stty ' . self::$_old . ' < /dev/tty', \false);
        return;
    }
    public static function getMode($pipe = \STDIN) : int
    {
        $_pipe = (int) $pipe;
        if (isset(self::$_mode[$_pipe])) {
            return self::$_mode[$_pipe];
        }
        $stat = \fstat($pipe);
        switch ($stat['mode'] & 0170000) {
            case 010000:
                $mode = self::IS_FIFO;
                break;
            case 020000:
                $mode = self::IS_CHARACTER;
                break;
            case 040000:
                $mode = self::IS_DIRECTORY;
                break;
            case 060000:
                $mode = self::IS_BLOCK;
                break;
            case 0100000:
                $mode = self::IS_REGULAR;
                break;
            case 0120000:
                $mode = self::IS_LINK;
                break;
            case 0140000:
                $mode = self::IS_SOCKET;
                break;
            case 0160000:
                $mode = self::IS_WHITEOUT;
                break;
            default:
                $mode = -1;
        }
        return self::$_mode[$_pipe] = $mode;
    }
    public static function isDirect($pipe) : bool
    {
        return self::IS_CHARACTER === self::getMode($pipe);
    }
    public static function isPipe($pipe) : bool
    {
        return self::IS_FIFO === self::getMode($pipe);
    }
    public static function isRedirection($pipe) : bool
    {
        $mode = self::getMode($pipe);
        return self::IS_REGULAR === $mode || self::IS_DIRECTORY === $mode || self::IS_LINK === $mode || self::IS_SOCKET === $mode || self::IS_BLOCK === $mode;
    }
    public static function setInput(ConsoleInput $input)
    {
        $old = static::$_input;
        static::$_input = $input;
        return $old;
    }
    public static function getInput() : ConsoleInput
    {
        if (null === static::$_input) {
            static::$_input = new ConsoleInput();
        }
        return static::$_input;
    }
    public static function setOutput(ConsoleOutput $output)
    {
        $old = static::$_output;
        static::$_output = $output;
        return $old;
    }
    public static function getOutput() : ConsoleOutput
    {
        if (null === static::$_output) {
            static::$_output = new ConsoleOutput();
        }
        return static::$_output;
    }
    public static function setTput(ConsoleTput $tput)
    {
        $old = static::$_tput;
        static::$_tput = $tput;
        return $old;
    }
    public static function getTput() : ConsoleTput
    {
        if (null === static::$_tput) {
            static::$_tput = new ConsoleTput();
        }
        return static::$_tput;
    }
    public static function isTmuxRunning() : bool
    {
        return isset($_SERVER['TMUX']);
    }
}
\register_shutdown_function([Console::class, 'restoreInteraction']);
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileException extends Exception
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileReadWrite extends File implements StreamIn, StreamOut
{
    public function __construct(string $streamName, string $mode = parent::MODE_APPEND_READ_WRITE, string $context = null, bool $wait = \false)
    {
        parent::__construct($streamName, $mode, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        static $createModes = [parent::MODE_READ_WRITE, parent::MODE_TRUNCATE_READ_WRITE, parent::MODE_APPEND_READ_WRITE, parent::MODE_CREATE_READ_WRITE];
        if (!\in_array($this->getMode(), $createModes)) {
            throw new FileException('Open mode are not supported; given %d. Only %s are supported.', 0, [$this->getMode(), \implode(', ', $createModes)]);
        }
        \preg_match('#^(\\w+)://#', $streamName, $match);
        if ((isset($match[1]) && $match[1] === 'file' || !isset($match[1])) && !\file_exists($streamName) && parent::MODE_READ_WRITE === $this->getMode()) {
            throw new FileDoesNotExistException('File %s does not exist.', 1, $streamName);
        }
        $out = parent::_open($streamName, $context);
        return $out;
    }
    public function eof() : bool
    {
        return \feof($this->getStream());
    }
    public function read(int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 2, $length);
        }
        return \fread($this->getStream(), $length);
    }
    public function readString(int $length)
    {
        return $this->read($length);
    }
    public function readCharacter()
    {
        return \fgetc($this->getStream());
    }
    public function readBoolean()
    {
        return (bool) $this->read(1);
    }
    public function readInteger(int $length = 1)
    {
        return (int) $this->read($length);
    }
    public function readFloat(int $length = 1)
    {
        return (float) $this->read($length);
    }
    public function readArray(string $format = null)
    {
        return $this->scanf($format);
    }
    public function readLine()
    {
        return \fgets($this->getStream());
    }
    public function readAll(int $offset = 0)
    {
        return \stream_get_contents($this->getStream(), -1, $offset);
    }
    public function scanf(string $format) : array
    {
        return \fscanf($this->getStream(), $format);
    }
    public function write(string $string, int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 3, $length);
        }
        return \fwrite($this->getStream(), $string, $length);
    }
    public function writeString(string $string)
    {
        $string = (string) $string;
        return $this->write($string, \strlen($string));
    }
    public function writeCharacter(string $char)
    {
        return $this->write((string) $char[0], 1);
    }
    public function writeBoolean(bool $boolean)
    {
        return $this->write((string) (bool) $boolean, 1);
    }
    public function writeInteger(int $integer)
    {
        $integer = (string) (int) $integer;
        return $this->write($integer, \strlen($integer));
    }
    public function writeFloat(float $float)
    {
        $float = (string) (float) $float;
        return $this->write($float, \strlen($float));
    }
    public function writeArray(array $array)
    {
        $array = \var_export($array, \true);
        return $this->write($array, \strlen($array));
    }
    public function writeLine(string $line)
    {
        if (\false === ($n = \strpos($line, "\n"))) {
            return $this->write($line . "\n", \strlen($line) + 1);
        }
        ++$n;
        return $this->write(\substr($line, 0, $n), $n);
    }
    public function writeAll(string $string)
    {
        return $this->write($string, \strlen($string));
    }
    public function truncate(int $size) : bool
    {
        return \ftruncate($this->getStream(), $size);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

abstract class FileGeneric extends Stream implements StreamPathable, StreamStatable, StreamTouchable
{
    protected $_mode = null;
    public function getBasename() : string
    {
        return \basename($this->getStreamName());
    }
    public function getDirname() : string
    {
        return \dirname($this->getStreamName());
    }
    public function getSize() : int
    {
        if (\false === $this->getStatistic()) {
            return \false;
        }
        return \filesize($this->getStreamName());
    }
    public function getStatistic() : array
    {
        return \fstat($this->getStream());
    }
    public function getATime() : int
    {
        return \fileatime($this->getStreamName());
    }
    public function getCTime() : int
    {
        return \filectime($this->getStreamName());
    }
    public function getMTime() : int
    {
        return \filemtime($this->getStreamName());
    }
    public function getGroup() : int
    {
        return \filegroup($this->getStreamName());
    }
    public function getOwner() : int
    {
        return \fileowner($this->getStreamName());
    }
    public function getPermissions() : int
    {
        return \fileperms($this->getStreamName());
    }
    public function getReadablePermissions() : string
    {
        $p = $this->getPermissions();
        if (($p & 0xc000) === 0xc000) {
            $out = 's';
        } elseif (($p & 0xa000) === 0xa000) {
            $out = 'l';
        } elseif (($p & 0x8000) === 0x8000) {
            $out = '-';
        } elseif (($p & 0x6000) === 0x6000) {
            $out = 'b';
        } elseif (($p & 0x4000) === 0x4000) {
            $out = 'd';
        } elseif (($p & 0x2000) === 0x2000) {
            $out = 'c';
        } elseif (($p & 0x1000) === 0x1000) {
            $out = 'p';
        } else {
            $out = 'u';
        }
        $out .= ($p & 0x100 ? 'r' : '-') . ($p & 0x80 ? 'w' : '-') . ($p & 0x40 ? $p & 0x800 ? 's' : 'x' : ($p & 0x800 ? 'S' : '-')) . ($p & 0x20 ? 'r' : '-') . ($p & 0x10 ? 'w' : '-') . ($p & 0x8 ? $p & 0x400 ? 's' : 'x' : ($p & 0x400 ? 'S' : '-')) . ($p & 0x4 ? 'r' : '-') . ($p & 0x2 ? 'w' : '-') . ($p & 0x1 ? $p & 0x200 ? 't' : 'x' : ($p & 0x200 ? 'T' : '-'));
        return $out;
    }
    public function isReadable() : bool
    {
        return \is_readable($this->getStreamName());
    }
    public function isWritable() : bool
    {
        return \is_writable($this->getStreamName());
    }
    public function isExecutable() : bool
    {
        return \is_executable($this->getStreamName());
    }
    public function clearStatisticCache()
    {
        \clearstatcache(\true, $this->getStreamName());
    }
    public static function clearAllStatisticCaches()
    {
        \clearstatcache();
    }
    public function touch(int $time = null, int $atime = null) : bool
    {
        if (null === $time) {
            $time = \time();
        }
        if (null === $atime) {
            $atime = $time;
        }
        return \touch($this->getStreamName(), $time, $atime);
    }
    public function copy(string $to, bool $force = StreamTouchable::DO_NOT_OVERWRITE) : bool
    {
        $from = $this->getStreamName();
        if ($force === StreamTouchable::DO_NOT_OVERWRITE && \true === \file_exists($to)) {
            return \true;
        }
        if (null === $this->getStreamContext()) {
            return @\copy($from, $to);
        }
        return @\copy($from, $to, $this->getStreamContext()->getContext());
    }
    public function move(string $name, bool $force = StreamTouchable::DO_NOT_OVERWRITE, bool $mkdir = StreamTouchable::DO_NOT_MAKE_DIRECTORY) : bool
    {
        $from = $this->getStreamName();
        if ($force === StreamTouchable::DO_NOT_OVERWRITE && \true === \file_exists($name)) {
            return \false;
        }
        if (StreamTouchable::MAKE_DIRECTORY === $mkdir) {
            FileDirectory::create(\dirname($name), FileDirectory::MODE_CREATE_RECURSIVE);
        }
        if (null === $this->getStreamContext()) {
            return @\rename($from, $name);
        }
        return @\rename($from, $name, $this->getStreamContext()->getContext());
    }
    public function delete() : bool
    {
        if (null === $this->getStreamContext()) {
            return @\unlink($this->getStreamName());
        }
        return @\unlink($this->getStreamName(), $this->getStreamContext()->getContext());
    }
    public function changeGroup($group) : bool
    {
        return \chgrp($this->getStreamName(), $group);
    }
    public function changeMode(int $mode) : bool
    {
        return \chmod($this->getStreamName(), $mode);
    }
    public function changeOwner($user) : bool
    {
        return \chown($this->getStreamName(), $user);
    }
    public static function umask(int $umask = null) : int
    {
        if (null === $umask) {
            return \umask();
        }
        return \umask($umask);
    }
    public function isFile() : bool
    {
        return \is_file($this->getStreamName());
    }
    public function isLink() : bool
    {
        return \is_link($this->getStreamName());
    }
    public function isDirectory() : bool
    {
        return \is_dir($this->getStreamName());
    }
    public function isSocket() : bool
    {
        return \filetype($this->getStreamName()) === 'socket';
    }
    public function isFIFOPipe() : bool
    {
        return \filetype($this->getStreamName()) === 'fifo';
    }
    public function isCharacterSpecial() : bool
    {
        return \filetype($this->getStreamName()) === 'char';
    }
    public function isBlockSpecial() : bool
    {
        return \filetype($this->getStreamName()) === 'block';
    }
    public function isUnknown() : bool
    {
        return \filetype($this->getStreamName()) === 'unknown';
    }
    protected function setMode(string $mode)
    {
        $old = $this->_mode;
        $this->_mode = $mode;
        return $old;
    }
    public function getMode()
    {
        return $this->_mode;
    }
    public function getINode() : int
    {
        return \fileinode($this->getStreamName());
    }
    public static function isCaseSensitive() : bool
    {
        return !(\file_exists(\mb_strtolower(__FILE__)) && \file_exists(\mb_strtoupper(__FILE__)));
    }
    public function getRealPath() : string
    {
        if (\false === ($out = \realpath($this->getStreamName()))) {
            return $this->getStreamName();
        }
        return $out;
    }
    public function getExtension() : string
    {
        return \pathinfo($this->getStreamName(), \PATHINFO_EXTENSION);
    }
    public function getFilename() : string
    {
        $file = \basename($this->getStreamName());
        if (\defined('PATHINFO_FILENAME')) {
            return \pathinfo($file, \PATHINFO_FILENAME);
        }
        if (\strstr($file, '.')) {
            return \substr($file, 0, \strrpos($file, '.'));
        }
        return $file;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class StreamException extends Exception
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ExceptionIdle extends \Exception
{
    protected $_tmpArguments = null;
    protected $_arguments = null;
    protected $_trace = null;
    protected $_previous = null;
    protected $_rawMessage = null;
    public function __construct(string $message, int $code = 0, $arguments = [], \Exception $previous = null)
    {
        $this->_tmpArguments = $arguments;
        parent::__construct($message, $code, $previous);
        $this->_rawMessage = $message;
        $this->message = @\vsprintf($message, $this->getArguments());
        return;
    }
    public function getBacktrace()
    {
        if (null === $this->_trace) {
            $this->_trace = $this->getTrace();
        }
        return $this->_trace;
    }
    public function getPreviousThrow()
    {
        if (null === $this->_previous) {
            $this->_previous = $this->getPrevious();
        }
        return $this->_previous;
    }
    public function getArguments()
    {
        if (null === $this->_arguments) {
            $arguments = $this->_tmpArguments;
            if (!\is_array($arguments)) {
                $arguments = [$arguments];
            }
            foreach ($arguments as &$value) {
                if (null === $value) {
                    $value = '(null)';
                }
            }
            $this->_arguments = $arguments;
            unset($this->_tmpArguments);
        }
        return $this->_arguments;
    }
    public function getRawMessage() : string
    {
        return $this->_rawMessage;
    }
    public function getFormattedMessage() : string
    {
        return $this->getMessage();
    }
    public function getFrom() : string
    {
        $trace = $this->getBacktrace();
        $from = '{main}';
        if (!empty($trace)) {
            $t = $trace[0];
            $from = '';
            if (isset($t['class'])) {
                $from .= $t['class'] . '::';
            }
            if (isset($t['function'])) {
                $from .= $t['function'] . '()';
            }
        }
        return $from;
    }
    public function raise(bool $includePrevious = \false) : string
    {
        $message = $this->getFormattedMessage();
        $trace = $this->getBacktrace();
        $file = '/dev/null';
        $line = -1;
        $pre = $this->getFrom();
        if (!empty($trace)) {
            $file = $trace['file'] ?? null;
            $line = $trace['line'] ?? null;
        }
        $pre .= ': ';
        try {
            $out = $pre . '(' . $this->getCode() . ') ' . $message . "\n" . 'in ' . $this->getFile() . ' at line ' . $this->getLine() . '.';
        } catch (\Exception $e) {
            $out = $pre . '(' . $this->getCode() . ') ' . $message . "\n" . 'in ' . $file . ' around line ' . $line . '.';
        }
        if (\true === $includePrevious && null !== ($previous = $this->getPreviousThrow())) {
            $out .= "\n\n" . '    â¬‡' . "\n\n" . 'Nested exception (' . \get_class($previous) . '):' . "\n" . ($previous instanceof self ? $previous->raise(\true) : $previous->getMessage());
        }
        return $out;
    }
    public static function uncaught(\Throwable $exception)
    {
        if (!$exception instanceof self) {
            throw $exception;
        }
        while (0 < \ob_get_level()) {
            \ob_end_flush();
        }
        echo 'Uncaught exception (' . \get_class($exception) . '):' . "\n" . $exception->raise(\true);
    }
    public function __toString() : string
    {
        return $this->raise();
    }
    public static function enableUncaughtHandler(bool $enable = \true)
    {
        if (\false === $enable) {
            return \restore_exception_handler();
        }
        return \set_exception_handler(function ($exception) {
            return self::uncaught($exception);
        });
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class IteratorFileSystem extends \FilesystemIterator
{
    protected $_splFileInfoClass = null;
    public function __construct(string $path, int $flags = null, string $splFileInfoClass = null)
    {
        $this->_splFileInfoClass = $splFileInfoClass;
        if (null === $flags) {
            parent::__construct($path);
        } else {
            parent::__construct($path, $flags);
        }
        return;
    }
    #[\ReturnTypeWillChange]
    public function current()
    {
        $out = parent::current();
        if (null !== $this->_splFileInfoClass && $out instanceof \SplFileInfo) {
            $out->setInfoClass($this->_splFileInfoClass);
            $out = $out->getFileInfo();
        }
        return $out;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamLockable extends IStream
{
    /**
    @const
    */
    const LOCK_SHARED = \LOCK_SH;
    /**
    @const
    */
    const LOCK_EXCLUSIVE = \LOCK_EX;
    /**
    @const
    */
    const LOCK_RELEASE = \LOCK_UN;
    /**
    @const
    */
    const LOCK_NO_BLOCK = \LOCK_NB;
    public function lock(int $operation) : bool;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleOutput implements StreamOut
{
    protected $_considerMultiplexer = \false;
    protected $_output = null;
    public function __construct(StreamOut $output = null)
    {
        $this->_output = $output;
        return;
    }
    public function getStream() : StreamOut
    {
        return $this->_output;
    }
    public function write(string $string, int $length)
    {
        if (0 > $length) {
            throw new ConsoleException('Length must be greater than 0, given %d.', 0, $length);
        }
        $out = \substr($string, 0, $length);
        if (\true === $this->isMultiplexerConsidered()) {
            if (\true === Console::isTmuxRunning()) {
                $out = "\x1bPtmux;" . \str_replace("\x1b", "\x1b\x1b", $out) . "\x1b\\";
            }
            $length = \strlen($out);
        }
        if (null === $this->_output) {
            echo $out;
        } else {
            $this->_output->write($out, $length);
        }
    }
    public function writeString(string $string)
    {
        $string = (string) $string;
        return $this->write($string, \strlen($string));
    }
    public function writeCharacter(string $character)
    {
        return $this->write((string) $character[0], 1);
    }
    public function writeBoolean(bool $boolean)
    {
        return $this->write((bool) $boolean ? '1' : '0', 1);
    }
    public function writeInteger(int $integer)
    {
        $integer = (string) (int) $integer;
        return $this->write($integer, \strlen($integer));
    }
    public function writeFloat(float $float)
    {
        $float = (string) (float) $float;
        return $this->write($float, \strlen($float));
    }
    public function writeArray(array $array)
    {
        $array = \var_export($array, \true);
        return $this->write($array, \strlen($array));
    }
    public function writeLine(string $line)
    {
        if (\false === ($n = \strpos($line, "\n"))) {
            return $this->write($line . "\n", \strlen($line) + 1);
        }
        ++$n;
        return $this->write(\substr($line, 0, $n), $n);
    }
    public function writeAll(string $string)
    {
        return $this->write($string ?? '', \strlen($string ?? ''));
    }
    public function truncate(int $size) : bool
    {
        return \false;
    }
    public function considerMultiplexer(bool $consider) : bool
    {
        $old = $this->_considerMultiplexer;
        $this->_considerMultiplexer = $consider;
        return $old;
    }
    public function isMultiplexerConsidered() : bool
    {
        return $this->_considerMultiplexer;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class EventBucket
{
    protected $_source = null;
    protected $_data = null;
    public function __construct($data = null)
    {
        $this->setData($data);
        return;
    }
    public function send(string $eventId, EventSource $source)
    {
        return Event::notify($eventId, $source, $this);
    }
    public function setSource(EventSource $source)
    {
        $old = $this->_source;
        $this->_source = $source;
        return $old;
    }
    public function getSource()
    {
        return $this->_source;
    }
    public function setData($data)
    {
        $old = $this->_data;
        $this->_data = $data;
        return $old;
    }
    public function getData()
    {
        return $this->_data;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamPointable extends IStream
{
    const SEEK_SET = \SEEK_SET;
    const SEEK_CURRENT = \SEEK_CUR;
    const SEEK_END = \SEEK_END;
    public function rewind() : bool;
    public function seek(int $offset, int $whence = self::SEEK_SET) : int;
    public function tell() : int;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface EventSource
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class Exception extends ExceptionIdle implements EventSource
{
    public function __construct(string $message, int $code = 0, $arguments = [], \Throwable $previous = null)
    {
        parent::__construct($message, $code, $arguments, $previous);
        if (\false === Event::eventExists('hoa://Event/Exception')) {
            Event::register('hoa://Event/Exception', __CLASS__);
        }
        $this->send();
        return;
    }
    public function send()
    {
        Event::notify('hoa://Event/Exception', $this, new EventBucket($this));
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileDirectory extends FileGeneric
{
    const MODE_READ = 'rb';
    const MODE_CREATE = 'xb';
    const MODE_CREATE_RECURSIVE = 'xrb';
    public function __construct(string $streamName, string $mode = self::MODE_READ, string $context = null, bool $wait = \false)
    {
        $this->setMode($mode);
        parent::__construct($streamName, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        if (\false === \is_dir($streamName)) {
            if ($this->getMode() === self::MODE_READ) {
                throw new FileDoesNotExistException('Directory %s does not exist.', 0, $streamName);
            } else {
                self::create($streamName, $this->getMode(), null !== $context ? $context->getContext() : null);
            }
        }
        $out = null;
        return $out;
    }
    protected function _close() : bool
    {
        return \true;
    }
    public function copy(string $to, bool $force = StreamTouchable::DO_NOT_OVERWRITE) : bool
    {
        if (empty($to)) {
            throw new FileException('The destination path (to copy) is empty.', 1);
        }
        $from = $this->getStreamName();
        $fromLength = \strlen($from) + 1;
        $finder = new FileFinder();
        $finder->in($from);
        self::create($to, self::MODE_CREATE_RECURSIVE);
        foreach ($finder as $file) {
            $relative = \substr($file->getPathname(), $fromLength);
            $_to = $to . \DIRECTORY_SEPARATOR . $relative;
            if (\true === $file->isDir()) {
                self::create($_to, self::MODE_CREATE);
                continue;
            }
            $handle = null;
            if (\true === $file->isFile()) {
                $handle = new FileRead($file->getPathname());
            } elseif (\true === $file->isDir()) {
                $handle = new self($file->getPathName());
            } elseif (\true === $file->isLink()) {
                $handle = new FileLinkRead($file->getPathName());
            }
            if (null !== $handle) {
                $handle->copy($_to, $force);
                $handle->close();
            }
        }
        return \true;
    }
    public function delete() : bool
    {
        $from = $this->getStreamName();
        $finder = new FileFinder();
        $finder->in($from)->childFirst();
        foreach ($finder as $file) {
            $file->open()->delete();
            $file->close();
        }
        if (null === $this->getStreamContext()) {
            return @\rmdir($from);
        }
        return @\rmdir($from, $this->getStreamContext()->getContext());
    }
    public static function create(string $name, string $mode = self::MODE_CREATE_RECURSIVE, string $context = null) : bool
    {
        if (\true === \is_dir($name)) {
            return \true;
        }
        if (empty($name)) {
            return \false;
        }
        if (null !== $context) {
            if (\false === StreamContext::contextExists($context)) {
                throw new FileException('Context %s was not previously declared, cannot retrieve ' . 'this context.', 2, $context);
            } else {
                $context = StreamContext::getInstance($context);
            }
        }
        if (null === $context) {
            return @\mkdir($name, 0755, self::MODE_CREATE_RECURSIVE === $mode);
        }
        return @\mkdir($name, 0755, self::MODE_CREATE_RECURSIVE === $mode, $context->getContext());
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ProtocolWrapper
{
    private $_stream = null;
    private $_streamName = null;
    public $context = null;
    public static function realPath(string $path, bool $exists = \true)
    {
        return ProtocolNode::getRoot()->resolve($path, $exists);
    }
    public function stream_cast(int $castAs)
    {
        return null;
    }
    public function stream_close()
    {
        if (\true === @\fclose($this->getStream())) {
            $this->_stream = null;
            $this->_streamName = null;
        }
    }
    public function stream_eof() : bool
    {
        return \feof($this->getStream());
    }
    public function stream_flush() : bool
    {
        return \fflush($this->getStream());
    }
    public function stream_lock(int $operation) : bool
    {
        return \flock($this->getStream(), $operation);
    }
    public function stream_metadata(string $path, int $option, $values) : bool
    {
        $path = static::realPath($path, \false);
        switch ($option) {
            case \STREAM_META_TOUCH:
                $arity = \count($values);
                if (0 === $arity) {
                    $out = \touch($path);
                } elseif (1 === $arity) {
                    $out = \touch($path, $values[0]);
                } else {
                    $out = \touch($path, $values[0], $values[1]);
                }
                break;
            case \STREAM_META_OWNER_NAME:
            case \STREAM_META_OWNER:
                $out = \chown($path, $values);
                break;
            case \STREAM_META_GROUP_NAME:
            case \STREAM_META_GROUP:
                $out = \chgrp($path, $values);
                break;
            case \STREAM_META_ACCESS:
                $out = \chmod($path, $values);
                break;
            default:
                $out = \false;
        }
        return $out;
    }
    public function stream_open(string $path, string $mode, int $options, &$openedPath) : bool
    {
        $path = static::realPath($path, 'r' === $mode[0]);
        if (Protocol::NO_RESOLUTION === $path) {
            return \false;
        }
        if (null === $this->context) {
            $openedPath = \fopen($path, $mode, $options & \STREAM_USE_PATH);
        } else {
            $openedPath = \fopen($path, $mode, (bool) ($options & \STREAM_USE_PATH), $this->context);
        }
        if (\false === \is_resource($openedPath)) {
            return \false;
        }
        $this->_stream = $openedPath;
        $this->_streamName = $path;
        return \true;
    }
    public function stream_read(int $size) : string
    {
        return \fread($this->getStream(), $size);
    }
    public function stream_seek(int $offset, int $whence = \SEEK_SET) : bool
    {
        return 0 === \fseek($this->getStream(), $offset, $whence);
    }
    public function stream_stat() : array
    {
        return \fstat($this->getStream());
    }
    public function stream_tell() : int
    {
        return \ftell($this->getStream());
    }
    public function stream_truncate(int $size) : bool
    {
        return \ftruncate($this->getStream(), $size);
    }
    public function stream_write(string $data) : int
    {
        return \fwrite($this->getStream(), $data);
    }
    public function dir_closedir()
    {
        \closedir($this->getStream());
        $this->_stream = null;
        $this->_streamName = null;
    }
    public function dir_opendir(string $path, int $options) : bool
    {
        $path = static::realPath($path);
        $handle = null;
        if (null === $this->context) {
            $handle = @\opendir($path);
        } else {
            $handle = @\opendir($path, $this->context);
        }
        if (\false === $handle) {
            return \false;
        }
        $this->_stream = $handle;
        $this->_streamName = $path;
        return \true;
    }
    public function dir_readdir()
    {
        return \readdir($this->getStream());
    }
    public function dir_rewinddir()
    {
        \rewinddir($this->getStream());
    }
    public function mkdir(string $path, int $mode, int $options) : bool
    {
        if (null === $this->context) {
            return \mkdir(static::realPath($path, \false), $mode, $options | \STREAM_MKDIR_RECURSIVE);
        }
        return \mkdir(static::realPath($path, \false), $mode, (bool) ($options | \STREAM_MKDIR_RECURSIVE), $this->context);
    }
    public function rename(string $from, string $to) : bool
    {
        if (null === $this->context) {
            return \rename(static::realPath($from), static::realPath($to, \false));
        }
        return \rename(static::realPath($from), static::realPath($to, \false), $this->context);
    }
    public function rmdir(string $path, int $options) : bool
    {
        if (null === $this->context) {
            return \rmdir(static::realPath($path));
        }
        return \rmdir(static::realPath($path), $this->context);
    }
    public function unlink(string $path) : bool
    {
        if (null === $this->context) {
            return \unlink(static::realPath($path));
        }
        return \unlink(static::realPath($path), $this->context);
    }
    public function url_stat(string $path, int $flags)
    {
        $path = static::realPath($path);
        if (Protocol::NO_RESOLUTION === $path) {
            if ($flags & \STREAM_URL_STAT_QUIET) {
                return 0;
            } else {
                return \trigger_error('Path ' . $path . ' cannot be resolved.', \E_WARNING);
            }
        }
        if ($flags & \STREAM_URL_STAT_LINK) {
            return @\lstat($path);
        }
        return @\stat($path);
    }
    public function getStream()
    {
        return $this->_stream;
    }
    public function getStreamName()
    {
        return $this->_streamName;
    }
}
\stream_wrapper_register('hoa', ProtocolWrapper::class);
<?php

namespace Cvphar\Psy\Readline\Hoa;

interface StreamPathable extends IStream
{
    public function getBasename() : string;
    public function getDirname() : string;
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class EventException extends Exception
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleTput
{
    protected static $_booleans = ['auto_left_margin', 'auto_right_margin', 'no_esc_ctlc', 'ceol_standout_glitch', 'eat_newline_glitch', 'erase_overstrike', 'generic_type', 'hard_copy', 'meta_key', 'status_line', 'insert_null_glitch', 'memory_above', 'memory_below', 'move_insert_mode', 'move_standout_mode', 'over_strike', 'status_line_esc_ok', 'dest_tabs_magic_smso', 'tilde_glitch', 'transparent_underline', 'xon_xoff', 'needs_xon_xoff', 'prtr_silent', 'hard_cursor', 'non_rev_rmcup', 'no_pad_char', 'non_dest_scroll_region', 'can_change', 'back_color_erase', 'hue_lightness_saturation', 'col_addr_glitch', 'cr_cancels_micro_mode', 'print_wheel', 'row_addr_glitch', 'semi_auto_right_margin', 'cpi_changes_res', 'lpi_changes_res', 'backspaces_with_bs', 'crt_no_scrolling', 'no_correctly_working_cr', 'gnu_meta_key', 'linefeed_is_newline', 'hardware_tabs', 'return_does_clr_eol'];
    protected static $_numbers = ['columns', 'init_tabs', 'lines', 'lines_of_memory', 'magic_cookie_glitch', 'padding_baud_rate', 'virtual_terminal', 'width_status_line', 'num_labels', 'label_height', 'label_width', 'max_attributes', 'maximum_windows', 'max_colors', 'max_pairs', 'no_color_video', 'buffer_capacity', 'dot_vert_spacing', 'dot_horz_spacing', 'max_micro_address', 'max_micro_jump', 'micro_col_size', 'micro_line_size', 'number_of_pins', 'output_res_char', 'output_res_line', 'output_res_horz_inch', 'output_res_vert_inch', 'print_rate', 'wide_char_size', 'buttons', 'bit_image_entwining', 'bit_image_type', 'magic_cookie_glitch_ul', 'carriage_return_delay', 'new_line_delay', 'backspace_delay', 'horizontal_tab_delay', 'number_of_function_keys'];
    protected static $_strings = ['back_tab', 'bell', 'carriage_return', 'change_scroll_region', 'clear_all_tabs', 'clear_screen', 'clr_eol', 'clr_eos', 'column_address', 'command_character', 'cursor_address', 'cursor_down', 'cursor_home', 'cursor_invisible', 'cursor_left', 'cursor_mem_address', 'cursor_normal', 'cursor_right', 'cursor_to_ll', 'cursor_up', 'cursor_visible', 'delete_character', 'delete_line', 'dis_status_line', 'down_half_line', 'enter_alt_charset_mode', 'enter_blink_mode', 'enter_bold_mode', 'enter_ca_mode', 'enter_delete_mode', 'enter_dim_mode', 'enter_insert_mode', 'enter_secure_mode', 'enter_protected_mode', 'enter_reverse_mode', 'enter_standout_mode', 'enter_underline_mode', 'erase_chars', 'exit_alt_charset_mode', 'exit_attribute_mode', 'exit_ca_mode', 'exit_delete_mode', 'exit_insert_mode', 'exit_standout_mode', 'exit_underline_mode', 'flash_screen', 'form_feed', 'from_status_line', 'init_1string', 'init_2string', 'init_3string', 'init_file', 'insert_character', 'insert_line', 'insert_padding', 'key_backspace', 'key_catab', 'key_clear', 'key_ctab', 'key_dc', 'key_dl', 'key_down', 'key_eic', 'key_eol', 'key_eos', 'key_f0', 'key_f1', 'key_f10', 'key_f2', 'key_f3', 'key_f4', 'key_f5', 'key_f6', 'key_f7', 'key_f8', 'key_f9', 'key_home', 'key_ic', 'key_il', 'key_left', 'key_ll', 'key_npage', 'key_ppage', 'key_right', 'key_sf', 'key_sr', 'key_stab', 'key_up', 'keypad_local', 'keypad_xmit', 'lab_f0', 'lab_f1', 'lab_f10', 'lab_f2', 'lab_f3', 'lab_f4', 'lab_f5', 'lab_f6', 'lab_f7', 'lab_f8', 'lab_f9', 'meta_off', 'meta_on', 'newline', 'pad_char', 'parm_dch', 'parm_delete_line', 'parm_down_cursor', 'parm_ich', 'parm_index', 'parm_insert_line', 'parm_left_cursor', 'parm_right_cursor', 'parm_rindex', 'parm_up_cursor', 'pkey_key', 'pkey_local', 'pkey_xmit', 'print_screen', 'prtr_off', 'prtr_on', 'repeat_char', 'reset_1string', 'reset_2string', 'reset_3string', 'reset_file', 'restore_cursor', 'row_address', 'save_cursor', 'scroll_forward', 'scroll_reverse', 'set_attributes', 'set_tab', 'set_window', 'tab', 'to_status_line', 'underline_char', 'up_half_line', 'init_prog', 'key_a1', 'key_a3', 'key_b2', 'key_c1', 'key_c3', 'prtr_non', 'char_padding', 'acs_chars', 'plab_norm', 'key_btab', 'enter_xon_mode', 'exit_xon_mode', 'enter_am_mode', 'exit_am_mode', 'xon_character', 'xoff_character', 'ena_acs', 'label_on', 'label_off', 'key_beg', 'key_cancel', 'key_close', 'key_command', 'key_copy', 'key_create', 'key_end', 'key_enter', 'key_exit', 'key_find', 'key_help', 'key_mark', 'key_message', 'key_move', 'key_next', 'key_open', 'key_options', 'key_previous', 'key_print', 'key_redo', 'key_reference', 'key_refresh', 'key_replace', 'key_restart', 'key_resume', 'key_save', 'key_suspend', 'key_undo', 'key_sbeg', 'key_scancel', 'key_scommand', 'key_scopy', 'key_screate', 'key_sdc', 'key_sdl', 'key_select', 'key_send', 'key_seol', 'key_sexit', 'key_sfind', 'key_shelp', 'key_shome', 'key_sic', 'key_sleft', 'key_smessage', 'key_smove', 'key_snext', 'key_soptions', 'key_sprevious', 'key_sprint', 'key_sredo', 'key_sreplace', 'key_sright', 'key_srsume', 'key_ssave', 'key_ssuspend', 'key_sundo', 'req_for_input', 'key_f11', 'key_f12', 'key_f13', 'key_f14', 'key_f15', 'key_f16', 'key_f17', 'key_f18', 'key_f19', 'key_f20', 'key_f21', 'key_f22', 'key_f23', 'key_f24', 'key_f25', 'key_f26', 'key_f27', 'key_f28', 'key_f29', 'key_f30', 'key_f31', 'key_f32', 'key_f33', 'key_f34', 'key_f35', 'key_f36', 'key_f37', 'key_f38', 'key_f39', 'key_f40', 'key_f41', 'key_f42', 'key_f43', 'key_f44', 'key_f45', 'key_f46', 'key_f47', 'key_f48', 'key_f49', 'key_f50', 'key_f51', 'key_f52', 'key_f53', 'key_f54', 'key_f55', 'key_f56', 'key_f57', 'key_f58', 'key_f59', 'key_f60', 'key_f61', 'key_f62', 'key_f63', 'clr_bol', 'clear_margins', 'set_left_margin', 'set_right_margin', 'label_format', 'set_clock', 'display_clock', 'remove_clock', 'create_window', 'goto_window', 'hangup', 'dial_phone', 'quick_dial', 'tone', 'pulse', 'flash_hook', 'fixed_pause', 'wait_tone', 'user0', 'user1', 'user2', 'user3', 'user4', 'user5', 'user6', 'user7', 'user8', 'user9', 'orig_pair', 'orig_colors', 'initialize_color', 'initialize_pair', 'set_color_pair', 'set_foreground', 'set_background', 'change_char_pitch', 'change_line_pitch', 'change_res_horz', 'change_res_vert', 'define_char', 'enter_doublewide_mode', 'enter_draft_quality', 'enter_italics_mode', 'enter_leftward_mode', 'enter_micro_mode', 'enter_near_letter_quality', 'enter_normal_quality', 'enter_shadow_mode', 'enter_subscript_mode', 'enter_superscript_mode', 'enter_upward_mode', 'exit_doublewide_mode', 'exit_italics_mode', 'exit_leftward_mode', 'exit_micro_mode', 'exit_shadow_mode', 'exit_subscript_mode', 'exit_superscript_mode', 'exit_upward_mode', 'micro_column_address', 'micro_down', 'micro_left', 'micro_right', 'micro_row_address', 'micro_up', 'order_of_pins', 'parm_down_micro', 'parm_left_micro', 'parm_right_micro', 'parm_up_micro', 'select_char_set', 'set_bottom_margin', 'set_bottom_margin_parm', 'set_left_margin_parm', 'set_right_margin_parm', 'set_top_margin', 'set_top_margin_parm', 'start_bit_image', 'start_char_set_def', 'stop_bit_image', 'stop_char_set_def', 'subscript_characters', 'superscript_characters', 'these_cause_cr', 'zero_motion', 'char_set_names', 'key_mouse', 'mouse_info', 'req_mouse_pos', 'get_mouse', 'set_a_foreground', 'set_a_background', 'pkey_plab', 'device_type', 'code_set_init', 'set0_des_seq', 'set1_des_seq', 'set2_des_seq', 'set3_des_seq', 'set_lr_margin', 'set_tb_margin', 'bit_image_repeat', 'bit_image_newline', 'bit_image_carriage_return', 'color_names', 'define_bit_image_region', 'end_bit_image_region', 'set_color_band', 'set_page_length', 'display_pc_char', 'enter_pc_charset_mode', 'exit_pc_charset_mode', 'enter_scancode_mode', 'exit_scancode_mode', 'pc_term_options', 'scancode_escape', 'alt_scancode_esc', 'enter_horizontal_hl_mode', 'enter_left_hl_mode', 'enter_low_hl_mode', 'enter_right_hl_mode', 'enter_top_hl_mode', 'enter_vertical_hl_mode', 'set_a_attributes', 'set_pglen_inch', 'termcap_init2', 'termcap_reset', 'linefeed_if_not_lf', 'backspace_if_not_bs', 'other_non_function_keys', 'arrow_key_map', 'acs_ulcorner', 'acs_llcorner', 'acs_urcorner', 'acs_lrcorner', 'acs_ltee', 'acs_rtee', 'acs_btee', 'acs_ttee', 'acs_hline', 'acs_vline', 'acs_plus', 'memory_lock', 'memory_unlock', 'box_chars_1'];
    protected $_informations = [];
    public function __construct($terminfo = null)
    {
        if (null === $terminfo) {
            $terminfo = static::getTerminfo();
        }
        $this->parse($terminfo);
        return;
    }
    protected function parse(string $terminfo) : array
    {
        if (!\file_exists($terminfo)) {
            throw new ConsoleException('Terminfo file %s does not exist.', 0, $terminfo);
        }
        $data = \file_get_contents($terminfo);
        $length = \strlen($data);
        $out = ['file' => $terminfo];
        $headers = ['data_size' => $length, 'header_size' => 12, 'magic_number' => \ord($data[1]) << 8 | \ord($data[0]), 'names_size' => \ord($data[3]) << 8 | \ord($data[2]), 'bool_count' => \ord($data[5]) << 8 | \ord($data[4]), 'number_count' => \ord($data[7]) << 8 | \ord($data[6]), 'string_count' => \ord($data[9]) << 8 | \ord($data[8]), 'string_table_size' => \ord($data[11]) << 8 | \ord($data[10])];
        $out['headers'] = $headers;
        $i = $headers['header_size'];
        $nameAndDescription = \explode('|', \substr($data, $i, $headers['names_size'] - 1));
        $out['name'] = $nameAndDescription[0];
        $out['description'] = $nameAndDescription[1];
        $i += $headers['names_size'];
        $booleans = [];
        $booleanNames =& static::$_booleans;
        for ($e = 0, $max = $i + $headers['bool_count']; $i < $max; ++$e, ++$i) {
            $booleans[$booleanNames[$e]] = 1 === \ord($data[$i]);
        }
        $out['booleans'] = $booleans;
        if (1 === $i % 2) {
            ++$i;
        }
        $numbers = [];
        $numberNames =& static::$_numbers;
        for ($e = 0, $max = $i + $headers['number_count'] * 2; $i < $max; ++$e, $i += 2) {
            $name = $numberNames[$e];
            $data_i0 = \ord($data[$i]);
            $data_i1 = \ord($data[$i + 1]);
            if ($data_i1 === 255 && $data_i0 === 255) {
                $numbers[$name] = -1;
            } else {
                $numbers[$name] = $data_i1 << 8 | $data_i0;
            }
        }
        $out['numbers'] = $numbers;
        $strings = [];
        $stringNames =& static::$_strings;
        $ii = $i + $headers['string_count'] * 2;
        for ($e = 0, $max = $ii; $i < $max; ++$e, $i += 2) {
            $name = $stringNames[$e];
            $data_i0 = \ord($data[$i]);
            $data_i1 = \ord($data[$i + 1]);
            if ($data_i1 === 255 && $data_i0 === 255) {
                continue;
            }
            $a = $data_i1 << 8 | $data_i0;
            $strings[$name] = $a;
            if (65534 === $a) {
                continue;
            }
            $b = $ii + $a;
            $c = $b;
            while ($c < $length && \ord($data[$c])) {
                $c++;
            }
            $value = \substr($data, $b, $c - $b);
            $strings[$name] = \false !== $value ? $value : null;
        }
        $out['strings'] = $strings;
        return $this->_informations = $out;
    }
    public function getInformations() : array
    {
        return $this->_informations;
    }
    public function has(string $boolean) : bool
    {
        if (!isset($this->_informations['booleans'][$boolean])) {
            return \false;
        }
        return $this->_informations['booleans'][$boolean];
    }
    public function count(string $number) : int
    {
        if (!isset($this->_informations['numbers'][$number])) {
            return 0;
        }
        return $this->_informations['numbers'][$number];
    }
    public function get(string $string)
    {
        if (!isset($this->_informations['strings'][$string])) {
            return null;
        }
        return $this->_informations['strings'][$string];
    }
    public static function getTerm() : string
    {
        return isset($_SERVER['TERM']) && !empty($_SERVER['TERM']) ? $_SERVER['TERM'] : (\defined('PHP_WINDOWS_VERSION_PLATFORM') ? 'windows-ansi' : 'xterm');
    }
    public static function getTerminfo($term = null) : string
    {
        $paths = [];
        if (isset($_SERVER['TERMINFO'])) {
            $paths[] = $_SERVER['TERMINFO'];
        }
        if (isset($_SERVER['HOME'])) {
            $paths[] = $_SERVER['HOME'] . \DIRECTORY_SEPARATOR . '.terminfo';
        }
        if (isset($_SERVER['TERMINFO_DIRS'])) {
            foreach (\explode(':', $_SERVER['TERMINFO_DIRS']) as $path) {
                $paths[] = $path;
            }
        }
        $paths[] = '/usr/share/terminfo';
        $paths[] = '/usr/share/lib/terminfo';
        $paths[] = '/lib/terminfo';
        $paths[] = '/usr/lib/terminfo';
        $paths[] = '/usr/local/share/terminfo';
        $paths[] = '/usr/local/share/lib/terminfo';
        $paths[] = '/usr/local/lib/terminfo';
        $paths[] = '/usr/local/ncurses/lib/terminfo';
        $paths[] = 'hoa://Library/Terminfo';
        $term = $term ?: static::getTerm();
        $fileHexa = \dechex(\ord($term[0])) . \DIRECTORY_SEPARATOR . $term;
        $fileAlpha = $term[0] . \DIRECTORY_SEPARATOR . $term;
        $pathname = null;
        foreach ($paths as $path) {
            if (\file_exists($_ = $path . \DIRECTORY_SEPARATOR . $fileHexa) || \file_exists($_ = $path . \DIRECTORY_SEPARATOR . $fileAlpha)) {
                $pathname = $_;
                break;
            }
        }
        if (null === $pathname && 'xterm' !== $term) {
            return static::getTerminfo('xterm');
        }
        return $pathname ?? '';
    }
    public static function isSupported() : bool
    {
        if (static::getTerminfo() === '') {
            return \false;
        }
        $requiredVars = ['clear_screen', 'clr_bol', 'clr_eol', 'clr_eos', 'initialize_color', 'parm_down_cursor', 'parm_index', 'parm_left_cursor', 'parm_right_cursor', 'parm_rindex', 'parm_up_cursor', 'user6', 'user7'];
        $tput = new self();
        foreach ($requiredVars as $var) {
            if ($tput->get($var) === null) {
                return \false;
            }
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleException extends Exception
{
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileLinkRead extends FileLink implements StreamIn
{
    public function __construct(string $streamName, string $mode = parent::MODE_READ, string $context = null, bool $wait = \false)
    {
        parent::__construct($streamName, $mode, $context, $wait);
        return;
    }
    protected function &_open(string $streamName, StreamContext $context = null)
    {
        static $createModes = [parent::MODE_READ];
        if (!\in_array($this->getMode(), $createModes)) {
            throw new FileException('Open mode are not supported; given %d. Only %s are supported.', 0, [$this->getMode(), \implode(', ', $createModes)]);
        }
        \preg_match('#^(\\w+)://#', $streamName, $match);
        if ((isset($match[1]) && $match[1] === 'file' || !isset($match[1])) && !\file_exists($streamName)) {
            throw new FileDoesNotExistException('File %s does not exist.', 1, $streamName);
        }
        $out = parent::_open($streamName, $context);
        return $out;
    }
    public function eof() : bool
    {
        return \feof($this->getStream());
    }
    public function read(int $length)
    {
        if (0 > $length) {
            throw new FileException('Length must be greater than 0, given %d.', 2, $length);
        }
        return \fread($this->getStream(), $length);
    }
    public function readString(int $length)
    {
        return $this->read($length);
    }
    public function readCharacter()
    {
        return \fgetc($this->getStream());
    }
    public function readBoolean()
    {
        return (bool) $this->read(1);
    }
    public function readInteger(int $length = 1)
    {
        return (int) $this->read($length);
    }
    public function readFloat(int $length = 1)
    {
        return (float) $this->read($length);
    }
    public function readArray(string $format = null)
    {
        return $this->scanf($format);
    }
    public function readLine()
    {
        return \fgets($this->getStream());
    }
    public function readAll(int $offset = 0)
    {
        return \stream_get_contents($this->getStream(), -1, $offset);
    }
    public function scanf(string $format) : array
    {
        return \fscanf($this->getStream(), $format);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class FileLink extends File
{
    public function __construct(string $streamName, string $mode, string $context = null, bool $wait = \false)
    {
        if (!\is_link($streamName)) {
            throw new FileException('File %s is not a link.', 0, $streamName);
        }
        parent::__construct($streamName, $mode, $context, $wait);
        return;
    }
    public function getStatistic() : array
    {
        return \lstat($this->getStreamName());
    }
    public function changeGroup($group) : bool
    {
        return \lchgrp($this->getStreamName(), $group);
    }
    public function changeOwner($user) : bool
    {
        return \lchown($this->getStreamName(), $user);
    }
    public function getPermissions() : int
    {
        return 41453;
    }
    public function getTarget() : FileGeneric
    {
        $target = \dirname($this->getStreamName()) . \DIRECTORY_SEPARATOR . $this->getTargetName();
        $context = null !== $this->getStreamContext() ? $this->getStreamContext()->getCurrentId() : null;
        if (\true === \is_link($target)) {
            return new FileLinkReadWrite($target, File::MODE_APPEND_READ_WRITE, $context);
        } elseif (\true === \is_file($target)) {
            return new FileReadWrite($target, File::MODE_APPEND_READ_WRITE, $context);
        } elseif (\true === \is_dir($target)) {
            return new FileDirectory($target, File::MODE_READ, $context);
        }
        throw new FileException('Cannot find an appropriated object that matches with ' . 'path %s when defining it.', 1, $target);
    }
    public function getTargetName() : string
    {
        return \readlink($this->getStreamName());
    }
    public static function create(string $name, string $target) : bool
    {
        if (\false !== \linkinfo($name)) {
            return \true;
        }
        return \symlink($target, $name);
    }
}
<?php

namespace Cvphar\Psy\Readline\Hoa;

class ConsoleWindow implements EventSource
{
    private static $_instance = null;
    private function __construct()
    {
        Event::register('hoa://Event/Console/Window:resize', $this);
        return;
    }
    public static function getInstance() : self
    {
        if (null === static::$_instance) {
            static::$_instance = new self();
        }
        return static::$_instance;
    }
    public static function setSize(int $x, int $y)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[8;" . $y . ';' . $x . 't');
        return;
    }
    public static function getSize() : array
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            $modecon = \explode("\n", \ltrim(ConsoleProcessus::execute('mode con')));
            $_y = \trim($modecon[2]);
            \preg_match('#[^:]+:\\s*([0-9]+)#', $_y, $matches);
            $y = (int) $matches[1];
            $_x = \trim($modecon[3]);
            \preg_match('#[^:]+:\\s*([0-9]+)#', $_x, $matches);
            $x = (int) $matches[1];
            return ['x' => $x, 'y' => $y];
        }
        $term = '';
        if (isset($_SERVER['TERM'])) {
            $term = 'TERM="' . $_SERVER['TERM'] . '" ';
        }
        $command = $term . 'tput cols && ' . $term . 'tput lines';
        $tput = ConsoleProcessus::execute($command, \false);
        if (!empty($tput)) {
            list($x, $y) = \explode("\n", $tput);
            return ['x' => (int) $x, 'y' => (int) $y];
        }
        Console::getOutput()->writeAll("\x1b[18t");
        $input = Console::getInput();
        $input->read(4);
        $x = null;
        $y = null;
        $handle =& $y;
        while (\true) {
            $char = $input->readCharacter();
            switch ($char) {
                case ';':
                    $handle =& $x;
                    break;
                case 't':
                    break 2;
                default:
                    if (\false === \ctype_digit($char)) {
                        break 2;
                    }
                    $handle .= $char;
            }
        }
        if (null === $x || null === $y) {
            return ['x' => 0, 'y' => 0];
        }
        return ['x' => (int) $x, 'y' => (int) $y];
    }
    public static function moveTo(int $x, int $y)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[3;" . $x . ';' . $y . 't');
        return;
    }
    public static function getPosition() : array
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return ['x' => 0, 'y' => 0];
        }
        Console::getOutput()->writeAll("\x1b[13t");
        $input = Console::getInput();
        $input->read(4);
        $x = null;
        $y = null;
        $handle =& $x;
        while (\true) {
            $char = $input->readCharacter();
            switch ($char) {
                case ';':
                    $handle =& $y;
                    break;
                case 't':
                    break 2;
                default:
                    $handle .= $char;
            }
        }
        return ['x' => (int) $x, 'y' => (int) $y];
    }
    public static function scroll(string $directions, int $repeat = 1)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        if (1 > $repeat) {
            return;
        } elseif (1 === $repeat) {
            $handle = \explode(' ', $directions);
        } else {
            $handle = \explode(' ', $directions, 1);
        }
        $tput = Console::getTput();
        $count = ['up' => 0, 'down' => 0];
        foreach ($handle as $direction) {
            switch ($direction) {
                case 'u':
                case 'up':
                case 'â†‘':
                    ++$count['up'];
                    break;
                case 'd':
                case 'down':
                case 'â†“':
                    ++$count['down'];
                    break;
            }
        }
        $output = Console::getOutput();
        if (0 < $count['up']) {
            $output->writeAll(\str_replace('%p1%d', $count['up'] * $repeat, $tput->get('parm_index')));
        }
        if (0 < $count['down']) {
            $output->writeAll(\str_replace('%p1%d', $count['down'] * $repeat, $tput->get('parm_rindex')));
        }
        return;
    }
    public static function minimize()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[2t");
        return;
    }
    public static function restore()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[1t");
        return;
    }
    public static function raise()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[5t");
        return;
    }
    public static function lower()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[6t");
        return;
    }
    public static function setTitle(string $title)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b]0;" . $title . "\x1b\\");
        return;
    }
    public static function getTitle()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return null;
        }
        Console::getOutput()->writeAll("\x1b[21t");
        $input = Console::getInput();
        $read = [$input->getStream()->getStream()];
        $write = [];
        $except = [];
        $out = null;
        if (0 === \stream_select($read, $write, $except, 0, 50000)) {
            return $out;
        }
        $input->read(3);
        while (\true) {
            $char = $input->readCharacter();
            if ("\x1b" === $char) {
                $chaar = $input->readCharacter();
                if ('\\' === $chaar) {
                    break;
                }
                $char .= $chaar;
            }
            $out .= $char;
        }
        return $out;
    }
    public static function getLabel()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return null;
        }
        Console::getOutput()->writeAll("\x1b[20t");
        $input = Console::getInput();
        $read = [$input->getStream()->getStream()];
        $write = [];
        $except = [];
        $out = null;
        if (0 === \stream_select($read, $write, $except, 0, 50000)) {
            return $out;
        }
        $input->read(3);
        while (\true) {
            $char = $input->readCharacter();
            if ("\x1b" === $char) {
                $chaar = $input->readCharacter();
                if ('\\' === $chaar) {
                    break;
                }
                $char .= $chaar;
            }
            $out .= $char;
        }
        return $out;
    }
    public static function refresh()
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        Console::getOutput()->writeAll("\x1b[7t");
        return;
    }
    public static function copy(string $data)
    {
        if (\defined('PHP_WINDOWS_VERSION_PLATFORM')) {
            return;
        }
        $out = "\x1b]52;;" . \base64_encode($data) . "\x1b\\";
        $output = Console::getOutput();
        $considerMultiplexer = $output->considerMultiplexer(\true);
        $output->writeAll($out);
        $output->considerMultiplexer($considerMultiplexer);
        return;
    }
}
Console::advancedInteraction();
if (\function_exists('pcntl_signal')) {
    ConsoleWindow::getInstance();
    \pcntl_signal(\SIGWINCH, function () {
        static $_window = null;
        if (null === $_window) {
            $_window = ConsoleWindow::getInstance();
        }
        Event::notify('hoa://Event/Console/Window:resize', $_window, new EventBucket(['size' => ConsoleWindow::getSize()]));
    });
}
<?php

namespace Cvphar\Psy\Readline;

use Cvphar\Psy\Util\Str;
class Libedit extends GNUReadline
{
    private $hasWarnedOwnership = \false;
    public static function isSupported() : bool
    {
        return \function_exists('readline') && !\function_exists('readline_list_history');
    }
    public static function supportsBracketedPaste() : bool
    {
        return \false;
    }
    public function listHistory() : array
    {
        $history = \file_get_contents($this->historyFile);
        if (!$history) {
            return [];
        }
        $history = \explode("\n", $history);
        if ($history[0] === '_HiStOrY_V2_') {
            \array_shift($history);
        }
        $history = \array_map([$this, 'parseHistoryLine'], $history);
        return \array_values(\array_filter($history));
    }
    public function writeHistory() : bool
    {
        $res = parent::writeHistory();
        if ($res === \false && !$this->hasWarnedOwnership) {
            if (\is_file($this->historyFile) && \is_writable($this->historyFile)) {
                $this->hasWarnedOwnership = \true;
                $msg = \sprintf('Error writing history file, check file ownership: %s', $this->historyFile);
                \trigger_error($msg, \E_USER_NOTICE);
            }
        }
        return $res;
    }
    protected function parseHistoryLine(string $line)
    {
        if (!$line || $line[0] === "\x00") {
            return;
        }
        if (($pos = \strpos($line, "\x00")) !== \false) {
            $line = \substr($line, 0, $pos);
        }
        return $line !== '' ? Str::unvis($line) : null;
    }
}
<?php

namespace Cvphar\Psy;

interface ContextAware
{
    public function setContext(Context $context);
}
<?php

namespace Cvphar\Psy;

class SuperglobalsEnv implements EnvInterface
{
    public function get(string $key)
    {
        if (isset($_SERVER[$key]) && $_SERVER[$key]) {
            return $_SERVER[$key];
        }
        return null;
    }
}
<?php

namespace Cvphar\Psy\Output;

use Cvphar\Symfony\Component\Console\Output\StreamOutput;
class ProcOutputPager extends StreamOutput implements OutputPager
{
    private $proc;
    private $pipe;
    private $stream;
    private $cmd;
    public function __construct(StreamOutput $output, string $cmd = 'less -R -F -X')
    {
        $this->stream = $output->getStream();
        $this->cmd = $cmd;
    }
    public function doWrite($message, $newline)
    {
        $pipe = $this->getPipe();
        if (\false === @\fwrite($pipe, $message . ($newline ? \PHP_EOL : ''))) {
            $this->close();
            throw new \RuntimeException('Unable to write output');
        }
        \fflush($pipe);
    }
    public function close()
    {
        if (isset($this->pipe)) {
            \fclose($this->pipe);
        }
        if (isset($this->proc)) {
            $exit = \proc_close($this->proc);
            if ($exit !== 0) {
                throw new \RuntimeException('Error closing output stream');
            }
        }
        $this->pipe = null;
        $this->proc = null;
    }
    private function getPipe()
    {
        if (!isset($this->pipe) || !isset($this->proc)) {
            $desc = [['pipe', 'r'], $this->stream, \fopen('php://stderr', 'w')];
            $this->proc = \proc_open($this->cmd, $desc, $pipes);
            if (!\is_resource($this->proc)) {
                throw new \RuntimeException('Error opening output stream');
            }
            $this->pipe = $pipes[0];
        }
        return $this->pipe;
    }
}
<?php

namespace Cvphar\Psy\Output;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
interface OutputPager extends OutputInterface
{
    public function close();
}
<?php

namespace Cvphar\Psy\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterStyle;
class Theme
{
    const MODERN_THEME = [];
    const COMPACT_THEME = ['compact' => \true];
    const CLASSIC_THEME = ['compact' => \true, 'prompt' => '>>> ', 'bufferPrompt' => '... ', 'replayPrompt' => '--> ', 'returnValue' => '=>  '];
    const DEFAULT_STYLES = ['info' => ['white', 'blue', ['bold']], 'warning' => ['black', 'yellow'], 'error' => ['white', 'red', ['bold']], 'whisper' => ['gray'], 'aside' => ['blue'], 'strong' => [null, null, ['bold']], 'return' => ['cyan'], 'urgent' => ['red'], 'hidden' => ['black'], 'public' => [null, null, ['bold']], 'protected' => ['yellow'], 'private' => ['red'], 'global' => ['cyan', null, ['bold']], 'const' => ['cyan'], 'class' => ['blue', null, ['underscore']], 'function' => [null], 'default' => [null], 'number' => ['magenta'], 'integer' => ['magenta'], 'float' => ['yellow'], 'string' => ['green'], 'bool' => ['cyan'], 'keyword' => ['yellow'], 'comment' => ['blue'], 'code_comment' => ['gray'], 'object' => ['blue'], 'resource' => ['yellow'], 'inline_html' => ['cyan']];
    const ERROR_STYLES = ['info', 'warning', 'error', 'whisper', 'class'];
    private $compact = \false;
    private $prompt = '> ';
    private $bufferPrompt = '. ';
    private $replayPrompt = '- ';
    private $returnValue = '= ';
    private $grayFallback = 'blue';
    private $styles = [];
    public function __construct($config = 'modern')
    {
        if (\is_string($config)) {
            switch ($config) {
                case 'modern':
                    $config = static::MODERN_THEME;
                    break;
                case 'compact':
                    $config = static::COMPACT_THEME;
                    break;
                case 'classic':
                    $config = static::CLASSIC_THEME;
                    break;
                default:
                    \trigger_error(\sprintf('Unknown theme: %s', $config), \E_USER_NOTICE);
                    $config = static::MODERN_THEME;
                    break;
            }
        }
        if (!\is_array($config)) {
            throw new \InvalidArgumentException('Invalid theme config');
        }
        foreach ($config as $name => $value) {
            switch ($name) {
                case 'compact':
                    $this->setCompact($value);
                    break;
                case 'prompt':
                    $this->setPrompt($value);
                    break;
                case 'bufferPrompt':
                    $this->setBufferPrompt($value);
                    break;
                case 'replayPrompt':
                    $this->setReplayPrompt($value);
                    break;
                case 'returnValue':
                    $this->setReturnValue($value);
                    break;
                case 'grayFallback':
                    $this->setGrayFallback($value);
                    break;
            }
        }
        $this->setStyles($config['styles'] ?? []);
    }
    public function setCompact(bool $compact)
    {
        $this->compact = $compact;
    }
    public function compact() : bool
    {
        return $this->compact;
    }
    public function setPrompt(string $prompt)
    {
        $this->prompt = $prompt;
    }
    public function prompt() : string
    {
        return $this->prompt;
    }
    public function setBufferPrompt(string $bufferPrompt)
    {
        $this->bufferPrompt = $bufferPrompt;
    }
    public function bufferPrompt() : string
    {
        return $this->bufferPrompt;
    }
    public function setReplayPrompt(string $replayPrompt)
    {
        $this->replayPrompt = $replayPrompt;
    }
    public function replayPrompt() : string
    {
        return $this->replayPrompt;
    }
    public function setReturnValue(string $returnValue)
    {
        $this->returnValue = $returnValue;
    }
    public function returnValue() : string
    {
        return $this->returnValue;
    }
    public function setGrayFallback(string $grayFallback)
    {
        $this->grayFallback = $grayFallback;
    }
    public function setStyles(array $styles)
    {
        foreach (\array_keys(static::DEFAULT_STYLES) as $name) {
            $this->styles[$name] = $styles[$name] ?? static::DEFAULT_STYLES[$name];
        }
    }
    public function applyStyles(OutputFormatterInterface $formatter, bool $useGrayFallback)
    {
        foreach (\array_keys(static::DEFAULT_STYLES) as $name) {
            $formatter->setStyle($name, new OutputFormatterStyle(...$this->getStyle($name, $useGrayFallback)));
        }
    }
    public function applyErrorStyles(OutputFormatterInterface $errorFormatter, bool $useGrayFallback)
    {
        foreach (static::ERROR_STYLES as $name) {
            $errorFormatter->setStyle($name, new OutputFormatterStyle(...$this->getStyle($name, $useGrayFallback)));
        }
    }
    private function getStyle(string $name, bool $useGrayFallback) : array
    {
        return \array_map(function ($style) use($useGrayFallback) {
            return $useGrayFallback && $style === 'gray' ? $this->grayFallback : $style;
        }, $this->styles[$name]);
    }
}
<?php

namespace Cvphar\Psy\Output;

use Cvphar\Symfony\Component\Console\Output\StreamOutput;
class PassthruPager extends StreamOutput implements OutputPager
{
    public function __construct(StreamOutput $output)
    {
        parent::__construct($output->getStream());
    }
    public function close()
    {
    }
}
<?php

namespace Cvphar\Psy\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutput;
class ShellOutput extends ConsoleOutput
{
    const NUMBER_LINES = 128;
    private $paging = 0;
    private $pager;
    private $theme;
    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null, $pager = null, $theme = null)
    {
        parent::__construct($verbosity, $decorated, $formatter);
        $this->theme = $theme ?? new Theme('modern');
        $this->initFormatters();
        if ($pager === null) {
            $this->pager = new PassthruPager($this);
        } elseif (\is_string($pager)) {
            $this->pager = new ProcOutputPager($this, $pager);
        } elseif ($pager instanceof OutputPager) {
            $this->pager = $pager;
        } else {
            throw new \InvalidArgumentException('Unexpected pager parameter: ' . $pager);
        }
    }
    public function page($messages, int $type = 0)
    {
        if (\is_string($messages)) {
            $messages = (array) $messages;
        }
        if (!\is_array($messages) && !\is_callable($messages)) {
            throw new \InvalidArgumentException('Paged output requires a string, array or callback');
        }
        $this->startPaging();
        if (\is_callable($messages)) {
            $messages($this);
        } else {
            $this->write($messages, \true, $type);
        }
        $this->stopPaging();
    }
    public function startPaging()
    {
        $this->paging++;
    }
    public function stopPaging()
    {
        $this->paging--;
        $this->closePager();
    }
    public function write($messages, $newline = \false, $type = 0)
    {
        if ($this->getVerbosity() === self::VERBOSITY_QUIET) {
            return;
        }
        $messages = (array) $messages;
        if ($type & self::NUMBER_LINES) {
            $pad = \strlen((string) \count($messages));
            $template = $this->isDecorated() ? "<aside>%{$pad}s</aside>: %s" : "%{$pad}s: %s";
            if ($type & self::OUTPUT_RAW) {
                $messages = \array_map([OutputFormatter::class, 'escape'], $messages);
            }
            foreach ($messages as $i => $line) {
                $messages[$i] = \sprintf($template, $i, $line);
            }
            $type = $type & ~self::NUMBER_LINES & ~self::OUTPUT_RAW;
        }
        parent::write($messages, $newline, $type);
    }
    public function doWrite($message, $newline)
    {
        if ($this->paging > 0) {
            $this->pager->doWrite($message, $newline);
        } else {
            parent::doWrite($message, $newline);
        }
    }
    public function setTheme(Theme $theme)
    {
        $this->theme = $theme;
        $this->initFormatters();
    }
    private function closePager()
    {
        if ($this->paging <= 0) {
            $this->pager->close();
        }
    }
    private function initFormatters()
    {
        $useGrayFallback = !$this->grayExists();
        $this->theme->applyStyles($this->getFormatter(), $useGrayFallback);
        $this->theme->applyErrorStyles($this->getErrorOutput()->getFormatter(), $useGrayFallback);
    }
    private function grayExists() : bool
    {
        try {
            $this->write('<fg=gray></>');
        } catch (\InvalidArgumentException $e) {
            return \false;
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy;

use Cvphar\Psy\Exception\DeprecatedException;
use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\ExecutionLoop\ProcessForker;
use Cvphar\Psy\Output\OutputPager;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\Output\Theme;
use Cvphar\Psy\TabCompletion\AutoCompleter;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Psy\VersionUpdater\Checker;
use Cvphar\Psy\VersionUpdater\GitHubChecker;
use Cvphar\Psy\VersionUpdater\IntervalChecker;
use Cvphar\Psy\VersionUpdater\NoopChecker;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Configuration
{
    const COLOR_MODE_AUTO = 'auto';
    const COLOR_MODE_FORCED = 'forced';
    const COLOR_MODE_DISABLED = 'disabled';
    const INTERACTIVE_MODE_AUTO = 'auto';
    const INTERACTIVE_MODE_FORCED = 'forced';
    const INTERACTIVE_MODE_DISABLED = 'disabled';
    const VERBOSITY_QUIET = 'quiet';
    const VERBOSITY_NORMAL = 'normal';
    const VERBOSITY_VERBOSE = 'verbose';
    const VERBOSITY_VERY_VERBOSE = 'very_verbose';
    const VERBOSITY_DEBUG = 'debug';
    private static $AVAILABLE_OPTIONS = ['codeCleaner', 'colorMode', 'configDir', 'dataDir', 'defaultIncludes', 'eraseDuplicates', 'errorLoggingLevel', 'forceArrayIndexes', 'formatterStyles', 'historyFile', 'historySize', 'interactiveMode', 'manualDbFile', 'pager', 'prompt', 'rawOutput', 'requireSemicolons', 'runtimeDir', 'startupMessage', 'theme', 'updateCheck', 'useBracketedPaste', 'usePcntl', 'useReadline', 'useTabCompletion', 'useUnicode', 'verbosity', 'warnOnMultipleConfigs', 'yolo'];
    private $defaultIncludes;
    private $configDir;
    private $dataDir;
    private $runtimeDir;
    private $configFile;
    private $historyFile;
    private $historySize;
    private $eraseDuplicates;
    private $manualDbFile;
    private $hasReadline;
    private $useReadline;
    private $useBracketedPaste;
    private $hasPcntl;
    private $usePcntl;
    private $newCommands = [];
    private $pipedInput;
    private $pipedOutput;
    private $rawOutput = \false;
    private $requireSemicolons = \false;
    private $useUnicode;
    private $useTabCompletion;
    private $newMatchers = [];
    private $errorLoggingLevel = \E_ALL;
    private $warnOnMultipleConfigs = \false;
    private $colorMode = self::COLOR_MODE_AUTO;
    private $interactiveMode = self::INTERACTIVE_MODE_AUTO;
    private $updateCheck;
    private $startupMessage;
    private $forceArrayIndexes = \false;
    private $formatterStyles = [];
    private $verbosity = self::VERBOSITY_NORMAL;
    private $yolo = \false;
    private $theme;
    private $readline;
    private $output;
    private $shell;
    private $cleaner;
    private $pager;
    private $manualDb;
    private $presenter;
    private $autoCompleter;
    private $checker;
    private $prompt;
    private $configPaths;
    public function __construct(array $config = [])
    {
        $this->configPaths = new ConfigPaths();
        if (isset($config['configFile'])) {
            $this->configFile = $config['configFile'];
        } elseif (isset($_SERVER['PSYSH_CONFIG']) && $_SERVER['PSYSH_CONFIG']) {
            $this->configFile = $_SERVER['PSYSH_CONFIG'];
        } elseif (\PHP_SAPI === 'cli-server' && ($configFile = \getenv('PSYSH_CONFIG'))) {
            $this->configFile = $configFile;
        }
        if (isset($config['baseDir'])) {
            $msg = "The 'baseDir' configuration option is deprecated; " . "please specify 'configDir' and 'dataDir' options instead";
            throw new DeprecatedException($msg);
        }
        unset($config['configFile'], $config['baseDir']);
        $this->loadConfig($config);
        $this->init();
    }
    public static function fromInput(InputInterface $input) : self
    {
        $config = new self(['configFile' => self::getConfigFileFromInput($input)]);
        if (self::getOptionFromInput($input, ['color', 'ansi'])) {
            $config->setColorMode(self::COLOR_MODE_FORCED);
        } elseif (self::getOptionFromInput($input, ['no-color', 'no-ansi'])) {
            $config->setColorMode(self::COLOR_MODE_DISABLED);
        }
        if ($verbosity = self::getVerbosityFromInput($input)) {
            $config->setVerbosity($verbosity);
        }
        if (self::getOptionFromInput($input, ['interactive', 'interaction'], ['-a', '-i'])) {
            $config->setInteractiveMode(self::INTERACTIVE_MODE_FORCED);
        } elseif (self::getOptionFromInput($input, ['no-interactive', 'no-interaction'], ['-n'])) {
            $config->setInteractiveMode(self::INTERACTIVE_MODE_DISABLED);
        }
        if (self::getOptionFromInput($input, ['compact'])) {
            $config->setTheme('compact');
        }
        if (!$config->getInputInteractive()) {
            if (self::getOptionFromInput($input, ['raw-output'], ['-r'])) {
                $config->setRawOutput(\true);
            }
        }
        if (self::getOptionFromInput($input, ['yolo'])) {
            $config->setYolo(\true);
        }
        return $config;
    }
    private static function getConfigFileFromInput(InputInterface $input)
    {
        if ($input->hasOption('config')) {
            return $input->getOption('config');
        }
        return $input->getParameterOption('--config', null, \true) ?: $input->getParameterOption('-c', null, \true);
    }
    private static function getOptionFromInput(InputInterface $input, array $names, array $otherParams = []) : bool
    {
        foreach ($names as $name) {
            if ($input->hasOption($name) && $input->getOption($name)) {
                return \true;
            }
        }
        foreach ($names as $name) {
            $otherParams[] = '--' . $name;
        }
        foreach ($otherParams as $name) {
            if ($input->hasParameterOption($name, \true)) {
                return \true;
            }
        }
        return \false;
    }
    private static function getVerbosityFromInput(InputInterface $input)
    {
        if (self::getOptionFromInput($input, ['quiet'], ['-q'])) {
            return self::VERBOSITY_QUIET;
        }
        if ($input->hasOption('verbose') && $input->getOption('verbose') !== \true) {
            switch ($input->getOption('verbose')) {
                case '-1':
                    return self::VERBOSITY_QUIET;
                case '0':
                    return self::VERBOSITY_NORMAL;
                case '1':
                case null:
                    return self::VERBOSITY_VERBOSE;
                case '2':
                case 'v':
                    return self::VERBOSITY_VERY_VERBOSE;
                case '3':
                case 'vv':
                    return self::VERBOSITY_DEBUG;
                default:
                    return;
            }
        }
        if ($input->hasParameterOption('--verbose=-1', \true) || $input->getParameterOption('--verbose', \false, \true) === '-1') {
            return self::VERBOSITY_QUIET;
        }
        if ($input->hasParameterOption('--verbose=0', \true) || $input->getParameterOption('--verbose', \false, \true) === '0') {
            return self::VERBOSITY_NORMAL;
        }
        if ($input->hasParameterOption('-vvv', \true) || $input->hasParameterOption('--verbose=3', \true) || $input->getParameterOption('--verbose', \false, \true) === '3') {
            return self::VERBOSITY_DEBUG;
        }
        if ($input->hasParameterOption('-vv', \true) || $input->hasParameterOption('--verbose=2', \true) || $input->getParameterOption('--verbose', \false, \true) === '2') {
            return self::VERBOSITY_VERY_VERBOSE;
        }
        if ($input->hasParameterOption('-v', \true) || $input->hasParameterOption('--verbose=1', \true) || $input->hasParameterOption('--verbose', \true)) {
            return self::VERBOSITY_VERBOSE;
        }
    }
    public static function getInputOptions() : array
    {
        return [new InputOption('config', 'c', InputOption::VALUE_REQUIRED, 'Use an alternate PsySH config file location.'), new InputOption('cwd', null, InputOption::VALUE_REQUIRED, 'Use an alternate working directory.'), new InputOption('color', null, InputOption::VALUE_NONE, 'Force colors in output.'), new InputOption('no-color', null, InputOption::VALUE_NONE, 'Disable colors in output.'), new InputOption('ansi', null, InputOption::VALUE_NONE, 'Force colors in output.'), new InputOption('no-ansi', null, InputOption::VALUE_NONE, 'Disable colors in output.'), new InputOption('quiet', 'q', InputOption::VALUE_NONE, 'Shhhhhh.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_OPTIONAL, 'Increase the verbosity of messages.', '0'), new InputOption('compact', null, InputOption::VALUE_NONE, 'Run PsySH with compact output.'), new InputOption('interactive', 'i|a', InputOption::VALUE_NONE, 'Force PsySH to run in interactive mode.'), new InputOption('no-interactive', 'n', InputOption::VALUE_NONE, 'Run PsySH without interactive input. Requires input from stdin.'), new InputOption('interaction', null, InputOption::VALUE_NONE, 'Force PsySH to run in interactive mode.'), new InputOption('no-interaction', null, InputOption::VALUE_NONE, 'Run PsySH without interactive input. Requires input from stdin.'), new InputOption('raw-output', 'r', InputOption::VALUE_NONE, 'Print var_export-style return values (for non-interactive input)'), new InputOption('self-update', 'u', InputOption::VALUE_NONE, 'Update to the latest version'), new InputOption('yolo', null, InputOption::VALUE_NONE, 'Run PsySH with minimal input validation. You probably don\'t want this.')];
    }
    public function init()
    {
        $this->hasReadline = \function_exists('readline');
        $this->hasPcntl = ProcessForker::isSupported();
        if ($configFile = $this->getConfigFile()) {
            $this->loadConfigFile($configFile);
        }
        if (!$this->configFile && ($localConfig = $this->getLocalConfigFile())) {
            $this->loadConfigFile($localConfig);
        }
        $this->configPaths->overrideDirs(['configDir' => $this->configDir, 'dataDir' => $this->dataDir, 'runtimeDir' => $this->runtimeDir]);
    }
    public function getConfigFile()
    {
        if (isset($this->configFile)) {
            return $this->configFile;
        }
        $files = $this->configPaths->configFiles(['config.php', 'rc.php']);
        if (!empty($files)) {
            if ($this->warnOnMultipleConfigs && \count($files) > 1) {
                $msg = \sprintf('Multiple configuration files found: %s. Using %s', \implode(', ', $files), $files[0]);
                \trigger_error($msg, \E_USER_NOTICE);
            }
            return $files[0];
        }
    }
    public function getLocalConfigFile()
    {
        $localConfig = \getcwd() . '/.psysh.php';
        if (@\is_file($localConfig)) {
            return $localConfig;
        }
    }
    public function loadConfig(array $options)
    {
        foreach (self::$AVAILABLE_OPTIONS as $option) {
            if (isset($options[$option])) {
                $method = 'set' . \ucfirst($option);
                $this->{$method}($options[$option]);
            }
        }
        if (isset($options['tabCompletion'])) {
            $msg = '`tabCompletion` is deprecated; use `useTabCompletion` instead.';
            @\trigger_error($msg, \E_USER_DEPRECATED);
            $this->setUseTabCompletion($options['tabCompletion']);
        }
        foreach (['commands', 'matchers', 'casters'] as $option) {
            if (isset($options[$option])) {
                $method = 'add' . \ucfirst($option);
                $this->{$method}($options[$option]);
            }
        }
        if (isset($options['tabCompletionMatchers'])) {
            $msg = '`tabCompletionMatchers` is deprecated; use `matchers` instead.';
            @\trigger_error($msg, \E_USER_DEPRECATED);
            $this->addMatchers($options['tabCompletionMatchers']);
        }
    }
    public function loadConfigFile(string $file)
    {
        if (!\is_file($file)) {
            throw new \InvalidArgumentException(\sprintf('Invalid configuration file specified, %s does not exist', $file));
        }
        $__psysh_config_file__ = $file;
        $load = function ($config) use($__psysh_config_file__) {
            $result = (require $__psysh_config_file__);
            if ($result !== 1) {
                return $result;
            }
        };
        $result = $load($this);
        if (!empty($result)) {
            if (\is_array($result)) {
                $this->loadConfig($result);
            } else {
                throw new \InvalidArgumentException('Psy Shell configuration must return an array of options');
            }
        }
    }
    public function setDefaultIncludes(array $includes = [])
    {
        $this->defaultIncludes = $includes;
    }
    public function getDefaultIncludes() : array
    {
        return $this->defaultIncludes ?: [];
    }
    public function setConfigDir(string $dir)
    {
        $this->configDir = (string) $dir;
        $this->configPaths->overrideDirs(['configDir' => $this->configDir, 'dataDir' => $this->dataDir, 'runtimeDir' => $this->runtimeDir]);
    }
    public function getConfigDir()
    {
        return $this->configDir;
    }
    public function setDataDir(string $dir)
    {
        $this->dataDir = (string) $dir;
        $this->configPaths->overrideDirs(['configDir' => $this->configDir, 'dataDir' => $this->dataDir, 'runtimeDir' => $this->runtimeDir]);
    }
    public function getDataDir()
    {
        return $this->dataDir;
    }
    public function setRuntimeDir(string $dir)
    {
        $this->runtimeDir = (string) $dir;
        $this->configPaths->overrideDirs(['configDir' => $this->configDir, 'dataDir' => $this->dataDir, 'runtimeDir' => $this->runtimeDir]);
    }
    public function getRuntimeDir() : string
    {
        $runtimeDir = $this->configPaths->runtimeDir();
        if (!\is_dir($runtimeDir)) {
            if (!@\mkdir($runtimeDir, 0700, \true)) {
                throw new RuntimeException(\sprintf('Unable to create PsySH runtime directory. Make sure PHP is able to write to %s in order to continue.', \dirname($runtimeDir)));
            }
        }
        return $runtimeDir;
    }
    public function setHistoryFile(string $file)
    {
        $this->historyFile = ConfigPaths::touchFileWithMkdir($file);
    }
    public function getHistoryFile() : string
    {
        if (isset($this->historyFile)) {
            return $this->historyFile;
        }
        $files = $this->configPaths->configFiles(['psysh_history', 'history']);
        if (!empty($files)) {
            if ($this->warnOnMultipleConfigs && \count($files) > 1) {
                $msg = \sprintf('Multiple history files found: %s. Using %s', \implode(', ', $files), $files[0]);
                \trigger_error($msg, \E_USER_NOTICE);
            }
            $this->setHistoryFile($files[0]);
        } else {
            $this->setHistoryFile($this->configPaths->currentConfigDir() . '/psysh_history');
        }
        return $this->historyFile;
    }
    public function setHistorySize(int $value)
    {
        $this->historySize = (int) $value;
    }
    public function getHistorySize()
    {
        return $this->historySize;
    }
    public function setEraseDuplicates(bool $value)
    {
        $this->eraseDuplicates = (bool) $value;
    }
    public function getEraseDuplicates()
    {
        return $this->eraseDuplicates;
    }
    public function getTempFile(string $type, int $pid) : string
    {
        return \tempnam($this->getRuntimeDir(), $type . '_' . $pid . '_');
    }
    public function getPipe(string $type, int $pid) : string
    {
        return \sprintf('%s/%s_%s', $this->getRuntimeDir(), $type, $pid);
    }
    public function hasReadline() : bool
    {
        return $this->hasReadline;
    }
    public function setUseReadline(bool $useReadline)
    {
        $this->useReadline = (bool) $useReadline;
    }
    public function useReadline() : bool
    {
        return isset($this->useReadline) ? $this->hasReadline && $this->useReadline : $this->hasReadline;
    }
    public function setReadline(Readline\Readline $readline)
    {
        $this->readline = $readline;
    }
    public function getReadline() : Readline\Readline
    {
        if (!isset($this->readline)) {
            $className = $this->getReadlineClass();
            $this->readline = new $className($this->getHistoryFile(), $this->getHistorySize(), $this->getEraseDuplicates());
        }
        return $this->readline;
    }
    private function getReadlineClass() : string
    {
        if ($this->useReadline()) {
            if (Readline\GNUReadline::isSupported()) {
                return Readline\GNUReadline::class;
            } elseif (Readline\Libedit::isSupported()) {
                return Readline\Libedit::class;
            }
        }
        if (Readline\Userland::isSupported()) {
            return Readline\Userland::class;
        }
        return Readline\Transient::class;
    }
    public function setUseBracketedPaste(bool $useBracketedPaste)
    {
        $this->useBracketedPaste = (bool) $useBracketedPaste;
    }
    public function useBracketedPaste() : bool
    {
        $readlineClass = $this->getReadlineClass();
        return $this->useBracketedPaste && $readlineClass::supportsBracketedPaste();
    }
    public function hasPcntl() : bool
    {
        return $this->hasPcntl;
    }
    public function setUsePcntl(bool $usePcntl)
    {
        $this->usePcntl = (bool) $usePcntl;
    }
    public function usePcntl() : bool
    {
        if (!isset($this->usePcntl)) {
            if (\function_exists('xdebug_is_debugger_active') && \xdebug_is_debugger_active()) {
                return \false;
            }
            return $this->hasPcntl;
        }
        return $this->hasPcntl && $this->usePcntl;
    }
    public function rawOutput() : bool
    {
        return $this->rawOutput;
    }
    public function setRawOutput(bool $rawOutput)
    {
        $this->rawOutput = (bool) $rawOutput;
    }
    public function setRequireSemicolons(bool $requireSemicolons)
    {
        $this->requireSemicolons = (bool) $requireSemicolons;
    }
    public function requireSemicolons() : bool
    {
        return $this->requireSemicolons;
    }
    public function setUseUnicode(bool $useUnicode)
    {
        $this->useUnicode = (bool) $useUnicode;
    }
    public function useUnicode() : bool
    {
        if (isset($this->useUnicode)) {
            return $this->useUnicode;
        }
        return \true;
    }
    public function setErrorLoggingLevel($errorLoggingLevel)
    {
        $this->errorLoggingLevel = (\E_ALL | \E_STRICT) & $errorLoggingLevel;
    }
    public function errorLoggingLevel() : int
    {
        return $this->errorLoggingLevel;
    }
    public function setCodeCleaner(CodeCleaner $cleaner)
    {
        $this->cleaner = $cleaner;
    }
    public function getCodeCleaner() : CodeCleaner
    {
        if (!isset($this->cleaner)) {
            $this->cleaner = new CodeCleaner(null, null, null, $this->yolo());
        }
        return $this->cleaner;
    }
    public function setYolo($yolo)
    {
        $this->yolo = (bool) $yolo;
    }
    public function yolo() : bool
    {
        return $this->yolo;
    }
    public function setUseTabCompletion(bool $useTabCompletion)
    {
        $this->useTabCompletion = (bool) $useTabCompletion;
    }
    public function setTabCompletion(bool $useTabCompletion)
    {
        $this->setUseTabCompletion($useTabCompletion);
    }
    public function useTabCompletion() : bool
    {
        return isset($this->useTabCompletion) ? $this->hasReadline && $this->useTabCompletion : $this->hasReadline;
    }
    public function getTabCompletion() : bool
    {
        return $this->useTabCompletion();
    }
    public function setOutput(ShellOutput $output)
    {
        $this->output = $output;
        $this->pipedOutput = null;
        if (isset($this->theme)) {
            $output->setTheme($this->theme);
        }
        $this->applyFormatterStyles();
    }
    public function getOutput() : ShellOutput
    {
        if (!isset($this->output)) {
            $this->setOutput(new ShellOutput($this->getOutputVerbosity(), null, null, $this->getPager() ?: null, $this->theme()));
            $decorated = $this->getOutputDecorated();
            if ($decorated !== null) {
                $this->output->setDecorated($decorated);
            }
        }
        return $this->output;
    }
    public function getOutputDecorated()
    {
        switch ($this->colorMode()) {
            case self::COLOR_MODE_FORCED:
                return \true;
            case self::COLOR_MODE_DISABLED:
                return \false;
            case self::COLOR_MODE_AUTO:
            default:
                return $this->outputIsPiped() ? \false : null;
        }
    }
    public function getInputInteractive() : bool
    {
        switch ($this->interactiveMode()) {
            case self::INTERACTIVE_MODE_FORCED:
                return \true;
            case self::INTERACTIVE_MODE_DISABLED:
                return \false;
            case self::INTERACTIVE_MODE_AUTO:
            default:
                return !$this->inputIsPiped();
        }
    }
    public function setPager($pager)
    {
        if ($pager === null || $pager === \false || $pager === 'cat') {
            $pager = \false;
        }
        if ($pager !== \false && !\is_string($pager) && !$pager instanceof OutputPager) {
            throw new \InvalidArgumentException('Unexpected pager instance');
        }
        $this->pager = $pager;
    }
    public function getPager()
    {
        if (!isset($this->pager) && $this->usePcntl()) {
            if (\getenv('TERM') === 'dumb') {
                return \false;
            }
            if ($pager = \ini_get('cli.pager')) {
                $this->pager = $pager;
            } elseif ($less = $this->configPaths->which('less')) {
                $this->pager = $less . ' -R -F -X';
            }
        }
        return $this->pager;
    }
    public function setAutoCompleter(AutoCompleter $autoCompleter)
    {
        $this->autoCompleter = $autoCompleter;
    }
    public function getAutoCompleter() : AutoCompleter
    {
        if (!isset($this->autoCompleter)) {
            $this->autoCompleter = new AutoCompleter();
        }
        return $this->autoCompleter;
    }
    public function getTabCompletionMatchers() : array
    {
        return [];
    }
    public function addMatchers(array $matchers)
    {
        $this->newMatchers = \array_merge($this->newMatchers, $matchers);
        if (isset($this->shell)) {
            $this->doAddMatchers();
        }
    }
    private function doAddMatchers()
    {
        if (!empty($this->newMatchers)) {
            $this->shell->addMatchers($this->newMatchers);
            $this->newMatchers = [];
        }
    }
    public function addTabCompletionMatchers(array $matchers)
    {
        $this->addMatchers($matchers);
    }
    public function addCommands(array $commands)
    {
        $this->newCommands = \array_merge($this->newCommands, $commands);
        if (isset($this->shell)) {
            $this->doAddCommands();
        }
    }
    private function doAddCommands()
    {
        if (!empty($this->newCommands)) {
            $this->shell->addCommands($this->newCommands);
            $this->newCommands = [];
        }
    }
    public function setShell(Shell $shell)
    {
        $this->shell = $shell;
        $this->doAddCommands();
        $this->doAddMatchers();
    }
    public function setManualDbFile(string $filename)
    {
        $this->manualDbFile = (string) $filename;
    }
    public function getManualDbFile()
    {
        if (isset($this->manualDbFile)) {
            return $this->manualDbFile;
        }
        $files = $this->configPaths->dataFiles(['php_manual.sqlite']);
        if (!empty($files)) {
            if ($this->warnOnMultipleConfigs && \count($files) > 1) {
                $msg = \sprintf('Multiple manual database files found: %s. Using %s', \implode(', ', $files), $files[0]);
                \trigger_error($msg, \E_USER_NOTICE);
            }
            return $this->manualDbFile = $files[0];
        }
    }
    public function getManualDb()
    {
        if (!isset($this->manualDb)) {
            $dbFile = $this->getManualDbFile();
            if ($dbFile !== null && \is_file($dbFile)) {
                try {
                    $this->manualDb = new \PDO('sqlite:' . $dbFile);
                } catch (\PDOException $e) {
                    if ($e->getMessage() === 'could not find driver') {
                        throw new RuntimeException('SQLite PDO driver not found', 0, $e);
                    } else {
                        throw $e;
                    }
                }
            }
        }
        return $this->manualDb;
    }
    public function addCasters(array $casters)
    {
        $this->getPresenter()->addCasters($casters);
    }
    public function getPresenter() : Presenter
    {
        if (!isset($this->presenter)) {
            $this->presenter = new Presenter($this->getOutput()->getFormatter(), $this->forceArrayIndexes());
        }
        return $this->presenter;
    }
    public function setWarnOnMultipleConfigs(bool $warnOnMultipleConfigs)
    {
        $this->warnOnMultipleConfigs = (bool) $warnOnMultipleConfigs;
    }
    public function warnOnMultipleConfigs() : bool
    {
        return $this->warnOnMultipleConfigs;
    }
    public function setColorMode(string $colorMode)
    {
        $validColorModes = [self::COLOR_MODE_AUTO, self::COLOR_MODE_FORCED, self::COLOR_MODE_DISABLED];
        if (!\in_array($colorMode, $validColorModes)) {
            throw new \InvalidArgumentException('Invalid color mode: ' . $colorMode);
        }
        $this->colorMode = $colorMode;
    }
    public function colorMode() : string
    {
        return $this->colorMode;
    }
    public function setInteractiveMode(string $interactiveMode)
    {
        $validInteractiveModes = [self::INTERACTIVE_MODE_AUTO, self::INTERACTIVE_MODE_FORCED, self::INTERACTIVE_MODE_DISABLED];
        if (!\in_array($interactiveMode, $validInteractiveModes)) {
            throw new \InvalidArgumentException('Invalid interactive mode: ' . $interactiveMode);
        }
        $this->interactiveMode = $interactiveMode;
    }
    public function interactiveMode() : string
    {
        return $this->interactiveMode;
    }
    public function setChecker(Checker $checker)
    {
        $this->checker = $checker;
    }
    public function getChecker() : Checker
    {
        if (!isset($this->checker)) {
            $interval = $this->getUpdateCheck();
            switch ($interval) {
                case Checker::ALWAYS:
                    $this->checker = new GitHubChecker();
                    break;
                case Checker::DAILY:
                case Checker::WEEKLY:
                case Checker::MONTHLY:
                    $checkFile = $this->getUpdateCheckCacheFile();
                    if ($checkFile === \false) {
                        $this->checker = new NoopChecker();
                    } else {
                        $this->checker = new IntervalChecker($checkFile, $interval);
                    }
                    break;
                case Checker::NEVER:
                    $this->checker = new NoopChecker();
                    break;
            }
        }
        return $this->checker;
    }
    public function getUpdateCheck() : string
    {
        return isset($this->updateCheck) ? $this->updateCheck : Checker::WEEKLY;
    }
    public function setUpdateCheck(string $interval)
    {
        $validIntervals = [Checker::ALWAYS, Checker::DAILY, Checker::WEEKLY, Checker::MONTHLY, Checker::NEVER];
        if (!\in_array($interval, $validIntervals)) {
            throw new \InvalidArgumentException('Invalid update check interval: ' . $interval);
        }
        $this->updateCheck = $interval;
    }
    public function getUpdateCheckCacheFile()
    {
        return ConfigPaths::touchFileWithMkdir($this->configPaths->currentConfigDir() . '/update_check.json');
    }
    public function setStartupMessage(string $message)
    {
        $this->startupMessage = $message;
    }
    public function getStartupMessage()
    {
        return $this->startupMessage;
    }
    public function setPrompt(string $prompt)
    {
        $this->prompt = $prompt;
        if (isset($this->theme)) {
            $this->theme->setPrompt($prompt);
        }
    }
    public function getPrompt()
    {
        return $this->prompt;
    }
    public function forceArrayIndexes() : bool
    {
        return $this->forceArrayIndexes;
    }
    public function setForceArrayIndexes(bool $forceArrayIndexes)
    {
        $this->forceArrayIndexes = $forceArrayIndexes;
    }
    public function setTheme($theme)
    {
        if (!$theme instanceof Theme) {
            $theme = new Theme($theme);
        }
        $this->theme = $theme;
        if (isset($this->prompt)) {
            $this->theme->setPrompt($this->prompt);
        }
        if (isset($this->output)) {
            $this->output->setTheme($theme);
            $this->applyFormatterStyles();
        }
    }
    public function theme() : Theme
    {
        if (!isset($this->theme)) {
            $this->theme = $this->prompt ? new Theme('classic') : new Theme();
        }
        if (isset($this->prompt)) {
            $this->theme->setPrompt($this->prompt);
        }
        return $this->theme;
    }
    public function setFormatterStyles(array $formatterStyles)
    {
        foreach ($formatterStyles as $name => $style) {
            $this->formatterStyles[$name] = new OutputFormatterStyle(...$style);
        }
        if (isset($this->output)) {
            $this->applyFormatterStyles();
        }
    }
    private function applyFormatterStyles()
    {
        $formatter = $this->output->getFormatter();
        foreach ($this->formatterStyles as $name => $style) {
            $formatter->setStyle($name, $style);
        }
        $errorFormatter = $this->output->getErrorOutput()->getFormatter();
        foreach (Theme::ERROR_STYLES as $name) {
            if (isset($this->formatterStyles[$name])) {
                $errorFormatter->setStyle($name, $this->formatterStyles[$name]);
            }
        }
    }
    public function verbosity() : string
    {
        return $this->verbosity;
    }
    public function setVerbosity(string $verbosity)
    {
        $validVerbosityLevels = [self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE, self::VERBOSITY_VERY_VERBOSE, self::VERBOSITY_DEBUG];
        if (!\in_array($verbosity, $validVerbosityLevels)) {
            throw new \InvalidArgumentException('Invalid verbosity level: ' . $verbosity);
        }
        $this->verbosity = $verbosity;
        if (isset($this->output)) {
            $this->output->setVerbosity($this->getOutputVerbosity());
        }
    }
    public function getOutputVerbosity() : int
    {
        switch ($this->verbosity()) {
            case self::VERBOSITY_QUIET:
                return OutputInterface::VERBOSITY_QUIET;
            case self::VERBOSITY_VERBOSE:
                return OutputInterface::VERBOSITY_VERBOSE;
            case self::VERBOSITY_VERY_VERBOSE:
                return OutputInterface::VERBOSITY_VERY_VERBOSE;
            case self::VERBOSITY_DEBUG:
                return OutputInterface::VERBOSITY_DEBUG;
            case self::VERBOSITY_NORMAL:
            default:
                return OutputInterface::VERBOSITY_NORMAL;
        }
    }
    public function inputIsPiped() : bool
    {
        if ($this->pipedInput === null) {
            $this->pipedInput = \defined('STDIN') && self::looksLikeAPipe(\STDIN);
        }
        return $this->pipedInput;
    }
    public function outputIsPiped() : bool
    {
        if ($this->pipedOutput === null) {
            $this->pipedOutput = self::looksLikeAPipe($this->getOutput()->getStream());
        }
        return $this->pipedOutput;
    }
    private static function looksLikeAPipe($stream) : bool
    {
        if (\function_exists('posix_isatty')) {
            return !\posix_isatty($stream);
        }
        $stat = \fstat($stream);
        $mode = $stat['mode'] & 0170000;
        return $mode === 010000 || $mode === 040000 || $mode === 0100000 || $mode === 0120000;
    }
}
<?php

namespace Cvphar\Psy;

use Cvphar\PhpParser\Parser;
use Cvphar\PhpParser\ParserFactory as OriginalParserFactory;
class ParserFactory
{
    const ONLY_PHP5 = 'ONLY_PHP5';
    const ONLY_PHP7 = 'ONLY_PHP7';
    const PREFER_PHP5 = 'PREFER_PHP5';
    const PREFER_PHP7 = 'PREFER_PHP7';
    public static function getPossibleKinds() : array
    {
        return ['ONLY_PHP5', 'ONLY_PHP7', 'PREFER_PHP5', 'PREFER_PHP7'];
    }
    public function getDefaultKind()
    {
        return static::ONLY_PHP7;
    }
    public function createParser($kind = null) : Parser
    {
        $originalFactory = new OriginalParserFactory();
        $kind = $kind ?: $this->getDefaultKind();
        if (!\in_array($kind, static::getPossibleKinds())) {
            throw new \InvalidArgumentException('Unknown parser kind');
        }
        $parser = $originalFactory->create(\constant(OriginalParserFactory::class . '::' . $kind));
        return $parser;
    }
}
<?php

namespace Cvphar\Psy\Formatter;

use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
class TraceFormatter
{
    public static function formatTrace(\Throwable $throwable, FilterOptions $filter = null, int $count = null, bool $includePsy = \true) : array
    {
        if ($cwd = \getcwd()) {
            $cwd = \rtrim($cwd, \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
        }
        if ($count === null) {
            $count = \PHP_INT_MAX;
        }
        $lines = [];
        $trace = $throwable->getTrace();
        \array_unshift($trace, ['function' => '', 'file' => $throwable->getFile() !== null ? $throwable->getFile() : 'n/a', 'line' => $throwable->getLine() !== null ? $throwable->getLine() : 'n/a', 'args' => []]);
        if (!$includePsy) {
            for ($i = \count($trace) - 1; $i >= 0; $i--) {
                $thing = isset($trace[$i]['class']) ? $trace[$i]['class'] : $trace[$i]['function'];
                if (\preg_match('/\\\\?Psy\\\\/', $thing)) {
                    $trace = \array_slice($trace, $i + 1);
                    break;
                }
            }
        }
        for ($i = 0, $count = \min($count, \count($trace)); $i < $count; $i++) {
            $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
            $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
            $function = $trace[$i]['function'];
            $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
            $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
            if ($cwd !== \false) {
                $file = \preg_replace('/^' . \preg_quote($cwd, '/') . '/', '', $file);
            }
            if (\preg_match("#/src/Execution(?:Loop)?Closure.php\\(\\d+\\) : eval\\(\\)'d code\$#", \str_replace('\\', '/', $file))) {
                $file = "eval()'d code";
            }
            if ($filter !== null && !$filter->match(\sprintf('%s%s%s() at %s:%s', $class, $type, $function, $file, $line))) {
                continue;
            }
            $lines[] = \sprintf(' <class>%s</class>%s%s() at <info>%s:%s</info>', OutputFormatter::escape($class), OutputFormatter::escape($type), OutputFormatter::escape($function), OutputFormatter::escape($file), OutputFormatter::escape($line));
        }
        return $lines;
    }
}
<?php

namespace Cvphar\Psy\Formatter;

use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
class CodeFormatter implements ReflectorFormatter
{
    const LINE_MARKER = '  <urgent>></urgent> ';
    const NO_LINE_MARKER = '    ';
    const HIGHLIGHT_DEFAULT = 'default';
    const HIGHLIGHT_KEYWORD = 'keyword';
    const HIGHLIGHT_PUBLIC = 'public';
    const HIGHLIGHT_PROTECTED = 'protected';
    const HIGHLIGHT_PRIVATE = 'private';
    const HIGHLIGHT_CONST = 'const';
    const HIGHLIGHT_NUMBER = 'number';
    const HIGHLIGHT_STRING = 'string';
    const HIGHLIGHT_COMMENT = 'code_comment';
    const HIGHLIGHT_INLINE_HTML = 'inline_html';
    private static $tokenMap = [\T_OPEN_TAG => self::HIGHLIGHT_DEFAULT, \T_OPEN_TAG_WITH_ECHO => self::HIGHLIGHT_DEFAULT, \T_CLOSE_TAG => self::HIGHLIGHT_DEFAULT, \T_STRING => self::HIGHLIGHT_DEFAULT, \T_VARIABLE => self::HIGHLIGHT_DEFAULT, \T_NS_SEPARATOR => self::HIGHLIGHT_DEFAULT, \T_PUBLIC => self::HIGHLIGHT_PUBLIC, \T_PROTECTED => self::HIGHLIGHT_PROTECTED, \T_PRIVATE => self::HIGHLIGHT_PRIVATE, \T_DIR => self::HIGHLIGHT_CONST, \T_FILE => self::HIGHLIGHT_CONST, \T_METHOD_C => self::HIGHLIGHT_CONST, \T_NS_C => self::HIGHLIGHT_CONST, \T_LINE => self::HIGHLIGHT_CONST, \T_CLASS_C => self::HIGHLIGHT_CONST, \T_FUNC_C => self::HIGHLIGHT_CONST, \T_TRAIT_C => self::HIGHLIGHT_CONST, \T_DNUMBER => self::HIGHLIGHT_NUMBER, \T_LNUMBER => self::HIGHLIGHT_NUMBER, \T_ENCAPSED_AND_WHITESPACE => self::HIGHLIGHT_STRING, \T_CONSTANT_ENCAPSED_STRING => self::HIGHLIGHT_STRING, \T_COMMENT => self::HIGHLIGHT_COMMENT, \T_DOC_COMMENT => self::HIGHLIGHT_COMMENT, \T_INLINE_HTML => self::HIGHLIGHT_INLINE_HTML];
    public static function format(\Reflector $reflector, string $colorMode = null) : string
    {
        if (self::isReflectable($reflector)) {
            if ($code = @\file_get_contents($reflector->getFileName())) {
                return self::formatCode($code, self::getStartLine($reflector), $reflector->getEndLine());
            }
        }
        throw new RuntimeException('Source code unavailable');
    }
    public static function formatCode(string $code, int $startLine = 1, int $endLine = null, int $markLine = null) : string
    {
        $spans = self::tokenizeSpans($code);
        $lines = self::splitLines($spans, $startLine, $endLine);
        $lines = self::formatLines($lines);
        $lines = self::numberLines($lines, $markLine);
        return \implode('', \iterator_to_array($lines));
    }
    private static function getStartLine(\Reflector $reflector) : int
    {
        $startLine = $reflector->getStartLine();
        if ($docComment = $reflector->getDocComment()) {
            $startLine -= \preg_match_all('/(\\r\\n?|\\n)/', $docComment) + 1;
        }
        return \max($startLine, 1);
    }
    private static function tokenizeSpans(string $code) : \Generator
    {
        $spanType = null;
        $buffer = '';
        foreach (\token_get_all($code) as $token) {
            $nextType = self::nextHighlightType($token, $spanType);
            $spanType = $spanType ?: $nextType;
            if ($spanType !== $nextType) {
                (yield [$spanType, $buffer]);
                $spanType = $nextType;
                $buffer = '';
            }
            $buffer .= \is_array($token) ? $token[1] : $token;
        }
        if ($spanType !== null && $buffer !== '') {
            (yield [$spanType, $buffer]);
        }
    }
    private static function nextHighlightType($token, $currentType)
    {
        if ($token === '"') {
            return self::HIGHLIGHT_STRING;
        }
        if (\is_array($token)) {
            if ($token[0] === \T_WHITESPACE) {
                return $currentType;
            }
            if (\array_key_exists($token[0], self::$tokenMap)) {
                return self::$tokenMap[$token[0]];
            }
        }
        return self::HIGHLIGHT_KEYWORD;
    }
    private static function splitLines(\Generator $spans, int $startLine = 1, int $endLine = null) : \Generator
    {
        $lineNum = 1;
        $buffer = [];
        foreach ($spans as list($spanType, $spanText)) {
            foreach (\preg_split('/(\\r\\n?|\\n)/', $spanText) as $index => $spanLine) {
                if ($index > 0) {
                    if ($lineNum >= $startLine) {
                        (yield $lineNum => $buffer);
                    }
                    $lineNum++;
                    $buffer = [];
                    if ($endLine !== null && $lineNum > $endLine) {
                        return;
                    }
                }
                if ($spanLine !== '') {
                    $buffer[] = [$spanType, $spanLine];
                }
            }
        }
        if (!empty($buffer)) {
            (yield $lineNum => $buffer);
        }
    }
    private static function formatLines(\Generator $spanLines) : \Generator
    {
        foreach ($spanLines as $lineNum => $spanLine) {
            $line = '';
            foreach ($spanLine as list($spanType, $spanText)) {
                if ($spanType === self::HIGHLIGHT_DEFAULT) {
                    $line .= OutputFormatter::escape($spanText);
                } else {
                    $line .= \sprintf('<%s>%s</%s>', $spanType, OutputFormatter::escape($spanText), $spanType);
                }
            }
            (yield $lineNum => $line . \PHP_EOL);
        }
    }
    private static function numberLines(\Generator $lines, int $markLine = null) : \Generator
    {
        $lines = \iterator_to_array($lines);
        \end($lines);
        $pad = \strlen(\key($lines));
        if ($markLine !== null) {
            if ($markLine > \key($lines)) {
                $markLine = null;
            }
            \reset($lines);
            if ($markLine < \key($lines)) {
                $markLine = null;
            }
        }
        foreach ($lines as $lineNum => $line) {
            $mark = '';
            if ($markLine !== null) {
                $mark = $markLine === $lineNum ? self::LINE_MARKER : self::NO_LINE_MARKER;
            }
            (yield \sprintf("%s<aside>%{$pad}s</aside>: %s", $mark, $lineNum, $line));
        }
    }
    /**
    @phpstan-assert-if-true
    */
    private static function isReflectable(\Reflector $reflector) : bool
    {
        return ($reflector instanceof \ReflectionClass || $reflector instanceof \ReflectionFunctionAbstract) && \is_file($reflector->getFileName());
    }
}
<?php

namespace Cvphar\Psy\Formatter;

interface Formatter extends ReflectorFormatter
{
}
<?php

namespace Cvphar\Psy\Formatter;

interface ReflectorFormatter
{
    public static function format(\Reflector $reflector) : string;
}
<?php

namespace Cvphar\Psy\Formatter;

use Cvphar\Psy\Util\Docblock;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
class DocblockFormatter implements ReflectorFormatter
{
    private static $vectorParamTemplates = ['type' => 'info', 'var' => 'strong'];
    public static function format(\Reflector $reflector) : string
    {
        $docblock = new Docblock($reflector);
        $chunks = [];
        if (!empty($docblock->desc)) {
            $chunks[] = '<comment>Description:</comment>';
            $chunks[] = self::indent(OutputFormatter::escape($docblock->desc), '  ');
            $chunks[] = '';
        }
        if (!empty($docblock->tags)) {
            foreach ($docblock::$vectors as $name => $vector) {
                if (isset($docblock->tags[$name])) {
                    $chunks[] = \sprintf('<comment>%s:</comment>', self::inflect($name));
                    $chunks[] = self::formatVector($vector, $docblock->tags[$name]);
                    $chunks[] = '';
                }
            }
            $tags = self::formatTags(\array_keys($docblock::$vectors), $docblock->tags);
            if (!empty($tags)) {
                $chunks[] = $tags;
                $chunks[] = '';
            }
        }
        return \rtrim(\implode("\n", $chunks));
    }
    private static function formatVector(array $vector, array $lines) : string
    {
        $template = [' '];
        foreach ($vector as $type) {
            $max = 0;
            foreach ($lines as $line) {
                $chunk = $line[$type];
                $cur = empty($chunk) ? 0 : \strlen($chunk) + 1;
                if ($cur > $max) {
                    $max = $cur;
                }
            }
            $template[] = self::getVectorParamTemplate($type, $max);
        }
        $template = \implode(' ', $template);
        return \implode("\n", \array_map(function ($line) use($template) {
            $escaped = \array_map(function ($l) {
                if ($l === null) {
                    return '';
                }
                return OutputFormatter::escape($l);
            }, $line);
            return \rtrim(\vsprintf($template, $escaped));
        }, $lines));
    }
    private static function formatTags(array $skip, array $tags) : string
    {
        $chunks = [];
        foreach ($tags as $name => $values) {
            if (\in_array($name, $skip)) {
                continue;
            }
            foreach ($values as $value) {
                $chunks[] = \sprintf('<comment>%s%s</comment> %s', self::inflect($name), empty($value) ? '' : ':', OutputFormatter::escape($value));
            }
            $chunks[] = '';
        }
        return \implode("\n", $chunks);
    }
    private static function getVectorParamTemplate(string $type, int $max) : string
    {
        if (!isset(self::$vectorParamTemplates[$type])) {
            return \sprintf('%%-%ds', $max);
        }
        return \sprintf('<%s>%%-%ds</%s>', self::$vectorParamTemplates[$type], $max, self::$vectorParamTemplates[$type]);
    }
    private static function indent(string $text, string $indent = '  ') : string
    {
        return $indent . \str_replace("\n", "\n" . $indent, $text);
    }
    private static function inflect(string $text) : string
    {
        $words = \trim(\preg_replace('/[\\s_-]+/', ' ', \preg_replace('/([a-z])([A-Z])/', '$1 $2', $text)));
        return \implode(' ', \array_map('ucfirst', \explode(' ', $words)));
    }
}
<?php

namespace Cvphar\Psy\Formatter;

use Cvphar\Psy\Reflection\ReflectionClassConstant;
use Cvphar\Psy\Reflection\ReflectionConstant_;
use Cvphar\Psy\Reflection\ReflectionLanguageConstruct;
use Cvphar\Psy\Util\Json;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
class SignatureFormatter implements ReflectorFormatter
{
    public static function format(\Reflector $reflector) : string
    {
        switch (\true) {
            case $reflector instanceof \ReflectionFunction:
            case $reflector instanceof ReflectionLanguageConstruct:
                return self::formatFunction($reflector);
            case $reflector instanceof \ReflectionClass:
                return self::formatClass($reflector);
            case $reflector instanceof ReflectionClassConstant:
            case $reflector instanceof \ReflectionClassConstant:
                return self::formatClassConstant($reflector);
            case $reflector instanceof \ReflectionMethod:
                return self::formatMethod($reflector);
            case $reflector instanceof \ReflectionProperty:
                return self::formatProperty($reflector);
            case $reflector instanceof ReflectionConstant_:
                return self::formatConstant($reflector);
            default:
                throw new \InvalidArgumentException('Unexpected Reflector class: ' . \get_class($reflector));
        }
    }
    public static function formatName(\Reflector $reflector) : string
    {
        return $reflector->getName();
    }
    private static function formatModifiers(\Reflector $reflector) : string
    {
        return \implode(' ', \array_map(function ($modifier) {
            return \sprintf('<keyword>%s</keyword>', $modifier);
        }, \Reflection::getModifierNames($reflector->getModifiers())));
    }
    private static function formatClass(\ReflectionClass $reflector) : string
    {
        $chunks = [];
        if ($modifiers = self::formatModifiers($reflector)) {
            $chunks[] = $modifiers;
        }
        if ($reflector->isTrait()) {
            $chunks[] = 'trait';
        } else {
            $chunks[] = $reflector->isInterface() ? 'interface' : 'class';
        }
        $chunks[] = \sprintf('<class>%s</class>', self::formatName($reflector));
        if ($parent = $reflector->getParentClass()) {
            $chunks[] = 'extends';
            $chunks[] = \sprintf('<class>%s</class>', $parent->getName());
        }
        $interfaces = $reflector->getInterfaceNames();
        if (!empty($interfaces)) {
            \sort($interfaces);
            $chunks[] = $reflector->isInterface() ? 'extends' : 'implements';
            $chunks[] = \implode(', ', \array_map(function ($name) {
                return \sprintf('<class>%s</class>', $name);
            }, $interfaces));
        }
        return \implode(' ', $chunks);
    }
    private static function formatClassConstant($reflector) : string
    {
        $value = $reflector->getValue();
        $style = self::getTypeStyle($value);
        return \sprintf('<keyword>const</keyword> <const>%s</const> = <%s>%s</%s>', self::formatName($reflector), $style, OutputFormatter::escape(Json::encode($value)), $style);
    }
    private static function formatConstant(ReflectionConstant_ $reflector) : string
    {
        $value = $reflector->getValue();
        $style = self::getTypeStyle($value);
        return \sprintf('<keyword>define</keyword>(<string>%s</string>, <%s>%s</%s>)', OutputFormatter::escape(Json::encode($reflector->getName())), $style, OutputFormatter::escape(Json::encode($value)), $style);
    }
    private static function getTypeStyle($value) : string
    {
        if (\is_int($value) || \is_float($value)) {
            return 'number';
        } elseif (\is_string($value)) {
            return 'string';
        } elseif (\is_bool($value) || $value === null) {
            return 'bool';
        } else {
            return 'strong';
        }
    }
    private static function formatProperty(\ReflectionProperty $reflector) : string
    {
        return \sprintf('%s <strong>$%s</strong>', self::formatModifiers($reflector), $reflector->getName());
    }
    private static function formatFunction(\ReflectionFunctionAbstract $reflector) : string
    {
        return \sprintf('<keyword>function</keyword> %s<function>%s</function>(%s)%s', $reflector->returnsReference() ? '&' : '', self::formatName($reflector), \implode(', ', self::formatFunctionParams($reflector)), self::formatFunctionReturnType($reflector));
    }
    private static function formatFunctionReturnType(\ReflectionFunctionAbstract $reflector) : string
    {
        if (!\method_exists($reflector, 'hasReturnType') || !$reflector->hasReturnType()) {
            return '';
        }
        return \sprintf(': %s', self::formatReflectionType($reflector->getReturnType()));
    }
    private static function formatMethod(\ReflectionMethod $reflector) : string
    {
        return \sprintf('%s %s', self::formatModifiers($reflector), self::formatFunction($reflector));
    }
    private static function formatFunctionParams(\ReflectionFunctionAbstract $reflector) : array
    {
        $params = [];
        foreach ($reflector->getParameters() as $param) {
            $hint = '';
            try {
                if (\method_exists($param, 'getType')) {
                    $hint = self::formatReflectionType($param->getType());
                } else {
                    if ($param->isArray()) {
                        $hint = '<keyword>array</keyword>';
                    } elseif ($class = $param->getClass()) {
                        $hint = \sprintf('<class>%s</class>', $class->getName());
                    }
                }
            } catch (\Throwable $e) {
                $chunks = \explode('$' . $param->getName(), (string) $param);
                $chunks = \explode(' ', \trim($chunks[0]));
                $guess = \end($chunks);
                $hint = \sprintf('<urgent>%s</urgent>', OutputFormatter::escape($guess));
            }
            if ($param->isOptional()) {
                if (!$param->isDefaultValueAvailable()) {
                    $value = 'unknown';
                    $typeStyle = 'urgent';
                } else {
                    $value = $param->getDefaultValue();
                    $typeStyle = self::getTypeStyle($value);
                    $value = \is_array($value) ? '[]' : ($value === null ? 'null' : \var_export($value, \true));
                }
                $default = \sprintf(' = <%s>%s</%s>', $typeStyle, OutputFormatter::escape($value), $typeStyle);
            } else {
                $default = '';
            }
            $params[] = \sprintf('%s%s%s<strong>$%s</strong>%s', $param->isPassedByReference() ? '&' : '', $hint, $hint !== '' ? ' ' : '', $param->getName(), $default);
        }
        return $params;
    }
    private static function formatReflectionType(\ReflectionType $type = null) : string
    {
        if ($type === null) {
            return '';
        }
        $types = $type instanceof \ReflectionUnionType ? $type->getTypes() : [$type];
        $formattedTypes = [];
        foreach ($types as $type) {
            $typeStyle = $type->isBuiltin() ? 'keyword' : 'class';
            $typeName = \method_exists($type, 'getName') ? $type->getName() : (string) $type;
            $formattedTypes[] = \sprintf('<%s>%s</%s>', $typeStyle, OutputFormatter::escape($typeName), $typeStyle);
        }
        return \implode('|', $formattedTypes);
    }
}
<?php

namespace Cvphar\Psy;

class Context
{
    private static $specialNames = ['_', '_e', '__out', '__psysh__', 'this'];
    private static $commandScopeNames = ['__function', '__method', '__class', '__namespace', '__file', '__line', '__dir'];
    private $scopeVariables = [];
    private $commandScopeVariables = [];
    private $returnValue;
    private $lastException;
    private $lastStdout;
    private $boundObject;
    private $boundClass;
    public function get(string $name)
    {
        switch ($name) {
            case '_':
                return $this->returnValue;
            case '_e':
                if (isset($this->lastException)) {
                    return $this->lastException;
                }
                break;
            case '__out':
                if (isset($this->lastStdout)) {
                    return $this->lastStdout;
                }
                break;
            case 'this':
                if (isset($this->boundObject)) {
                    return $this->boundObject;
                }
                break;
            case '__function':
            case '__method':
            case '__class':
            case '__namespace':
            case '__file':
            case '__line':
            case '__dir':
                if (\array_key_exists($name, $this->commandScopeVariables)) {
                    return $this->commandScopeVariables[$name];
                }
                break;
            default:
                if (\array_key_exists($name, $this->scopeVariables)) {
                    return $this->scopeVariables[$name];
                }
                break;
        }
        throw new \InvalidArgumentException('Unknown variable: $' . $name);
    }
    public function getAll() : array
    {
        return \array_merge($this->scopeVariables, $this->getSpecialVariables());
    }
    public function getSpecialVariables() : array
    {
        $vars = ['_' => $this->returnValue];
        if (isset($this->lastException)) {
            $vars['_e'] = $this->lastException;
        }
        if (isset($this->lastStdout)) {
            $vars['__out'] = $this->lastStdout;
        }
        if (isset($this->boundObject)) {
            $vars['this'] = $this->boundObject;
        }
        return \array_merge($vars, $this->commandScopeVariables);
    }
    public function setAll(array $vars)
    {
        foreach (self::$specialNames as $key) {
            unset($vars[$key]);
        }
        foreach (self::$commandScopeNames as $key) {
            unset($vars[$key]);
        }
        $this->scopeVariables = $vars;
    }
    public function setReturnValue($value)
    {
        $this->returnValue = $value;
    }
    public function getReturnValue()
    {
        return $this->returnValue;
    }
    public function setLastException(\Throwable $e)
    {
        $this->lastException = $e;
    }
    public function getLastException()
    {
        if (!isset($this->lastException)) {
            throw new \InvalidArgumentException('No most-recent exception');
        }
        return $this->lastException;
    }
    public function setLastStdout(string $lastStdout)
    {
        $this->lastStdout = $lastStdout;
    }
    public function getLastStdout()
    {
        if (!isset($this->lastStdout)) {
            throw new \InvalidArgumentException('No most-recent output');
        }
        return $this->lastStdout;
    }
    public function setBoundObject($boundObject)
    {
        $this->boundObject = \is_object($boundObject) ? $boundObject : null;
        $this->boundClass = null;
    }
    public function getBoundObject()
    {
        return $this->boundObject;
    }
    public function setBoundClass($boundClass)
    {
        $this->boundClass = \is_string($boundClass) && $boundClass !== '' ? $boundClass : null;
        $this->boundObject = null;
    }
    public function getBoundClass()
    {
        return $this->boundClass;
    }
    public function setCommandScopeVariables(array $commandScopeVariables)
    {
        $vars = [];
        foreach ($commandScopeVariables as $key => $value) {
            if (\is_scalar($value) && \in_array($key, self::$commandScopeNames)) {
                $vars[$key] = $value;
            }
        }
        $this->commandScopeVariables = $vars;
    }
    public function getCommandScopeVariables() : array
    {
        return $this->commandScopeVariables;
    }
    public function getUnusedCommandScopeVariableNames() : array
    {
        return \array_diff(self::$commandScopeNames, \array_keys($this->commandScopeVariables));
    }
    public static function isSpecialVariableName(string $name) : bool
    {
        return \in_array($name, self::$specialNames) || \in_array($name, self::$commandScopeNames);
    }
}
<?php

namespace Cvphar\Psy;

use Cvphar\PhpParser\NodeTraverser;
use Cvphar\PhpParser\Parser;
use Cvphar\PhpParser\PrettyPrinter\Standard as Printer;
use Cvphar\Psy\CodeCleaner\AbstractClassPass;
use Cvphar\Psy\CodeCleaner\AssignThisVariablePass;
use Cvphar\Psy\CodeCleaner\CalledClassPass;
use Cvphar\Psy\CodeCleaner\CallTimePassByReferencePass;
use Cvphar\Psy\CodeCleaner\CodeCleanerPass;
use Cvphar\Psy\CodeCleaner\EmptyArrayDimFetchPass;
use Cvphar\Psy\CodeCleaner\ExitPass;
use Cvphar\Psy\CodeCleaner\FinalClassPass;
use Cvphar\Psy\CodeCleaner\FunctionContextPass;
use Cvphar\Psy\CodeCleaner\FunctionReturnInWriteContextPass;
use Cvphar\Psy\CodeCleaner\ImplicitReturnPass;
use Cvphar\Psy\CodeCleaner\InstanceOfPass;
use Cvphar\Psy\CodeCleaner\IssetPass;
use Cvphar\Psy\CodeCleaner\LabelContextPass;
use Cvphar\Psy\CodeCleaner\LeavePsyshAlonePass;
use Cvphar\Psy\CodeCleaner\ListPass;
use Cvphar\Psy\CodeCleaner\LoopContextPass;
use Cvphar\Psy\CodeCleaner\MagicConstantsPass;
use Cvphar\Psy\CodeCleaner\NamespacePass;
use Cvphar\Psy\CodeCleaner\PassableByReferencePass;
use Cvphar\Psy\CodeCleaner\RequirePass;
use Cvphar\Psy\CodeCleaner\ReturnTypePass;
use Cvphar\Psy\CodeCleaner\StrictTypesPass;
use Cvphar\Psy\CodeCleaner\UseStatementPass;
use Cvphar\Psy\CodeCleaner\ValidClassNamePass;
use Cvphar\Psy\CodeCleaner\ValidConstructorPass;
use Cvphar\Psy\CodeCleaner\ValidFunctionNamePass;
use Cvphar\Psy\Exception\ParseErrorException;
class CodeCleaner
{
    private $yolo = \false;
    private $parser;
    private $printer;
    private $traverser;
    private $namespace;
    public function __construct(Parser $parser = null, Printer $printer = null, NodeTraverser $traverser = null, bool $yolo = \false)
    {
        $this->yolo = $yolo;
        if ($parser === null) {
            $parserFactory = new ParserFactory();
            $parser = $parserFactory->createParser();
        }
        $this->parser = $parser;
        $this->printer = $printer ?: new Printer();
        $this->traverser = $traverser ?: new NodeTraverser();
        foreach ($this->getDefaultPasses() as $pass) {
            $this->traverser->addVisitor($pass);
        }
    }
    public function yolo() : bool
    {
        return $this->yolo;
    }
    private function getDefaultPasses() : array
    {
        if ($this->yolo) {
            return $this->getYoloPasses();
        }
        $useStatementPass = new UseStatementPass();
        $namespacePass = new NamespacePass($this);
        $this->addImplicitDebugContext([$useStatementPass, $namespacePass]);
        return [new AbstractClassPass(), new AssignThisVariablePass(), new CalledClassPass(), new CallTimePassByReferencePass(), new FinalClassPass(), new FunctionContextPass(), new FunctionReturnInWriteContextPass(), new InstanceOfPass(), new IssetPass(), new LabelContextPass(), new LeavePsyshAlonePass(), new ListPass(), new LoopContextPass(), new PassableByReferencePass(), new ReturnTypePass(), new EmptyArrayDimFetchPass(), new ValidConstructorPass(), $useStatementPass, new ExitPass(), new ImplicitReturnPass(), new MagicConstantsPass(), $namespacePass, new RequirePass(), new StrictTypesPass(), new ValidClassNamePass(), new ValidFunctionNamePass()];
    }
    private function getYoloPasses() : array
    {
        $useStatementPass = new UseStatementPass();
        $namespacePass = new NamespacePass($this);
        $this->addImplicitDebugContext([$useStatementPass, $namespacePass]);
        return [new LeavePsyshAlonePass(), $useStatementPass, new ExitPass(), new ImplicitReturnPass(), new MagicConstantsPass(), $namespacePass, new RequirePass(), new StrictTypesPass()];
    }
    private function addImplicitDebugContext(array $passes)
    {
        $file = $this->getDebugFile();
        if ($file === null) {
            return;
        }
        try {
            $code = @\file_get_contents($file);
            if (!$code) {
                return;
            }
            $stmts = $this->parse($code, \true);
            if ($stmts === \false) {
                return;
            }
            $traverser = new NodeTraverser();
            foreach ($passes as $pass) {
                $traverser->addVisitor($pass);
            }
            $traverser->traverse($stmts);
        } catch (\Throwable $e) {
        }
    }
    private static function getDebugFile()
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
        foreach (\array_reverse($trace) as $stackFrame) {
            if (!self::isDebugCall($stackFrame)) {
                continue;
            }
            if (\preg_match('/eval\\(/', $stackFrame['file'])) {
                \preg_match_all('/([^\\(]+)\\((\\d+)/', $stackFrame['file'], $matches);
                return $matches[1][0];
            }
            return $stackFrame['file'];
        }
    }
    private static function isDebugCall(array $stackFrame) : bool
    {
        $class = isset($stackFrame['class']) ? $stackFrame['class'] : null;
        $function = isset($stackFrame['function']) ? $stackFrame['function'] : null;
        return $class === null && $function === 'Psy\\debug' || $class === Shell::class && $function === 'debug';
    }
    public function clean(array $codeLines, bool $requireSemicolons = \false)
    {
        $stmts = $this->parse('<?php ' . \implode(\PHP_EOL, $codeLines) . \PHP_EOL, $requireSemicolons);
        if ($stmts === \false) {
            return \false;
        }
        $stmts = $this->traverser->traverse($stmts);
        $oldLocale = \setlocale(\LC_NUMERIC, 0);
        \setlocale(\LC_NUMERIC, 'C');
        $code = $this->printer->prettyPrint($stmts);
        \setlocale(\LC_NUMERIC, $oldLocale);
        return $code;
    }
    public function setNamespace(array $namespace = null)
    {
        $this->namespace = $namespace;
    }
    public function getNamespace()
    {
        return $this->namespace;
    }
    protected function parse(string $code, bool $requireSemicolons = \false)
    {
        try {
            return $this->parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if ($this->parseErrorIsUnclosedString($e, $code)) {
                return \false;
            }
            if ($this->parseErrorIsUnterminatedComment($e, $code)) {
                return \false;
            }
            if ($this->parseErrorIsTrailingComma($e, $code)) {
                return \false;
            }
            if (!$this->parseErrorIsEOF($e)) {
                throw ParseErrorException::fromParseError($e);
            }
            if ($requireSemicolons) {
                return \false;
            }
            try {
                return $this->parser->parse($code . ';');
            } catch (\Cvphar\PhpParser\Error $e) {
                return \false;
            }
        }
    }
    private function parseErrorIsEOF(\Cvphar\PhpParser\Error $e) : bool
    {
        $msg = $e->getRawMessage();
        return $msg === 'Unexpected token EOF' || \strpos($msg, 'Syntax error, unexpected EOF') !== \false;
    }
    private function parseErrorIsUnclosedString(\Cvphar\PhpParser\Error $e, string $code) : bool
    {
        if ($e->getRawMessage() !== 'Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE') {
            return \false;
        }
        try {
            $this->parser->parse($code . "';");
        } catch (\Throwable $e) {
            return \false;
        }
        return \true;
    }
    private function parseErrorIsUnterminatedComment(\Cvphar\PhpParser\Error $e, $code) : bool
    {
        return $e->getRawMessage() === 'Unterminated comment';
    }
    private function parseErrorIsTrailingComma(\Cvphar\PhpParser\Error $e, $code) : bool
    {
        return $e->getRawMessage() === 'A trailing comma is not allowed here' && \substr(\rtrim($code), -1) === ',';
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\PhpParser\NodeTraverser;
use Cvphar\PhpParser\PrettyPrinter\Standard as Printer;
use Cvphar\Psy\CodeCleaner\NoReturnValue;
use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
use Cvphar\Psy\Exception\ErrorException;
use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Exception\UnexpectedTargetException;
use Cvphar\Psy\ParserFactory;
use Cvphar\Psy\Reflection\ReflectionClassConstant;
use Cvphar\Psy\Reflection\ReflectionConstant_;
use Cvphar\Psy\Sudo\SudoVisitor;
use Cvphar\Psy\Util\Mirror;
abstract class ReflectingCommand extends Command implements ContextAware
{
    const CLASS_OR_FUNC = '/^[\\\\\\w]+$/';
    const CLASS_MEMBER = '/^([\\\\\\w]+)::(\\w+)$/';
    const CLASS_STATIC = '/^([\\\\\\w]+)::\\$(\\w+)$/';
    const INSTANCE_MEMBER = '/^(\\$\\w+)(::|->)(\\w+)$/';
    protected $context;
    private $parser;
    private $traverser;
    private $printer;
    public function __construct($name = null)
    {
        $parserFactory = new ParserFactory();
        $this->parser = $parserFactory->createParser();
        $this->traverser = new NodeTraverser();
        $this->traverser->addVisitor(new SudoVisitor());
        $this->printer = new Printer();
        parent::__construct($name);
    }
    public function setContext(Context $context)
    {
        $this->context = $context;
    }
    protected function getTarget(string $valueName) : array
    {
        $valueName = \trim($valueName);
        $matches = [];
        switch (\true) {
            case \preg_match(self::CLASS_OR_FUNC, $valueName, $matches):
                return [$this->resolveName($matches[0], \true), null, 0];
            case \preg_match(self::CLASS_MEMBER, $valueName, $matches):
                return [$this->resolveName($matches[1]), $matches[2], Mirror::CONSTANT | Mirror::METHOD];
            case \preg_match(self::CLASS_STATIC, $valueName, $matches):
                return [$this->resolveName($matches[1]), $matches[2], Mirror::STATIC_PROPERTY | Mirror::PROPERTY];
            case \preg_match(self::INSTANCE_MEMBER, $valueName, $matches):
                if ($matches[2] === '->') {
                    $kind = Mirror::METHOD | Mirror::PROPERTY;
                } else {
                    $kind = Mirror::CONSTANT | Mirror::METHOD;
                }
                return [$this->resolveObject($matches[1]), $matches[3], $kind];
            default:
                return [$this->resolveObject($valueName), null, 0];
        }
    }
    protected function resolveName(string $name, bool $includeFunctions = \false) : string
    {
        $shell = $this->getApplication();
        if (\in_array(\strtolower($name), ['self', 'static'])) {
            if ($boundClass = $shell->getBoundClass()) {
                return $boundClass;
            }
            if ($boundObject = $shell->getBoundObject()) {
                return \get_class($boundObject);
            }
            $msg = \sprintf('Cannot use "%s" when no class scope is active', \strtolower($name));
            throw new ErrorException($msg, 0, \E_USER_ERROR, "eval()'d code", 1);
        }
        if (\substr($name, 0, 1) === '\\') {
            return $name;
        }
        if (self::couldBeClassName($name)) {
            try {
                $name = $this->resolveCode($name . '::class');
            } catch (RuntimeException $e) {
            }
        }
        if ($namespace = $shell->getNamespace()) {
            $fullName = $namespace . '\\' . $name;
            if (\class_exists($fullName) || \interface_exists($fullName) || $includeFunctions && \function_exists($fullName)) {
                return $fullName;
            }
        }
        return $name;
    }
    protected function couldBeClassName(string $name) : bool
    {
        return \preg_match('/^[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*(\\\\[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)*$/', $name) === 1;
    }
    protected function getTargetAndReflector(string $valueName) : array
    {
        list($value, $member, $kind) = $this->getTarget($valueName);
        return [$value, Mirror::get($value, $member, $kind)];
    }
    protected function resolveCode(string $code)
    {
        try {
            $nodes = $this->traverser->traverse($this->parse($code));
            $sudoCode = $this->printer->prettyPrint($nodes);
            $value = $this->getApplication()->execute($sudoCode, \true);
        } catch (\Throwable $e) {
        }
        if (!isset($value) || $value instanceof NoReturnValue) {
            throw new RuntimeException('Unknown target: ' . $code);
        }
        return $value;
    }
    private function parse($code)
    {
        $code = '<?php ' . $code;
        try {
            return $this->parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === \false) {
                throw $e;
            }
            return $this->parser->parse($code . ';');
        }
    }
    private function resolveObject(string $code)
    {
        $value = $this->resolveCode($code);
        if (!\is_object($value)) {
            throw new UnexpectedTargetException($value, 'Unable to inspect a non-object');
        }
        return $value;
    }
    protected function resolveInstance(string $name)
    {
        @\trigger_error('`resolveInstance` is deprecated; use `resolveCode` instead.', \E_USER_DEPRECATED);
        return $this->resolveCode($name);
    }
    protected function getScopeVariable(string $name)
    {
        return $this->context->get($name);
    }
    protected function getScopeVariables() : array
    {
        return $this->context->getAll();
    }
    protected function setCommandScopeVariables(\Reflector $reflector)
    {
        $vars = [];
        switch (\get_class($reflector)) {
            case \ReflectionClass::class:
            case \ReflectionObject::class:
                $vars['__class'] = $reflector->name;
                if ($reflector->inNamespace()) {
                    $vars['__namespace'] = $reflector->getNamespaceName();
                }
                break;
            case \ReflectionMethod::class:
                $vars['__method'] = \sprintf('%s::%s', $reflector->class, $reflector->name);
                $vars['__class'] = $reflector->class;
                $classReflector = $reflector->getDeclaringClass();
                if ($classReflector->inNamespace()) {
                    $vars['__namespace'] = $classReflector->getNamespaceName();
                }
                break;
            case \ReflectionFunction::class:
                $vars['__function'] = $reflector->name;
                if ($reflector->inNamespace()) {
                    $vars['__namespace'] = $reflector->getNamespaceName();
                }
                break;
            case \ReflectionGenerator::class:
                $funcReflector = $reflector->getFunction();
                $vars['__function'] = $funcReflector->name;
                if ($funcReflector->inNamespace()) {
                    $vars['__namespace'] = $funcReflector->getNamespaceName();
                }
                if ($fileName = $reflector->getExecutingFile()) {
                    $vars['__file'] = $fileName;
                    $vars['__line'] = $reflector->getExecutingLine();
                    $vars['__dir'] = \dirname($fileName);
                }
                break;
            case \ReflectionProperty::class:
            case \ReflectionClassConstant::class:
            case ReflectionClassConstant::class:
                $classReflector = $reflector->getDeclaringClass();
                $vars['__class'] = $classReflector->name;
                if ($classReflector->inNamespace()) {
                    $vars['__namespace'] = $classReflector->getNamespaceName();
                }
                if ($fileName = $reflector->getDeclaringClass()->getFileName()) {
                    $vars['__file'] = $fileName;
                    $vars['__dir'] = \dirname($fileName);
                }
                break;
            case ReflectionConstant_::class:
                if ($reflector->inNamespace()) {
                    $vars['__namespace'] = $reflector->getNamespaceName();
                }
                break;
        }
        if ($reflector instanceof \ReflectionClass || $reflector instanceof \ReflectionFunctionAbstract) {
            if ($fileName = $reflector->getFileName()) {
                $vars['__file'] = $fileName;
                $vars['__line'] = $reflector->getStartLine();
                $vars['__dir'] = \dirname($fileName);
            }
        }
        $this->context->setCommandScopeVariables($vars);
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Formatter\CodeFormatter;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\Shell;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class WhereamiCommand extends Command
{
    private $backtrace;
    public function __construct($colorMode = null)
    {
        $this->backtrace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
        parent::__construct();
    }
    protected function configure()
    {
        $this->setName('whereami')->setDefinition([new InputOption('num', 'n', InputOption::VALUE_OPTIONAL, 'Number of lines before and after.', '5'), new InputOption('file', 'f|a', InputOption::VALUE_NONE, 'Show the full source for the current file.')])->setDescription('Show where you are in the code.')->setHelp(<<<'HELP'
Show where you are in the code.

Optionally, include the number of lines before and after you want to display,
or --file for the whole file.

e.g.
<return>> whereami </return>
<return>> whereami -n10</return>
<return>> whereami --file</return>
HELP
);
    }
    protected function trace() : array
    {
        foreach (\array_reverse($this->backtrace) as $stackFrame) {
            if ($this->isDebugCall($stackFrame)) {
                return $stackFrame;
            }
        }
        return \end($this->backtrace);
    }
    private static function isDebugCall(array $stackFrame) : bool
    {
        $class = isset($stackFrame['class']) ? $stackFrame['class'] : null;
        $function = isset($stackFrame['function']) ? $stackFrame['function'] : null;
        return $class === null && $function === 'Psy\\debug' || $class === Shell::class && \in_array($function, ['__construct', 'debug']);
    }
    protected function fileInfo() : array
    {
        $stackFrame = $this->trace();
        if (\preg_match('/eval\\(/', $stackFrame['file'])) {
            \preg_match_all('/([^\\(]+)\\((\\d+)/', $stackFrame['file'], $matches);
            $file = $matches[1][0];
            $line = (int) $matches[2][0];
        } else {
            $file = $stackFrame['file'];
            $line = $stackFrame['line'];
        }
        return \compact('file', 'line');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $info = $this->fileInfo();
        $num = $input->getOption('num');
        $lineNum = $info['line'];
        $startLine = \max($lineNum - $num, 1);
        $endLine = $lineNum + $num;
        $code = \file_get_contents($info['file']);
        if ($input->getOption('file')) {
            $startLine = 1;
            $endLine = null;
        }
        if ($output instanceof ShellOutput) {
            $output->startPaging();
        }
        $output->writeln(\sprintf('From <info>%s:%s</info>:', $this->replaceCwd($info['file']), $lineNum));
        $output->write(CodeFormatter::formatCode($code, $startLine, $endLine, $lineNum), \false);
        if ($output instanceof ShellOutput) {
            $output->stopPaging();
        }
        return 0;
    }
    private function replaceCwd(string $file) : string
    {
        $cwd = \getcwd();
        if ($cwd === \false) {
            return $file;
        }
        $cwd = \rtrim($cwd, \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
        return \preg_replace('/^' . \preg_quote($cwd, '/') . '/', '', $file);
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class PsyVersionCommand extends Command
{
    protected function configure()
    {
        $this->setName('version')->setDefinition([])->setDescription('Show Psy Shell version.')->setHelp('Show Psy Shell version.');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln($this->getApplication()->getVersion());
        return 0;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Formatter\DocblockFormatter;
use Cvphar\Psy\Formatter\SignatureFormatter;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\Reflection\ReflectionClassConstant;
use Cvphar\Psy\Reflection\ReflectionConstant_;
use Cvphar\Psy\Reflection\ReflectionLanguageConstruct;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class DocCommand extends ReflectingCommand
{
    const INHERIT_DOC_TAG = '{@inheritdoc}';
    protected function configure()
    {
        $this->setName('doc')->setAliases(['rtfm', 'man'])->setDefinition([new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show documentation for superclasses as well as the current class.'), new CodeArgument('target', CodeArgument::REQUIRED, 'Function, class, instance, constant, method or property to document.')])->setDescription('Read the documentation for an object, class, constant, method or property.')->setHelp(<<<HELP
Read the documentation for an object, class, constant, method or property.

It's awesome for well-documented code, not quite as awesome for poorly documented code.

e.g.
<return>>>> doc preg_replace</return>
<return>>>> doc Psy\\Shell</return>
<return>>>> doc Psy\\Shell::debug</return>
<return>>>> \$s = new Psy\\Shell</return>
<return>>>> doc \$s->run</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $value = $input->getArgument('target');
        if (ReflectionLanguageConstruct::isLanguageConstruct($value)) {
            $reflector = new ReflectionLanguageConstruct($value);
            $doc = $this->getManualDocById($value);
        } else {
            list($target, $reflector) = $this->getTargetAndReflector($value);
            $doc = $this->getManualDoc($reflector) ?: DocblockFormatter::format($reflector);
        }
        $db = $this->getApplication()->getManualDb();
        if ($output instanceof ShellOutput) {
            $output->startPaging();
        }
        if ($reflector instanceof \ReflectionMethod || $reflector instanceof \ReflectionProperty) {
            $output->writeln(SignatureFormatter::format($reflector->getDeclaringClass()));
        }
        $output->writeln(SignatureFormatter::format($reflector));
        $output->writeln('');
        if (empty($doc) && !$db) {
            $output->writeln('<warning>PHP manual not found</warning>');
            $output->writeln('    To document core PHP functionality, download the PHP reference manual:');
            $output->writeln('    https://github.com/bobthecow/psysh/wiki/PHP-manual');
        } else {
            $output->writeln($doc);
        }
        if ($input->getOption('all') || \stripos($doc, self::INHERIT_DOC_TAG) !== \false) {
            $parent = $reflector;
            foreach ($this->getParentReflectors($reflector) as $parent) {
                $output->writeln('');
                $output->writeln('---');
                $output->writeln('');
                if ($parent instanceof \ReflectionMethod || $parent instanceof \ReflectionProperty) {
                    $output->writeln(SignatureFormatter::format($parent->getDeclaringClass()));
                }
                $output->writeln(SignatureFormatter::format($parent));
                $output->writeln('');
                if ($doc = $this->getManualDoc($parent) ?: DocblockFormatter::format($parent)) {
                    $output->writeln($doc);
                }
            }
        }
        if ($output instanceof ShellOutput) {
            $output->stopPaging();
        }
        $this->setCommandScopeVariables($reflector);
        return 0;
    }
    private function getManualDoc($reflector)
    {
        switch (\get_class($reflector)) {
            case \ReflectionClass::class:
            case \ReflectionObject::class:
            case \ReflectionFunction::class:
                $id = $reflector->name;
                break;
            case \ReflectionMethod::class:
                $id = $reflector->class . '::' . $reflector->name;
                break;
            case \ReflectionProperty::class:
                $id = $reflector->class . '::$' . $reflector->name;
                break;
            case \ReflectionClassConstant::class:
            case ReflectionClassConstant::class:
                $id = $reflector->class . '::' . $reflector->name;
                break;
            case ReflectionConstant_::class:
                $id = $reflector->name;
                break;
            default:
                return \false;
        }
        return $this->getManualDocById($id);
    }
    private function getParentReflectors($reflector) : \Generator
    {
        $seenClasses = [];
        switch (\get_class($reflector)) {
            case \ReflectionClass::class:
            case \ReflectionObject::class:
                foreach ($reflector->getTraits() as $trait) {
                    if (!\in_array($trait->getName(), $seenClasses)) {
                        $seenClasses[] = $trait->getName();
                        (yield $trait);
                    }
                }
                foreach ($reflector->getInterfaces() as $interface) {
                    if (!\in_array($interface->getName(), $seenClasses)) {
                        $seenClasses[] = $interface->getName();
                        (yield $interface);
                    }
                }
                while ($reflector = $reflector->getParentClass()) {
                    (yield $reflector);
                    foreach ($reflector->getTraits() as $trait) {
                        if (!\in_array($trait->getName(), $seenClasses)) {
                            $seenClasses[] = $trait->getName();
                            (yield $trait);
                        }
                    }
                    foreach ($reflector->getInterfaces() as $interface) {
                        if (!\in_array($interface->getName(), $seenClasses)) {
                            $seenClasses[] = $interface->getName();
                            (yield $interface);
                        }
                    }
                }
                return;
            case \ReflectionMethod::class:
                foreach ($this->getParentReflectors($reflector->getDeclaringClass()) as $parent) {
                    if ($parent->hasMethod($reflector->getName())) {
                        $parentMethod = $parent->getMethod($reflector->getName());
                        if (!\in_array($parentMethod->getDeclaringClass()->getName(), $seenClasses)) {
                            $seenClasses[] = $parentMethod->getDeclaringClass()->getName();
                            (yield $parentMethod);
                        }
                    }
                }
                return;
            case \ReflectionProperty::class:
                foreach ($this->getParentReflectors($reflector->getDeclaringClass()) as $parent) {
                    if ($parent->hasProperty($reflector->getName())) {
                        $parentProperty = $parent->getProperty($reflector->getName());
                        if (!\in_array($parentProperty->getDeclaringClass()->getName(), $seenClasses)) {
                            $seenClasses[] = $parentProperty->getDeclaringClass()->getName();
                            (yield $parentProperty);
                        }
                    }
                }
                break;
        }
    }
    private function getManualDocById($id)
    {
        if ($db = $this->getApplication()->getManualDb()) {
            $result = $db->query(\sprintf('SELECT doc FROM php_manual WHERE id = %s', $db->quote($id)));
            if ($result !== \false) {
                return $result->fetchColumn(0);
            }
        }
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Reflection\ReflectionClassConstant;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
class ClassConstantEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if ($reflector === null) {
            return [];
        }
        if (!$reflector instanceof \ReflectionClass) {
            return [];
        }
        if (!$input->getOption('constants')) {
            return [];
        }
        $noInherit = $input->getOption('no-inherit');
        $constants = $this->prepareConstants($this->getConstants($reflector, $noInherit));
        if (empty($constants)) {
            return [];
        }
        $ret = [];
        $ret[$this->getKindLabel($reflector)] = $constants;
        return $ret;
    }
    protected function getConstants(\ReflectionClass $reflector, bool $noInherit = \false) : array
    {
        $className = $reflector->getName();
        $constants = [];
        foreach ($reflector->getConstants() as $name => $constant) {
            $constReflector = ReflectionClassConstant::create($reflector->name, $name);
            if ($noInherit && $constReflector->getDeclaringClass()->getName() !== $className) {
                continue;
            }
            $constants[$name] = $constReflector;
        }
        \ksort($constants, \SORT_NATURAL | \SORT_FLAG_CASE);
        return $constants;
    }
    protected function prepareConstants(array $constants) : array
    {
        $ret = [];
        foreach ($constants as $name => $constant) {
            if ($this->showItem($name)) {
                $ret[$name] = ['name' => $name, 'style' => self::IS_CONSTANT, 'value' => $this->presentRef($constant->getValue())];
            }
        }
        return $ret;
    }
    protected function getKindLabel(\ReflectionClass $reflector) : string
    {
        if ($reflector->isInterface()) {
            return 'Interface Constants';
        } else {
            return 'Class Constants';
        }
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Context;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
class VariableEnumerator extends Enumerator
{
    private static $specialNames = ['_', '_e', '__out', '__function', '__method', '__class', '__namespace', '__file', '__line', '__dir'];
    private $context;
    public function __construct(Presenter $presenter, Context $context)
    {
        $this->context = $context;
        parent::__construct($presenter);
    }
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if ($reflector !== null || $target !== null) {
            return [];
        }
        if (!$input->getOption('vars')) {
            return [];
        }
        $showAll = $input->getOption('all');
        $variables = $this->prepareVariables($this->getVariables($showAll));
        if (empty($variables)) {
            return [];
        }
        return ['Variables' => $variables];
    }
    protected function getVariables(bool $showAll) : array
    {
        $scopeVars = $this->context->getAll();
        \uksort($scopeVars, function ($a, $b) {
            $aIndex = \array_search($a, self::$specialNames);
            $bIndex = \array_search($b, self::$specialNames);
            if ($aIndex !== \false) {
                if ($bIndex !== \false) {
                    return $aIndex - $bIndex;
                }
                return 1;
            }
            if ($bIndex !== \false) {
                return -1;
            }
            return \strnatcasecmp($a, $b);
        });
        $ret = [];
        foreach ($scopeVars as $name => $val) {
            if (!$showAll && \in_array($name, self::$specialNames)) {
                continue;
            }
            $ret[$name] = $val;
        }
        return $ret;
    }
    protected function prepareVariables(array $variables) : array
    {
        $ret = [];
        foreach ($variables as $name => $val) {
            if ($this->showItem($name)) {
                $fname = '$' . $name;
                $ret[$fname] = ['name' => $fname, 'style' => \in_array($name, self::$specialNames) ? self::IS_PRIVATE : self::IS_PUBLIC, 'value' => $this->presentRef($val)];
            }
        }
        return $ret;
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
class PropertyEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if ($reflector === null) {
            return [];
        }
        if (!$reflector instanceof \ReflectionClass) {
            return [];
        }
        if (!$input->getOption('properties')) {
            return [];
        }
        $showAll = $input->getOption('all');
        $noInherit = $input->getOption('no-inherit');
        $properties = $this->prepareProperties($this->getProperties($showAll, $reflector, $noInherit), $target);
        if (empty($properties)) {
            return [];
        }
        $ret = [];
        $ret[$this->getKindLabel($reflector)] = $properties;
        return $ret;
    }
    protected function getProperties(bool $showAll, \ReflectionClass $reflector, bool $noInherit = \false) : array
    {
        $className = $reflector->getName();
        $properties = [];
        foreach ($reflector->getProperties() as $property) {
            if ($noInherit && $property->getDeclaringClass()->getName() !== $className) {
                continue;
            }
            if ($showAll || $property->isPublic()) {
                $properties[$property->getName()] = $property;
            }
        }
        \ksort($properties, \SORT_NATURAL | \SORT_FLAG_CASE);
        return $properties;
    }
    protected function prepareProperties(array $properties, $target = null) : array
    {
        $ret = [];
        foreach ($properties as $name => $property) {
            if ($this->showItem($name)) {
                $fname = '$' . $name;
                $ret[$fname] = ['name' => $fname, 'style' => $this->getVisibilityStyle($property), 'value' => $this->presentValue($property, $target)];
            }
        }
        return $ret;
    }
    protected function getKindLabel(\ReflectionClass $reflector) : string
    {
        if (\method_exists($reflector, 'isTrait') && $reflector->isTrait()) {
            return 'Trait Properties';
        } else {
            return 'Class Properties';
        }
    }
    private function getVisibilityStyle(\ReflectionProperty $property) : string
    {
        if ($property->isPublic()) {
            return self::IS_PUBLIC;
        } elseif ($property->isProtected()) {
            return self::IS_PROTECTED;
        } else {
            return self::IS_PRIVATE;
        }
    }
    protected function presentValue(\ReflectionProperty $property, $target) : string
    {
        if (!$target) {
            return '';
        }
        if (!\is_object($target)) {
            try {
                $refl = new \ReflectionClass($target);
                $props = $refl->getDefaultProperties();
                if (\array_key_exists($property->name, $props)) {
                    $suffix = $property->isStatic() ? '' : ' <aside>(default)</aside>';
                    return $this->presentRef($props[$property->name]) . $suffix;
                }
            } catch (\Throwable $e) {
            }
            return '';
        }
        $property->setAccessible(\true);
        $value = $property->getValue($target);
        return $this->presentRef($value);
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
class GlobalVariableEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if ($reflector !== null || $target !== null) {
            return [];
        }
        if (!$input->getOption('globals')) {
            return [];
        }
        $globals = $this->prepareGlobals($this->getGlobals());
        if (empty($globals)) {
            return [];
        }
        return ['Global Variables' => $globals];
    }
    protected function getGlobals() : array
    {
        global $GLOBALS;
        $names = \array_keys($GLOBALS);
        \natcasesort($names);
        $ret = [];
        foreach ($names as $name) {
            $ret[$name] = $GLOBALS[$name];
        }
        return $ret;
    }
    protected function prepareGlobals(array $globals) : array
    {
        $ret = [];
        foreach ($globals as $name => $value) {
            if ($this->showItem($name)) {
                $fname = '$' . $name;
                $ret[$fname] = ['name' => $fname, 'style' => self::IS_GLOBAL, 'value' => $this->presentRef($value)];
            }
        }
        return $ret;
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Reflection\ReflectionNamespace;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
class ClassEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if (($target !== null || $reflector !== null) && !$reflector instanceof ReflectionNamespace) {
            return [];
        }
        $internal = $input->getOption('internal');
        $user = $input->getOption('user');
        $prefix = $reflector === null ? null : \strtolower($reflector->getName()) . '\\';
        $ret = [];
        if ($input->getOption('classes')) {
            $ret = \array_merge($ret, $this->filterClasses('Classes', \get_declared_classes(), $internal, $user, $prefix));
        }
        if ($input->getOption('interfaces')) {
            $ret = \array_merge($ret, $this->filterClasses('Interfaces', \get_declared_interfaces(), $internal, $user, $prefix));
        }
        if ($input->getOption('traits')) {
            $ret = \array_merge($ret, $this->filterClasses('Traits', \get_declared_traits(), $internal, $user, $prefix));
        }
        return \array_map([$this, 'prepareClasses'], \array_filter($ret));
    }
    protected function filterClasses(string $key, array $classes, bool $internal, bool $user, string $prefix = null) : array
    {
        $ret = [];
        if ($internal) {
            $ret['Internal ' . $key] = \array_filter($classes, function ($class) use($prefix) {
                if ($prefix !== null && \strpos(\strtolower($class), $prefix) !== 0) {
                    return \false;
                }
                $refl = new \ReflectionClass($class);
                return $refl->isInternal();
            });
        }
        if ($user) {
            $ret['User ' . $key] = \array_filter($classes, function ($class) use($prefix) {
                if ($prefix !== null && \strpos(\strtolower($class), $prefix) !== 0) {
                    return \false;
                }
                $refl = new \ReflectionClass($class);
                return !$refl->isInternal();
            });
        }
        if (!$user && !$internal) {
            $ret[$key] = \array_filter($classes, function ($class) use($prefix) {
                return $prefix === null || \strpos(\strtolower($class), $prefix) === 0;
            });
        }
        return $ret;
    }
    protected function prepareClasses(array $classes) : array
    {
        \natcasesort($classes);
        $ret = [];
        foreach ($classes as $name) {
            if ($this->showItem($name)) {
                $ret[$name] = ['name' => $name, 'style' => self::IS_CLASS, 'value' => $this->presentSignature($name)];
            }
        }
        return $ret;
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Reflection\ReflectionNamespace;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
class ConstantEnumerator extends Enumerator
{
    private static $categoryLabels = ['libxml' => 'libxml', 'openssl' => 'OpenSSL', 'pcre' => 'PCRE', 'sqlite3' => 'SQLite3', 'curl' => 'cURL', 'dom' => 'DOM', 'ftp' => 'FTP', 'gd' => 'GD', 'gmp' => 'GMP', 'iconv' => 'iconv', 'json' => 'JSON', 'ldap' => 'LDAP', 'mbstring' => 'mbstring', 'odbc' => 'ODBC', 'pcntl' => 'PCNTL', 'pgsql' => 'pgsql', 'posix' => 'POSIX', 'mysqli' => 'mysqli', 'soap' => 'SOAP', 'exif' => 'EXIF', 'sysvmsg' => 'sysvmsg', 'xml' => 'XML', 'xsl' => 'XSL'];
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if (($target !== null || $reflector !== null) && !$reflector instanceof ReflectionNamespace) {
            return [];
        }
        if (!$input->getOption('constants')) {
            return [];
        }
        $user = $input->getOption('user');
        $internal = $input->getOption('internal');
        $category = $input->getOption('category');
        if ($category) {
            $category = \strtolower($category);
            if ($category === 'internal') {
                $internal = \true;
                $category = null;
            } elseif ($category === 'user') {
                $user = \true;
                $category = null;
            }
        }
        $ret = [];
        if ($user) {
            $ret['User Constants'] = $this->getConstants('user');
        }
        if ($internal) {
            $ret['Internal Constants'] = $this->getConstants('internal');
        }
        if ($category) {
            $caseCategory = \array_key_exists($category, self::$categoryLabels) ? self::$categoryLabels[$category] : \ucfirst($category);
            $label = $caseCategory . ' Constants';
            $ret[$label] = $this->getConstants($category);
        }
        if (!$user && !$internal && !$category) {
            $ret['Constants'] = $this->getConstants();
        }
        if ($reflector !== null) {
            $prefix = \strtolower($reflector->getName()) . '\\';
            foreach ($ret as $key => $names) {
                foreach (\array_keys($names) as $name) {
                    if (\strpos(\strtolower($name), $prefix) !== 0) {
                        unset($ret[$key][$name]);
                    }
                }
            }
        }
        return \array_map([$this, 'prepareConstants'], \array_filter($ret));
    }
    protected function getConstants(string $category = null) : array
    {
        if (!$category) {
            return \get_defined_constants();
        }
        $consts = \get_defined_constants(\true);
        if ($category === 'internal') {
            unset($consts['user']);
            return \array_merge(...\array_values($consts));
        }
        foreach ($consts as $key => $value) {
            if (\strtolower($key) === $category) {
                return $value;
            }
        }
        return [];
    }
    protected function prepareConstants(array $constants) : array
    {
        $ret = [];
        $names = \array_keys($constants);
        \natcasesort($names);
        foreach ($names as $name) {
            if ($this->showItem($name)) {
                $ret[$name] = ['name' => $name, 'style' => self::IS_CONSTANT, 'value' => $this->presentRef($constants[$name])];
            }
        }
        return $ret;
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Formatter\SignatureFormatter;
use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Psy\Util\Mirror;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
abstract class Enumerator
{
    const IS_PUBLIC = 'public';
    const IS_PROTECTED = 'protected';
    const IS_PRIVATE = 'private';
    const IS_GLOBAL = 'global';
    const IS_CONSTANT = 'const';
    const IS_CLASS = 'class';
    const IS_FUNCTION = 'function';
    private $filter;
    private $presenter;
    public function __construct(Presenter $presenter)
    {
        $this->filter = new FilterOptions();
        $this->presenter = $presenter;
    }
    public function enumerate(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        $this->filter->bind($input);
        return $this->listItems($input, $reflector, $target);
    }
    protected abstract function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array;
    protected function showItem($name)
    {
        return $this->filter->match($name);
    }
    protected function presentRef($value)
    {
        return $this->presenter->presentRef($value);
    }
    protected function presentSignature($target)
    {
        if (!$target instanceof \Reflector) {
            $target = Mirror::get($target);
        }
        return SignatureFormatter::format($target);
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Psy\Reflection\ReflectionNamespace;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
class FunctionEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if (($target !== null || $reflector !== null) && !$reflector instanceof ReflectionNamespace) {
            return [];
        }
        if (!$input->getOption('functions')) {
            return [];
        }
        if ($input->getOption('user')) {
            $label = 'User Functions';
            $functions = $this->getFunctions('user');
        } elseif ($input->getOption('internal')) {
            $label = 'Internal Functions';
            $functions = $this->getFunctions('internal');
        } else {
            $label = 'Functions';
            $functions = $this->getFunctions();
        }
        $prefix = $reflector === null ? null : \strtolower($reflector->getName()) . '\\';
        $functions = $this->prepareFunctions($functions, $prefix);
        if (empty($functions)) {
            return [];
        }
        $ret = [];
        $ret[$label] = $functions;
        return $ret;
    }
    protected function getFunctions(string $type = null) : array
    {
        $funcs = \get_defined_functions();
        if ($type) {
            return $funcs[$type];
        } else {
            return \array_merge($funcs['internal'], $funcs['user']);
        }
    }
    protected function prepareFunctions(array $functions, string $prefix = null) : array
    {
        \natcasesort($functions);
        $ret = [];
        foreach ($functions as $name) {
            if ($prefix !== null && \strpos(\strtolower($name), $prefix) !== 0) {
                continue;
            }
            if ($this->showItem($name)) {
                try {
                    $ret[$name] = ['name' => $name, 'style' => self::IS_FUNCTION, 'value' => $this->presentSignature($name)];
                } catch (\Throwable $e) {
                }
            }
        }
        return $ret;
    }
}
<?php

namespace Cvphar\Psy\Command\ListCommand;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
class MethodEnumerator extends Enumerator
{
    protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null) : array
    {
        if ($reflector === null) {
            return [];
        }
        if (!$reflector instanceof \ReflectionClass) {
            return [];
        }
        if (!$input->getOption('methods')) {
            return [];
        }
        $showAll = $input->getOption('all');
        $noInherit = $input->getOption('no-inherit');
        $methods = $this->prepareMethods($this->getMethods($showAll, $reflector, $noInherit));
        if (empty($methods)) {
            return [];
        }
        $ret = [];
        $ret[$this->getKindLabel($reflector)] = $methods;
        return $ret;
    }
    protected function getMethods(bool $showAll, \ReflectionClass $reflector, bool $noInherit = \false) : array
    {
        $className = $reflector->getName();
        $methods = [];
        foreach ($reflector->getMethods() as $name => $method) {
            if (($noInherit || $method->isPrivate()) && $method->getDeclaringClass()->getName() !== $className) {
                continue;
            }
            if ($showAll || $method->isPublic()) {
                $methods[$method->getName()] = $method;
            }
        }
        \ksort($methods, \SORT_NATURAL | \SORT_FLAG_CASE);
        return $methods;
    }
    protected function prepareMethods(array $methods) : array
    {
        $ret = [];
        foreach ($methods as $name => $method) {
            if ($this->showItem($name)) {
                $ret[$name] = ['name' => $name, 'style' => $this->getVisibilityStyle($method), 'value' => $this->presentSignature($method)];
            }
        }
        return $ret;
    }
    protected function getKindLabel(\ReflectionClass $reflector) : string
    {
        if ($reflector->isInterface()) {
            return 'Interface Methods';
        } elseif (\method_exists($reflector, 'isTrait') && $reflector->isTrait()) {
            return 'Trait Methods';
        } else {
            return 'Class Methods';
        }
    }
    private function getVisibilityStyle(\ReflectionMethod $method) : string
    {
        if ($method->isPublic()) {
            return self::IS_PUBLIC;
        } elseif ($method->isProtected()) {
            return self::IS_PROTECTED;
        } else {
            return self::IS_PRIVATE;
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Formatter\TraceFormatter;
use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class TraceCommand extends Command
{
    protected $filter;
    public function __construct($name = null)
    {
        $this->filter = new FilterOptions();
        parent::__construct($name);
    }
    protected function configure()
    {
        list($grep, $insensitive, $invert) = FilterOptions::getOptions();
        $this->setName('trace')->setDefinition([new InputOption('include-psy', 'p', InputOption::VALUE_NONE, 'Include Psy in the call stack.'), new InputOption('num', 'n', InputOption::VALUE_REQUIRED, 'Only include NUM lines.'), $grep, $insensitive, $invert])->setDescription('Show the current call stack.')->setHelp(<<<'HELP'
Show the current call stack.

Optionally, include PsySH in the call stack by passing the <info>--include-psy</info> option.

e.g.
<return>> trace -n10</return>
<return>> trace --include-psy</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->filter->bind($input);
        $trace = $this->getBacktrace(new \Exception(), $input->getOption('num'), $input->getOption('include-psy'));
        $output->page($trace, ShellOutput::NUMBER_LINES);
        return 0;
    }
    protected function getBacktrace(\Throwable $e, int $count = null, bool $includePsy = \true) : array
    {
        return TraceFormatter::formatTrace($e, $this->filter, $count, $includePsy);
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Symfony\Component\Console\Helper\TableHelper;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class HelpCommand extends Command
{
    private $command;
    protected function configure()
    {
        $this->setName('help')->setAliases(['?'])->setDefinition([new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name.', null)])->setDescription('Show a list of commands. Type `help [foo]` for information about [foo].')->setHelp('My. How meta.');
    }
    public function setCommand(Command $command)
    {
        $this->command = $command;
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($this->command !== null) {
            $output->page($this->command->asText());
            $this->command = null;
        } elseif ($name = $input->getArgument('command_name')) {
            $output->page($this->getApplication()->get($name)->asText());
        } else {
            $commands = $this->getApplication()->all();
            $table = $this->getTable($output);
            foreach ($commands as $name => $command) {
                if ($name !== $command->getName()) {
                    continue;
                }
                if ($command->getAliases()) {
                    $aliases = \sprintf('<comment>Aliases:</comment> %s', \implode(', ', $command->getAliases()));
                } else {
                    $aliases = '';
                }
                $table->addRow([\sprintf('<info>%s</info>', $name), $command->getDescription(), $aliases]);
            }
            if ($output instanceof ShellOutput) {
                $output->startPaging();
            }
            if ($table instanceof TableHelper) {
                $table->render($output);
            } else {
                $table->render();
            }
            if ($output instanceof ShellOutput) {
                $output->stopPaging();
            }
        }
        return 0;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Exception\BreakException;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExitCommand extends Command
{
    protected function configure()
    {
        $this->setName('exit')->setAliases(['quit', 'q'])->setDefinition([])->setDescription('End the current session and return to caller.')->setHelp(<<<'HELP'
End the current session and return to caller.

e.g.
<return>>>> exit</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        throw new BreakException('Goodbye');
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Exception\UnexpectedTargetException;
use Cvphar\Psy\Formatter\CodeFormatter;
use Cvphar\Psy\Formatter\SignatureFormatter;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ShowCommand extends ReflectingCommand
{
    private $lastException;
    private $lastExceptionIndex;
    public function __construct($colorMode = null)
    {
        parent::__construct();
    }
    protected function configure()
    {
        $this->setName('show')->setDefinition([new CodeArgument('target', CodeArgument::OPTIONAL, 'Function, class, instance, constant, method or property to show.'), new InputOption('ex', null, InputOption::VALUE_OPTIONAL, 'Show last exception context. Optionally specify a stack index.', 1)])->setDescription('Show the code for an object, class, constant, method or property.')->setHelp(<<<HELP
Show the code for an object, class, constant, method or property, or the context
of the last exception.

<return>cat --ex</return> defaults to showing the lines surrounding the location of the last
exception. Invoking it more than once travels up the exception's stack trace,
and providing a number shows the context of the given index of the trace.

e.g.
<return>>>> show \$myObject</return>
<return>>>> show Psy\\Shell::debug</return>
<return>>>> show --ex</return>
<return>>>> show --ex 3</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $opts = $input->getOptions();
        if ($opts['ex'] !== 1) {
            if ($input->getArgument('target')) {
                throw new \InvalidArgumentException('Too many arguments (supply either "target" or "--ex")');
            }
            $this->writeExceptionContext($input, $output);
            return 0;
        }
        if ($input->getArgument('target')) {
            $this->writeCodeContext($input, $output);
            return 0;
        }
        throw new RuntimeException('Not enough arguments (missing: "target")');
    }
    private function writeCodeContext(InputInterface $input, OutputInterface $output)
    {
        try {
            list($target, $reflector) = $this->getTargetAndReflector($input->getArgument('target'));
        } catch (UnexpectedTargetException $e) {
            $target = $e->getTarget();
            if (\is_string($target) && \is_file($target) && ($code = @\file_get_contents($target))) {
                $file = \realpath($target);
                if ($file !== $this->context->get('__file')) {
                    $this->context->setCommandScopeVariables(['__file' => $file, '__dir' => \dirname($file)]);
                }
                $output->page(CodeFormatter::formatCode($code));
                return;
            } else {
                throw $e;
            }
        }
        $this->setCommandScopeVariables($reflector);
        try {
            $output->page(CodeFormatter::format($reflector));
        } catch (RuntimeException $e) {
            $output->writeln(SignatureFormatter::format($reflector));
            throw $e;
        }
    }
    private function writeExceptionContext(InputInterface $input, OutputInterface $output)
    {
        $exception = $this->context->getLastException();
        if ($exception !== $this->lastException) {
            $this->lastException = null;
            $this->lastExceptionIndex = null;
        }
        $opts = $input->getOptions();
        if ($opts['ex'] === null) {
            if ($this->lastException && $this->lastExceptionIndex !== null) {
                $index = $this->lastExceptionIndex + 1;
            } else {
                $index = 0;
            }
        } else {
            $index = \max(0, (int) $input->getOption('ex') - 1);
        }
        $trace = $exception->getTrace();
        \array_unshift($trace, ['file' => $exception->getFile(), 'line' => $exception->getLine()]);
        if ($index >= \count($trace)) {
            $index = 0;
        }
        $this->lastException = $exception;
        $this->lastExceptionIndex = $index;
        $output->writeln($this->getApplication()->formatException($exception));
        $output->writeln('--');
        $this->writeTraceLine($output, $trace, $index);
        $this->writeTraceCodeSnippet($output, $trace, $index);
        $this->setCommandScopeVariablesFromContext($trace[$index]);
    }
    private function writeTraceLine(OutputInterface $output, array $trace, $index)
    {
        $file = isset($trace[$index]['file']) ? $this->replaceCwd($trace[$index]['file']) : 'n/a';
        $line = isset($trace[$index]['line']) ? $trace[$index]['line'] : 'n/a';
        $output->writeln(\sprintf('From <info>%s:%d</info> at <strong>level %d</strong> of backtrace (of %d):', OutputFormatter::escape($file), OutputFormatter::escape($line), $index + 1, \count($trace)));
    }
    private function replaceCwd(string $file) : string
    {
        if ($cwd = \getcwd()) {
            $cwd = \rtrim($cwd, \DIRECTORY_SEPARATOR) . \DIRECTORY_SEPARATOR;
        }
        if ($cwd === \false) {
            return $file;
        } else {
            return \preg_replace('/^' . \preg_quote($cwd, '/') . '/', '', $file);
        }
    }
    private function writeTraceCodeSnippet(OutputInterface $output, array $trace, $index)
    {
        if (!isset($trace[$index]['file'])) {
            return;
        }
        $file = $trace[$index]['file'];
        if ($fileAndLine = $this->extractEvalFileAndLine($file)) {
            list($file, $line) = $fileAndLine;
        } else {
            if (!isset($trace[$index]['line'])) {
                return;
            }
            $line = $trace[$index]['line'];
        }
        if (\is_file($file)) {
            $code = @\file_get_contents($file);
        }
        if (empty($code)) {
            return;
        }
        $startLine = \max($line - 5, 0);
        $endLine = $line + 5;
        $output->write(CodeFormatter::formatCode($code, $startLine, $endLine, $line), \false);
    }
    private function setCommandScopeVariablesFromContext(array $context)
    {
        $vars = [];
        if (isset($context['class'])) {
            $vars['__class'] = $context['class'];
            if (isset($context['function'])) {
                $vars['__method'] = $context['function'];
            }
            try {
                $refl = new \ReflectionClass($context['class']);
                if ($namespace = $refl->getNamespaceName()) {
                    $vars['__namespace'] = $namespace;
                }
            } catch (\Throwable $e) {
            }
        } elseif (isset($context['function'])) {
            $vars['__function'] = $context['function'];
            try {
                $refl = new \ReflectionFunction($context['function']);
                if ($namespace = $refl->getNamespaceName()) {
                    $vars['__namespace'] = $namespace;
                }
            } catch (\Throwable $e) {
            }
        }
        if (isset($context['file'])) {
            $file = $context['file'];
            if ($fileAndLine = $this->extractEvalFileAndLine($file)) {
                list($file, $line) = $fileAndLine;
            } elseif (isset($context['line'])) {
                $line = $context['line'];
            }
            if (\is_file($file)) {
                $vars['__file'] = $file;
                if (isset($line)) {
                    $vars['__line'] = $line;
                }
                $vars['__dir'] = \dirname($file);
            }
        }
        $this->context->setCommandScopeVariables($vars);
    }
    private function extractEvalFileAndLine(string $file)
    {
        if (\preg_match('/(.*)\\((\\d+)\\) : eval\\(\\)\'d code$/', $file, $matches)) {
            return [$matches[1], $matches[2]];
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\PhpParser\NodeTraverser;
use Cvphar\PhpParser\PrettyPrinter\Standard as Printer;
use Cvphar\Psy\Command\TimeitCommand\TimeitVisitor;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\ParserFactory;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class TimeitCommand extends Command
{
    const RESULT_MSG = '<info>Command took %.6f seconds to complete.</info>';
    const AVG_RESULT_MSG = '<info>Command took %.6f seconds on average (%.6f median; %.6f total) to complete.</info>';
    private static $useHrtime;
    private static $start = null;
    private static $times = [];
    private $parser;
    private $traverser;
    private $printer;
    public function __construct($name = null)
    {
        self::$useHrtime = \function_exists('hrtime');
        $parserFactory = new ParserFactory();
        $this->parser = $parserFactory->createParser();
        $this->traverser = new NodeTraverser();
        $this->traverser->addVisitor(new TimeitVisitor());
        $this->printer = new Printer();
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('timeit')->setDefinition([new InputOption('num', 'n', InputOption::VALUE_REQUIRED, 'Number of iterations.'), new CodeArgument('code', CodeArgument::REQUIRED, 'Code to execute.')])->setDescription('Profiles with a timer.')->setHelp(<<<'HELP'
Time profiling for functions and commands.

e.g.
<return>>>> timeit sleep(1)</return>
<return>>>> timeit -n1000 $closure()</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $code = $input->getArgument('code');
        $num = $input->getOption('num') ?: 1;
        $shell = $this->getApplication();
        $instrumentedCode = $this->instrumentCode($code);
        self::$times = [];
        for ($i = 0; $i < $num; $i++) {
            $_ = $shell->execute($instrumentedCode);
            $this->ensureEndMarked();
        }
        $shell->writeReturnValue($_);
        $times = self::$times;
        self::$times = [];
        if ($num === 1) {
            $output->writeln(\sprintf(self::RESULT_MSG, $times[0] / 1000000000.0));
        } else {
            $total = \array_sum($times);
            \rsort($times);
            $median = $times[\round($num / 2)];
            $output->writeln(\sprintf(self::AVG_RESULT_MSG, $total / $num / 1000000000.0, $median / 1000000000.0, $total / 1000000000.0));
        }
        return 0;
    }
    public static function markStart()
    {
        self::$start = self::$useHrtime ? \hrtime(\true) : \microtime(\true) * 1000000.0;
    }
    public static function markEnd($ret = null)
    {
        self::$times[] = (self::$useHrtime ? \hrtime(\true) : \microtime(\true) * 1000000.0) - self::$start;
        self::$start = null;
        return $ret;
    }
    private function ensureEndMarked()
    {
        if (self::$start !== null) {
            self::markEnd();
        }
    }
    private function instrumentCode(string $code) : string
    {
        return $this->printer->prettyPrint($this->traverser->traverse($this->parse($code)));
    }
    private function parse(string $code) : array
    {
        $code = '<?php ' . $code;
        try {
            return $this->parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === \false) {
                throw $e;
            }
            return $this->parser->parse($code . ';');
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr\New_;
use Cvphar\PhpParser\Node\Expr\Variable;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Scalar\String_;
use Cvphar\PhpParser\Node\Stmt\Throw_;
use Cvphar\PhpParser\PrettyPrinter\Standard as Printer;
use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
use Cvphar\Psy\Exception\ThrowUpException;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\ParserFactory;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ThrowUpCommand extends Command implements ContextAware
{
    private $parser;
    private $printer;
    public function __construct($name = null)
    {
        $parserFactory = new ParserFactory();
        $this->parser = $parserFactory->createParser();
        $this->printer = new Printer();
        parent::__construct($name);
    }
    public function setContext(Context $context)
    {
    }
    protected function configure()
    {
        $this->setName('throw-up')->setDefinition([new CodeArgument('exception', CodeArgument::OPTIONAL, 'Exception or Error to throw.')])->setDescription('Throw an exception or error out of the Psy Shell.')->setHelp(<<<'HELP'
Throws an exception or error out of the current the Psy Shell instance.

By default it throws the most recent exception.

e.g.
<return>>>> throw-up</return>
<return>>>> throw-up $e</return>
<return>>>> throw-up new Exception('WHEEEEEE!')</return>
<return>>>> throw-up "bye!"</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $args = $this->prepareArgs($input->getArgument('exception'));
        $throwStmt = new Throw_(new New_(new FullyQualifiedName(ThrowUpException::class), $args));
        $throwCode = $this->printer->prettyPrint([$throwStmt]);
        $shell = $this->getApplication();
        $shell->addCode($throwCode, !$shell->hasCode());
        return 0;
    }
    private function prepareArgs(string $code = null) : array
    {
        if (!$code) {
            return [new Arg(new Variable('_e'))];
        }
        if (\strpos($code, '<?') === \false) {
            $code = '<?php ' . $code;
        }
        $nodes = $this->parse($code);
        if (\count($nodes) !== 1) {
            throw new \InvalidArgumentException('No idea how to throw this');
        }
        $node = $nodes[0];
        $expr = isset($node->expr) ? $node->expr : $node;
        $args = [new Arg($expr, \false, \false, $node->getAttributes())];
        if ($expr instanceof String_) {
            return [new New_(new FullyQualifiedName(\Exception::class), $args)];
        }
        return $args;
    }
    private function parse(string $code) : array
    {
        try {
            return $this->parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === \false) {
                throw $e;
            }
            return $this->parser->parse($code . ';');
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Command\ListCommand\ClassConstantEnumerator;
use Cvphar\Psy\Command\ListCommand\ClassEnumerator;
use Cvphar\Psy\Command\ListCommand\ConstantEnumerator;
use Cvphar\Psy\Command\ListCommand\FunctionEnumerator;
use Cvphar\Psy\Command\ListCommand\GlobalVariableEnumerator;
use Cvphar\Psy\Command\ListCommand\MethodEnumerator;
use Cvphar\Psy\Command\ListCommand\PropertyEnumerator;
use Cvphar\Psy\Command\ListCommand\VariableEnumerator;
use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Psy\VarDumper\PresenterAware;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Helper\TableHelper;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ListCommand extends ReflectingCommand implements PresenterAware
{
    protected $presenter;
    protected $enumerators;
    public function setPresenter(Presenter $presenter)
    {
        $this->presenter = $presenter;
    }
    protected function configure()
    {
        list($grep, $insensitive, $invert) = FilterOptions::getOptions();
        $this->setName('ls')->setAliases(['dir'])->setDefinition([new CodeArgument('target', CodeArgument::OPTIONAL, 'A target class or object to list.'), new InputOption('vars', '', InputOption::VALUE_NONE, 'Display variables.'), new InputOption('constants', 'c', InputOption::VALUE_NONE, 'Display defined constants.'), new InputOption('functions', 'f', InputOption::VALUE_NONE, 'Display defined functions.'), new InputOption('classes', 'k', InputOption::VALUE_NONE, 'Display declared classes.'), new InputOption('interfaces', 'I', InputOption::VALUE_NONE, 'Display declared interfaces.'), new InputOption('traits', 't', InputOption::VALUE_NONE, 'Display declared traits.'), new InputOption('no-inherit', '', InputOption::VALUE_NONE, 'Exclude inherited methods, properties and constants.'), new InputOption('properties', 'p', InputOption::VALUE_NONE, 'Display class or object properties (public properties by default).'), new InputOption('methods', 'm', InputOption::VALUE_NONE, 'Display class or object methods (public methods by default).'), $grep, $insensitive, $invert, new InputOption('globals', 'g', InputOption::VALUE_NONE, 'Include global variables.'), new InputOption('internal', 'n', InputOption::VALUE_NONE, 'Limit to internal functions and classes.'), new InputOption('user', 'u', InputOption::VALUE_NONE, 'Limit to user-defined constants, functions and classes.'), new InputOption('category', 'C', InputOption::VALUE_REQUIRED, 'Limit to constants in a specific category (e.g. "date").'), new InputOption('all', 'a', InputOption::VALUE_NONE, 'Include private and protected methods and properties.'), new InputOption('long', 'l', InputOption::VALUE_NONE, 'List in long format: includes class names and method signatures.')])->setDescription('List local, instance or class variables, methods and constants.')->setHelp(<<<'HELP'
List variables, constants, classes, interfaces, traits, functions, methods,
and properties.

Called without options, this will return a list of variables currently in scope.

If a target object is provided, list properties, constants and methods of that
target. If a class, interface or trait name is passed instead, list constants
and methods on that class.

e.g.
<return>>>> ls</return>
<return>>>> ls $foo</return>
<return>>>> ls -k --grep mongo -i</return>
<return>>>> ls -al ReflectionClass</return>
<return>>>> ls --constants --category date</return>
<return>>>> ls -l --functions --grep /^array_.*/</return>
<return>>>> ls -l --properties new DateTime()</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateInput($input);
        $this->initEnumerators();
        $method = $input->getOption('long') ? 'writeLong' : 'write';
        if ($target = $input->getArgument('target')) {
            list($target, $reflector) = $this->getTargetAndReflector($target);
        } else {
            $reflector = null;
        }
        if ($output instanceof ShellOutput && $input->getOption('long')) {
            $output->startPaging();
        }
        foreach ($this->enumerators as $enumerator) {
            $this->{$method}($output, $enumerator->enumerate($input, $reflector, $target));
        }
        if ($output instanceof ShellOutput && $input->getOption('long')) {
            $output->stopPaging();
        }
        if ($reflector !== null) {
            $this->setCommandScopeVariables($reflector);
        }
        return 0;
    }
    protected function initEnumerators()
    {
        if (!isset($this->enumerators)) {
            $mgr = $this->presenter;
            $this->enumerators = [new ClassConstantEnumerator($mgr), new ClassEnumerator($mgr), new ConstantEnumerator($mgr), new FunctionEnumerator($mgr), new GlobalVariableEnumerator($mgr), new PropertyEnumerator($mgr), new MethodEnumerator($mgr), new VariableEnumerator($mgr, $this->context)];
        }
    }
    protected function write(OutputInterface $output, array $result)
    {
        if (\count($result) === 0) {
            return;
        }
        foreach ($result as $label => $items) {
            $names = \array_map([$this, 'formatItemName'], $items);
            $output->writeln(\sprintf('<strong>%s</strong>: %s', $label, \implode(', ', $names)));
        }
    }
    protected function writeLong(OutputInterface $output, array $result)
    {
        if (\count($result) === 0) {
            return;
        }
        $table = $this->getTable($output);
        foreach ($result as $label => $items) {
            $output->writeln('');
            $output->writeln(\sprintf('<strong>%s:</strong>', $label));
            $table->setRows([]);
            foreach ($items as $item) {
                $table->addRow([$this->formatItemName($item), $item['value']]);
            }
            if ($table instanceof TableHelper) {
                $table->render($output);
            } else {
                $table->render();
            }
        }
    }
    private function formatItemName(array $item) : string
    {
        return \sprintf('<%s>%s</%s>', $item['style'], OutputFormatter::escape($item['name']), $item['style']);
    }
    private function validateInput(InputInterface $input)
    {
        if (!$input->getArgument('target')) {
            foreach (['properties', 'methods', 'no-inherit'] as $option) {
                if ($input->getOption($option)) {
                    throw new RuntimeException('--' . $option . ' does not make sense without a specified target');
                }
            }
            foreach (['globals', 'vars', 'constants', 'functions', 'classes', 'interfaces', 'traits'] as $option) {
                if ($input->getOption($option)) {
                    return;
                }
            }
            $input->setOption('vars', \true);
        } else {
            foreach (['vars', 'globals'] as $option) {
                if ($input->getOption($option)) {
                    throw new RuntimeException('--' . $option . ' does not make sense with a specified target');
                }
            }
            foreach (['constants', 'properties', 'methods', 'functions', 'classes', 'interfaces', 'traits'] as $option) {
                if ($input->getOption($option)) {
                    return;
                }
            }
            $input->setOption('constants', \true);
            $input->setOption('properties', \true);
            $input->setOption('methods', \true);
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class EditCommand extends Command implements ContextAware
{
    private $runtimeDir = '';
    private $context;
    public function __construct($runtimeDir, $name = null)
    {
        parent::__construct($name);
        $this->runtimeDir = $runtimeDir;
    }
    protected function configure()
    {
        $this->setName('edit')->setDefinition([new InputArgument('file', InputArgument::OPTIONAL, 'The file to open for editing. If this is not given, edits a temporary file.', null), new InputOption('exec', 'e', InputOption::VALUE_NONE, 'Execute the file content after editing. This is the default when a file name argument is not given.', null), new InputOption('no-exec', 'E', InputOption::VALUE_NONE, 'Do not execute the file content after editing. This is the default when a file name argument is given.', null)])->setDescription('Open an external editor. Afterwards, get produced code in input buffer.')->setHelp('Set the EDITOR environment variable to something you\'d like to use.');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('exec') && $input->getOption('no-exec')) {
            throw new \InvalidArgumentException('The --exec and --no-exec flags are mutually exclusive');
        }
        $filePath = $this->extractFilePath($input->getArgument('file'));
        $execute = $this->shouldExecuteFile($input->getOption('exec'), $input->getOption('no-exec'), $filePath);
        $shouldRemoveFile = \false;
        if ($filePath === null) {
            $filePath = \tempnam($this->runtimeDir, 'psysh-edit-command');
            $shouldRemoveFile = \true;
        }
        $editedContent = $this->editFile($filePath, $shouldRemoveFile);
        if ($execute) {
            $this->getApplication()->addInput($editedContent);
        }
        return 0;
    }
    private function shouldExecuteFile(bool $execOption, bool $noExecOption, string $filePath = null) : bool
    {
        if ($execOption) {
            return \true;
        }
        if ($noExecOption) {
            return \false;
        }
        return $filePath === null;
    }
    private function extractFilePath(string $fileArgument = null)
    {
        if ($fileArgument !== null && $fileArgument !== '' && $fileArgument[0] === '$') {
            $fileArgument = $this->context->get(\preg_replace('/^\\$/', '', $fileArgument));
        }
        return $fileArgument;
    }
    private function editFile(string $filePath, bool $shouldRemoveFile) : string
    {
        $escapedFilePath = \escapeshellarg($filePath);
        $editor = isset($_SERVER['EDITOR']) && $_SERVER['EDITOR'] ? $_SERVER['EDITOR'] : 'nano';
        $pipes = [];
        $proc = \proc_open("{$editor} {$escapedFilePath}", [\STDIN, \STDOUT, \STDERR], $pipes);
        \proc_close($proc);
        $editedContent = @\file_get_contents($filePath);
        if ($shouldRemoveFile) {
            @\unlink($filePath);
        }
        if ($editedContent === \false) {
            throw new \UnexpectedValueException("Reading {$filePath} returned false");
        }
        return $editedContent;
    }
    public function setContext(Context $context)
    {
        $this->context = $context;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ClearCommand extends Command
{
    protected function configure()
    {
        $this->setName('clear')->setDefinition([])->setDescription('Clear the Psy Shell screen.')->setHelp(<<<'HELP'
Clear the Psy Shell screen.

Pro Tip: If your PHP has readline support, you should be able to use ctrl+l too!
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->write(\sprintf('%c[2J%c[0;0f', 27, 27));
        return 0;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Exception\RuntimeException;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class BufferCommand extends Command
{
    protected function configure()
    {
        $this->setName('buffer')->setAliases(['buf'])->setDefinition([new InputOption('clear', '', InputOption::VALUE_NONE, 'Clear the current buffer.')])->setDescription('Show (or clear) the contents of the code input buffer.')->setHelp(<<<'HELP'
Show the contents of the code buffer for the current multi-line expression.

Optionally, clear the buffer by passing the <info>--clear</info> option.
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $app = $this->getApplication();
        if (!$app instanceof \Cvphar\Psy\Shell) {
            throw new RuntimeException('Buffer command requires a \\Psy\\Shell application');
        }
        $buf = $app->getCodeBuffer();
        if ($input->getOption('clear')) {
            $app->resetCodeBuffer();
            $output->writeln($this->formatLines($buf, 'urgent'), ShellOutput::NUMBER_LINES);
        } else {
            $output->writeln($this->formatLines($buf), ShellOutput::NUMBER_LINES);
        }
        return 0;
    }
    protected function formatLines(array $lines, string $type = 'return') : array
    {
        $template = \sprintf('<%s>%%s</%s>', $type, $type);
        return \array_map(function ($line) use($template) {
            return \sprintf($template, $line);
        }, $lines);
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\PhpParser\NodeTraverser;
use Cvphar\PhpParser\PrettyPrinter\Standard as Printer;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\ParserFactory;
use Cvphar\Psy\Readline\Readline;
use Cvphar\Psy\Sudo\SudoVisitor;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SudoCommand extends Command
{
    private $readline;
    private $parser;
    private $traverser;
    private $printer;
    public function __construct($name = null)
    {
        $parserFactory = new ParserFactory();
        $this->parser = $parserFactory->createParser();
        $this->traverser = new NodeTraverser();
        $this->traverser->addVisitor(new SudoVisitor());
        $this->printer = new Printer();
        parent::__construct($name);
    }
    public function setReadline(Readline $readline)
    {
        $this->readline = $readline;
    }
    protected function configure()
    {
        $this->setName('sudo')->setDefinition([new CodeArgument('code', CodeArgument::REQUIRED, 'Code to execute.')])->setDescription('Evaluate PHP code, bypassing visibility restrictions.')->setHelp(<<<'HELP'
Evaluate PHP code, bypassing visibility restrictions.

e.g.
<return>>>> $sekret->whisper("hi")</return>
<return>PHP error:  Call to private method Sekret::whisper() from context '' on line 1</return>

<return>>>> sudo $sekret->whisper("hi")</return>
<return>=> "hi"</return>

<return>>>> $sekret->word</return>
<return>PHP error:  Cannot access private property Sekret::$word on line 1</return>

<return>>>> sudo $sekret->word</return>
<return>=> "hi"</return>

<return>>>> $sekret->word = "please"</return>
<return>PHP error:  Cannot access private property Sekret::$word on line 1</return>

<return>>>> sudo $sekret->word = "please"</return>
<return>=> "please"</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $code = $input->getArgument('code');
        if ($code === '!!') {
            $history = $this->readline->listHistory();
            if (\count($history) < 2) {
                throw new \InvalidArgumentException('No previous command to replay');
            }
            $code = $history[\count($history) - 2];
        }
        if (\strpos($code, '<?') === \false) {
            $code = '<?php ' . $code;
        }
        $nodes = $this->traverser->traverse($this->parse($code));
        $sudoCode = $this->printer->prettyPrint($nodes);
        $shell = $this->getApplication();
        $shell->addCode($sudoCode, !$shell->hasCode());
        return 0;
    }
    private function parse(string $code) : array
    {
        try {
            return $this->parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === \false) {
                throw $e;
            }
            return $this->parser->parse($code . ';');
        }
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Shell;
use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command as BaseCommand;
use Cvphar\Symfony\Component\Console\Helper\Table;
use Cvphar\Symfony\Component\Console\Helper\TableHelper;
use Cvphar\Symfony\Component\Console\Helper\TableStyle;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
abstract class Command extends BaseCommand
{
    public function setApplication(Application $application = null)
    {
        if ($application !== null && !$application instanceof Shell) {
            throw new \InvalidArgumentException('PsySH Commands require an instance of Psy\\Shell');
        }
        return parent::setApplication($application);
    }
    public function asText() : string
    {
        $messages = ['<comment>Usage:</comment>', ' ' . $this->getSynopsis(), ''];
        if ($this->getAliases()) {
            $messages[] = $this->aliasesAsText();
        }
        if ($this->getArguments()) {
            $messages[] = $this->argumentsAsText();
        }
        if ($this->getOptions()) {
            $messages[] = $this->optionsAsText();
        }
        if ($help = $this->getProcessedHelp()) {
            $messages[] = '<comment>Help:</comment>';
            $messages[] = ' ' . \str_replace("\n", "\n ", $help) . "\n";
        }
        return \implode("\n", $messages);
    }
    private function getArguments() : array
    {
        $hidden = $this->getHiddenArguments();
        return \array_filter($this->getNativeDefinition()->getArguments(), function ($argument) use($hidden) {
            return !\in_array($argument->getName(), $hidden);
        });
    }
    protected function getHiddenArguments() : array
    {
        return ['command'];
    }
    private function getOptions() : array
    {
        $hidden = $this->getHiddenOptions();
        return \array_filter($this->getNativeDefinition()->getOptions(), function ($option) use($hidden) {
            return !\in_array($option->getName(), $hidden);
        });
    }
    protected function getHiddenOptions() : array
    {
        return ['verbose'];
    }
    private function aliasesAsText() : string
    {
        return '<comment>Aliases:</comment> <info>' . \implode(', ', $this->getAliases()) . '</info>' . \PHP_EOL;
    }
    private function argumentsAsText() : string
    {
        $max = $this->getMaxWidth();
        $messages = [];
        $arguments = $this->getArguments();
        if (!empty($arguments)) {
            $messages[] = '<comment>Arguments:</comment>';
            foreach ($arguments as $argument) {
                if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) {
                    $default = \sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($argument->getDefault()));
                } else {
                    $default = '';
                }
                $description = \str_replace("\n", "\n" . \str_pad('', $max + 2, ' '), $argument->getDescription());
                $messages[] = \sprintf(" <info>%-{$max}s</info> %s%s", $argument->getName(), $description, $default);
            }
            $messages[] = '';
        }
        return \implode(\PHP_EOL, $messages);
    }
    private function optionsAsText() : string
    {
        $max = $this->getMaxWidth();
        $messages = [];
        $options = $this->getOptions();
        if ($options) {
            $messages[] = '<comment>Options:</comment>';
            foreach ($options as $option) {
                if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) {
                    $default = \sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($option->getDefault()));
                } else {
                    $default = '';
                }
                $multiple = $option->isArray() ? '<comment> (multiple values allowed)</comment>' : '';
                $description = \str_replace("\n", "\n" . \str_pad('', $max + 2, ' '), $option->getDescription());
                $optionMax = $max - \strlen($option->getName()) - 2;
                $messages[] = \sprintf(" <info>%s</info> %-{$optionMax}s%s%s%s", '--' . $option->getName(), $option->getShortcut() ? \sprintf('(-%s) ', $option->getShortcut()) : '', $description, $default, $multiple);
            }
            $messages[] = '';
        }
        return \implode(\PHP_EOL, $messages);
    }
    private function getMaxWidth() : int
    {
        $max = 0;
        foreach ($this->getOptions() as $option) {
            $nameLength = \strlen($option->getName()) + 2;
            if ($option->getShortcut()) {
                $nameLength += \strlen($option->getShortcut()) + 3;
            }
            $max = \max($max, $nameLength);
        }
        foreach ($this->getArguments() as $argument) {
            $max = \max($max, \strlen($argument->getName()));
        }
        return ++$max;
    }
    private function formatDefaultValue($default) : string
    {
        if (\is_array($default) && $default === \array_values($default)) {
            return \sprintf("['%s']", \implode("', '", $default));
        }
        return \str_replace("\n", '', \var_export($default, \true));
    }
    protected function getTable(OutputInterface $output)
    {
        if (!\class_exists(Table::class)) {
            return $this->getTableHelper();
        }
        $style = new TableStyle();
        if (\method_exists($style, 'setVerticalBorderChars')) {
            $style->setVerticalBorderChars(' ');
            $style->setHorizontalBorderChars('');
            $style->setCrossingChars('', '', '', '', '', '', '', '', '');
        } else {
            $style->setVerticalBorderChar(' ');
            $style->setHorizontalBorderChar('');
            $style->setCrossingChar('');
        }
        $table = new Table($output);
        return $table->setRows([])->setStyle($style);
    }
    protected function getTableHelper() : TableHelper
    {
        $table = $this->getApplication()->getHelperSet()->get('table');
        return $table->setRows([])->setLayout(TableHelper::LAYOUT_BORDERLESS)->setHorizontalBorderChar('')->setCrossingChar('');
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Parser;
use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\ParserFactory;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Psy\VarDumper\PresenterAware;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\VarDumper\Caster\Caster;
class ParseCommand extends Command implements ContextAware, PresenterAware
{
    protected $context;
    private $presenter;
    private $parserFactory;
    private $parsers;
    public function __construct($name = null)
    {
        $this->parserFactory = new ParserFactory();
        $this->parsers = [];
        parent::__construct($name);
    }
    public function setContext(Context $context)
    {
        $this->context = $context;
    }
    public function setPresenter(Presenter $presenter)
    {
        $this->presenter = clone $presenter;
        $this->presenter->addCasters([Node::class => function (Node $node, array $a) {
            $a = [Caster::PREFIX_VIRTUAL . 'type' => $node->getType(), Caster::PREFIX_VIRTUAL . 'attributes' => $node->getAttributes()];
            foreach ($node->getSubNodeNames() as $name) {
                $a[Caster::PREFIX_VIRTUAL . $name] = $node->{$name};
            }
            return $a;
        }]);
    }
    protected function configure()
    {
        $kindMsg = 'One of PhpParser\\ParserFactory constants: ' . \implode(', ', ParserFactory::getPossibleKinds()) . " (default is based on current interpreter's version).";
        $this->setName('parse')->setDefinition([new CodeArgument('code', CodeArgument::REQUIRED, 'PHP code to parse.'), new InputOption('depth', '', InputOption::VALUE_REQUIRED, 'Depth to parse.', 10), new InputOption('kind', '', InputOption::VALUE_REQUIRED, $kindMsg, $this->parserFactory->getDefaultKind())])->setDescription('Parse PHP code and show the abstract syntax tree.')->setHelp(<<<'HELP'
Parse PHP code and show the abstract syntax tree.

This command is used in the development of PsySH. Given a string of PHP code,
it pretty-prints the PHP Parser parse tree.

See https://github.com/nikic/PHP-Parser

It prolly won't be super useful for most of you, but it's here if you want to play.
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $code = $input->getArgument('code');
        if (\strpos($code, '<?') === \false) {
            $code = '<?php ' . $code;
        }
        $parserKind = $input->getOption('kind');
        $depth = $input->getOption('depth');
        $nodes = $this->parse($this->getParser($parserKind), $code);
        $output->page($this->presenter->present($nodes, $depth));
        $this->context->setReturnValue($nodes);
        return 0;
    }
    private function parse(Parser $parser, string $code) : array
    {
        try {
            return $parser->parse($code);
        } catch (\Cvphar\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === \false) {
                throw $e;
            }
            return $parser->parse($code . ';');
        }
    }
    private function getParser(string $kind = null) : Parser
    {
        if (!\array_key_exists($kind, $this->parsers)) {
            $this->parsers[$kind] = $this->parserFactory->createParser($kind);
        }
        return $this->parsers[$kind];
    }
}
<?php

namespace Cvphar\Psy\Command\TimeitCommand;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\FunctionLike;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Stmt\Expression;
use Cvphar\PhpParser\Node\Stmt\Return_;
use Cvphar\PhpParser\NodeVisitorAbstract;
use Cvphar\Psy\CodeCleaner\NoReturnValue;
use Cvphar\Psy\Command\TimeitCommand;
class TimeitVisitor extends NodeVisitorAbstract
{
    private $functionDepth;
    public function beforeTraverse(array $nodes)
    {
        $this->functionDepth = 0;
    }
    public function enterNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth++;
            return;
        }
        if ($this->functionDepth === 0 && $node instanceof Return_) {
            return new Return_($this->getEndCall($node->expr), $node->getAttributes());
        }
    }
    public function leaveNode(Node $node)
    {
        if ($node instanceof FunctionLike) {
            $this->functionDepth--;
        }
    }
    public function afterTraverse(array $nodes)
    {
        \array_unshift($nodes, $this->maybeExpression($this->getStartCall()));
        $last = $nodes[\count($nodes) - 1];
        if ($last instanceof Expr) {
            \array_pop($nodes);
            $nodes[] = $this->getEndCall($last);
        } elseif ($last instanceof Expression) {
            \array_pop($nodes);
            $nodes[] = new Expression($this->getEndCall($last->expr), $last->getAttributes());
        } elseif ($last instanceof Return_) {
        } else {
            $nodes[] = $this->maybeExpression($this->getEndCall());
        }
        return $nodes;
    }
    private function getStartCall() : StaticCall
    {
        return new StaticCall(new FullyQualifiedName(TimeitCommand::class), 'markStart');
    }
    private function getEndCall(Expr $arg = null) : StaticCall
    {
        if ($arg === null) {
            $arg = NoReturnValue::create();
        }
        return new StaticCall(new FullyQualifiedName(TimeitCommand::class), 'markEnd', [new Arg($arg)]);
    }
    private function maybeExpression(Node $expr, array $attrs = [])
    {
        return \class_exists(Expression::class) ? new Expression($expr, $attrs) : $expr;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Context;
use Cvphar\Psy\ContextAware;
use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class WtfCommand extends TraceCommand implements ContextAware
{
    protected $context;
    public function setContext(Context $context)
    {
        $this->context = $context;
    }
    protected function configure()
    {
        list($grep, $insensitive, $invert) = FilterOptions::getOptions();
        $this->setName('wtf')->setAliases(['last-exception', 'wtf?'])->setDefinition([new InputArgument('incredulity', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Number of lines to show.'), new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show entire backtrace.'), $grep, $insensitive, $invert])->setDescription('Show the backtrace of the most recent exception.')->setHelp(<<<'HELP'
Shows a few lines of the backtrace of the most recent exception.

If you want to see more lines, add more question marks or exclamation marks:

e.g.
<return>>>> wtf ?</return>
<return>>>> wtf ?!???!?!?</return>

To see the entire backtrace, pass the -a/--all flag:

e.g.
<return>>>> wtf -a</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->filter->bind($input);
        $incredulity = \implode('', $input->getArgument('incredulity'));
        if (\strlen(\preg_replace('/[\\?!]/', '', $incredulity))) {
            throw new \InvalidArgumentException('Incredulity must include only "?" and "!"');
        }
        $exception = $this->context->getLastException();
        $count = $input->getOption('all') ? \PHP_INT_MAX : \max(3, \pow(2, \strlen($incredulity) + 1));
        $shell = $this->getApplication();
        if ($output instanceof ShellOutput) {
            $output->startPaging();
        }
        do {
            $traceCount = \count($exception->getTrace());
            $showLines = $count;
            if ($traceCount < \max($count * 1.2, $count + 2)) {
                $showLines = \PHP_INT_MAX;
            }
            $trace = $this->getBacktrace($exception, $showLines);
            $moreLines = $traceCount - \count($trace);
            $output->writeln($shell->formatException($exception));
            $output->writeln('--');
            $output->write($trace, \true, ShellOutput::NUMBER_LINES);
            $output->writeln('');
            if ($moreLines > 0) {
                $output->writeln(\sprintf('<aside>Use <return>wtf -a</return> to see %d more lines</aside>', $moreLines));
                $output->writeln('');
            }
        } while ($exception = $exception->getPrevious());
        if ($output instanceof ShellOutput) {
            $output->stopPaging();
        }
        return 0;
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Input\CodeArgument;
use Cvphar\Psy\VarDumper\Presenter;
use Cvphar\Psy\VarDumper\PresenterAware;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ReflectingCommand implements PresenterAware
{
    private $presenter;
    public function setPresenter(Presenter $presenter)
    {
        $this->presenter = $presenter;
    }
    protected function configure()
    {
        $this->setName('dump')->setDefinition([new CodeArgument('target', CodeArgument::REQUIRED, 'A target object or primitive to dump.'), new InputOption('depth', '', InputOption::VALUE_REQUIRED, 'Depth to parse.', 10), new InputOption('all', 'a', InputOption::VALUE_NONE, 'Include private and protected methods and properties.')])->setDescription('Dump an object or primitive.')->setHelp(<<<'HELP'
Dump an object or primitive.

This is like var_dump but <strong>way</strong> awesomer.

e.g.
<return>>>> dump $_</return>
<return>>>> dump $someVar</return>
<return>>>> dump $stuff->getAll()</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $depth = $input->getOption('depth');
        $target = $this->resolveCode($input->getArgument('target'));
        $output->page($this->presenter->present($target, $depth, $input->getOption('all') ? Presenter::VERBOSE : 0));
        if (\is_object($target)) {
            $this->setCommandScopeVariables(new \ReflectionObject($target));
        }
        return 0;
    }
    protected function resolveTarget(string $name)
    {
        @\trigger_error('`resolveTarget` is deprecated; use `resolveCode` instead.', \E_USER_DEPRECATED);
        return $this->resolveCode($name);
    }
}
<?php

namespace Cvphar\Psy\Command;

use Cvphar\Psy\Input\FilterOptions;
use Cvphar\Psy\Output\ShellOutput;
use Cvphar\Psy\Readline\Readline;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class HistoryCommand extends Command
{
    private $filter;
    private $readline;
    public function __construct($name = null)
    {
        $this->filter = new FilterOptions();
        parent::__construct($name);
    }
    public function setReadline(Readline $readline)
    {
        $this->readline = $readline;
    }
    protected function configure()
    {
        list($grep, $insensitive, $invert) = FilterOptions::getOptions();
        $this->setName('history')->setAliases(['hist'])->setDefinition([new InputOption('show', 's', InputOption::VALUE_REQUIRED, 'Show the given range of lines.'), new InputOption('head', 'H', InputOption::VALUE_REQUIRED, 'Display the first N items.'), new InputOption('tail', 'T', InputOption::VALUE_REQUIRED, 'Display the last N items.'), $grep, $insensitive, $invert, new InputOption('no-numbers', 'N', InputOption::VALUE_NONE, 'Omit line numbers.'), new InputOption('save', '', InputOption::VALUE_REQUIRED, 'Save history to a file.'), new InputOption('replay', '', InputOption::VALUE_NONE, 'Replay.'), new InputOption('clear', '', InputOption::VALUE_NONE, 'Clear the history.')])->setDescription('Show the Psy Shell history.')->setHelp(<<<'HELP'
Show, search, save or replay the Psy Shell history.

e.g.
<return>>>> history --grep /[bB]acon/</return>
<return>>>> history --show 0..10 --replay</return>
<return>>>> history --clear</return>
<return>>>> history --tail 1000 --save somefile.txt</return>
HELP
);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateOnlyOne($input, ['show', 'head', 'tail']);
        $this->validateOnlyOne($input, ['save', 'replay', 'clear']);
        $history = $this->getHistorySlice($input->getOption('show'), $input->getOption('head'), $input->getOption('tail'));
        $highlighted = \false;
        $this->filter->bind($input);
        if ($this->filter->hasFilter()) {
            $matches = [];
            $highlighted = [];
            foreach ($history as $i => $line) {
                if ($this->filter->match($line, $matches)) {
                    if (isset($matches[0])) {
                        $chunks = \explode($matches[0], $history[$i]);
                        $chunks = \array_map([__CLASS__, 'escape'], $chunks);
                        $glue = \sprintf('<urgent>%s</urgent>', self::escape($matches[0]));
                        $highlighted[$i] = \implode($glue, $chunks);
                    }
                } else {
                    unset($history[$i]);
                }
            }
        }
        if ($save = $input->getOption('save')) {
            $output->writeln(\sprintf('Saving history in %s...', $save));
            \file_put_contents($save, \implode(\PHP_EOL, $history) . \PHP_EOL);
            $output->writeln('<info>History saved.</info>');
        } elseif ($input->getOption('replay')) {
            if (!($input->getOption('show') || $input->getOption('head') || $input->getOption('tail'))) {
                throw new \InvalidArgumentException('You must limit history via --head, --tail or --show before replaying');
            }
            $count = \count($history);
            $output->writeln(\sprintf('Replaying %d line%s of history', $count, $count !== 1 ? 's' : ''));
            $this->getApplication()->addInput($history);
        } elseif ($input->getOption('clear')) {
            $this->clearHistory();
            $output->writeln('<info>History cleared.</info>');
        } else {
            $type = $input->getOption('no-numbers') ? 0 : ShellOutput::NUMBER_LINES;
            if (!$highlighted) {
                $type = $type | OutputInterface::OUTPUT_RAW;
            }
            $output->page($highlighted ?: $history, $type);
        }
        return 0;
    }
    private function extractRange(string $range) : array
    {
        if (\preg_match('/^\\d+$/', $range)) {
            return [$range, $range + 1];
        }
        $matches = [];
        if ($range !== '..' && \preg_match('/^(\\d*)\\.\\.(\\d*)$/', $range, $matches)) {
            $start = $matches[1] ? (int) $matches[1] : 0;
            $end = $matches[2] ? (int) $matches[2] + 1 : \PHP_INT_MAX;
            return [$start, $end];
        }
        throw new \InvalidArgumentException('Unexpected range: ' . $range);
    }
    private function getHistorySlice($show, $head, $tail) : array
    {
        $history = $this->readline->listHistory();
        \array_pop($history);
        if ($show) {
            list($start, $end) = $this->extractRange($show);
            $length = $end - $start;
        } elseif ($head) {
            if (!\preg_match('/^\\d+$/', $head)) {
                throw new \InvalidArgumentException('Please specify an integer argument for --head');
            }
            $start = 0;
            $length = (int) $head;
        } elseif ($tail) {
            if (!\preg_match('/^\\d+$/', $tail)) {
                throw new \InvalidArgumentException('Please specify an integer argument for --tail');
            }
            $start = \count($history) - $tail;
            $length = (int) $tail + 1;
        } else {
            return $history;
        }
        return \array_slice($history, $start, $length, \true);
    }
    private function validateOnlyOne(InputInterface $input, array $options)
    {
        $count = 0;
        foreach ($options as $opt) {
            if ($input->getOption($opt)) {
                $count++;
            }
        }
        if ($count > 1) {
            throw new \InvalidArgumentException('Please specify only one of --' . \implode(', --', $options));
        }
    }
    private function clearHistory()
    {
        $this->readline->clearHistory();
    }
    public static function escape(string $string) : string
    {
        return OutputFormatter::escape($string);
    }
}
<?php

namespace Cvphar\Psy\Sudo;

use Cvphar\PhpParser\Node;
use Cvphar\PhpParser\Node\Arg;
use Cvphar\PhpParser\Node\Expr\Assign;
use Cvphar\PhpParser\Node\Expr\ClassConstFetch;
use Cvphar\PhpParser\Node\Expr\MethodCall;
use Cvphar\PhpParser\Node\Expr\New_;
use Cvphar\PhpParser\Node\Expr\PropertyFetch;
use Cvphar\PhpParser\Node\Expr\StaticCall;
use Cvphar\PhpParser\Node\Expr\StaticPropertyFetch;
use Cvphar\PhpParser\Node\Identifier;
use Cvphar\PhpParser\Node\Name;
use Cvphar\PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use Cvphar\PhpParser\Node\Scalar\String_;
use Cvphar\PhpParser\NodeVisitorAbstract;
use Cvphar\Psy\Sudo;
class SudoVisitor extends NodeVisitorAbstract
{
    const PROPERTY_FETCH = 'fetchProperty';
    const PROPERTY_ASSIGN = 'assignProperty';
    const METHOD_CALL = 'callMethod';
    const STATIC_PROPERTY_FETCH = 'fetchStaticProperty';
    const STATIC_PROPERTY_ASSIGN = 'assignStaticProperty';
    const STATIC_CALL = 'callStatic';
    const CLASS_CONST_FETCH = 'fetchClassConst';
    const NEW_INSTANCE = 'newInstance';
    public function enterNode(Node $node)
    {
        if ($node instanceof PropertyFetch) {
            $name = $node->name instanceof Identifier ? $node->name->toString() : $node->name;
            $args = [$node->var, \is_string($name) ? new String_($name) : $name];
            return $this->prepareCall(self::PROPERTY_FETCH, $args);
        } elseif ($node instanceof Assign && $node->var instanceof PropertyFetch) {
            $target = $node->var;
            $name = $target->name instanceof Identifier ? $target->name->toString() : $target->name;
            $args = [$target->var, \is_string($name) ? new String_($name) : $name, $node->expr];
            return $this->prepareCall(self::PROPERTY_ASSIGN, $args);
        } elseif ($node instanceof MethodCall) {
            $name = $node->name instanceof Identifier ? $node->name->toString() : $node->name;
            $args = $node->args;
            \array_unshift($args, new Arg(\is_string($name) ? new String_($name) : $name));
            \array_unshift($args, new Arg($node->var));
            return new StaticCall(new FullyQualifiedName(Sudo::class), self::METHOD_CALL, $args);
        } elseif ($node instanceof StaticPropertyFetch) {
            $class = $node->class instanceof Name ? $node->class->toString() : $node->class;
            $name = $node->name instanceof Identifier ? $node->name->toString() : $node->name;
            $args = [\is_string($class) ? new String_($class) : $class, \is_string($name) ? new String_($name) : $name];
            return $this->prepareCall(self::STATIC_PROPERTY_FETCH, $args);
        } elseif ($node instanceof Assign && $node->var instanceof StaticPropertyFetch) {
            $target = $node->var;
            $class = $target->class instanceof Name ? $target->class->toString() : $target->class;
            $name = $target->name instanceof Identifier ? $target->name->toString() : $target->name;
            $args = [\is_string($class) ? new String_($class) : $class, \is_string($name) ? new String_($name) : $name, $node->expr];
            return $this->prepareCall(self::STATIC_PROPERTY_ASSIGN, $args);
        } elseif ($node instanceof StaticCall) {
            $args = $node->args;
            $class = $node->class instanceof Name ? $node->class->toString() : $node->class;
            $name = $node->name instanceof Identifier ? $node->name->toString() : $node->name;
            \array_unshift($args, new Arg(\is_string($name) ? new String_($name) : $name));
            \array_unshift($args, new Arg(\is_string($class) ? new String_($class) : $class));
            return new StaticCall(new FullyQualifiedName(Sudo::class), self::STATIC_CALL, $args);
        } elseif ($node instanceof ClassConstFetch) {
            $class = $node->class instanceof Name ? $node->class->toString() : $node->class;
            $name = $node->name instanceof Identifier ? $node->name->toString() : $node->name;
            $args = [\is_string($class) ? new String_($class) : $class, \is_string($name) ? new String_($name) : $name];
            return $this->prepareCall(self::CLASS_CONST_FETCH, $args);
        } elseif ($node instanceof New_) {
            $args = $node->args;
            $class = $node->class instanceof Name ? $node->class->toString() : $node->class;
            \array_unshift($args, new Arg(\is_string($class) ? new String_($class) : $class));
            return new StaticCall(new FullyQualifiedName(Sudo::class), self::NEW_INSTANCE, $args);
        }
    }
    private function prepareCall(string $method, array $args) : StaticCall
    {
        return new StaticCall(new FullyQualifiedName(Sudo::class), $method, \array_map(function ($arg) {
            return new Arg($arg);
        }, $args));
    }
}
<?php

namespace Cvphar\Psy\VarDumper;

interface PresenterAware
{
    public function setPresenter(Presenter $presenter);
}
<?php

namespace Cvphar\Psy\VarDumper;

use Cvphar\Symfony\Component\VarDumper\Caster\Caster;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
use Cvphar\Symfony\Component\VarDumper\Cloner\VarCloner;
class Cloner extends VarCloner
{
    private $filter = 0;
    public function cloneVar($var, $filter = 0) : Data
    {
        $this->filter = $filter;
        return parent::cloneVar($var, $filter);
    }
    protected function castResource(Stub $stub, $isNested) : array
    {
        return Caster::EXCLUDE_VERBOSE & $this->filter ? [] : parent::castResource($stub, $isNested);
    }
}
<?php

namespace Cvphar\Psy\VarDumper;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\VarDumper\Cloner\Cursor;
use Cvphar\Symfony\Component\VarDumper\Dumper\CliDumper;
class Dumper extends CliDumper
{
    private $formatter;
    private $forceArrayIndexes;
    protected static $onlyControlCharsRx = '/^[\\x00-\\x1F\\x7F]+$/';
    protected static $controlCharsRx = '/([\\x00-\\x1F\\x7F]+)/';
    protected static $controlCharsMap = ["\x00" => '\\0', "\t" => '\\t', "\n" => '\\n', "\v" => '\\v', "\f" => '\\f', "\r" => '\\r', "\x1b" => '\\e'];
    public function __construct(OutputFormatter $formatter, $forceArrayIndexes = \false)
    {
        $this->formatter = $formatter;
        $this->forceArrayIndexes = $forceArrayIndexes;
        parent::__construct();
        $this->setColors(\false);
    }
    public function enterHash(Cursor $cursor, $type, $class, $hasChild)
    {
        if (Cursor::HASH_INDEXED === $type || Cursor::HASH_ASSOC === $type) {
            $class = 0;
        }
        parent::enterHash($cursor, $type, $class, $hasChild);
    }
    protected function dumpKey(Cursor $cursor)
    {
        if ($this->forceArrayIndexes || Cursor::HASH_INDEXED !== $cursor->hashType) {
            parent::dumpKey($cursor);
        }
    }
    protected function style($style, $value, $attr = []) : string
    {
        if ('ref' === $style) {
            $value = \strtr($value, '@', '#');
        }
        $styled = '';
        $map = self::$controlCharsMap;
        $cchr = $this->styles['cchr'];
        $chunks = \preg_split(self::$controlCharsRx, $value, -1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE);
        foreach ($chunks as $chunk) {
            if (\preg_match(self::$onlyControlCharsRx, $chunk)) {
                $chars = '';
                $i = 0;
                do {
                    $chars .= isset($map[$chunk[$i]]) ? $map[$chunk[$i]] : \sprintf('\\x%02X', \ord($chunk[$i]));
                } while (isset($chunk[++$i]));
                $chars = $this->formatter->escape($chars);
                $styled .= "<{$cchr}>{$chars}</{$cchr}>";
            } else {
                $styled .= $this->formatter->escape($chunk);
            }
        }
        $style = $this->styles[$style];
        return "<{$style}>{$styled}</{$style}>";
    }
    protected function dumpLine($depth, $endOfValue = \false)
    {
        if ($endOfValue && 0 < $depth) {
            $this->line .= ',';
        }
        $this->line = $this->formatter->format($this->line);
        parent::dumpLine($depth, $endOfValue);
    }
}
<?php

namespace Cvphar\Psy\VarDumper;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\VarDumper\Caster\Caster;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class Presenter
{
    const VERBOSE = 1;
    private $cloner;
    private $dumper;
    private $exceptionsImportants = ["\x00*\x00message", "\x00*\x00code", "\x00*\x00file", "\x00*\x00line", "\x00Exception\x00previous"];
    private $styles = ['num' => 'number', 'integer' => 'integer', 'float' => 'float', 'const' => 'const', 'str' => 'string', 'cchr' => 'default', 'note' => 'class', 'ref' => 'default', 'public' => 'public', 'protected' => 'protected', 'private' => 'private', 'meta' => 'comment', 'key' => 'comment', 'index' => 'number'];
    public function __construct(OutputFormatter $formatter, $forceArrayIndexes = \false)
    {
        $oldLocale = \setlocale(\LC_NUMERIC, 0);
        \setlocale(\LC_NUMERIC, 'C');
        $this->dumper = new Dumper($formatter, $forceArrayIndexes);
        $this->dumper->setStyles($this->styles);
        \setlocale(\LC_NUMERIC, $oldLocale);
        $this->cloner = new Cloner();
        $this->cloner->addCasters(['*' => function ($obj, array $a, Stub $stub, $isNested, $filter = 0) {
            if ($filter || $isNested) {
                if ($obj instanceof \Throwable) {
                    $a = Caster::filter($a, Caster::EXCLUDE_NOT_IMPORTANT | Caster::EXCLUDE_EMPTY, $this->exceptionsImportants);
                } else {
                    $a = Caster::filter($a, Caster::EXCLUDE_PROTECTED | Caster::EXCLUDE_PRIVATE);
                }
            }
            return $a;
        }]);
    }
    public function addCasters(array $casters)
    {
        $this->cloner->addCasters($casters);
    }
    public function presentRef($value) : string
    {
        return $this->present($value, 0);
    }
    public function present($value, int $depth = null, int $options = 0) : string
    {
        $data = $this->cloner->cloneVar($value, !($options & self::VERBOSE) ? Caster::EXCLUDE_VERBOSE : 0);
        if (null !== $depth) {
            $data = $data->withMaxDepth($depth);
        }
        $oldLocale = \setlocale(\LC_NUMERIC, 0);
        \setlocale(\LC_NUMERIC, 'C');
        $output = '';
        $this->dumper->dump($data, function ($line, $depth) use(&$output) {
            if ($depth >= 0) {
                if ('' !== $output) {
                    $output .= \PHP_EOL;
                }
                $output .= \str_repeat('  ', $depth) . $line;
            }
        });
        \setlocale(\LC_NUMERIC, $oldLocale);
        return OutputFormatter::escape($output);
    }
}
<?php

namespace Cvphar\Psy\Exception;

class ErrorException extends \ErrorException implements Exception
{
    private $rawMessage;
    public function __construct($message = '', $code = 0, $severity = 1, $filename = null, $lineno = null, \Throwable $previous = null)
    {
        $this->rawMessage = $message;
        if (!empty($filename) && \preg_match('{Psy[/\\\\]ExecutionLoop}', $filename)) {
            $filename = '';
        }
        switch ($severity) {
            case \E_STRICT:
                $type = 'Strict error';
                break;
            case \E_NOTICE:
            case \E_USER_NOTICE:
                $type = 'Notice';
                break;
            case \E_WARNING:
            case \E_CORE_WARNING:
            case \E_COMPILE_WARNING:
            case \E_USER_WARNING:
                $type = 'Warning';
                break;
            case \E_DEPRECATED:
            case \E_USER_DEPRECATED:
                $type = 'Deprecated';
                break;
            case \E_RECOVERABLE_ERROR:
                $type = 'Recoverable fatal error';
                break;
            default:
                $type = 'Error';
                break;
        }
        $message = \sprintf('PHP %s:  %s%s on line %d', $type, $message, $filename ? ' in ' . $filename : '', $lineno);
        parent::__construct($message, $code, $severity, $filename, $lineno, $previous);
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
    public static function throwException($errno, $errstr, $errfile, $errline)
    {
        throw new self($errstr, 0, $errno, $errfile, $errline);
    }
    public static function fromError(\Error $e) : self
    {
        return new self($e->getMessage(), $e->getCode(), 1, $e->getFile(), $e->getLine(), $e);
    }
}
<?php

namespace Cvphar\Psy\Exception;

class BreakException extends \Exception implements Exception
{
    private $rawMessage;
    public function __construct($message = '', $code = 0, \Throwable $previous = null)
    {
        $this->rawMessage = $message;
        parent::__construct(\sprintf('Exit:  %s', $message), $code, $previous);
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
    public static function exitShell()
    {
        throw new self('Goodbye');
    }
}
<?php

namespace Cvphar\Psy\Exception;

class TypeErrorException extends \Exception implements Exception
{
    private $rawMessage;
    public function __construct(string $message = '', int $code = 0, \Throwable $previous = null)
    {
        $this->rawMessage = $message;
        $message = \preg_replace('/, called in .*?: eval\\(\\)\'d code/', '', $message);
        parent::__construct(\sprintf('TypeError: %s', $message), $code, $previous);
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
    public static function fromTypeError(\TypeError $e) : self
    {
        return new self($e->getMessage(), $e->getCode(), $e);
    }
}
<?php

namespace Cvphar\Psy\Exception;

class UnexpectedTargetException extends RuntimeException
{
    private $target;
    public function __construct($target, string $message = '', int $code = 0, \Throwable $previous = null)
    {
        $this->target = $target;
        parent::__construct($message, $code, $previous);
    }
    public function getTarget()
    {
        return $this->target;
    }
}
<?php

namespace Cvphar\Psy\Exception;

class RuntimeException extends \RuntimeException implements Exception
{
    private $rawMessage;
    public function __construct(string $message = '', int $code = 0, \Throwable $previous = null)
    {
        $this->rawMessage = $message;
        parent::__construct($message, $code, $previous);
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
}
<?php

namespace Cvphar\Psy\Exception;

class ThrowUpException extends \Exception implements Exception
{
    public function __construct(\Throwable $throwable)
    {
        $message = \sprintf("Throwing %s with message '%s'", \get_class($throwable), $throwable->getMessage());
        parent::__construct($message, $throwable->getCode(), $throwable);
    }
    public function getRawMessage() : string
    {
        return $this->getPrevious()->getMessage();
    }
    public static function fromThrowable($throwable) : self
    {
        if ($throwable instanceof \Error) {
            $throwable = ErrorException::fromError($throwable);
        }
        if (!$throwable instanceof \Exception) {
            throw new \InvalidArgumentException('throw-up can only throw Exceptions and Errors');
        }
        return new self($throwable);
    }
}
<?php

namespace Cvphar\Psy\Exception;

class FatalErrorException extends \ErrorException implements Exception
{
    private $rawMessage;
    public function __construct($message = '', $code = 0, $severity = 1, $filename = null, $lineno = null, \Throwable $previous = null)
    {
        if ($lineno === -1) {
            $lineno = null;
        }
        $this->rawMessage = $message;
        $message = \sprintf('PHP Fatal error:  %s in %s on line %d', $message, $filename ?: "eval()'d code", $lineno);
        parent::__construct($message, $code, $severity, $filename, $lineno, $previous);
    }
    public function getRawMessage() : string
    {
        return $this->rawMessage;
    }
}
<?php

namespace Cvphar\Psy\Exception;

class DeprecatedException extends RuntimeException
{
}
<?php

namespace Cvphar\Psy\Exception;

interface Exception
{
    public function getRawMessage();
}
<?php

namespace Cvphar\Psy\Exception;

class ParseErrorException extends \Cvphar\PhpParser\Error implements Exception
{
    public function __construct(string $message = '', int $line = -1)
    {
        $message = \sprintf('PHP Parse error: %s', $message);
        parent::__construct($message, $line);
    }
    public static function fromParseError(\Cvphar\PhpParser\Error $e) : self
    {
        return new self($e->getRawMessage(), $e->getStartLine());
    }
}
<?php

namespace Cvphar\Psy;

interface EnvInterface
{
    public function get(string $key);
}
<?php

namespace Cvphar\Psy;

class Sudo
{
    public static function fetchProperty($object, string $property)
    {
        $prop = self::getProperty(new \ReflectionObject($object), $property);
        return $prop->getValue($object);
    }
    public static function assignProperty($object, string $property, $value)
    {
        $prop = self::getProperty(new \ReflectionObject($object), $property);
        $prop->setValue($object, $value);
        return $value;
    }
    public static function callMethod($object, string $method, ...$args)
    {
        $refl = new \ReflectionObject($object);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(\true);
        return $reflMethod->invokeArgs($object, $args);
    }
    public static function fetchStaticProperty($class, string $property)
    {
        $prop = self::getProperty(new \ReflectionClass($class), $property);
        $prop->setAccessible(\true);
        return $prop->getValue();
    }
    public static function assignStaticProperty($class, string $property, $value)
    {
        $prop = self::getProperty(new \ReflectionClass($class), $property);
        $prop->setValue($value);
        return $value;
    }
    public static function callStatic($class, string $method, ...$args)
    {
        $refl = new \ReflectionClass($class);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(\true);
        return $reflMethod->invokeArgs(null, $args);
    }
    public static function fetchClassConst($class, string $const)
    {
        $refl = new \ReflectionClass($class);
        do {
            if ($refl->hasConstant($const)) {
                return $refl->getConstant($const);
            }
            $refl = $refl->getParentClass();
        } while ($refl !== \false);
        return \false;
    }
    public static function newInstance(string $class, ...$args)
    {
        $refl = new \ReflectionClass($class);
        $instance = $refl->newInstanceWithoutConstructor();
        $constructor = $refl->getConstructor();
        $constructor->setAccessible(\true);
        $constructor->invokeArgs($instance, $args);
        return $instance;
    }
    private static function getProperty(\ReflectionClass $refl, string $property) : \ReflectionProperty
    {
        $firstException = null;
        do {
            try {
                $prop = $refl->getProperty($property);
                $prop->setAccessible(\true);
                return $prop;
            } catch (\ReflectionException $e) {
                if ($firstException === null) {
                    $firstException = $e;
                }
                $refl = $refl->getParentClass();
            }
        } while ($refl !== \false);
        throw $firstException;
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionLanguageConstructParameter extends \ReflectionParameter
{
    private $function;
    private $parameter;
    private $opts;
    public function __construct($function, $parameter, array $opts)
    {
        $this->function = $function;
        $this->parameter = $parameter;
        $this->opts = $opts;
    }
    #[\ReturnTypeWillChange]
    public function getClass()
    {
        return;
    }
    public function isArray() : bool
    {
        return \array_key_exists('isArray', $this->opts) && $this->opts['isArray'];
    }
    #[\ReturnTypeWillChange]
    public function getDefaultValue()
    {
        if ($this->isDefaultValueAvailable()) {
            return $this->opts['defaultValue'];
        }
        return null;
    }
    public function getName() : string
    {
        return $this->parameter;
    }
    public function isOptional() : bool
    {
        return \array_key_exists('isOptional', $this->opts) && $this->opts['isOptional'];
    }
    public function isDefaultValueAvailable() : bool
    {
        return \array_key_exists('defaultValue', $this->opts);
    }
    public function isPassedByReference() : bool
    {
        return \array_key_exists('isPassedByReference', $this->opts) && $this->opts['isPassedByReference'];
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionLanguageConstruct extends \ReflectionFunctionAbstract
{
    public $keyword;
    private static $languageConstructs = ['isset' => ['var' => [], '...' => ['isOptional' => \true, 'defaultValue' => null]], 'unset' => ['var' => [], '...' => ['isOptional' => \true, 'defaultValue' => null]], 'empty' => ['var' => []], 'echo' => ['arg1' => [], '...' => ['isOptional' => \true, 'defaultValue' => null]], 'print' => ['arg' => []], 'die' => ['status' => ['isOptional' => \true, 'defaultValue' => 0]], 'exit' => ['status' => ['isOptional' => \true, 'defaultValue' => 0]]];
    public function __construct(string $keyword)
    {
        if (!self::isLanguageConstruct($keyword)) {
            throw new \InvalidArgumentException('Unknown language construct: ' . $keyword);
        }
        $this->keyword = $keyword;
    }
    public static function export($name)
    {
        throw new \RuntimeException('Not yet implemented because it\'s unclear what I should do here :)');
    }
    public function getName() : string
    {
        return $this->keyword;
    }
    public function returnsReference() : bool
    {
        return \false;
    }
    public function getParameters() : array
    {
        $params = [];
        foreach (self::$languageConstructs[$this->keyword] as $parameter => $opts) {
            $params[] = new ReflectionLanguageConstructParameter($this->keyword, $parameter, $opts);
        }
        return $params;
    }
    #[\ReturnTypeWillChange]
    public function getFileName()
    {
        return \false;
    }
    public function __toString() : string
    {
        return $this->getName();
    }
    public static function isLanguageConstruct(string $keyword) : bool
    {
        return \array_key_exists($keyword, self::$languageConstructs);
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionNamespace implements \Reflector
{
    private $name;
    public function __construct(string $name)
    {
        $this->name = $name;
    }
    public function getName() : string
    {
        return $this->name;
    }
    public static function export($name)
    {
        throw new \RuntimeException('Not yet implemented because it\'s unclear what I should do here :)');
    }
    public function __toString() : string
    {
        return $this->getName();
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionClassConstant implements \Reflector
{
    public $class;
    public $name;
    private $value;
    public function __construct($class, string $name)
    {
        if (!$class instanceof \ReflectionClass) {
            $class = new \ReflectionClass($class);
        }
        $this->class = $class;
        $this->name = $name;
        $constants = $class->getConstants();
        if (!\array_key_exists($name, $constants)) {
            throw new \InvalidArgumentException('Unknown constant: ' . $name);
        }
        $this->value = $constants[$name];
    }
    public static function export($class, string $name, bool $return = \false)
    {
        $refl = new self($class, $name);
        $value = $refl->getValue();
        $str = \sprintf('Constant [ public %s %s ] { %s }', \gettype($value), $refl->getName(), $value);
        if ($return) {
            return $str;
        }
        echo $str . "\n";
    }
    public function getDeclaringClass() : \ReflectionClass
    {
        $parent = $this->class;
        do {
            $class = $parent;
            $parent = $class->getParentClass();
        } while ($parent && $parent->hasConstant($this->name) && $parent->getConstant($this->name) === $this->value);
        return $class;
    }
    public function getDocComment() : bool
    {
        return \false;
    }
    public function getModifiers() : int
    {
        return \ReflectionMethod::IS_PUBLIC;
    }
    public function getName() : string
    {
        return $this->name;
    }
    public function getValue()
    {
        return $this->value;
    }
    public function isPrivate() : bool
    {
        return \false;
    }
    public function isProtected() : bool
    {
        return \false;
    }
    public function isPublic() : bool
    {
        return \true;
    }
    public function __toString() : string
    {
        return $this->getName();
    }
    public function getFileName()
    {
        return;
    }
    public function getStartLine()
    {
        throw new \RuntimeException('Not yet implemented because it\'s unclear what I should do here :)');
    }
    public function getEndLine()
    {
        return $this->getStartLine();
    }
    public static function create($class, string $name)
    {
        if (\class_exists(\ReflectionClassConstant::class)) {
            return new \ReflectionClassConstant($class, $name);
        }
        return new self($class, $name);
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionConstant extends ReflectionClassConstant
{
    public function __construct($class, $name)
    {
        @\trigger_error('ReflectionConstant is now ReflectionClassConstant', \E_USER_DEPRECATED);
        parent::__construct($class, $name);
    }
}
<?php

namespace Cvphar\Psy\Reflection;

class ReflectionConstant_ implements \Reflector
{
    public $name;
    private $value;
    private static $magicConstants = ['__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__', '__TRAIT__', '__METHOD__', '__NAMESPACE__', '__COMPILER_HALT_OFFSET__'];
    public function __construct(string $name)
    {
        $this->name = $name;
        if (!\defined($name) && !self::isMagicConstant($name)) {
            throw new \InvalidArgumentException('Unknown constant: ' . $name);
        }
        if (!self::isMagicConstant($name)) {
            $this->value = @\constant($name);
        }
    }
    public static function export(string $name, bool $return = \false)
    {
        $refl = new self($name);
        $value = $refl->getValue();
        $str = \sprintf('Constant [ %s %s ] { %s }', \gettype($value), $refl->getName(), $value);
        if ($return) {
            return $str;
        }
        echo $str . "\n";
    }
    public static function isMagicConstant($name)
    {
        return \in_array($name, self::$magicConstants);
    }
    public function getDocComment() : bool
    {
        return \false;
    }
    public function getName() : string
    {
        return $this->name;
    }
    public function getNamespaceName() : string
    {
        if (!$this->inNamespace()) {
            return '';
        }
        return \preg_replace('/\\\\[^\\\\]+$/', '', $this->name);
    }
    public function getValue()
    {
        return $this->value;
    }
    public function inNamespace() : bool
    {
        return \strpos($this->name, '\\') !== \false;
    }
    public function __toString() : string
    {
        return $this->getName();
    }
    public function getFileName()
    {
        return;
    }
    public function getStartLine()
    {
        throw new \RuntimeException('Not yet implemented because it\'s unclear what I should do here :)');
    }
    public function getEndLine()
    {
        return $this->getStartLine();
    }
}
<?php

namespace Cvphar\Psy\ExecutionLoop;

use Cvphar\Psy\Exception\ParseErrorException;
use Cvphar\Psy\ParserFactory;
use Cvphar\Psy\Shell;
class RunkitReloader extends AbstractListener
{
    private $parser;
    private $timestamps = [];
    public static function isSupported() : bool
    {
        return \extension_loaded('runkit') || \extension_loaded('runkit7') && \function_exists('Cvphar\\runkit_import');
    }
    public function __construct()
    {
        $parserFactory = new ParserFactory();
        $this->parser = $parserFactory->createParser();
    }
    public function onInput(Shell $shell, string $input)
    {
        $this->reload($shell);
    }
    private function reload(Shell $shell)
    {
        \clearstatcache();
        $modified = [];
        foreach (\get_included_files() as $file) {
            $timestamp = \filemtime($file);
            if (!isset($this->timestamps[$file])) {
                $this->timestamps[$file] = $timestamp;
                continue;
            }
            if ($this->timestamps[$file] === $timestamp) {
                continue;
            }
            if (!$this->lintFile($file)) {
                $msg = \sprintf('Modified file "%s" could not be reloaded', $file);
                $shell->writeException(new ParseErrorException($msg));
                continue;
            }
            $modified[] = $file;
            $this->timestamps[$file] = $timestamp;
        }
        foreach ($modified as $file) {
            $flags = RUNKIT_IMPORT_FUNCTIONS | RUNKIT_IMPORT_CLASSES | RUNKIT_IMPORT_CLASS_METHODS | RUNKIT_IMPORT_CLASS_CONSTS | RUNKIT_IMPORT_CLASS_PROPS | RUNKIT_IMPORT_OVERRIDE;
            if (\extension_loaded('runkit7')) {
                $flags &= ~RUNKIT_IMPORT_CLASS_PROPS & ~RUNKIT_IMPORT_CLASS_STATIC_PROPS;
                runkit7_import($file, $flags);
            } else {
                runkit_import($file, $flags);
            }
        }
    }
    private function lintFile(string $file) : bool
    {
        try {
            $this->parser->parse(\file_get_contents($file));
        } catch (\Throwable $e) {
            return \false;
        }
        return \true;
    }
}
<?php

namespace Cvphar\Psy\ExecutionLoop;

use Cvphar\Psy\Shell;
abstract class AbstractListener implements Listener
{
    public function beforeRun(Shell $shell)
    {
    }
    public function beforeLoop(Shell $shell)
    {
    }
    public function onInput(Shell $shell, string $input)
    {
    }
    public function onExecute(Shell $shell, string $code)
    {
    }
    public function afterLoop(Shell $shell)
    {
    }
    public function afterRun(Shell $shell)
    {
    }
}
<?php

namespace Cvphar\Psy\ExecutionLoop;

use Cvphar\Psy\Shell;
interface Listener
{
    public static function isSupported() : bool;
    public function beforeRun(Shell $shell);
    public function beforeLoop(Shell $shell);
    public function onInput(Shell $shell, string $input);
    public function onExecute(Shell $shell, string $code);
    public function afterLoop(Shell $shell);
    public function afterRun(Shell $shell);
}
<?php

namespace Cvphar\Psy\ExecutionLoop;

use Cvphar\Psy\Context;
use Cvphar\Psy\Exception\BreakException;
use Cvphar\Psy\Shell;
class ProcessForker extends AbstractListener
{
    private $savegame;
    private $up;
    private static $pcntlFunctions = ['pcntl_fork', 'pcntl_signal_dispatch', 'pcntl_signal', 'pcntl_waitpid', 'pcntl_wexitstatus'];
    private static $posixFunctions = ['posix_getpid', 'posix_kill'];
    public static function isSupported() : bool
    {
        return self::isPcntlSupported() && !self::disabledPcntlFunctions() && self::isPosixSupported() && !self::disabledPosixFunctions();
    }
    public static function isPcntlSupported() : bool
    {
        foreach (self::$pcntlFunctions as $func) {
            if (!\function_exists($func)) {
                return \false;
            }
        }
        return \true;
    }
    public static function disabledPcntlFunctions()
    {
        return self::checkDisabledFunctions(self::$pcntlFunctions);
    }
    public static function isPosixSupported() : bool
    {
        foreach (self::$posixFunctions as $func) {
            if (!\function_exists($func)) {
                return \false;
            }
        }
        return \true;
    }
    public static function disabledPosixFunctions()
    {
        return self::checkDisabledFunctions(self::$posixFunctions);
    }
    private static function checkDisabledFunctions(array $functions) : array
    {
        return \array_values(\array_intersect($functions, \array_map('strtolower', \array_map('trim', \explode(',', \ini_get('disable_functions'))))));
    }
    public function beforeRun(Shell $shell)
    {
        list($up, $down) = \stream_socket_pair(\STREAM_PF_UNIX, \STREAM_SOCK_STREAM, \STREAM_IPPROTO_IP);
        if (!$up) {
            throw new \RuntimeException('Unable to create socket pair');
        }
        $pid = \pcntl_fork();
        if ($pid < 0) {
            throw new \RuntimeException('Unable to start execution loop');
        } elseif ($pid > 0) {
            \fclose($up);
            $read = [$down];
            $write = null;
            $except = null;
            do {
                $n = @\stream_select($read, $write, $except, null);
                if ($n === 0) {
                    throw new \RuntimeException('Process timed out waiting for execution loop');
                }
                if ($n === \false) {
                    $err = \error_get_last();
                    if (!isset($err['message']) || \stripos($err['message'], 'interrupted system call') === \false) {
                        $msg = $err['message'] ? \sprintf('Error waiting for execution loop: %s', $err['message']) : 'Error waiting for execution loop';
                        throw new \RuntimeException($msg);
                    }
                }
            } while ($n < 1);
            $content = \stream_get_contents($down);
            \fclose($down);
            if ($content) {
                $shell->setScopeVariables(@\unserialize($content));
            }
            throw new BreakException('Exiting main thread');
        }
        if (!@\cli_set_process_title('psysh (loop)')) {
            if (\function_exists('Cvphar\\setproctitle')) {
                @\Cvphar\setproctitle('psysh (loop)');
            }
        }
        \fclose($down);
        $this->up = $up;
    }
    public function beforeLoop(Shell $shell)
    {
        $this->createSavegame();
    }
    public function afterLoop(Shell $shell)
    {
        if (isset($this->savegame)) {
            \posix_kill($this->savegame, \SIGKILL);
            \pcntl_signal_dispatch();
        }
    }
    public function afterRun(Shell $shell)
    {
        if (isset($this->up)) {
            \fwrite($this->up, $this->serializeReturn($shell->getScopeVariables(\false)));
            \fclose($this->up);
            \posix_kill(\posix_getpid(), \SIGKILL);
        }
    }
    private function createSavegame()
    {
        $this->savegame = \posix_getpid();
        $pid = \pcntl_fork();
        if ($pid < 0) {
            throw new \RuntimeException('Unable to create savegame fork');
        } elseif ($pid > 0) {
            \pcntl_waitpid($pid, $status);
            if (!\pcntl_wexitstatus($status)) {
                \posix_kill(\posix_getpid(), \SIGKILL);
            }
            $this->createSavegame();
        }
    }
    private function serializeReturn(array $return) : string
    {
        $serializable = [];
        foreach ($return as $key => $value) {
            if (Context::isSpecialVariableName($key)) {
                continue;
            }
            if (\is_resource($value) || $value instanceof \Closure) {
                continue;
            }
            if (\version_compare(\PHP_VERSION, '8.1', '>=') && $value instanceof \UnitEnum) {
                $ref = new \ReflectionObject($value);
                if (\strpos($ref->getFileName(), ": eval()'d code") !== \false) {
                    continue;
                }
            }
            try {
                @\serialize($value);
                $serializable[$key] = $value;
            } catch (\Throwable $e) {
            }
        }
        return @\serialize($serializable);
    }
}
<?php

namespace Cvphar\Psy;

class SystemEnv implements EnvInterface
{
    public function get(string $key)
    {
        if (isset($_SERVER[$key]) && $_SERVER[$key]) {
            return $_SERVER[$key];
        }
        $result = \getenv($key);
        return $result === \false ? null : $result;
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

use Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
use Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface;
use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\ArrayInput;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputOption;
class CompletionHandler
{
    protected $application;
    protected $command;
    protected $context;
    protected $helpers = array();
    private $commandWordIndex;
    public function __construct(Application $application, CompletionContext $context = null)
    {
        $this->application = $application;
        $this->context = $context;
        $this->addHandler(new Completion('help', 'command_name', Completion::TYPE_ARGUMENT, $this->getCommandNames()));
        $this->addHandler(new Completion('list', 'namespace', Completion::TYPE_ARGUMENT, $application->getNamespaces()));
    }
    public function setContext(CompletionContext $context)
    {
        $this->context = $context;
    }
    public function getContext()
    {
        return $this->context;
    }
    public function addHandlers(array $array)
    {
        $this->helpers = \array_merge($this->helpers, $array);
    }
    public function addHandler(CompletionInterface $helper)
    {
        $this->helpers[] = $helper;
    }
    public function runCompletion()
    {
        if (!$this->context) {
            throw new \RuntimeException('A CompletionContext must be set before requesting completion.');
        }
        $this->command = $this->detectCommand();
        $process = array('completeForOptionValues', 'completeForOptionShortcuts', 'completeForOptionShortcutValues', 'completeForOptions', 'completeForCommandName', 'completeForCommandArguments');
        foreach ($process as $methodName) {
            $result = $this->{$methodName}();
            if (\false !== $result) {
                return $this->filterResults((array) $result);
            }
        }
        return array();
    }
    public function getInput()
    {
        $words = $this->context->getWords();
        \array_shift($words);
        $words = \array_filter($words);
        return new ArrayInput($words);
    }
    protected function completeForOptions()
    {
        $word = $this->context->getCurrentWord();
        if (\substr($word, 0, 2) === '--') {
            $options = array();
            foreach ($this->getAllOptions() as $opt) {
                $options[] = '--' . $opt->getName();
            }
            return $options;
        }
        return \false;
    }
    protected function completeForOptionShortcuts()
    {
        $word = $this->context->getCurrentWord();
        if (\strpos($word, '-') === 0 && \strlen($word) == 2) {
            $definition = $this->command ? $this->command->getNativeDefinition() : $this->application->getDefinition();
            if ($definition->hasShortcut(\substr($word, 1))) {
                return array($word);
            }
        }
        return \false;
    }
    protected function completeForOptionShortcutValues()
    {
        $wordIndex = $this->context->getWordIndex();
        if ($this->command && $wordIndex > 1) {
            $left = $this->context->getWordAtIndex($wordIndex - 1);
            if ($left[0] == '-' && \strlen($left) == 2) {
                $shortcut = \substr($left, 1);
                $def = $this->command->getNativeDefinition();
                if (!$def->hasShortcut($shortcut)) {
                    return \false;
                }
                $opt = $def->getOptionForShortcut($shortcut);
                if ($opt->isValueRequired() || $opt->isValueOptional()) {
                    return $this->completeOption($opt);
                }
            }
        }
        return \false;
    }
    protected function completeForOptionValues()
    {
        $wordIndex = $this->context->getWordIndex();
        if ($this->command && $wordIndex > 1) {
            $left = $this->context->getWordAtIndex($wordIndex - 1);
            if (\strpos($left, '--') === 0) {
                $name = \substr($left, 2);
                $def = $this->command->getNativeDefinition();
                if (!$def->hasOption($name)) {
                    return \false;
                }
                $opt = $def->getOption($name);
                if ($opt->isValueRequired() || $opt->isValueOptional()) {
                    return $this->completeOption($opt);
                }
            }
        }
        return \false;
    }
    protected function completeForCommandName()
    {
        if (!$this->command || $this->context->getWordIndex() == $this->commandWordIndex) {
            return $this->getCommandNames();
        }
        return \false;
    }
    protected function completeForCommandArguments()
    {
        if (!$this->command || \strpos($this->context->getCurrentWord(), '-') === 0) {
            return \false;
        }
        $definition = $this->command->getNativeDefinition();
        $argWords = $this->mapArgumentsToWords($definition->getArguments());
        $wordIndex = $this->context->getWordIndex();
        if (isset($argWords[$wordIndex])) {
            $name = $argWords[$wordIndex];
        } elseif (!empty($argWords) && $definition->getArgument(\end($argWords))->isArray()) {
            $name = \end($argWords);
        } else {
            return \false;
        }
        if ($helper = $this->getCompletionHelper($name, Completion::TYPE_ARGUMENT)) {
            return $helper->run();
        }
        if ($this->command instanceof CompletionAwareInterface) {
            return $this->command->completeArgumentValues($name, $this->context);
        }
        return \false;
    }
    protected function getCompletionHelper($name, $type)
    {
        foreach ($this->helpers as $helper) {
            if ($helper->getType() != $type && $helper->getType() != CompletionInterface::ALL_TYPES) {
                continue;
            }
            if ($helper->getCommandName() == CompletionInterface::ALL_COMMANDS || $helper->getCommandName() == $this->command->getName()) {
                if ($helper->getTargetName() == $name) {
                    return $helper;
                }
            }
        }
        return null;
    }
    protected function completeOption(InputOption $option)
    {
        if ($helper = $this->getCompletionHelper($option->getName(), Completion::TYPE_OPTION)) {
            return $helper->run();
        }
        if ($this->command instanceof CompletionAwareInterface) {
            return $this->command->completeOptionValues($option->getName(), $this->context);
        }
        return \false;
    }
    protected function mapArgumentsToWords($argumentDefinitions)
    {
        $argumentPositions = array();
        $argumentNumber = 0;
        $previousWord = null;
        $argumentNames = \array_keys($argumentDefinitions);
        $optionsWithArgs = $this->getOptionWordsWithValues();
        foreach ($this->context->getWords() as $wordIndex => $word) {
            if ($wordIndex == 0 || $wordIndex === $this->commandWordIndex || $word && '-' === $word[0] || \in_array($previousWord, $optionsWithArgs)) {
                $previousWord = $word;
                continue;
            } else {
                $previousWord = $word;
            }
            if (isset($argumentNames[$argumentNumber])) {
                $argumentPositions[$wordIndex] = $argumentNames[$argumentNumber];
            }
            $argumentNumber++;
        }
        return $argumentPositions;
    }
    protected function getOptionWordsWithValues()
    {
        $strings = array();
        foreach ($this->getAllOptions() as $option) {
            if ($option->isValueRequired()) {
                $strings[] = '--' . $option->getName();
                if ($option->getShortcut()) {
                    $strings[] = '-' . $option->getShortcut();
                }
            }
        }
        return $strings;
    }
    protected function filterResults(array $array)
    {
        $curWord = $this->context->getCurrentWord();
        return \array_filter($array, function ($val) use($curWord) {
            return \fnmatch($curWord . '*', $val);
        });
    }
    protected function getAllOptions()
    {
        if (!$this->command) {
            return $this->application->getDefinition()->getOptions();
        }
        return \array_merge($this->command->getNativeDefinition()->getOptions(), $this->application->getDefinition()->getOptions());
    }
    protected function getCommandNames()
    {
        if (\method_exists('Cvphar\\Symfony\\Component\\Console\\Command\\Command', 'isHidden')) {
            $commands = array();
            foreach ($this->application->all() as $name => $command) {
                if (!$command->isHidden()) {
                    $commands[] = $name;
                }
            }
            return $commands;
        } else {
            $commands = $this->application->all();
            unset($commands['_completion']);
            return \array_keys($commands);
        }
    }
    private function detectCommand()
    {
        $skipNext = \true;
        foreach ($this->context->getWords() as $index => $word) {
            if ($skipNext) {
                $skipNext = \false;
                continue;
            }
            if (\strlen($word) == 0 || $word[0] === '-') {
                continue;
            }
            try {
                $cmd = $this->application->find($word);
                $this->commandWordIndex = $index;
                return $cmd;
            } catch (\InvalidArgumentException $e) {
            }
        }
        return null;
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion;

use Cvphar\Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
interface CompletionAwareInterface
{
    public function completeOptionValues($optionName, CompletionContext $context);
    public function completeArgumentValues($argumentName, CompletionContext $context);
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion;

class ShellPathCompletion implements CompletionInterface
{
    const PATH_COMPLETION_EXIT_CODE = 200;
    protected $type;
    protected $commandName;
    protected $targetName;
    public function __construct($commandName, $targetName, $type)
    {
        $this->commandName = $commandName;
        $this->targetName = $targetName;
        $this->type = $type;
    }
    public function getType()
    {
        return $this->type;
    }
    public function getCommandName()
    {
        return $this->commandName;
    }
    public function getTargetName()
    {
        return $this->targetName;
    }
    public function run()
    {
        exit(self::PATH_COMPLETION_EXIT_CODE);
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion;

interface CompletionInterface
{
    const ALL_COMMANDS = null;
    const ALL_TYPES = null;
    const TYPE_OPTION = 'option';
    const TYPE_ARGUMENT = 'argument';
    public function getType();
    public function getCommandName();
    public function getTargetName();
    public function run();
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

class EnvironmentCompletionContext extends CompletionContext
{
    public function __construct()
    {
        $this->commandLine = \getenv('CMDLINE_CONTENTS');
        $this->charIndex = \intval(\getenv('CMDLINE_CURSOR_INDEX'));
        if ($this->commandLine === \false) {
            $message = 'Failed to configure from environment; Environment var CMDLINE_CONTENTS not set.';
            if (\getenv('COMP_LINE')) {
                $message .= "\n\nYou appear to be attempting completion using an out-dated hook. If you've just updated," . " you probably need to reinitialise the completion shell hook by reloading your shell" . " profile or starting a new shell session. If you are using a hard-coded (rather than generated)" . " hook, you will need to update that function with the new environment variable names." . "\n\nSee here for details: https://github.com/stecman/symfony-console-completion/issues/31";
            }
            throw new \RuntimeException($message);
        }
    }
    public function useWordBreaksFromEnvironment()
    {
        $breaks = \getenv('CMDLINE_WORDBREAKS');
        if (!$breaks) {
            throw new \RuntimeException('Failed to read word breaks from environment; Environment var CMDLINE_WORDBREAKS not set');
        }
        $this->wordBreaks = $breaks;
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

class CompletionContext
{
    protected $commandLine;
    protected $charIndex = 0;
    protected $words = null;
    protected $rawWords = null;
    protected $wordIndex = null;
    protected $wordBreaks = "= \t\n";
    public function setCommandLine($commandLine)
    {
        $this->commandLine = $commandLine;
        $this->reset();
    }
    public function getCommandLine()
    {
        return $this->commandLine;
    }
    public function getCurrentWord()
    {
        if (isset($this->words[$this->wordIndex])) {
            return $this->words[$this->wordIndex];
        }
        return '';
    }
    public function getRawCurrentWord()
    {
        if (isset($this->rawWords[$this->wordIndex])) {
            return $this->rawWords[$this->wordIndex];
        }
        return '';
    }
    public function getWordAtIndex($index)
    {
        if (isset($this->words[$index])) {
            return $this->words[$index];
        }
        return '';
    }
    public function getWords()
    {
        if ($this->words === null) {
            $this->splitCommand();
        }
        return $this->words;
    }
    public function getRawWords()
    {
        if ($this->rawWords === null) {
            $this->splitCommand();
        }
        return $this->rawWords;
    }
    public function getWordIndex()
    {
        if ($this->wordIndex === null) {
            $this->splitCommand();
        }
        return $this->wordIndex;
    }
    public function getCharIndex()
    {
        return $this->charIndex;
    }
    public function setCharIndex($index)
    {
        $this->charIndex = $index;
        $this->reset();
    }
    public function setWordBreaks($charList)
    {
        $this->wordBreaks = \str_replace(array('"', '\''), '', $charList);
        $this->reset();
    }
    protected function splitCommand()
    {
        $tokens = $this->tokenizeString($this->commandLine);
        foreach ($tokens as $token) {
            if ($token['type'] != 'break') {
                $this->words[] = $this->getTokenValue($token);
                $this->rawWords[] = $token['value'];
            }
            if ($this->wordIndex === null && $this->charIndex <= $token['offsetEnd']) {
                $this->wordIndex = \count($this->words) - 1;
                if ($token['type'] == 'break') {
                    $this->wordIndex++;
                    $this->words[] = '';
                    $this->rawWords[] = '';
                    continue;
                }
                if ($this->charIndex < $token['offsetEnd']) {
                    $truncatedToken = $token;
                    $relativeOffset = $this->charIndex - $token['offset'];
                    $truncatedToken['value'] = \substr($token['value'], 0, $relativeOffset);
                    $this->words[$this->wordIndex] = $this->getTokenValue($truncatedToken);
                    $this->rawWords[$this->wordIndex] = $truncatedToken['value'];
                }
            }
        }
        if ($this->wordIndex === null) {
            $this->wordIndex = \count($this->words);
            $this->words[] = '';
            $this->rawWords[] = '';
        }
    }
    protected function getTokenValue($token)
    {
        $value = $token['value'];
        if ($token['type'] == 'quoted') {
            $value = \preg_replace('/^(?:[\'"])(.*?)(?:[\'"])?$/', '$1', $value);
        }
        $value = \preg_replace('/\\\\(.)/', '$1', $value);
        return $value;
    }
    protected function tokenizeString($string)
    {
        $typeMap = array('double_quote_string' => 'quoted', 'single_quote_string' => 'quoted', 'word' => 'word', 'break' => 'break');
        $breaks = \preg_replace('/(.)/', '\\\\$1', $this->wordBreaks);
        $pattern = <<<REGEX
            /(?:
                (?P<double_quote_string>
                    "(\\\\.|[^\\"\\\\])*(?:"|\$)
                ) |
                (?P<single_quote_string>
                    '(\\\\.|[^'\\\\])*(?:'|\$)
                ) |
                (?P<word>
                    (?:\\\\.|[^{$breaks}])+
                ) |
                (?P<break>
                     [{$breaks}]+
                )
            )/x
REGEX;
        $tokens = array();
        if (!\preg_match_all($pattern, $string, $matches, \PREG_OFFSET_CAPTURE | \PREG_SET_ORDER)) {
            return $tokens;
        }
        foreach ($matches as $set) {
            foreach ($set as $groupName => $match) {
                if (\is_integer($groupName)) {
                    continue;
                }
                if ($match[1] === -1) {
                    continue;
                }
                $tokens[] = array('type' => $typeMap[$groupName], 'value' => $match[0], 'offset' => $match[1], 'offsetEnd' => $match[1] + \strlen($match[0]));
                continue;
            }
        }
        return $tokens;
    }
    protected function reset()
    {
        $this->words = null;
        $this->wordIndex = null;
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

use Cvphar\Symfony\Component\Console\Command\Command as SymfonyCommand;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class CompletionCommand extends SymfonyCommand
{
    protected $handler;
    protected function configure()
    {
        $this->setName('_completion')->setDefinition($this->createDefinition())->setDescription('BASH completion hook.')->setHelp(<<<END
To enable BASH completion, run:

    <comment>eval `[program] _completion -g`</comment>.

Or for an alias:

    <comment>eval `[program] _completion -g -p [alias]`</comment>.

END
);
        if (\method_exists($this, 'setHidden')) {
            $this->setHidden(\true);
        }
    }
    public function getNativeDefinition()
    {
        return $this->createDefinition();
    }
    public function mergeApplicationDefinition($mergeArgs = \true)
    {
        $appDefinition = $this->getApplication()->getDefinition();
        $originalOptions = $appDefinition->getOptions();
        $appDefinition->setOptions($this->filterApplicationOptions($originalOptions));
        parent::mergeApplicationDefinition($mergeArgs);
        $appDefinition->setOptions($originalOptions);
    }
    protected function filterApplicationOptions(array $appOptions)
    {
        return \array_filter($appOptions, function (InputOption $option) {
            static $coreOptions = array('help' => \true, 'quiet' => \true, 'verbose' => \true, 'version' => \true, 'ansi' => \true, 'no-ansi' => \true, 'no-interaction' => \true);
            return isset($coreOptions[$option->getName()]);
        });
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->handler = new CompletionHandler($this->getApplication());
        $handler = $this->handler;
        if ($input->getOption('generate-hook')) {
            global $argv;
            $program = $argv[0];
            $factory = new HookFactory();
            $alias = $input->getOption('program');
            $multiple = (bool) $input->getOption('multiple');
            if (!$alias) {
                $alias = \basename($program);
            }
            $hook = $factory->generateHook($input->getOption('shell-type') ?: $this->getShellType(), $program, $alias, $multiple);
            $output->write($hook, \true);
        } else {
            $handler->setContext(new EnvironmentCompletionContext());
            $results = $this->runCompletion();
            $shellType = $input->getOption('shell-type') ?: $this->getShellType();
            foreach ($results as &$result) {
                $result = $this->escapeForShell($result, $shellType);
            }
            $output->write($results, \true);
        }
        return 0;
    }
    protected function escapeForShell($result, $shellType)
    {
        switch ($shellType) {
            case 'bash':
                $context = $this->handler->getContext();
                $wordStart = \substr($context->getRawCurrentWord(), 0, 1);
                if ($wordStart == "'") {
                    $result = \str_replace("'", "\\'", $result);
                } else {
                    if ($wordStart == '"') {
                        $result = \str_replace('"', '\\"', $result);
                    } else {
                        $result = \preg_replace('/([\\s\'"\\\\])/', '\\\\$1', $result);
                    }
                }
                return \escapeshellarg($result);
            default:
                return $result;
        }
    }
    protected function runCompletion()
    {
        $this->configureCompletion($this->handler);
        return $this->handler->runCompletion();
    }
    protected function configureCompletion(CompletionHandler $handler)
    {
    }
    protected function getShellType()
    {
        if (!\getenv('SHELL')) {
            throw new \RuntimeException('Could not read SHELL environment variable. Please specify your shell type using the --shell-type option.');
        }
        return \basename(\getenv('SHELL'));
    }
    protected function createDefinition()
    {
        return new InputDefinition(array(new InputOption('generate-hook', 'g', InputOption::VALUE_NONE, 'Generate BASH code that sets up completion for this application.'), new InputOption('program', 'p', InputOption::VALUE_REQUIRED, "Program name that should trigger completion\n<comment>(defaults to the absolute application path)</comment>."), new InputOption('multiple', 'm', InputOption::VALUE_NONE, "Generated hook can be used for multiple applications."), new InputOption('shell-type', null, InputOption::VALUE_OPTIONAL, 'Set the shell type (zsh or bash). Otherwise this is determined automatically.')));
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

final class HookFactory
{
    protected static $hooks = array('bash' => <<<'END'
# BASH completion for %%program_path%%
function %%function_name%% {

    # Copy BASH's completion variables to the ones the completion command expects
    # These line up exactly as the library was originally designed for BASH
    local CMDLINE_CONTENTS="$COMP_LINE";
    local CMDLINE_CURSOR_INDEX="$COMP_POINT";
    local CMDLINE_WORDBREAKS="$COMP_WORDBREAKS";

    export CMDLINE_CONTENTS CMDLINE_CURSOR_INDEX CMDLINE_WORDBREAKS;

    local RESULT STATUS;

    # Force splitting by newline instead of default delimiters
    local IFS=$'\n';

    RESULT="$(%%completion_command%% </dev/null)";
    STATUS=$?;

    local cur mail_check_backup;

    mail_check_backup=$MAILCHECK;
    MAILCHECK=-1;

    _get_comp_words_by_ref -n : cur;

    # Check if shell provided path completion is requested
    # @see Completion\ShellPathCompletion
    if [ $STATUS -eq 200 ]; then
        # Turn file/dir completion on temporarily and give control back to BASH
        compopt -o default;
        return 0;

    # Bail out if PHP didn't exit cleanly
    elif [ $STATUS -ne 0 ]; then
        echo -e "$RESULT";
        return $?;
    fi;

    COMPREPLY=(`compgen -W "$RESULT" -- $cur`);

    __ltrim_colon_completions "$cur";

    MAILCHECK=mail_check_backup;
};

if [ "$(type -t _get_comp_words_by_ref)" == "function" ]; then
    complete -F %%function_name%% "%%program_name%%";
else
    >&2 echo "Completion was not registered for %%program_name%%:";
    >&2 echo "The 'bash-completion' package is required but doesn't appear to be installed.";
fi;
END
, 'zsh' => <<<'END'
# ZSH completion for %%program_path%%
function %%function_name%% {
    local -x CMDLINE_CONTENTS="$words";
    local -x CMDLINE_CURSOR_INDEX;
    (( CMDLINE_CURSOR_INDEX = ${#${(j. .)words[1,CURRENT]}} ));

    local RESULT STATUS;
    RESULT=("${(@f)$( %%completion_command%% )}");
    STATUS=$?;

    # Check if shell provided path completion is requested
    # @see Completion\ShellPathCompletion
    if [ $STATUS -eq 200 ]; then
        _path_files;
        return 0;

    # Bail out if PHP didn't exit cleanly
    elif [ $STATUS -ne 0 ]; then
        echo -e "$RESULT";
        return $?;
    fi;

    compadd -- $RESULT;
};

compdef %%function_name%% "%%program_name%%";
END
);
    public static function getShellTypes()
    {
        return \array_keys(self::$hooks);
    }
    public function generateHook($type, $programPath, $programName = null, $multiple = \false)
    {
        if (!isset(self::$hooks[$type])) {
            throw new \RuntimeException(\sprintf("Cannot generate hook for unknown shell type '%s'. Available hooks are: %s", $type, \implode(', ', self::getShellTypes())));
        }
        $programName = $programName ?: $programPath;
        if ($multiple) {
            $completionCommand = '$1 _completion';
        } else {
            $completionCommand = $programPath . ' _completion';
        }
        $completionCommand .= " --shell-type {$type}";
        return \str_replace(array('%%function_name%%', '%%program_name%%', '%%program_path%%', '%%completion_command%%'), array($this->generateFunctionName($programPath, $programName), $programName, $programPath, $completionCommand), $this->stripComments(self::$hooks[$type]));
    }
    protected function generateFunctionName($programPath, $programName)
    {
        return \sprintf('_%s_%s_complete', $this->sanitiseForFunctionName(\basename($programName)), \substr(\md5($programPath), 0, 16));
    }
    protected function sanitiseForFunctionName($name)
    {
        $name = \str_replace('-', '_', $name);
        return \preg_replace('/[^A-Za-z0-9_]+/', '', $name);
    }
    protected function stripComments($script)
    {
        return \preg_replace('/(^\\s*\\#.*$)/m', '', $script);
    }
}
<?php

namespace Cvphar\Stecman\Component\Symfony\Console\BashCompletion;

use Cvphar\Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface;
class Completion implements CompletionInterface
{
    protected $type;
    protected $commandName;
    protected $targetName;
    protected $completion;
    public static function makeGlobalHandler($targetName, $type, $completion)
    {
        return new Completion(CompletionInterface::ALL_COMMANDS, $targetName, $type, $completion);
    }
    public function __construct($commandName, $targetName, $type, $completion)
    {
        $this->commandName = $commandName;
        $this->targetName = $targetName;
        $this->type = $type;
        $this->completion = $completion;
    }
    public function run()
    {
        if ($this->isCallable()) {
            return \call_user_func($this->completion);
        }
        return $this->completion;
    }
    public function getType()
    {
        return $this->type;
    }
    public function setType($type)
    {
        $this->type = $type;
    }
    public function getCommandName()
    {
        return $this->commandName;
    }
    public function setCommandName($commandName)
    {
        $this->commandName = $commandName;
    }
    public function getTargetName()
    {
        return $this->targetName;
    }
    public function setTargetName($targetName)
    {
        $this->targetName = $targetName;
    }
    public function getCompletion()
    {
        return $this->completion;
    }
    public function setCompletion($completion)
    {
        $this->completion = $completion;
    }
    public function isCallable()
    {
        return \is_callable($this->completion);
    }
}
<?php

namespace Cvphar\Psr\Container;

interface NotFoundExceptionInterface extends ContainerExceptionInterface
{
}
<?php

namespace Cvphar\Psr\Container;

interface ContainerInterface
{
    public function get($id);
    public function has($id);
}
<?php

namespace Cvphar\Psr\Container;

interface ContainerExceptionInterface
{
}
<?php

namespace Cvphar\Psr\Log;

interface LoggerAwareInterface
{
    public function setLogger(LoggerInterface $logger);
}
<?php

namespace Cvphar\Psr\Log;

class LogLevel
{
    const EMERGENCY = 'emergency';
    const ALERT = 'alert';
    const CRITICAL = 'critical';
    const ERROR = 'error';
    const WARNING = 'warning';
    const NOTICE = 'notice';
    const INFO = 'info';
    const DEBUG = 'debug';
}
<?php

namespace Cvphar\Psr\Log;

trait LoggerAwareTrait
{
    protected $logger;
    public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }
}
<?php

namespace Cvphar\Psr\Log;

class InvalidArgumentException extends \InvalidArgumentException
{
}
<?php

namespace Cvphar\Psr\Log;

class NullLogger extends AbstractLogger
{
    public function log($level, $message, array $context = array())
    {
    }
}
<?php

namespace Cvphar\Psr\Log;

interface LoggerInterface
{
    public function emergency($message, array $context = array());
    public function alert($message, array $context = array());
    public function critical($message, array $context = array());
    public function error($message, array $context = array());
    public function warning($message, array $context = array());
    public function notice($message, array $context = array());
    public function info($message, array $context = array());
    public function debug($message, array $context = array());
    public function log($level, $message, array $context = array());
}
<?php

namespace Cvphar\Psr\Log;

trait LoggerTrait
{
    public function emergency($message, array $context = array())
    {
        $this->log(LogLevel::EMERGENCY, $message, $context);
    }
    public function alert($message, array $context = array())
    {
        $this->log(LogLevel::ALERT, $message, $context);
    }
    public function critical($message, array $context = array())
    {
        $this->log(LogLevel::CRITICAL, $message, $context);
    }
    public function error($message, array $context = array())
    {
        $this->log(LogLevel::ERROR, $message, $context);
    }
    public function warning($message, array $context = array())
    {
        $this->log(LogLevel::WARNING, $message, $context);
    }
    public function notice($message, array $context = array())
    {
        $this->log(LogLevel::NOTICE, $message, $context);
    }
    public function info($message, array $context = array())
    {
        $this->log(LogLevel::INFO, $message, $context);
    }
    public function debug($message, array $context = array())
    {
        $this->log(LogLevel::DEBUG, $message, $context);
    }
    public abstract function log($level, $message, array $context = array());
}
<?php

namespace Cvphar\Psr\Log;

abstract class AbstractLogger implements LoggerInterface
{
    public function emergency($message, array $context = array())
    {
        $this->log(LogLevel::EMERGENCY, $message, $context);
    }
    public function alert($message, array $context = array())
    {
        $this->log(LogLevel::ALERT, $message, $context);
    }
    public function critical($message, array $context = array())
    {
        $this->log(LogLevel::CRITICAL, $message, $context);
    }
    public function error($message, array $context = array())
    {
        $this->log(LogLevel::ERROR, $message, $context);
    }
    public function warning($message, array $context = array())
    {
        $this->log(LogLevel::WARNING, $message, $context);
    }
    public function notice($message, array $context = array())
    {
        $this->log(LogLevel::NOTICE, $message, $context);
    }
    public function info($message, array $context = array())
    {
        $this->log(LogLevel::INFO, $message, $context);
    }
    public function debug($message, array $context = array())
    {
        $this->log(LogLevel::DEBUG, $message, $context);
    }
}
<?php

namespace Cvphar\Symfony\Polyfill\Php73;

final class Php73
{
    public static $startAt = 1533462603;
    public static function hrtime($asNum = \false)
    {
        $ns = \microtime(\false);
        $s = \substr($ns, 11) - self::$startAt;
        $ns = 1000000000.0 * (float) $ns;
        if ($asNum) {
            $ns += $s * 1000000000.0;
            return \PHP_INT_SIZE === 4 ? $ns : (int) $ns;
        }
        return [$s, (int) $ns];
    }
}
<?php

namespace Cvphar;

class JsonException extends \Exception
{
}
\class_alias('Cvphar\\JsonException', 'JsonException', \false);
<?php

namespace Cvphar;

use Cvphar\Symfony\Polyfill\Php73 as p;
if (\PHP_VERSION_ID >= 70300) {
    return;
}
if (!\function_exists('is_countable')) {
    function is_countable($value)
    {
        return \is_array($value) || $value instanceof \Countable || $value instanceof \ResourceBundle || $value instanceof \SimpleXmlElement;
    }
}
if (!\function_exists('hrtime')) {
    require_once __DIR__ . '/Php73.php';
    p\Php73::$startAt = (int) \microtime(\true);
    function hrtime($as_number = \false)
    {
        return p\Php73::hrtime($as_number);
    }
}
if (!\function_exists('array_key_first')) {
    function array_key_first(array $array)
    {
        foreach ($array as $key => $value) {
            return $key;
        }
    }
}
if (!\function_exists('array_key_last')) {
    function array_key_last(array $array)
    {
        return \key(\array_slice($array, -1, 1, \true));
    }
}
<?php

namespace Cvphar;

class ValueError extends \Error
{
}
\class_alias('Cvphar\\ValueError', 'ValueError', \false);
<?php

namespace Cvphar;

#[\Attribute(\Attribute::TARGET_CLASS)]
final class Attribute
{
    public const TARGET_CLASS = 1;
    public const TARGET_FUNCTION = 2;
    public const TARGET_METHOD = 4;
    public const TARGET_PROPERTY = 8;
    public const TARGET_CLASS_CONSTANT = 16;
    public const TARGET_PARAMETER = 32;
    public const TARGET_ALL = 63;
    public const IS_REPEATABLE = 64;
    public $flags;
    public function __construct(int $flags = self::TARGET_ALL)
    {
        $this->flags = $flags;
    }
}
\class_alias('Cvphar\\Attribute', 'Attribute', \false);
<?php

namespace Cvphar;

class UnhandledMatchError extends \Error
{
}
\class_alias('Cvphar\\UnhandledMatchError', 'UnhandledMatchError', \false);
<?php

namespace Cvphar;

if (\PHP_VERSION_ID < 80000) {
    interface Stringable
    {
        public function __toString();
    }
}
<?php

namespace Cvphar;

use Cvphar\Symfony\Polyfill\Php80 as p;
if (\PHP_VERSION_ID >= 80000) {
    return;
}
if (!\defined('FILTER_VALIDATE_BOOL') && \defined('FILTER_VALIDATE_BOOLEAN')) {
    \define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN);
}
if (!\function_exists('fdiv')) {
    function fdiv(float $num1, float $num2) : float
    {
        return p\Php80::fdiv($num1, $num2);
    }
}
if (!\function_exists('preg_last_error_msg')) {
    function preg_last_error_msg() : string
    {
        return p\Php80::preg_last_error_msg();
    }
}
if (!\function_exists('str_contains')) {
    function str_contains(?string $haystack, ?string $needle) : bool
    {
        return p\Php80::str_contains($haystack ?? '', $needle ?? '');
    }
}
if (!\function_exists('str_starts_with')) {
    function str_starts_with(?string $haystack, ?string $needle) : bool
    {
        return p\Php80::str_starts_with($haystack ?? '', $needle ?? '');
    }
}
if (!\function_exists('str_ends_with')) {
    function str_ends_with(?string $haystack, ?string $needle) : bool
    {
        return p\Php80::str_ends_with($haystack ?? '', $needle ?? '');
    }
}
if (!\function_exists('get_debug_type')) {
    function get_debug_type($value) : string
    {
        return p\Php80::get_debug_type($value);
    }
}
if (!\function_exists('get_resource_id')) {
    function get_resource_id($resource) : int
    {
        return p\Php80::get_resource_id($resource);
    }
}
<?php

namespace Cvphar\Symfony\Polyfill\Php80;

final class Php80
{
    public static function fdiv(float $dividend, float $divisor) : float
    {
        return @($dividend / $divisor);
    }
    public static function get_debug_type($value) : string
    {
        switch (\true) {
            case null === $value:
                return 'null';
            case \is_bool($value):
                return 'bool';
            case \is_string($value):
                return 'string';
            case \is_array($value):
                return 'array';
            case \is_int($value):
                return 'int';
            case \is_float($value):
                return 'float';
            case \is_object($value):
                break;
            case $value instanceof \__PHP_Incomplete_Class:
                return '__PHP_Incomplete_Class';
            default:
                if (null === ($type = @\get_resource_type($value))) {
                    return 'unknown';
                }
                if ('Unknown' === $type) {
                    $type = 'closed';
                }
                return "resource ({$type})";
        }
        $class = \get_class($value);
        if (\false === \strpos($class, '@')) {
            return $class;
        }
        return ((\get_parent_class($class) ?: \key(\class_implements($class))) ?: 'class') . '@anonymous';
    }
    public static function get_resource_id($res) : int
    {
        if (!\is_resource($res) && null === @\get_resource_type($res)) {
            throw new \TypeError(\sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', \get_debug_type($res)));
        }
        return (int) $res;
    }
    public static function preg_last_error_msg() : string
    {
        switch (\preg_last_error()) {
            case \PREG_INTERNAL_ERROR:
                return 'Internal error';
            case \PREG_BAD_UTF8_ERROR:
                return 'Malformed UTF-8 characters, possibly incorrectly encoded';
            case \PREG_BAD_UTF8_OFFSET_ERROR:
                return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
            case \PREG_BACKTRACK_LIMIT_ERROR:
                return 'Backtrack limit exhausted';
            case \PREG_RECURSION_LIMIT_ERROR:
                return 'Recursion limit exhausted';
            case \PREG_JIT_STACKLIMIT_ERROR:
                return 'JIT stack limit exhausted';
            case \PREG_NO_ERROR:
                return 'No error';
            default:
                return 'Unknown error';
        }
    }
    public static function str_contains(string $haystack, string $needle) : bool
    {
        return '' === $needle || \false !== \strpos($haystack, $needle);
    }
    public static function str_starts_with(string $haystack, string $needle) : bool
    {
        return 0 === \strncmp($haystack, $needle, \strlen($needle));
    }
    public static function str_ends_with(string $haystack, string $needle) : bool
    {
        return '' === $needle || '' !== $haystack && 0 === \substr_compare($haystack, $needle, -\strlen($needle));
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

class Cursor
{
    public const HASH_INDEXED = Stub::ARRAY_INDEXED;
    public const HASH_ASSOC = Stub::ARRAY_ASSOC;
    public const HASH_OBJECT = Stub::TYPE_OBJECT;
    public const HASH_RESOURCE = Stub::TYPE_RESOURCE;
    public $depth = 0;
    public $refIndex = 0;
    public $softRefTo = 0;
    public $softRefCount = 0;
    public $softRefHandle = 0;
    public $hardRefTo = 0;
    public $hardRefCount = 0;
    public $hardRefHandle = 0;
    public $hashType;
    public $hashKey;
    public $hashKeyIsBinary;
    public $hashIndex = 0;
    public $hashLength = 0;
    public $hashCut = 0;
    public $stop = \false;
    public $attr = [];
    public $skipChildren = \false;
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

class VarCloner extends AbstractCloner
{
    private static $gid;
    private static $arrayCache = [];
    protected function doClone($var)
    {
        $len = 1;
        $pos = 0;
        $refsCounter = 0;
        $queue = [[$var]];
        $hardRefs = [];
        $objRefs = [];
        $objects = [];
        $resRefs = [];
        $values = [];
        $maxItems = $this->maxItems;
        $maxString = $this->maxString;
        $minDepth = $this->minDepth;
        $currentDepth = 0;
        $currentDepthFinalIndex = 0;
        $minimumDepthReached = 0 === $minDepth;
        $cookie = (object) [];
        $a = null;
        $stub = null;
        if (!($gid = self::$gid)) {
            $gid = self::$gid = \md5(\random_bytes(6));
        }
        $arrayStub = new Stub();
        $arrayStub->type = Stub::TYPE_ARRAY;
        $fromObjCast = \false;
        for ($i = 0; $i < $len; ++$i) {
            if ($i > $currentDepthFinalIndex) {
                ++$currentDepth;
                $currentDepthFinalIndex = $len - 1;
                if ($currentDepth >= $minDepth) {
                    $minimumDepthReached = \true;
                }
            }
            $refs = $vals = $queue[$i];
            foreach ($vals as $k => $v) {
                if (\PHP_VERSION_ID >= 70400) {
                    $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null;
                } else {
                    $refs[$k] = $cookie;
                    $zvalRef = $vals[$k] === $cookie;
                }
                if ($zvalRef) {
                    $vals[$k] =& $stub;
                    unset($stub);
                    if (\PHP_VERSION_ID >= 70400 ? null !== ($vals[$k] = $hardRefs[$zvalRef] ?? null) : $v instanceof Stub && isset($hardRefs[\spl_object_id($v)])) {
                        if (\PHP_VERSION_ID >= 70400) {
                            $v = $vals[$k];
                        } else {
                            $refs[$k] = $vals[$k] = $v;
                        }
                        if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
                            ++$v->value->refCount;
                        }
                        ++$v->refCount;
                        continue;
                    }
                    $vals[$k] = new Stub();
                    $vals[$k]->value = $v;
                    $vals[$k]->handle = ++$refsCounter;
                    if (\PHP_VERSION_ID >= 70400) {
                        $hardRefs[$zvalRef] = $vals[$k];
                    } else {
                        $refs[$k] = $vals[$k];
                        $h = \spl_object_id($refs[$k]);
                        $hardRefs[$h] =& $refs[$k];
                        $values[$h] = $v;
                    }
                }
                switch (\true) {
                    case null === $v:
                    case \is_bool($v):
                    case \is_int($v):
                    case \is_float($v):
                        continue 2;
                    case \is_string($v):
                        if ('' === $v) {
                            continue 2;
                        }
                        if (!\preg_match('//u', $v)) {
                            $stub = new Stub();
                            $stub->type = Stub::TYPE_STRING;
                            $stub->class = Stub::STRING_BINARY;
                            if (0 <= $maxString && 0 < ($cut = \strlen($v) - $maxString)) {
                                $stub->cut = $cut;
                                $stub->value = \substr($v, 0, -$cut);
                            } else {
                                $stub->value = $v;
                            }
                        } elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < ($cut = \mb_strlen($v, 'UTF-8') - $maxString)) {
                            $stub = new Stub();
                            $stub->type = Stub::TYPE_STRING;
                            $stub->class = Stub::STRING_UTF8;
                            $stub->cut = $cut;
                            $stub->value = \mb_substr($v, 0, $maxString, 'UTF-8');
                        } else {
                            continue 2;
                        }
                        $a = null;
                        break;
                    case \is_array($v):
                        if (!$v) {
                            continue 2;
                        }
                        $stub = $arrayStub;
                        if (\PHP_VERSION_ID >= 80100) {
                            $stub->class = \array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC;
                            $a = $v;
                            break;
                        }
                        $stub->class = Stub::ARRAY_INDEXED;
                        $j = -1;
                        foreach ($v as $gk => $gv) {
                            if ($gk !== ++$j) {
                                $stub->class = Stub::ARRAY_ASSOC;
                                $a = $v;
                                $a[$gid] = \true;
                                break;
                            }
                        }
                        if (isset($v[$gid])) {
                            unset($v[$gid]);
                            $a = [];
                            foreach ($v as $gk => &$gv) {
                                if ($v === $gv && (\PHP_VERSION_ID < 70400 || !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()]))) {
                                    unset($v);
                                    $v = new Stub();
                                    $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0];
                                    $v->handle = -1;
                                    if (\PHP_VERSION_ID >= 70400) {
                                        $gv =& $a[$gk];
                                        $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] =& $gv;
                                    } else {
                                        $gv =& $hardRefs[\spl_object_id($v)];
                                    }
                                    $gv = $v;
                                }
                                $a[$gk] =& $gv;
                            }
                            unset($gv);
                        } else {
                            $a = $v;
                        }
                        break;
                    case \is_object($v):
                        if (empty($objRefs[$h = \spl_object_id($v)])) {
                            $stub = new Stub();
                            $stub->type = Stub::TYPE_OBJECT;
                            $stub->class = \get_class($v);
                            $stub->value = $v;
                            $stub->handle = $h;
                            $a = $this->castObject($stub, 0 < $i);
                            if ($v !== $stub->value) {
                                if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) {
                                    break;
                                }
                                $stub->handle = $h = \spl_object_id($stub->value);
                            }
                            $stub->value = null;
                            if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
                                $stub->cut = \count($a);
                                $a = null;
                            }
                        }
                        if (empty($objRefs[$h])) {
                            $objRefs[$h] = $stub;
                            $objects[] = $v;
                        } else {
                            $stub = $objRefs[$h];
                            ++$stub->refCount;
                            $a = null;
                        }
                        break;
                    default:
                        if (empty($resRefs[$h = (int) $v])) {
                            $stub = new Stub();
                            $stub->type = Stub::TYPE_RESOURCE;
                            if ('Unknown' === ($stub->class = @\get_resource_type($v))) {
                                $stub->class = 'Closed';
                            }
                            $stub->value = $v;
                            $stub->handle = $h;
                            $a = $this->castResource($stub, 0 < $i);
                            $stub->value = null;
                            if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
                                $stub->cut = \count($a);
                                $a = null;
                            }
                        }
                        if (empty($resRefs[$h])) {
                            $resRefs[$h] = $stub;
                        } else {
                            $stub = $resRefs[$h];
                            ++$stub->refCount;
                            $a = null;
                        }
                        break;
                }
                if ($a) {
                    if (!$minimumDepthReached || 0 > $maxItems) {
                        $queue[$len] = $a;
                        $stub->position = $len++;
                    } elseif ($pos < $maxItems) {
                        if ($maxItems < ($pos += \count($a))) {
                            $a = \array_slice($a, 0, $maxItems - $pos, \true);
                            if ($stub->cut >= 0) {
                                $stub->cut += $pos - $maxItems;
                            }
                        }
                        $queue[$len] = $a;
                        $stub->position = $len++;
                    } elseif ($stub->cut >= 0) {
                        $stub->cut += \count($a);
                        $stub->position = 0;
                    }
                }
                if ($arrayStub === $stub) {
                    if ($arrayStub->cut) {
                        $stub = [$arrayStub->cut, $arrayStub->class => $arrayStub->position];
                        $arrayStub->cut = 0;
                    } elseif (isset(self::$arrayCache[$arrayStub->class][$arrayStub->position])) {
                        $stub = self::$arrayCache[$arrayStub->class][$arrayStub->position];
                    } else {
                        self::$arrayCache[$arrayStub->class][$arrayStub->position] = $stub = [$arrayStub->class => $arrayStub->position];
                    }
                }
                if (!$zvalRef) {
                    $vals[$k] = $stub;
                } elseif (\PHP_VERSION_ID >= 70400) {
                    $hardRefs[$zvalRef]->value = $stub;
                } else {
                    $refs[$k]->value = $stub;
                }
            }
            if ($fromObjCast) {
                $fromObjCast = \false;
                $refs = $vals;
                $vals = [];
                $j = -1;
                foreach ($queue[$i] as $k => $v) {
                    foreach ([$k => \true] as $gk => $gv) {
                    }
                    if ($gk !== $k) {
                        $vals = (object) $vals;
                        $vals->{$k} = $refs[++$j];
                        $vals = (array) $vals;
                    } else {
                        $vals[$k] = $refs[++$j];
                    }
                }
            }
            $queue[$i] = $vals;
        }
        foreach ($values as $h => $v) {
            $hardRefs[$h] = $v;
        }
        return $queue;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

interface ClonerInterface
{
    public function cloneVar($var);
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

interface DumperInterface
{
    public function dumpScalar(Cursor $cursor, string $type, $value);
    public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
    public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild);
    public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut);
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

use Cvphar\Symfony\Component\VarDumper\Caster\Caster;
use Cvphar\Symfony\Component\VarDumper\Exception\ThrowingCasterException;
abstract class AbstractCloner implements ClonerInterface
{
    public static $defaultCasters = ['__PHP_Incomplete_Class' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\Caster', 'castPhpIncompleteClass'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castStub'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castCutArray'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ConstStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castStub'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\EnumStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castEnum'], 'Fiber' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FiberCaster', 'castFiber'], 'Closure' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClosure'], 'Generator' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castGenerator'], 'ReflectionType' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castType'], 'ReflectionAttribute' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castAttribute'], 'ReflectionGenerator' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castReflectionGenerator'], 'ReflectionClass' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClass'], 'ReflectionClassConstant' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClassConstant'], 'ReflectionFunctionAbstract' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castFunctionAbstract'], 'ReflectionMethod' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castMethod'], 'ReflectionParameter' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castParameter'], 'ReflectionProperty' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castProperty'], 'ReflectionReference' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castReference'], 'ReflectionExtension' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castExtension'], 'ReflectionZendExtension' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castZendExtension'], 'Cvphar\\Doctrine\\Common\\Persistence\\ObjectManager' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Doctrine\\Common\\Proxy\\Proxy' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castCommonProxy'], 'Cvphar\\Doctrine\\ORM\\Proxy\\Proxy' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castOrmProxy'], 'Cvphar\\Doctrine\\ORM\\PersistentCollection' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castPersistentCollection'], 'Cvphar\\Doctrine\\Persistence\\ObjectManager' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'DOMException' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castException'], 'DOMStringList' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNameList' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMImplementation' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castImplementation'], 'DOMImplementationList' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNode' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNode'], 'DOMNameSpaceNode' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNameSpaceNode'], 'DOMDocument' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDocument'], 'DOMNodeList' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNamedNodeMap' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMCharacterData' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castCharacterData'], 'DOMAttr' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castAttr'], 'DOMElement' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castElement'], 'DOMText' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castText'], 'DOMTypeinfo' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castTypeinfo'], 'DOMDomError' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDomError'], 'DOMLocator' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLocator'], 'DOMDocumentType' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDocumentType'], 'DOMNotation' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNotation'], 'DOMEntity' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castEntity'], 'DOMProcessingInstruction' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castProcessingInstruction'], 'DOMXPath' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castXPath'], 'XMLReader' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster', 'castXmlReader'], 'ErrorException' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castErrorException'], 'Exception' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castException'], 'Error' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castError'], 'Cvphar\\Symfony\\Bridge\\Monolog\\Logger' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Symfony\\Component\\HttpClient\\AmpHttpClient' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'Cvphar\\Symfony\\Component\\HttpClient\\CurlHttpClient' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'Cvphar\\Symfony\\Component\\HttpClient\\NativeHttpClient' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'Cvphar\\Symfony\\Component\\HttpClient\\Response\\AmpResponse' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'Cvphar\\Symfony\\Component\\HttpClient\\Response\\CurlResponse' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'Cvphar\\Symfony\\Component\\HttpClient\\Response\\NativeResponse' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\\Component\\HttpFoundation\\Request' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castRequest'], 'Cvphar\\Symfony\\Component\\Uid\\Ulid' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castUlid'], 'Cvphar\\Symfony\\Component\\Uid\\Uuid' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castUuid'], 'Cvphar\\Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castThrowingCasterException'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\TraceStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castTraceStub'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\FrameStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castFrameStub'], 'Cvphar\\Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Symfony\\Component\\ErrorHandler\\Exception\\SilencedErrorContext' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castSilencedErrorContext'], 'Cvphar\\Imagine\\Image\\ImageInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ImagineCaster', 'castImage'], 'Cvphar\\Ramsey\\Uuid\\UuidInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\UuidCaster', 'castRamseyUuid'], 'Cvphar\\ProxyManager\\Proxy\\ProxyInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster', 'castProxy'], 'PHPUnit_Framework_MockObject_MockObject' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\PHPUnit\\Framework\\MockObject\\MockObject' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\PHPUnit\\Framework\\MockObject\\Stub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Prophecy\\Prophecy\\ProphecySubjectInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'Cvphar\\Mockery\\MockInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'PDO' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster', 'castPdo'], 'PDOStatement' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster', 'castPdoStatement'], 'AMQPConnection' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castConnection'], 'AMQPChannel' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castChannel'], 'AMQPQueue' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castQueue'], 'AMQPExchange' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castExchange'], 'AMQPEnvelope' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castEnvelope'], 'ArrayObject' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castArrayObject'], 'ArrayIterator' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castArrayIterator'], 'SplDoublyLinkedList' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castDoublyLinkedList'], 'SplFileInfo' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castFileInfo'], 'SplFileObject' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castFileObject'], 'SplHeap' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castHeap'], 'SplObjectStorage' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castObjectStorage'], 'SplPriorityQueue' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castHeap'], 'OuterIterator' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castOuterIterator'], 'WeakReference' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castWeakReference'], 'Redis' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedis'], 'RedisArray' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedisArray'], 'RedisCluster' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedisCluster'], 'DateTimeInterface' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castDateTime'], 'DateInterval' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castInterval'], 'DateTimeZone' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castTimeZone'], 'DatePeriod' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castPeriod'], 'GMP' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\GmpCaster', 'castGmp'], 'MessageFormatter' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castMessageFormatter'], 'NumberFormatter' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castNumberFormatter'], 'IntlTimeZone' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlTimeZone'], 'IntlCalendar' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlCalendar'], 'IntlDateFormatter' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlDateFormatter'], 'Memcached' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster', 'castMemcached'], 'Cvphar\\Ds\\Collection' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castCollection'], 'Cvphar\\Ds\\Map' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castMap'], 'Cvphar\\Ds\\Pair' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castPair'], 'Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castPairStub'], 'mysqli_driver' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\MysqliCaster', 'castMysqliDriver'], 'CurlHandle' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castCurl'], ':curl' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castCurl'], ':dba' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castDba'], ':dba persistent' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castDba'], 'GdImage' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castGd'], ':gd' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castGd'], ':mysql link' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castMysqlLink'], ':pgsql large object' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLargeObject'], ':pgsql link' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLink'], ':pgsql link persistent' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLink'], ':pgsql result' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castResult'], ':process' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castProcess'], ':stream' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStream'], 'OpenSSLCertificate' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castOpensslX509'], ':OpenSSL X.509' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castOpensslX509'], ':persistent stream' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStream'], ':stream-context' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStreamContext'], 'XmlParser' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster', 'castXml'], ':xml' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster', 'castXml'], 'RdKafka' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castRdKafka'], 'Cvphar\\RdKafka\\Conf' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castConf'], 'Cvphar\\RdKafka\\KafkaConsumer' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castKafkaConsumer'], 'Cvphar\\RdKafka\\Metadata\\Broker' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castBrokerMetadata'], 'Cvphar\\RdKafka\\Metadata\\Collection' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castCollectionMetadata'], 'Cvphar\\RdKafka\\Metadata\\Partition' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castPartitionMetadata'], 'Cvphar\\RdKafka\\Metadata\\Topic' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicMetadata'], 'Cvphar\\RdKafka\\Message' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castMessage'], 'Cvphar\\RdKafka\\Topic' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopic'], 'Cvphar\\RdKafka\\TopicPartition' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicPartition'], 'Cvphar\\RdKafka\\TopicConf' => ['Cvphar\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicConf']];
    protected $maxItems = 2500;
    protected $maxString = -1;
    protected $minDepth = 1;
    private $casters = [];
    private $prevErrorHandler;
    private $classInfo = [];
    private $filter = 0;
    public function __construct(array $casters = null)
    {
        if (null === $casters) {
            $casters = static::$defaultCasters;
        }
        $this->addCasters($casters);
    }
    public function addCasters(array $casters)
    {
        foreach ($casters as $type => $callback) {
            $this->casters[$type][] = $callback;
        }
    }
    public function setMaxItems(int $maxItems)
    {
        $this->maxItems = $maxItems;
    }
    public function setMaxString(int $maxString)
    {
        $this->maxString = $maxString;
    }
    public function setMinDepth(int $minDepth)
    {
        $this->minDepth = $minDepth;
    }
    public function cloneVar($var, int $filter = 0)
    {
        $this->prevErrorHandler = \set_error_handler(function ($type, $msg, $file, $line, $context = []) {
            if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) {
                throw new \ErrorException($msg, 0, $type, $file, $line);
            }
            if ($this->prevErrorHandler) {
                return ($this->prevErrorHandler)($type, $msg, $file, $line, $context);
            }
            return \false;
        });
        $this->filter = $filter;
        if ($gc = \gc_enabled()) {
            \gc_disable();
        }
        try {
            return new Data($this->doClone($var));
        } finally {
            if ($gc) {
                \gc_enable();
            }
            \restore_error_handler();
            $this->prevErrorHandler = null;
        }
    }
    protected abstract function doClone($var);
    protected function castObject(Stub $stub, bool $isNested)
    {
        $obj = $stub->value;
        $class = $stub->class;
        if (\PHP_VERSION_ID < 80000 ? "\x00" === ($class[15] ?? null) : \str_contains($class, "@anonymous\x00")) {
            $stub->class = \get_debug_type($obj);
        }
        if (isset($this->classInfo[$class])) {
            [$i, $parents, $hasDebugInfo, $fileInfo] = $this->classInfo[$class];
        } else {
            $i = 2;
            $parents = [$class];
            $hasDebugInfo = \method_exists($class, '__debugInfo');
            foreach (\class_parents($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            foreach (\class_implements($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            $parents[] = '*';
            $r = new \ReflectionClass($class);
            $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : ['file' => $r->getFileName(), 'line' => $r->getStartLine()];
            $this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo];
        }
        $stub->attr += $fileInfo;
        $a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class);
        try {
            while ($i--) {
                if (!empty($this->casters[$p = $parents[$i]])) {
                    foreach ($this->casters[$p] as $callback) {
                        $a = $callback($obj, $a, $stub, $isNested, $this->filter);
                    }
                }
            }
        } catch (\Exception $e) {
            $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '') . 'âš ' => new ThrowingCasterException($e)] + $a;
        }
        return $a;
    }
    protected function castResource(Stub $stub, bool $isNested)
    {
        $a = [];
        $res = $stub->value;
        $type = $stub->class;
        try {
            if (!empty($this->casters[':' . $type])) {
                foreach ($this->casters[':' . $type] as $callback) {
                    $a = $callback($res, $a, $stub, $isNested, $this->filter);
                }
            }
        } catch (\Exception $e) {
            $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '') . 'âš ' => new ThrowingCasterException($e)] + $a;
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

use Cvphar\Symfony\Component\VarDumper\Caster\Caster;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
class Data implements \ArrayAccess, \Countable, \IteratorAggregate
{
    private $data;
    private $position = 0;
    private $key = 0;
    private $maxDepth = 20;
    private $maxItemsPerDepth = -1;
    private $useRefHandles = -1;
    private $context = [];
    public function __construct(array $data)
    {
        $this->data = $data;
    }
    public function getType()
    {
        $item = $this->data[$this->position][$this->key];
        if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
            $item = $item->value;
        }
        if (!$item instanceof Stub) {
            return \gettype($item);
        }
        if (Stub::TYPE_STRING === $item->type) {
            return 'string';
        }
        if (Stub::TYPE_ARRAY === $item->type) {
            return 'array';
        }
        if (Stub::TYPE_OBJECT === $item->type) {
            return $item->class;
        }
        if (Stub::TYPE_RESOURCE === $item->type) {
            return $item->class . ' resource';
        }
        return null;
    }
    public function getValue($recursive = \false)
    {
        $item = $this->data[$this->position][$this->key];
        if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
            $item = $item->value;
        }
        if (!($item = $this->getStub($item)) instanceof Stub) {
            return $item;
        }
        if (Stub::TYPE_STRING === $item->type) {
            return $item->value;
        }
        $children = $item->position ? $this->data[$item->position] : [];
        foreach ($children as $k => $v) {
            if ($recursive && !($v = $this->getStub($v)) instanceof Stub) {
                continue;
            }
            $children[$k] = clone $this;
            $children[$k]->key = $k;
            $children[$k]->position = $item->position;
            if ($recursive) {
                if (Stub::TYPE_REF === $v->type && ($v = $this->getStub($v->value)) instanceof Stub) {
                    $recursive = (array) $recursive;
                    if (isset($recursive[$v->position])) {
                        continue;
                    }
                    $recursive[$v->position] = \true;
                }
                $children[$k] = $children[$k]->getValue($recursive);
            }
        }
        return $children;
    }
    #[\ReturnTypeWillChange]
    public function count()
    {
        return \count($this->getValue());
    }
    #[\ReturnTypeWillChange]
    public function getIterator()
    {
        if (!\is_array($value = $this->getValue())) {
            throw new \LogicException(\sprintf('"%s" object holds non-iterable type "%s".', self::class, \get_debug_type($value)));
        }
        yield from $value;
    }
    public function __get(string $key)
    {
        if (null !== ($data = $this->seek($key))) {
            $item = $this->getStub($data->data[$data->position][$data->key]);
            return $item instanceof Stub || [] === $item ? $data : $item;
        }
        return null;
    }
    public function __isset(string $key)
    {
        return null !== $this->seek($key);
    }
    #[\ReturnTypeWillChange]
    public function offsetExists($key)
    {
        return $this->__isset($key);
    }
    #[\ReturnTypeWillChange]
    public function offsetGet($key)
    {
        return $this->__get($key);
    }
    #[\ReturnTypeWillChange]
    public function offsetSet($key, $value)
    {
        throw new \BadMethodCallException(self::class . ' objects are immutable.');
    }
    #[\ReturnTypeWillChange]
    public function offsetUnset($key)
    {
        throw new \BadMethodCallException(self::class . ' objects are immutable.');
    }
    public function __toString()
    {
        $value = $this->getValue();
        if (!\is_array($value)) {
            return (string) $value;
        }
        return \sprintf('%s (count=%d)', $this->getType(), \count($value));
    }
    public function withMaxDepth(int $maxDepth)
    {
        $data = clone $this;
        $data->maxDepth = $maxDepth;
        return $data;
    }
    public function withMaxItemsPerDepth(int $maxItemsPerDepth)
    {
        $data = clone $this;
        $data->maxItemsPerDepth = $maxItemsPerDepth;
        return $data;
    }
    public function withRefHandles(bool $useRefHandles)
    {
        $data = clone $this;
        $data->useRefHandles = $useRefHandles ? -1 : 0;
        return $data;
    }
    public function withContext(array $context)
    {
        $data = clone $this;
        $data->context = $context;
        return $data;
    }
    public function seek($key)
    {
        $item = $this->data[$this->position][$this->key];
        if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
            $item = $item->value;
        }
        if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) {
            return null;
        }
        $keys = [$key];
        switch ($item->type) {
            case Stub::TYPE_OBJECT:
                $keys[] = Caster::PREFIX_DYNAMIC . $key;
                $keys[] = Caster::PREFIX_PROTECTED . $key;
                $keys[] = Caster::PREFIX_VIRTUAL . $key;
                $keys[] = "\x00{$item->class}\x00{$key}";
            case Stub::TYPE_ARRAY:
            case Stub::TYPE_RESOURCE:
                break;
            default:
                return null;
        }
        $data = null;
        $children = $this->data[$item->position];
        foreach ($keys as $key) {
            if (isset($children[$key]) || \array_key_exists($key, $children)) {
                $data = clone $this;
                $data->key = $key;
                $data->position = $item->position;
                break;
            }
        }
        return $data;
    }
    public function dump(DumperInterface $dumper)
    {
        $refs = [0];
        $cursor = new Cursor();
        if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) {
            $cursor->attr['if_links'] = \true;
            $cursor->hashType = -1;
            $dumper->dumpScalar($cursor, 'default', '^');
            $cursor->attr = ['if_links' => \true];
            $dumper->dumpScalar($cursor, 'default', ' ');
            $cursor->hashType = 0;
        }
        $this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]);
    }
    private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item)
    {
        $cursor->refIndex = 0;
        $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
        $cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0;
        $firstSeen = \true;
        if (!$item instanceof Stub) {
            $cursor->attr = [];
            $type = \gettype($item);
            if ($item && 'array' === $type) {
                $item = $this->getStub($item);
            }
        } elseif (Stub::TYPE_REF === $item->type) {
            if ($item->handle) {
                if (!isset($refs[$r = $item->handle - (\PHP_INT_MAX >> 1)])) {
                    $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
                } else {
                    $firstSeen = \false;
                }
                $cursor->hardRefTo = $refs[$r];
                $cursor->hardRefHandle = $this->useRefHandles & $item->handle;
                $cursor->hardRefCount = 0 < $item->handle ? $item->refCount : 0;
            }
            $cursor->attr = $item->attr;
            $type = $item->class ?: \gettype($item->value);
            $item = $this->getStub($item->value);
        }
        if ($item instanceof Stub) {
            if ($item->refCount) {
                if (!isset($refs[$r = $item->handle])) {
                    $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
                } else {
                    $firstSeen = \false;
                }
                $cursor->softRefTo = $refs[$r];
            }
            $cursor->softRefHandle = $this->useRefHandles & $item->handle;
            $cursor->softRefCount = $item->refCount;
            $cursor->attr = $item->attr;
            $cut = $item->cut;
            if ($item->position && $firstSeen) {
                $children = $this->data[$item->position];
                if ($cursor->stop) {
                    if ($cut >= 0) {
                        $cut += \count($children);
                    }
                    $children = [];
                }
            } else {
                $children = [];
            }
            switch ($item->type) {
                case Stub::TYPE_STRING:
                    $dumper->dumpString($cursor, $item->value, Stub::STRING_BINARY === $item->class, $cut);
                    break;
                case Stub::TYPE_ARRAY:
                    $item = clone $item;
                    $item->type = $item->class;
                    $item->class = $item->value;
                case Stub::TYPE_OBJECT:
                case Stub::TYPE_RESOURCE:
                    $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth;
                    $dumper->enterHash($cursor, $item->type, $item->class, $withChildren);
                    if ($withChildren) {
                        if ($cursor->skipChildren) {
                            $withChildren = \false;
                            $cut = -1;
                        } else {
                            $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class);
                        }
                    } elseif ($children && 0 <= $cut) {
                        $cut += \count($children);
                    }
                    $cursor->skipChildren = \false;
                    $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
                    break;
                default:
                    throw new \RuntimeException(\sprintf('Unexpected Stub type: "%s".', $item->type));
            }
        } elseif ('array' === $type) {
            $dumper->enterHash($cursor, Cursor::HASH_INDEXED, 0, \false);
            $dumper->leaveHash($cursor, Cursor::HASH_INDEXED, 0, \false, 0);
        } elseif ('string' === $type) {
            $dumper->dumpString($cursor, $item, \false, 0);
        } else {
            $dumper->dumpScalar($cursor, $type, $item);
        }
    }
    private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array &$refs, array $children, int $hashCut, int $hashType, bool $dumpKeys) : int
    {
        $cursor = clone $parentCursor;
        ++$cursor->depth;
        $cursor->hashType = $hashType;
        $cursor->hashIndex = 0;
        $cursor->hashLength = \count($children);
        $cursor->hashCut = $hashCut;
        foreach ($children as $key => $child) {
            $cursor->hashKeyIsBinary = isset($key[0]) && !\preg_match('//u', $key);
            $cursor->hashKey = $dumpKeys ? $key : null;
            $this->dumpItem($dumper, $cursor, $refs, $child);
            if (++$cursor->hashIndex === $this->maxItemsPerDepth || $cursor->stop) {
                $parentCursor->stop = \true;
                return $hashCut >= 0 ? $hashCut + $cursor->hashLength - $cursor->hashIndex : $hashCut;
            }
        }
        return $hashCut;
    }
    private function getStub($item)
    {
        if (!$item || !\is_array($item)) {
            return $item;
        }
        $stub = new Stub();
        $stub->type = Stub::TYPE_ARRAY;
        foreach ($item as $stub->class => $stub->position) {
        }
        if (isset($item[0])) {
            $stub->cut = $item[0];
        }
        $stub->value = $stub->cut + ($stub->position ? \count($this->data[$stub->position]) : 0);
        return $stub;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Cloner;

class Stub
{
    public const TYPE_REF = 1;
    public const TYPE_STRING = 2;
    public const TYPE_ARRAY = 3;
    public const TYPE_OBJECT = 4;
    public const TYPE_RESOURCE = 5;
    public const STRING_BINARY = 1;
    public const STRING_UTF8 = 2;
    public const ARRAY_ASSOC = 1;
    public const ARRAY_INDEXED = 2;
    public $type = self::TYPE_REF;
    public $class = '';
    public $value;
    public $cut = 0;
    public $handle = 0;
    public $refCount = 0;
    public $position = 0;
    public $attr = [];
    private static $defaultProperties = [];
    public function __sleep() : array
    {
        $properties = [];
        if (!isset(self::$defaultProperties[$c = static::class])) {
            self::$defaultProperties[$c] = \get_class_vars($c);
            foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) {
                unset(self::$defaultProperties[$c][$k]);
            }
        }
        foreach (self::$defaultProperties[$c] as $k => $v) {
            if ($this->{$k} !== $v) {
                $properties[] = $k;
            }
        }
        return $properties;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class GmpCaster
{
    public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter) : array
    {
        $a[Caster::PREFIX_VIRTUAL . 'value'] = new ConstStub(\gmp_strval($gmp), \gmp_strval($gmp));
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ReflectionCaster
{
    public const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__ . '::unsetClosureFileInfo'];
    private const EXTRA_MAP = ['docComment' => 'getDocComment', 'extension' => 'getExtensionName', 'isDisabled' => 'isDisabled', 'isDeprecated' => 'isDeprecated', 'isInternal' => 'isInternal', 'isUserDefined' => 'isUserDefined', 'isGenerator' => 'isGenerator', 'isVariadic' => 'isVariadic'];
    public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $c = new \ReflectionFunction($c);
        $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
        if (!\str_contains($c->name, '{closure}')) {
            $stub->class = isset($a[$prefix . 'class']) ? $a[$prefix . 'class']->value . '::' . $c->name : $c->name;
            unset($a[$prefix . 'class']);
        }
        unset($a[$prefix . 'extra']);
        $stub->class .= self::getSignature($a);
        if ($f = $c->getFileName()) {
            $stub->attr['file'] = $f;
            $stub->attr['line'] = $c->getStartLine();
        }
        unset($a[$prefix . 'parameters']);
        if ($filter & Caster::EXCLUDE_VERBOSE) {
            $stub->cut += ($c->getFileName() ? 2 : 0) + \count($a);
            return [];
        }
        if ($f) {
            $a[$prefix . 'file'] = new LinkStub($f, $c->getStartLine());
            $a[$prefix . 'line'] = $c->getStartLine() . ' to ' . $c->getEndLine();
        }
        return $a;
    }
    public static function unsetClosureFileInfo(\Closure $c, array $a)
    {
        unset($a[Caster::PREFIX_VIRTUAL . 'file'], $a[Caster::PREFIX_VIRTUAL . 'line']);
        return $a;
    }
    public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested)
    {
        try {
            $reflectionGenerator = new \ReflectionGenerator($c);
        } catch (\Exception $e) {
            $a[Caster::PREFIX_VIRTUAL . 'closed'] = \true;
            return $a;
        }
        return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested);
    }
    public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) {
            $a += [$prefix . 'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c, $prefix . 'allowsNull' => $c->allowsNull(), $prefix . 'isBuiltin' => $c->isBuiltin()];
        } elseif ($c instanceof \ReflectionUnionType || $c instanceof \ReflectionIntersectionType) {
            $a[$prefix . 'allowsNull'] = $c->allowsNull();
            self::addMap($a, $c, ['types' => 'getTypes']);
        } else {
            $a[$prefix . 'allowsNull'] = $c->allowsNull();
        }
        return $a;
    }
    public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested)
    {
        self::addMap($a, $c, ['name' => 'getName', 'arguments' => 'getArguments']);
        return $a;
    }
    public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        if ($c->getThis()) {
            $a[$prefix . 'this'] = new CutStub($c->getThis());
        }
        $function = $c->getFunction();
        $frame = ['class' => $function->class ?? null, 'type' => isset($function->class) ? $function->isStatic() ? '::' : '->' : null, 'function' => $function->name, 'file' => $c->getExecutingFile(), 'line' => $c->getExecutingLine()];
        if ($trace = $c->getTrace(\DEBUG_BACKTRACE_IGNORE_ARGS)) {
            $function = new \ReflectionGenerator($c->getExecutingGenerator());
            \array_unshift($trace, ['function' => 'yield', 'file' => $function->getExecutingFile(), 'line' => $function->getExecutingLine() - (int) (\PHP_VERSION_ID < 80100)]);
            $trace[] = $frame;
            $a[$prefix . 'trace'] = new TraceStub($trace, \false, 0, -1, -1);
        } else {
            $function = new FrameStub($frame, \false, \true);
            $function = ExceptionCaster::castFrameStub($function, [], $function, \true);
            $a[$prefix . 'executing'] = $function[$prefix . 'src'];
        }
        $a[Caster::PREFIX_VIRTUAL . 'closed'] = \false;
        return $a;
    }
    public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        if ($n = \Reflection::getModifierNames($c->getModifiers())) {
            $a[$prefix . 'modifiers'] = \implode(' ', $n);
        }
        self::addMap($a, $c, ['extends' => 'getParentClass', 'implements' => 'getInterfaceNames', 'constants' => 'getReflectionConstants']);
        foreach ($c->getProperties() as $n) {
            $a[$prefix . 'properties'][$n->name] = $n;
        }
        foreach ($c->getMethods() as $n) {
            $a[$prefix . 'methods'][$n->name] = $n;
        }
        self::addAttributes($a, $c, $prefix);
        if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
            self::addExtra($a, $c);
        }
        return $a;
    }
    public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        self::addMap($a, $c, ['returnsReference' => 'returnsReference', 'returnType' => 'getReturnType', 'class' => \PHP_VERSION_ID >= 80111 ? 'getClosureCalledClass' : 'getClosureScopeClass', 'this' => 'getClosureThis']);
        if (isset($a[$prefix . 'returnType'])) {
            $v = $a[$prefix . 'returnType'];
            $v = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v;
            $a[$prefix . 'returnType'] = new ClassStub($a[$prefix . 'returnType'] instanceof \ReflectionNamedType && $a[$prefix . 'returnType']->allowsNull() && 'mixed' !== $v ? '?' . $v : $v, [\class_exists($v, \false) || \interface_exists($v, \false) || \trait_exists($v, \false) ? $v : '', '']);
        }
        if (isset($a[$prefix . 'class'])) {
            $a[$prefix . 'class'] = new ClassStub($a[$prefix . 'class']);
        }
        if (isset($a[$prefix . 'this'])) {
            $a[$prefix . 'this'] = new CutStub($a[$prefix . 'this']);
        }
        foreach ($c->getParameters() as $v) {
            $k = '$' . $v->name;
            if ($v->isVariadic()) {
                $k = '...' . $k;
            }
            if ($v->isPassedByReference()) {
                $k = '&' . $k;
            }
            $a[$prefix . 'parameters'][$k] = $v;
        }
        if (isset($a[$prefix . 'parameters'])) {
            $a[$prefix . 'parameters'] = new EnumStub($a[$prefix . 'parameters']);
        }
        self::addAttributes($a, $c, $prefix);
        if (!($filter & Caster::EXCLUDE_VERBOSE) && ($v = $c->getStaticVariables())) {
            foreach ($v as $k => &$v) {
                if (\is_object($v)) {
                    $a[$prefix . 'use']['$' . $k] = new CutStub($v);
                } else {
                    $a[$prefix . 'use']['$' . $k] =& $v;
                }
            }
            unset($v);
            $a[$prefix . 'use'] = new EnumStub($a[$prefix . 'use']);
        }
        if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
            self::addExtra($a, $c);
        }
        return $a;
    }
    public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'modifiers'] = \implode(' ', \Reflection::getModifierNames($c->getModifiers()));
        $a[Caster::PREFIX_VIRTUAL . 'value'] = $c->getValue();
        self::addAttributes($a, $c);
        return $a;
    }
    public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'modifiers'] = \implode(' ', \Reflection::getModifierNames($c->getModifiers()));
        return $a;
    }
    public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        self::addMap($a, $c, ['position' => 'getPosition', 'isVariadic' => 'isVariadic', 'byReference' => 'isPassedByReference', 'allowsNull' => 'allowsNull']);
        self::addAttributes($a, $c, $prefix);
        if ($v = $c->getType()) {
            $a[$prefix . 'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v;
        }
        if (isset($a[$prefix . 'typeHint'])) {
            $v = $a[$prefix . 'typeHint'];
            $a[$prefix . 'typeHint'] = new ClassStub($v, [\class_exists($v, \false) || \interface_exists($v, \false) || \trait_exists($v, \false) ? $v : '', '']);
        } else {
            unset($a[$prefix . 'allowsNull']);
        }
        if ($c->isOptional()) {
            try {
                $a[$prefix . 'default'] = $v = $c->getDefaultValue();
                if ($c->isDefaultValueConstant() && !\is_object($v)) {
                    $a[$prefix . 'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
                }
                if (null === $v) {
                    unset($a[$prefix . 'allowsNull']);
                }
            } catch (\ReflectionException $e) {
            }
        }
        return $a;
    }
    public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'modifiers'] = \implode(' ', \Reflection::getModifierNames($c->getModifiers()));
        self::addAttributes($a, $c);
        self::addExtra($a, $c);
        return $a;
    }
    public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'id'] = $c->getId();
        return $a;
    }
    public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested)
    {
        self::addMap($a, $c, ['version' => 'getVersion', 'dependencies' => 'getDependencies', 'iniEntries' => 'getIniEntries', 'isPersistent' => 'isPersistent', 'isTemporary' => 'isTemporary', 'constants' => 'getConstants', 'functions' => 'getFunctions', 'classes' => 'getClasses']);
        return $a;
    }
    public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested)
    {
        self::addMap($a, $c, ['version' => 'getVersion', 'author' => 'getAuthor', 'copyright' => 'getCopyright', 'url' => 'getURL']);
        return $a;
    }
    public static function getSignature(array $a)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $signature = '';
        if (isset($a[$prefix . 'parameters'])) {
            foreach ($a[$prefix . 'parameters']->value as $k => $param) {
                $signature .= ', ';
                if ($type = $param->getType()) {
                    if (!$type instanceof \ReflectionNamedType) {
                        $signature .= $type . ' ';
                    } else {
                        if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) {
                            $signature .= '?';
                        }
                        $signature .= \substr(\strrchr('\\' . $type->getName(), '\\'), 1) . ' ';
                    }
                }
                $signature .= $k;
                if (!$param->isDefaultValueAvailable()) {
                    continue;
                }
                $v = $param->getDefaultValue();
                $signature .= ' = ';
                if ($param->isDefaultValueConstant()) {
                    $signature .= \substr(\strrchr('\\' . $param->getDefaultValueConstantName(), '\\'), 1);
                } elseif (null === $v) {
                    $signature .= 'null';
                } elseif (\is_array($v)) {
                    $signature .= $v ? '[â€¦' . \count($v) . ']' : '[]';
                } elseif (\is_string($v)) {
                    $signature .= 10 > \strlen($v) && !\str_contains($v, '\\') ? "'{$v}'" : "'â€¦" . \strlen($v) . "'";
                } elseif (\is_bool($v)) {
                    $signature .= $v ? 'true' : 'false';
                } elseif (\is_object($v)) {
                    $signature .= 'new ' . \substr(\strrchr('\\' . \get_debug_type($v), '\\'), 1);
                } else {
                    $signature .= $v;
                }
            }
        }
        $signature = (empty($a[$prefix . 'returnsReference']) ? '' : '&') . '(' . \substr($signature, 2) . ')';
        if (isset($a[$prefix . 'returnType'])) {
            $signature .= ': ' . \substr(\strrchr('\\' . $a[$prefix . 'returnType'], '\\'), 1);
        }
        return $signature;
    }
    private static function addExtra(array &$a, \Reflector $c)
    {
        $x = isset($a[Caster::PREFIX_VIRTUAL . 'extra']) ? $a[Caster::PREFIX_VIRTUAL . 'extra']->value : [];
        if (\method_exists($c, 'getFileName') && ($m = $c->getFileName())) {
            $x['file'] = new LinkStub($m, $c->getStartLine());
            $x['line'] = $c->getStartLine() . ' to ' . $c->getEndLine();
        }
        self::addMap($x, $c, self::EXTRA_MAP, '');
        if ($x) {
            $a[Caster::PREFIX_VIRTUAL . 'extra'] = new EnumStub($x);
        }
    }
    private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
    {
        foreach ($map as $k => $m) {
            if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
                continue;
            }
            if (\method_exists($c, $m) && \false !== ($m = $c->{$m}()) && null !== $m) {
                $a[$prefix . $k] = $m instanceof \Reflector ? $m->name : $m;
            }
        }
    }
    private static function addAttributes(array &$a, \Reflector $c, string $prefix = Caster::PREFIX_VIRTUAL) : void
    {
        if (\PHP_VERSION_ID >= 80000) {
            foreach ($c->getAttributes() as $n) {
                $a[$prefix . 'attributes'][] = $n;
            }
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class StubCaster
{
    public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested)
    {
        if ($isNested) {
            $stub->type = $c->type;
            $stub->class = $c->class;
            $stub->value = $c->value;
            $stub->handle = $c->handle;
            $stub->cut = $c->cut;
            $stub->attr = $c->attr;
            if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !\preg_match('//u', $c->value)) {
                $stub->type = Stub::TYPE_STRING;
                $stub->class = Stub::STRING_BINARY;
            }
            $a = [];
        }
        return $a;
    }
    public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested)
    {
        return $isNested ? $c->preservedSubset : $a;
    }
    public static function cutInternals($obj, array $a, Stub $stub, bool $isNested)
    {
        if ($isNested) {
            $stub->cut += \count($a);
            return [];
        }
        return $a;
    }
    public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested)
    {
        if ($isNested) {
            $stub->class = $c->dumpKeys ? '' : null;
            $stub->handle = 0;
            $stub->value = null;
            $stub->cut = $c->cut;
            $stub->attr = $c->attr;
            $a = [];
            if ($c->value) {
                foreach (\array_keys($c->value) as $k) {
                    $keys[] = !isset($k[0]) || "\x00" !== $k[0] ? Caster::PREFIX_VIRTUAL . $k : $k;
                }
                $a = \array_combine($keys, $c->value);
            }
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Symfony\Component\HttpFoundation\Request;
use Cvphar\Symfony\Component\Uid\Ulid;
use Cvphar\Symfony\Component\Uid\Uuid;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class SymfonyCaster
{
    private const REQUEST_GETTERS = ['pathInfo' => 'getPathInfo', 'requestUri' => 'getRequestUri', 'baseUrl' => 'getBaseUrl', 'basePath' => 'getBasePath', 'method' => 'getMethod', 'format' => 'getRequestFormat'];
    public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested)
    {
        $clone = null;
        foreach (self::REQUEST_GETTERS as $prop => $getter) {
            $key = Caster::PREFIX_PROTECTED . $prop;
            if (\array_key_exists($key, $a) && null === $a[$key]) {
                if (null === $clone) {
                    $clone = clone $request;
                }
                $a[Caster::PREFIX_VIRTUAL . $prop] = $clone->{$getter}();
            }
        }
        return $a;
    }
    public static function castHttpClient($client, array $a, Stub $stub, bool $isNested)
    {
        $multiKey = \sprintf("\x00%s\x00multi", \get_class($client));
        if (isset($a[$multiKey])) {
            $a[$multiKey] = new CutStub($a[$multiKey]);
        }
        return $a;
    }
    public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested)
    {
        $stub->cut += \count($a);
        $a = [];
        foreach ($response->getInfo() as $k => $v) {
            $a[Caster::PREFIX_VIRTUAL . $k] = $v;
        }
        return $a;
    }
    public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'toBase58'] = $uuid->toBase58();
        $a[Caster::PREFIX_VIRTUAL . 'toBase32'] = $uuid->toBase32();
        if (\method_exists($uuid, 'getDateTime')) {
            $a[Caster::PREFIX_VIRTUAL . 'time'] = $uuid->getDateTime()->format('Y-m-d H:i:s.u \\U\\T\\C');
        }
        return $a;
    }
    public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'toBase58'] = $ulid->toBase58();
        $a[Caster::PREFIX_VIRTUAL . 'toRfc4122'] = $ulid->toRfc4122();
        if (\method_exists($ulid, 'getDateTime')) {
            $a[Caster::PREFIX_VIRTUAL . 'time'] = $ulid->getDateTime()->format('Y-m-d H:i:s.v \\U\\T\\C');
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

class FrameStub extends EnumStub
{
    public $keepArgs;
    public $inTraceStub;
    public function __construct(array $frame, bool $keepArgs = \true, bool $inTraceStub = \false)
    {
        $this->value = $frame;
        $this->keepArgs = $keepArgs;
        $this->inTraceStub = $inTraceStub;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\ProxyManager\Proxy\ProxyInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ProxyManagerCaster
{
    public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested)
    {
        if ($parent = \get_parent_class($c)) {
            $stub->class .= ' - ' . $parent;
        }
        $stub->class .= '@proxy';
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DateCaster
{
    private const PERIOD_LIMIT = 3;
    public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $location = $d->getTimezone()->getLocation();
        $fromNow = (new \DateTime())->diff($d);
        $title = $d->format('l, F j, Y') . "\n" . self::formatInterval($fromNow) . ' from now' . ($location ? $d->format('I') ? "\nDST On" : "\nDST Off" : '');
        unset($a[Caster::PREFIX_DYNAMIC . 'date'], $a[Caster::PREFIX_DYNAMIC . 'timezone'], $a[Caster::PREFIX_DYNAMIC . 'timezone_type']);
        $a[$prefix . 'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title);
        $stub->class .= $d->format(' @U');
        return $a;
    }
    public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter)
    {
        $now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
        $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp();
        $title = \number_format($numberOfSeconds, 0, '.', ' ') . 's';
        $i = [Caster::PREFIX_VIRTUAL . 'interval' => new ConstStub(self::formatInterval($interval), $title)];
        return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a;
    }
    private static function formatInterval(\DateInterval $i) : string
    {
        $format = '%R ';
        if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) {
            $d = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
            $i = $d->diff($d->add($i));
            $format .= 0 < $i->days ? '%ad ' : '';
        } else {
            $format .= ($i->y ? '%yy ' : '') . ($i->m ? '%mm ' : '') . ($i->d ? '%dd ' : '');
        }
        $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:' . self::formatSeconds($i->s, \substr($i->f, 2)) : '';
        $format = '%R ' === $format ? '0s' : $format;
        return $i->format(\rtrim($format));
    }
    public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter)
    {
        $location = $timeZone->getLocation();
        $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
        $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-' . $location['country_code']) : '';
        $z = [Caster::PREFIX_VIRTUAL . 'timezone' => new ConstStub($formatted, $title)];
        return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a;
    }
    public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter)
    {
        $dates = [];
        foreach (clone $p as $i => $d) {
            if (self::PERIOD_LIMIT === $i) {
                $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
                $dates[] = \sprintf('%s more', ($end = $p->getEndDate()) ? \ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) : $p->recurrences - $i);
                break;
            }
            $dates[] = \sprintf('%s) %s', $i + 1, self::formatDateTime($d));
        }
        $period = \sprintf('every %s, from %s%s %s', self::formatInterval($p->getDateInterval()), $p->include_start_date ? '[' : ']', self::formatDateTime($p->getStartDate()), ($end = $p->getEndDate()) ? 'to ' . self::formatDateTime($end) . (\PHP_VERSION_ID >= 80200 && $p->include_end_date ? ']' : '[') : 'recurring ' . $p->recurrences . ' time/s');
        $p = [Caster::PREFIX_VIRTUAL . 'period' => new ConstStub($period, \implode("\n", $dates))];
        return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a;
    }
    private static function formatDateTime(\DateTimeInterface $d, string $extra = '') : string
    {
        return $d->format('Y-m-d H:i:' . self::formatSeconds($d->format('s'), $d->format('u')) . $extra);
    }
    private static function formatSeconds(string $s, string $us) : string
    {
        return \sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = \rtrim($us, '0'))) ? '0' : ($len <= 3 ? \str_pad($t, 3, '0') : $us));
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class PdoCaster
{
    private const PDO_ATTRIBUTES = ['CASE' => [\PDO::CASE_LOWER => 'LOWER', \PDO::CASE_NATURAL => 'NATURAL', \PDO::CASE_UPPER => 'UPPER'], 'ERRMODE' => [\PDO::ERRMODE_SILENT => 'SILENT', \PDO::ERRMODE_WARNING => 'WARNING', \PDO::ERRMODE_EXCEPTION => 'EXCEPTION'], 'TIMEOUT', 'PREFETCH', 'AUTOCOMMIT', 'PERSISTENT', 'DRIVER_NAME', 'SERVER_INFO', 'ORACLE_NULLS' => [\PDO::NULL_NATURAL => 'NATURAL', \PDO::NULL_EMPTY_STRING => 'EMPTY_STRING', \PDO::NULL_TO_STRING => 'TO_STRING'], 'CLIENT_VERSION', 'SERVER_VERSION', 'STATEMENT_CLASS', 'EMULATE_PREPARES', 'CONNECTION_STATUS', 'STRINGIFY_FETCHES', 'DEFAULT_FETCH_MODE' => [\PDO::FETCH_ASSOC => 'ASSOC', \PDO::FETCH_BOTH => 'BOTH', \PDO::FETCH_LAZY => 'LAZY', \PDO::FETCH_NUM => 'NUM', \PDO::FETCH_OBJ => 'OBJ']];
    public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested)
    {
        $attr = [];
        $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE);
        $c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        foreach (self::PDO_ATTRIBUTES as $k => $v) {
            if (!isset($k[0])) {
                $k = $v;
                $v = [];
            }
            try {
                $attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(\constant('PDO::ATTR_' . $k));
                if ($v && isset($v[$attr[$k]])) {
                    $attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]);
                }
            } catch (\Exception $e) {
            }
        }
        if (isset($attr[$k = 'STATEMENT_CLASS'][1])) {
            if ($attr[$k][1]) {
                $attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]);
            }
            $attr[$k][0] = new ClassStub($attr[$k][0]);
        }
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'inTransaction' => \method_exists($c, 'inTransaction'), $prefix . 'errorInfo' => $c->errorInfo(), $prefix . 'attributes' => new EnumStub($attr)];
        if ($a[$prefix . 'inTransaction']) {
            $a[$prefix . 'inTransaction'] = $c->inTransaction();
        } else {
            unset($a[$prefix . 'inTransaction']);
        }
        if (!isset($a[$prefix . 'errorInfo'][1], $a[$prefix . 'errorInfo'][2])) {
            unset($a[$prefix . 'errorInfo']);
        }
        $c->setAttribute(\PDO::ATTR_ERRMODE, $errmode);
        return $a;
    }
    public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a[$prefix . 'errorInfo'] = $c->errorInfo();
        if (!isset($a[$prefix . 'errorInfo'][1], $a[$prefix . 'errorInfo'][2])) {
            unset($a[$prefix . 'errorInfo']);
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class XmlResourceCaster
{
    private const XML_ERRORS = [\XML_ERROR_NONE => 'XML_ERROR_NONE', \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', \XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', \XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', \XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', \XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', \XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', \XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', \XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', \XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', \XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', \XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', \XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', \XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', \XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', \XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', \XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', \XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', \XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', \XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING'];
    public static function castXml($h, array $a, Stub $stub, bool $isNested)
    {
        $a['current_byte_index'] = \xml_get_current_byte_index($h);
        $a['current_column_number'] = \xml_get_current_column_number($h);
        $a['current_line_number'] = \xml_get_current_line_number($h);
        $a['error_code'] = \xml_get_error_code($h);
        if (isset(self::XML_ERRORS[$a['error_code']])) {
            $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']);
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ResourceCaster
{
    public static function castCurl($h, array $a, Stub $stub, bool $isNested) : array
    {
        return \curl_getinfo($h);
    }
    public static function castDba($dba, array $a, Stub $stub, bool $isNested)
    {
        $list = \dba_list();
        $a['file'] = $list[(int) $dba];
        return $a;
    }
    public static function castProcess($process, array $a, Stub $stub, bool $isNested)
    {
        return \proc_get_status($process);
    }
    public static function castStream($stream, array $a, Stub $stub, bool $isNested)
    {
        $a = \stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
        if ($a['uri'] ?? \false) {
            $a['uri'] = new LinkStub($a['uri']);
        }
        return $a;
    }
    public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested)
    {
        return @\stream_context_get_params($stream) ?: $a;
    }
    public static function castGd($gd, array $a, Stub $stub, bool $isNested)
    {
        $a['size'] = \imagesx($gd) . 'x' . \imagesy($gd);
        $a['trueColor'] = \imageistruecolor($gd);
        return $a;
    }
    public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested)
    {
        $a['host'] = \mysql_get_host_info($h);
        $a['protocol'] = \mysql_get_proto_info($h);
        $a['server'] = \mysql_get_server_info($h);
        return $a;
    }
    public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested)
    {
        $stub->cut = -1;
        $info = \openssl_x509_parse($h, \false);
        $pin = \openssl_pkey_get_public($h);
        $pin = \openssl_pkey_get_details($pin)['key'];
        $pin = \array_slice(\explode("\n", $pin), 1, -2);
        $pin = \base64_decode(\implode('', $pin));
        $pin = \base64_encode(\hash('sha256', $pin, \true));
        $a += ['subject' => new EnumStub(\array_intersect_key($info['subject'], ['organizationName' => \true, 'commonName' => \true])), 'issuer' => new EnumStub(\array_intersect_key($info['issuer'], ['organizationName' => \true, 'commonName' => \true])), 'expiry' => new ConstStub(\date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), 'fingerprint' => new EnumStub(['md5' => new ConstStub(\wordwrap(\strtoupper(\openssl_x509_fingerprint($h, 'md5')), 2, ':', \true)), 'sha1' => new ConstStub(\wordwrap(\strtoupper(\openssl_x509_fingerprint($h, 'sha1')), 2, ':', \true)), 'sha256' => new ConstStub(\wordwrap(\strtoupper(\openssl_x509_fingerprint($h, 'sha256')), 2, ':', \true)), 'pin-sha256' => new ConstStub($pin)])];
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
use Cvphar\Symfony\Component\VarDumper\Exception\ThrowingCasterException;
class ExceptionCaster
{
    public static $srcContext = 1;
    public static $traceArgs = \true;
    public static $errorTypes = [\E_DEPRECATED => 'E_DEPRECATED', \E_USER_DEPRECATED => 'E_USER_DEPRECATED', \E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', \E_ERROR => 'E_ERROR', \E_WARNING => 'E_WARNING', \E_PARSE => 'E_PARSE', \E_NOTICE => 'E_NOTICE', \E_CORE_ERROR => 'E_CORE_ERROR', \E_CORE_WARNING => 'E_CORE_WARNING', \E_COMPILE_ERROR => 'E_COMPILE_ERROR', \E_COMPILE_WARNING => 'E_COMPILE_WARNING', \E_USER_ERROR => 'E_USER_ERROR', \E_USER_WARNING => 'E_USER_WARNING', \E_USER_NOTICE => 'E_USER_NOTICE', \E_STRICT => 'E_STRICT'];
    private static $framesCache = [];
    public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        return self::filterExceptionArray($stub->class, $a, "\x00Error\x00", $filter);
    }
    public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        return self::filterExceptionArray($stub->class, $a, "\x00Exception\x00", $filter);
    }
    public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested)
    {
        if (isset($a[$s = Caster::PREFIX_PROTECTED . 'severity'], self::$errorTypes[$a[$s]])) {
            $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
        }
        return $a;
    }
    public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested)
    {
        $trace = Caster::PREFIX_VIRTUAL . 'trace';
        $prefix = Caster::PREFIX_PROTECTED;
        $xPrefix = "\x00Exception\x00";
        if (isset($a[$xPrefix . 'previous'], $a[$trace]) && $a[$xPrefix . 'previous'] instanceof \Exception) {
            $b = (array) $a[$xPrefix . 'previous'];
            $class = \get_debug_type($a[$xPrefix . 'previous']);
            self::traceUnshift($b[$xPrefix . 'trace'], $class, $b[$prefix . 'file'], $b[$prefix . 'line']);
            $a[$trace] = new TraceStub($b[$xPrefix . 'trace'], \false, 0, -\count($a[$trace]->value));
        }
        unset($a[$xPrefix . 'previous'], $a[$prefix . 'code'], $a[$prefix . 'file'], $a[$prefix . 'line']);
        return $a;
    }
    public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested)
    {
        $sPrefix = "\x00" . SilencedErrorContext::class . "\x00";
        if (!isset($a[$s = $sPrefix . 'severity'])) {
            return $a;
        }
        if (isset(self::$errorTypes[$a[$s]])) {
            $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
        }
        $trace = [['file' => $a[$sPrefix . 'file'], 'line' => $a[$sPrefix . 'line']]];
        if (isset($a[$sPrefix . 'trace'])) {
            $trace = \array_merge($trace, $a[$sPrefix . 'trace']);
        }
        unset($a[$sPrefix . 'file'], $a[$sPrefix . 'line'], $a[$sPrefix . 'trace']);
        $a[Caster::PREFIX_VIRTUAL . 'trace'] = new TraceStub($trace, self::$traceArgs);
        return $a;
    }
    public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested)
    {
        if (!$isNested) {
            return $a;
        }
        $stub->class = '';
        $stub->handle = 0;
        $frames = $trace->value;
        $prefix = Caster::PREFIX_VIRTUAL;
        $a = [];
        $j = \count($frames);
        if (0 > ($i = $trace->sliceOffset)) {
            $i = \max(0, $j + $i);
        }
        if (!isset($trace->value[$i])) {
            return [];
        }
        $lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'] . $frames[$i]['type'] : '') . $frames[$i]['function'] . '()' : '';
        $frames[] = ['function' => ''];
        $collapse = \false;
        for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) {
            $f = $frames[$i];
            $call = isset($f['function']) ? (isset($f['class']) ? $f['class'] . $f['type'] : '') . $f['function'] : '???';
            $frame = new FrameStub(['object' => $f['object'] ?? null, 'class' => $f['class'] ?? null, 'type' => $f['type'] ?? null, 'function' => $f['function'] ?? null] + $frames[$i - 1], \false, \true);
            $f = self::castFrameStub($frame, [], $frame, \true);
            if (isset($f[$prefix . 'src'])) {
                foreach ($f[$prefix . 'src']->value as $label => $frame) {
                    if (\str_starts_with($label, "\x00~collapse=0")) {
                        if ($collapse) {
                            $label = \substr_replace($label, '1', 11, 1);
                        } else {
                            $collapse = \true;
                        }
                    }
                    $label = \substr_replace($label, "title=Stack level {$j}.&", 2, 0);
                }
                $f = $frames[$i - 1];
                if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) {
                    $frame->value['arguments'] = new ArgsStub($f['args'], $f['function'] ?? null, $f['class'] ?? null);
                }
            } elseif ('???' !== $lastCall) {
                $label = new ClassStub($lastCall);
                if (isset($label->attr['ellipsis'])) {
                    $label->attr['ellipsis'] += 2;
                    $label = \substr_replace($prefix, "ellipsis-type=class&ellipsis={$label->attr['ellipsis']}&ellipsis-tail=1&title=Stack level {$j}.", 2, 0) . $label->value . '()';
                } else {
                    $label = \substr_replace($prefix, "title=Stack level {$j}.", 2, 0) . $label->value . '()';
                }
            } else {
                $label = \substr_replace($prefix, "title=Stack level {$j}.", 2, 0) . $lastCall;
            }
            $a[\substr_replace($label, \sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
            $lastCall = $call;
        }
        if (null !== $trace->sliceLength) {
            $a = \array_slice($a, 0, $trace->sliceLength, \true);
        }
        return $a;
    }
    public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested)
    {
        if (!$isNested) {
            return $a;
        }
        $f = $frame->value;
        $prefix = Caster::PREFIX_VIRTUAL;
        if (isset($f['file'], $f['line'])) {
            $cacheKey = $f;
            unset($cacheKey['object'], $cacheKey['args']);
            $cacheKey[] = self::$srcContext;
            $cacheKey = \implode('-', $cacheKey);
            if (isset(self::$framesCache[$cacheKey])) {
                $a[$prefix . 'src'] = self::$framesCache[$cacheKey];
            } else {
                if (\preg_match('/\\((\\d+)\\)(?:\\([\\da-f]{32}\\))? : (?:eval\\(\\)\'d code|runtime-created function)$/', $f['file'], $match)) {
                    $f['file'] = \substr($f['file'], 0, -\strlen($match[0]));
                    $f['line'] = (int) $match[1];
                }
                $src = $f['line'];
                $srcKey = $f['file'];
                $ellipsis = new LinkStub($srcKey, 0);
                $srcAttr = 'collapse=' . (int) $ellipsis->inVendor;
                $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0;
                $ellipsis = $ellipsis->attr['ellipsis'] ?? 0;
                if (\is_file($f['file']) && 0 <= self::$srcContext) {
                    if (!empty($f['class']) && (\is_subclass_of($f['class'], 'Cvphar\\Twig\\Template') || \is_subclass_of($f['class'], 'Cvphar\\Twig_Template')) && \method_exists($f['class'], 'getDebugInfo')) {
                        $template = null;
                        if (isset($f['object'])) {
                            $template = $f['object'];
                        } elseif ((new \ReflectionClass($f['class']))->isInstantiable()) {
                            $template = \unserialize(\sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
                        }
                        if (null !== $template) {
                            $ellipsis = 0;
                            $templateSrc = \method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (\method_exists($template, 'getSource') ? $template->getSource() : '');
                            $templateInfo = $template->getDebugInfo();
                            if (isset($templateInfo[$f['line']])) {
                                if (!\method_exists($template, 'getSourceContext') || !\is_file($templatePath = $template->getSourceContext()->getPath())) {
                                    $templatePath = null;
                                }
                                if ($templateSrc) {
                                    $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f);
                                    $srcKey = ($templatePath ?: $template->getTemplateName()) . ':' . $templateInfo[$f['line']];
                                }
                            }
                        }
                    }
                    if ($srcKey == $f['file']) {
                        $src = self::extractSource(\file_get_contents($f['file']), $f['line'], self::$srcContext, 'php', $f['file'], $f);
                        $srcKey .= ':' . $f['line'];
                        if ($ellipsis) {
                            $ellipsis += 1 + \strlen($f['line']);
                        }
                    }
                    $srcAttr .= \sprintf('&separator= &file=%s&line=%d', \rawurlencode($f['file']), $f['line']);
                } else {
                    $srcAttr .= '&separator=:';
                }
                $srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis=' . $ellipsis . '&ellipsis-tail=' . $ellipsisTail : '';
                self::$framesCache[$cacheKey] = $a[$prefix . 'src'] = new EnumStub(["\x00~{$srcAttr}\x00{$srcKey}" => $src]);
            }
        }
        unset($a[$prefix . 'args'], $a[$prefix . 'line'], $a[$prefix . 'file']);
        if ($frame->inTraceStub) {
            unset($a[$prefix . 'class'], $a[$prefix . 'type'], $a[$prefix . 'function']);
        }
        foreach ($a as $k => $v) {
            if (!$v) {
                unset($a[$k]);
            }
        }
        if ($frame->keepArgs && !empty($f['args'])) {
            $a[$prefix . 'arguments'] = new ArgsStub($f['args'], $f['function'], $f['class']);
        }
        return $a;
    }
    private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter) : array
    {
        if (isset($a[$xPrefix . 'trace'])) {
            $trace = $a[$xPrefix . 'trace'];
            unset($a[$xPrefix . 'trace']);
        } else {
            $trace = [];
        }
        if (!($filter & Caster::EXCLUDE_VERBOSE) && $trace) {
            if (isset($a[Caster::PREFIX_PROTECTED . 'file'], $a[Caster::PREFIX_PROTECTED . 'line'])) {
                self::traceUnshift($trace, $xClass, $a[Caster::PREFIX_PROTECTED . 'file'], $a[Caster::PREFIX_PROTECTED . 'line']);
            }
            $a[Caster::PREFIX_VIRTUAL . 'trace'] = new TraceStub($trace, self::$traceArgs);
        }
        if (empty($a[$xPrefix . 'previous'])) {
            unset($a[$xPrefix . 'previous']);
        }
        unset($a[$xPrefix . 'string'], $a[Caster::PREFIX_DYNAMIC . 'xdebug_message'], $a[Caster::PREFIX_DYNAMIC . '__destructorException']);
        if (isset($a[Caster::PREFIX_PROTECTED . 'message']) && \str_contains($a[Caster::PREFIX_PROTECTED . 'message'], "@anonymous\x00")) {
            $a[Caster::PREFIX_PROTECTED . 'message'] = \preg_replace_callback('/[a-zA-Z_\\x7f-\\xff][\\\\a-zA-Z0-9_\\x7f-\\xff]*+@anonymous\\x00.*?\\.php(?:0x?|:[0-9]++\\$)[0-9a-fA-F]++/', function ($m) {
                return \class_exists($m[0], \false) ? ((\get_parent_class($m[0]) ?: \key(\class_implements($m[0]))) ?: 'class') . '@anonymous' : $m[0];
            }, $a[Caster::PREFIX_PROTECTED . 'message']);
        }
        if (isset($a[Caster::PREFIX_PROTECTED . 'file'], $a[Caster::PREFIX_PROTECTED . 'line'])) {
            $a[Caster::PREFIX_PROTECTED . 'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED . 'file'], $a[Caster::PREFIX_PROTECTED . 'line']);
        }
        return $a;
    }
    private static function traceUnshift(array &$trace, ?string $class, string $file, int $line) : void
    {
        if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) {
            return;
        }
        \array_unshift($trace, ['function' => $class ? 'new ' . $class : null, 'file' => $file, 'line' => $line]);
    }
    private static function extractSource(string $srcLines, int $line, int $srcContext, string $lang, ?string $file, array $frame) : EnumStub
    {
        $srcLines = \explode("\n", $srcLines);
        $src = [];
        for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) {
            $src[] = ($srcLines[$i] ?? '') . "\n";
        }
        if ($frame['function'] ?? \false) {
            $stub = new CutStub(new \stdClass());
            $stub->class = (isset($frame['class']) ? $frame['class'] . $frame['type'] : '') . $frame['function'];
            $stub->type = Stub::TYPE_OBJECT;
            $stub->attr['cut_hash'] = \true;
            $stub->attr['file'] = $frame['file'];
            $stub->attr['line'] = $frame['line'];
            try {
                $caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']);
                $stub->class .= ReflectionCaster::getSignature(ReflectionCaster::castFunctionAbstract($caller, [], $stub, \true, Caster::EXCLUDE_VERBOSE));
                if ($f = $caller->getFileName()) {
                    $stub->attr['file'] = $f;
                    $stub->attr['line'] = $caller->getStartLine();
                }
            } catch (\ReflectionException $e) {
            }
            $srcLines = ["\x00~separator=\x00" => $stub];
        } else {
            $stub = null;
            $srcLines = [];
        }
        $ltrim = 0;
        do {
            $pad = null;
            for ($i = $srcContext << 1; $i >= 0; --$i) {
                if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) {
                    if (null === $pad) {
                        $pad = $c;
                    }
                    if (' ' !== $c && "\t" !== $c || $pad !== $c) {
                        break;
                    }
                }
            }
            ++$ltrim;
        } while (0 > $i && null !== $pad);
        --$ltrim;
        foreach ($src as $i => $c) {
            if ($ltrim) {
                $c = isset($c[$ltrim]) && "\r" !== $c[$ltrim] ? \substr($c, $ltrim) : \ltrim($c, " \t");
            }
            $c = \substr($c, 0, -1);
            if ($i !== $srcContext) {
                $c = new ConstStub('default', $c);
            } else {
                $c = new ConstStub($c, $stub ? 'in ' . $stub->class : '');
                if (null !== $file) {
                    $c->attr['file'] = $file;
                    $c->attr['line'] = $line;
                }
            }
            $c->attr['lang'] = $lang;
            $srcLines[\sprintf("\x00~separator=â€º &%d\x00", $i + $line - $srcContext)] = $c;
        }
        return new EnumStub($srcLines);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Ds\Collection;
use Ds\Map;
use Ds\Pair;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DsCaster
{
    public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested) : array
    {
        $a[Caster::PREFIX_VIRTUAL . 'count'] = $c->count();
        $a[Caster::PREFIX_VIRTUAL . 'capacity'] = $c->capacity();
        if (!$c instanceof Map) {
            $a += $c->toArray();
        }
        return $a;
    }
    public static function castMap(Map $c, array $a, Stub $stub, bool $isNested) : array
    {
        foreach ($c as $k => $v) {
            $a[] = new DsPairStub($k, $v);
        }
        return $a;
    }
    public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested) : array
    {
        foreach ($c->toArray() as $k => $v) {
            $a[Caster::PREFIX_VIRTUAL . $k] = $v;
        }
        return $a;
    }
    public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested) : array
    {
        if ($isNested) {
            $stub->class = Pair::class;
            $stub->value = null;
            $stub->handle = 0;
            $a = $c->value;
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

class LinkStub extends ConstStub
{
    public $inVendor = \false;
    private static $vendorRoots;
    private static $composerRoots;
    public function __construct(string $label, int $line = 0, string $href = null)
    {
        $this->value = $label;
        if (null === $href) {
            $href = $label;
        }
        if (!\is_string($href)) {
            return;
        }
        if (\str_starts_with($href, 'file://')) {
            if ($href === $label) {
                $label = \substr($label, 7);
            }
            $href = \substr($href, 7);
        } elseif (\str_contains($href, '://')) {
            $this->attr['href'] = $href;
            return;
        }
        if (!\is_file($href)) {
            return;
        }
        if ($line) {
            $this->attr['line'] = $line;
        }
        if ($label !== ($this->attr['file'] = \realpath($href) ?: $href)) {
            return;
        }
        if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) {
            $this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1;
            $this->attr['ellipsis-type'] = 'path';
            $this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(\implode('', \array_slice(\explode(\DIRECTORY_SEPARATOR, \substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
        } elseif (3 < \count($ellipsis = \explode(\DIRECTORY_SEPARATOR, $href))) {
            $this->attr['ellipsis'] = 2 + \strlen(\implode('', \array_slice($ellipsis, -2)));
            $this->attr['ellipsis-type'] = 'path';
            $this->attr['ellipsis-tail'] = 1;
        }
    }
    private function getComposerRoot(string $file, bool &$inVendor)
    {
        if (null === self::$vendorRoots) {
            self::$vendorRoots = [];
            foreach (\get_declared_classes() as $class) {
                if ('C' === $class[0] && \str_starts_with($class, 'ComposerAutoloaderInit')) {
                    $r = new \ReflectionClass($class);
                    $v = \dirname($r->getFileName(), 2);
                    if (\is_file($v . '/composer/installed.json')) {
                        self::$vendorRoots[] = $v . \DIRECTORY_SEPARATOR;
                    }
                }
            }
        }
        $inVendor = \false;
        if (isset(self::$composerRoots[$dir = \dirname($file)])) {
            return self::$composerRoots[$dir];
        }
        foreach (self::$vendorRoots as $root) {
            if ($inVendor = \str_starts_with($file, $root)) {
                return $root;
            }
        }
        $parent = $dir;
        while (!@\is_file($parent . '/composer.json')) {
            if (!@\file_exists($parent)) {
                break;
            }
            if ($parent === \dirname($parent)) {
                return self::$composerRoots[$dir] = \false;
            }
            $parent = \dirname($parent);
        }
        return self::$composerRoots[$dir] = $parent . \DIRECTORY_SEPARATOR;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class MemcachedCaster
{
    private static $optionConstants;
    private static $defaultOptions;
    public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'servers' => $c->getServerList(), Caster::PREFIX_VIRTUAL . 'options' => new EnumStub(self::getNonDefaultOptions($c))];
        return $a;
    }
    private static function getNonDefaultOptions(\Memcached $c) : array
    {
        self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
        self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
        $nonDefaultOptions = [];
        foreach (self::$optionConstants as $constantKey => $value) {
            if (self::$defaultOptions[$constantKey] !== ($option = $c->getOption($value))) {
                $nonDefaultOptions[$constantKey] = $option;
            }
        }
        return $nonDefaultOptions;
    }
    private static function discoverDefaultOptions() : array
    {
        $defaultMemcached = new \Memcached();
        $defaultMemcached->addServer('127.0.0.1', 11211);
        $defaultOptions = [];
        self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
        foreach (self::$optionConstants as $constantKey => $value) {
            $defaultOptions[$constantKey] = $defaultMemcached->getOption($value);
        }
        return $defaultOptions;
    }
    private static function getOptionConstants() : array
    {
        $reflectedMemcached = new \ReflectionClass(\Memcached::class);
        $optionConstants = [];
        foreach ($reflectedMemcached->getConstants() as $constantKey => $value) {
            if (\str_starts_with($constantKey, 'OPT_')) {
                $optionConstants[$constantKey] = $value;
            }
        }
        return $optionConstants;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Doctrine\Common\Proxy\Proxy as CommonProxy;
use Cvphar\Doctrine\ORM\PersistentCollection;
use Cvphar\Doctrine\ORM\Proxy\Proxy as OrmProxy;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DoctrineCaster
{
    public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested)
    {
        foreach (['__cloner__', '__initializer__'] as $k) {
            if (\array_key_exists($k, $a)) {
                unset($a[$k]);
                ++$stub->cut;
            }
        }
        return $a;
    }
    public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested)
    {
        foreach (['_entityPersister', '_identifier'] as $k) {
            if (\array_key_exists($k = "\x00Doctrine\\ORM\\Proxy\\Proxy\x00" . $k, $a)) {
                unset($a[$k]);
                ++$stub->cut;
            }
        }
        return $a;
    }
    public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested)
    {
        foreach (['snapshot', 'association', 'typeClass'] as $k) {
            if (\array_key_exists($k = "\x00Doctrine\\ORM\\PersistentCollection\x00" . $k, $a)) {
                $a[$k] = new CutStub($a[$k]);
            }
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use RdKafka\Conf;
use RdKafka\Exception as RdKafkaException;
use RdKafka\KafkaConsumer;
use RdKafka\Message;
use RdKafka\Metadata\Broker as BrokerMetadata;
use RdKafka\Metadata\Collection as CollectionMetadata;
use RdKafka\Metadata\Partition as PartitionMetadata;
use RdKafka\Metadata\Topic as TopicMetadata;
use RdKafka\Topic;
use RdKafka\TopicConf;
use RdKafka\TopicPartition;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class RdKafkaCaster
{
    public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        try {
            $assignment = $c->getAssignment();
        } catch (RdKafkaException $e) {
            $assignment = [];
        }
        $a += [$prefix . 'subscription' => $c->getSubscription(), $prefix . 'assignment' => $assignment];
        $a += self::extractMetadata($c);
        return $a;
    }
    public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'name' => $c->getName()];
        return $a;
    }
    public static function castTopicPartition(TopicPartition $c, array $a)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'offset' => $c->getOffset(), $prefix . 'partition' => $c->getPartition(), $prefix . 'topic' => $c->getTopic()];
        return $a;
    }
    public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'errstr' => $c->errstr()];
        return $a;
    }
    public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        foreach ($c->dump() as $key => $value) {
            $a[$prefix . $key] = $value;
        }
        return $a;
    }
    public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        foreach ($c->dump() as $key => $value) {
            $a[$prefix . $key] = $value;
        }
        return $a;
    }
    public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'out_q_len' => $c->getOutQLen()];
        $a += self::extractMetadata($c);
        return $a;
    }
    public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested)
    {
        $a += \iterator_to_array($c);
        return $a;
    }
    public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'name' => $c->getTopic(), $prefix . 'partitions' => $c->getPartitions()];
        return $a;
    }
    public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'id' => $c->getId(), $prefix . 'err' => $c->getErr(), $prefix . 'leader' => $c->getLeader()];
        return $a;
    }
    public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'id' => $c->getId(), $prefix . 'host' => $c->getHost(), $prefix . 'port' => $c->getPort()];
        return $a;
    }
    private static function extractMetadata($c)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        try {
            $m = $c->getMetadata(\true, null, 500);
        } catch (RdKafkaException $e) {
            return [];
        }
        return [$prefix . 'orig_broker_id' => $m->getOrigBrokerId(), $prefix . 'orig_broker_name' => $m->getOrigBrokerName(), $prefix . 'brokers' => $m->getBrokers(), $prefix . 'topics' => $m->getTopics()];
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
final class MysqliCaster
{
    public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested) : array
    {
        foreach ($a as $k => $v) {
            if (isset($c->{$k})) {
                $a[$k] = $c->{$k};
            }
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

class ImgStub extends ConstStub
{
    public function __construct(string $data, string $contentType, string $size = '')
    {
        $this->value = '';
        $this->attr['img-data'] = $data;
        $this->attr['img-size'] = $size;
        $this->attr['content-type'] = $contentType;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ClassStub extends ConstStub
{
    public function __construct(string $identifier, $callable = null)
    {
        $this->value = $identifier;
        try {
            if (null !== $callable) {
                if ($callable instanceof \Closure) {
                    $r = new \ReflectionFunction($callable);
                } elseif (\is_object($callable)) {
                    $r = [$callable, '__invoke'];
                } elseif (\is_array($callable)) {
                    $r = $callable;
                } elseif (\false !== ($i = \strpos($callable, '::'))) {
                    $r = [\substr($callable, 0, $i), \substr($callable, 2 + $i)];
                } else {
                    $r = new \ReflectionFunction($callable);
                }
            } elseif (0 < ($i = \strpos($identifier, '::') ?: \strpos($identifier, '->'))) {
                $r = [\substr($identifier, 0, $i), \substr($identifier, 2 + $i)];
            } else {
                $r = new \ReflectionClass($identifier);
            }
            if (\is_array($r)) {
                try {
                    $r = new \ReflectionMethod($r[0], $r[1]);
                } catch (\ReflectionException $e) {
                    $r = new \ReflectionClass($r[0]);
                }
            }
            if (\str_contains($identifier, "@anonymous\x00")) {
                $this->value = $identifier = \preg_replace_callback('/[a-zA-Z_\\x7f-\\xff][\\\\a-zA-Z0-9_\\x7f-\\xff]*+@anonymous\\x00.*?\\.php(?:0x?|:[0-9]++\\$)[0-9a-fA-F]++/', function ($m) {
                    return \class_exists($m[0], \false) ? ((\get_parent_class($m[0]) ?: \key(\class_implements($m[0]))) ?: 'class') . '@anonymous' : $m[0];
                }, $identifier);
            }
            if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
                $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), \true, Caster::EXCLUDE_VERBOSE);
                $s = ReflectionCaster::getSignature($s);
                if (\str_ends_with($identifier, '()')) {
                    $this->value = \substr_replace($identifier, $s, -2);
                } else {
                    $this->value .= $s;
                }
            }
        } catch (\ReflectionException $e) {
            return;
        } finally {
            if (0 < ($i = \strrpos($this->value, '\\'))) {
                $this->attr['ellipsis'] = \strlen($this->value) - $i;
                $this->attr['ellipsis-type'] = 'class';
                $this->attr['ellipsis-tail'] = 1;
            }
        }
        if ($f = $r->getFileName()) {
            $this->attr['file'] = $f;
            $this->attr['line'] = $r->getStartLine();
        }
    }
    public static function wrapCallable($callable)
    {
        if (\is_object($callable) || !\is_callable($callable)) {
            return $callable;
        }
        if (!\is_array($callable)) {
            $callable = new static($callable, $callable);
        } elseif (\is_string($callable[0])) {
            $callable[0] = new static($callable[0], $callable);
        } else {
            $callable[1] = new static($callable[1], $callable);
        }
        return $callable;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class TraceStub extends Stub
{
    public $keepArgs;
    public $sliceOffset;
    public $sliceLength;
    public $numberingOffset;
    public function __construct(array $trace, bool $keepArgs = \true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0)
    {
        $this->value = $trace;
        $this->keepArgs = $keepArgs;
        $this->sliceOffset = $sliceOffset;
        $this->sliceLength = $sliceLength;
        $this->numberingOffset = $numberingOffset;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

class CutArrayStub extends CutStub
{
    public $preservedSubset;
    public function __construct(array $value, array $preservedKeys)
    {
        parent::__construct($value);
        $this->preservedSubset = \array_intersect_key($value, \array_flip($preservedKeys));
        $this->cut -= \count($this->preservedSubset);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class PgSqlCaster
{
    private const PARAM_CODES = ['server_encoding', 'client_encoding', 'is_superuser', 'session_authorization', 'DateStyle', 'TimeZone', 'IntervalStyle', 'integer_datetimes', 'application_name', 'standard_conforming_strings'];
    private const TRANSACTION_STATUS = [\PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE', \PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE', \PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS', \PGSQL_TRANSACTION_INERROR => 'PGSQL_TRANSACTION_INERROR', \PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN'];
    private const RESULT_STATUS = [\PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY', \PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK', \PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK', \PGSQL_COPY_OUT => 'PGSQL_COPY_OUT', \PGSQL_COPY_IN => 'PGSQL_COPY_IN', \PGSQL_BAD_RESPONSE => 'PGSQL_BAD_RESPONSE', \PGSQL_NONFATAL_ERROR => 'PGSQL_NONFATAL_ERROR', \PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR'];
    private const DIAG_CODES = ['severity' => \PGSQL_DIAG_SEVERITY, 'sqlstate' => \PGSQL_DIAG_SQLSTATE, 'message' => \PGSQL_DIAG_MESSAGE_PRIMARY, 'detail' => \PGSQL_DIAG_MESSAGE_DETAIL, 'hint' => \PGSQL_DIAG_MESSAGE_HINT, 'statement position' => \PGSQL_DIAG_STATEMENT_POSITION, 'internal position' => \PGSQL_DIAG_INTERNAL_POSITION, 'internal query' => \PGSQL_DIAG_INTERNAL_QUERY, 'context' => \PGSQL_DIAG_CONTEXT, 'file' => \PGSQL_DIAG_SOURCE_FILE, 'line' => \PGSQL_DIAG_SOURCE_LINE, 'function' => \PGSQL_DIAG_SOURCE_FUNCTION];
    public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested)
    {
        $a['seek position'] = \pg_lo_tell($lo);
        return $a;
    }
    public static function castLink($link, array $a, Stub $stub, bool $isNested)
    {
        $a['status'] = \pg_connection_status($link);
        $a['status'] = new ConstStub(\PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']);
        $a['busy'] = \pg_connection_busy($link);
        $a['transaction'] = \pg_transaction_status($link);
        if (isset(self::TRANSACTION_STATUS[$a['transaction']])) {
            $a['transaction'] = new ConstStub(self::TRANSACTION_STATUS[$a['transaction']], $a['transaction']);
        }
        $a['pid'] = \pg_get_pid($link);
        $a['last error'] = \pg_last_error($link);
        $a['last notice'] = \pg_last_notice($link);
        $a['host'] = \pg_host($link);
        $a['port'] = \pg_port($link);
        $a['dbname'] = \pg_dbname($link);
        $a['options'] = \pg_options($link);
        $a['version'] = \pg_version($link);
        foreach (self::PARAM_CODES as $v) {
            if (\false !== ($s = \pg_parameter_status($link, $v))) {
                $a['param'][$v] = $s;
            }
        }
        $a['param']['client_encoding'] = \pg_client_encoding($link);
        $a['param'] = new EnumStub($a['param']);
        return $a;
    }
    public static function castResult($result, array $a, Stub $stub, bool $isNested)
    {
        $a['num rows'] = \pg_num_rows($result);
        $a['status'] = \pg_result_status($result);
        if (isset(self::RESULT_STATUS[$a['status']])) {
            $a['status'] = new ConstStub(self::RESULT_STATUS[$a['status']], $a['status']);
        }
        $a['command-completion tag'] = \pg_result_status($result, \PGSQL_STATUS_STRING);
        if (-1 === $a['num rows']) {
            foreach (self::DIAG_CODES as $k => $v) {
                $a['error'][$k] = \pg_result_error_field($result, $v);
            }
        }
        $a['affected rows'] = \pg_affected_rows($result);
        $a['last OID'] = \pg_last_oid($result);
        $fields = \pg_num_fields($result);
        for ($i = 0; $i < $fields; ++$i) {
            $field = ['name' => \pg_field_name($result, $i), 'table' => \sprintf('%s (OID: %s)', \pg_field_table($result, $i), \pg_field_table($result, $i, \true)), 'type' => \sprintf('%s (OID: %s)', \pg_field_type($result, $i), \pg_field_type_oid($result, $i)), 'nullable' => (bool) \pg_field_is_null($result, $i), 'storage' => \pg_field_size($result, $i) . ' bytes', 'display' => \pg_field_prtlen($result, $i) . ' chars'];
            if (' (OID: )' === $field['table']) {
                $field['table'] = null;
            }
            if ('-1 bytes' === $field['storage']) {
                $field['storage'] = 'variable size';
            } elseif ('1 bytes' === $field['storage']) {
                $field['storage'] = '1 byte';
            }
            if ('1 chars' === $field['display']) {
                $field['display'] = '1 char';
            }
            $a['fields'][] = new EnumStub($field);
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class Caster
{
    public const EXCLUDE_VERBOSE = 1;
    public const EXCLUDE_VIRTUAL = 2;
    public const EXCLUDE_DYNAMIC = 4;
    public const EXCLUDE_PUBLIC = 8;
    public const EXCLUDE_PROTECTED = 16;
    public const EXCLUDE_PRIVATE = 32;
    public const EXCLUDE_NULL = 64;
    public const EXCLUDE_EMPTY = 128;
    public const EXCLUDE_NOT_IMPORTANT = 256;
    public const EXCLUDE_STRICT = 512;
    public const PREFIX_VIRTUAL = "\x00~\x00";
    public const PREFIX_DYNAMIC = "\x00+\x00";
    public const PREFIX_PROTECTED = "\x00*\x00";
    public static function castObject(object $obj, string $class, bool $hasDebugInfo = \false, string $debugClass = null) : array
    {
        if ($hasDebugInfo) {
            try {
                $debugInfo = $obj->__debugInfo();
            } catch (\Throwable $e) {
                $hasDebugInfo = \false;
            }
        }
        $a = $obj instanceof \Closure ? [] : (array) $obj;
        if ($obj instanceof \__PHP_Incomplete_Class) {
            return $a;
        }
        if ($a) {
            static $publicProperties = [];
            $debugClass = $debugClass ?? \get_debug_type($obj);
            $i = 0;
            $prefixedKeys = [];
            foreach ($a as $k => $v) {
                if ("\x00" !== ($k[0] ?? '')) {
                    if (!isset($publicProperties[$class])) {
                        foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
                            $publicProperties[$class][$prop->name] = \true;
                        }
                    }
                    if (!isset($publicProperties[$class][$k])) {
                        $prefixedKeys[$i] = self::PREFIX_DYNAMIC . $k;
                    }
                } elseif ($debugClass !== $class && 1 === \strpos($k, $class)) {
                    $prefixedKeys[$i] = "\x00" . $debugClass . \strrchr($k, "\x00");
                }
                ++$i;
            }
            if ($prefixedKeys) {
                $keys = \array_keys($a);
                foreach ($prefixedKeys as $i => $k) {
                    $keys[$i] = $k;
                }
                $a = \array_combine($keys, $a);
            }
        }
        if ($hasDebugInfo && \is_array($debugInfo)) {
            foreach ($debugInfo as $k => $v) {
                if (!isset($k[0]) || "\x00" !== $k[0]) {
                    if (\array_key_exists(self::PREFIX_DYNAMIC . $k, $a)) {
                        continue;
                    }
                    $k = self::PREFIX_VIRTUAL . $k;
                }
                unset($a[$k]);
                $a[$k] = $v;
            }
        }
        return $a;
    }
    public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0) : array
    {
        $count = 0;
        foreach ($a as $k => $v) {
            $type = self::EXCLUDE_STRICT & $filter;
            if (null === $v) {
                $type |= self::EXCLUDE_NULL & $filter;
                $type |= self::EXCLUDE_EMPTY & $filter;
            } elseif (\false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
                $type |= self::EXCLUDE_EMPTY & $filter;
            }
            if (self::EXCLUDE_NOT_IMPORTANT & $filter && !\in_array($k, $listedProperties, \true)) {
                $type |= self::EXCLUDE_NOT_IMPORTANT;
            }
            if (self::EXCLUDE_VERBOSE & $filter && \in_array($k, $listedProperties, \true)) {
                $type |= self::EXCLUDE_VERBOSE;
            }
            if (!isset($k[1]) || "\x00" !== $k[0]) {
                $type |= self::EXCLUDE_PUBLIC & $filter;
            } elseif ('~' === $k[1]) {
                $type |= self::EXCLUDE_VIRTUAL & $filter;
            } elseif ('+' === $k[1]) {
                $type |= self::EXCLUDE_DYNAMIC & $filter;
            } elseif ('*' === $k[1]) {
                $type |= self::EXCLUDE_PROTECTED & $filter;
            } else {
                $type |= self::EXCLUDE_PRIVATE & $filter;
            }
            if (self::EXCLUDE_STRICT & $filter ? $type === $filter : $type) {
                unset($a[$k]);
                ++$count;
            }
        }
        return $a;
    }
    public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested) : array
    {
        if (isset($a['__PHP_Incomplete_Class_Name'])) {
            $stub->class .= '(' . $a['__PHP_Incomplete_Class_Name'] . ')';
            unset($a['__PHP_Incomplete_Class_Name']);
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class SplCaster
{
    private const SPL_FILE_OBJECT_FLAGS = [\SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE', \SplFileObject::READ_AHEAD => 'READ_AHEAD', \SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY', \SplFileObject::READ_CSV => 'READ_CSV'];
    public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested)
    {
        return self::castSplArray($c, $a, $stub, $isNested);
    }
    public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested)
    {
        return self::castSplArray($c, $a, $stub, $isNested);
    }
    public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'heap' => \iterator_to_array(clone $c)];
        return $a;
    }
    public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $mode = $c->getIteratorMode();
        $c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE);
        $a += [$prefix . 'mode' => new ConstStub(($mode & \SplDoublyLinkedList::IT_MODE_LIFO ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO') . ' | ' . ($mode & \SplDoublyLinkedList::IT_MODE_DELETE ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode), $prefix . 'dllist' => \iterator_to_array($c)];
        $c->setIteratorMode($mode);
        return $a;
    }
    public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested)
    {
        static $map = ['path' => 'getPath', 'filename' => 'getFilename', 'basename' => 'getBasename', 'pathname' => 'getPathname', 'extension' => 'getExtension', 'realPath' => 'getRealPath', 'aTime' => 'getATime', 'mTime' => 'getMTime', 'cTime' => 'getCTime', 'inode' => 'getInode', 'size' => 'getSize', 'perms' => 'getPerms', 'owner' => 'getOwner', 'group' => 'getGroup', 'type' => 'getType', 'writable' => 'isWritable', 'readable' => 'isReadable', 'executable' => 'isExecutable', 'file' => 'isFile', 'dir' => 'isDir', 'link' => 'isLink', 'linkTarget' => 'getLinkTarget'];
        $prefix = Caster::PREFIX_VIRTUAL;
        unset($a["\x00SplFileInfo\x00fileName"]);
        unset($a["\x00SplFileInfo\x00pathName"]);
        if (\PHP_VERSION_ID < 80000) {
            if (\false === $c->getPathname()) {
                $a[$prefix . 'âš '] = 'The parent constructor was not called: the object is in an invalid state';
                return $a;
            }
        } else {
            try {
                $c->isReadable();
            } catch (\RuntimeException $e) {
                if ('Object not initialized' !== $e->getMessage()) {
                    throw $e;
                }
                $a[$prefix . 'âš '] = 'The parent constructor was not called: the object is in an invalid state';
                return $a;
            } catch (\Error $e) {
                if ('Object not initialized' !== $e->getMessage()) {
                    throw $e;
                }
                $a[$prefix . 'âš '] = 'The parent constructor was not called: the object is in an invalid state';
                return $a;
            }
        }
        foreach ($map as $key => $accessor) {
            try {
                $a[$prefix . $key] = $c->{$accessor}();
            } catch (\Exception $e) {
            }
        }
        if ($a[$prefix . 'realPath'] ?? \false) {
            $a[$prefix . 'realPath'] = new LinkStub($a[$prefix . 'realPath']);
        }
        if (isset($a[$prefix . 'perms'])) {
            $a[$prefix . 'perms'] = new ConstStub(\sprintf('0%o', $a[$prefix . 'perms']), $a[$prefix . 'perms']);
        }
        static $mapDate = ['aTime', 'mTime', 'cTime'];
        foreach ($mapDate as $key) {
            if (isset($a[$prefix . $key])) {
                $a[$prefix . $key] = new ConstStub(\date('Y-m-d H:i:s', $a[$prefix . $key]), $a[$prefix . $key]);
            }
        }
        return $a;
    }
    public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested)
    {
        static $map = ['csvControl' => 'getCsvControl', 'flags' => 'getFlags', 'maxLineLen' => 'getMaxLineLen', 'fstat' => 'fstat', 'eof' => 'eof', 'key' => 'key'];
        $prefix = Caster::PREFIX_VIRTUAL;
        foreach ($map as $key => $accessor) {
            try {
                $a[$prefix . $key] = $c->{$accessor}();
            } catch (\Exception $e) {
            }
        }
        if (isset($a[$prefix . 'flags'])) {
            $flagsArray = [];
            foreach (self::SPL_FILE_OBJECT_FLAGS as $value => $name) {
                if ($a[$prefix . 'flags'] & $value) {
                    $flagsArray[] = $name;
                }
            }
            $a[$prefix . 'flags'] = new ConstStub(\implode('|', $flagsArray), $a[$prefix . 'flags']);
        }
        if (isset($a[$prefix . 'fstat'])) {
            $a[$prefix . 'fstat'] = new CutArrayStub($a[$prefix . 'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']);
        }
        return $a;
    }
    public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested)
    {
        $storage = [];
        unset($a[Caster::PREFIX_DYNAMIC . "\x00gcdata"]);
        unset($a["\x00SplObjectStorage\x00storage"]);
        $clone = clone $c;
        foreach ($clone as $obj) {
            $storage[] = ['object' => $obj, 'info' => $clone->getInfo()];
        }
        $a += [Caster::PREFIX_VIRTUAL . 'storage' => $storage];
        return $a;
    }
    public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'innerIterator'] = $c->getInnerIterator();
        return $a;
    }
    public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested)
    {
        $a[Caster::PREFIX_VIRTUAL . 'object'] = $c->get();
        return $a;
    }
    private static function castSplArray($c, array $a, Stub $stub, bool $isNested) : array
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $flags = $c->getFlags();
        if (!($flags & \ArrayObject::STD_PROP_LIST)) {
            $c->setFlags(\ArrayObject::STD_PROP_LIST);
            $a = Caster::castObject($c, \get_class($c), \method_exists($c, '__debugInfo'), $stub->class);
            $c->setFlags($flags);
        }
        if (\PHP_VERSION_ID < 70400) {
            $a[$prefix . 'storage'] = $c->getArrayCopy();
        }
        $a += [$prefix . 'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), $prefix . 'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS)];
        if ($c instanceof \ArrayObject) {
            $a[$prefix . 'iteratorClass'] = new ClassStub($c->getIteratorClass());
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ConstStub extends Stub
{
    public function __construct(string $name, $value = null)
    {
        $this->class = $name;
        $this->value = 1 < \func_num_args() ? $value : $name;
    }
    public function __toString()
    {
        return (string) $this->value;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DsPairStub extends Stub
{
    public function __construct($key, $value)
    {
        $this->value = [Caster::PREFIX_VIRTUAL . 'key' => $key, Caster::PREFIX_VIRTUAL . 'value' => $value];
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class IntlCaster
{
    public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'locale' => $c->getLocale(), Caster::PREFIX_VIRTUAL . 'pattern' => $c->getPattern()];
        return self::castError($c, $a);
    }
    public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'locale' => $c->getLocale(), Caster::PREFIX_VIRTUAL . 'pattern' => $c->getPattern()];
        if ($filter & Caster::EXCLUDE_VERBOSE) {
            $stub->cut += 3;
            return self::castError($c, $a);
        }
        $a += [Caster::PREFIX_VIRTUAL . 'attributes' => new EnumStub(['PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY), 'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED), 'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN), 'MAX_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS), 'MIN_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_INTEGER_DIGITS), 'INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::INTEGER_DIGITS), 'MAX_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_FRACTION_DIGITS), 'MIN_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_FRACTION_DIGITS), 'FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::FRACTION_DIGITS), 'MULTIPLIER' => $c->getAttribute(\NumberFormatter::MULTIPLIER), 'GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::GROUPING_SIZE), 'ROUNDING_MODE' => $c->getAttribute(\NumberFormatter::ROUNDING_MODE), 'ROUNDING_INCREMENT' => $c->getAttribute(\NumberFormatter::ROUNDING_INCREMENT), 'FORMAT_WIDTH' => $c->getAttribute(\NumberFormatter::FORMAT_WIDTH), 'PADDING_POSITION' => $c->getAttribute(\NumberFormatter::PADDING_POSITION), 'SECONDARY_GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::SECONDARY_GROUPING_SIZE), 'SIGNIFICANT_DIGITS_USED' => $c->getAttribute(\NumberFormatter::SIGNIFICANT_DIGITS_USED), 'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS), 'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS), 'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE)]), Caster::PREFIX_VIRTUAL . 'text_attributes' => new EnumStub(['POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX), 'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX), 'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX), 'NEGATIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_SUFFIX), 'PADDING_CHARACTER' => $c->getTextAttribute(\NumberFormatter::PADDING_CHARACTER), 'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE), 'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET), 'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS)]), Caster::PREFIX_VIRTUAL . 'symbols' => new EnumStub(['DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL), 'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL), 'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL), 'PERCENT_SYMBOL' => $c->getSymbol(\NumberFormatter::PERCENT_SYMBOL), 'ZERO_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::ZERO_DIGIT_SYMBOL), 'DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::DIGIT_SYMBOL), 'MINUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::MINUS_SIGN_SYMBOL), 'PLUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::PLUS_SIGN_SYMBOL), 'CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::CURRENCY_SYMBOL), 'INTL_CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL), 'MONETARY_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_SEPARATOR_SYMBOL), 'EXPONENTIAL_SYMBOL' => $c->getSymbol(\NumberFormatter::EXPONENTIAL_SYMBOL), 'PERMILL_SYMBOL' => $c->getSymbol(\NumberFormatter::PERMILL_SYMBOL), 'PAD_ESCAPE_SYMBOL' => $c->getSymbol(\NumberFormatter::PAD_ESCAPE_SYMBOL), 'INFINITY_SYMBOL' => $c->getSymbol(\NumberFormatter::INFINITY_SYMBOL), 'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL), 'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL), 'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL)])];
        return self::castError($c, $a);
    }
    public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'display_name' => $c->getDisplayName(), Caster::PREFIX_VIRTUAL . 'id' => $c->getID(), Caster::PREFIX_VIRTUAL . 'raw_offset' => $c->getRawOffset()];
        if ($c->useDaylightTime()) {
            $a += [Caster::PREFIX_VIRTUAL . 'dst_savings' => $c->getDSTSavings()];
        }
        return self::castError($c, $a);
    }
    public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'type' => $c->getType(), Caster::PREFIX_VIRTUAL . 'first_day_of_week' => $c->getFirstDayOfWeek(), Caster::PREFIX_VIRTUAL . 'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(), Caster::PREFIX_VIRTUAL . 'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(), Caster::PREFIX_VIRTUAL . 'skipped_wall_time_option' => $c->getSkippedWallTimeOption(), Caster::PREFIX_VIRTUAL . 'time' => $c->getTime(), Caster::PREFIX_VIRTUAL . 'in_daylight_time' => $c->inDaylightTime(), Caster::PREFIX_VIRTUAL . 'is_lenient' => $c->isLenient(), Caster::PREFIX_VIRTUAL . 'time_zone' => $filter & Caster::EXCLUDE_VERBOSE ? new CutStub($c->getTimeZone()) : $c->getTimeZone()];
        return self::castError($c, $a);
    }
    public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'locale' => $c->getLocale(), Caster::PREFIX_VIRTUAL . 'pattern' => $c->getPattern(), Caster::PREFIX_VIRTUAL . 'calendar' => $c->getCalendar(), Caster::PREFIX_VIRTUAL . 'time_zone_id' => $c->getTimeZoneId(), Caster::PREFIX_VIRTUAL . 'time_type' => $c->getTimeType(), Caster::PREFIX_VIRTUAL . 'date_type' => $c->getDateType(), Caster::PREFIX_VIRTUAL . 'calendar_object' => $filter & Caster::EXCLUDE_VERBOSE ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(), Caster::PREFIX_VIRTUAL . 'time_zone' => $filter & Caster::EXCLUDE_VERBOSE ? new CutStub($c->getTimeZone()) : $c->getTimeZone()];
        return self::castError($c, $a);
    }
    private static function castError(object $c, array $a) : array
    {
        if ($errorCode = $c->getErrorCode()) {
            $a += [Caster::PREFIX_VIRTUAL . 'error_code' => $errorCode, Caster::PREFIX_VIRTUAL . 'error_message' => $c->getErrorMessage()];
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class RedisCaster
{
    private const SERIALIZERS = [\Redis::SERIALIZER_NONE => 'NONE', \Redis::SERIALIZER_PHP => 'PHP', 2 => 'IGBINARY'];
    private const MODES = [\Redis::ATOMIC => 'ATOMIC', \Redis::MULTI => 'MULTI', \Redis::PIPELINE => 'PIPELINE'];
    private const COMPRESSION_MODES = [0 => 'NONE', 1 => 'LZF'];
    private const FAILOVER_OPTIONS = [\RedisCluster::FAILOVER_NONE => 'NONE', \RedisCluster::FAILOVER_ERROR => 'ERROR', \RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE', \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES'];
    public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        if (!($connected = $c->isConnected())) {
            return $a + [$prefix . 'isConnected' => $connected];
        }
        $mode = $c->getMode();
        return $a + [$prefix . 'isConnected' => $connected, $prefix . 'host' => $c->getHost(), $prefix . 'port' => $c->getPort(), $prefix . 'auth' => $c->getAuth(), $prefix . 'mode' => isset(self::MODES[$mode]) ? new ConstStub(self::MODES[$mode], $mode) : $mode, $prefix . 'dbNum' => $c->getDbNum(), $prefix . 'timeout' => $c->getTimeout(), $prefix . 'lastError' => $c->getLastError(), $prefix . 'persistentId' => $c->getPersistentID(), $prefix . 'options' => self::getRedisOptions($c)];
    }
    public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        return $a + [$prefix . 'hosts' => $c->_hosts(), $prefix . 'function' => ClassStub::wrapCallable($c->_function()), $prefix . 'lastError' => $c->getLastError(), $prefix . 'options' => self::getRedisOptions($c)];
    }
    public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER);
        $a += [$prefix . '_masters' => $c->_masters(), $prefix . '_redir' => $c->_redir(), $prefix . 'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()), $prefix . 'lastError' => $c->getLastError(), $prefix . 'options' => self::getRedisOptions($c, ['SLAVE_FAILOVER' => isset(self::FAILOVER_OPTIONS[$failover]) ? new ConstStub(self::FAILOVER_OPTIONS[$failover], $failover) : $failover])];
        return $a;
    }
    private static function getRedisOptions($redis, array $options = []) : EnumStub
    {
        $serializer = $redis->getOption(\Redis::OPT_SERIALIZER);
        if (\is_array($serializer)) {
            foreach ($serializer as &$v) {
                if (isset(self::SERIALIZERS[$v])) {
                    $v = new ConstStub(self::SERIALIZERS[$v], $v);
                }
            }
        } elseif (isset(self::SERIALIZERS[$serializer])) {
            $serializer = new ConstStub(self::SERIALIZERS[$serializer], $serializer);
        }
        $compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0;
        if (\is_array($compression)) {
            foreach ($compression as &$v) {
                if (isset(self::COMPRESSION_MODES[$v])) {
                    $v = new ConstStub(self::COMPRESSION_MODES[$v], $v);
                }
            }
        } elseif (isset(self::COMPRESSION_MODES[$compression])) {
            $compression = new ConstStub(self::COMPRESSION_MODES[$compression], $compression);
        }
        $retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0;
        if (\is_array($retry)) {
            foreach ($retry as &$v) {
                $v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v);
            }
        } else {
            $retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry);
        }
        $options += ['TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0, 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT), 'COMPRESSION' => $compression, 'SERIALIZER' => $serializer, 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX), 'SCAN' => $retry];
        return new EnumStub($options);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
final class FiberCaster
{
    public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        if ($fiber->isTerminated()) {
            $status = 'terminated';
        } elseif ($fiber->isRunning()) {
            $status = 'running';
        } elseif ($fiber->isSuspended()) {
            $status = 'suspended';
        } elseif ($fiber->isStarted()) {
            $status = 'started';
        } else {
            $status = 'not started';
        }
        $a[$prefix . 'status'] = $status;
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Imagine\Image\ImageInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
final class ImagineCaster
{
    public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested) : array
    {
        $imgData = $c->get('png');
        if (\strlen($imgData) > 1 * 1000 * 1000) {
            $a += [Caster::PREFIX_VIRTUAL . 'image' => new ConstStub($c->getSize())];
        } else {
            $a += [Caster::PREFIX_VIRTUAL . 'image' => new ImgStub($imgData, 'image/png', $c->getSize())];
        }
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class AmqpCaster
{
    private const FLAGS = [\AMQP_DURABLE => 'AMQP_DURABLE', \AMQP_PASSIVE => 'AMQP_PASSIVE', \AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE', \AMQP_AUTODELETE => 'AMQP_AUTODELETE', \AMQP_INTERNAL => 'AMQP_INTERNAL', \AMQP_NOLOCAL => 'AMQP_NOLOCAL', \AMQP_AUTOACK => 'AMQP_AUTOACK', \AMQP_IFEMPTY => 'AMQP_IFEMPTY', \AMQP_IFUNUSED => 'AMQP_IFUNUSED', \AMQP_MANDATORY => 'AMQP_MANDATORY', \AMQP_IMMEDIATE => 'AMQP_IMMEDIATE', \AMQP_MULTIPLE => 'AMQP_MULTIPLE', \AMQP_NOWAIT => 'AMQP_NOWAIT', \AMQP_REQUEUE => 'AMQP_REQUEUE'];
    private const EXCHANGE_TYPES = [\AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT', \AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT', \AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC', \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS'];
    public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'is_connected' => $c->isConnected()];
        if (isset($a["\x00AMQPConnection\x00login"])) {
            return $a;
        }
        if (\method_exists($c, 'getReadTimeout')) {
            $timeout = $c->getReadTimeout();
        } else {
            $timeout = $c->getTimeout();
        }
        $a += [$prefix . 'is_connected' => $c->isConnected(), $prefix . 'login' => $c->getLogin(), $prefix . 'password' => $c->getPassword(), $prefix . 'host' => $c->getHost(), $prefix . 'vhost' => $c->getVhost(), $prefix . 'port' => $c->getPort(), $prefix . 'read_timeout' => $timeout];
        return $a;
    }
    public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'is_connected' => $c->isConnected(), $prefix . 'channel_id' => $c->getChannelId()];
        if (isset($a["\x00AMQPChannel\x00connection"])) {
            return $a;
        }
        $a += [$prefix . 'connection' => $c->getConnection(), $prefix . 'prefetch_size' => $c->getPrefetchSize(), $prefix . 'prefetch_count' => $c->getPrefetchCount()];
        return $a;
    }
    public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'flags' => self::extractFlags($c->getFlags())];
        if (isset($a["\x00AMQPQueue\x00name"])) {
            return $a;
        }
        $a += [$prefix . 'connection' => $c->getConnection(), $prefix . 'channel' => $c->getChannel(), $prefix . 'name' => $c->getName(), $prefix . 'arguments' => $c->getArguments()];
        return $a;
    }
    public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $a += [$prefix . 'flags' => self::extractFlags($c->getFlags())];
        $type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType();
        if (isset($a["\x00AMQPExchange\x00name"])) {
            $a["\x00AMQPExchange\x00type"] = $type;
            return $a;
        }
        $a += [$prefix . 'connection' => $c->getConnection(), $prefix . 'channel' => $c->getChannel(), $prefix . 'name' => $c->getName(), $prefix . 'type' => $type, $prefix . 'arguments' => $c->getArguments()];
        return $a;
    }
    public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;
        $deliveryMode = new ConstStub($c->getDeliveryMode() . (2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode());
        if (isset($a["\x00AMQPEnvelope\x00body"])) {
            $a["\x00AMQPEnvelope\x00delivery_mode"] = $deliveryMode;
            return $a;
        }
        if (!($filter & Caster::EXCLUDE_VERBOSE)) {
            $a += [$prefix . 'body' => $c->getBody()];
        }
        $a += [$prefix . 'delivery_tag' => $c->getDeliveryTag(), $prefix . 'is_redelivery' => $c->isRedelivery(), $prefix . 'exchange_name' => $c->getExchangeName(), $prefix . 'routing_key' => $c->getRoutingKey(), $prefix . 'content_type' => $c->getContentType(), $prefix . 'content_encoding' => $c->getContentEncoding(), $prefix . 'headers' => $c->getHeaders(), $prefix . 'delivery_mode' => $deliveryMode, $prefix . 'priority' => $c->getPriority(), $prefix . 'correlation_id' => $c->getCorrelationId(), $prefix . 'reply_to' => $c->getReplyTo(), $prefix . 'expiration' => $c->getExpiration(), $prefix . 'message_id' => $c->getMessageId(), $prefix . 'timestamp' => $c->getTimeStamp(), $prefix . 'type' => $c->getType(), $prefix . 'user_id' => $c->getUserId(), $prefix . 'app_id' => $c->getAppId()];
        return $a;
    }
    private static function extractFlags(int $flags) : ConstStub
    {
        $flagsArray = [];
        foreach (self::FLAGS as $value => $name) {
            if ($flags & $value) {
                $flagsArray[] = $name;
            }
        }
        if (!$flagsArray) {
            $flagsArray = ['AMQP_NOPARAM'];
        }
        return new ConstStub(\implode('|', $flagsArray), $flags);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DOMCaster
{
    private const ERROR_CODES = [\DOM_PHP_ERR => 'DOM_PHP_ERR', \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR', \DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR', \DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR', \DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR', \DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR', \DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR', \DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR', \DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR', \DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR', \DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR', \DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR', \DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR', \DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR', \DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR'];
    private const NODE_TYPES = [\XML_ELEMENT_NODE => 'XML_ELEMENT_NODE', \XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE', \XML_TEXT_NODE => 'XML_TEXT_NODE', \XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE', \XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE', \XML_ENTITY_NODE => 'XML_ENTITY_NODE', \XML_PI_NODE => 'XML_PI_NODE', \XML_COMMENT_NODE => 'XML_COMMENT_NODE', \XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE', \XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE', \XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE', \XML_NOTATION_NODE => 'XML_NOTATION_NODE', \XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE', \XML_DTD_NODE => 'XML_DTD_NODE', \XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE', \XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE', \XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE', \XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE'];
    public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested)
    {
        $k = Caster::PREFIX_PROTECTED . 'code';
        if (isset($a[$k], self::ERROR_CODES[$a[$k]])) {
            $a[$k] = new ConstStub(self::ERROR_CODES[$a[$k]], $a[$k]);
        }
        return $a;
    }
    public static function castLength($dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['length' => $dom->length];
        return $a;
    }
    public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += [Caster::PREFIX_VIRTUAL . 'Core' => '1.0', Caster::PREFIX_VIRTUAL . 'XML' => '2.0'];
        return $a;
    }
    public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['nodeName' => $dom->nodeName, 'nodeValue' => new CutStub($dom->nodeValue), 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), 'parentNode' => new CutStub($dom->parentNode), 'childNodes' => $dom->childNodes, 'firstChild' => new CutStub($dom->firstChild), 'lastChild' => new CutStub($dom->lastChild), 'previousSibling' => new CutStub($dom->previousSibling), 'nextSibling' => new CutStub($dom->nextSibling), 'attributes' => $dom->attributes, 'ownerDocument' => new CutStub($dom->ownerDocument), 'namespaceURI' => $dom->namespaceURI, 'prefix' => $dom->prefix, 'localName' => $dom->localName, 'baseURI' => $dom->baseURI ? new LinkStub($dom->baseURI) : $dom->baseURI, 'textContent' => new CutStub($dom->textContent)];
        return $a;
    }
    public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['nodeName' => $dom->nodeName, 'nodeValue' => new CutStub($dom->nodeValue), 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), 'prefix' => $dom->prefix, 'localName' => $dom->localName, 'namespaceURI' => $dom->namespaceURI, 'ownerDocument' => new CutStub($dom->ownerDocument), 'parentNode' => new CutStub($dom->parentNode)];
        return $a;
    }
    public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $a += ['doctype' => $dom->doctype, 'implementation' => $dom->implementation, 'documentElement' => new CutStub($dom->documentElement), 'actualEncoding' => $dom->actualEncoding, 'encoding' => $dom->encoding, 'xmlEncoding' => $dom->xmlEncoding, 'standalone' => $dom->standalone, 'xmlStandalone' => $dom->xmlStandalone, 'version' => $dom->version, 'xmlVersion' => $dom->xmlVersion, 'strictErrorChecking' => $dom->strictErrorChecking, 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, 'config' => $dom->config, 'formatOutput' => $dom->formatOutput, 'validateOnParse' => $dom->validateOnParse, 'resolveExternals' => $dom->resolveExternals, 'preserveWhiteSpace' => $dom->preserveWhiteSpace, 'recover' => $dom->recover, 'substituteEntities' => $dom->substituteEntities];
        if (!($filter & Caster::EXCLUDE_VERBOSE)) {
            $formatOutput = $dom->formatOutput;
            $dom->formatOutput = \true;
            $a += [Caster::PREFIX_VIRTUAL . 'xml' => $dom->saveXML()];
            $dom->formatOutput = $formatOutput;
        }
        return $a;
    }
    public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['data' => $dom->data, 'length' => $dom->length];
        return $a;
    }
    public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['name' => $dom->name, 'specified' => $dom->specified, 'value' => $dom->value, 'ownerElement' => $dom->ownerElement, 'schemaTypeInfo' => $dom->schemaTypeInfo];
        return $a;
    }
    public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['tagName' => $dom->tagName, 'schemaTypeInfo' => $dom->schemaTypeInfo];
        return $a;
    }
    public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['wholeText' => $dom->wholeText];
        return $a;
    }
    public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['typeName' => $dom->typeName, 'typeNamespace' => $dom->typeNamespace];
        return $a;
    }
    public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['severity' => $dom->severity, 'message' => $dom->message, 'type' => $dom->type, 'relatedException' => $dom->relatedException, 'related_data' => $dom->related_data, 'location' => $dom->location];
        return $a;
    }
    public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['lineNumber' => $dom->lineNumber, 'columnNumber' => $dom->columnNumber, 'offset' => $dom->offset, 'relatedNode' => $dom->relatedNode, 'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri];
        return $a;
    }
    public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['name' => $dom->name, 'entities' => $dom->entities, 'notations' => $dom->notations, 'publicId' => $dom->publicId, 'systemId' => $dom->systemId, 'internalSubset' => $dom->internalSubset];
        return $a;
    }
    public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['publicId' => $dom->publicId, 'systemId' => $dom->systemId];
        return $a;
    }
    public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['publicId' => $dom->publicId, 'systemId' => $dom->systemId, 'notationName' => $dom->notationName, 'actualEncoding' => $dom->actualEncoding, 'encoding' => $dom->encoding, 'version' => $dom->version];
        return $a;
    }
    public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['target' => $dom->target, 'data' => $dom->data];
        return $a;
    }
    public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested)
    {
        $a += ['document' => $dom->document];
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Ramsey\Uuid\UuidInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
final class UuidCaster
{
    public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested) : array
    {
        $a += [Caster::PREFIX_VIRTUAL . 'uuid' => (string) $c];
        return $a;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class XmlReaderCaster
{
    private const NODE_TYPES = [\XMLReader::NONE => 'NONE', \XMLReader::ELEMENT => 'ELEMENT', \XMLReader::ATTRIBUTE => 'ATTRIBUTE', \XMLReader::TEXT => 'TEXT', \XMLReader::CDATA => 'CDATA', \XMLReader::ENTITY_REF => 'ENTITY_REF', \XMLReader::ENTITY => 'ENTITY', \XMLReader::PI => 'PI (Processing Instruction)', \XMLReader::COMMENT => 'COMMENT', \XMLReader::DOC => 'DOC', \XMLReader::DOC_TYPE => 'DOC_TYPE', \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT', \XMLReader::NOTATION => 'NOTATION', \XMLReader::WHITESPACE => 'WHITESPACE', \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', \XMLReader::END_ELEMENT => 'END_ELEMENT', \XMLReader::END_ENTITY => 'END_ENTITY', \XMLReader::XML_DECLARATION => 'XML_DECLARATION'];
    public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested)
    {
        try {
            $properties = ['LOADDTD' => @$reader->getParserProperty(\XMLReader::LOADDTD), 'DEFAULTATTRS' => @$reader->getParserProperty(\XMLReader::DEFAULTATTRS), 'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE), 'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES)];
        } catch (\Error $e) {
            $properties = ['LOADDTD' => \false, 'DEFAULTATTRS' => \false, 'VALIDATE' => \false, 'SUBST_ENTITIES' => \false];
        }
        $props = Caster::PREFIX_VIRTUAL . 'parserProperties';
        $info = ['localName' => $reader->localName, 'prefix' => $reader->prefix, 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType), 'depth' => $reader->depth, 'isDefault' => $reader->isDefault, 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, 'xmlLang' => $reader->xmlLang, 'attributeCount' => $reader->attributeCount, 'value' => $reader->value, 'namespaceURI' => $reader->namespaceURI, 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, $props => $properties];
        if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) {
            $info[$props] = new EnumStub($info[$props]);
            $info[$props]->cut = $count;
        }
        $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count);
        $stub->cut += $count + 2;
        return $a + $info;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class ArgsStub extends EnumStub
{
    private static $parameters = [];
    public function __construct(array $args, string $function, ?string $class)
    {
        [$variadic, $params] = self::getParameters($function, $class);
        $values = [];
        foreach ($args as $k => $v) {
            $values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
        }
        if (null === $params) {
            parent::__construct($values, \false);
            return;
        }
        if (\count($values) < \count($params)) {
            $params = \array_slice($params, 0, \count($values));
        } elseif (\count($values) > \count($params)) {
            $values[] = new EnumStub(\array_splice($values, \count($params)), \false);
            $params[] = $variadic;
        }
        if (['...'] === $params) {
            $this->dumpKeys = \false;
            $this->value = $values[0]->value;
        } else {
            $this->value = \array_combine($params, $values);
        }
    }
    private static function getParameters(string $function, ?string $class) : array
    {
        if (isset(self::$parameters[$k = $class . '::' . $function])) {
            return self::$parameters[$k];
        }
        try {
            $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function);
        } catch (\ReflectionException $e) {
            return [null, null];
        }
        $variadic = '...';
        $params = [];
        foreach ($r->getParameters() as $v) {
            $k = '$' . $v->name;
            if ($v->isPassedByReference()) {
                $k = '&' . $k;
            }
            if ($v->isVariadic()) {
                $variadic .= $k;
            } else {
                $params[] = $k;
            }
        }
        return self::$parameters[$k] = [$variadic, $params];
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class EnumStub extends Stub
{
    public $dumpKeys = \true;
    public function __construct(array $values, bool $dumpKeys = \true)
    {
        $this->value = $values;
        $this->dumpKeys = $dumpKeys;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Caster;

use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class CutStub extends Stub
{
    public function __construct($value)
    {
        $this->value = $value;
        switch (\gettype($value)) {
            case 'object':
                $this->type = self::TYPE_OBJECT;
                $this->class = \get_class($value);
                if ($value instanceof \Closure) {
                    ReflectionCaster::castClosure($value, [], $this, \true, Caster::EXCLUDE_VERBOSE);
                }
                $this->cut = -1;
                break;
            case 'array':
                $this->type = self::TYPE_ARRAY;
                $this->class = self::ARRAY_ASSOC;
                $this->cut = $this->value = \count($value);
                break;
            case 'resource':
            case 'unknown type':
            case 'resource (closed)':
                $this->type = self::TYPE_RESOURCE;
                $this->handle = (int) $value;
                if ('Unknown' === ($this->class = @\get_resource_type($value))) {
                    $this->class = 'Closed';
                }
                $this->cut = -1;
                break;
            case 'string':
                $this->type = self::TYPE_STRING;
                $this->class = \preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY;
                $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : \mb_strlen($value, 'UTF-8');
                $this->value = '';
                break;
        }
    }
}
<?php

namespace Cvphar;

use Cvphar\Symfony\Component\VarDumper\VarDumper;
if (!\function_exists('Cvphar\\dump')) {
    function dump($var, ...$moreVars)
    {
        VarDumper::dump($var);
        foreach ($moreVars as $v) {
            VarDumper::dump($v);
        }
        if (1 < \func_num_args()) {
            return \func_get_args();
        }
        return $var;
    }
}
if (!\function_exists('Cvphar\\dd')) {
    function dd(...$vars)
    {
        if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], \true) && !\headers_sent()) {
            \header('HTTP/1.1 500 Internal Server Error');
        }
        foreach ($vars as $v) {
            VarDumper::dump($v);
        }
        exit(1);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Server;

use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
class Connection
{
    private $host;
    private $contextProviders;
    private $socket;
    public function __construct(string $host, array $contextProviders = [])
    {
        if (!\str_contains($host, '://')) {
            $host = 'tcp://' . $host;
        }
        $this->host = $host;
        $this->contextProviders = $contextProviders;
    }
    public function getContextProviders() : array
    {
        return $this->contextProviders;
    }
    public function write(Data $data) : bool
    {
        $socketIsFresh = !$this->socket;
        if (!($this->socket = $this->socket ?: $this->createSocket())) {
            return \false;
        }
        $context = ['timestamp' => \microtime(\true)];
        foreach ($this->contextProviders as $name => $provider) {
            $context[$name] = $provider->getContext();
        }
        $context = \array_filter($context);
        $encodedPayload = \base64_encode(\serialize([$data, $context])) . "\n";
        \set_error_handler([self::class, 'nullErrorHandler']);
        try {
            if (-1 !== \stream_socket_sendto($this->socket, $encodedPayload)) {
                return \true;
            }
            if (!$socketIsFresh) {
                \stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR);
                \fclose($this->socket);
                $this->socket = $this->createSocket();
            }
            if (-1 !== \stream_socket_sendto($this->socket, $encodedPayload)) {
                return \true;
            }
        } finally {
            \restore_error_handler();
        }
        return \false;
    }
    private static function nullErrorHandler(int $t, string $m)
    {
    }
    private function createSocket()
    {
        \set_error_handler([self::class, 'nullErrorHandler']);
        try {
            return \stream_socket_client($this->host, $errno, $errstr, 3);
        } finally {
            \restore_error_handler();
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Server;

use Cvphar\Psr\Log\LoggerInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class DumpServer
{
    private $host;
    private $logger;
    private $socket;
    public function __construct(string $host, LoggerInterface $logger = null)
    {
        if (!\str_contains($host, '://')) {
            $host = 'tcp://' . $host;
        }
        $this->host = $host;
        $this->logger = $logger;
    }
    public function start() : void
    {
        if (!($this->socket = \stream_socket_server($this->host, $errno, $errstr))) {
            throw new \RuntimeException(\sprintf('Server start failed on "%s": ', $this->host) . $errstr . ' ' . $errno);
        }
    }
    public function listen(callable $callback) : void
    {
        if (null === $this->socket) {
            $this->start();
        }
        foreach ($this->getMessages() as $clientId => $message) {
            if ($this->logger) {
                $this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]);
            }
            $payload = @\unserialize(\base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]);
            if (\false === $payload) {
                if ($this->logger) {
                    $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
                }
                continue;
            }
            if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
                if ($this->logger) {
                    $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
                }
                continue;
            }
            [$data, $context] = $payload;
            $callback($data, $context, $clientId);
        }
    }
    public function getHost() : string
    {
        return $this->host;
    }
    private function getMessages() : iterable
    {
        $sockets = [(int) $this->socket => $this->socket];
        $write = [];
        while (\true) {
            $read = $sockets;
            \stream_select($read, $write, $write, null);
            foreach ($read as $stream) {
                if ($this->socket === $stream) {
                    $stream = \stream_socket_accept($this->socket);
                    $sockets[(int) $stream] = $stream;
                } elseif (\feof($stream)) {
                    unset($sockets[(int) $stream]);
                    \fclose($stream);
                } else {
                    (yield (int) $stream => \fgets($stream));
                }
            }
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Command;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Completion\CompletionInput;
use Cvphar\Symfony\Component\Console\Completion\CompletionSuggestions;
use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Style\SymfonyStyle;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor;
use Cvphar\Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface;
use Cvphar\Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor;
use Cvphar\Symfony\Component\VarDumper\Dumper\CliDumper;
use Cvphar\Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Cvphar\Symfony\Component\VarDumper\Server\DumpServer;
class ServerDumpCommand extends Command
{
    protected static $defaultName = 'server:dump';
    protected static $defaultDescription = 'Start a dump server that collects and displays dumps in a single place';
    private $server;
    private $descriptors;
    public function __construct(DumpServer $server, array $descriptors = [])
    {
        $this->server = $server;
        $this->descriptors = $descriptors + ['cli' => new CliDescriptor(new CliDumper()), 'html' => new HtmlDescriptor(new HtmlDumper())];
        parent::__construct();
    }
    protected function configure()
    {
        $this->addOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format (%s)', \implode(', ', $this->getAvailableFormats())), 'cli')->setDescription(self::$defaultDescription)->setHelp(<<<'EOF'
<info>%command.name%</info> starts a dump server that collects and displays
dumps in a single place for debugging you application:

  <info>php %command.full_name%</info>

You can consult dumped data in HTML format in your browser by providing the <comment>--format=html</comment> option
and redirecting the output to a file:

  <info>php %command.full_name% --format="html" > dump.html</info>

EOF
);
    }
    protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $io = new SymfonyStyle($input, $output);
        $format = $input->getOption('format');
        if (!($descriptor = $this->descriptors[$format] ?? null)) {
            throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $format));
        }
        $errorIo = $io->getErrorStyle();
        $errorIo->title('Symfony Var Dumper Server');
        $this->server->start();
        $errorIo->success(\sprintf('Server listening on %s', $this->server->getHost()));
        $errorIo->comment('Quit the server with CONTROL-C.');
        $this->server->listen(function (Data $data, array $context, int $clientId) use($descriptor, $io) {
            $descriptor->describe($io, $data, $context, $clientId);
        });
        return 0;
    }
    public function complete(CompletionInput $input, CompletionSuggestions $suggestions) : void
    {
        if ($input->mustSuggestOptionValuesFor('format')) {
            $suggestions->suggestValues($this->getAvailableFormats());
        }
    }
    private function getAvailableFormats() : array
    {
        return \array_keys($this->descriptors);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Command\Descriptor;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
interface DumpDescriptorInterface
{
    public function describe(OutputInterface $output, Data $data, array $context, int $clientId) : void;
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Command\Descriptor;

use Cvphar\Symfony\Component\Console\Input\ArrayInput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Style\SymfonyStyle;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Dumper\CliDumper;
class CliDescriptor implements DumpDescriptorInterface
{
    private $dumper;
    private $lastIdentifier;
    public function __construct(CliDumper $dumper)
    {
        $this->dumper = $dumper;
    }
    public function describe(OutputInterface $output, Data $data, array $context, int $clientId) : void
    {
        $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output);
        $this->dumper->setColors($output->isDecorated());
        $rows = [['date', \date('r', (int) $context['timestamp'])]];
        $lastIdentifier = $this->lastIdentifier;
        $this->lastIdentifier = $clientId;
        $section = "Received from client #{$clientId}";
        if (isset($context['request'])) {
            $request = $context['request'];
            $this->lastIdentifier = $request['identifier'];
            $section = \sprintf('%s %s', $request['method'], $request['uri']);
            if ($controller = $request['controller']) {
                $rows[] = ['controller', \rtrim($this->dumper->dump($controller, \true), "\n")];
            }
        } elseif (isset($context['cli'])) {
            $this->lastIdentifier = $context['cli']['identifier'];
            $section = '$ ' . $context['cli']['command_line'];
        }
        if ($this->lastIdentifier !== $lastIdentifier) {
            $io->section($section);
        }
        if (isset($context['source'])) {
            $source = $context['source'];
            $sourceInfo = \sprintf('%s on line %d', $source['name'], $source['line']);
            if ($fileLink = $source['file_link'] ?? null) {
                $sourceInfo = \sprintf('<href=%s>%s</>', $fileLink, $sourceInfo);
            }
            $rows[] = ['source', $sourceInfo];
            $file = $source['file_relative'] ?? $source['file'];
            $rows[] = ['file', $file];
        }
        $io->table([], $rows);
        $this->dumper->dump($data);
        $io->newLine();
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Command\Descriptor;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Dumper\HtmlDumper;
class HtmlDescriptor implements DumpDescriptorInterface
{
    private $dumper;
    private $initialized = \false;
    public function __construct(HtmlDumper $dumper)
    {
        $this->dumper = $dumper;
    }
    public function describe(OutputInterface $output, Data $data, array $context, int $clientId) : void
    {
        if (!$this->initialized) {
            $styles = \file_get_contents(__DIR__ . '/../../Resources/css/htmlDescriptor.css');
            $scripts = \file_get_contents(__DIR__ . '/../../Resources/js/htmlDescriptor.js');
            $output->writeln("<style>{$styles}</style><script>{$scripts}</script>");
            $this->initialized = \true;
        }
        $title = '-';
        if (isset($context['request'])) {
            $request = $context['request'];
            $controller = "<span class='dumped-tag'>{$this->dumper->dump($request['controller'], \true, ['maxDepth' => 0])}</span>";
            $title = \sprintf('<code>%s</code> <a href="%s">%s</a>', $request['method'], $uri = $request['uri'], $uri);
            $dedupIdentifier = $request['identifier'];
        } elseif (isset($context['cli'])) {
            $title = '<code>$ </code>' . $context['cli']['command_line'];
            $dedupIdentifier = $context['cli']['identifier'];
        } else {
            $dedupIdentifier = \uniqid('', \true);
        }
        $sourceDescription = '';
        if (isset($context['source'])) {
            $source = $context['source'];
            $projectDir = $source['project_dir'] ?? null;
            $sourceDescription = \sprintf('%s on line %d', $source['name'], $source['line']);
            if (isset($source['file_link'])) {
                $sourceDescription = \sprintf('<a href="%s">%s</a>', $source['file_link'], $sourceDescription);
            }
        }
        $isoDate = $this->extractDate($context, 'c');
        $tags = \array_filter(['controller' => $controller ?? null, 'project dir' => $projectDir ?? null]);
        $output->writeln(<<<HTML
<article data-dedup-id="{$dedupIdentifier}">
    <header>
        <div class="row">
            <h2 class="col">{$title}</h2>
            <time class="col text-small" title="{$isoDate}" datetime="{$isoDate}">
                {$this->extractDate($context)}
            </time>
        </div>
        {$this->renderTags($tags)}
    </header>
    <section class="body">
        <p class="text-small">
            {$sourceDescription}
        </p>
        {$this->dumper->dump($data, \true)}
    </section>
</article>
HTML
);
    }
    private function extractDate(array $context, string $format = 'r') : string
    {
        return \date($format, (int) $context['timestamp']);
    }
    private function renderTags(array $tags) : string
    {
        if (!$tags) {
            return '';
        }
        $renderedTags = '';
        foreach ($tags as $key => $value) {
            $renderedTags .= \sprintf('<li><span class="badge">%s</span>%s</li>', $key, $value);
        }
        return <<<HTML
<div class="row">
    <ul class="tags">
        {$renderedTags}
    </ul>
</div>
HTML;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Exception;

class ThrowingCasterException extends \Exception
{
    public function __construct(\Throwable $prev)
    {
        parent::__construct('Unexpected ' . \get_class($prev) . ' thrown from a caster: ' . $prev->getMessage(), 0, $prev);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
use Cvphar\Symfony\Component\VarDumper\Server\Connection;
class ServerDumper implements DataDumperInterface
{
    private $connection;
    private $wrappedDumper;
    public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = [])
    {
        $this->connection = new Connection($host, $contextProviders);
        $this->wrappedDumper = $wrappedDumper;
    }
    public function getContextProviders() : array
    {
        return $this->connection->getContextProviders();
    }
    public function dump(Data $data)
    {
        if (!$this->connection->write($data) && $this->wrappedDumper) {
            $this->wrappedDumper->dump($data);
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
interface DataDumperInterface
{
    public function dump(Data $data);
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider;

interface ContextProviderInterface
{
    public function getContext() : ?array;
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider;

use Symfony\Component\HttpFoundation\RequestStack;
use Cvphar\Symfony\Component\VarDumper\Caster\ReflectionCaster;
use Cvphar\Symfony\Component\VarDumper\Cloner\VarCloner;
final class RequestContextProvider implements ContextProviderInterface
{
    private $requestStack;
    private $cloner;
    public function __construct(RequestStack $requestStack)
    {
        $this->requestStack = $requestStack;
        $this->cloner = new VarCloner();
        $this->cloner->setMaxItems(0);
        $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
    }
    public function getContext() : ?array
    {
        if (null === ($request = $this->requestStack->getCurrentRequest())) {
            return null;
        }
        $controller = $request->attributes->get('_controller');
        return ['uri' => $request->getUri(), 'method' => $request->getMethod(), 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller, 'identifier' => \spl_object_hash($request)];
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider;

final class CliContextProvider implements ContextProviderInterface
{
    public function getContext() : ?array
    {
        if ('cli' !== \PHP_SAPI) {
            return null;
        }
        return ['command_line' => $commandLine = \implode(' ', $_SERVER['argv'] ?? []), 'identifier' => \hash('crc32b', $commandLine . $_SERVER['REQUEST_TIME_FLOAT'])];
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider;

use Cvphar\Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
use Cvphar\Symfony\Component\VarDumper\Cloner\VarCloner;
use Cvphar\Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Cvphar\Symfony\Component\VarDumper\VarDumper;
use Cvphar\Twig\Template;
final class SourceContextProvider implements ContextProviderInterface
{
    private $limit;
    private $charset;
    private $projectDir;
    private $fileLinkFormatter;
    public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9)
    {
        $this->charset = $charset;
        $this->projectDir = $projectDir;
        $this->fileLinkFormatter = $fileLinkFormatter;
        $this->limit = $limit;
    }
    public function getContext() : ?array
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit);
        $file = $trace[1]['file'];
        $line = $trace[1]['line'];
        $name = \false;
        $fileExcerpt = \false;
        for ($i = 2; $i < $this->limit; ++$i) {
            if (isset($trace[$i]['class'], $trace[$i]['function']) && 'dump' === $trace[$i]['function'] && VarDumper::class === $trace[$i]['class']) {
                $file = $trace[$i]['file'] ?? $file;
                $line = $trace[$i]['line'] ?? $line;
                while (++$i < $this->limit) {
                    if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !\str_starts_with($trace[$i]['function'], 'call_user_func')) {
                        $file = $trace[$i]['file'];
                        $line = $trace[$i]['line'];
                        break;
                    } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) {
                        $template = $trace[$i]['object'];
                        $name = $template->getTemplateName();
                        $src = \method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (\method_exists($template, 'getSource') ? $template->getSource() : \false);
                        $info = $template->getDebugInfo();
                        if (isset($info[$trace[$i - 1]['line']])) {
                            $line = $info[$trace[$i - 1]['line']];
                            $file = \method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null;
                            if ($src) {
                                $src = \explode("\n", $src);
                                $fileExcerpt = [];
                                for ($i = \max($line - 3, 1), $max = \min($line + 3, \count($src)); $i <= $max; ++$i) {
                                    $fileExcerpt[] = '<li' . ($i === $line ? ' class="selected"' : '') . '><code>' . $this->htmlEncode($src[$i - 1]) . '</code></li>';
                                }
                                $fileExcerpt = '<ol start="' . \max($line - 3, 1) . '">' . \implode("\n", $fileExcerpt) . '</ol>';
                            }
                        }
                        break;
                    }
                }
                break;
            }
        }
        if (\false === $name) {
            $name = \str_replace('\\', '/', $file);
            $name = \substr($name, \strrpos($name, '/') + 1);
        }
        $context = ['name' => $name, 'file' => $file, 'line' => $line];
        $context['file_excerpt'] = $fileExcerpt;
        if (null !== $this->projectDir) {
            $context['project_dir'] = $this->projectDir;
            if (\str_starts_with($file, $this->projectDir)) {
                $context['file_relative'] = \ltrim(\substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
            }
        }
        if ($this->fileLinkFormatter && ($fileLink = $this->fileLinkFormatter->format($context['file'], $context['line']))) {
            $context['file_link'] = $fileLink;
        }
        return $context;
    }
    private function htmlEncode(string $s) : string
    {
        $html = '';
        $dumper = new HtmlDumper(function ($line) use(&$html) {
            $html .= $line;
        }, $this->charset);
        $dumper->setDumpHeader('');
        $dumper->setDumpBoundaries('', '');
        $cloner = new VarCloner();
        $dumper->dump($cloner->cloneVar($s));
        return \substr(\strip_tags($html), 1, -1);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Cloner\DumperInterface;
abstract class AbstractDumper implements DataDumperInterface, DumperInterface
{
    public const DUMP_LIGHT_ARRAY = 1;
    public const DUMP_STRING_LENGTH = 2;
    public const DUMP_COMMA_SEPARATOR = 4;
    public const DUMP_TRAILING_COMMA = 8;
    public static $defaultOutput = 'php://output';
    protected $line = '';
    protected $lineDumper;
    protected $outputStream;
    protected $decimalPoint;
    protected $indentPad = '  ';
    protected $flags;
    private $charset = '';
    public function __construct($output = null, string $charset = null, int $flags = 0)
    {
        $this->flags = $flags;
        $this->setCharset((($charset ?: \ini_get('php.output_encoding')) ?: \ini_get('default_charset')) ?: 'UTF-8');
        $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : \localeconv()['decimal_point'];
        $this->setOutput($output ?: static::$defaultOutput);
        if (!$output && \is_string(static::$defaultOutput)) {
            static::$defaultOutput = $this->outputStream;
        }
    }
    public function setOutput($output)
    {
        $prev = $this->outputStream ?? $this->lineDumper;
        if (\is_callable($output)) {
            $this->outputStream = null;
            $this->lineDumper = $output;
        } else {
            if (\is_string($output)) {
                $output = \fopen($output, 'w');
            }
            $this->outputStream = $output;
            $this->lineDumper = [$this, 'echoLine'];
        }
        return $prev;
    }
    public function setCharset(string $charset)
    {
        $prev = $this->charset;
        $charset = \strtoupper($charset);
        $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
        $this->charset = $charset;
        return $prev;
    }
    public function setIndentPad(string $pad)
    {
        $prev = $this->indentPad;
        $this->indentPad = $pad;
        return $prev;
    }
    public function dump(Data $data, $output = null)
    {
        $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : \localeconv()['decimal_point'];
        if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? \setlocale(\LC_NUMERIC, 0) : null) {
            \setlocale(\LC_NUMERIC, 'C');
        }
        if ($returnDump = \true === $output) {
            $output = \fopen('php://memory', 'r+');
        }
        if ($output) {
            $prevOutput = $this->setOutput($output);
        }
        try {
            $data->dump($this);
            $this->dumpLine(-1);
            if ($returnDump) {
                $result = \stream_get_contents($output, -1, 0);
                \fclose($output);
                return $result;
            }
        } finally {
            if ($output) {
                $this->setOutput($prevOutput);
            }
            if ($locale) {
                \setlocale(\LC_NUMERIC, $locale);
            }
        }
        return null;
    }
    protected function dumpLine(int $depth)
    {
        ($this->lineDumper)($this->line, $depth, $this->indentPad);
        $this->line = '';
    }
    protected function echoLine(string $line, int $depth, string $indentPad)
    {
        if (-1 !== $depth) {
            \fwrite($this->outputStream, \str_repeat($indentPad, $depth) . $line . "\n");
        }
    }
    protected function utf8Encode(?string $s)
    {
        if (null === $s || \preg_match('//u', $s)) {
            return $s;
        }
        if (!\function_exists('iconv')) {
            throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.');
        }
        if (\false !== ($c = @\iconv($this->charset, 'UTF-8', $s))) {
            return $c;
        }
        if ('CP1252' !== $this->charset && \false !== ($c = @\iconv('CP1252', 'UTF-8', $s))) {
            return $c;
        }
        return \iconv('CP850', 'UTF-8', $s);
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Cursor;
use Cvphar\Symfony\Component\VarDumper\Cloner\Stub;
class CliDumper extends AbstractDumper
{
    public static $defaultColors;
    public static $defaultOutput = 'php://stdout';
    protected $colors;
    protected $maxStringWidth = 0;
    protected $styles = ['default' => '0;38;5;208', 'num' => '1;38;5;38', 'const' => '1;38;5;208', 'str' => '1;38;5;113', 'note' => '38;5;38', 'ref' => '38;5;247', 'public' => '', 'protected' => '', 'private' => '', 'meta' => '38;5;170', 'key' => '38;5;113', 'index' => '38;5;38'];
    protected static $controlCharsRx = '/[\\x00-\\x1F\\x7F]+/';
    protected static $controlCharsMap = ["\t" => '\\t', "\n" => '\\n', "\v" => '\\v', "\f" => '\\f', "\r" => '\\r', "\x1b" => '\\e'];
    protected $collapseNextHash = \false;
    protected $expandNextHash = \false;
    private $displayOptions = ['fileLinkFormat' => null];
    private $handlesHrefGracefully;
    public function __construct($output = null, string $charset = null, int $flags = 0)
    {
        parent::__construct($output, $charset, $flags);
        if ('\\' === \DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) {
            $this->setStyles(['default' => '31', 'num' => '1;34', 'const' => '1;31', 'str' => '1;32', 'note' => '34', 'ref' => '1;30', 'meta' => '35', 'key' => '32', 'index' => '34']);
        }
        $this->displayOptions['fileLinkFormat'] = (\ini_get('xdebug.file_link_format') ?: \get_cfg_var('xdebug.file_link_format')) ?: 'file://%f#L%l';
    }
    public function setColors(bool $colors)
    {
        $this->colors = $colors;
    }
    public function setMaxStringWidth(int $maxStringWidth)
    {
        $this->maxStringWidth = $maxStringWidth;
    }
    public function setStyles(array $styles)
    {
        $this->styles = $styles + $this->styles;
    }
    public function setDisplayOptions(array $displayOptions)
    {
        $this->displayOptions = $displayOptions + $this->displayOptions;
    }
    public function dumpScalar(Cursor $cursor, string $type, $value)
    {
        $this->dumpKey($cursor);
        $style = 'const';
        $attr = $cursor->attr;
        switch ($type) {
            case 'default':
                $style = 'default';
                break;
            case 'integer':
                $style = 'num';
                if (isset($this->styles['integer'])) {
                    $style = 'integer';
                }
                break;
            case 'double':
                $style = 'num';
                if (isset($this->styles['float'])) {
                    $style = 'float';
                }
                switch (\true) {
                    case \INF === $value:
                        $value = 'INF';
                        break;
                    case -\INF === $value:
                        $value = '-INF';
                        break;
                    case \is_nan($value):
                        $value = 'NAN';
                        break;
                    default:
                        $value = (string) $value;
                        if (!\str_contains($value, $this->decimalPoint)) {
                            $value .= $this->decimalPoint . '0';
                        }
                        break;
                }
                break;
            case 'NULL':
                $value = 'null';
                break;
            case 'boolean':
                $value = $value ? 'true' : 'false';
                break;
            default:
                $attr += ['value' => $this->utf8Encode($value)];
                $value = $this->utf8Encode($type);
                break;
        }
        $this->line .= $this->style($style, $value, $attr);
        $this->endValue($cursor);
    }
    public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
    {
        $this->dumpKey($cursor);
        $attr = $cursor->attr;
        if ($bin) {
            $str = $this->utf8Encode($str);
        }
        if ('' === $str) {
            $this->line .= '""';
            if ($cut) {
                $this->line .= 'â€¦' . $cut;
            }
            $this->endValue($cursor);
        } else {
            $attr += ['length' => 0 <= $cut ? \mb_strlen($str, 'UTF-8') + $cut : 0, 'binary' => $bin];
            $str = $bin && \false !== \strpos($str, "\x00") ? [$str] : \explode("\n", $str);
            if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) {
                unset($str[1]);
                $str[0] .= "\n";
            }
            $m = \count($str) - 1;
            $i = $lineCut = 0;
            if (self::DUMP_STRING_LENGTH & $this->flags) {
                $this->line .= '(' . $attr['length'] . ') ';
            }
            if ($bin) {
                $this->line .= 'b';
            }
            if ($m) {
                $this->line .= '"""';
                $this->dumpLine($cursor->depth);
            } else {
                $this->line .= '"';
            }
            foreach ($str as $str) {
                if ($i < $m) {
                    $str .= "\n";
                }
                if (0 < $this->maxStringWidth && $this->maxStringWidth < ($len = \mb_strlen($str, 'UTF-8'))) {
                    $str = \mb_substr($str, 0, $this->maxStringWidth, 'UTF-8');
                    $lineCut = $len - $this->maxStringWidth;
                }
                if ($m && 0 < $cursor->depth) {
                    $this->line .= $this->indentPad;
                }
                if ('' !== $str) {
                    $this->line .= $this->style('str', $str, $attr);
                }
                if ($i++ == $m) {
                    if ($m) {
                        if ('' !== $str) {
                            $this->dumpLine($cursor->depth);
                            if (0 < $cursor->depth) {
                                $this->line .= $this->indentPad;
                            }
                        }
                        $this->line .= '"""';
                    } else {
                        $this->line .= '"';
                    }
                    if ($cut < 0) {
                        $this->line .= 'â€¦';
                        $lineCut = 0;
                    } elseif ($cut) {
                        $lineCut += $cut;
                    }
                }
                if ($lineCut) {
                    $this->line .= 'â€¦' . $lineCut;
                    $lineCut = 0;
                }
                if ($i > $m) {
                    $this->endValue($cursor);
                } else {
                    $this->dumpLine($cursor->depth);
                }
            }
        }
    }
    public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild)
    {
        if (null === $this->colors) {
            $this->colors = $this->supportsColors();
        }
        $this->dumpKey($cursor);
        $attr = $cursor->attr;
        if ($this->collapseNextHash) {
            $cursor->skipChildren = \true;
            $this->collapseNextHash = $hasChild = \false;
        }
        $class = $this->utf8Encode($class);
        if (Cursor::HASH_OBJECT === $type) {
            $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class, $attr) . (empty($attr['cut_hash']) ? ' {' : '') : '{';
        } elseif (Cursor::HASH_RESOURCE === $type) {
            $prefix = $this->style('note', $class . ' resource', $attr) . ($hasChild ? ' {' : ' ');
        } else {
            $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:' . $class) . ' [' : '[';
        }
        if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) {
            $prefix .= $this->style('ref', (Cursor::HASH_RESOURCE === $type ? '@' : '#') . (0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->softRefTo), ['count' => $cursor->softRefCount]);
        } elseif ($cursor->hardRefTo && !$cursor->refIndex && $class) {
            $prefix .= $this->style('ref', '&' . $cursor->hardRefTo, ['count' => $cursor->hardRefCount]);
        } elseif (!$hasChild && Cursor::HASH_RESOURCE === $type) {
            $prefix = \substr($prefix, 0, -1);
        }
        $this->line .= $prefix;
        if ($hasChild) {
            $this->dumpLine($cursor->depth);
        }
    }
    public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut)
    {
        if (empty($cursor->attr['cut_hash'])) {
            $this->dumpEllipsis($cursor, $hasChild, $cut);
            $this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : ''));
        }
        $this->endValue($cursor);
    }
    protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)
    {
        if ($cut) {
            $this->line .= ' â€¦';
            if (0 < $cut) {
                $this->line .= $cut;
            }
            if ($hasChild) {
                $this->dumpLine($cursor->depth + 1);
            }
        }
    }
    protected function dumpKey(Cursor $cursor)
    {
        if (null !== ($key = $cursor->hashKey)) {
            if ($cursor->hashKeyIsBinary) {
                $key = $this->utf8Encode($key);
            }
            $attr = ['binary' => $cursor->hashKeyIsBinary];
            $bin = $cursor->hashKeyIsBinary ? 'b' : '';
            $style = 'key';
            switch ($cursor->hashType) {
                default:
                case Cursor::HASH_INDEXED:
                    if (self::DUMP_LIGHT_ARRAY & $this->flags) {
                        break;
                    }
                    $style = 'index';
                case Cursor::HASH_ASSOC:
                    if (\is_int($key)) {
                        $this->line .= $this->style($style, $key) . ' => ';
                    } else {
                        $this->line .= $bin . '"' . $this->style($style, $key) . '" => ';
                    }
                    break;
                case Cursor::HASH_RESOURCE:
                    $key = "\x00~\x00" . $key;
                case Cursor::HASH_OBJECT:
                    if (!isset($key[0]) || "\x00" !== $key[0]) {
                        $this->line .= '+' . $bin . $this->style('public', $key) . ': ';
                    } elseif (0 < \strpos($key, "\x00", 1)) {
                        $key = \explode("\x00", \substr($key, 1), 2);
                        switch ($key[0][0]) {
                            case '+':
                                $attr['dynamic'] = \true;
                                $this->line .= '+' . $bin . '"' . $this->style('public', $key[1], $attr) . '": ';
                                break 2;
                            case '~':
                                $style = 'meta';
                                if (isset($key[0][1])) {
                                    \parse_str(\substr($key[0], 1), $attr);
                                    $attr += ['binary' => $cursor->hashKeyIsBinary];
                                }
                                break;
                            case '*':
                                $style = 'protected';
                                $bin = '#' . $bin;
                                break;
                            default:
                                $attr['class'] = $key[0];
                                $style = 'private';
                                $bin = '-' . $bin;
                                break;
                        }
                        if (isset($attr['collapse'])) {
                            if ($attr['collapse']) {
                                $this->collapseNextHash = \true;
                            } else {
                                $this->expandNextHash = \true;
                            }
                        }
                        $this->line .= $bin . $this->style($style, $key[1], $attr) . ($attr['separator'] ?? ': ');
                    } else {
                        $this->line .= '-' . $bin . '"' . $this->style('private', $key, ['class' => '']) . '": ';
                    }
                    break;
            }
            if ($cursor->hardRefTo) {
                $this->line .= $this->style('ref', '&' . ($cursor->hardRefCount ? $cursor->hardRefTo : ''), ['count' => $cursor->hardRefCount]) . ' ';
            }
        }
    }
    protected function style(string $style, string $value, array $attr = [])
    {
        if (null === $this->colors) {
            $this->colors = $this->supportsColors();
        }
        if (null === $this->handlesHrefGracefully) {
            $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== \getenv('TERMINAL_EMULATOR') && (!\getenv('KONSOLE_VERSION') || (int) \getenv('KONSOLE_VERSION') > 201100) && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']);
        }
        if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {
            $prefix = \substr($value, 0, -$attr['ellipsis']);
            if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && \str_starts_with($prefix, $_SERVER[$pwd])) {
                $prefix = '.' . \substr($prefix, \strlen($_SERVER[$pwd]));
            }
            if (!empty($attr['ellipsis-tail'])) {
                $prefix .= \substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']);
                $value = \substr($value, -$attr['ellipsis'] + $attr['ellipsis-tail']);
            } else {
                $value = \substr($value, -$attr['ellipsis']);
            }
            $value = $this->style('default', $prefix) . $this->style($style, $value);
            goto href;
        }
        $map = static::$controlCharsMap;
        $startCchr = $this->colors ? "\x1b[m\x1b[{$this->styles['default']}m" : '';
        $endCchr = $this->colors ? "\x1b[m\x1b[{$this->styles[$style]}m" : '';
        $value = \preg_replace_callback(static::$controlCharsRx, function ($c) use($map, $startCchr, $endCchr) {
            $s = $startCchr;
            $c = $c[$i = 0];
            do {
                $s .= $map[$c[$i]] ?? \sprintf('\\x%02X', \ord($c[$i]));
            } while (isset($c[++$i]));
            return $s . $endCchr;
        }, $value, -1, $cchrCount);
        if ($this->colors) {
            if ($cchrCount && "\x1b" === $value[0]) {
                $value = \substr($value, \strlen($startCchr));
            } else {
                $value = "\x1b[{$this->styles[$style]}m" . $value;
            }
            if ($cchrCount && \str_ends_with($value, $endCchr)) {
                $value = \substr($value, 0, -\strlen($endCchr));
            } else {
                $value .= "\x1b[{$this->styles['default']}m";
            }
        }
        href:
        if ($this->colors && $this->handlesHrefGracefully) {
            if (isset($attr['file']) && ($href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0))) {
                if ('note' === $style) {
                    $value .= "\x1b]8;;{$href}\x1b\\^\x1b]8;;\x1b\\";
                } else {
                    $attr['href'] = $href;
                }
            }
            if (isset($attr['href'])) {
                $value = "\x1b]8;;{$attr['href']}\x1b\\{$value}\x1b]8;;\x1b\\";
            }
        } elseif ($attr['if_links'] ?? \false) {
            return '';
        }
        return $value;
    }
    protected function supportsColors()
    {
        if ($this->outputStream !== static::$defaultOutput) {
            return $this->hasColorSupport($this->outputStream);
        }
        if (null !== static::$defaultColors) {
            return static::$defaultColors;
        }
        if (isset($_SERVER['argv'][1])) {
            $colors = $_SERVER['argv'];
            $i = \count($colors);
            while (--$i > 0) {
                if (isset($colors[$i][5])) {
                    switch ($colors[$i]) {
                        case '--ansi':
                        case '--color':
                        case '--color=yes':
                        case '--color=force':
                        case '--color=always':
                        case '--colors=always':
                            return static::$defaultColors = \true;
                        case '--no-ansi':
                        case '--color=no':
                        case '--color=none':
                        case '--color=never':
                        case '--colors=never':
                            return static::$defaultColors = \false;
                    }
                }
            }
        }
        $h = \stream_get_meta_data($this->outputStream) + ['wrapper_type' => null];
        $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? \fopen('php://stdout', 'w') : $this->outputStream;
        return static::$defaultColors = $this->hasColorSupport($h);
    }
    protected function dumpLine(int $depth, bool $endOfValue = \false)
    {
        if ($this->colors) {
            $this->line = \sprintf("\x1b[%sm%s\x1b[m", $this->styles['default'], $this->line);
        }
        parent::dumpLine($depth);
    }
    protected function endValue(Cursor $cursor)
    {
        if (-1 === $cursor->hashType) {
            return;
        }
        if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) {
            if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) {
                $this->line .= ',';
            } elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) {
                $this->line .= ',';
            }
        }
        $this->dumpLine($cursor->depth, \true);
    }
    private function hasColorSupport($stream) : bool
    {
        if (!\is_resource($stream) || 'stream' !== \get_resource_type($stream)) {
            return \false;
        }
        if (isset($_SERVER['NO_COLOR']) || \false !== \getenv('NO_COLOR')) {
            return \false;
        }
        if ('Hyper' === \getenv('TERM_PROGRAM')) {
            return \true;
        }
        if (\DIRECTORY_SEPARATOR === '\\') {
            return \function_exists('sapi_windows_vt100_support') && @\sapi_windows_vt100_support($stream) || \false !== \getenv('ANSICON') || 'ON' === \getenv('ConEmuANSI') || 'xterm' === \getenv('TERM');
        }
        return \stream_isatty($stream);
    }
    private function isWindowsTrueColor() : bool
    {
        $result = 183 <= \getenv('ANSICON_VER') || 'ON' === \getenv('ConEmuANSI') || 'xterm' === \getenv('TERM') || 'Hyper' === \getenv('TERM_PROGRAM');
        if (!$result) {
            $version = \sprintf('%s.%s.%s', \PHP_WINDOWS_VERSION_MAJOR, \PHP_WINDOWS_VERSION_MINOR, \PHP_WINDOWS_VERSION_BUILD);
            $result = $version >= '10.0.15063';
        }
        return $result;
    }
    private function getSourceLink(string $file, int $line)
    {
        if ($fmt = $this->displayOptions['fileLinkFormat']) {
            return \is_string($fmt) ? \strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://' . $file . '#L' . $line);
        }
        return \false;
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
class ContextualizedDumper implements DataDumperInterface
{
    private $wrappedDumper;
    private $contextProviders;
    public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders)
    {
        $this->wrappedDumper = $wrappedDumper;
        $this->contextProviders = $contextProviders;
    }
    public function dump(Data $data)
    {
        $context = [];
        foreach ($this->contextProviders as $contextProvider) {
            $context[\get_class($contextProvider)] = $contextProvider->getContext();
        }
        $this->wrappedDumper->dump($data->withContext($context));
    }
}
<?php

namespace Cvphar\Symfony\Component\VarDumper\Dumper;

use Cvphar\Symfony\Component\VarDumper\Cloner\Cursor;
use Cvphar\Symfony\Component\VarDumper\Cloner\Data;
class HtmlDumper extends CliDumper
{
    public static $defaultOutput = 'php://output';
    protected static $themes = ['dark' => ['default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', 'num' => 'font-weight:bold; color:#1299DA', 'const' => 'font-weight:bold', 'str' => 'font-weight:bold; color:#56DB3A', 'note' => 'color:#1299DA', 'ref' => 'color:#A0A0A0', 'public' => 'color:#FFFFFF', 'protected' => 'color:#FFFFFF', 'private' => 'color:#FFFFFF', 'meta' => 'color:#B729D9', 'key' => 'color:#56DB3A', 'index' => 'color:#1299DA', 'ellipsis' => 'color:#FF8400', 'ns' => 'user-select:none;'], 'light' => ['default' => 'background:none; color:#CC7832; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', 'num' => 'font-weight:bold; color:#1299DA', 'const' => 'font-weight:bold', 'str' => 'font-weight:bold; color:#629755;', 'note' => 'color:#6897BB', 'ref' => 'color:#6E6E6E', 'public' => 'color:#262626', 'protected' => 'color:#262626', 'private' => 'color:#262626', 'meta' => 'color:#B729D9', 'key' => 'color:#789339', 'index' => 'color:#1299DA', 'ellipsis' => 'color:#CC7832', 'ns' => 'user-select:none;']];
    protected $dumpHeader;
    protected $dumpPrefix = '<pre class=sf-dump id=%s data-indent-pad="%s">';
    protected $dumpSuffix = '</pre><script>Sfdump(%s)</script>';
    protected $dumpId = 'sf-dump';
    protected $colors = \true;
    protected $headerIsDumped = \false;
    protected $lastDepth = -1;
    protected $styles;
    private $displayOptions = ['maxDepth' => 1, 'maxStringLength' => 160, 'fileLinkFormat' => null];
    private $extraDisplayOptions = [];
    public function __construct($output = null, string $charset = null, int $flags = 0)
    {
        AbstractDumper::__construct($output, $charset, $flags);
        $this->dumpId = 'sf-dump-' . \mt_rand();
        $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: \get_cfg_var('xdebug.file_link_format');
        $this->styles = static::$themes['dark'] ?? self::$themes['dark'];
    }
    public function setStyles(array $styles)
    {
        $this->headerIsDumped = \false;
        $this->styles = $styles + $this->styles;
    }
    public function setTheme(string $themeName)
    {
        if (!isset(static::$themes[$themeName])) {
            throw new \InvalidArgumentException(\sprintf('Theme "%s" does not exist in class "%s".', $themeName, static::class));
        }
        $this->setStyles(static::$themes[$themeName]);
    }
    public function setDisplayOptions(array $displayOptions)
    {
        $this->headerIsDumped = \false;
        $this->displayOptions = $displayOptions + $this->displayOptions;
    }
    public function setDumpHeader(?string $header)
    {
        $this->dumpHeader = $header;
    }
    public function setDumpBoundaries(string $prefix, string $suffix)
    {
        $this->dumpPrefix = $prefix;
        $this->dumpSuffix = $suffix;
    }
    public function dump(Data $data, $output = null, array $extraDisplayOptions = [])
    {
        $this->extraDisplayOptions = $extraDisplayOptions;
        $result = parent::dump($data, $output);
        $this->dumpId = 'sf-dump-' . \mt_rand();
        return $result;
    }
    protected function getDumpHeader()
    {
        $this->headerIsDumped = $this->outputStream ?? $this->lineDumper;
        if (null !== $this->dumpHeader) {
            return $this->dumpHeader;
        }
        $line = \str_replace('{$options}', \json_encode($this->displayOptions, \JSON_FORCE_OBJECT), <<<'EOHTML'
<script>
Sfdump = window.Sfdump || (function (doc) {

var refStyle = doc.createElement('style'),
    rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
    idRx = /\bsf-dump-\d+-ref[012]\w+\b/,
    keyHint = 0 <= navigator.platform.toUpperCase().indexOf('MAC') ? 'Cmd' : 'Ctrl',
    addEventListener = function (e, n, cb) {
        e.addEventListener(n, cb, false);
    };

refStyle.innerHTML = 'pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }';
doc.head.appendChild(refStyle);
refStyle = doc.createElement('style');
doc.head.appendChild(refStyle);

if (!doc.addEventListener) {
    addEventListener = function (element, eventName, callback) {
        element.attachEvent('on' + eventName, function (e) {
            e.preventDefault = function () {e.returnValue = false;};
            e.target = e.srcElement;
            callback(e);
        });
    };
}

function toggle(a, recursive) {
    var s = a.nextSibling || {}, oldClass = s.className, arrow, newClass;

    if (/\bsf-dump-compact\b/.test(oldClass)) {
        arrow = 'â–¼';
        newClass = 'sf-dump-expanded';
    } else if (/\bsf-dump-expanded\b/.test(oldClass)) {
        arrow = 'â–¶';
        newClass = 'sf-dump-compact';
    } else {
        return false;
    }

    if (doc.createEvent && s.dispatchEvent) {
        var event = doc.createEvent('Event');
        event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false);

        s.dispatchEvent(event);
    }

    a.lastChild.innerHTML = arrow;
    s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass);

    if (recursive) {
        try {
            a = s.querySelectorAll('.'+oldClass);
            for (s = 0; s < a.length; ++s) {
                if (-1 == a[s].className.indexOf(newClass)) {
                    a[s].className = newClass;
                    a[s].previousSibling.lastChild.innerHTML = arrow;
                }
            }
        } catch (e) {
        }
    }

    return true;
};

function collapse(a, recursive) {
    var s = a.nextSibling || {}, oldClass = s.className;

    if (/\bsf-dump-expanded\b/.test(oldClass)) {
        toggle(a, recursive);

        return true;
    }

    return false;
};

function expand(a, recursive) {
    var s = a.nextSibling || {}, oldClass = s.className;

    if (/\bsf-dump-compact\b/.test(oldClass)) {
        toggle(a, recursive);

        return true;
    }

    return false;
};

function collapseAll(root) {
    var a = root.querySelector('a.sf-dump-toggle');
    if (a) {
        collapse(a, true);
        expand(a);

        return true;
    }

    return false;
}

function reveal(node) {
    var previous, parents = [];

    while ((node = node.parentNode || {}) && (previous = node.previousSibling) && 'A' === previous.tagName) {
        parents.push(previous);
    }

    if (0 !== parents.length) {
        parents.forEach(function (parent) {
            expand(parent);
        });

        return true;
    }

    return false;
}

function highlight(root, activeNode, nodes) {
    resetHighlightedNodes(root);

    Array.from(nodes||[]).forEach(function (node) {
        if (!/\bsf-dump-highlight\b/.test(node.className)) {
            node.className = node.className + ' sf-dump-highlight';
        }
    });

    if (!/\bsf-dump-highlight-active\b/.test(activeNode.className)) {
        activeNode.className = activeNode.className + ' sf-dump-highlight-active';
    }
}

function resetHighlightedNodes(root) {
    Array.from(root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private')).forEach(function (strNode) {
        strNode.className = strNode.className.replace(/\bsf-dump-highlight\b/, '');
        strNode.className = strNode.className.replace(/\bsf-dump-highlight-active\b/, '');
    });
}

return function (root, x) {
    root = doc.getElementById(root);

    var indentRx = new RegExp('^('+(root.getAttribute('data-indent-pad') || '  ').replace(rxEsc, '\\$1')+')+', 'm'),
        options = {$options},
        elt = root.getElementsByTagName('A'),
        len = elt.length,
        i = 0, s, h,
        t = [];

    while (i < len) t.push(elt[i++]);

    for (i in x) {
        options[i] = x[i];
    }

    function a(e, f) {
        addEventListener(root, e, function (e, n) {
            if ('A' == e.target.tagName) {
                f(e.target, e);
            } else if ('A' == e.target.parentNode.tagName) {
                f(e.target.parentNode, e);
            } else {
                n = /\bsf-dump-ellipsis\b/.test(e.target.className) ? e.target.parentNode : e.target;

                if ((n = n.nextElementSibling) && 'A' == n.tagName) {
                    if (!/\bsf-dump-toggle\b/.test(n.className)) {
                        n = n.nextElementSibling || n;
                    }

                    f(n, e, true);
                }
            }
        });
    };
    function isCtrlKey(e) {
        return e.ctrlKey || e.metaKey;
    }
    function xpathString(str) {
        var parts = str.match(/[^'"]+|['"]/g).map(function (part) {
            if ("'" == part)  {
                return '"\'"';
            }
            if ('"' == part) {
                return "'\"'";
            }

            return "'" + part + "'";
        });

        return "concat(" + parts.join(",") + ", '')";
    }
    function xpathHasClass(className) {
        return "contains(concat(' ', normalize-space(@class), ' '), ' " + className +" ')";
    }
    addEventListener(root, 'mouseover', function (e) {
        if ('' != refStyle.innerHTML) {
            refStyle.innerHTML = '';
        }
    });
    a('mouseover', function (a, e, c) {
        if (c) {
            e.target.style.cursor = "pointer";
        } else if (a = idRx.exec(a.className)) {
            try {
                refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-color: #B729D9; color: #FFF !important; border-radius: 2px}';
            } catch (e) {
            }
        }
    });
    a('click', function (a, e, c) {
        if (/\bsf-dump-toggle\b/.test(a.className)) {
            e.preventDefault();
            if (!toggle(a, isCtrlKey(e))) {
                var r = doc.getElementById(a.getAttribute('href').slice(1)),
                    s = r.previousSibling,
                    f = r.parentNode,
                    t = a.parentNode;
                t.replaceChild(r, a);
                f.replaceChild(a, s);
                t.insertBefore(s, r);
                f = f.firstChild.nodeValue.match(indentRx);
                t = t.firstChild.nodeValue.match(indentRx);
                if (f && t && f[0] !== t[0]) {
                    r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
                }
                if (/\bsf-dump-compact\b/.test(r.className)) {
                    toggle(s, isCtrlKey(e));
                }
            }

            if (c) {
            } else if (doc.getSelection) {
                try {
                    doc.getSelection().removeAllRanges();
                } catch (e) {
                    doc.getSelection().empty();
                }
            } else {
                doc.selection.empty();
            }
        } else if (/\bsf-dump-str-toggle\b/.test(a.className)) {
            e.preventDefault();
            e = a.parentNode.parentNode;
            e.className = e.className.replace(/\bsf-dump-str-(expand|collapse)\b/, a.parentNode.className);
        }
    });

    elt = root.getElementsByTagName('SAMP');
    len = elt.length;
    i = 0;

    while (i < len) t.push(elt[i++]);
    len = t.length;

    for (i = 0; i < len; ++i) {
        elt = t[i];
        if ('SAMP' == elt.tagName) {
            a = elt.previousSibling || {};
            if ('A' != a.tagName) {
                a = doc.createElement('A');
                a.className = 'sf-dump-ref';
                elt.parentNode.insertBefore(a, elt);
            } else {
                a.innerHTML += ' ';
            }
            a.title = (a.title ? a.title+'\n[' : '[')+keyHint+'+click] Expand all children';
            a.innerHTML += elt.className == 'sf-dump-compact' ? '<span>â–¶</span>' : '<span>â–¼</span>';
            a.className += ' sf-dump-toggle';

            x = 1;
            if ('sf-dump' != elt.parentNode.className) {
                x += elt.parentNode.getAttribute('data-depth')/1;
            }
        } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
            a = a.slice(1);
            elt.className += ' '+a;

            if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {
                a = a != elt.nextSibling.id && doc.getElementById(a);
                try {
                    s = a.nextSibling;
                    elt.appendChild(a);
                    s.parentNode.insertBefore(a, s);
                    if (/^[@#]/.test(elt.innerHTML)) {
                        elt.innerHTML += ' <span>â–¶</span>';
                    } else {
                        elt.innerHTML = '<span>â–¶</span>';
                        elt.className = 'sf-dump-ref';
                    }
                    elt.className += ' sf-dump-toggle';
                } catch (e) {
                    if ('&' == elt.innerHTML.charAt(0)) {
                        elt.innerHTML = 'â€¦';
                        elt.className = 'sf-dump-ref';
                    }
                }
            }
        }
    }

    if (doc.evaluate && Array.from && root.children.length > 1) {
        root.setAttribute('tabindex', 0);

        SearchState = function () {
            this.nodes = [];
            this.idx = 0;
        };
        SearchState.prototype = {
            next: function () {
                if (this.isEmpty()) {
                    return this.current();
                }
                this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0;

                return this.current();
            },
            previous: function () {
                if (this.isEmpty()) {
                    return this.current();
                }
                this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1);

                return this.current();
            },
            isEmpty: function () {
                return 0 === this.count();
            },
            current: function () {
                if (this.isEmpty()) {
                    return null;
                }
                return this.nodes[this.idx];
            },
            reset: function () {
                this.nodes = [];
                this.idx = 0;
            },
            count: function () {
                return this.nodes.length;
            },
        };

        function showCurrent(state)
        {
            var currentNode = state.current(), currentRect, searchRect;
            if (currentNode) {
                reveal(currentNode);
                highlight(root, currentNode, state.nodes);
                if ('scrollIntoView' in currentNode) {
                    currentNode.scrollIntoView(true);
                    currentRect = currentNode.getBoundingClientRect();
                    searchRect = search.getBoundingClientRect();
                    if (currentRect.top < (searchRect.top + searchRect.height)) {
                        window.scrollBy(0, -(searchRect.top + searchRect.height + 5));
                    }
                }
            }
            counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
        }

        var search = doc.createElement('div');
        search.className = 'sf-dump-search-wrapper sf-dump-search-hidden';
        search.innerHTML = '
            <input type="text" class="sf-dump-search-input">
            <span class="sf-dump-search-count">0 of 0<\/span>
            <button type="button" class="sf-dump-search-input-previous" tabindex="-1">
                <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1683 1331l-166 165q-19 19-45 19t-45-19L896 965l-531 531q-19 19-45 19t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19 45-19t45 19l742 741q19 19 19 45.5t-19 45.5z"\/><\/svg>
            <\/button>
            <button type="button" class="sf-dump-search-input-next" tabindex="-1">
                <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1683 808l-742 741q-19 19-45 19t-45-19L109 808q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"\/><\/svg>
            <\/button>
        ';
        root.insertBefore(search, root.firstChild);

        var state = new SearchState();
        var searchInput = search.querySelector('.sf-dump-search-input');
        var counter = search.querySelector('.sf-dump-search-count');
        var searchInputTimer = 0;
        var previousSearchQuery = '';

        addEventListener(searchInput, 'keyup', function (e) {
            var searchQuery = e.target.value;
            /* Don't perform anything if the pressed key didn't change the query */
            if (searchQuery === previousSearchQuery) {
                return;
            }
            previousSearchQuery = searchQuery;
            clearTimeout(searchInputTimer);
            searchInputTimer = setTimeout(function () {
                state.reset();
                collapseAll(root);
                resetHighlightedNodes(root);
                if ('' === searchQuery) {
                    counter.textContent = '0 of 0';

                    return;
                }

                var classMatches = [
                    "sf-dump-str",
                    "sf-dump-key",
                    "sf-dump-public",
                    "sf-dump-protected",
                    "sf-dump-private",
                ].map(xpathHasClass).join(' or ');

                var xpathResult = doc.evaluate('.//span[' + classMatches + '][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);

                while (node = xpathResult.iterateNext()) state.nodes.push(node);

                showCurrent(state);
            }, 400);
        });

        Array.from(search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous')).forEach(function (btn) {
            addEventListener(btn, 'click', function (e) {
                e.preventDefault();
                -1 !== e.target.className.indexOf('next') ? state.next() : state.previous();
                searchInput.focus();
                collapseAll(root);
                showCurrent(state);
            })
        });

        addEventListener(root, 'keydown', function (e) {
            var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className);
            if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) {
                /* F3 or CMD/CTRL + F */
                if (70 === e.keyCode && document.activeElement === searchInput) {
                   /*
                    * If CMD/CTRL + F is hit while having focus on search input,
                    * the user probably meant to trigger browser search instead.
                    * Let the browser execute its behavior:
                    */
                    return;
                }

                e.preventDefault();
                search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
                searchInput.focus();
            } else if (isSearchActive) {
                if (27 === e.keyCode) {
                    /* ESC key */
                    search.className += ' sf-dump-search-hidden';
                    e.preventDefault();
                    resetHighlightedNodes(root);
                    searchInput.value = '';
                } else if (
                    (isCtrlKey(e) && 71 === e.keyCode) /* CMD/CTRL + G */
                    || 13 === e.keyCode /* Enter */
                    || 114 === e.keyCode /* F3 */
                ) {
                    e.preventDefault();
                    e.shiftKey ? state.previous() : state.next();
                    collapseAll(root);
                    showCurrent(state);
                }
            }
        });
    }

    if (0 >= options.maxStringLength) {
        return;
    }
    try {
        elt = root.querySelectorAll('.sf-dump-str');
        len = elt.length;
        i = 0;
        t = [];

        while (i < len) t.push(elt[i++]);
        len = t.length;

        for (i = 0; i < len; ++i) {
            elt = t[i];
            s = elt.innerText || elt.textContent;
            x = s.length - options.maxStringLength;
            if (0 < x) {
                h = elt.innerHTML;
                elt[elt.innerText ? 'innerText' : 'textContent'] = s.substring(0, options.maxStringLength);
                elt.className += ' sf-dump-str-collapse';
                elt.innerHTML = '<span class=sf-dump-str-collapse>'+h+'<a class="sf-dump-ref sf-dump-str-toggle" title="Collapse"> â—€</a></span>'+
                    '<span class=sf-dump-str-expand>'+elt.innerHTML+'<a class="sf-dump-ref sf-dump-str-toggle" title="'+x+' remaining characters"> â–¶</a></span>';
            }
        }
    } catch (e) {
    }
};

})(document);
</script><style>
pre.sf-dump {
    display: block;
    white-space: pre;
    padding: 5px;
    overflow: initial !important;
}
pre.sf-dump:after {
   content: "";
   visibility: hidden;
   display: block;
   height: 0;
   clear: both;
}
pre.sf-dump span {
    display: inline;
}
pre.sf-dump a {
    text-decoration: none;
    cursor: pointer;
    border: 0;
    outline: none;
    color: inherit;
}
pre.sf-dump img {
    max-width: 50em;
    max-height: 50em;
    margin: .5em 0 0 0;
    padding: 0;
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAHUlEQVQY02O8zAABilCaiQEN0EeA8QuUcX9g3QEAAjcC5piyhyEAAAAASUVORK5CYII=) #D3D3D3;
}
pre.sf-dump .sf-dump-ellipsis {
    display: inline-block;
    overflow: visible;
    text-overflow: ellipsis;
    max-width: 5em;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: top;
}
pre.sf-dump .sf-dump-ellipsis+.sf-dump-ellipsis {
    max-width: none;
}
pre.sf-dump code {
    display:inline;
    padding:0;
    background:none;
}
.sf-dump-public.sf-dump-highlight,
.sf-dump-protected.sf-dump-highlight,
.sf-dump-private.sf-dump-highlight,
.sf-dump-str.sf-dump-highlight,
.sf-dump-key.sf-dump-highlight {
    background: rgba(111, 172, 204, 0.3);
    border: 1px solid #7DA0B1;
    border-radius: 3px;
}
.sf-dump-public.sf-dump-highlight-active,
.sf-dump-protected.sf-dump-highlight-active,
.sf-dump-private.sf-dump-highlight-active,
.sf-dump-str.sf-dump-highlight-active,
.sf-dump-key.sf-dump-highlight-active {
    background: rgba(253, 175, 0, 0.4);
    border: 1px solid #ffa500;
    border-radius: 3px;
}
pre.sf-dump .sf-dump-search-hidden {
    display: none !important;
}
pre.sf-dump .sf-dump-search-wrapper {
    font-size: 0;
    white-space: nowrap;
    margin-bottom: 5px;
    display: flex;
    position: -webkit-sticky;
    position: sticky;
    top: 5px;
}
pre.sf-dump .sf-dump-search-wrapper > * {
    vertical-align: top;
    box-sizing: border-box;
    height: 21px;
    font-weight: normal;
    border-radius: 0;
    background: #FFF;
    color: #757575;
    border: 1px solid #BBB;
}
pre.sf-dump .sf-dump-search-wrapper > input.sf-dump-search-input {
    padding: 3px;
    height: 21px;
    font-size: 12px;
    border-right: none;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    color: #000;
    min-width: 15px;
    width: 100%;
}
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next,
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous {
    background: #F2F2F2;
    outline: none;
    border-left: none;
    font-size: 0;
    line-height: 0;
}
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next > svg,
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous > svg {
    pointer-events: none;
    width: 12px;
    height: 12px;
}
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-count {
    display: inline-block;
    padding: 0 5px;
    margin: 0;
    border-left: none;
    line-height: 21px;
    font-size: 12px;
}
EOHTML
);
        foreach ($this->styles as $class => $style) {
            $line .= 'pre.sf-dump' . ('default' === $class ? ', pre.sf-dump' : '') . ' .sf-dump-' . $class . '{' . $style . '}';
        }
        $line .= 'pre.sf-dump .sf-dump-ellipsis-note{' . $this->styles['note'] . '}';
        return $this->dumpHeader = \preg_replace('/\\s+/', ' ', $line) . '</style>' . $this->dumpHeader;
    }
    public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
    {
        if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) {
            $this->dumpKey($cursor);
            $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []);
            $this->line .= $cursor->depth >= $this->displayOptions['maxDepth'] ? ' <samp class=sf-dump-compact>' : ' <samp class=sf-dump-expanded>';
            $this->endValue($cursor);
            $this->line .= $this->indentPad;
            $this->line .= \sprintf('<img src="data:%s;base64,%s" /></samp>', $cursor->attr['content-type'], \base64_encode($cursor->attr['img-data']));
            $this->endValue($cursor);
        } else {
            parent::dumpString($cursor, $str, $bin, $cut);
        }
    }
    public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild)
    {
        if (Cursor::HASH_OBJECT === $type) {
            $cursor->attr['depth'] = $cursor->depth;
        }
        parent::enterHash($cursor, $type, $class, \false);
        if ($cursor->skipChildren || $cursor->depth >= $this->displayOptions['maxDepth']) {
            $cursor->skipChildren = \false;
            $eol = ' class=sf-dump-compact>';
        } else {
            $this->expandNextHash = \false;
            $eol = ' class=sf-dump-expanded>';
        }
        if ($hasChild) {
            $this->line .= '<samp data-depth=' . ($cursor->depth + 1);
            if ($cursor->refIndex) {
                $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
                $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
                $this->line .= \sprintf(' id=%s-ref%s', $this->dumpId, $r);
            }
            $this->line .= $eol;
            $this->dumpLine($cursor->depth);
        }
    }
    public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut)
    {
        $this->dumpEllipsis($cursor, $hasChild, $cut);
        if ($hasChild) {
            $this->line .= '</samp>';
        }
        parent::leaveHash($cursor, $type, $class, $hasChild, 0);
    }
    protected function style(string $style, string $value, array $attr = [])
    {
        if ('' === $value) {
            return '';
        }
        $v = esc($value);
        if ('ref' === $style) {
            if (empty($attr['count'])) {
                return \sprintf('<a class=sf-dump-ref>%s</a>', $v);
            }
            $r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2) . \substr($value, 1);
            return \sprintf('<a class=sf-dump-ref href=#%s-ref%s title="%d occurrences">%s</a>', $this->dumpId, $r, 1 + $attr['count'], $v);
        }
        if ('const' === $style && isset($attr['value'])) {
            $style .= \sprintf(' title="%s"', esc(\is_scalar($attr['value']) ? $attr['value'] : \json_encode($attr['value'])));
        } elseif ('public' === $style) {
            $style .= \sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
        } elseif ('str' === $style && 1 < $attr['length']) {
            $style .= \sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
        } elseif ('note' === $style && 0 < ($attr['depth'] ?? 0) && \false !== ($c = \strrpos($value, '\\'))) {
            $style .= ' title=""';
            $attr += ['ellipsis' => \strlen($value) - $c, 'ellipsis-type' => 'note', 'ellipsis-tail' => 1];
        } elseif ('protected' === $style) {
            $style .= ' title="Protected property"';
        } elseif ('meta' === $style && isset($attr['title'])) {
            $style .= \sprintf(' title="%s"', esc($this->utf8Encode($attr['title'])));
        } elseif ('private' === $style) {
            $style .= \sprintf(' title="Private property defined in class:&#10;`%s`"', esc($this->utf8Encode($attr['class'])));
        }
        $map = static::$controlCharsMap;
        if (isset($attr['ellipsis'])) {
            $class = 'sf-dump-ellipsis';
            if (isset($attr['ellipsis-type'])) {
                $class = \sprintf('"%s sf-dump-ellipsis-%s"', $class, $attr['ellipsis-type']);
            }
            $label = esc(\substr($value, -$attr['ellipsis']));
            $style = \str_replace(' title="', " title=\"{$v}\n", $style);
            $v = \sprintf('<span class=%s>%s</span>', $class, \substr($v, 0, -\strlen($label)));
            if (!empty($attr['ellipsis-tail'])) {
                $tail = \strlen(esc(\substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
                $v .= \sprintf('<span class=%s>%s</span>%s', $class, \substr($label, 0, $tail), \substr($label, $tail));
            } else {
                $v .= $label;
            }
        }
        $v = "<span class=sf-dump-{$style}>" . \preg_replace_callback(static::$controlCharsRx, function ($c) use($map) {
            $s = $b = '<span class="sf-dump-default';
            $c = $c[$i = 0];
            if ($ns = "\r" === $c[$i] || "\n" === $c[$i]) {
                $s .= ' sf-dump-ns';
            }
            $s .= '">';
            do {
                if (("\r" === $c[$i] || "\n" === $c[$i]) !== $ns) {
                    $s .= '</span>' . $b;
                    if ($ns = !$ns) {
                        $s .= ' sf-dump-ns';
                    }
                    $s .= '">';
                }
                $s .= $map[$c[$i]] ?? \sprintf('\\x%02X', \ord($c[$i]));
            } while (isset($c[++$i]));
            return $s . '</span>';
        }, $v) . '</span>';
        if (isset($attr['file']) && ($href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0))) {
            $attr['href'] = $href;
        }
        if (isset($attr['href'])) {
            $target = isset($attr['file']) ? '' : ' target="_blank"';
            $v = \sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v);
        }
        if (isset($attr['lang'])) {
            $v = \sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
        }
        return $v;
    }
    protected function dumpLine(int $depth, bool $endOfValue = \false)
    {
        if (-1 === $this->lastDepth) {
            $this->line = \sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad) . $this->line;
        }
        if ($this->headerIsDumped !== ($this->outputStream ?? $this->lineDumper)) {
            $this->line = $this->getDumpHeader() . $this->line;
        }
        if (-1 === $depth) {
            $args = ['"' . $this->dumpId . '"'];
            if ($this->extraDisplayOptions) {
                $args[] = \json_encode($this->extraDisplayOptions, \JSON_FORCE_OBJECT);
            }
            $this->line .= \sprintf(\str_replace('"%s"', '%s', $this->dumpSuffix), \implode(', ', $args));
        }
        $this->lastDepth = $depth;
        $this->line = \mb_encode_numericentity($this->line, [0x80, 0x10ffff, 0, 0x1fffff], 'UTF-8');
        if (-1 === $depth) {
            AbstractDumper::dumpLine(0);
        }
        AbstractDumper::dumpLine($depth);
    }
    private function getSourceLink(string $file, int $line)
    {
        $options = $this->extraDisplayOptions + $this->displayOptions;
        if ($fmt = $options['fileLinkFormat']) {
            return \is_string($fmt) ? \strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);
        }
        return \false;
    }
}
function esc(string $str)
{
    return \htmlspecialchars($str, \ENT_QUOTES, 'UTF-8');
}
<?php

namespace Cvphar\Symfony\Component\VarDumper;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Cvphar\Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
use Cvphar\Symfony\Component\VarDumper\Caster\ReflectionCaster;
use Cvphar\Symfony\Component\VarDumper\Cloner\VarCloner;
use Cvphar\Symfony\Component\VarDumper\Dumper\CliDumper;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
use Cvphar\Symfony\Component\VarDumper\Dumper\ContextualizedDumper;
use Cvphar\Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Cvphar\Symfony\Component\VarDumper\Dumper\ServerDumper;
require_once __DIR__ . '/Resources/functions/dump.php';
class VarDumper
{
    private static $handler;
    public static function dump($var)
    {
        if (null === self::$handler) {
            self::register();
        }
        return (self::$handler)($var);
    }
    public static function setHandler(callable $callable = null)
    {
        $prevHandler = self::$handler;
        if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
            return $prevHandler;
        }
        self::$handler = $callable;
        return $prevHandler;
    }
    private static function register() : void
    {
        $cloner = new VarCloner();
        $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
        $format = $_SERVER['VAR_DUMPER_FORMAT'] ?? null;
        switch (\true) {
            case 'html' === $format:
                $dumper = new HtmlDumper();
                break;
            case 'cli' === $format:
                $dumper = new CliDumper();
                break;
            case 'server' === $format:
            case $format && 'tcp' === \parse_url($format, \PHP_URL_SCHEME):
                $host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format;
                $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], \true) ? new CliDumper() : new HtmlDumper();
                $dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders());
                break;
            default:
                $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], \true) ? new CliDumper() : new HtmlDumper();
        }
        if (!$dumper instanceof ServerDumper) {
            $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]);
        }
        self::$handler = function ($var) use($cloner, $dumper) {
            $dumper->dump($cloner->cloneVar($var));
        };
    }
    private static function getDefaultContextProviders() : array
    {
        $contextProviders = [];
        if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], \true) && \class_exists(Request::class)) {
            $requestStack = new RequestStack();
            $requestStack->push(Request::createFromGlobals());
            $contextProviders['request'] = new RequestContextProvider($requestStack);
        }
        $fileLinkFormatter = \class_exists(FileLinkFormatter::class) ? new FileLinkFormatter(null, $requestStack ?? null) : null;
        return $contextProviders + ['cli' => new CliContextProvider(), 'source' => new SourceContextProvider(null, null, $fileLinkFormatter)];
    }
}
<?php

namespace Cvphar\Symfony\Contracts\Service;

interface ServiceSubscriberInterface
{
    public static function getSubscribedServices();
}
<?php

namespace Cvphar\Symfony\Contracts\Service;

interface ResetInterface
{
    public function reset();
}
<?php

namespace Cvphar\Symfony\Contracts\Service;

use Cvphar\Psr\Container\ContainerInterface;
interface ServiceProviderInterface extends ContainerInterface
{
    public function getProvidedServices() : array;
}
<?php

namespace Cvphar\Symfony\Contracts\Service;

use Cvphar\Psr\Container\ContainerInterface;
trait ServiceSubscriberTrait
{
    protected $container;
    public static function getSubscribedServices() : array
    {
        static $services;
        if (null !== $services) {
            return $services;
        }
        $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : [];
        foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {
            if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) {
                continue;
            }
            if (self::class !== $method->getDeclaringClass()->name) {
                continue;
            }
            if (!($returnType = $method->getReturnType()) instanceof \ReflectionNamedType) {
                continue;
            }
            if ($returnType->isBuiltin()) {
                continue;
            }
            $services[self::class . '::' . $method->name] = '?' . $returnType->getName();
        }
        return $services;
    }
    public function setContainer(ContainerInterface $container)
    {
        $this->container = $container;
        if (\is_callable(['parent', __FUNCTION__])) {
            return parent::setContainer($container);
        }
        return null;
    }
}
<?php

namespace Cvphar\Symfony\Contracts\Service;

use Cvphar\Psr\Container\ContainerExceptionInterface;
use Cvphar\Psr\Container\NotFoundExceptionInterface;
\class_exists(ContainerExceptionInterface::class);
\class_exists(NotFoundExceptionInterface::class);
trait ServiceLocatorTrait
{
    private $factories;
    private $loading = [];
    private $providedTypes;
    public function __construct(array $factories)
    {
        $this->factories = $factories;
    }
    public function has($id)
    {
        return isset($this->factories[$id]);
    }
    public function get($id)
    {
        if (!isset($this->factories[$id])) {
            throw $this->createNotFoundException($id);
        }
        if (isset($this->loading[$id])) {
            $ids = \array_values($this->loading);
            $ids = \array_slice($this->loading, \array_search($id, $ids));
            $ids[] = $id;
            throw $this->createCircularReferenceException($id, $ids);
        }
        $this->loading[$id] = $id;
        try {
            return $this->factories[$id]($this);
        } finally {
            unset($this->loading[$id]);
        }
    }
    public function getProvidedServices() : array
    {
        if (null === $this->providedTypes) {
            $this->providedTypes = [];
            foreach ($this->factories as $name => $factory) {
                if (!\is_callable($factory)) {
                    $this->providedTypes[$name] = '?';
                } else {
                    $type = (new \ReflectionFunction($factory))->getReturnType();
                    $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '') . ($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?';
                }
            }
        }
        return $this->providedTypes;
    }
    private function createNotFoundException(string $id) : NotFoundExceptionInterface
    {
        if (!($alternatives = \array_keys($this->factories))) {
            $message = 'is empty...';
        } else {
            $last = \array_pop($alternatives);
            if ($alternatives) {
                $message = \sprintf('only knows about the "%s" and "%s" services.', \implode('", "', $alternatives), $last);
            } else {
                $message = \sprintf('only knows about the "%s" service.', $last);
            }
        }
        if ($this->loading) {
            $message = \sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', \end($this->loading), $id, $message);
        } else {
            $message = \sprintf('Service "%s" not found: the current service locator %s', $id, $message);
        }
        return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface
        {
        };
    }
    private function createCircularReferenceException(string $id, array $path) : ContainerExceptionInterface
    {
        return new class(\sprintf('Circular reference detected for service "%s", path: "%s".', $id, \implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface
        {
        };
    }
}
<?php

namespace Cvphar\Symfony\Component\Process;

class ExecutableFinder
{
    private $suffixes = ['.exe', '.bat', '.cmd', '.com'];
    public function setSuffixes(array $suffixes)
    {
        $this->suffixes = $suffixes;
    }
    public function addSuffix($suffix)
    {
        $this->suffixes[] = $suffix;
    }
    public function find($name, $default = null, array $extraDirs = [])
    {
        if (\ini_get('open_basedir')) {
            $searchPath = \array_merge(\explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs);
            $dirs = [];
            foreach ($searchPath as $path) {
                if (@\is_dir($path)) {
                    $dirs[] = $path;
                } else {
                    if (\basename($path) == $name && @\is_executable($path)) {
                        return $path;
                    }
                }
            }
        } else {
            $dirs = \array_merge(\explode(\PATH_SEPARATOR, \getenv('PATH') ?: \getenv('Path')), $extraDirs);
        }
        $suffixes = [''];
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $pathExt = \getenv('PATHEXT');
            $suffixes = \array_merge($pathExt ? \explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes);
        }
        foreach ($suffixes as $suffix) {
            foreach ($dirs as $dir) {
                if (@\is_file($file = $dir . \DIRECTORY_SEPARATOR . $name . $suffix) && ('\\' === \DIRECTORY_SEPARATOR || @\is_executable($file))) {
                    return $file;
                }
            }
        }
        return $default;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Pipes;

use Cvphar\Symfony\Component\Process\Process;
class UnixPipes extends AbstractPipes
{
    private $ttyMode;
    private $ptyMode;
    private $haveReadSupport;
    public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport)
    {
        $this->ttyMode = $ttyMode;
        $this->ptyMode = $ptyMode;
        $this->haveReadSupport = $haveReadSupport;
        parent::__construct($input);
    }
    public function __sleep()
    {
        throw new \BadMethodCallException('Cannot serialize ' . __CLASS__);
    }
    public function __wakeup()
    {
        throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
    }
    public function __destruct()
    {
        $this->close();
    }
    public function getDescriptors() : array
    {
        if (!$this->haveReadSupport) {
            $nullstream = \fopen('/dev/null', 'c');
            return [['pipe', 'r'], $nullstream, $nullstream];
        }
        if ($this->ttyMode) {
            return [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']];
        }
        if ($this->ptyMode && Process::isPtySupported()) {
            return [['pty'], ['pty'], ['pty']];
        }
        return [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']];
    }
    public function getFiles() : array
    {
        return [];
    }
    public function readAndWrite(bool $blocking, bool $close = \false) : array
    {
        $this->unblock();
        $w = $this->write();
        $read = $e = [];
        $r = $this->pipes;
        unset($r[0]);
        \set_error_handler([$this, 'handleError']);
        if (($r || $w) && \false === \stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1000000.0 : 0)) {
            \restore_error_handler();
            if (!$this->hasSystemCallBeenInterrupted()) {
                $this->pipes = [];
            }
            return $read;
        }
        \restore_error_handler();
        foreach ($r as $pipe) {
            $read[$type = \array_search($pipe, $this->pipes, \true)] = '';
            do {
                $data = @\fread($pipe, self::CHUNK_SIZE);
                $read[$type] .= $data;
            } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1])));
            if (!isset($read[$type][0])) {
                unset($read[$type]);
            }
            if ($close && \feof($pipe)) {
                \fclose($pipe);
                unset($this->pipes[$type]);
            }
        }
        return $read;
    }
    public function haveReadSupport() : bool
    {
        return $this->haveReadSupport;
    }
    public function areOpen() : bool
    {
        return (bool) $this->pipes;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Pipes;

use Cvphar\Symfony\Component\Process\Exception\RuntimeException;
use Cvphar\Symfony\Component\Process\Process;
class WindowsPipes extends AbstractPipes
{
    private $files = [];
    private $fileHandles = [];
    private $lockHandles = [];
    private $readBytes = [Process::STDOUT => 0, Process::STDERR => 0];
    private $haveReadSupport;
    public function __construct($input, bool $haveReadSupport)
    {
        $this->haveReadSupport = $haveReadSupport;
        if ($this->haveReadSupport) {
            $pipes = [Process::STDOUT => Process::OUT, Process::STDERR => Process::ERR];
            $tmpDir = \sys_get_temp_dir();
            $lastError = 'unknown reason';
            \set_error_handler(function ($type, $msg) use(&$lastError) {
                $lastError = $msg;
            });
            for ($i = 0;; ++$i) {
                foreach ($pipes as $pipe => $name) {
                    $file = \sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
                    if (!($h = \fopen($file . '.lock', 'w'))) {
                        if (\file_exists($file . '.lock')) {
                            continue 2;
                        }
                        \restore_error_handler();
                        throw new RuntimeException('A temporary file could not be opened to write the process output: ' . $lastError);
                    }
                    if (!\flock($h, \LOCK_EX | \LOCK_NB)) {
                        continue 2;
                    }
                    if (isset($this->lockHandles[$pipe])) {
                        \flock($this->lockHandles[$pipe], \LOCK_UN);
                        \fclose($this->lockHandles[$pipe]);
                    }
                    $this->lockHandles[$pipe] = $h;
                    if (!($h = \fopen($file, 'w')) || !\fclose($h) || !($h = \fopen($file, 'r'))) {
                        \flock($this->lockHandles[$pipe], \LOCK_UN);
                        \fclose($this->lockHandles[$pipe]);
                        unset($this->lockHandles[$pipe]);
                        continue 2;
                    }
                    $this->fileHandles[$pipe] = $h;
                    $this->files[$pipe] = $file;
                }
                break;
            }
            \restore_error_handler();
        }
        parent::__construct($input);
    }
    public function __sleep()
    {
        throw new \BadMethodCallException('Cannot serialize ' . __CLASS__);
    }
    public function __wakeup()
    {
        throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
    }
    public function __destruct()
    {
        $this->close();
    }
    public function getDescriptors() : array
    {
        if (!$this->haveReadSupport) {
            $nullstream = \fopen('NUL', 'c');
            return [['pipe', 'r'], $nullstream, $nullstream];
        }
        return [['pipe', 'r'], ['file', 'NUL', 'w'], ['file', 'NUL', 'w']];
    }
    public function getFiles() : array
    {
        return $this->files;
    }
    public function readAndWrite(bool $blocking, bool $close = \false) : array
    {
        $this->unblock();
        $w = $this->write();
        $read = $r = $e = [];
        if ($blocking) {
            if ($w) {
                @\stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1000000.0);
            } elseif ($this->fileHandles) {
                \usleep(Process::TIMEOUT_PRECISION * 1000000.0);
            }
        }
        foreach ($this->fileHandles as $type => $fileHandle) {
            $data = \stream_get_contents($fileHandle, -1, $this->readBytes[$type]);
            if (isset($data[0])) {
                $this->readBytes[$type] += \strlen($data);
                $read[$type] = $data;
            }
            if ($close) {
                \ftruncate($fileHandle, 0);
                \fclose($fileHandle);
                \flock($this->lockHandles[$type], \LOCK_UN);
                \fclose($this->lockHandles[$type]);
                unset($this->fileHandles[$type], $this->lockHandles[$type]);
            }
        }
        return $read;
    }
    public function haveReadSupport() : bool
    {
        return $this->haveReadSupport;
    }
    public function areOpen() : bool
    {
        return $this->pipes && $this->fileHandles;
    }
    public function close()
    {
        parent::close();
        foreach ($this->fileHandles as $type => $handle) {
            \ftruncate($handle, 0);
            \fclose($handle);
            \flock($this->lockHandles[$type], \LOCK_UN);
            \fclose($this->lockHandles[$type]);
        }
        $this->fileHandles = $this->lockHandles = [];
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Pipes;

use Cvphar\Symfony\Component\Process\Exception\InvalidArgumentException;
abstract class AbstractPipes implements PipesInterface
{
    public $pipes = [];
    private $inputBuffer = '';
    private $input;
    private $blocked = \true;
    private $lastError;
    public function __construct($input)
    {
        if (\is_resource($input) || $input instanceof \Iterator) {
            $this->input = $input;
        } elseif (\is_string($input)) {
            $this->inputBuffer = $input;
        } else {
            $this->inputBuffer = (string) $input;
        }
    }
    public function close()
    {
        foreach ($this->pipes as $pipe) {
            \fclose($pipe);
        }
        $this->pipes = [];
    }
    protected function hasSystemCallBeenInterrupted() : bool
    {
        $lastError = $this->lastError;
        $this->lastError = null;
        return null !== $lastError && \false !== \stripos($lastError, 'interrupted system call');
    }
    protected function unblock()
    {
        if (!$this->blocked) {
            return;
        }
        foreach ($this->pipes as $pipe) {
            \stream_set_blocking($pipe, 0);
        }
        if (\is_resource($this->input)) {
            \stream_set_blocking($this->input, 0);
        }
        $this->blocked = \false;
    }
    protected function write() : ?array
    {
        if (!isset($this->pipes[0])) {
            return null;
        }
        $input = $this->input;
        if ($input instanceof \Iterator) {
            if (!$input->valid()) {
                $input = null;
            } elseif (\is_resource($input = $input->current())) {
                \stream_set_blocking($input, 0);
            } elseif (!isset($this->inputBuffer[0])) {
                if (!\is_string($input)) {
                    if (!\is_scalar($input)) {
                        throw new InvalidArgumentException(\sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', \get_class($this->input), \gettype($input)));
                    }
                    $input = (string) $input;
                }
                $this->inputBuffer = $input;
                $this->input->next();
                $input = null;
            } else {
                $input = null;
            }
        }
        $r = $e = [];
        $w = [$this->pipes[0]];
        if (\false === @\stream_select($r, $w, $e, 0, 0)) {
            return null;
        }
        foreach ($w as $stdin) {
            if (isset($this->inputBuffer[0])) {
                $written = \fwrite($stdin, $this->inputBuffer);
                $this->inputBuffer = \substr($this->inputBuffer, $written);
                if (isset($this->inputBuffer[0])) {
                    return [$this->pipes[0]];
                }
            }
            if ($input) {
                for (;;) {
                    $data = \fread($input, self::CHUNK_SIZE);
                    if (!isset($data[0])) {
                        break;
                    }
                    $written = \fwrite($stdin, $data);
                    $data = \substr($data, $written);
                    if (isset($data[0])) {
                        $this->inputBuffer = $data;
                        return [$this->pipes[0]];
                    }
                }
                if (\feof($input)) {
                    if ($this->input instanceof \Iterator) {
                        $this->input->next();
                    } else {
                        $this->input = null;
                    }
                }
            }
        }
        if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) {
            $this->input = null;
            \fclose($this->pipes[0]);
            unset($this->pipes[0]);
        } elseif (!$w) {
            return [$this->pipes[0]];
        }
        return null;
    }
    public function handleError(int $type, string $msg)
    {
        $this->lastError = $msg;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Pipes;

interface PipesInterface
{
    public const CHUNK_SIZE = 16384;
    public function getDescriptors() : array;
    public function getFiles() : array;
    public function readAndWrite(bool $blocking, bool $close = \false) : array;
    public function areOpen() : bool;
    public function haveReadSupport() : bool;
    public function close();
}
<?php

namespace Cvphar\Symfony\Component\Process;

use Cvphar\Symfony\Component\Process\Exception\RuntimeException;
class InputStream implements \IteratorAggregate
{
    private $onEmpty = null;
    private $input = [];
    private $open = \true;
    public function onEmpty(callable $onEmpty = null)
    {
        $this->onEmpty = $onEmpty;
    }
    public function write($input)
    {
        if (null === $input) {
            return;
        }
        if ($this->isClosed()) {
            throw new RuntimeException(\sprintf('"%s" is closed.', static::class));
        }
        $this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
    }
    public function close()
    {
        $this->open = \false;
    }
    public function isClosed()
    {
        return !$this->open;
    }
    #[\ReturnTypeWillChange]
    public function getIterator()
    {
        $this->open = \true;
        while ($this->open || $this->input) {
            if (!$this->input) {
                (yield '');
                continue;
            }
            $current = \array_shift($this->input);
            if ($current instanceof \Iterator) {
                yield from $current;
            } else {
                (yield $current);
            }
            if (!$this->input && $this->open && null !== ($onEmpty = $this->onEmpty)) {
                $this->write($onEmpty($this));
            }
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Process;

use Cvphar\Symfony\Component\Process\Exception\LogicException;
use Cvphar\Symfony\Component\Process\Exception\RuntimeException;
class PhpProcess extends Process
{
    public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null)
    {
        if (null === $php) {
            $executableFinder = new PhpExecutableFinder();
            $php = $executableFinder->find(\false);
            $php = \false === $php ? null : \array_merge([$php], $executableFinder->findArguments());
        }
        if ('phpdbg' === \PHP_SAPI) {
            $file = \tempnam(\sys_get_temp_dir(), 'dbg');
            \file_put_contents($file, $script);
            \register_shutdown_function('unlink', $file);
            $php[] = $file;
            $script = null;
        }
        parent::__construct($php, $cwd, $env, $script, $timeout);
    }
    public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
    {
        throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class));
    }
    public function setPhpBinary($php)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.2, use the $php argument of the constructor instead.', __METHOD__), \E_USER_DEPRECATED);
        $this->setCommandLine($php);
    }
    public function start(callable $callback = null, array $env = [])
    {
        if (null === $this->getCommandLine()) {
            throw new RuntimeException('Unable to find the PHP executable.');
        }
        parent::start($callback, $env);
    }
}
<?php

namespace Cvphar\Symfony\Component\Process;

class PhpExecutableFinder
{
    private $executableFinder;
    public function __construct()
    {
        $this->executableFinder = new ExecutableFinder();
    }
    public function find($includeArgs = \true)
    {
        if ($php = \getenv('PHP_BINARY')) {
            if (!\is_executable($php)) {
                $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
                if ($php = \strtok(\exec($command . ' ' . \escapeshellarg($php)), \PHP_EOL)) {
                    if (!\is_executable($php)) {
                        return \false;
                    }
                } else {
                    return \false;
                }
            }
            return $php;
        }
        $args = $this->findArguments();
        $args = $includeArgs && $args ? ' ' . \implode(' ', $args) : '';
        if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], \true)) {
            return \PHP_BINARY . $args;
        }
        if ($php = \getenv('PHP_PATH')) {
            if (!@\is_executable($php)) {
                return \false;
            }
            return $php;
        }
        if ($php = \getenv('PHP_PEAR_PHP_BIN')) {
            if (@\is_executable($php)) {
                return $php;
            }
        }
        if (@\is_executable($php = \PHP_BINDIR . ('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
            return $php;
        }
        $dirs = [\PHP_BINDIR];
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $dirs[] = 'C:\\xampp\\php\\';
        }
        return $this->executableFinder->find('php', \false, $dirs);
    }
    public function findArguments()
    {
        $arguments = [];
        if ('phpdbg' === \PHP_SAPI) {
            $arguments[] = '-qrr';
        }
        return $arguments;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

use Cvphar\Symfony\Component\Process\Process;
final class ProcessSignaledException extends RuntimeException
{
    private $process;
    public function __construct(Process $process)
    {
        $this->process = $process;
        parent::__construct(\sprintf('The process has been signaled with signal "%s".', $process->getTermSignal()));
    }
    public function getProcess() : Process
    {
        return $this->process;
    }
    public function getSignal() : int
    {
        return $this->getProcess()->getTermSignal();
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

class LogicException extends \LogicException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

interface ExceptionInterface extends \Throwable
{
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

use Cvphar\Symfony\Component\Process\Process;
class ProcessFailedException extends RuntimeException
{
    private $process;
    public function __construct(Process $process)
    {
        if ($process->isSuccessful()) {
            throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
        }
        $error = \sprintf('The command "%s" failed.' . "\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), $process->getWorkingDirectory());
        if (!$process->isOutputDisabled()) {
            $error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput());
        }
        parent::__construct($error);
        $this->process = $process;
    }
    public function getProcess()
    {
        return $this->process;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

use Cvphar\Symfony\Component\Process\Process;
class ProcessTimedOutException extends RuntimeException
{
    public const TYPE_GENERAL = 1;
    public const TYPE_IDLE = 2;
    private $process;
    private $timeoutType;
    public function __construct(Process $process, int $timeoutType)
    {
        $this->process = $process;
        $this->timeoutType = $timeoutType;
        parent::__construct(\sprintf('The process "%s" exceeded the timeout of %s seconds.', $process->getCommandLine(), $this->getExceededTimeout()));
    }
    public function getProcess()
    {
        return $this->process;
    }
    public function isGeneralTimeout()
    {
        return self::TYPE_GENERAL === $this->timeoutType;
    }
    public function isIdleTimeout()
    {
        return self::TYPE_IDLE === $this->timeoutType;
    }
    public function getExceededTimeout()
    {
        switch ($this->timeoutType) {
            case self::TYPE_GENERAL:
                return $this->process->getTimeout();
            case self::TYPE_IDLE:
                return $this->process->getIdleTimeout();
            default:
                throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType));
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Process\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Process;

use Cvphar\Symfony\Component\Process\Exception\InvalidArgumentException;
class ProcessUtils
{
    private function __construct()
    {
    }
    public static function validateInput($caller, $input)
    {
        if (null !== $input) {
            if (\is_resource($input)) {
                return $input;
            }
            if (\is_string($input)) {
                return $input;
            }
            if (\is_scalar($input)) {
                return (string) $input;
            }
            if ($input instanceof Process) {
                return $input->getIterator($input::ITER_SKIP_ERR);
            }
            if ($input instanceof \Iterator) {
                return $input;
            }
            if ($input instanceof \Traversable) {
                return new \IteratorIterator($input);
            }
            throw new InvalidArgumentException(\sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller));
        }
        return $input;
    }
}
<?php

namespace Cvphar\Symfony\Component\Process;

use Cvphar\Symfony\Component\Process\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Process\Exception\LogicException;
use Cvphar\Symfony\Component\Process\Exception\ProcessFailedException;
use Cvphar\Symfony\Component\Process\Exception\ProcessSignaledException;
use Cvphar\Symfony\Component\Process\Exception\ProcessTimedOutException;
use Cvphar\Symfony\Component\Process\Exception\RuntimeException;
use Cvphar\Symfony\Component\Process\Pipes\PipesInterface;
use Cvphar\Symfony\Component\Process\Pipes\UnixPipes;
use Cvphar\Symfony\Component\Process\Pipes\WindowsPipes;
class Process implements \IteratorAggregate
{
    public const ERR = 'err';
    public const OUT = 'out';
    public const STATUS_READY = 'ready';
    public const STATUS_STARTED = 'started';
    public const STATUS_TERMINATED = 'terminated';
    public const STDIN = 0;
    public const STDOUT = 1;
    public const STDERR = 2;
    public const TIMEOUT_PRECISION = 0.2;
    public const ITER_NON_BLOCKING = 1;
    public const ITER_KEEP_OUTPUT = 2;
    public const ITER_SKIP_OUT = 4;
    public const ITER_SKIP_ERR = 8;
    private $callback;
    private $hasCallback = \false;
    private $commandline;
    private $cwd;
    private $env;
    private $input;
    private $starttime;
    private $lastOutputTime;
    private $timeout;
    private $idleTimeout;
    private $exitcode;
    private $fallbackStatus = [];
    private $processInformation;
    private $outputDisabled = \false;
    private $stdout;
    private $stderr;
    private $process;
    private $status = self::STATUS_READY;
    private $incrementalOutputOffset = 0;
    private $incrementalErrorOutputOffset = 0;
    private $tty = \false;
    private $pty;
    private $useFileHandles = \false;
    private $processPipes;
    private $latestSignal;
    private static $sigchild;
    public static $exitCodes = [0 => 'OK', 1 => 'General error', 2 => 'Misuse of shell builtins', 126 => 'Invoked command cannot execute', 127 => 'Command not found', 128 => 'Invalid exit argument', 129 => 'Hangup', 130 => 'Interrupt', 131 => 'Quit and dump core', 132 => 'Illegal instruction', 133 => 'Trace/breakpoint trap', 134 => 'Process aborted', 135 => 'Bus error: "access to undefined portion of memory object"', 136 => 'Floating point exception: "erroneous arithmetic operation"', 137 => 'Kill (terminate immediately)', 138 => 'User-defined 1', 139 => 'Segmentation violation', 140 => 'User-defined 2', 141 => 'Write to pipe with no one reading', 142 => 'Signal raised by alarm', 143 => 'Termination (request to terminate)', 145 => 'Child process terminated, stopped (or continued*)', 146 => 'Continue if stopped', 147 => 'Stop executing temporarily', 148 => 'Terminal stop signal', 149 => 'Background process attempting to read from tty ("in")', 150 => 'Background process attempting to write to tty ("out")', 151 => 'Urgent data available on socket', 152 => 'CPU time limit exceeded', 153 => 'File size limit exceeded', 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', 155 => 'Profiling timer expired', 157 => 'Pollable event', 159 => 'Bad syscall'];
    public function __construct($command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
    {
        if (!\function_exists('proc_open')) {
            throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.');
        }
        if (!\is_array($command)) {
            @\trigger_error(\sprintf('Passing a command as string when creating a "%s" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.', __CLASS__), \E_USER_DEPRECATED);
        }
        $this->commandline = $command;
        $this->cwd = $cwd;
        if (null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR)) {
            $this->cwd = \getcwd();
        }
        if (null !== $env) {
            $this->setEnv($env);
        }
        $this->setInput($input);
        $this->setTimeout($timeout);
        $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR;
        $this->pty = \false;
    }
    public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
    {
        $process = new static([], $cwd, $env, $input, $timeout);
        $process->commandline = $command;
        return $process;
    }
    public function __sleep()
    {
        throw new \BadMethodCallException('Cannot serialize ' . __CLASS__);
    }
    public function __wakeup()
    {
        throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
    }
    public function __destruct()
    {
        $this->stop(0);
    }
    public function __clone()
    {
        $this->resetProcessData();
    }
    public function run(callable $callback = null, array $env = []) : int
    {
        $this->start($callback, $env);
        return $this->wait();
    }
    public function mustRun(callable $callback = null, array $env = []) : self
    {
        if (0 !== $this->run($callback, $env)) {
            throw new ProcessFailedException($this);
        }
        return $this;
    }
    public function start(callable $callback = null, array $env = [])
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Process is already running.');
        }
        $this->resetProcessData();
        $this->starttime = $this->lastOutputTime = \microtime(\true);
        $this->callback = $this->buildCallback($callback);
        $this->hasCallback = null !== $callback;
        $descriptors = $this->getDescriptors();
        if ($this->env) {
            $env += $this->env;
        }
        $env += $this->getDefaultEnv();
        if (\is_array($commandline = $this->commandline)) {
            $commandline = \implode(' ', \array_map([$this, 'escapeArgument'], $commandline));
            if ('\\' !== \DIRECTORY_SEPARATOR) {
                $commandline = 'exec ' . $commandline;
            }
        } else {
            $commandline = $this->replacePlaceholders($commandline, $env);
        }
        $options = ['suppress_errors' => \true];
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $options['bypass_shell'] = \true;
            $commandline = $this->prepareWindowsCommandLine($commandline, $env);
        } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) {
            $descriptors[3] = ['pipe', 'w'];
            $commandline = '{ (' . $commandline . ') <&3 3<&- 3>/dev/null & } 3<&0;';
            $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code';
            $ptsWorkaround = \fopen(__FILE__, 'r');
        }
        $envPairs = [];
        foreach ($env as $k => $v) {
            if (\false !== $v && 'argc' !== $k && 'argv' !== $k) {
                $envPairs[] = $k . '=' . $v;
            }
        }
        if (!\is_dir($this->cwd)) {
            throw new RuntimeException(\sprintf('The provided cwd "%s" does not exist.', $this->cwd));
        }
        $this->process = @\proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $options);
        if (!\is_resource($this->process)) {
            throw new RuntimeException('Unable to launch a new process.');
        }
        $this->status = self::STATUS_STARTED;
        if (isset($descriptors[3])) {
            $this->fallbackStatus['pid'] = (int) \fgets($this->processPipes->pipes[3]);
        }
        if ($this->tty) {
            return;
        }
        $this->updateStatus(\false);
        $this->checkTimeout();
    }
    public function restart(callable $callback = null, array $env = []) : self
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Process is already running.');
        }
        $process = clone $this;
        $process->start($callback, $env);
        return $process;
    }
    public function wait(callable $callback = null)
    {
        $this->requireProcessIsStarted(__FUNCTION__);
        $this->updateStatus(\false);
        if (null !== $callback) {
            if (!$this->processPipes->haveReadSupport()) {
                $this->stop(0);
                throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".');
            }
            $this->callback = $this->buildCallback($callback);
        }
        do {
            $this->checkTimeout();
            $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
            $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
        } while ($running);
        while ($this->isRunning()) {
            $this->checkTimeout();
            \usleep(1000);
        }
        if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
            throw new ProcessSignaledException($this);
        }
        return $this->exitcode;
    }
    public function waitUntil(callable $callback) : bool
    {
        $this->requireProcessIsStarted(__FUNCTION__);
        $this->updateStatus(\false);
        if (!$this->processPipes->haveReadSupport()) {
            $this->stop(0);
            throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".');
        }
        $callback = $this->buildCallback($callback);
        $ready = \false;
        while (\true) {
            $this->checkTimeout();
            $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
            $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
            foreach ($output as $type => $data) {
                if (3 !== $type) {
                    $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready;
                } elseif (!isset($this->fallbackStatus['signaled'])) {
                    $this->fallbackStatus['exitcode'] = (int) $data;
                }
            }
            if ($ready) {
                return \true;
            }
            if (!$running) {
                return \false;
            }
            \usleep(1000);
        }
    }
    public function getPid()
    {
        return $this->isRunning() ? $this->processInformation['pid'] : null;
    }
    public function signal($signal)
    {
        $this->doSignal($signal, \true);
        return $this;
    }
    public function disableOutput()
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Disabling output while the process is running is not possible.');
        }
        if (null !== $this->idleTimeout) {
            throw new LogicException('Output can not be disabled while an idle timeout is set.');
        }
        $this->outputDisabled = \true;
        return $this;
    }
    public function enableOutput()
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Enabling output while the process is running is not possible.');
        }
        $this->outputDisabled = \false;
        return $this;
    }
    public function isOutputDisabled()
    {
        return $this->outputDisabled;
    }
    public function getOutput()
    {
        $this->readPipesForOutput(__FUNCTION__);
        if (\false === ($ret = \stream_get_contents($this->stdout, -1, 0))) {
            return '';
        }
        return $ret;
    }
    public function getIncrementalOutput()
    {
        $this->readPipesForOutput(__FUNCTION__);
        $latest = \stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset);
        $this->incrementalOutputOffset = \ftell($this->stdout);
        if (\false === $latest) {
            return '';
        }
        return $latest;
    }
    #[\ReturnTypeWillChange]
    public function getIterator($flags = 0)
    {
        $this->readPipesForOutput(__FUNCTION__, \false);
        $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags);
        $blocking = !(self::ITER_NON_BLOCKING & $flags);
        $yieldOut = !(self::ITER_SKIP_OUT & $flags);
        $yieldErr = !(self::ITER_SKIP_ERR & $flags);
        while (null !== $this->callback || $yieldOut && !\feof($this->stdout) || $yieldErr && !\feof($this->stderr)) {
            if ($yieldOut) {
                $out = \stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset);
                if (isset($out[0])) {
                    if ($clearOutput) {
                        $this->clearOutput();
                    } else {
                        $this->incrementalOutputOffset = \ftell($this->stdout);
                    }
                    (yield self::OUT => $out);
                }
            }
            if ($yieldErr) {
                $err = \stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset);
                if (isset($err[0])) {
                    if ($clearOutput) {
                        $this->clearErrorOutput();
                    } else {
                        $this->incrementalErrorOutputOffset = \ftell($this->stderr);
                    }
                    (yield self::ERR => $err);
                }
            }
            if (!$blocking && !isset($out[0]) && !isset($err[0])) {
                (yield self::OUT => '');
            }
            $this->checkTimeout();
            $this->readPipesForOutput(__FUNCTION__, $blocking);
        }
    }
    public function clearOutput()
    {
        \ftruncate($this->stdout, 0);
        \fseek($this->stdout, 0);
        $this->incrementalOutputOffset = 0;
        return $this;
    }
    public function getErrorOutput()
    {
        $this->readPipesForOutput(__FUNCTION__);
        if (\false === ($ret = \stream_get_contents($this->stderr, -1, 0))) {
            return '';
        }
        return $ret;
    }
    public function getIncrementalErrorOutput()
    {
        $this->readPipesForOutput(__FUNCTION__);
        $latest = \stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset);
        $this->incrementalErrorOutputOffset = \ftell($this->stderr);
        if (\false === $latest) {
            return '';
        }
        return $latest;
    }
    public function clearErrorOutput()
    {
        \ftruncate($this->stderr, 0);
        \fseek($this->stderr, 0);
        $this->incrementalErrorOutputOffset = 0;
        return $this;
    }
    public function getExitCode()
    {
        $this->updateStatus(\false);
        return $this->exitcode;
    }
    public function getExitCodeText()
    {
        if (null === ($exitcode = $this->getExitCode())) {
            return null;
        }
        return self::$exitCodes[$exitcode] ?? 'Unknown error';
    }
    public function isSuccessful()
    {
        return 0 === $this->getExitCode();
    }
    public function hasBeenSignaled()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);
        return $this->processInformation['signaled'];
    }
    public function getTermSignal()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);
        if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) {
            throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
        }
        return $this->processInformation['termsig'];
    }
    public function hasBeenStopped()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);
        return $this->processInformation['stopped'];
    }
    public function getStopSignal()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);
        return $this->processInformation['stopsig'];
    }
    public function isRunning()
    {
        if (self::STATUS_STARTED !== $this->status) {
            return \false;
        }
        $this->updateStatus(\false);
        return $this->processInformation['running'];
    }
    public function isStarted()
    {
        return self::STATUS_READY != $this->status;
    }
    public function isTerminated()
    {
        $this->updateStatus(\false);
        return self::STATUS_TERMINATED == $this->status;
    }
    public function getStatus()
    {
        $this->updateStatus(\false);
        return $this->status;
    }
    public function stop($timeout = 10, $signal = null)
    {
        $timeoutMicro = \microtime(\true) + $timeout;
        if ($this->isRunning()) {
            $this->doSignal(15, \false);
            do {
                \usleep(1000);
            } while ($this->isRunning() && \microtime(\true) < $timeoutMicro);
            if ($this->isRunning()) {
                $this->doSignal($signal ?: 9, \false);
            }
        }
        if ($this->isRunning()) {
            if (isset($this->fallbackStatus['pid'])) {
                unset($this->fallbackStatus['pid']);
                return $this->stop(0, $signal);
            }
            $this->close();
        }
        return $this->exitcode;
    }
    public function addOutput(string $line)
    {
        $this->lastOutputTime = \microtime(\true);
        \fseek($this->stdout, 0, \SEEK_END);
        \fwrite($this->stdout, $line);
        \fseek($this->stdout, $this->incrementalOutputOffset);
    }
    public function addErrorOutput(string $line)
    {
        $this->lastOutputTime = \microtime(\true);
        \fseek($this->stderr, 0, \SEEK_END);
        \fwrite($this->stderr, $line);
        \fseek($this->stderr, $this->incrementalErrorOutputOffset);
    }
    public function getLastOutputTime() : ?float
    {
        return $this->lastOutputTime;
    }
    public function getCommandLine()
    {
        return \is_array($this->commandline) ? \implode(' ', \array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline;
    }
    public function setCommandLine($commandline)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
        $this->commandline = $commandline;
        return $this;
    }
    public function getTimeout()
    {
        return $this->timeout;
    }
    public function getIdleTimeout()
    {
        return $this->idleTimeout;
    }
    public function setTimeout($timeout)
    {
        $this->timeout = $this->validateTimeout($timeout);
        return $this;
    }
    public function setIdleTimeout($timeout)
    {
        if (null !== $timeout && $this->outputDisabled) {
            throw new LogicException('Idle timeout can not be set while the output is disabled.');
        }
        $this->idleTimeout = $this->validateTimeout($timeout);
        return $this;
    }
    public function setTty($tty)
    {
        if ('\\' === \DIRECTORY_SEPARATOR && $tty) {
            throw new RuntimeException('TTY mode is not supported on Windows platform.');
        }
        if ($tty && !self::isTtySupported()) {
            throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.');
        }
        $this->tty = (bool) $tty;
        return $this;
    }
    public function isTty()
    {
        return $this->tty;
    }
    public function setPty($bool)
    {
        $this->pty = (bool) $bool;
        return $this;
    }
    public function isPty()
    {
        return $this->pty;
    }
    public function getWorkingDirectory()
    {
        if (null === $this->cwd) {
            return \getcwd() ?: null;
        }
        return $this->cwd;
    }
    public function setWorkingDirectory($cwd)
    {
        $this->cwd = $cwd;
        return $this;
    }
    public function getEnv()
    {
        return $this->env;
    }
    public function setEnv(array $env)
    {
        $this->env = $env;
        return $this;
    }
    public function getInput()
    {
        return $this->input;
    }
    public function setInput($input)
    {
        if ($this->isRunning()) {
            throw new LogicException('Input can not be set while the process is running.');
        }
        $this->input = ProcessUtils::validateInput(__METHOD__, $input);
        return $this;
    }
    public function inheritEnvironmentVariables($inheritEnv = \true)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.4, env variables are always inherited.', __METHOD__), \E_USER_DEPRECATED);
        if (!$inheritEnv) {
            throw new InvalidArgumentException('Not inheriting environment variables is not supported.');
        }
        return $this;
    }
    public function checkTimeout()
    {
        if (self::STATUS_STARTED !== $this->status) {
            return;
        }
        if (null !== $this->timeout && $this->timeout < \microtime(\true) - $this->starttime) {
            $this->stop(0);
            throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
        }
        if (null !== $this->idleTimeout && $this->idleTimeout < \microtime(\true) - $this->lastOutputTime) {
            $this->stop(0);
            throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);
        }
    }
    public static function isTtySupported() : bool
    {
        static $isTtySupported;
        if (null === $isTtySupported) {
            $isTtySupported = (bool) @\proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes);
        }
        return $isTtySupported;
    }
    public static function isPtySupported()
    {
        static $result;
        if (null !== $result) {
            return $result;
        }
        if ('\\' === \DIRECTORY_SEPARATOR) {
            return $result = \false;
        }
        return $result = (bool) @\proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes);
    }
    private function getDescriptors() : array
    {
        if ($this->input instanceof \Iterator) {
            $this->input->rewind();
        }
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback);
        } else {
            $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback);
        }
        return $this->processPipes->getDescriptors();
    }
    protected function buildCallback(callable $callback = null)
    {
        if ($this->outputDisabled) {
            return function ($type, $data) use($callback) : bool {
                return null !== $callback && $callback($type, $data);
            };
        }
        $out = self::OUT;
        return function ($type, $data) use($callback, $out) : bool {
            if ($out == $type) {
                $this->addOutput($data);
            } else {
                $this->addErrorOutput($data);
            }
            return null !== $callback && $callback($type, $data);
        };
    }
    protected function updateStatus($blocking)
    {
        if (self::STATUS_STARTED !== $this->status) {
            return;
        }
        $this->processInformation = \proc_get_status($this->process);
        $running = $this->processInformation['running'];
        $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running);
        if ($this->fallbackStatus && $this->isSigchildEnabled()) {
            $this->processInformation = $this->fallbackStatus + $this->processInformation;
        }
        if (!$running) {
            $this->close();
        }
    }
    protected function isSigchildEnabled()
    {
        if (null !== self::$sigchild) {
            return self::$sigchild;
        }
        if (!\function_exists('phpinfo')) {
            return self::$sigchild = \false;
        }
        \ob_start();
        \phpinfo(\INFO_GENERAL);
        return self::$sigchild = \str_contains(\ob_get_clean(), '--enable-sigchild');
    }
    private function readPipesForOutput(string $caller, bool $blocking = \false)
    {
        if ($this->outputDisabled) {
            throw new LogicException('Output has been disabled.');
        }
        $this->requireProcessIsStarted($caller);
        $this->updateStatus($blocking);
    }
    private function validateTimeout(?float $timeout) : ?float
    {
        $timeout = (float) $timeout;
        if (0.0 === $timeout) {
            $timeout = null;
        } elseif ($timeout < 0) {
            throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
        }
        return $timeout;
    }
    private function readPipes(bool $blocking, bool $close)
    {
        $result = $this->processPipes->readAndWrite($blocking, $close);
        $callback = $this->callback;
        foreach ($result as $type => $data) {
            if (3 !== $type) {
                $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data);
            } elseif (!isset($this->fallbackStatus['signaled'])) {
                $this->fallbackStatus['exitcode'] = (int) $data;
            }
        }
    }
    private function close() : int
    {
        $this->processPipes->close();
        if (\is_resource($this->process)) {
            \proc_close($this->process);
        }
        $this->exitcode = $this->processInformation['exitcode'];
        $this->status = self::STATUS_TERMINATED;
        if (-1 === $this->exitcode) {
            if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) {
                $this->exitcode = 128 + $this->processInformation['termsig'];
            } elseif ($this->isSigchildEnabled()) {
                $this->processInformation['signaled'] = \true;
                $this->processInformation['termsig'] = -1;
            }
        }
        $this->callback = null;
        return $this->exitcode;
    }
    private function resetProcessData()
    {
        $this->starttime = null;
        $this->callback = null;
        $this->exitcode = null;
        $this->fallbackStatus = [];
        $this->processInformation = null;
        $this->stdout = \fopen('php://temp/maxmemory:' . 1024 * 1024, 'w+');
        $this->stderr = \fopen('php://temp/maxmemory:' . 1024 * 1024, 'w+');
        $this->process = null;
        $this->latestSignal = null;
        $this->status = self::STATUS_READY;
        $this->incrementalOutputOffset = 0;
        $this->incrementalErrorOutputOffset = 0;
    }
    private function doSignal(int $signal, bool $throwException) : bool
    {
        if (null === ($pid = $this->getPid())) {
            if ($throwException) {
                throw new LogicException('Can not send signal on a non running process.');
            }
            return \false;
        }
        if ('\\' === \DIRECTORY_SEPARATOR) {
            \exec(\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode);
            if ($exitCode && $this->isRunning()) {
                if ($throwException) {
                    throw new RuntimeException(\sprintf('Unable to kill the process (%s).', \implode(' ', $output)));
                }
                return \false;
            }
        } else {
            if (!$this->isSigchildEnabled()) {
                $ok = @\proc_terminate($this->process, $signal);
            } elseif (\function_exists('posix_kill')) {
                $ok = @\posix_kill($pid, $signal);
            } elseif ($ok = \proc_open(\sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) {
                $ok = \false === \fgets($pipes[2]);
            }
            if (!$ok) {
                if ($throwException) {
                    throw new RuntimeException(\sprintf('Error while sending signal "%s".', $signal));
                }
                return \false;
            }
        }
        $this->latestSignal = $signal;
        $this->fallbackStatus['signaled'] = \true;
        $this->fallbackStatus['exitcode'] = -1;
        $this->fallbackStatus['termsig'] = $this->latestSignal;
        return \true;
    }
    private function prepareWindowsCommandLine(string $cmd, array &$env) : string
    {
        $uid = \uniqid('', \true);
        $varCount = 0;
        $varCache = [];
        $cmd = \preg_replace_callback('/"(?:(
                [^"%!^]*+
                (?:
                    (?: !LF! | "(?:\\^[%!^])?+" )
                    [^"%!^]*+
                )++
            ) | [^"]*+ )"/x', function ($m) use(&$env, &$varCache, &$varCount, $uid) {
            if (!isset($m[1])) {
                return $m[0];
            }
            if (isset($varCache[$m[0]])) {
                return $varCache[$m[0]];
            }
            if (\str_contains($value = $m[1], "\x00")) {
                $value = \str_replace("\x00", '?', $value);
            }
            if (\false === \strpbrk($value, "\"%!\n")) {
                return '"' . $value . '"';
            }
            $value = \str_replace(['!LF!', '"^!"', '"^%"', '"^^"', '""'], ["\n", '!', '%', '^', '"'], $value);
            $value = '"' . \preg_replace('/(\\\\*)"/', '$1$1\\"', $value) . '"';
            $var = $uid . ++$varCount;
            $env[$var] = $value;
            return $varCache[$m[0]] = '!' . $var . '!';
        }, $cmd);
        $cmd = 'cmd /V:ON /E:ON /D /C (' . \str_replace("\n", ' ', $cmd) . ')';
        foreach ($this->processPipes->getFiles() as $offset => $filename) {
            $cmd .= ' ' . $offset . '>"' . $filename . '"';
        }
        return $cmd;
    }
    private function requireProcessIsStarted(string $functionName)
    {
        if (!$this->isStarted()) {
            throw new LogicException(\sprintf('Process must be started before calling "%s()".', $functionName));
        }
    }
    private function requireProcessIsTerminated(string $functionName)
    {
        if (!$this->isTerminated()) {
            throw new LogicException(\sprintf('Process must be terminated before calling "%s()".', $functionName));
        }
    }
    private function escapeArgument(?string $argument) : string
    {
        if ('' === $argument || null === $argument) {
            return '""';
        }
        if ('\\' !== \DIRECTORY_SEPARATOR) {
            return "'" . \str_replace("'", "'\\''", $argument) . "'";
        }
        if (\str_contains($argument, "\x00")) {
            $argument = \str_replace("\x00", '?', $argument);
        }
        if (!\preg_match('/[\\/()%!^"<>&|\\s]/', $argument)) {
            return $argument;
        }
        $argument = \preg_replace('/(\\\\+)$/', '$1$1', $argument);
        return '"' . \str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument) . '"';
    }
    private function replacePlaceholders(string $commandline, array $env)
    {
        return \preg_replace_callback('/"\\$\\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\\}"/', function ($matches) use($commandline, $env) {
            if (!isset($env[$matches[1]]) || \false === $env[$matches[1]]) {
                throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]) . $commandline);
            }
            return $this->escapeArgument($env[$matches[1]]);
        }, $commandline);
    }
    private function getDefaultEnv() : array
    {
        $env = \getenv();
        $env = \array_intersect_key($env, $_SERVER) ?: $env;
        return $_ENV + $env;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console;

final class ConsoleEvents
{
    /**
    @Event("Symfony\Component\Console\Event\ConsoleCommandEvent")
    */
    public const COMMAND = 'console.command';
    /**
    @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent")
    */
    public const TERMINATE = 'console.terminate';
    /**
    @Event("Symfony\Component\Console\Event\ConsoleErrorEvent")
    */
    public const ERROR = 'console.error';
}
<?php

namespace Cvphar\Symfony\Component\Console;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Command\HelpCommand;
use Cvphar\Symfony\Component\Console\Command\ListCommand;
use Cvphar\Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Cvphar\Symfony\Component\Console\Event\ConsoleCommandEvent;
use Cvphar\Symfony\Component\Console\Event\ConsoleErrorEvent;
use Cvphar\Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Cvphar\Symfony\Component\Console\Exception\CommandNotFoundException;
use Cvphar\Symfony\Component\Console\Exception\ExceptionInterface;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
use Cvphar\Symfony\Component\Console\Exception\NamespaceNotFoundException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Helper\DebugFormatterHelper;
use Cvphar\Symfony\Component\Console\Helper\FormatterHelper;
use Cvphar\Symfony\Component\Console\Helper\Helper;
use Cvphar\Symfony\Component\Console\Helper\HelperSet;
use Cvphar\Symfony\Component\Console\Helper\ProcessHelper;
use Cvphar\Symfony\Component\Console\Helper\QuestionHelper;
use Cvphar\Symfony\Component\Console\Input\ArgvInput;
use Cvphar\Symfony\Component\Console\Input\ArrayInput;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputAwareInterface;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutput;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Style\SymfonyStyle;
use Cvphar\Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
use Cvphar\Symfony\Component\Debug\Exception\FatalThrowableError;
use Cvphar\Symfony\Component\ErrorHandler\ErrorHandler;
use Cvphar\Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Cvphar\Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Cvphar\Symfony\Contracts\Service\ResetInterface;
class Application implements ResetInterface
{
    private $commands = [];
    private $wantHelps = \false;
    private $runningCommand;
    private $name;
    private $version;
    private $commandLoader;
    private $catchExceptions = \true;
    private $autoExit = \true;
    private $definition;
    private $helperSet;
    private $dispatcher;
    private $terminal;
    private $defaultCommand;
    private $singleCommand = \false;
    private $initialized;
    public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
    {
        $this->name = $name;
        $this->version = $version;
        $this->terminal = new Terminal();
        $this->defaultCommand = 'list';
    }
    public function setDispatcher(EventDispatcherInterface $dispatcher)
    {
        $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
    }
    public function setCommandLoader(CommandLoaderInterface $commandLoader)
    {
        $this->commandLoader = $commandLoader;
    }
    public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        if (\function_exists('putenv')) {
            @\putenv('LINES=' . $this->terminal->getHeight());
            @\putenv('COLUMNS=' . $this->terminal->getWidth());
        }
        if (null === $input) {
            $input = new ArgvInput();
        }
        if (null === $output) {
            $output = new ConsoleOutput();
        }
        $renderException = function (\Throwable $e) use($output) {
            if ($output instanceof ConsoleOutputInterface) {
                $this->renderThrowable($e, $output->getErrorOutput());
            } else {
                $this->renderThrowable($e, $output);
            }
        };
        if ($phpHandler = \set_exception_handler($renderException)) {
            \restore_exception_handler();
            if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler && !$phpHandler[0] instanceof LegacyErrorHandler) {
                $errorHandler = \true;
            } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
                $phpHandler[0]->setExceptionHandler($errorHandler);
            }
        }
        $this->configureIO($input, $output);
        try {
            $exitCode = $this->doRun($input, $output);
        } catch (\Exception $e) {
            if (!$this->catchExceptions) {
                throw $e;
            }
            $renderException($e);
            $exitCode = $e->getCode();
            if (\is_numeric($exitCode)) {
                $exitCode = (int) $exitCode;
                if (0 === $exitCode) {
                    $exitCode = 1;
                }
            } else {
                $exitCode = 1;
            }
        } finally {
            if (!$phpHandler) {
                if (\set_exception_handler($renderException) === $renderException) {
                    \restore_exception_handler();
                }
                \restore_exception_handler();
            } elseif (!$errorHandler) {
                $finalHandler = $phpHandler[0]->setExceptionHandler(null);
                if ($finalHandler !== $renderException) {
                    $phpHandler[0]->setExceptionHandler($finalHandler);
                }
            }
        }
        if ($this->autoExit) {
            if ($exitCode > 255) {
                $exitCode = 255;
            }
            exit($exitCode);
        }
        return $exitCode;
    }
    public function doRun(InputInterface $input, OutputInterface $output)
    {
        if (\true === $input->hasParameterOption(['--version', '-V'], \true)) {
            $output->writeln($this->getLongVersion());
            return 0;
        }
        try {
            $input->bind($this->getDefinition());
        } catch (ExceptionInterface $e) {
        }
        $name = $this->getCommandName($input);
        if (\true === $input->hasParameterOption(['--help', '-h'], \true)) {
            if (!$name) {
                $name = 'help';
                $input = new ArrayInput(['command_name' => $this->defaultCommand]);
            } else {
                $this->wantHelps = \true;
            }
        }
        if (!$name) {
            $name = $this->defaultCommand;
            $definition = $this->getDefinition();
            $definition->setArguments(\array_merge($definition->getArguments(), ['command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name)]));
        }
        try {
            $this->runningCommand = null;
            $command = $this->find($name);
        } catch (\Throwable $e) {
            if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) {
                if (null !== $this->dispatcher) {
                    $event = new ConsoleErrorEvent($input, $output, $e);
                    $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
                    if (0 === $event->getExitCode()) {
                        return 0;
                    }
                    $e = $event->getError();
                }
                throw $e;
            }
            $alternative = $alternatives[0];
            $style = new SymfonyStyle($input, $output);
            $style->block(\sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
            if (!$style->confirm(\sprintf('Do you want to run "%s" instead? ', $alternative), \false)) {
                if (null !== $this->dispatcher) {
                    $event = new ConsoleErrorEvent($input, $output, $e);
                    $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
                    return $event->getExitCode();
                }
                return 1;
            }
            $command = $this->find($alternative);
        }
        $this->runningCommand = $command;
        $exitCode = $this->doRunCommand($command, $input, $output);
        $this->runningCommand = null;
        return $exitCode;
    }
    public function reset()
    {
    }
    public function setHelperSet(HelperSet $helperSet)
    {
        $this->helperSet = $helperSet;
    }
    public function getHelperSet()
    {
        if (!$this->helperSet) {
            $this->helperSet = $this->getDefaultHelperSet();
        }
        return $this->helperSet;
    }
    public function setDefinition(InputDefinition $definition)
    {
        $this->definition = $definition;
    }
    public function getDefinition()
    {
        if (!$this->definition) {
            $this->definition = $this->getDefaultInputDefinition();
        }
        if ($this->singleCommand) {
            $inputDefinition = $this->definition;
            $inputDefinition->setArguments();
            return $inputDefinition;
        }
        return $this->definition;
    }
    public function getHelp()
    {
        return $this->getLongVersion();
    }
    public function areExceptionsCaught()
    {
        return $this->catchExceptions;
    }
    public function setCatchExceptions($boolean)
    {
        $this->catchExceptions = (bool) $boolean;
    }
    public function isAutoExitEnabled()
    {
        return $this->autoExit;
    }
    public function setAutoExit($boolean)
    {
        $this->autoExit = (bool) $boolean;
    }
    public function getName()
    {
        return $this->name;
    }
    public function setName($name)
    {
        $this->name = $name;
    }
    public function getVersion()
    {
        return $this->version;
    }
    public function setVersion($version)
    {
        $this->version = $version;
    }
    public function getLongVersion()
    {
        if ('UNKNOWN' !== $this->getName()) {
            if ('UNKNOWN' !== $this->getVersion()) {
                return \sprintf('%s <info>%s</info>', $this->getName(), $this->getVersion());
            }
            return $this->getName();
        }
        return 'Console Tool';
    }
    public function register($name)
    {
        return $this->add(new Command($name));
    }
    public function addCommands(array $commands)
    {
        foreach ($commands as $command) {
            $this->add($command);
        }
    }
    public function add(Command $command)
    {
        $this->init();
        $command->setApplication($this);
        if (!$command->isEnabled()) {
            $command->setApplication(null);
            return null;
        }
        $command->getDefinition();
        if (!$command->getName()) {
            throw new LogicException(\sprintf('The command defined in "%s" cannot have an empty name.', \get_class($command)));
        }
        $this->commands[$command->getName()] = $command;
        foreach ($command->getAliases() as $alias) {
            $this->commands[$alias] = $command;
        }
        return $command;
    }
    public function get($name)
    {
        $this->init();
        if (!$this->has($name)) {
            throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name));
        }
        if (!isset($this->commands[$name])) {
            throw new CommandNotFoundException(\sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name));
        }
        $command = $this->commands[$name];
        if ($this->wantHelps) {
            $this->wantHelps = \false;
            $helpCommand = $this->get('help');
            $helpCommand->setCommand($command);
            return $helpCommand;
        }
        return $command;
    }
    public function has($name)
    {
        $this->init();
        return isset($this->commands[$name]) || $this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name));
    }
    public function getNamespaces()
    {
        $namespaces = [];
        foreach ($this->all() as $command) {
            if ($command->isHidden()) {
                continue;
            }
            $namespaces = \array_merge($namespaces, $this->extractAllNamespaces($command->getName()));
            foreach ($command->getAliases() as $alias) {
                $namespaces = \array_merge($namespaces, $this->extractAllNamespaces($alias));
            }
        }
        return \array_values(\array_unique(\array_filter($namespaces)));
    }
    public function findNamespace($namespace)
    {
        $allNamespaces = $this->getNamespaces();
        $expr = \preg_replace_callback('{([^:]+|)}', function ($matches) {
            return \preg_quote($matches[1]) . '[^:]*';
        }, $namespace);
        $namespaces = \preg_grep('{^' . $expr . '}', $allNamespaces);
        if (empty($namespaces)) {
            $message = \sprintf('There are no commands defined in the "%s" namespace.', $namespace);
            if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) {
                if (1 == \count($alternatives)) {
                    $message .= "\n\nDid you mean this?\n    ";
                } else {
                    $message .= "\n\nDid you mean one of these?\n    ";
                }
                $message .= \implode("\n    ", $alternatives);
            }
            throw new NamespaceNotFoundException($message, $alternatives);
        }
        $exact = \in_array($namespace, $namespaces, \true);
        if (\count($namespaces) > 1 && !$exact) {
            throw new NamespaceNotFoundException(\sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(\array_values($namespaces))), \array_values($namespaces));
        }
        return $exact ? $namespace : \reset($namespaces);
    }
    public function find($name)
    {
        $this->init();
        $aliases = [];
        foreach ($this->commands as $command) {
            foreach ($command->getAliases() as $alias) {
                if (!$this->has($alias)) {
                    $this->commands[$alias] = $command;
                }
            }
        }
        if ($this->has($name)) {
            return $this->get($name);
        }
        $allCommands = $this->commandLoader ? \array_merge($this->commandLoader->getNames(), \array_keys($this->commands)) : \array_keys($this->commands);
        $expr = \preg_replace_callback('{([^:]+|)}', function ($matches) {
            return \preg_quote($matches[1]) . '[^:]*';
        }, $name);
        $commands = \preg_grep('{^' . $expr . '}', $allCommands);
        if (empty($commands)) {
            $commands = \preg_grep('{^' . $expr . '}i', $allCommands);
        }
        if (empty($commands) || \count(\preg_grep('{^' . $expr . '$}i', $commands)) < 1) {
            if (\false !== ($pos = \strrpos($name, ':'))) {
                $this->findNamespace(\substr($name, 0, $pos));
            }
            $message = \sprintf('Command "%s" is not defined.', $name);
            if ($alternatives = $this->findAlternatives($name, $allCommands)) {
                $alternatives = \array_filter($alternatives, function ($name) {
                    return !$this->get($name)->isHidden();
                });
                if (1 == \count($alternatives)) {
                    $message .= "\n\nDid you mean this?\n    ";
                } else {
                    $message .= "\n\nDid you mean one of these?\n    ";
                }
                $message .= \implode("\n    ", $alternatives);
            }
            throw new CommandNotFoundException($message, \array_values($alternatives));
        }
        if (\count($commands) > 1) {
            $commandList = $this->commandLoader ? \array_merge(\array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
            $commands = \array_unique(\array_filter($commands, function ($nameOrAlias) use(&$commandList, $commands, &$aliases) {
                if (!$commandList[$nameOrAlias] instanceof Command) {
                    $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
                }
                $commandName = $commandList[$nameOrAlias]->getName();
                $aliases[$nameOrAlias] = $commandName;
                return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
            }));
        }
        if (\count($commands) > 1) {
            $usableWidth = $this->terminal->getWidth() - 10;
            $abbrevs = \array_values($commands);
            $maxLen = 0;
            foreach ($abbrevs as $abbrev) {
                $maxLen = \max(Helper::strlen($abbrev), $maxLen);
            }
            $abbrevs = \array_map(function ($cmd) use($commandList, $usableWidth, $maxLen, &$commands) {
                if ($commandList[$cmd]->isHidden()) {
                    unset($commands[\array_search($cmd, $commands)]);
                    return \false;
                }
                $abbrev = \str_pad($cmd, $maxLen, ' ') . ' ' . $commandList[$cmd]->getDescription();
                return Helper::strlen($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3) . '...' : $abbrev;
            }, \array_values($commands));
            if (\count($commands) > 1) {
                $suggestions = $this->getAbbreviationSuggestions(\array_filter($abbrevs));
                throw new CommandNotFoundException(\sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), \array_values($commands));
            }
        }
        $command = $this->get(\reset($commands));
        if ($command->isHidden()) {
            @\trigger_error(\sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), \E_USER_DEPRECATED);
        }
        return $command;
    }
    public function all($namespace = null)
    {
        $this->init();
        if (null === $namespace) {
            if (!$this->commandLoader) {
                return $this->commands;
            }
            $commands = $this->commands;
            foreach ($this->commandLoader->getNames() as $name) {
                if (!isset($commands[$name]) && $this->has($name)) {
                    $commands[$name] = $this->get($name);
                }
            }
            return $commands;
        }
        $commands = [];
        foreach ($this->commands as $name => $command) {
            if ($namespace === $this->extractNamespace($name, \substr_count($namespace, ':') + 1)) {
                $commands[$name] = $command;
            }
        }
        if ($this->commandLoader) {
            foreach ($this->commandLoader->getNames() as $name) {
                if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, \substr_count($namespace, ':') + 1) && $this->has($name)) {
                    $commands[$name] = $this->get($name);
                }
            }
        }
        return $commands;
    }
    public static function getAbbreviations($names)
    {
        $abbrevs = [];
        foreach ($names as $name) {
            for ($len = \strlen($name); $len > 0; --$len) {
                $abbrev = \substr($name, 0, $len);
                $abbrevs[$abbrev][] = $name;
            }
        }
        return $abbrevs;
    }
    public function renderException(\Exception $e, OutputInterface $output)
    {
        @\trigger_error(\sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
        $output->writeln('', OutputInterface::VERBOSITY_QUIET);
        $this->doRenderException($e, $output);
        $this->finishRenderThrowableOrException($output);
    }
    public function renderThrowable(\Throwable $e, OutputInterface $output) : void
    {
        if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'renderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'renderException'))->getDeclaringClass()->getName()) {
            @\trigger_error(\sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
            if (!$e instanceof \Exception) {
                $e = \class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
            }
            $this->renderException($e, $output);
            return;
        }
        $output->writeln('', OutputInterface::VERBOSITY_QUIET);
        $this->doRenderThrowable($e, $output);
        $this->finishRenderThrowableOrException($output);
    }
    private function finishRenderThrowableOrException(OutputInterface $output) : void
    {
        if (null !== $this->runningCommand) {
            $output->writeln(\sprintf('<info>%s</info>', OutputFormatter::escape(\sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET);
            $output->writeln('', OutputInterface::VERBOSITY_QUIET);
        }
    }
    protected function doRenderException(\Exception $e, OutputInterface $output)
    {
        @\trigger_error(\sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
        $this->doActuallyRenderThrowable($e, $output);
    }
    protected function doRenderThrowable(\Throwable $e, OutputInterface $output) : void
    {
        if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'doRenderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'doRenderException'))->getDeclaringClass()->getName()) {
            @\trigger_error(\sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
            if (!$e instanceof \Exception) {
                $e = \class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
            }
            $this->doRenderException($e, $output);
            return;
        }
        $this->doActuallyRenderThrowable($e, $output);
    }
    private function doActuallyRenderThrowable(\Throwable $e, OutputInterface $output) : void
    {
        do {
            $message = \trim($e->getMessage());
            if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $class = \get_debug_type($e);
                $title = \sprintf('  [%s%s]  ', $class, 0 !== ($code = $e->getCode()) ? ' (' . $code . ')' : '');
                $len = Helper::strlen($title);
            } else {
                $len = 0;
            }
            if (\str_contains($message, "@anonymous\x00")) {
                $message = \preg_replace_callback('/[a-zA-Z_\\x7f-\\xff][\\\\a-zA-Z0-9_\\x7f-\\xff]*+@anonymous\\x00.*?\\.php(?:0x?|:[0-9]++\\$)[0-9a-fA-F]++/', function ($m) {
                    return \class_exists($m[0], \false) ? ((\get_parent_class($m[0]) ?: \key(\class_implements($m[0]))) ?: 'class') . '@anonymous' : $m[0];
                }, $message);
            }
            $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
            $lines = [];
            foreach ('' !== $message ? \preg_split('/\\r?\\n/', $message) : [] as $line) {
                foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
                    $lineLength = Helper::strlen($line) + 4;
                    $lines[] = [$line, $lineLength];
                    $len = \max($lineLength, $len);
                }
            }
            $messages = [];
            if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $messages[] = \sprintf('<comment>%s</comment>', OutputFormatter::escape(\sprintf('In %s line %s:', \basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
            }
            $messages[] = $emptyLine = \sprintf('<error>%s</error>', \str_repeat(' ', $len));
            if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $messages[] = \sprintf('<error>%s%s</error>', $title, \str_repeat(' ', \max(0, $len - Helper::strlen($title))));
            }
            foreach ($lines as $line) {
                $messages[] = \sprintf('<error>  %s  %s</error>', OutputFormatter::escape($line[0]), \str_repeat(' ', $len - $line[1]));
            }
            $messages[] = $emptyLine;
            $messages[] = '';
            $output->writeln($messages, OutputInterface::VERBOSITY_QUIET);
            if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
                $trace = $e->getTrace();
                \array_unshift($trace, ['function' => '', 'file' => $e->getFile() ?: 'n/a', 'line' => $e->getLine() ?: 'n/a', 'args' => []]);
                for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
                    $class = $trace[$i]['class'] ?? '';
                    $type = $trace[$i]['type'] ?? '';
                    $function = $trace[$i]['function'] ?? '';
                    $file = $trace[$i]['file'] ?? 'n/a';
                    $line = $trace[$i]['line'] ?? 'n/a';
                    $output->writeln(\sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type . $function . '()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
                }
                $output->writeln('', OutputInterface::VERBOSITY_QUIET);
            }
        } while ($e = $e->getPrevious());
    }
    protected function configureIO(InputInterface $input, OutputInterface $output)
    {
        if (\true === $input->hasParameterOption(['--ansi'], \true)) {
            $output->setDecorated(\true);
        } elseif (\true === $input->hasParameterOption(['--no-ansi'], \true)) {
            $output->setDecorated(\false);
        }
        if (\true === $input->hasParameterOption(['--no-interaction', '-n'], \true)) {
            $input->setInteractive(\false);
        }
        switch ($shellVerbosity = (int) \getenv('SHELL_VERBOSITY')) {
            case -1:
                $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
                break;
            case 1:
                $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
                break;
            case 2:
                $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
                break;
            case 3:
                $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
                break;
            default:
                $shellVerbosity = 0;
                break;
        }
        if (\true === $input->hasParameterOption(['--quiet', '-q'], \true)) {
            $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
            $shellVerbosity = -1;
        } else {
            if ($input->hasParameterOption('-vvv', \true) || $input->hasParameterOption('--verbose=3', \true) || 3 === $input->getParameterOption('--verbose', \false, \true)) {
                $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
                $shellVerbosity = 3;
            } elseif ($input->hasParameterOption('-vv', \true) || $input->hasParameterOption('--verbose=2', \true) || 2 === $input->getParameterOption('--verbose', \false, \true)) {
                $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
                $shellVerbosity = 2;
            } elseif ($input->hasParameterOption('-v', \true) || $input->hasParameterOption('--verbose=1', \true) || $input->hasParameterOption('--verbose', \true) || $input->getParameterOption('--verbose', \false, \true)) {
                $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
                $shellVerbosity = 1;
            }
        }
        if (-1 === $shellVerbosity) {
            $input->setInteractive(\false);
        }
        if (\function_exists('putenv')) {
            @\putenv('SHELL_VERBOSITY=' . $shellVerbosity);
        }
        $_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
        $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
    }
    protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
    {
        foreach ($command->getHelperSet() as $helper) {
            if ($helper instanceof InputAwareInterface) {
                $helper->setInput($input);
            }
        }
        if (null === $this->dispatcher) {
            return $command->run($input, $output);
        }
        try {
            $command->mergeApplicationDefinition();
            $input->bind($command->getDefinition());
        } catch (ExceptionInterface $e) {
        }
        $event = new ConsoleCommandEvent($command, $input, $output);
        $e = null;
        try {
            $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND);
            if ($event->commandShouldRun()) {
                $exitCode = $command->run($input, $output);
            } else {
                $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
            }
        } catch (\Throwable $e) {
            $event = new ConsoleErrorEvent($input, $output, $e, $command);
            $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
            $e = $event->getError();
            if (0 === ($exitCode = $event->getExitCode())) {
                $e = null;
            }
        }
        $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
        $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE);
        if (null !== $e) {
            throw $e;
        }
        return $event->getExitCode();
    }
    protected function getCommandName(InputInterface $input)
    {
        return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument();
    }
    protected function getDefaultInputDefinition()
    {
        return new InputDefinition([new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question')]);
    }
    protected function getDefaultCommands()
    {
        return [new HelpCommand(), new ListCommand()];
    }
    protected function getDefaultHelperSet()
    {
        return new HelperSet([new FormatterHelper(), new DebugFormatterHelper(), new ProcessHelper(), new QuestionHelper()]);
    }
    private function getAbbreviationSuggestions(array $abbrevs) : string
    {
        return '    ' . \implode("\n    ", $abbrevs);
    }
    public function extractNamespace($name, $limit = null)
    {
        $parts = \explode(':', $name, -1);
        return \implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
    }
    private function findAlternatives(string $name, iterable $collection) : array
    {
        $threshold = 1000.0;
        $alternatives = [];
        $collectionParts = [];
        foreach ($collection as $item) {
            $collectionParts[$item] = \explode(':', $item);
        }
        foreach (\explode(':', $name) as $i => $subname) {
            foreach ($collectionParts as $collectionName => $parts) {
                $exists = isset($alternatives[$collectionName]);
                if (!isset($parts[$i]) && $exists) {
                    $alternatives[$collectionName] += $threshold;
                    continue;
                } elseif (!isset($parts[$i])) {
                    continue;
                }
                $lev = \levenshtein($subname, $parts[$i]);
                if ($lev <= \strlen($subname) / 3 || '' !== $subname && \str_contains($parts[$i], $subname)) {
                    $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
                } elseif ($exists) {
                    $alternatives[$collectionName] += $threshold;
                }
            }
        }
        foreach ($collection as $item) {
            $lev = \levenshtein($name, $item);
            if ($lev <= \strlen($name) / 3 || \str_contains($item, $name)) {
                $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
            }
        }
        $alternatives = \array_filter($alternatives, function ($lev) use($threshold) {
            return $lev < 2 * $threshold;
        });
        \ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
        return \array_keys($alternatives);
    }
    public function setDefaultCommand($commandName, $isSingleCommand = \false)
    {
        $this->defaultCommand = $commandName;
        if ($isSingleCommand) {
            $this->find($commandName);
            $this->singleCommand = \true;
        }
        return $this;
    }
    public function isSingleCommand() : bool
    {
        return $this->singleCommand;
    }
    private function splitStringByWidth(string $string, int $width) : array
    {
        if (\false === ($encoding = \mb_detect_encoding($string, null, \true))) {
            return \str_split($string, $width);
        }
        $utf8String = \mb_convert_encoding($string, 'utf8', $encoding);
        $lines = [];
        $line = '';
        $offset = 0;
        while (\preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) {
            $offset += \strlen($m[0]);
            foreach (\preg_split('//u', $m[0]) as $char) {
                if (\mb_strwidth($line . $char, 'utf8') <= $width) {
                    $line .= $char;
                    continue;
                }
                $lines[] = \str_pad($line, $width);
                $line = $char;
            }
        }
        $lines[] = \count($lines) ? \str_pad($line, $width) : $line;
        \mb_convert_variables($encoding, 'utf8', $lines);
        return $lines;
    }
    private function extractAllNamespaces(string $name) : array
    {
        $parts = \explode(':', $name, -1);
        $namespaces = [];
        foreach ($parts as $part) {
            if (\count($namespaces)) {
                $namespaces[] = \end($namespaces) . ':' . $part;
            } else {
                $namespaces[] = $part;
            }
        }
        return $namespaces;
    }
    private function init()
    {
        if ($this->initialized) {
            return;
        }
        $this->initialized = \true;
        foreach ($this->getDefaultCommands() as $command) {
            $this->add($command);
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Logger;

use Cvphar\Psr\Log\AbstractLogger;
use Cvphar\Psr\Log\InvalidArgumentException;
use Cvphar\Psr\Log\LogLevel;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ConsoleLogger extends AbstractLogger
{
    public const INFO = 'info';
    public const ERROR = 'error';
    private $output;
    private $verbosityLevelMap = [LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG];
    private $formatLevelMap = [LogLevel::EMERGENCY => self::ERROR, LogLevel::ALERT => self::ERROR, LogLevel::CRITICAL => self::ERROR, LogLevel::ERROR => self::ERROR, LogLevel::WARNING => self::INFO, LogLevel::NOTICE => self::INFO, LogLevel::INFO => self::INFO, LogLevel::DEBUG => self::INFO];
    private $errored = \false;
    public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = [])
    {
        $this->output = $output;
        $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap;
        $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap;
    }
    public function log($level, $message, array $context = [])
    {
        if (!isset($this->verbosityLevelMap[$level])) {
            throw new InvalidArgumentException(\sprintf('The log level "%s" does not exist.', $level));
        }
        $output = $this->output;
        if (self::ERROR === $this->formatLevelMap[$level]) {
            if ($this->output instanceof ConsoleOutputInterface) {
                $output = $output->getErrorOutput();
            }
            $this->errored = \true;
        }
        if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) {
            $output->writeln(\sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]);
        }
    }
    public function hasErrored()
    {
        return $this->errored;
    }
    private function interpolate(string $message, array $context) : string
    {
        if (!\str_contains($message, '{')) {
            return $message;
        }
        $replacements = [];
        foreach ($context as $key => $val) {
            if (null === $val || \is_scalar($val) || \is_object($val) && \method_exists($val, '__toString')) {
                $replacements["{{$key}}"] = $val;
            } elseif ($val instanceof \DateTimeInterface) {
                $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339);
            } elseif (\is_object($val)) {
                $replacements["{{$key}}"] = '[object ' . \get_class($val) . ']';
            } else {
                $replacements["{{$key}}"] = '[' . \gettype($val) . ']';
            }
        }
        return \strtr($message, $replacements);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

interface StreamableInputInterface extends InputInterface
{
    public function setStream($stream);
    public function getStream();
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\InvalidOptionException;
class ArrayInput extends Input
{
    private $parameters;
    public function __construct(array $parameters, InputDefinition $definition = null)
    {
        $this->parameters = $parameters;
        parent::__construct($definition);
    }
    public function getFirstArgument()
    {
        foreach ($this->parameters as $param => $value) {
            if ($param && \is_string($param) && '-' === $param[0]) {
                continue;
            }
            return $value;
        }
        return null;
    }
    public function hasParameterOption($values, $onlyParams = \false)
    {
        $values = (array) $values;
        foreach ($this->parameters as $k => $v) {
            if (!\is_int($k)) {
                $v = $k;
            }
            if ($onlyParams && '--' === $v) {
                return \false;
            }
            if (\in_array($v, $values)) {
                return \true;
            }
        }
        return \false;
    }
    public function getParameterOption($values, $default = \false, $onlyParams = \false)
    {
        $values = (array) $values;
        foreach ($this->parameters as $k => $v) {
            if ($onlyParams && ('--' === $k || \is_int($k) && '--' === $v)) {
                return $default;
            }
            if (\is_int($k)) {
                if (\in_array($v, $values)) {
                    return \true;
                }
            } elseif (\in_array($k, $values)) {
                return $v;
            }
        }
        return $default;
    }
    public function __toString()
    {
        $params = [];
        foreach ($this->parameters as $param => $val) {
            if ($param && \is_string($param) && '-' === $param[0]) {
                $glue = '-' === $param[1] ? '=' : ' ';
                if (\is_array($val)) {
                    foreach ($val as $v) {
                        $params[] = $param . ('' != $v ? $glue . $this->escapeToken($v) : '');
                    }
                } else {
                    $params[] = $param . ('' != $val ? $glue . $this->escapeToken($val) : '');
                }
            } else {
                $params[] = \is_array($val) ? \implode(' ', \array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val);
            }
        }
        return \implode(' ', $params);
    }
    protected function parse()
    {
        foreach ($this->parameters as $key => $value) {
            if ('--' === $key) {
                return;
            }
            if (\str_starts_with($key, '--')) {
                $this->addLongOption(\substr($key, 2), $value);
            } elseif (\str_starts_with($key, '-')) {
                $this->addShortOption(\substr($key, 1), $value);
            } else {
                $this->addArgument($key, $value);
            }
        }
    }
    private function addShortOption(string $shortcut, $value)
    {
        if (!$this->definition->hasShortcut($shortcut)) {
            throw new InvalidOptionException(\sprintf('The "-%s" option does not exist.', $shortcut));
        }
        $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
    }
    private function addLongOption(string $name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new InvalidOptionException(\sprintf('The "--%s" option does not exist.', $name));
        }
        $option = $this->definition->getOption($name);
        if (null === $value) {
            if ($option->isValueRequired()) {
                throw new InvalidOptionException(\sprintf('The "--%s" option requires a value.', $name));
            }
            if (!$option->isValueOptional()) {
                $value = \true;
            }
        }
        $this->options[$name] = $value;
    }
    private function addArgument($name, $value)
    {
        if (!$this->definition->hasArgument($name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name));
        }
        $this->arguments[$name] = $value;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
class ArgvInput extends Input
{
    private $tokens;
    private $parsed;
    public function __construct(array $argv = null, InputDefinition $definition = null)
    {
        $argv = $argv ?? $_SERVER['argv'] ?? [];
        \array_shift($argv);
        $this->tokens = $argv;
        parent::__construct($definition);
    }
    protected function setTokens(array $tokens)
    {
        $this->tokens = $tokens;
    }
    protected function parse()
    {
        $parseOptions = \true;
        $this->parsed = $this->tokens;
        while (null !== ($token = \array_shift($this->parsed))) {
            if ($parseOptions && '' == $token) {
                $this->parseArgument($token);
            } elseif ($parseOptions && '--' == $token) {
                $parseOptions = \false;
            } elseif ($parseOptions && \str_starts_with($token, '--')) {
                $this->parseLongOption($token);
            } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
                $this->parseShortOption($token);
            } else {
                $this->parseArgument($token);
            }
        }
    }
    private function parseShortOption(string $token)
    {
        $name = \substr($token, 1);
        if (\strlen($name) > 1) {
            if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
                $this->addShortOption($name[0], \substr($name, 1));
            } else {
                $this->parseShortOptionSet($name);
            }
        } else {
            $this->addShortOption($name, null);
        }
    }
    private function parseShortOptionSet(string $name)
    {
        $len = \strlen($name);
        for ($i = 0; $i < $len; ++$i) {
            if (!$this->definition->hasShortcut($name[$i])) {
                $encoding = \mb_detect_encoding($name, null, \true);
                throw new RuntimeException(\sprintf('The "-%s" option does not exist.', \false === $encoding ? $name[$i] : \mb_substr($name, $i, 1, $encoding)));
            }
            $option = $this->definition->getOptionForShortcut($name[$i]);
            if ($option->acceptValue()) {
                $this->addLongOption($option->getName(), $i === $len - 1 ? null : \substr($name, $i + 1));
                break;
            } else {
                $this->addLongOption($option->getName(), null);
            }
        }
    }
    private function parseLongOption(string $token)
    {
        $name = \substr($token, 2);
        if (\false !== ($pos = \strpos($name, '='))) {
            if ('' === ($value = \substr($name, $pos + 1))) {
                \array_unshift($this->parsed, $value);
            }
            $this->addLongOption(\substr($name, 0, $pos), $value);
        } else {
            $this->addLongOption($name, null);
        }
    }
    private function parseArgument(string $token)
    {
        $c = \count($this->arguments);
        if ($this->definition->hasArgument($c)) {
            $arg = $this->definition->getArgument($c);
            $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token;
        } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
            $arg = $this->definition->getArgument($c - 1);
            $this->arguments[$arg->getName()][] = $token;
        } else {
            $all = $this->definition->getArguments();
            if (\count($all)) {
                throw new RuntimeException(\sprintf('Too many arguments, expected arguments "%s".', \implode('" "', \array_keys($all))));
            }
            throw new RuntimeException(\sprintf('No arguments expected, got "%s".', $token));
        }
    }
    private function addShortOption(string $shortcut, $value)
    {
        if (!$this->definition->hasShortcut($shortcut)) {
            throw new RuntimeException(\sprintf('The "-%s" option does not exist.', $shortcut));
        }
        $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
    }
    private function addLongOption(string $name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new RuntimeException(\sprintf('The "--%s" option does not exist.', $name));
        }
        $option = $this->definition->getOption($name);
        if (null !== $value && !$option->acceptValue()) {
            throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name));
        }
        if (\in_array($value, ['', null], \true) && $option->acceptValue() && \count($this->parsed)) {
            $next = \array_shift($this->parsed);
            if (isset($next[0]) && '-' !== $next[0] || \in_array($next, ['', null], \true)) {
                $value = $next;
            } else {
                \array_unshift($this->parsed, $next);
            }
        }
        if (null === $value) {
            if ($option->isValueRequired()) {
                throw new RuntimeException(\sprintf('The "--%s" option requires a value.', $name));
            }
            if (!$option->isArray() && !$option->isValueOptional()) {
                $value = \true;
            }
        }
        if ($option->isArray()) {
            $this->options[$name][] = $value;
        } else {
            $this->options[$name] = $value;
        }
    }
    public function getFirstArgument()
    {
        $isOption = \false;
        foreach ($this->tokens as $i => $token) {
            if ($token && '-' === $token[0]) {
                if (\str_contains($token, '=') || !isset($this->tokens[$i + 1])) {
                    continue;
                }
                $name = '-' === $token[1] ? \substr($token, 2) : \substr($token, -1);
                if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) {
                } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) {
                    $isOption = \true;
                }
                continue;
            }
            if ($isOption) {
                $isOption = \false;
                continue;
            }
            return $token;
        }
        return null;
    }
    public function hasParameterOption($values, $onlyParams = \false)
    {
        $values = (array) $values;
        foreach ($this->tokens as $token) {
            if ($onlyParams && '--' === $token) {
                return \false;
            }
            foreach ($values as $value) {
                $leading = \str_starts_with($value, '--') ? $value . '=' : $value;
                if ($token === $value || '' !== $leading && \str_starts_with($token, $leading)) {
                    return \true;
                }
            }
        }
        return \false;
    }
    public function getParameterOption($values, $default = \false, $onlyParams = \false)
    {
        $values = (array) $values;
        $tokens = $this->tokens;
        while (0 < \count($tokens)) {
            $token = \array_shift($tokens);
            if ($onlyParams && '--' === $token) {
                return $default;
            }
            foreach ($values as $value) {
                if ($token === $value) {
                    return \array_shift($tokens);
                }
                $leading = \str_starts_with($value, '--') ? $value . '=' : $value;
                if ('' !== $leading && \str_starts_with($token, $leading)) {
                    return \substr($token, \strlen($leading));
                }
            }
        }
        return $default;
    }
    public function __toString()
    {
        $tokens = \array_map(function ($token) {
            if (\preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
                return $match[1] . $this->escapeToken($match[2]);
            }
            if ($token && '-' !== $token[0]) {
                return $this->escapeToken($token);
            }
            return $token;
        }, $this->tokens);
        return \implode(' ', $tokens);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
class InputArgument
{
    public const REQUIRED = 1;
    public const OPTIONAL = 2;
    public const IS_ARRAY = 4;
    private $name;
    private $mode;
    private $default;
    private $description;
    public function __construct(string $name, int $mode = null, string $description = '', $default = null)
    {
        if (null === $mode) {
            $mode = self::OPTIONAL;
        } elseif ($mode > 7 || $mode < 1) {
            throw new InvalidArgumentException(\sprintf('Argument mode "%s" is not valid.', $mode));
        }
        $this->name = $name;
        $this->mode = $mode;
        $this->description = $description;
        $this->setDefault($default);
    }
    public function getName()
    {
        return $this->name;
    }
    public function isRequired()
    {
        return self::REQUIRED === (self::REQUIRED & $this->mode);
    }
    public function isArray()
    {
        return self::IS_ARRAY === (self::IS_ARRAY & $this->mode);
    }
    public function setDefault($default = null)
    {
        if (self::REQUIRED === $this->mode && null !== $default) {
            throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
        }
        if ($this->isArray()) {
            if (null === $default) {
                $default = [];
            } elseif (!\is_array($default)) {
                throw new LogicException('A default value for an array argument must be an array.');
            }
        }
        $this->default = $default;
    }
    public function getDefault()
    {
        return $this->default;
    }
    public function getDescription()
    {
        return $this->description;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

interface InputAwareInterface
{
    public function setInput(InputInterface $input);
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
class InputOption
{
    public const VALUE_NONE = 1;
    public const VALUE_REQUIRED = 2;
    public const VALUE_OPTIONAL = 4;
    public const VALUE_IS_ARRAY = 8;
    private $name;
    private $shortcut;
    private $mode;
    private $default;
    private $description;
    public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
    {
        if (\str_starts_with($name, '--')) {
            $name = \substr($name, 2);
        }
        if (empty($name)) {
            throw new InvalidArgumentException('An option name cannot be empty.');
        }
        if (empty($shortcut)) {
            $shortcut = null;
        }
        if (null !== $shortcut) {
            if (\is_array($shortcut)) {
                $shortcut = \implode('|', $shortcut);
            }
            $shortcuts = \preg_split('{(\\|)-?}', \ltrim($shortcut, '-'));
            $shortcuts = \array_filter($shortcuts);
            $shortcut = \implode('|', $shortcuts);
            if (empty($shortcut)) {
                throw new InvalidArgumentException('An option shortcut cannot be empty.');
            }
        }
        if (null === $mode) {
            $mode = self::VALUE_NONE;
        } elseif ($mode > 15 || $mode < 1) {
            throw new InvalidArgumentException(\sprintf('Option mode "%s" is not valid.', $mode));
        }
        $this->name = $name;
        $this->shortcut = $shortcut;
        $this->mode = $mode;
        $this->description = $description;
        if ($this->isArray() && !$this->acceptValue()) {
            throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.');
        }
        $this->setDefault($default);
    }
    public function getShortcut()
    {
        return $this->shortcut;
    }
    public function getName()
    {
        return $this->name;
    }
    public function acceptValue()
    {
        return $this->isValueRequired() || $this->isValueOptional();
    }
    public function isValueRequired()
    {
        return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode);
    }
    public function isValueOptional()
    {
        return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode);
    }
    public function isArray()
    {
        return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode);
    }
    public function setDefault($default = null)
    {
        if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) {
            throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.');
        }
        if ($this->isArray()) {
            if (null === $default) {
                $default = [];
            } elseif (!\is_array($default)) {
                throw new LogicException('A default value for an array option must be an array.');
            }
        }
        $this->default = $this->acceptValue() ? $default : \false;
    }
    public function getDefault()
    {
        return $this->default;
    }
    public function getDescription()
    {
        return $this->description;
    }
    public function equals(self $option)
    {
        return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut() && $option->getDefault() === $this->getDefault() && $option->isArray() === $this->isArray() && $option->isValueRequired() === $this->isValueRequired() && $option->isValueOptional() === $this->isValueOptional();
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
class InputDefinition
{
    private $arguments;
    private $requiredCount;
    private $hasAnArrayArgument = \false;
    private $hasOptional;
    private $options;
    private $shortcuts;
    public function __construct(array $definition = [])
    {
        $this->setDefinition($definition);
    }
    public function setDefinition(array $definition)
    {
        $arguments = [];
        $options = [];
        foreach ($definition as $item) {
            if ($item instanceof InputOption) {
                $options[] = $item;
            } else {
                $arguments[] = $item;
            }
        }
        $this->setArguments($arguments);
        $this->setOptions($options);
    }
    public function setArguments($arguments = [])
    {
        $this->arguments = [];
        $this->requiredCount = 0;
        $this->hasOptional = \false;
        $this->hasAnArrayArgument = \false;
        $this->addArguments($arguments);
    }
    public function addArguments($arguments = [])
    {
        if (null !== $arguments) {
            foreach ($arguments as $argument) {
                $this->addArgument($argument);
            }
        }
    }
    public function addArgument(InputArgument $argument)
    {
        if (isset($this->arguments[$argument->getName()])) {
            throw new LogicException(\sprintf('An argument with name "%s" already exists.', $argument->getName()));
        }
        if ($this->hasAnArrayArgument) {
            throw new LogicException('Cannot add an argument after an array argument.');
        }
        if ($argument->isRequired() && $this->hasOptional) {
            throw new LogicException('Cannot add a required argument after an optional one.');
        }
        if ($argument->isArray()) {
            $this->hasAnArrayArgument = \true;
        }
        if ($argument->isRequired()) {
            ++$this->requiredCount;
        } else {
            $this->hasOptional = \true;
        }
        $this->arguments[$argument->getName()] = $argument;
    }
    public function getArgument($name)
    {
        if (!$this->hasArgument($name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name));
        }
        $arguments = \is_int($name) ? \array_values($this->arguments) : $this->arguments;
        return $arguments[$name];
    }
    public function hasArgument($name)
    {
        $arguments = \is_int($name) ? \array_values($this->arguments) : $this->arguments;
        return isset($arguments[$name]);
    }
    public function getArguments()
    {
        return $this->arguments;
    }
    public function getArgumentCount()
    {
        return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments);
    }
    public function getArgumentRequiredCount()
    {
        return $this->requiredCount;
    }
    public function getArgumentDefaults()
    {
        $values = [];
        foreach ($this->arguments as $argument) {
            $values[$argument->getName()] = $argument->getDefault();
        }
        return $values;
    }
    public function setOptions($options = [])
    {
        $this->options = [];
        $this->shortcuts = [];
        $this->addOptions($options);
    }
    public function addOptions($options = [])
    {
        foreach ($options as $option) {
            $this->addOption($option);
        }
    }
    public function addOption(InputOption $option)
    {
        if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) {
            throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName()));
        }
        if ($option->getShortcut()) {
            foreach (\explode('|', $option->getShortcut()) as $shortcut) {
                if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) {
                    throw new LogicException(\sprintf('An option with shortcut "%s" already exists.', $shortcut));
                }
            }
        }
        $this->options[$option->getName()] = $option;
        if ($option->getShortcut()) {
            foreach (\explode('|', $option->getShortcut()) as $shortcut) {
                $this->shortcuts[$shortcut] = $option->getName();
            }
        }
    }
    public function getOption($name)
    {
        if (!$this->hasOption($name)) {
            throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $name));
        }
        return $this->options[$name];
    }
    public function hasOption($name)
    {
        return isset($this->options[$name]);
    }
    public function getOptions()
    {
        return $this->options;
    }
    public function hasShortcut($name)
    {
        return isset($this->shortcuts[$name]);
    }
    public function getOptionForShortcut($shortcut)
    {
        return $this->getOption($this->shortcutToName($shortcut));
    }
    public function getOptionDefaults()
    {
        $values = [];
        foreach ($this->options as $option) {
            $values[$option->getName()] = $option->getDefault();
        }
        return $values;
    }
    public function shortcutToName(string $shortcut) : string
    {
        if (!isset($this->shortcuts[$shortcut])) {
            throw new InvalidArgumentException(\sprintf('The "-%s" option does not exist.', $shortcut));
        }
        return $this->shortcuts[$shortcut];
    }
    public function getSynopsis($short = \false)
    {
        $elements = [];
        if ($short && $this->getOptions()) {
            $elements[] = '[options]';
        } elseif (!$short) {
            foreach ($this->getOptions() as $option) {
                $value = '';
                if ($option->acceptValue()) {
                    $value = \sprintf(' %s%s%s', $option->isValueOptional() ? '[' : '', \strtoupper($option->getName()), $option->isValueOptional() ? ']' : '');
                }
                $shortcut = $option->getShortcut() ? \sprintf('-%s|', $option->getShortcut()) : '';
                $elements[] = \sprintf('[%s--%s%s]', $shortcut, $option->getName(), $value);
            }
        }
        if (\count($elements) && $this->getArguments()) {
            $elements[] = '[--]';
        }
        $tail = '';
        foreach ($this->getArguments() as $argument) {
            $element = '<' . $argument->getName() . '>';
            if ($argument->isArray()) {
                $element .= '...';
            }
            if (!$argument->isRequired()) {
                $element = '[' . $element;
                $tail .= ']';
            }
            $elements[] = $element;
        }
        return \implode(' ', $elements) . $tail;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class StringInput extends ArgvInput
{
    public const REGEX_STRING = '([^\\s]+?)(?:\\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
    public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
    public function __construct(string $input)
    {
        parent::__construct([]);
        $this->setTokens($this->tokenize($input));
    }
    private function tokenize(string $input) : array
    {
        $tokens = [];
        $length = \strlen($input);
        $cursor = 0;
        while ($cursor < $length) {
            if (\preg_match('/\\s+/A', $input, $match, 0, $cursor)) {
            } elseif (\preg_match('/([^="\'\\s]+?)(=?)(' . self::REGEX_QUOTED_STRING . '+)/A', $input, $match, 0, $cursor)) {
                $tokens[] = $match[1] . $match[2] . \stripcslashes(\str_replace(['"\'', '\'"', '\'\'', '""'], '', \substr($match[3], 1, -1)));
            } elseif (\preg_match('/' . self::REGEX_QUOTED_STRING . '/A', $input, $match, 0, $cursor)) {
                $tokens[] = \stripcslashes(\substr($match[0], 1, -1));
            } elseif (\preg_match('/' . self::REGEX_STRING . '/A', $input, $match, 0, $cursor)) {
                $tokens[] = \stripcslashes($match[1]);
            } else {
                throw new InvalidArgumentException(\sprintf('Unable to parse input near "... %s ...".', \substr($input, $cursor, 10)));
            }
            $cursor += \strlen($match[0]);
        }
        return $tokens;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
abstract class Input implements InputInterface, StreamableInputInterface
{
    protected $definition;
    protected $stream;
    protected $options = [];
    protected $arguments = [];
    protected $interactive = \true;
    public function __construct(InputDefinition $definition = null)
    {
        if (null === $definition) {
            $this->definition = new InputDefinition();
        } else {
            $this->bind($definition);
            $this->validate();
        }
    }
    public function bind(InputDefinition $definition)
    {
        $this->arguments = [];
        $this->options = [];
        $this->definition = $definition;
        $this->parse();
    }
    protected abstract function parse();
    public function validate()
    {
        $definition = $this->definition;
        $givenArguments = $this->arguments;
        $missingArguments = \array_filter(\array_keys($definition->getArguments()), function ($argument) use($definition, $givenArguments) {
            return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
        });
        if (\count($missingArguments) > 0) {
            throw new RuntimeException(\sprintf('Not enough arguments (missing: "%s").', \implode(', ', $missingArguments)));
        }
    }
    public function isInteractive()
    {
        return $this->interactive;
    }
    public function setInteractive($interactive)
    {
        $this->interactive = (bool) $interactive;
    }
    public function getArguments()
    {
        return \array_merge($this->definition->getArgumentDefaults(), $this->arguments);
    }
    public function getArgument($name)
    {
        if (!$this->definition->hasArgument((string) $name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name));
        }
        return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault();
    }
    public function setArgument($name, $value)
    {
        if (!$this->definition->hasArgument((string) $name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name));
        }
        $this->arguments[$name] = $value;
    }
    public function hasArgument($name)
    {
        return $this->definition->hasArgument((string) $name);
    }
    public function getOptions()
    {
        return \array_merge($this->definition->getOptionDefaults(), $this->options);
    }
    public function getOption($name)
    {
        if (!$this->definition->hasOption($name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name));
        }
        return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
    }
    public function setOption($name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name));
        }
        $this->options[$name] = $value;
    }
    public function hasOption($name)
    {
        return $this->definition->hasOption($name);
    }
    public function escapeToken($token)
    {
        return \preg_match('{^[\\w-]+$}', $token) ? $token : \escapeshellarg($token);
    }
    public function setStream($stream)
    {
        $this->stream = $stream;
    }
    public function getStream()
    {
        return $this->stream;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Input;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
interface InputInterface
{
    public function getFirstArgument();
    public function hasParameterOption($values, $onlyParams = \false);
    public function getParameterOption($values, $default = \false, $onlyParams = \false);
    public function bind(InputDefinition $definition);
    public function validate();
    public function getArguments();
    public function getArgument($name);
    public function setArgument($name, $value);
    public function hasArgument($name);
    public function getOptions();
    public function getOption($name);
    public function setOption($name, $value);
    public function hasOption($name);
    public function isInteractive();
    public function setInteractive($interactive);
}
<?php

namespace Cvphar\Symfony\Component\Console;

class Terminal
{
    private static $width;
    private static $height;
    private static $stty;
    public function getWidth()
    {
        $width = \getenv('COLUMNS');
        if (\false !== $width) {
            return (int) \trim($width);
        }
        if (null === self::$width) {
            self::initDimensions();
        }
        return self::$width ?: 80;
    }
    public function getHeight()
    {
        $height = \getenv('LINES');
        if (\false !== $height) {
            return (int) \trim($height);
        }
        if (null === self::$height) {
            self::initDimensions();
        }
        return self::$height ?: 50;
    }
    public static function hasSttyAvailable()
    {
        if (null !== self::$stty) {
            return self::$stty;
        }
        if (!\function_exists('exec')) {
            return \false;
        }
        \exec('stty 2>&1', $output, $exitcode);
        return self::$stty = 0 === $exitcode;
    }
    private static function initDimensions()
    {
        if ('\\' === \DIRECTORY_SEPARATOR) {
            if (\preg_match('/^(\\d+)x(\\d+)(?: \\((\\d+)x(\\d+)\\))?$/', \trim(\getenv('ANSICON')), $matches)) {
                self::$width = (int) $matches[1];
                self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
            } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) {
                self::initDimensionsUsingStty();
            } elseif (null !== ($dimensions = self::getConsoleMode())) {
                self::$width = (int) $dimensions[0];
                self::$height = (int) $dimensions[1];
            }
        } else {
            self::initDimensionsUsingStty();
        }
    }
    private static function hasVt100Support() : bool
    {
        return \function_exists('sapi_windows_vt100_support') && \sapi_windows_vt100_support(\fopen('php://stdout', 'w'));
    }
    private static function initDimensionsUsingStty()
    {
        if ($sttyString = self::getSttyColumns()) {
            if (\preg_match('/rows.(\\d+);.columns.(\\d+);/i', $sttyString, $matches)) {
                self::$width = (int) $matches[2];
                self::$height = (int) $matches[1];
            } elseif (\preg_match('/;.(\\d+).rows;.(\\d+).columns/i', $sttyString, $matches)) {
                self::$width = (int) $matches[2];
                self::$height = (int) $matches[1];
            }
        }
    }
    private static function getConsoleMode() : ?array
    {
        $info = self::readFromProcess('mode CON');
        if (null === $info || !\preg_match('/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/', $info, $matches)) {
            return null;
        }
        return [(int) $matches[2], (int) $matches[1]];
    }
    private static function getSttyColumns() : ?string
    {
        return self::readFromProcess('stty -a | grep columns');
    }
    private static function readFromProcess(string $command) : ?string
    {
        if (!\function_exists('proc_open')) {
            return null;
        }
        $descriptorspec = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
        $process = \proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => \true]);
        if (!\is_resource($process)) {
            return null;
        }
        $info = \stream_get_contents($pipes[1]);
        \fclose($pipes[1]);
        \fclose($pipes[2]);
        \proc_close($process);
        return $info;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
class TrimmedBufferOutput extends Output
{
    private $maxLength;
    private $buffer = '';
    public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = \false, OutputFormatterInterface $formatter = null)
    {
        if ($maxLength <= 0) {
            throw new InvalidArgumentException(\sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength));
        }
        parent::__construct($verbosity, $decorated, $formatter);
        $this->maxLength = $maxLength;
    }
    public function fetch()
    {
        $content = $this->buffer;
        $this->buffer = '';
        return $content;
    }
    protected function doWrite($message, $newline)
    {
        $this->buffer .= $message;
        if ($newline) {
            $this->buffer .= \PHP_EOL;
        }
        $this->buffer = \substr($this->buffer, 0 - $this->maxLength);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

interface ConsoleOutputInterface extends OutputInterface
{
    public function getErrorOutput();
    public function setErrorOutput(OutputInterface $error);
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

class BufferedOutput extends Output
{
    private $buffer = '';
    public function fetch()
    {
        $content = $this->buffer;
        $this->buffer = '';
        return $content;
    }
    protected function doWrite($message, $newline)
    {
        $this->buffer .= $message;
        if ($newline) {
            $this->buffer .= \PHP_EOL;
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
interface OutputInterface
{
    public const VERBOSITY_QUIET = 16;
    public const VERBOSITY_NORMAL = 32;
    public const VERBOSITY_VERBOSE = 64;
    public const VERBOSITY_VERY_VERBOSE = 128;
    public const VERBOSITY_DEBUG = 256;
    public const OUTPUT_NORMAL = 1;
    public const OUTPUT_RAW = 2;
    public const OUTPUT_PLAIN = 4;
    public function write($messages, $newline = \false, $options = 0);
    public function writeln($messages, $options = 0);
    public function setVerbosity($level);
    public function getVerbosity();
    public function isQuiet();
    public function isVerbose();
    public function isVeryVerbose();
    public function isDebug();
    public function setDecorated($decorated);
    public function isDecorated();
    public function setFormatter(OutputFormatterInterface $formatter);
    public function getFormatter();
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
abstract class Output implements OutputInterface
{
    private $verbosity;
    private $formatter;
    public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = \false, OutputFormatterInterface $formatter = null)
    {
        $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
        $this->formatter = $formatter ?? new OutputFormatter();
        $this->formatter->setDecorated($decorated);
    }
    public function setFormatter(OutputFormatterInterface $formatter)
    {
        $this->formatter = $formatter;
    }
    public function getFormatter()
    {
        return $this->formatter;
    }
    public function setDecorated($decorated)
    {
        $this->formatter->setDecorated($decorated);
    }
    public function isDecorated()
    {
        return $this->formatter->isDecorated();
    }
    public function setVerbosity($level)
    {
        $this->verbosity = (int) $level;
    }
    public function getVerbosity()
    {
        return $this->verbosity;
    }
    public function isQuiet()
    {
        return self::VERBOSITY_QUIET === $this->verbosity;
    }
    public function isVerbose()
    {
        return self::VERBOSITY_VERBOSE <= $this->verbosity;
    }
    public function isVeryVerbose()
    {
        return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity;
    }
    public function isDebug()
    {
        return self::VERBOSITY_DEBUG <= $this->verbosity;
    }
    public function writeln($messages, $options = self::OUTPUT_NORMAL)
    {
        $this->write($messages, \true, $options);
    }
    public function write($messages, $newline = \false, $options = self::OUTPUT_NORMAL)
    {
        if (!\is_iterable($messages)) {
            $messages = [$messages];
        }
        $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN;
        $type = $types & $options ?: self::OUTPUT_NORMAL;
        $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG;
        $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL;
        if ($verbosity > $this->getVerbosity()) {
            return;
        }
        foreach ($messages as $message) {
            switch ($type) {
                case OutputInterface::OUTPUT_NORMAL:
                    $message = $this->formatter->format($message);
                    break;
                case OutputInterface::OUTPUT_RAW:
                    break;
                case OutputInterface::OUTPUT_PLAIN:
                    $message = \strip_tags($this->formatter->format($message));
                    break;
            }
            $this->doWrite($message ?? '', $newline);
        }
    }
    protected abstract function doWrite($message, $newline);
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Cvphar\Symfony\Component\Console\Helper\Helper;
use Cvphar\Symfony\Component\Console\Terminal;
class ConsoleSectionOutput extends StreamOutput
{
    private $content = [];
    private $lines = 0;
    private $sections;
    private $terminal;
    public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter)
    {
        parent::__construct($stream, $verbosity, $decorated, $formatter);
        \array_unshift($sections, $this);
        $this->sections =& $sections;
        $this->terminal = new Terminal();
    }
    public function clear(int $lines = null)
    {
        if (empty($this->content) || !$this->isDecorated()) {
            return;
        }
        if ($lines) {
            \array_splice($this->content, -($lines * 2));
        } else {
            $lines = $this->lines;
            $this->content = [];
        }
        $this->lines -= $lines;
        parent::doWrite($this->popStreamContentUntilCurrentSection($lines), \false);
    }
    public function overwrite($message)
    {
        $this->clear();
        $this->writeln($message);
    }
    public function getContent() : string
    {
        return \implode('', $this->content);
    }
    public function addContent(string $input)
    {
        foreach (\explode(\PHP_EOL, $input) as $lineContent) {
            $this->lines += \ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1;
            $this->content[] = $lineContent;
            $this->content[] = \PHP_EOL;
        }
    }
    protected function doWrite($message, $newline)
    {
        if (!$this->isDecorated()) {
            parent::doWrite($message, $newline);
            return;
        }
        $erasedContent = $this->popStreamContentUntilCurrentSection();
        $this->addContent($message);
        parent::doWrite($message, \true);
        parent::doWrite($erasedContent, \false);
    }
    private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0) : string
    {
        $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection;
        $erasedContent = [];
        foreach ($this->sections as $section) {
            if ($section === $this) {
                break;
            }
            $numberOfLinesToClear += $section->lines;
            $erasedContent[] = $section->getContent();
        }
        if ($numberOfLinesToClear > 0) {
            parent::doWrite(\sprintf("\x1b[%dA", $numberOfLinesToClear), \false);
            parent::doWrite("\x1b[0J", \false);
        }
        return \implode('', \array_reverse($erasedContent));
    }
    private function getDisplayLength(string $text) : string
    {
        return Helper::strlenWithoutDecoration($this->getFormatter(), \str_replace("\t", '        ', $text));
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
{
    private $stderr;
    private $consoleSectionOutputs = [];
    public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
    {
        parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
        if (null === $formatter) {
            $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated);
            return;
        }
        $actualDecorated = $this->isDecorated();
        $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
        if (null === $decorated) {
            $this->setDecorated($actualDecorated && $this->stderr->isDecorated());
        }
    }
    public function section() : ConsoleSectionOutput
    {
        return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter());
    }
    public function setDecorated($decorated)
    {
        parent::setDecorated($decorated);
        $this->stderr->setDecorated($decorated);
    }
    public function setFormatter(OutputFormatterInterface $formatter)
    {
        parent::setFormatter($formatter);
        $this->stderr->setFormatter($formatter);
    }
    public function setVerbosity($level)
    {
        parent::setVerbosity($level);
        $this->stderr->setVerbosity($level);
    }
    public function getErrorOutput()
    {
        return $this->stderr;
    }
    public function setErrorOutput(OutputInterface $error)
    {
        $this->stderr = $error;
    }
    protected function hasStdoutSupport()
    {
        return \false === $this->isRunningOS400();
    }
    protected function hasStderrSupport()
    {
        return \false === $this->isRunningOS400();
    }
    private function isRunningOS400() : bool
    {
        $checks = [\function_exists('php_uname') ? \php_uname('s') : '', \getenv('OSTYPE'), \PHP_OS];
        return \false !== \stripos(\implode(';', $checks), 'OS400');
    }
    private function openOutputStream()
    {
        if (!$this->hasStdoutSupport()) {
            return \fopen('php://output', 'w');
        }
        return @\fopen('php://stdout', 'w') ?: \fopen('php://output', 'w');
    }
    private function openErrorStream()
    {
        return \fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w');
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
class NullOutput implements OutputInterface
{
    public function setFormatter(OutputFormatterInterface $formatter)
    {
    }
    public function getFormatter()
    {
        return new OutputFormatter();
    }
    public function setDecorated($decorated)
    {
    }
    public function isDecorated()
    {
        return \false;
    }
    public function setVerbosity($level)
    {
    }
    public function getVerbosity()
    {
        return self::VERBOSITY_QUIET;
    }
    public function isQuiet()
    {
        return \true;
    }
    public function isVerbose()
    {
        return \false;
    }
    public function isVeryVerbose()
    {
        return \false;
    }
    public function isDebug()
    {
        return \false;
    }
    public function writeln($messages, $options = self::OUTPUT_NORMAL)
    {
    }
    public function write($messages, $newline = \false, $options = self::OUTPUT_NORMAL)
    {
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Output;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
class StreamOutput extends Output
{
    private $stream;
    public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
    {
        if (!\is_resource($stream) || 'stream' !== \get_resource_type($stream)) {
            throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
        }
        $this->stream = $stream;
        if (null === $decorated) {
            $decorated = $this->hasColorSupport();
        }
        parent::__construct($verbosity, $decorated, $formatter);
    }
    public function getStream()
    {
        return $this->stream;
    }
    protected function doWrite($message, $newline)
    {
        if ($newline) {
            $message .= \PHP_EOL;
        }
        @\fwrite($this->stream, $message);
        \fflush($this->stream);
    }
    protected function hasColorSupport()
    {
        if (isset($_SERVER['NO_COLOR']) || \false !== \getenv('NO_COLOR')) {
            return \false;
        }
        if ('Hyper' === \getenv('TERM_PROGRAM')) {
            return \true;
        }
        if (\DIRECTORY_SEPARATOR === '\\') {
            return \function_exists('sapi_windows_vt100_support') && @\sapi_windows_vt100_support($this->stream) || \false !== \getenv('ANSICON') || 'ON' === \getenv('ConEmuANSI') || 'xterm' === \getenv('TERM');
        }
        if (\function_exists('stream_isatty')) {
            return @\stream_isatty($this->stream);
        }
        if (\function_exists('posix_isatty')) {
            return @\posix_isatty($this->stream);
        }
        $stat = @\fstat($this->stream);
        return $stat ? 020000 === ($stat['mode'] & 0170000) : \false;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Style;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Cvphar\Symfony\Component\Console\Helper\ProgressBar;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
abstract class OutputStyle implements OutputInterface, StyleInterface
{
    private $output;
    public function __construct(OutputInterface $output)
    {
        $this->output = $output;
    }
    public function newLine($count = 1)
    {
        $this->output->write(\str_repeat(\PHP_EOL, $count));
    }
    public function createProgressBar($max = 0)
    {
        return new ProgressBar($this->output, $max);
    }
    public function write($messages, $newline = \false, $type = self::OUTPUT_NORMAL)
    {
        $this->output->write($messages, $newline, $type);
    }
    public function writeln($messages, $type = self::OUTPUT_NORMAL)
    {
        $this->output->writeln($messages, $type);
    }
    public function setVerbosity($level)
    {
        $this->output->setVerbosity($level);
    }
    public function getVerbosity()
    {
        return $this->output->getVerbosity();
    }
    public function setDecorated($decorated)
    {
        $this->output->setDecorated($decorated);
    }
    public function isDecorated()
    {
        return $this->output->isDecorated();
    }
    public function setFormatter(OutputFormatterInterface $formatter)
    {
        $this->output->setFormatter($formatter);
    }
    public function getFormatter()
    {
        return $this->output->getFormatter();
    }
    public function isQuiet()
    {
        return $this->output->isQuiet();
    }
    public function isVerbose()
    {
        return $this->output->isVerbose();
    }
    public function isVeryVerbose()
    {
        return $this->output->isVeryVerbose();
    }
    public function isDebug()
    {
        return $this->output->isDebug();
    }
    protected function getErrorOutput()
    {
        if (!$this->output instanceof ConsoleOutputInterface) {
            return $this->output;
        }
        return $this->output->getErrorOutput();
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Style;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Helper\Helper;
use Cvphar\Symfony\Component\Console\Helper\ProgressBar;
use Cvphar\Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Cvphar\Symfony\Component\Console\Helper\Table;
use Cvphar\Symfony\Component\Console\Helper\TableCell;
use Cvphar\Symfony\Component\Console\Helper\TableSeparator;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Output\TrimmedBufferOutput;
use Cvphar\Symfony\Component\Console\Question\ChoiceQuestion;
use Cvphar\Symfony\Component\Console\Question\ConfirmationQuestion;
use Cvphar\Symfony\Component\Console\Question\Question;
use Cvphar\Symfony\Component\Console\Terminal;
class SymfonyStyle extends OutputStyle
{
    public const MAX_LINE_LENGTH = 120;
    private $input;
    private $questionHelper;
    private $progressBar;
    private $lineLength;
    private $bufferedOutput;
    public function __construct(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), \false, clone $output->getFormatter());
        $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH;
        $this->lineLength = \min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
        parent::__construct($output);
    }
    public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = \false, $escape = \true)
    {
        $messages = \is_array($messages) ? \array_values($messages) : [$messages];
        $this->autoPrependBlock();
        $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape));
        $this->newLine();
    }
    public function title($message)
    {
        $this->autoPrependBlock();
        $this->writeln([\sprintf('<comment>%s</>', OutputFormatter::escapeTrailingBackslash($message)), \sprintf('<comment>%s</>', \str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message)))]);
        $this->newLine();
    }
    public function section($message)
    {
        $this->autoPrependBlock();
        $this->writeln([\sprintf('<comment>%s</>', OutputFormatter::escapeTrailingBackslash($message)), \sprintf('<comment>%s</>', \str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message)))]);
        $this->newLine();
    }
    public function listing(array $elements)
    {
        $this->autoPrependText();
        $elements = \array_map(function ($element) {
            return \sprintf(' * %s', $element);
        }, $elements);
        $this->writeln($elements);
        $this->newLine();
    }
    public function text($message)
    {
        $this->autoPrependText();
        $messages = \is_array($message) ? \array_values($message) : [$message];
        foreach ($messages as $message) {
            $this->writeln(\sprintf(' %s', $message));
        }
    }
    public function comment($message)
    {
        $this->block($message, null, null, '<fg=default;bg=default> // </>', \false, \false);
    }
    public function success($message)
    {
        $this->block($message, 'OK', 'fg=black;bg=green', ' ', \true);
    }
    public function error($message)
    {
        $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', \true);
    }
    public function warning($message)
    {
        $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', \true);
    }
    public function note($message)
    {
        $this->block($message, 'NOTE', 'fg=yellow', ' ! ');
    }
    public function caution($message)
    {
        $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', \true);
    }
    public function table(array $headers, array $rows)
    {
        $style = clone Table::getStyleDefinition('symfony-style-guide');
        $style->setCellHeaderFormat('<info>%s</info>');
        $table = new Table($this);
        $table->setHeaders($headers);
        $table->setRows($rows);
        $table->setStyle($style);
        $table->render();
        $this->newLine();
    }
    public function horizontalTable(array $headers, array $rows)
    {
        $style = clone Table::getStyleDefinition('symfony-style-guide');
        $style->setCellHeaderFormat('<info>%s</info>');
        $table = new Table($this);
        $table->setHeaders($headers);
        $table->setRows($rows);
        $table->setStyle($style);
        $table->setHorizontal(\true);
        $table->render();
        $this->newLine();
    }
    public function definitionList(...$list)
    {
        $style = clone Table::getStyleDefinition('symfony-style-guide');
        $style->setCellHeaderFormat('<info>%s</info>');
        $table = new Table($this);
        $headers = [];
        $row = [];
        foreach ($list as $value) {
            if ($value instanceof TableSeparator) {
                $headers[] = $value;
                $row[] = $value;
                continue;
            }
            if (\is_string($value)) {
                $headers[] = new TableCell($value, ['colspan' => 2]);
                $row[] = null;
                continue;
            }
            if (!\is_array($value)) {
                throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.');
            }
            $headers[] = \key($value);
            $row[] = \current($value);
        }
        $table->setHeaders($headers);
        $table->setRows([$row]);
        $table->setHorizontal();
        $table->setStyle($style);
        $table->render();
        $this->newLine();
    }
    public function ask($question, $default = null, $validator = null)
    {
        $question = new Question($question, $default);
        $question->setValidator($validator);
        return $this->askQuestion($question);
    }
    public function askHidden($question, $validator = null)
    {
        $question = new Question($question);
        $question->setHidden(\true);
        $question->setValidator($validator);
        return $this->askQuestion($question);
    }
    public function confirm($question, $default = \true)
    {
        return $this->askQuestion(new ConfirmationQuestion($question, $default));
    }
    public function choice($question, array $choices, $default = null)
    {
        if (null !== $default) {
            $values = \array_flip($choices);
            $default = $values[$default] ?? $default;
        }
        return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
    }
    public function progressStart($max = 0)
    {
        $this->progressBar = $this->createProgressBar($max);
        $this->progressBar->start();
    }
    public function progressAdvance($step = 1)
    {
        $this->getProgressBar()->advance($step);
    }
    public function progressFinish()
    {
        $this->getProgressBar()->finish();
        $this->newLine(2);
        $this->progressBar = null;
    }
    public function createProgressBar($max = 0)
    {
        $progressBar = parent::createProgressBar($max);
        if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === \getenv('TERM_PROGRAM')) {
            $progressBar->setEmptyBarCharacter('â–‘');
            $progressBar->setProgressCharacter('');
            $progressBar->setBarCharacter('â–“');
        }
        return $progressBar;
    }
    public function askQuestion(Question $question)
    {
        if ($this->input->isInteractive()) {
            $this->autoPrependBlock();
        }
        if (!$this->questionHelper) {
            $this->questionHelper = new SymfonyQuestionHelper();
        }
        $answer = $this->questionHelper->ask($this->input, $this, $question);
        if ($this->input->isInteractive()) {
            $this->newLine();
            $this->bufferedOutput->write("\n");
        }
        return $answer;
    }
    public function writeln($messages, $type = self::OUTPUT_NORMAL)
    {
        if (!\is_iterable($messages)) {
            $messages = [$messages];
        }
        foreach ($messages as $message) {
            parent::writeln($message, $type);
            $this->writeBuffer($message, \true, $type);
        }
    }
    public function write($messages, $newline = \false, $type = self::OUTPUT_NORMAL)
    {
        if (!\is_iterable($messages)) {
            $messages = [$messages];
        }
        foreach ($messages as $message) {
            parent::write($message, $newline, $type);
            $this->writeBuffer($message, $newline, $type);
        }
    }
    public function newLine($count = 1)
    {
        parent::newLine($count);
        $this->bufferedOutput->write(\str_repeat("\n", $count));
    }
    public function getErrorStyle()
    {
        return new self($this->input, $this->getErrorOutput());
    }
    private function getProgressBar() : ProgressBar
    {
        if (!$this->progressBar) {
            throw new RuntimeException('The ProgressBar is not started.');
        }
        return $this->progressBar;
    }
    private function autoPrependBlock() : void
    {
        $chars = \substr(\str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
        if (!isset($chars[0])) {
            $this->newLine();
            return;
        }
        $this->newLine(2 - \substr_count($chars, "\n"));
    }
    private function autoPrependText() : void
    {
        $fetched = $this->bufferedOutput->fetch();
        if (!\str_ends_with($fetched, "\n")) {
            $this->newLine();
        }
    }
    private function writeBuffer(string $message, bool $newLine, int $type) : void
    {
        $this->bufferedOutput->write($message, $newLine, $type);
    }
    private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = \false, bool $escape = \false) : array
    {
        $indentLength = 0;
        $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
        $lines = [];
        if (null !== $type) {
            $type = \sprintf('[%s] ', $type);
            $indentLength = \strlen($type);
            $lineIndentation = \str_repeat(' ', $indentLength);
        }
        foreach ($messages as $key => $message) {
            if ($escape) {
                $message = OutputFormatter::escape($message);
            }
            $decorationLength = Helper::strlen($message) - Helper::strlenWithoutDecoration($this->getFormatter(), $message);
            $messageLineLength = \min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength);
            $messageLines = \explode(\PHP_EOL, \wordwrap($message, $messageLineLength, \PHP_EOL, \true));
            foreach ($messageLines as $messageLine) {
                $lines[] = $messageLine;
            }
            if (\count($messages) > 1 && $key < \count($messages) - 1) {
                $lines[] = '';
            }
        }
        $firstLineIndex = 0;
        if ($padding && $this->isDecorated()) {
            $firstLineIndex = 1;
            \array_unshift($lines, '');
            $lines[] = '';
        }
        foreach ($lines as $i => &$line) {
            if (null !== $type) {
                $line = $firstLineIndex === $i ? $type . $line : $lineIndentation . $line;
            }
            $line = $prefix . $line;
            $line .= \str_repeat(' ', \max($this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line), 0));
            if ($style) {
                $line = \sprintf('<%s>%s</>', $style, $line);
            }
        }
        return $lines;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Style;

interface StyleInterface
{
    public function title($message);
    public function section($message);
    public function listing(array $elements);
    public function text($message);
    public function success($message);
    public function error($message);
    public function warning($message);
    public function note($message);
    public function caution($message);
    public function table(array $headers, array $rows);
    public function ask($question, $default = null, $validator = null);
    public function askHidden($question, $validator = null);
    public function confirm($question, $default = \true);
    public function choice($question, array $choices, $default = null);
    public function newLine($count = 1);
    public function progressStart($max = 0);
    public function progressAdvance($step = 1);
    public function progressFinish();
}
<?php

namespace Cvphar\Symfony\Component\Console\Question;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class ChoiceQuestion extends Question
{
    private $choices;
    private $multiselect = \false;
    private $prompt = ' > ';
    private $errorMessage = 'Value "%s" is invalid';
    public function __construct(string $question, array $choices, $default = null)
    {
        if (!$choices) {
            throw new \LogicException('Choice question must have at least 1 choice available.');
        }
        parent::__construct($question, $default);
        $this->choices = $choices;
        $this->setValidator($this->getDefaultValidator());
        $this->setAutocompleterValues($choices);
    }
    public function getChoices()
    {
        return $this->choices;
    }
    public function setMultiselect($multiselect)
    {
        $this->multiselect = $multiselect;
        $this->setValidator($this->getDefaultValidator());
        return $this;
    }
    public function isMultiselect()
    {
        return $this->multiselect;
    }
    public function getPrompt()
    {
        return $this->prompt;
    }
    public function setPrompt($prompt)
    {
        $this->prompt = $prompt;
        return $this;
    }
    public function setErrorMessage($errorMessage)
    {
        $this->errorMessage = $errorMessage;
        $this->setValidator($this->getDefaultValidator());
        return $this;
    }
    private function getDefaultValidator() : callable
    {
        $choices = $this->choices;
        $errorMessage = $this->errorMessage;
        $multiselect = $this->multiselect;
        $isAssoc = $this->isAssoc($choices);
        return function ($selected) use($choices, $errorMessage, $multiselect, $isAssoc) {
            if ($multiselect) {
                if (!\preg_match('/^[^,]+(?:,[^,]+)*$/', $selected, $matches)) {
                    throw new InvalidArgumentException(\sprintf($errorMessage, $selected));
                }
                $selectedChoices = \explode(',', $selected);
            } else {
                $selectedChoices = [$selected];
            }
            if ($this->isTrimmable()) {
                foreach ($selectedChoices as $k => $v) {
                    $selectedChoices[$k] = \trim($v);
                }
            }
            $multiselectChoices = [];
            foreach ($selectedChoices as $value) {
                $results = [];
                foreach ($choices as $key => $choice) {
                    if ($choice === $value) {
                        $results[] = $key;
                    }
                }
                if (\count($results) > 1) {
                    throw new InvalidArgumentException(\sprintf('The provided answer is ambiguous. Value should be one of "%s".', \implode('" or "', $results)));
                }
                $result = \array_search($value, $choices);
                if (!$isAssoc) {
                    if (\false !== $result) {
                        $result = $choices[$result];
                    } elseif (isset($choices[$value])) {
                        $result = $choices[$value];
                    }
                } elseif (\false === $result && isset($choices[$value])) {
                    $result = $value;
                }
                if (\false === $result) {
                    throw new InvalidArgumentException(\sprintf($errorMessage, $value));
                }
                $multiselectChoices[] = (string) $result;
            }
            if ($multiselect) {
                return $multiselectChoices;
            }
            return \current($multiselectChoices);
        };
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Question;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
class Question
{
    private $question;
    private $attempts;
    private $hidden = \false;
    private $hiddenFallback = \true;
    private $autocompleterCallback;
    private $validator;
    private $default;
    private $normalizer;
    private $trimmable = \true;
    public function __construct(string $question, $default = null)
    {
        $this->question = $question;
        $this->default = $default;
    }
    public function getQuestion()
    {
        return $this->question;
    }
    public function getDefault()
    {
        return $this->default;
    }
    public function isHidden()
    {
        return $this->hidden;
    }
    public function setHidden($hidden)
    {
        if ($this->autocompleterCallback) {
            throw new LogicException('A hidden question cannot use the autocompleter.');
        }
        $this->hidden = (bool) $hidden;
        return $this;
    }
    public function isHiddenFallback()
    {
        return $this->hiddenFallback;
    }
    public function setHiddenFallback($fallback)
    {
        $this->hiddenFallback = (bool) $fallback;
        return $this;
    }
    public function getAutocompleterValues()
    {
        $callback = $this->getAutocompleterCallback();
        return $callback ? $callback('') : null;
    }
    public function setAutocompleterValues($values)
    {
        if (\is_array($values)) {
            $values = $this->isAssoc($values) ? \array_merge(\array_keys($values), \array_values($values)) : \array_values($values);
            $callback = static function () use($values) {
                return $values;
            };
        } elseif ($values instanceof \Traversable) {
            $valueCache = null;
            $callback = static function () use($values, &$valueCache) {
                return $valueCache ?? ($valueCache = \iterator_to_array($values, \false));
            };
        } elseif (null === $values) {
            $callback = null;
        } else {
            throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
        }
        return $this->setAutocompleterCallback($callback);
    }
    public function getAutocompleterCallback() : ?callable
    {
        return $this->autocompleterCallback;
    }
    public function setAutocompleterCallback(callable $callback = null) : self
    {
        if ($this->hidden && null !== $callback) {
            throw new LogicException('A hidden question cannot use the autocompleter.');
        }
        $this->autocompleterCallback = $callback;
        return $this;
    }
    public function setValidator(callable $validator = null)
    {
        $this->validator = $validator;
        return $this;
    }
    public function getValidator()
    {
        return $this->validator;
    }
    public function setMaxAttempts($attempts)
    {
        if (null !== $attempts) {
            $attempts = (int) $attempts;
            if ($attempts < 1) {
                throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
            }
        }
        $this->attempts = $attempts;
        return $this;
    }
    public function getMaxAttempts()
    {
        return $this->attempts;
    }
    public function setNormalizer(callable $normalizer)
    {
        $this->normalizer = $normalizer;
        return $this;
    }
    public function getNormalizer()
    {
        return $this->normalizer;
    }
    protected function isAssoc($array)
    {
        return (bool) \count(\array_filter(\array_keys($array), 'is_string'));
    }
    public function isTrimmable() : bool
    {
        return $this->trimmable;
    }
    public function setTrimmable(bool $trimmable) : self
    {
        $this->trimmable = $trimmable;
        return $this;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Question;

class ConfirmationQuestion extends Question
{
    private $trueAnswerRegex;
    public function __construct(string $question, bool $default = \true, string $trueAnswerRegex = '/^y/i')
    {
        parent::__construct($question, $default);
        $this->trueAnswerRegex = $trueAnswerRegex;
        $this->setNormalizer($this->getDefaultNormalizer());
    }
    private function getDefaultNormalizer() : callable
    {
        $default = $this->getDefault();
        $regex = $this->trueAnswerRegex;
        return function ($answer) use($default, $regex) {
            if (\is_bool($answer)) {
                return $answer;
            }
            $answerIsTrue = (bool) \preg_match($regex, $answer);
            if (\false === $default) {
                return $answer && $answerIsTrue;
            }
            return '' === $answer || $answerIsTrue;
        };
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class OutputFormatterStyle implements OutputFormatterStyleInterface
{
    private static $availableForegroundColors = ['black' => ['set' => 30, 'unset' => 39], 'red' => ['set' => 31, 'unset' => 39], 'green' => ['set' => 32, 'unset' => 39], 'yellow' => ['set' => 33, 'unset' => 39], 'blue' => ['set' => 34, 'unset' => 39], 'magenta' => ['set' => 35, 'unset' => 39], 'cyan' => ['set' => 36, 'unset' => 39], 'white' => ['set' => 37, 'unset' => 39], 'default' => ['set' => 39, 'unset' => 39]];
    private static $availableBackgroundColors = ['black' => ['set' => 40, 'unset' => 49], 'red' => ['set' => 41, 'unset' => 49], 'green' => ['set' => 42, 'unset' => 49], 'yellow' => ['set' => 43, 'unset' => 49], 'blue' => ['set' => 44, 'unset' => 49], 'magenta' => ['set' => 45, 'unset' => 49], 'cyan' => ['set' => 46, 'unset' => 49], 'white' => ['set' => 47, 'unset' => 49], 'default' => ['set' => 49, 'unset' => 49]];
    private static $availableOptions = ['bold' => ['set' => 1, 'unset' => 22], 'underscore' => ['set' => 4, 'unset' => 24], 'blink' => ['set' => 5, 'unset' => 25], 'reverse' => ['set' => 7, 'unset' => 27], 'conceal' => ['set' => 8, 'unset' => 28]];
    private $foreground;
    private $background;
    private $href;
    private $options = [];
    private $handlesHrefGracefully;
    public function __construct(string $foreground = null, string $background = null, array $options = [])
    {
        if (null !== $foreground) {
            $this->setForeground($foreground);
        }
        if (null !== $background) {
            $this->setBackground($background);
        }
        if (\count($options)) {
            $this->setOptions($options);
        }
    }
    public function setForeground($color = null)
    {
        if (null === $color) {
            $this->foreground = null;
            return;
        }
        if (!isset(static::$availableForegroundColors[$color])) {
            throw new InvalidArgumentException(\sprintf('Invalid foreground color specified: "%s". Expected one of (%s).', $color, \implode(', ', \array_keys(static::$availableForegroundColors))));
        }
        $this->foreground = static::$availableForegroundColors[$color];
    }
    public function setBackground($color = null)
    {
        if (null === $color) {
            $this->background = null;
            return;
        }
        if (!isset(static::$availableBackgroundColors[$color])) {
            throw new InvalidArgumentException(\sprintf('Invalid background color specified: "%s". Expected one of (%s).', $color, \implode(', ', \array_keys(static::$availableBackgroundColors))));
        }
        $this->background = static::$availableBackgroundColors[$color];
    }
    public function setHref(string $url) : void
    {
        $this->href = $url;
    }
    public function setOption($option)
    {
        if (!isset(static::$availableOptions[$option])) {
            throw new InvalidArgumentException(\sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, \implode(', ', \array_keys(static::$availableOptions))));
        }
        if (!\in_array(static::$availableOptions[$option], $this->options)) {
            $this->options[] = static::$availableOptions[$option];
        }
    }
    public function unsetOption($option)
    {
        if (!isset(static::$availableOptions[$option])) {
            throw new InvalidArgumentException(\sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, \implode(', ', \array_keys(static::$availableOptions))));
        }
        $pos = \array_search(static::$availableOptions[$option], $this->options);
        if (\false !== $pos) {
            unset($this->options[$pos]);
        }
    }
    public function setOptions(array $options)
    {
        $this->options = [];
        foreach ($options as $option) {
            $this->setOption($option);
        }
    }
    public function apply($text)
    {
        $setCodes = [];
        $unsetCodes = [];
        if (null === $this->handlesHrefGracefully) {
            $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== \getenv('TERMINAL_EMULATOR') && (!\getenv('KONSOLE_VERSION') || (int) \getenv('KONSOLE_VERSION') > 201100);
        }
        if (null !== $this->foreground) {
            $setCodes[] = $this->foreground['set'];
            $unsetCodes[] = $this->foreground['unset'];
        }
        if (null !== $this->background) {
            $setCodes[] = $this->background['set'];
            $unsetCodes[] = $this->background['unset'];
        }
        foreach ($this->options as $option) {
            $setCodes[] = $option['set'];
            $unsetCodes[] = $option['unset'];
        }
        if (null !== $this->href && $this->handlesHrefGracefully) {
            $text = "\x1b]8;;{$this->href}\x1b\\{$text}\x1b]8;;\x1b\\";
        }
        if (0 === \count($setCodes)) {
            return $text;
        }
        return \sprintf("\x1b[%sm%s\x1b[%sm", \implode(';', $setCodes), $text, \implode(';', $unsetCodes));
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

interface OutputFormatterStyleInterface
{
    public function setForeground($color = null);
    public function setBackground($color = null);
    public function setOption($option);
    public function unsetOption($option);
    public function setOptions(array $options);
    public function apply($text);
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

interface OutputFormatterInterface
{
    public function setDecorated($decorated);
    public function isDecorated();
    public function setStyle($name, OutputFormatterStyleInterface $style);
    public function hasStyle($name);
    public function getStyle($name);
    public function format($message);
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class OutputFormatter implements WrappableOutputFormatterInterface
{
    private $decorated;
    private $styles = [];
    private $styleStack;
    public function __clone()
    {
        $this->styleStack = clone $this->styleStack;
        foreach ($this->styles as $key => $value) {
            $this->styles[$key] = clone $value;
        }
    }
    public static function escape($text)
    {
        $text = \preg_replace('/([^\\\\]?)</', '$1\\<', $text);
        return self::escapeTrailingBackslash($text);
    }
    public static function escapeTrailingBackslash(string $text) : string
    {
        if (\str_ends_with($text, '\\')) {
            $len = \strlen($text);
            $text = \rtrim($text, '\\');
            $text = \str_replace("\x00", '', $text);
            $text .= \str_repeat("\x00", $len - \strlen($text));
        }
        return $text;
    }
    public function __construct(bool $decorated = \false, array $styles = [])
    {
        $this->decorated = $decorated;
        $this->setStyle('error', new OutputFormatterStyle('white', 'red'));
        $this->setStyle('info', new OutputFormatterStyle('green'));
        $this->setStyle('comment', new OutputFormatterStyle('yellow'));
        $this->setStyle('question', new OutputFormatterStyle('black', 'cyan'));
        foreach ($styles as $name => $style) {
            $this->setStyle($name, $style);
        }
        $this->styleStack = new OutputFormatterStyleStack();
    }
    public function setDecorated($decorated)
    {
        $this->decorated = (bool) $decorated;
    }
    public function isDecorated()
    {
        return $this->decorated;
    }
    public function setStyle($name, OutputFormatterStyleInterface $style)
    {
        $this->styles[\strtolower($name)] = $style;
    }
    public function hasStyle($name)
    {
        return isset($this->styles[\strtolower($name)]);
    }
    public function getStyle($name)
    {
        if (!$this->hasStyle($name)) {
            throw new InvalidArgumentException(\sprintf('Undefined style: "%s".', $name));
        }
        return $this->styles[\strtolower($name)];
    }
    public function format($message)
    {
        return $this->formatAndWrap((string) $message, 0);
    }
    public function formatAndWrap(string $message, int $width)
    {
        $offset = 0;
        $output = '';
        $tagRegex = '[a-z][^<>]*+';
        $currentLineLength = 0;
        \preg_match_all("#<(({$tagRegex}) | /({$tagRegex})?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE);
        foreach ($matches[0] as $i => $match) {
            $pos = $match[1];
            $text = $match[0];
            if (0 != $pos && '\\' == $message[$pos - 1]) {
                continue;
            }
            $output .= $this->applyCurrentStyle(\substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength);
            $offset = $pos + \strlen($text);
            if ($open = '/' != $text[1]) {
                $tag = $matches[1][$i][0];
            } else {
                $tag = $matches[3][$i][0] ?? '';
            }
            if (!$open && !$tag) {
                $this->styleStack->pop();
            } elseif (null === ($style = $this->createStyleFromString($tag))) {
                $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength);
            } elseif ($open) {
                $this->styleStack->push($style);
            } else {
                $this->styleStack->pop($style);
            }
        }
        $output .= $this->applyCurrentStyle(\substr($message, $offset), $output, $width, $currentLineLength);
        if (\str_contains($output, "\x00")) {
            return \strtr($output, ["\x00" => '\\', '\\<' => '<']);
        }
        return \str_replace('\\<', '<', $output);
    }
    public function getStyleStack()
    {
        return $this->styleStack;
    }
    private function createStyleFromString(string $string) : ?OutputFormatterStyleInterface
    {
        if (isset($this->styles[$string])) {
            return $this->styles[$string];
        }
        if (!\preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) {
            return null;
        }
        $style = new OutputFormatterStyle();
        foreach ($matches as $match) {
            \array_shift($match);
            $match[0] = \strtolower($match[0]);
            if ('fg' == $match[0]) {
                $style->setForeground(\strtolower($match[1]));
            } elseif ('bg' == $match[0]) {
                $style->setBackground(\strtolower($match[1]));
            } elseif ('href' === $match[0]) {
                $style->setHref($match[1]);
            } elseif ('options' === $match[0]) {
                \preg_match_all('([^,;]+)', \strtolower($match[1]), $options);
                $options = \array_shift($options);
                foreach ($options as $option) {
                    $style->setOption($option);
                }
            } else {
                return null;
            }
        }
        return $style;
    }
    private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength) : string
    {
        if ('' === $text) {
            return '';
        }
        if (!$width) {
            return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
        }
        if (!$currentLineLength && '' !== $current) {
            $text = \ltrim($text);
        }
        if ($currentLineLength) {
            $prefix = \substr($text, 0, $i = $width - $currentLineLength) . "\n";
            $text = \substr($text, $i);
        } else {
            $prefix = '';
        }
        \preg_match('~(\\n)$~', $text, $matches);
        $text = $prefix . \preg_replace('~([^\\n]{' . $width . '})\\ *~', "\$1\n", $text);
        $text = \rtrim($text, "\n") . ($matches[1] ?? '');
        if (!$currentLineLength && '' !== $current && "\n" !== \substr($current, -1)) {
            $text = "\n" . $text;
        }
        $lines = \explode("\n", $text);
        foreach ($lines as $line) {
            $currentLineLength += \strlen($line);
            if ($width <= $currentLineLength) {
                $currentLineLength = 0;
            }
        }
        if ($this->isDecorated()) {
            foreach ($lines as $i => $line) {
                $lines[$i] = $this->styleStack->getCurrent()->apply($line);
            }
        }
        return \implode("\n", $lines);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

interface WrappableOutputFormatterInterface extends OutputFormatterInterface
{
    public function formatAndWrap(string $message, int $width);
}
<?php

namespace Cvphar\Symfony\Component\Console\Formatter;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Contracts\Service\ResetInterface;
class OutputFormatterStyleStack implements ResetInterface
{
    private $styles;
    private $emptyStyle;
    public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
    {
        $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
        $this->reset();
    }
    public function reset()
    {
        $this->styles = [];
    }
    public function push(OutputFormatterStyleInterface $style)
    {
        $this->styles[] = $style;
    }
    public function pop(OutputFormatterStyleInterface $style = null)
    {
        if (empty($this->styles)) {
            return $this->emptyStyle;
        }
        if (null === $style) {
            return \array_pop($this->styles);
        }
        foreach (\array_reverse($this->styles, \true) as $index => $stackedStyle) {
            if ($style->apply('') === $stackedStyle->apply('')) {
                $this->styles = \array_slice($this->styles, 0, $index);
                return $stackedStyle;
            }
        }
        throw new InvalidArgumentException('Incorrectly nested style tag found.');
    }
    public function getCurrent()
    {
        if (empty($this->styles)) {
            return $this->emptyStyle;
        }
        return $this->styles[\count($this->styles) - 1];
    }
    public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
    {
        $this->emptyStyle = $emptyStyle;
        return $this;
    }
    public function getEmptyStyle()
    {
        return $this->emptyStyle;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\CommandLoader;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Exception\CommandNotFoundException;
interface CommandLoaderInterface
{
    public function get($name);
    public function has($name);
    public function getNames();
}
<?php

namespace Cvphar\Symfony\Component\Console\CommandLoader;

use Cvphar\Psr\Container\ContainerInterface;
use Cvphar\Symfony\Component\Console\Exception\CommandNotFoundException;
class ContainerCommandLoader implements CommandLoaderInterface
{
    private $container;
    private $commandMap;
    public function __construct(ContainerInterface $container, array $commandMap)
    {
        $this->container = $container;
        $this->commandMap = $commandMap;
    }
    public function get($name)
    {
        if (!$this->has($name)) {
            throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
        }
        return $this->container->get($this->commandMap[$name]);
    }
    public function has($name)
    {
        return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]);
    }
    public function getNames()
    {
        return \array_keys($this->commandMap);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\CommandLoader;

use Cvphar\Symfony\Component\Console\Exception\CommandNotFoundException;
class FactoryCommandLoader implements CommandLoaderInterface
{
    private $factories;
    public function __construct(array $factories)
    {
        $this->factories = $factories;
    }
    public function has($name)
    {
        return isset($this->factories[$name]);
    }
    public function get($name)
    {
        if (!isset($this->factories[$name])) {
            throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
        }
        $factory = $this->factories[$name];
        return $factory();
    }
    public function getNames()
    {
        return \array_keys($this->factories);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Helper\Helper;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
class TextDescriptor extends Descriptor
{
    protected function describeInputArgument(InputArgument $argument, array $options = [])
    {
        if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) {
            $default = \sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($argument->getDefault()));
        } else {
            $default = '';
        }
        $totalWidth = $options['total_width'] ?? Helper::strlen($argument->getName());
        $spacingWidth = $totalWidth - \strlen($argument->getName());
        $this->writeText(\sprintf('  <info>%s</info>  %s%s%s', $argument->getName(), \str_repeat(' ', $spacingWidth), \preg_replace('/\\s*[\\r\\n]\\s*/', "\n" . \str_repeat(' ', $totalWidth + 4), $argument->getDescription()), $default), $options);
    }
    protected function describeInputOption(InputOption $option, array $options = [])
    {
        if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) {
            $default = \sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($option->getDefault()));
        } else {
            $default = '';
        }
        $value = '';
        if ($option->acceptValue()) {
            $value = '=' . \strtoupper($option->getName());
            if ($option->isValueOptional()) {
                $value = '[' . $value . ']';
            }
        }
        $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]);
        $synopsis = \sprintf('%s%s', $option->getShortcut() ? \sprintf('-%s, ', $option->getShortcut()) : '    ', \sprintf('--%s%s', $option->getName(), $value));
        $spacingWidth = $totalWidth - Helper::strlen($synopsis);
        $this->writeText(\sprintf('  <info>%s</info>  %s%s%s%s', $synopsis, \str_repeat(' ', $spacingWidth), \preg_replace('/\\s*[\\r\\n]\\s*/', "\n" . \str_repeat(' ', $totalWidth + 4), $option->getDescription()), $default, $option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''), $options);
    }
    protected function describeInputDefinition(InputDefinition $definition, array $options = [])
    {
        $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions());
        foreach ($definition->getArguments() as $argument) {
            $totalWidth = \max($totalWidth, Helper::strlen($argument->getName()));
        }
        if ($definition->getArguments()) {
            $this->writeText('<comment>Arguments:</comment>', $options);
            $this->writeText("\n");
            foreach ($definition->getArguments() as $argument) {
                $this->describeInputArgument($argument, \array_merge($options, ['total_width' => $totalWidth]));
                $this->writeText("\n");
            }
        }
        if ($definition->getArguments() && $definition->getOptions()) {
            $this->writeText("\n");
        }
        if ($definition->getOptions()) {
            $laterOptions = [];
            $this->writeText('<comment>Options:</comment>', $options);
            foreach ($definition->getOptions() as $option) {
                if (\strlen($option->getShortcut() ?? '') > 1) {
                    $laterOptions[] = $option;
                    continue;
                }
                $this->writeText("\n");
                $this->describeInputOption($option, \array_merge($options, ['total_width' => $totalWidth]));
            }
            foreach ($laterOptions as $option) {
                $this->writeText("\n");
                $this->describeInputOption($option, \array_merge($options, ['total_width' => $totalWidth]));
            }
        }
    }
    protected function describeCommand(Command $command, array $options = [])
    {
        $command->getSynopsis(\true);
        $command->getSynopsis(\false);
        $command->mergeApplicationDefinition(\false);
        if ($description = $command->getDescription()) {
            $this->writeText('<comment>Description:</comment>', $options);
            $this->writeText("\n");
            $this->writeText('  ' . $description);
            $this->writeText("\n\n");
        }
        $this->writeText('<comment>Usage:</comment>', $options);
        foreach (\array_merge([$command->getSynopsis(\true)], $command->getAliases(), $command->getUsages()) as $usage) {
            $this->writeText("\n");
            $this->writeText('  ' . OutputFormatter::escape($usage), $options);
        }
        $this->writeText("\n");
        $definition = $command->getNativeDefinition();
        if ($definition->getOptions() || $definition->getArguments()) {
            $this->writeText("\n");
            $this->describeInputDefinition($definition, $options);
            $this->writeText("\n");
        }
        $help = $command->getProcessedHelp();
        if ($help && $help !== $description) {
            $this->writeText("\n");
            $this->writeText('<comment>Help:</comment>', $options);
            $this->writeText("\n");
            $this->writeText('  ' . \str_replace("\n", "\n  ", $help), $options);
            $this->writeText("\n");
        }
    }
    protected function describeApplication(Application $application, array $options = [])
    {
        $describedNamespace = $options['namespace'] ?? null;
        $description = new ApplicationDescription($application, $describedNamespace);
        if (isset($options['raw_text']) && $options['raw_text']) {
            $width = $this->getColumnWidth($description->getCommands());
            foreach ($description->getCommands() as $command) {
                $this->writeText(\sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options);
                $this->writeText("\n");
            }
        } else {
            if ('' != ($help = $application->getHelp())) {
                $this->writeText("{$help}\n\n", $options);
            }
            $this->writeText("<comment>Usage:</comment>\n", $options);
            $this->writeText("  command [options] [arguments]\n\n", $options);
            $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options);
            $this->writeText("\n");
            $this->writeText("\n");
            $commands = $description->getCommands();
            $namespaces = $description->getNamespaces();
            if ($describedNamespace && $namespaces) {
                $describedNamespaceInfo = \reset($namespaces);
                foreach ($describedNamespaceInfo['commands'] as $name) {
                    $commands[$name] = $description->getCommand($name);
                }
            }
            $width = $this->getColumnWidth(\array_merge(...\array_values(\array_map(function ($namespace) use($commands) {
                return \array_intersect($namespace['commands'], \array_keys($commands));
            }, \array_values($namespaces)))));
            if ($describedNamespace) {
                $this->writeText(\sprintf('<comment>Available commands for the "%s" namespace:</comment>', $describedNamespace), $options);
            } else {
                $this->writeText('<comment>Available commands:</comment>', $options);
            }
            foreach ($namespaces as $namespace) {
                $namespace['commands'] = \array_filter($namespace['commands'], function ($name) use($commands) {
                    return isset($commands[$name]);
                });
                if (!$namespace['commands']) {
                    continue;
                }
                if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
                    $this->writeText("\n");
                    $this->writeText(' <comment>' . $namespace['id'] . '</comment>', $options);
                }
                foreach ($namespace['commands'] as $name) {
                    $this->writeText("\n");
                    $spacingWidth = $width - Helper::strlen($name);
                    $command = $commands[$name];
                    $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : '';
                    $this->writeText(\sprintf('  <info>%s</info>%s%s', $name, \str_repeat(' ', $spacingWidth), $commandAliases . $command->getDescription()), $options);
                }
            }
            $this->writeText("\n");
        }
    }
    private function writeText(string $content, array $options = [])
    {
        $this->write(isset($options['raw_text']) && $options['raw_text'] ? \strip_tags($content) : $content, isset($options['raw_output']) ? !$options['raw_output'] : \true);
    }
    private function getCommandAliasesText(Command $command) : string
    {
        $text = '';
        $aliases = $command->getAliases();
        if ($aliases) {
            $text = '[' . \implode('|', $aliases) . '] ';
        }
        return $text;
    }
    private function formatDefaultValue($default) : string
    {
        if (\INF === $default) {
            return 'INF';
        }
        if (\is_string($default)) {
            $default = OutputFormatter::escape($default);
        } elseif (\is_array($default)) {
            foreach ($default as $key => $value) {
                if (\is_string($value)) {
                    $default[$key] = OutputFormatter::escape($value);
                }
            }
        }
        return \str_replace('\\\\', '\\', \json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
    }
    private function getColumnWidth(array $commands) : int
    {
        $widths = [];
        foreach ($commands as $command) {
            if ($command instanceof Command) {
                $widths[] = Helper::strlen($command->getName());
                foreach ($command->getAliases() as $alias) {
                    $widths[] = Helper::strlen($alias);
                }
            } else {
                $widths[] = Helper::strlen($command);
            }
        }
        return $widths ? \max($widths) + 2 : 0;
    }
    private function calculateTotalWidthForOptions(array $options) : int
    {
        $totalWidth = 0;
        foreach ($options as $option) {
            $nameLength = 1 + \max(Helper::strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName());
            if ($option->acceptValue()) {
                $valueLength = 1 + Helper::strlen($option->getName());
                $valueLength += $option->isValueOptional() ? 2 : 0;
                $nameLength += $valueLength;
            }
            $totalWidth = \max($totalWidth, $nameLength);
        }
        return $totalWidth;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Exception\CommandNotFoundException;
class ApplicationDescription
{
    public const GLOBAL_NAMESPACE = '_global';
    private $application;
    private $namespace;
    private $showHidden;
    private $namespaces;
    private $commands;
    private $aliases;
    public function __construct(Application $application, string $namespace = null, bool $showHidden = \false)
    {
        $this->application = $application;
        $this->namespace = $namespace;
        $this->showHidden = $showHidden;
    }
    public function getNamespaces() : array
    {
        if (null === $this->namespaces) {
            $this->inspectApplication();
        }
        return $this->namespaces;
    }
    public function getCommands() : array
    {
        if (null === $this->commands) {
            $this->inspectApplication();
        }
        return $this->commands;
    }
    public function getCommand(string $name) : Command
    {
        if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
            throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
        }
        return $this->commands[$name] ?? $this->aliases[$name];
    }
    private function inspectApplication()
    {
        $this->commands = [];
        $this->namespaces = [];
        $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null);
        foreach ($this->sortCommands($all) as $namespace => $commands) {
            $names = [];
            foreach ($commands as $name => $command) {
                if (!$command->getName() || !$this->showHidden && $command->isHidden()) {
                    continue;
                }
                if ($command->getName() === $name) {
                    $this->commands[$name] = $command;
                } else {
                    $this->aliases[$name] = $command;
                }
                $names[] = $name;
            }
            $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names];
        }
    }
    private function sortCommands(array $commands) : array
    {
        $namespacedCommands = [];
        $globalCommands = [];
        $sortedCommands = [];
        foreach ($commands as $name => $command) {
            $key = $this->application->extractNamespace($name, 1);
            if (\in_array($key, ['', self::GLOBAL_NAMESPACE], \true)) {
                $globalCommands[$name] = $command;
            } else {
                $namespacedCommands[$key][$name] = $command;
            }
        }
        if ($globalCommands) {
            \ksort($globalCommands);
            $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands;
        }
        if ($namespacedCommands) {
            \ksort($namespacedCommands);
            foreach ($namespacedCommands as $key => $commandsSet) {
                \ksort($commandsSet);
                $sortedCommands[$key] = $commandsSet;
            }
        }
        return $sortedCommands;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
class XmlDescriptor extends Descriptor
{
    public function getInputDefinitionDocument(InputDefinition $definition) : \DOMDocument
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($definitionXML = $dom->createElement('definition'));
        $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments'));
        foreach ($definition->getArguments() as $argument) {
            $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument));
        }
        $definitionXML->appendChild($optionsXML = $dom->createElement('options'));
        foreach ($definition->getOptions() as $option) {
            $this->appendDocument($optionsXML, $this->getInputOptionDocument($option));
        }
        return $dom;
    }
    public function getCommandDocument(Command $command) : \DOMDocument
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($commandXML = $dom->createElement('command'));
        $command->getSynopsis();
        $command->mergeApplicationDefinition(\false);
        $commandXML->setAttribute('id', $command->getName());
        $commandXML->setAttribute('name', $command->getName());
        $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0);
        $commandXML->appendChild($usagesXML = $dom->createElement('usages'));
        foreach (\array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) {
            $usagesXML->appendChild($dom->createElement('usage', $usage));
        }
        $commandXML->appendChild($descriptionXML = $dom->createElement('description'));
        $descriptionXML->appendChild($dom->createTextNode(\str_replace("\n", "\n ", $command->getDescription())));
        $commandXML->appendChild($helpXML = $dom->createElement('help'));
        $helpXML->appendChild($dom->createTextNode(\str_replace("\n", "\n ", $command->getProcessedHelp())));
        $definitionXML = $this->getInputDefinitionDocument($command->getNativeDefinition());
        $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0));
        return $dom;
    }
    public function getApplicationDocument(Application $application, string $namespace = null) : \DOMDocument
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($rootXml = $dom->createElement('symfony'));
        if ('UNKNOWN' !== $application->getName()) {
            $rootXml->setAttribute('name', $application->getName());
            if ('UNKNOWN' !== $application->getVersion()) {
                $rootXml->setAttribute('version', $application->getVersion());
            }
        }
        $rootXml->appendChild($commandsXML = $dom->createElement('commands'));
        $description = new ApplicationDescription($application, $namespace, \true);
        if ($namespace) {
            $commandsXML->setAttribute('namespace', $namespace);
        }
        foreach ($description->getCommands() as $command) {
            $this->appendDocument($commandsXML, $this->getCommandDocument($command));
        }
        if (!$namespace) {
            $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces'));
            foreach ($description->getNamespaces() as $namespaceDescription) {
                $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace'));
                $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']);
                foreach ($namespaceDescription['commands'] as $name) {
                    $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command'));
                    $commandXML->appendChild($dom->createTextNode($name));
                }
            }
        }
        return $dom;
    }
    protected function describeInputArgument(InputArgument $argument, array $options = [])
    {
        $this->writeDocument($this->getInputArgumentDocument($argument));
    }
    protected function describeInputOption(InputOption $option, array $options = [])
    {
        $this->writeDocument($this->getInputOptionDocument($option));
    }
    protected function describeInputDefinition(InputDefinition $definition, array $options = [])
    {
        $this->writeDocument($this->getInputDefinitionDocument($definition));
    }
    protected function describeCommand(Command $command, array $options = [])
    {
        $this->writeDocument($this->getCommandDocument($command));
    }
    protected function describeApplication(Application $application, array $options = [])
    {
        $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null));
    }
    private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
    {
        foreach ($importedParent->childNodes as $childNode) {
            $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, \true));
        }
    }
    private function writeDocument(\DOMDocument $dom)
    {
        $dom->formatOutput = \true;
        $this->write($dom->saveXML());
    }
    private function getInputArgumentDocument(InputArgument $argument) : \DOMDocument
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($objectXML = $dom->createElement('argument'));
        $objectXML->setAttribute('name', $argument->getName());
        $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0);
        $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0);
        $objectXML->appendChild($descriptionXML = $dom->createElement('description'));
        $descriptionXML->appendChild($dom->createTextNode($argument->getDescription()));
        $objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
        $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [\var_export($argument->getDefault(), \true)] : ($argument->getDefault() ? [$argument->getDefault()] : []));
        foreach ($defaults as $default) {
            $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
            $defaultXML->appendChild($dom->createTextNode($default));
        }
        return $dom;
    }
    private function getInputOptionDocument(InputOption $option) : \DOMDocument
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($objectXML = $dom->createElement('option'));
        $objectXML->setAttribute('name', '--' . $option->getName());
        $pos = \strpos($option->getShortcut() ?? '', '|');
        if (\false !== $pos) {
            $objectXML->setAttribute('shortcut', '-' . \substr($option->getShortcut(), 0, $pos));
            $objectXML->setAttribute('shortcuts', '-' . \str_replace('|', '|-', $option->getShortcut()));
        } else {
            $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-' . $option->getShortcut() : '');
        }
        $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0);
        $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0);
        $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0);
        $objectXML->appendChild($descriptionXML = $dom->createElement('description'));
        $descriptionXML->appendChild($dom->createTextNode($option->getDescription()));
        if ($option->acceptValue()) {
            $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [\var_export($option->getDefault(), \true)] : ($option->getDefault() ? [$option->getDefault()] : []));
            $objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
            if (!empty($defaults)) {
                foreach ($defaults as $default) {
                    $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
                    $defaultXML->appendChild($dom->createTextNode($default));
                }
            }
        }
        return $dom;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
interface DescriptorInterface
{
    public function describe(OutputInterface $output, $object, array $options = []);
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
abstract class Descriptor implements DescriptorInterface
{
    protected $output;
    public function describe(OutputInterface $output, $object, array $options = [])
    {
        $this->output = $output;
        switch (\true) {
            case $object instanceof InputArgument:
                $this->describeInputArgument($object, $options);
                break;
            case $object instanceof InputOption:
                $this->describeInputOption($object, $options);
                break;
            case $object instanceof InputDefinition:
                $this->describeInputDefinition($object, $options);
                break;
            case $object instanceof Command:
                $this->describeCommand($object, $options);
                break;
            case $object instanceof Application:
                $this->describeApplication($object, $options);
                break;
            default:
                throw new InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', \get_class($object)));
        }
    }
    protected function write($content, $decorated = \false)
    {
        $this->output->write($content, \false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
    }
    protected abstract function describeInputArgument(InputArgument $argument, array $options = []);
    protected abstract function describeInputOption(InputOption $option, array $options = []);
    protected abstract function describeInputDefinition(InputDefinition $definition, array $options = []);
    protected abstract function describeCommand(Command $command, array $options = []);
    protected abstract function describeApplication(Application $application, array $options = []);
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
class JsonDescriptor extends Descriptor
{
    protected function describeInputArgument(InputArgument $argument, array $options = [])
    {
        $this->writeData($this->getInputArgumentData($argument), $options);
    }
    protected function describeInputOption(InputOption $option, array $options = [])
    {
        $this->writeData($this->getInputOptionData($option), $options);
    }
    protected function describeInputDefinition(InputDefinition $definition, array $options = [])
    {
        $this->writeData($this->getInputDefinitionData($definition), $options);
    }
    protected function describeCommand(Command $command, array $options = [])
    {
        $this->writeData($this->getCommandData($command), $options);
    }
    protected function describeApplication(Application $application, array $options = [])
    {
        $describedNamespace = $options['namespace'] ?? null;
        $description = new ApplicationDescription($application, $describedNamespace, \true);
        $commands = [];
        foreach ($description->getCommands() as $command) {
            $commands[] = $this->getCommandData($command);
        }
        $data = [];
        if ('UNKNOWN' !== $application->getName()) {
            $data['application']['name'] = $application->getName();
            if ('UNKNOWN' !== $application->getVersion()) {
                $data['application']['version'] = $application->getVersion();
            }
        }
        $data['commands'] = $commands;
        if ($describedNamespace) {
            $data['namespace'] = $describedNamespace;
        } else {
            $data['namespaces'] = \array_values($description->getNamespaces());
        }
        $this->writeData($data, $options);
    }
    private function writeData(array $data, array $options)
    {
        $flags = $options['json_encoding'] ?? 0;
        $this->write(\json_encode($data, $flags));
    }
    private function getInputArgumentData(InputArgument $argument) : array
    {
        return ['name' => $argument->getName(), 'is_required' => $argument->isRequired(), 'is_array' => $argument->isArray(), 'description' => \preg_replace('/\\s*[\\r\\n]\\s*/', ' ', $argument->getDescription()), 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault()];
    }
    private function getInputOptionData(InputOption $option) : array
    {
        return ['name' => '--' . $option->getName(), 'shortcut' => $option->getShortcut() ? '-' . \str_replace('|', '|-', $option->getShortcut()) : '', 'accept_value' => $option->acceptValue(), 'is_value_required' => $option->isValueRequired(), 'is_multiple' => $option->isArray(), 'description' => \preg_replace('/\\s*[\\r\\n]\\s*/', ' ', $option->getDescription()), 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault()];
    }
    private function getInputDefinitionData(InputDefinition $definition) : array
    {
        $inputArguments = [];
        foreach ($definition->getArguments() as $name => $argument) {
            $inputArguments[$name] = $this->getInputArgumentData($argument);
        }
        $inputOptions = [];
        foreach ($definition->getOptions() as $name => $option) {
            $inputOptions[$name] = $this->getInputOptionData($option);
        }
        return ['arguments' => $inputArguments, 'options' => $inputOptions];
    }
    private function getCommandData(Command $command) : array
    {
        $command->getSynopsis();
        $command->mergeApplicationDefinition(\false);
        return ['name' => $command->getName(), 'usage' => \array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), 'description' => $command->getDescription(), 'help' => $command->getProcessedHelp(), 'definition' => $this->getInputDefinitionData($command->getNativeDefinition()), 'hidden' => $command->isHidden()];
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Descriptor;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Helper\Helper;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class MarkdownDescriptor extends Descriptor
{
    public function describe(OutputInterface $output, $object, array $options = [])
    {
        $decorated = $output->isDecorated();
        $output->setDecorated(\false);
        parent::describe($output, $object, $options);
        $output->setDecorated($decorated);
    }
    protected function write($content, $decorated = \true)
    {
        parent::write($content, $decorated);
    }
    protected function describeInputArgument(InputArgument $argument, array $options = [])
    {
        $this->write('#### `' . ($argument->getName() ?: '<none>') . "`\n\n" . ($argument->getDescription() ? \preg_replace('/\\s*[\\r\\n]\\s*/', "\n", $argument->getDescription()) . "\n\n" : '') . '* Is required: ' . ($argument->isRequired() ? 'yes' : 'no') . "\n" . '* Is array: ' . ($argument->isArray() ? 'yes' : 'no') . "\n" . '* Default: `' . \str_replace("\n", '', \var_export($argument->getDefault(), \true)) . '`');
    }
    protected function describeInputOption(InputOption $option, array $options = [])
    {
        $name = '--' . $option->getName();
        if ($option->getShortcut()) {
            $name .= '|-' . \str_replace('|', '|-', $option->getShortcut()) . '';
        }
        $this->write('#### `' . $name . '`' . "\n\n" . ($option->getDescription() ? \preg_replace('/\\s*[\\r\\n]\\s*/', "\n", $option->getDescription()) . "\n\n" : '') . '* Accept value: ' . ($option->acceptValue() ? 'yes' : 'no') . "\n" . '* Is value required: ' . ($option->isValueRequired() ? 'yes' : 'no') . "\n" . '* Is multiple: ' . ($option->isArray() ? 'yes' : 'no') . "\n" . '* Default: `' . \str_replace("\n", '', \var_export($option->getDefault(), \true)) . '`');
    }
    protected function describeInputDefinition(InputDefinition $definition, array $options = [])
    {
        if ($showArguments = \count($definition->getArguments()) > 0) {
            $this->write('### Arguments');
            foreach ($definition->getArguments() as $argument) {
                $this->write("\n\n");
                $this->write($this->describeInputArgument($argument));
            }
        }
        if (\count($definition->getOptions()) > 0) {
            if ($showArguments) {
                $this->write("\n\n");
            }
            $this->write('### Options');
            foreach ($definition->getOptions() as $option) {
                $this->write("\n\n");
                $this->write($this->describeInputOption($option));
            }
        }
    }
    protected function describeCommand(Command $command, array $options = [])
    {
        $command->getSynopsis();
        $command->mergeApplicationDefinition(\false);
        $this->write('`' . $command->getName() . "`\n" . \str_repeat('-', Helper::strlen($command->getName()) + 2) . "\n\n" . ($command->getDescription() ? $command->getDescription() . "\n\n" : '') . '### Usage' . "\n\n" . \array_reduce(\array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
            return $carry . '* `' . $usage . '`' . "\n";
        }));
        if ($help = $command->getProcessedHelp()) {
            $this->write("\n");
            $this->write($help);
        }
        if ($command->getNativeDefinition()) {
            $this->write("\n\n");
            $this->describeInputDefinition($command->getNativeDefinition());
        }
    }
    protected function describeApplication(Application $application, array $options = [])
    {
        $describedNamespace = $options['namespace'] ?? null;
        $description = new ApplicationDescription($application, $describedNamespace);
        $title = $this->getApplicationTitle($application);
        $this->write($title . "\n" . \str_repeat('=', Helper::strlen($title)));
        foreach ($description->getNamespaces() as $namespace) {
            if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
                $this->write("\n\n");
                $this->write('**' . $namespace['id'] . ':**');
            }
            $this->write("\n\n");
            $this->write(\implode("\n", \array_map(function ($commandName) use($description) {
                return \sprintf('* [`%s`](#%s)', $commandName, \str_replace(':', '', $description->getCommand($commandName)->getName()));
            }, $namespace['commands'])));
        }
        foreach ($description->getCommands() as $command) {
            $this->write("\n\n");
            $this->write($this->describeCommand($command));
        }
    }
    private function getApplicationTitle(Application $application) : string
    {
        if ('UNKNOWN' !== $application->getName()) {
            if ('UNKNOWN' !== $application->getVersion()) {
                return \sprintf('%s %s', $application->getName(), $application->getVersion());
            }
            return $application->getName();
        }
        return 'Console Tool';
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Tester;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\ArrayInput;
class CommandTester
{
    use TesterTrait;
    private $command;
    private $input;
    private $statusCode;
    public function __construct(Command $command)
    {
        $this->command = $command;
    }
    public function execute(array $input, array $options = [])
    {
        if (!isset($input['command']) && null !== ($application = $this->command->getApplication()) && $application->getDefinition()->hasArgument('command')) {
            $input = \array_merge(['command' => $this->command->getName()], $input);
        }
        $this->input = new ArrayInput($input);
        $this->input->setStream(self::createStream($this->inputs));
        if (isset($options['interactive'])) {
            $this->input->setInteractive($options['interactive']);
        }
        if (!isset($options['decorated'])) {
            $options['decorated'] = \false;
        }
        $this->initOutput($options);
        return $this->statusCode = $this->command->run($this->input, $this->output);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Tester;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Output\StreamOutput;
trait TesterTrait
{
    private $output;
    private $inputs = [];
    private $captureStreamsIndependently = \false;
    public function getDisplay($normalize = \false)
    {
        if (null === $this->output) {
            throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?');
        }
        \rewind($this->output->getStream());
        $display = \stream_get_contents($this->output->getStream());
        if ($normalize) {
            $display = \str_replace(\PHP_EOL, "\n", $display);
        }
        return $display;
    }
    public function getErrorOutput($normalize = \false)
    {
        if (!$this->captureStreamsIndependently) {
            throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
        }
        \rewind($this->output->getErrorOutput()->getStream());
        $display = \stream_get_contents($this->output->getErrorOutput()->getStream());
        if ($normalize) {
            $display = \str_replace(\PHP_EOL, "\n", $display);
        }
        return $display;
    }
    public function getInput()
    {
        return $this->input;
    }
    public function getOutput()
    {
        return $this->output;
    }
    public function getStatusCode()
    {
        return $this->statusCode;
    }
    public function setInputs(array $inputs)
    {
        $this->inputs = $inputs;
        return $this;
    }
    private function initOutput(array $options)
    {
        $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
        if (!$this->captureStreamsIndependently) {
            $this->output = new StreamOutput(\fopen('php://memory', 'w', \false));
            if (isset($options['decorated'])) {
                $this->output->setDecorated($options['decorated']);
            }
            if (isset($options['verbosity'])) {
                $this->output->setVerbosity($options['verbosity']);
            }
        } else {
            $this->output = new ConsoleOutput($options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, $options['decorated'] ?? null);
            $errorOutput = new StreamOutput(\fopen('php://memory', 'w', \false));
            $errorOutput->setFormatter($this->output->getFormatter());
            $errorOutput->setVerbosity($this->output->getVerbosity());
            $errorOutput->setDecorated($this->output->isDecorated());
            $reflectedOutput = new \ReflectionObject($this->output);
            $strErrProperty = $reflectedOutput->getProperty('stderr');
            $strErrProperty->setAccessible(\true);
            $strErrProperty->setValue($this->output, $errorOutput);
            $reflectedParent = $reflectedOutput->getParentClass();
            $streamProperty = $reflectedParent->getProperty('stream');
            $streamProperty->setAccessible(\true);
            $streamProperty->setValue($this->output, \fopen('php://memory', 'w', \false));
        }
    }
    private static function createStream(array $inputs)
    {
        $stream = \fopen('php://memory', 'r+', \false);
        foreach ($inputs as $input) {
            \fwrite($stream, $input . \PHP_EOL);
        }
        \rewind($stream);
        return $stream;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Tester;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Input\ArrayInput;
class ApplicationTester
{
    use TesterTrait;
    private $application;
    private $input;
    private $statusCode;
    public function __construct(Application $application)
    {
        $this->application = $application;
    }
    public function run(array $input, $options = [])
    {
        $this->input = new ArrayInput($input);
        if (isset($options['interactive'])) {
            $this->input->setInteractive($options['interactive']);
        }
        if ($this->inputs) {
            $this->input->setStream(self::createStream($this->inputs));
        }
        $this->initOutput($options);
        return $this->statusCode = $this->application->run($this->input, $this->output);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Command;

use Cvphar\Symfony\Component\Console\Exception\LogicException;
use Cvphar\Symfony\Component\Lock\Lock;
use Cvphar\Symfony\Component\Lock\LockFactory;
use Cvphar\Symfony\Component\Lock\Store\FlockStore;
use Cvphar\Symfony\Component\Lock\Store\SemaphoreStore;
trait LockableTrait
{
    private $lock;
    private function lock(string $name = null, bool $blocking = \false) : bool
    {
        if (!\class_exists(SemaphoreStore::class)) {
            throw new LogicException('To enable the locking feature you must install the symfony/lock component.');
        }
        if (null !== $this->lock) {
            throw new LogicException('A lock is already in place.');
        }
        if (SemaphoreStore::isSupported()) {
            $store = new SemaphoreStore();
        } else {
            $store = new FlockStore();
        }
        $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName());
        if (!$this->lock->acquire($blocking)) {
            $this->lock = null;
            return \false;
        }
        return \true;
    }
    private function release()
    {
        if ($this->lock) {
            $this->lock->release();
            $this->lock = null;
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Command;

use Cvphar\Symfony\Component\Console\Helper\DescriptorHelper;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class HelpCommand extends Command
{
    private $command;
    protected function configure()
    {
        $this->ignoreValidationErrors();
        $this->setName('help')->setDefinition([new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help')])->setDescription('Display help for a command')->setHelp(<<<'EOF'
The <info>%command.name%</info> command displays help for a given command:

  <info>php %command.full_name% list</info>

You can also output the help in other formats by using the <comment>--format</comment> option:

  <info>php %command.full_name% --format=xml list</info>

To display the list of available commands, please use the <info>list</info> command.
EOF
);
    }
    public function setCommand(Command $command)
    {
        $this->command = $command;
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->command) {
            $this->command = $this->getApplication()->find($input->getArgument('command_name'));
        }
        $helper = new DescriptorHelper();
        $helper->describe($output, $this->command, ['format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw')]);
        $this->command = null;
        return 0;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Command;

use Cvphar\Symfony\Component\Console\Helper\DescriptorHelper;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ListCommand extends Command
{
    protected function configure()
    {
        $this->setName('list')->setDefinition($this->createDefinition())->setDescription('List commands')->setHelp(<<<'EOF'
The <info>%command.name%</info> command lists all commands:

  <info>php %command.full_name%</info>

You can also display the commands for a specific namespace:

  <info>php %command.full_name% test</info>

You can also output the information in other formats by using the <comment>--format</comment> option:

  <info>php %command.full_name% --format=xml</info>

It's also possible to get raw list of commands (useful for embedding command runner):

  <info>php %command.full_name% --raw</info>
EOF
);
    }
    public function getNativeDefinition()
    {
        return $this->createDefinition();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = new DescriptorHelper();
        $helper->describe($output, $this->getApplication(), ['format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace')]);
        return 0;
    }
    private function createDefinition() : InputDefinition
    {
        return new InputDefinition([new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt')]);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Command;

use Cvphar\Symfony\Component\Console\Application;
use Cvphar\Symfony\Component\Console\Exception\ExceptionInterface;
use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
use Cvphar\Symfony\Component\Console\Helper\HelperSet;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputDefinition;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Command
{
    protected static $defaultName;
    private $application;
    private $name;
    private $processTitle;
    private $aliases = [];
    private $definition;
    private $hidden = \false;
    private $help = '';
    private $description = '';
    private $ignoreValidationErrors = \false;
    private $applicationDefinitionMerged = \false;
    private $applicationDefinitionMergedWithArgs = \false;
    private $code;
    private $synopsis = [];
    private $usages = [];
    private $helperSet;
    public static function getDefaultName()
    {
        $class = static::class;
        $r = new \ReflectionProperty($class, 'defaultName');
        return $class === $r->class ? static::$defaultName : null;
    }
    public function __construct(string $name = null)
    {
        $this->definition = new InputDefinition();
        if (null !== $name || null !== ($name = static::getDefaultName())) {
            $this->setName($name);
        }
        $this->configure();
    }
    public function ignoreValidationErrors()
    {
        $this->ignoreValidationErrors = \true;
    }
    public function setApplication(Application $application = null)
    {
        $this->application = $application;
        if ($application) {
            $this->setHelperSet($application->getHelperSet());
        } else {
            $this->helperSet = null;
        }
    }
    public function setHelperSet(HelperSet $helperSet)
    {
        $this->helperSet = $helperSet;
    }
    public function getHelperSet()
    {
        return $this->helperSet;
    }
    public function getApplication()
    {
        return $this->application;
    }
    public function isEnabled()
    {
        return \true;
    }
    protected function configure()
    {
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        throw new LogicException('You must override the execute() method in the concrete command class.');
    }
    protected function interact(InputInterface $input, OutputInterface $output)
    {
    }
    protected function initialize(InputInterface $input, OutputInterface $output)
    {
    }
    public function run(InputInterface $input, OutputInterface $output)
    {
        $this->getSynopsis(\true);
        $this->getSynopsis(\false);
        $this->mergeApplicationDefinition();
        try {
            $input->bind($this->definition);
        } catch (ExceptionInterface $e) {
            if (!$this->ignoreValidationErrors) {
                throw $e;
            }
        }
        $this->initialize($input, $output);
        if (null !== $this->processTitle) {
            if (\function_exists('cli_set_process_title')) {
                if (!@\cli_set_process_title($this->processTitle)) {
                    if ('Darwin' === \PHP_OS) {
                        $output->writeln('<comment>Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE);
                    } else {
                        \cli_set_process_title($this->processTitle);
                    }
                }
            } elseif (\function_exists('Cvphar\\setproctitle')) {
                setproctitle($this->processTitle);
            } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
                $output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
            }
        }
        if ($input->isInteractive()) {
            $this->interact($input, $output);
        }
        if ($input->hasArgument('command') && null === $input->getArgument('command')) {
            $input->setArgument('command', $this->getName());
        }
        $input->validate();
        if ($this->code) {
            $statusCode = ($this->code)($input, $output);
        } else {
            $statusCode = $this->execute($input, $output);
            if (!\is_int($statusCode)) {
                @\trigger_error(\sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', static::class, \gettype($statusCode)), \E_USER_DEPRECATED);
            }
        }
        return \is_numeric($statusCode) ? (int) $statusCode : 0;
    }
    public function setCode(callable $code)
    {
        if ($code instanceof \Closure) {
            $r = new \ReflectionFunction($code);
            if (null === $r->getClosureThis()) {
                \set_error_handler(static function () {
                });
                try {
                    if ($c = \Closure::bind($code, $this)) {
                        $code = $c;
                    }
                } finally {
                    \restore_error_handler();
                }
            }
        }
        $this->code = $code;
        return $this;
    }
    public function mergeApplicationDefinition($mergeArgs = \true)
    {
        if (null === $this->application || \true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs)) {
            return;
        }
        $this->definition->addOptions($this->application->getDefinition()->getOptions());
        $this->applicationDefinitionMerged = \true;
        if ($mergeArgs) {
            $currentArguments = $this->definition->getArguments();
            $this->definition->setArguments($this->application->getDefinition()->getArguments());
            $this->definition->addArguments($currentArguments);
            $this->applicationDefinitionMergedWithArgs = \true;
        }
    }
    public function setDefinition($definition)
    {
        if ($definition instanceof InputDefinition) {
            $this->definition = $definition;
        } else {
            $this->definition->setDefinition($definition);
        }
        $this->applicationDefinitionMerged = \false;
        return $this;
    }
    public function getDefinition()
    {
        if (null === $this->definition) {
            throw new LogicException(\sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class));
        }
        return $this->definition;
    }
    public function getNativeDefinition()
    {
        return $this->getDefinition();
    }
    public function addArgument($name, $mode = null, $description = '', $default = null)
    {
        $this->definition->addArgument(new InputArgument($name, $mode, $description, $default));
        return $this;
    }
    public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
    {
        $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
        return $this;
    }
    public function setName($name)
    {
        $this->validateName($name);
        $this->name = $name;
        return $this;
    }
    public function setProcessTitle($title)
    {
        $this->processTitle = $title;
        return $this;
    }
    public function getName()
    {
        return $this->name;
    }
    public function setHidden($hidden)
    {
        $this->hidden = (bool) $hidden;
        return $this;
    }
    public function isHidden()
    {
        return $this->hidden;
    }
    public function setDescription($description)
    {
        $this->description = $description;
        return $this;
    }
    public function getDescription()
    {
        return $this->description;
    }
    public function setHelp($help)
    {
        $this->help = $help;
        return $this;
    }
    public function getHelp()
    {
        return $this->help;
    }
    public function getProcessedHelp()
    {
        $name = $this->name;
        $isSingleCommand = $this->application && $this->application->isSingleCommand();
        $placeholders = ['%command.name%', '%command.full_name%'];
        $replacements = [$name, $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . ' ' . $name];
        return \str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
    }
    public function setAliases($aliases)
    {
        if (!\is_array($aliases) && !$aliases instanceof \Traversable) {
            throw new InvalidArgumentException('$aliases must be an array or an instance of \\Traversable.');
        }
        foreach ($aliases as $alias) {
            $this->validateName($alias);
        }
        $this->aliases = $aliases;
        return $this;
    }
    public function getAliases()
    {
        return $this->aliases;
    }
    public function getSynopsis($short = \false)
    {
        $key = $short ? 'short' : 'long';
        if (!isset($this->synopsis[$key])) {
            $this->synopsis[$key] = \trim(\sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
        }
        return $this->synopsis[$key];
    }
    public function addUsage($usage)
    {
        if (!\str_starts_with($usage, $this->name)) {
            $usage = \sprintf('%s %s', $this->name, $usage);
        }
        $this->usages[] = $usage;
        return $this;
    }
    public function getUsages()
    {
        return $this->usages;
    }
    public function getHelper($name)
    {
        if (null === $this->helperSet) {
            throw new LogicException(\sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name));
        }
        return $this->helperSet->get($name);
    }
    private function validateName(string $name)
    {
        if (!\preg_match('/^[^\\:]++(\\:[^\\:]++)*$/', $name)) {
            throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name));
        }
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
class TableStyle
{
    private $paddingChar = ' ';
    private $horizontalOutsideBorderChar = '-';
    private $horizontalInsideBorderChar = '-';
    private $verticalOutsideBorderChar = '|';
    private $verticalInsideBorderChar = '|';
    private $crossingChar = '+';
    private $crossingTopRightChar = '+';
    private $crossingTopMidChar = '+';
    private $crossingTopLeftChar = '+';
    private $crossingMidRightChar = '+';
    private $crossingBottomRightChar = '+';
    private $crossingBottomMidChar = '+';
    private $crossingBottomLeftChar = '+';
    private $crossingMidLeftChar = '+';
    private $crossingTopLeftBottomChar = '+';
    private $crossingTopMidBottomChar = '+';
    private $crossingTopRightBottomChar = '+';
    private $headerTitleFormat = '<fg=black;bg=white;options=bold> %s </>';
    private $footerTitleFormat = '<fg=black;bg=white;options=bold> %s </>';
    private $cellHeaderFormat = '<info>%s</info>';
    private $cellRowFormat = '%s';
    private $cellRowContentFormat = ' %s ';
    private $borderFormat = '%s';
    private $padType = \STR_PAD_RIGHT;
    public function setPaddingChar($paddingChar)
    {
        if (!$paddingChar) {
            throw new LogicException('The padding char must not be empty.');
        }
        $this->paddingChar = $paddingChar;
        return $this;
    }
    public function getPaddingChar()
    {
        return $this->paddingChar;
    }
    public function setHorizontalBorderChars(string $outside, string $inside = null) : self
    {
        $this->horizontalOutsideBorderChar = $outside;
        $this->horizontalInsideBorderChar = $inside ?? $outside;
        return $this;
    }
    public function setHorizontalBorderChar($horizontalBorderChar)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
        return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar);
    }
    public function getHorizontalBorderChar()
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
        return $this->horizontalOutsideBorderChar;
    }
    public function setVerticalBorderChars(string $outside, string $inside = null) : self
    {
        $this->verticalOutsideBorderChar = $outside;
        $this->verticalInsideBorderChar = $inside ?? $outside;
        return $this;
    }
    public function setVerticalBorderChar($verticalBorderChar)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
        return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar);
    }
    public function getVerticalBorderChar()
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
        return $this->verticalOutsideBorderChar;
    }
    public function getBorderChars() : array
    {
        return [$this->horizontalOutsideBorderChar, $this->verticalOutsideBorderChar, $this->horizontalInsideBorderChar, $this->verticalInsideBorderChar];
    }
    public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null) : self
    {
        $this->crossingChar = $cross;
        $this->crossingTopLeftChar = $topLeft;
        $this->crossingTopMidChar = $topMid;
        $this->crossingTopRightChar = $topRight;
        $this->crossingMidRightChar = $midRight;
        $this->crossingBottomRightChar = $bottomRight;
        $this->crossingBottomMidChar = $bottomMid;
        $this->crossingBottomLeftChar = $bottomLeft;
        $this->crossingMidLeftChar = $midLeft;
        $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft;
        $this->crossingTopMidBottomChar = $topMidBottom ?? $cross;
        $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight;
        return $this;
    }
    public function setDefaultCrossingChar(string $char) : self
    {
        return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
    }
    public function setCrossingChar($crossingChar)
    {
        @\trigger_error(\sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), \E_USER_DEPRECATED);
        return $this->setDefaultCrossingChar($crossingChar);
    }
    public function getCrossingChar()
    {
        return $this->crossingChar;
    }
    public function getCrossingChars() : array
    {
        return [$this->crossingChar, $this->crossingTopLeftChar, $this->crossingTopMidChar, $this->crossingTopRightChar, $this->crossingMidRightChar, $this->crossingBottomRightChar, $this->crossingBottomMidChar, $this->crossingBottomLeftChar, $this->crossingMidLeftChar, $this->crossingTopLeftBottomChar, $this->crossingTopMidBottomChar, $this->crossingTopRightBottomChar];
    }
    public function setCellHeaderFormat($cellHeaderFormat)
    {
        $this->cellHeaderFormat = $cellHeaderFormat;
        return $this;
    }
    public function getCellHeaderFormat()
    {
        return $this->cellHeaderFormat;
    }
    public function setCellRowFormat($cellRowFormat)
    {
        $this->cellRowFormat = $cellRowFormat;
        return $this;
    }
    public function getCellRowFormat()
    {
        return $this->cellRowFormat;
    }
    public function setCellRowContentFormat($cellRowContentFormat)
    {
        $this->cellRowContentFormat = $cellRowContentFormat;
        return $this;
    }
    public function getCellRowContentFormat()
    {
        return $this->cellRowContentFormat;
    }
    public function setBorderFormat($borderFormat)
    {
        $this->borderFormat = $borderFormat;
        return $this;
    }
    public function getBorderFormat()
    {
        return $this->borderFormat;
    }
    public function setPadType($padType)
    {
        if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], \true)) {
            throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
        }
        $this->padType = $padType;
        return $this;
    }
    public function getPadType()
    {
        return $this->padType;
    }
    public function getHeaderTitleFormat() : string
    {
        return $this->headerTitleFormat;
    }
    public function setHeaderTitleFormat(string $format) : self
    {
        $this->headerTitleFormat = $format;
        return $this;
    }
    public function getFooterTitleFormat() : string
    {
        return $this->footerTitleFormat;
    }
    public function setFooterTitleFormat(string $format) : self
    {
        $this->footerTitleFormat = $format;
        return $this;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

class TableRows implements \IteratorAggregate
{
    private $generator;
    public function __construct(callable $generator)
    {
        $this->generator = $generator;
    }
    public function getIterator() : \Traversable
    {
        $g = $this->generator;
        return $g();
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Question\ChoiceQuestion;
use Cvphar\Symfony\Component\Console\Question\ConfirmationQuestion;
use Cvphar\Symfony\Component\Console\Question\Question;
use Cvphar\Symfony\Component\Console\Style\SymfonyStyle;
class SymfonyQuestionHelper extends QuestionHelper
{
    protected function writePrompt(OutputInterface $output, Question $question)
    {
        $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());
        $default = $question->getDefault();
        switch (\true) {
            case null === $default:
                $text = \sprintf(' <info>%s</info>:', $text);
                break;
            case $question instanceof ConfirmationQuestion:
                $text = \sprintf(' <info>%s (yes/no)</info> [<comment>%s</comment>]:', $text, $default ? 'yes' : 'no');
                break;
            case $question instanceof ChoiceQuestion && $question->isMultiselect():
                $choices = $question->getChoices();
                $default = \explode(',', $default);
                foreach ($default as $key => $value) {
                    $default[$key] = $choices[\trim($value)];
                }
                $text = \sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape(\implode(', ', $default)));
                break;
            case $question instanceof ChoiceQuestion:
                $choices = $question->getChoices();
                $text = \sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($choices[$default] ?? $default));
                break;
            default:
                $text = \sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($default));
        }
        $output->writeln($text);
        $prompt = ' > ';
        if ($question instanceof ChoiceQuestion) {
            $output->writeln($this->formatChoiceQuestionChoices($question, 'comment'));
            $prompt = $question->getPrompt();
        }
        $output->write($prompt);
    }
    protected function writeError(OutputInterface $output, \Exception $error)
    {
        if ($output instanceof SymfonyStyle) {
            $output->newLine();
            $output->error($error->getMessage());
            return;
        }
        parent::writeError($output, $error);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

interface HelperInterface
{
    public function setHelperSet(HelperSet $helperSet = null);
    public function getHelperSet();
    public function getName();
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class TableCell
{
    private $value;
    private $options = ['rowspan' => 1, 'colspan' => 1];
    public function __construct(string $value = '', array $options = [])
    {
        $this->value = $value;
        if ($diff = \array_diff(\array_keys($options), \array_keys($this->options))) {
            throw new InvalidArgumentException(\sprintf('The TableCell does not support the following options: \'%s\'.', \implode('\', \'', $diff)));
        }
        $this->options = \array_merge($this->options, $options);
    }
    public function __toString()
    {
        return $this->value;
    }
    public function getColspan()
    {
        return (int) $this->options['colspan'];
    }
    public function getRowspan()
    {
        return (int) $this->options['rowspan'];
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Process\Exception\ProcessFailedException;
use Cvphar\Symfony\Component\Process\Process;
class ProcessHelper extends Helper
{
    public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
    {
        if (!\class_exists(Process::class)) {
            throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
        }
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }
        $formatter = $this->getHelperSet()->get('debug_formatter');
        if ($cmd instanceof Process) {
            $cmd = [$cmd];
        }
        if (!\is_array($cmd)) {
            @\trigger_error(\sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), \E_USER_DEPRECATED);
            $cmd = [\method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)];
        }
        if (\is_string($cmd[0] ?? null)) {
            $process = new Process($cmd);
            $cmd = [];
        } elseif (($cmd[0] ?? null) instanceof Process) {
            $process = $cmd[0];
            unset($cmd[0]);
        } else {
            throw new \InvalidArgumentException(\sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__));
        }
        if ($verbosity <= $output->getVerbosity()) {
            $output->write($formatter->start(\spl_object_hash($process), $this->escapeString($process->getCommandLine())));
        }
        if ($output->isDebug()) {
            $callback = $this->wrapCallback($output, $process, $callback);
        }
        $process->run($callback, $cmd);
        if ($verbosity <= $output->getVerbosity()) {
            $message = $process->isSuccessful() ? 'Command ran successfully' : \sprintf('%s Command did not run successfully', $process->getExitCode());
            $output->write($formatter->stop(\spl_object_hash($process), $message, $process->isSuccessful()));
        }
        if (!$process->isSuccessful() && null !== $error) {
            $output->writeln(\sprintf('<error>%s</error>', $this->escapeString($error)));
        }
        return $process;
    }
    public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null)
    {
        $process = $this->run($output, $cmd, $error, $callback);
        if (!$process->isSuccessful()) {
            throw new ProcessFailedException($process);
        }
        return $process;
    }
    public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
    {
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }
        $formatter = $this->getHelperSet()->get('debug_formatter');
        return function ($type, $buffer) use($output, $process, $callback, $formatter) {
            $output->write($formatter->progress(\spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type));
            if (null !== $callback) {
                $callback($type, $buffer);
            }
        };
    }
    private function escapeString(string $str) : string
    {
        return \str_replace('<', '\\<', $str);
    }
    public function getName()
    {
        return 'process';
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

class TableSeparator extends TableCell
{
    public function __construct(array $options = [])
    {
        parent::__construct('', $options);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
class FormatterHelper extends Helper
{
    public function formatSection($section, $message, $style = 'info')
    {
        return \sprintf('<%s>[%s]</%s> %s', $style, $section, $style, $message);
    }
    public function formatBlock($messages, $style, $large = \false)
    {
        if (!\is_array($messages)) {
            $messages = [$messages];
        }
        $len = 0;
        $lines = [];
        foreach ($messages as $message) {
            $message = OutputFormatter::escape($message);
            $lines[] = \sprintf($large ? '  %s  ' : ' %s ', $message);
            $len = \max(self::strlen($message) + ($large ? 4 : 2), $len);
        }
        $messages = $large ? [\str_repeat(' ', $len)] : [];
        for ($i = 0; isset($lines[$i]); ++$i) {
            $messages[] = $lines[$i] . \str_repeat(' ', $len - self::strlen($lines[$i]));
        }
        if ($large) {
            $messages[] = \str_repeat(' ', $len);
        }
        for ($i = 0; isset($messages[$i]); ++$i) {
            $messages[$i] = \sprintf('<%s>%s</%s>', $style, $messages[$i], $style);
        }
        return \implode("\n", $messages);
    }
    public function truncate($message, $length, $suffix = '...')
    {
        $computedLength = $length - self::strlen($suffix);
        if ($computedLength > self::strlen($message)) {
            return $message;
        }
        return self::substr($message, 0, $length) . $suffix;
    }
    public function getName()
    {
        return 'formatter';
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\LogicException;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleSectionOutput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Terminal;
final class ProgressBar
{
    private $barWidth = 28;
    private $barChar;
    private $emptyBarChar = '-';
    private $progressChar = '>';
    private $format;
    private $internalFormat;
    private $redrawFreq = 1;
    private $writeCount;
    private $lastWriteTime;
    private $minSecondsBetweenRedraws = 0;
    private $maxSecondsBetweenRedraws = 1;
    private $output;
    private $step = 0;
    private $max;
    private $startTime;
    private $stepWidth;
    private $percent = 0.0;
    private $formatLineCount;
    private $messages = [];
    private $overwrite = \true;
    private $terminal;
    private $previousMessage;
    private static $formatters;
    private static $formats;
    public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 0.1)
    {
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }
        $this->output = $output;
        $this->setMaxSteps($max);
        $this->terminal = new Terminal();
        if (0 < $minSecondsBetweenRedraws) {
            $this->redrawFreq = null;
            $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws;
        }
        if (!$this->output->isDecorated()) {
            $this->overwrite = \false;
            $this->redrawFreq = null;
        }
        $this->startTime = \time();
    }
    public static function setPlaceholderFormatterDefinition(string $name, callable $callable) : void
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }
        self::$formatters[$name] = $callable;
    }
    public static function getPlaceholderFormatterDefinition(string $name) : ?callable
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }
        return self::$formatters[$name] ?? null;
    }
    public static function setFormatDefinition(string $name, string $format) : void
    {
        if (!self::$formats) {
            self::$formats = self::initFormats();
        }
        self::$formats[$name] = $format;
    }
    public static function getFormatDefinition(string $name) : ?string
    {
        if (!self::$formats) {
            self::$formats = self::initFormats();
        }
        return self::$formats[$name] ?? null;
    }
    public function setMessage(string $message, string $name = 'message')
    {
        $this->messages[$name] = $message;
    }
    public function getMessage(string $name = 'message')
    {
        return $this->messages[$name];
    }
    public function getStartTime() : int
    {
        return $this->startTime;
    }
    public function getMaxSteps() : int
    {
        return $this->max;
    }
    public function getProgress() : int
    {
        return $this->step;
    }
    private function getStepWidth() : int
    {
        return $this->stepWidth;
    }
    public function getProgressPercent() : float
    {
        return $this->percent;
    }
    public function getBarOffset() : int
    {
        return \floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (\min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth);
    }
    public function setBarWidth(int $size)
    {
        $this->barWidth = \max(1, $size);
    }
    public function getBarWidth() : int
    {
        return $this->barWidth;
    }
    public function setBarCharacter(string $char)
    {
        $this->barChar = $char;
    }
    public function getBarCharacter() : string
    {
        if (null === $this->barChar) {
            return $this->max ? '=' : $this->emptyBarChar;
        }
        return $this->barChar;
    }
    public function setEmptyBarCharacter(string $char)
    {
        $this->emptyBarChar = $char;
    }
    public function getEmptyBarCharacter() : string
    {
        return $this->emptyBarChar;
    }
    public function setProgressCharacter(string $char)
    {
        $this->progressChar = $char;
    }
    public function getProgressCharacter() : string
    {
        return $this->progressChar;
    }
    public function setFormat(string $format)
    {
        $this->format = null;
        $this->internalFormat = $format;
    }
    public function setRedrawFrequency(?int $freq)
    {
        $this->redrawFreq = null !== $freq ? \max(1, $freq) : null;
    }
    public function minSecondsBetweenRedraws(float $seconds) : void
    {
        $this->minSecondsBetweenRedraws = $seconds;
    }
    public function maxSecondsBetweenRedraws(float $seconds) : void
    {
        $this->maxSecondsBetweenRedraws = $seconds;
    }
    public function iterate(iterable $iterable, int $max = null) : iterable
    {
        $this->start($max ?? (\is_countable($iterable) ? \count($iterable) : 0));
        foreach ($iterable as $key => $value) {
            (yield $key => $value);
            $this->advance();
        }
        $this->finish();
    }
    public function start(int $max = null)
    {
        $this->startTime = \time();
        $this->step = 0;
        $this->percent = 0.0;
        if (null !== $max) {
            $this->setMaxSteps($max);
        }
        $this->display();
    }
    public function advance(int $step = 1)
    {
        $this->setProgress($this->step + $step);
    }
    public function setOverwrite(bool $overwrite)
    {
        $this->overwrite = $overwrite;
    }
    public function setProgress(int $step)
    {
        if ($this->max && $step > $this->max) {
            $this->max = $step;
        } elseif ($step < 0) {
            $step = 0;
        }
        $redrawFreq = $this->redrawFreq ?? ($this->max ?: 10) / 10;
        $prevPeriod = (int) ($this->step / $redrawFreq);
        $currPeriod = (int) ($step / $redrawFreq);
        $this->step = $step;
        $this->percent = $this->max ? (float) $this->step / $this->max : 0;
        $timeInterval = \microtime(\true) - $this->lastWriteTime;
        if ($this->max === $step) {
            $this->display();
            return;
        }
        if ($timeInterval < $this->minSecondsBetweenRedraws) {
            return;
        }
        if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) {
            $this->display();
        }
    }
    public function setMaxSteps(int $max)
    {
        $this->format = null;
        $this->max = \max(0, $max);
        $this->stepWidth = $this->max ? Helper::strlen((string) $this->max) : 4;
    }
    public function finish() : void
    {
        if (!$this->max) {
            $this->max = $this->step;
        }
        if ($this->step === $this->max && !$this->overwrite) {
            return;
        }
        $this->setProgress($this->max);
    }
    public function display() : void
    {
        if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) {
            return;
        }
        if (null === $this->format) {
            $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
        }
        $this->overwrite($this->buildLine());
    }
    public function clear() : void
    {
        if (!$this->overwrite) {
            return;
        }
        if (null === $this->format) {
            $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
        }
        $this->overwrite('');
    }
    private function setRealFormat(string $format)
    {
        if (!$this->max && null !== self::getFormatDefinition($format . '_nomax')) {
            $this->format = self::getFormatDefinition($format . '_nomax');
        } elseif (null !== self::getFormatDefinition($format)) {
            $this->format = self::getFormatDefinition($format);
        } else {
            $this->format = $format;
        }
        $this->formatLineCount = \substr_count($this->format, "\n");
    }
    private function overwrite(string $message) : void
    {
        if ($this->previousMessage === $message) {
            return;
        }
        $originalMessage = $message;
        if ($this->overwrite) {
            if (null !== $this->previousMessage) {
                if ($this->output instanceof ConsoleSectionOutput) {
                    $messageLines = \explode("\n", $message);
                    $lineCount = \count($messageLines);
                    foreach ($messageLines as $messageLine) {
                        $messageLineLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $messageLine);
                        if ($messageLineLength > $this->terminal->getWidth()) {
                            $lineCount += \floor($messageLineLength / $this->terminal->getWidth());
                        }
                    }
                    $this->output->clear($lineCount);
                } else {
                    if ($this->formatLineCount > 0) {
                        $message = \str_repeat("\x1b[1A\x1b[2K", $this->formatLineCount) . $message;
                    }
                    $message = "\r\x1b[2K{$message}";
                }
            }
        } elseif ($this->step > 0) {
            $message = \PHP_EOL . $message;
        }
        $this->previousMessage = $originalMessage;
        $this->lastWriteTime = \microtime(\true);
        $this->output->write($message);
        ++$this->writeCount;
    }
    private function determineBestFormat() : string
    {
        switch ($this->output->getVerbosity()) {
            case OutputInterface::VERBOSITY_VERBOSE:
                return $this->max ? 'verbose' : 'verbose_nomax';
            case OutputInterface::VERBOSITY_VERY_VERBOSE:
                return $this->max ? 'very_verbose' : 'very_verbose_nomax';
            case OutputInterface::VERBOSITY_DEBUG:
                return $this->max ? 'debug' : 'debug_nomax';
            default:
                return $this->max ? 'normal' : 'normal_nomax';
        }
    }
    private static function initPlaceholderFormatters() : array
    {
        return ['bar' => function (self $bar, OutputInterface $output) {
            $completeBars = $bar->getBarOffset();
            $display = \str_repeat($bar->getBarCharacter(), $completeBars);
            if ($completeBars < $bar->getBarWidth()) {
                $emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter());
                $display .= $bar->getProgressCharacter() . \str_repeat($bar->getEmptyBarCharacter(), $emptyBars);
            }
            return $display;
        }, 'elapsed' => function (self $bar) {
            return Helper::formatTime(\time() - $bar->getStartTime());
        }, 'remaining' => function (self $bar) {
            if (!$bar->getMaxSteps()) {
                throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.');
            }
            if (!$bar->getProgress()) {
                $remaining = 0;
            } else {
                $remaining = \round((\time() - $bar->getStartTime()) / $bar->getProgress() * ($bar->getMaxSteps() - $bar->getProgress()));
            }
            return Helper::formatTime($remaining);
        }, 'estimated' => function (self $bar) {
            if (!$bar->getMaxSteps()) {
                throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.');
            }
            if (!$bar->getProgress()) {
                $estimated = 0;
            } else {
                $estimated = \round((\time() - $bar->getStartTime()) / $bar->getProgress() * $bar->getMaxSteps());
            }
            return Helper::formatTime($estimated);
        }, 'memory' => function (self $bar) {
            return Helper::formatMemory(\memory_get_usage(\true));
        }, 'current' => function (self $bar) {
            return \str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT);
        }, 'max' => function (self $bar) {
            return $bar->getMaxSteps();
        }, 'percent' => function (self $bar) {
            return \floor($bar->getProgressPercent() * 100);
        }];
    }
    private static function initFormats() : array
    {
        return ['normal' => ' %current%/%max% [%bar%] %percent:3s%%', 'normal_nomax' => ' %current% [%bar%]', 'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', 'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', 'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', 'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', 'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', 'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%'];
    }
    private function buildLine() : string
    {
        $regex = "{%([a-z\\-_]+)(?:\\:([^%]+))?%}i";
        $callback = function ($matches) {
            if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) {
                $text = $formatter($this, $this->output);
            } elseif (isset($this->messages[$matches[1]])) {
                $text = $this->messages[$matches[1]];
            } else {
                return $matches[0];
            }
            if (isset($matches[2])) {
                $text = \sprintf('%' . $matches[2], $text);
            }
            return $text;
        };
        $line = \preg_replace_callback($regex, $callback, $this->format);
        $linesLength = \array_map(function ($subLine) {
            return Helper::strlenWithoutDecoration($this->output->getFormatter(), \rtrim($subLine, "\r"));
        }, \explode("\n", $line));
        $linesWidth = \max($linesLength);
        $terminalWidth = $this->terminal->getWidth();
        if ($linesWidth <= $terminalWidth) {
            return $line;
        }
        $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth);
        return \preg_replace_callback($regex, $callback, $this->format);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

class DebugFormatterHelper extends Helper
{
    private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'];
    private $started = [];
    private $count = -1;
    public function start($id, $message, $prefix = 'RUN')
    {
        $this->started[$id] = ['border' => ++$this->count % \count($this->colors)];
        return \sprintf("%s<bg=blue;fg=white> %s </> <fg=blue>%s</>\n", $this->getBorder($id), $prefix, $message);
    }
    public function progress($id, $buffer, $error = \false, $prefix = 'OUT', $errorPrefix = 'ERR')
    {
        $message = '';
        if ($error) {
            if (isset($this->started[$id]['out'])) {
                $message .= "\n";
                unset($this->started[$id]['out']);
            }
            if (!isset($this->started[$id]['err'])) {
                $message .= \sprintf('%s<bg=red;fg=white> %s </> ', $this->getBorder($id), $errorPrefix);
                $this->started[$id]['err'] = \true;
            }
            $message .= \str_replace("\n", \sprintf("\n%s<bg=red;fg=white> %s </> ", $this->getBorder($id), $errorPrefix), $buffer);
        } else {
            if (isset($this->started[$id]['err'])) {
                $message .= "\n";
                unset($this->started[$id]['err']);
            }
            if (!isset($this->started[$id]['out'])) {
                $message .= \sprintf('%s<bg=green;fg=white> %s </> ', $this->getBorder($id), $prefix);
                $this->started[$id]['out'] = \true;
            }
            $message .= \str_replace("\n", \sprintf("\n%s<bg=green;fg=white> %s </> ", $this->getBorder($id), $prefix), $buffer);
        }
        return $message;
    }
    public function stop($id, $message, $successful, $prefix = 'RES')
    {
        $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
        if ($successful) {
            return \sprintf("%s%s<bg=green;fg=white> %s </> <fg=green>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
        }
        $message = \sprintf("%s%s<bg=red;fg=white> %s </> <fg=red>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
        unset($this->started[$id]['out'], $this->started[$id]['err']);
        return $message;
    }
    private function getBorder(string $id) : string
    {
        return \sprintf('<bg=%s> </>', $this->colors[$this->started[$id]['border']]);
    }
    public function getName()
    {
        return 'debug_formatter';
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
class HelperSet implements \IteratorAggregate
{
    private $helpers = [];
    private $command;
    public function __construct(array $helpers = [])
    {
        foreach ($helpers as $alias => $helper) {
            $this->set($helper, \is_int($alias) ? null : $alias);
        }
    }
    public function set(HelperInterface $helper, $alias = null)
    {
        $this->helpers[$helper->getName()] = $helper;
        if (null !== $alias) {
            $this->helpers[$alias] = $helper;
        }
        $helper->setHelperSet($this);
    }
    public function has($name)
    {
        return isset($this->helpers[$name]);
    }
    public function get($name)
    {
        if (!$this->has($name)) {
            throw new InvalidArgumentException(\sprintf('The helper "%s" is not defined.', $name));
        }
        return $this->helpers[$name];
    }
    public function setCommand(Command $command = null)
    {
        $this->command = $command;
    }
    public function getCommand()
    {
        return $this->command;
    }
    #[\ReturnTypeWillChange]
    public function getIterator()
    {
        return new \ArrayIterator($this->helpers);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\ClonerInterface;
use Cvphar\Symfony\Component\VarDumper\Cloner\VarCloner;
use Cvphar\Symfony\Component\VarDumper\Dumper\CliDumper;
final class Dumper
{
    private $output;
    private $dumper;
    private $cloner;
    private $handler;
    public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null)
    {
        $this->output = $output;
        $this->dumper = $dumper;
        $this->cloner = $cloner;
        if (\class_exists(CliDumper::class)) {
            $this->handler = function ($var) : string {
                $dumper = $this->dumper ?? ($this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR));
                $dumper->setColors($this->output->isDecorated());
                return \rtrim($dumper->dump(($this->cloner ?? ($this->cloner = new VarCloner()))->cloneVar($var)->withRefHandles(\false), \true));
            };
        } else {
            $this->handler = function ($var) : string {
                switch (\true) {
                    case null === $var:
                        return 'null';
                    case \true === $var:
                        return 'true';
                    case \false === $var:
                        return 'false';
                    case \is_string($var):
                        return '"' . $var . '"';
                    default:
                        return \rtrim(\print_r($var, \true));
                }
            };
        }
    }
    public function __invoke($var) : string
    {
        return ($this->handler)($var);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Input\InputAwareInterface;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
abstract class InputAwareHelper extends Helper implements InputAwareInterface
{
    protected $input;
    public function setInput(InputInterface $input)
    {
        $this->input = $input;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\MissingInputException;
use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\StreamableInputInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleSectionOutput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Question\ChoiceQuestion;
use Cvphar\Symfony\Component\Console\Question\Question;
use Cvphar\Symfony\Component\Console\Terminal;
class QuestionHelper extends Helper
{
    private $inputStream;
    private static $shell;
    private static $stty = \true;
    private static $stdinIsInteractive;
    public function ask(InputInterface $input, OutputInterface $output, Question $question)
    {
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }
        if (!$input->isInteractive()) {
            return $this->getDefaultAnswer($question);
        }
        if ($input instanceof StreamableInputInterface && ($stream = $input->getStream())) {
            $this->inputStream = $stream;
        }
        try {
            if (!$question->getValidator()) {
                return $this->doAsk($output, $question);
            }
            $interviewer = function () use($output, $question) {
                return $this->doAsk($output, $question);
            };
            return $this->validateAttempts($interviewer, $output, $question);
        } catch (MissingInputException $exception) {
            $input->setInteractive(\false);
            if (null === ($fallbackOutput = $this->getDefaultAnswer($question))) {
                throw $exception;
            }
            return $fallbackOutput;
        }
    }
    public function getName()
    {
        return 'question';
    }
    public static function disableStty()
    {
        self::$stty = \false;
    }
    private function doAsk(OutputInterface $output, Question $question)
    {
        $this->writePrompt($output, $question);
        $inputStream = $this->inputStream ?: \STDIN;
        $autocomplete = $question->getAutocompleterCallback();
        if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
            $ret = \false;
            if ($question->isHidden()) {
                try {
                    $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable());
                    $ret = $question->isTrimmable() ? \trim($hiddenResponse) : $hiddenResponse;
                } catch (RuntimeException $e) {
                    if (!$question->isHiddenFallback()) {
                        throw $e;
                    }
                }
            }
            if (\false === $ret) {
                $cp = $this->setIOCodepage();
                $ret = \fgets($inputStream, 4096);
                $ret = $this->resetIOCodepage($cp, $ret);
                if (\false === $ret) {
                    throw new MissingInputException('Aborted.');
                }
                if ($question->isTrimmable()) {
                    $ret = \trim($ret);
                }
            }
        } else {
            $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete);
            $ret = $question->isTrimmable() ? \trim($autocomplete) : $autocomplete;
        }
        if ($output instanceof ConsoleSectionOutput) {
            $output->addContent($ret);
        }
        $ret = \strlen($ret) > 0 ? $ret : $question->getDefault();
        if ($normalizer = $question->getNormalizer()) {
            return $normalizer($ret);
        }
        return $ret;
    }
    private function getDefaultAnswer(Question $question)
    {
        $default = $question->getDefault();
        if (null === $default) {
            return $default;
        }
        if ($validator = $question->getValidator()) {
            return \call_user_func($question->getValidator(), $default);
        } elseif ($question instanceof ChoiceQuestion) {
            $choices = $question->getChoices();
            if (!$question->isMultiselect()) {
                return $choices[$default] ?? $default;
            }
            $default = \explode(',', $default);
            foreach ($default as $k => $v) {
                $v = $question->isTrimmable() ? \trim($v) : $v;
                $default[$k] = $choices[$v] ?? $v;
            }
        }
        return $default;
    }
    protected function writePrompt(OutputInterface $output, Question $question)
    {
        $message = $question->getQuestion();
        if ($question instanceof ChoiceQuestion) {
            $output->writeln(\array_merge([$question->getQuestion()], $this->formatChoiceQuestionChoices($question, 'info')));
            $message = $question->getPrompt();
        }
        $output->write($message);
    }
    protected function formatChoiceQuestionChoices(ChoiceQuestion $question, $tag)
    {
        $messages = [];
        $maxWidth = \max(\array_map([__CLASS__, 'strlen'], \array_keys($choices = $question->getChoices())));
        foreach ($choices as $key => $value) {
            $padding = \str_repeat(' ', $maxWidth - self::strlen($key));
            $messages[] = \sprintf("  [<{$tag}>%s{$padding}</{$tag}>] %s", $key, $value);
        }
        return $messages;
    }
    protected function writeError(OutputInterface $output, \Exception $error)
    {
        if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) {
            $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error');
        } else {
            $message = '<error>' . $error->getMessage() . '</error>';
        }
        $output->writeln($message);
    }
    private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete) : string
    {
        $fullChoice = '';
        $ret = '';
        $i = 0;
        $ofs = -1;
        $matches = $autocomplete($ret);
        $numMatches = \count($matches);
        $sttyMode = \shell_exec('stty -g');
        \shell_exec('stty -icanon -echo');
        $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white'));
        while (!\feof($inputStream)) {
            $c = \fread($inputStream, 1);
            if (\false === $c || '' === $ret && '' === $c && null === $question->getDefault()) {
                \shell_exec(\sprintf('stty %s', $sttyMode));
                throw new MissingInputException('Aborted.');
            } elseif ("" === $c) {
                if (0 === $numMatches && 0 !== $i) {
                    --$i;
                    $fullChoice = self::substr($fullChoice, 0, $i);
                    $output->write("\x1b[1D");
                }
                if (0 === $i) {
                    $ofs = -1;
                    $matches = $autocomplete($ret);
                    $numMatches = \count($matches);
                } else {
                    $numMatches = 0;
                }
                $ret = self::substr($ret, 0, $i);
            } elseif ("\x1b" === $c) {
                $c .= \fread($inputStream, 2);
                if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) {
                    if ('A' === $c[2] && -1 === $ofs) {
                        $ofs = 0;
                    }
                    if (0 === $numMatches) {
                        continue;
                    }
                    $ofs += 'A' === $c[2] ? -1 : 1;
                    $ofs = ($numMatches + $ofs) % $numMatches;
                }
            } elseif (\ord($c) < 32) {
                if ("\t" === $c || "\n" === $c) {
                    if ($numMatches > 0 && -1 !== $ofs) {
                        $ret = (string) $matches[$ofs];
                        $remainingCharacters = \substr($ret, \strlen(\trim($this->mostRecentlyEnteredValue($fullChoice))));
                        $output->write($remainingCharacters);
                        $fullChoice .= $remainingCharacters;
                        $i = \false === ($encoding = \mb_detect_encoding($fullChoice, null, \true)) ? \strlen($fullChoice) : \mb_strlen($fullChoice, $encoding);
                        $matches = \array_filter($autocomplete($ret), function ($match) use($ret) {
                            return '' === $ret || \str_starts_with($match, $ret);
                        });
                        $numMatches = \count($matches);
                        $ofs = -1;
                    }
                    if ("\n" === $c) {
                        $output->write($c);
                        break;
                    }
                    $numMatches = 0;
                }
                continue;
            } else {
                if ("\x80" <= $c) {
                    $c .= \fread($inputStream, ["\xc0" => 1, "\xd0" => 1, "\xe0" => 2, "\xf0" => 3][$c & "\xf0"]);
                }
                $output->write($c);
                $ret .= $c;
                $fullChoice .= $c;
                ++$i;
                $tempRet = $ret;
                if ($question instanceof ChoiceQuestion && $question->isMultiselect()) {
                    $tempRet = $this->mostRecentlyEnteredValue($fullChoice);
                }
                $numMatches = 0;
                $ofs = 0;
                foreach ($autocomplete($ret) as $value) {
                    if (\str_starts_with($value, $tempRet)) {
                        $matches[$numMatches++] = $value;
                    }
                }
            }
            $output->write("\x1b[K");
            if ($numMatches > 0 && -1 !== $ofs) {
                $output->write("\x1b7");
                $charactersEntered = \strlen(\trim($this->mostRecentlyEnteredValue($fullChoice)));
                $output->write('<hl>' . OutputFormatter::escapeTrailingBackslash(\substr($matches[$ofs], $charactersEntered)) . '</hl>');
                $output->write("\x1b8");
            }
        }
        \shell_exec(\sprintf('stty %s', $sttyMode));
        return $fullChoice;
    }
    private function mostRecentlyEnteredValue(string $entered) : string
    {
        if (!\str_contains($entered, ',')) {
            return $entered;
        }
        $choices = \explode(',', $entered);
        if ('' !== ($lastChoice = \trim($choices[\count($choices) - 1]))) {
            return $lastChoice;
        }
        return $entered;
    }
    private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = \true) : string
    {
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $exe = __DIR__ . '/../Resources/bin/hiddeninput.exe';
            if ('phar:' === \substr(__FILE__, 0, 5)) {
                $tmpExe = \sys_get_temp_dir() . '/hiddeninput.exe';
                \copy($exe, $tmpExe);
                $exe = $tmpExe;
            }
            $sExec = \shell_exec('"' . $exe . '"');
            $value = $trimmable ? \rtrim($sExec) : $sExec;
            $output->writeln('');
            if (isset($tmpExe)) {
                \unlink($tmpExe);
            }
            return $value;
        }
        if (self::$stty && Terminal::hasSttyAvailable()) {
            $sttyMode = \shell_exec('stty -g');
            \shell_exec('stty -echo');
        } elseif ($this->isInteractiveInput($inputStream)) {
            throw new RuntimeException('Unable to hide the response.');
        }
        $value = \fgets($inputStream, 4096);
        if (self::$stty && Terminal::hasSttyAvailable()) {
            \shell_exec(\sprintf('stty %s', $sttyMode));
        }
        if (\false === $value) {
            throw new MissingInputException('Aborted.');
        }
        if ($trimmable) {
            $value = \trim($value);
        }
        $output->writeln('');
        return $value;
    }
    private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question)
    {
        $error = null;
        $attempts = $question->getMaxAttempts();
        while (null === $attempts || $attempts--) {
            if (null !== $error) {
                $this->writeError($output, $error);
            }
            try {
                return $question->getValidator()($interviewer());
            } catch (RuntimeException $e) {
                throw $e;
            } catch (\Exception $error) {
            }
        }
        throw $error;
    }
    private function isInteractiveInput($inputStream) : bool
    {
        if ('php://stdin' !== (\stream_get_meta_data($inputStream)['uri'] ?? null)) {
            return \false;
        }
        if (null !== self::$stdinIsInteractive) {
            return self::$stdinIsInteractive;
        }
        if (\function_exists('stream_isatty')) {
            return self::$stdinIsInteractive = \stream_isatty(\fopen('php://stdin', 'r'));
        }
        if (\function_exists('posix_isatty')) {
            return self::$stdinIsInteractive = \posix_isatty(\fopen('php://stdin', 'r'));
        }
        if (!\function_exists('exec')) {
            return self::$stdinIsInteractive = \true;
        }
        \exec('stty 2> /dev/null', $output, $status);
        return self::$stdinIsInteractive = 1 !== $status;
    }
    private function setIOCodepage() : int
    {
        if (\function_exists('sapi_windows_cp_set')) {
            $cp = \sapi_windows_cp_get();
            \sapi_windows_cp_set(\sapi_windows_cp_get('oem'));
            return $cp;
        }
        return 0;
    }
    private function resetIOCodepage(int $cp, $input)
    {
        if (0 !== $cp) {
            \sapi_windows_cp_set($cp);
            if (\false !== $input && '' !== $input) {
                $input = \sapi_windows_cp_conv(\sapi_windows_cp_get('oem'), $cp, $input);
            }
        }
        return $input;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Formatter\OutputFormatterInterface;
abstract class Helper implements HelperInterface
{
    protected $helperSet = null;
    public function setHelperSet(HelperSet $helperSet = null)
    {
        $this->helperSet = $helperSet;
    }
    public function getHelperSet()
    {
        return $this->helperSet;
    }
    public static function strlen($string)
    {
        $string = (string) $string;
        if (\false === ($encoding = \mb_detect_encoding($string, null, \true))) {
            return \strlen($string);
        }
        return \mb_strwidth($string, $encoding);
    }
    public static function substr($string, $from, $length = null)
    {
        $string = (string) $string;
        if (\false === ($encoding = \mb_detect_encoding($string, null, \true))) {
            return \substr($string, $from, $length);
        }
        return \mb_substr($string, $from, $length, $encoding);
    }
    public static function formatTime($secs)
    {
        static $timeFormats = [[0, '< 1 sec'], [1, '1 sec'], [2, 'secs', 1], [60, '1 min'], [120, 'mins', 60], [3600, '1 hr'], [7200, 'hrs', 3600], [86400, '1 day'], [172800, 'days', 86400]];
        foreach ($timeFormats as $index => $format) {
            if ($secs >= $format[0]) {
                if (isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0] || $index == \count($timeFormats) - 1) {
                    if (2 == \count($format)) {
                        return $format[1];
                    }
                    return \floor($secs / $format[2]) . ' ' . $format[1];
                }
            }
        }
    }
    public static function formatMemory($memory)
    {
        if ($memory >= 1024 * 1024 * 1024) {
            return \sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024);
        }
        if ($memory >= 1024 * 1024) {
            return \sprintf('%.1f MiB', $memory / 1024 / 1024);
        }
        if ($memory >= 1024) {
            return \sprintf('%d KiB', $memory / 1024);
        }
        return \sprintf('%d B', $memory);
    }
    public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)
    {
        return self::strlen(self::removeDecoration($formatter, $string));
    }
    public static function removeDecoration(OutputFormatterInterface $formatter, $string)
    {
        $isDecorated = $formatter->isDecorated();
        $formatter->setDecorated(\false);
        $string = $formatter->format($string);
        $string = \preg_replace("/\x1b\\[[^m]*m/", '', $string);
        $formatter->setDecorated($isDecorated);
        return $string;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\RuntimeException;
use Cvphar\Symfony\Component\Console\Formatter\OutputFormatter;
use Cvphar\Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface;
use Cvphar\Symfony\Component\Console\Output\ConsoleSectionOutput;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Table
{
    private const SEPARATOR_TOP = 0;
    private const SEPARATOR_TOP_BOTTOM = 1;
    private const SEPARATOR_MID = 2;
    private const SEPARATOR_BOTTOM = 3;
    private const BORDER_OUTSIDE = 0;
    private const BORDER_INSIDE = 1;
    private $headerTitle;
    private $footerTitle;
    private $headers = [];
    private $rows = [];
    private $horizontal = \false;
    private $effectiveColumnWidths = [];
    private $numberOfColumns;
    private $output;
    private $style;
    private $columnStyles = [];
    private $columnWidths = [];
    private $columnMaxWidths = [];
    private static $styles;
    private $rendered = \false;
    public function __construct(OutputInterface $output)
    {
        $this->output = $output;
        if (!self::$styles) {
            self::$styles = self::initStyles();
        }
        $this->setStyle('default');
    }
    public static function setStyleDefinition($name, TableStyle $style)
    {
        if (!self::$styles) {
            self::$styles = self::initStyles();
        }
        self::$styles[$name] = $style;
    }
    public static function getStyleDefinition($name)
    {
        if (!self::$styles) {
            self::$styles = self::initStyles();
        }
        if (isset(self::$styles[$name])) {
            return self::$styles[$name];
        }
        throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name));
    }
    public function setStyle($name)
    {
        $this->style = $this->resolveStyle($name);
        return $this;
    }
    public function getStyle()
    {
        return $this->style;
    }
    public function setColumnStyle($columnIndex, $name)
    {
        $columnIndex = (int) $columnIndex;
        $this->columnStyles[$columnIndex] = $this->resolveStyle($name);
        return $this;
    }
    public function getColumnStyle($columnIndex)
    {
        return $this->columnStyles[$columnIndex] ?? $this->getStyle();
    }
    public function setColumnWidth($columnIndex, $width)
    {
        $this->columnWidths[(int) $columnIndex] = (int) $width;
        return $this;
    }
    public function setColumnWidths(array $widths)
    {
        $this->columnWidths = [];
        foreach ($widths as $index => $width) {
            $this->setColumnWidth($index, $width);
        }
        return $this;
    }
    public function setColumnMaxWidth(int $columnIndex, int $width) : self
    {
        if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) {
            throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, \get_class($this->output->getFormatter())));
        }
        $this->columnMaxWidths[$columnIndex] = $width;
        return $this;
    }
    public function setHeaders(array $headers)
    {
        $headers = \array_values($headers);
        if (!empty($headers) && !\is_array($headers[0])) {
            $headers = [$headers];
        }
        $this->headers = $headers;
        return $this;
    }
    public function setRows(array $rows)
    {
        $this->rows = [];
        return $this->addRows($rows);
    }
    public function addRows(array $rows)
    {
        foreach ($rows as $row) {
            $this->addRow($row);
        }
        return $this;
    }
    public function addRow($row)
    {
        if ($row instanceof TableSeparator) {
            $this->rows[] = $row;
            return $this;
        }
        if (!\is_array($row)) {
            throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.');
        }
        $this->rows[] = \array_values($row);
        return $this;
    }
    public function appendRow($row) : self
    {
        if (!$this->output instanceof ConsoleSectionOutput) {
            throw new RuntimeException(\sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__));
        }
        if ($this->rendered) {
            $this->output->clear($this->calculateRowCount());
        }
        $this->addRow($row);
        $this->render();
        return $this;
    }
    public function setRow($column, array $row)
    {
        $this->rows[$column] = $row;
        return $this;
    }
    public function setHeaderTitle(?string $title) : self
    {
        $this->headerTitle = $title;
        return $this;
    }
    public function setFooterTitle(?string $title) : self
    {
        $this->footerTitle = $title;
        return $this;
    }
    public function setHorizontal(bool $horizontal = \true) : self
    {
        $this->horizontal = $horizontal;
        return $this;
    }
    public function render()
    {
        $divider = new TableSeparator();
        if ($this->horizontal) {
            $rows = [];
            foreach ($this->headers[0] ?? [] as $i => $header) {
                $rows[$i] = [$header];
                foreach ($this->rows as $row) {
                    if ($row instanceof TableSeparator) {
                        continue;
                    }
                    if (isset($row[$i])) {
                        $rows[$i][] = $row[$i];
                    } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) {
                    } else {
                        $rows[$i][] = null;
                    }
                }
            }
        } else {
            $rows = \array_merge($this->headers, [$divider], $this->rows);
        }
        $this->calculateNumberOfColumns($rows);
        $rows = $this->buildTableRows($rows);
        $this->calculateColumnsWidth($rows);
        $isHeader = !$this->horizontal;
        $isFirstRow = $this->horizontal;
        $hasTitle = (bool) $this->headerTitle;
        foreach ($rows as $row) {
            if ($divider === $row) {
                $isHeader = \false;
                $isFirstRow = \true;
                continue;
            }
            if ($row instanceof TableSeparator) {
                $this->renderRowSeparator();
                continue;
            }
            if (!$row) {
                continue;
            }
            if ($isHeader || $isFirstRow) {
                $this->renderRowSeparator($isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, $hasTitle ? $this->headerTitle : null, $hasTitle ? $this->style->getHeaderTitleFormat() : null);
                $isFirstRow = \false;
                $hasTitle = \false;
            }
            if ($this->horizontal) {
                $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat());
            } else {
                $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
            }
        }
        $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat());
        $this->cleanup();
        $this->rendered = \true;
    }
    private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null)
    {
        if (0 === ($count = $this->numberOfColumns)) {
            return;
        }
        $borders = $this->style->getBorderChars();
        if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) {
            return;
        }
        $crossings = $this->style->getCrossingChars();
        if (self::SEPARATOR_MID === $type) {
            [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]];
        } elseif (self::SEPARATOR_TOP === $type) {
            [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]];
        } elseif (self::SEPARATOR_TOP_BOTTOM === $type) {
            [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]];
        } else {
            [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]];
        }
        $markup = $leftChar;
        for ($column = 0; $column < $count; ++$column) {
            $markup .= \str_repeat($horizontal, $this->effectiveColumnWidths[$column]);
            $markup .= $column === $count - 1 ? $rightChar : $midChar;
        }
        if (null !== $title) {
            $titleLength = Helper::strlenWithoutDecoration($formatter = $this->output->getFormatter(), $formattedTitle = \sprintf($titleFormat, $title));
            $markupLength = Helper::strlen($markup);
            if ($titleLength > ($limit = $markupLength - 4)) {
                $titleLength = $limit;
                $formatLength = Helper::strlenWithoutDecoration($formatter, \sprintf($titleFormat, ''));
                $formattedTitle = \sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3) . '...');
            }
            $titleStart = \intdiv($markupLength - $titleLength, 2);
            if (\false === \mb_detect_encoding($markup, null, \true)) {
                $markup = \substr_replace($markup, $formattedTitle, $titleStart, $titleLength);
            } else {
                $markup = \mb_substr($markup, 0, $titleStart) . $formattedTitle . \mb_substr($markup, $titleStart + $titleLength);
            }
        }
        $this->output->writeln(\sprintf($this->style->getBorderFormat(), $markup));
    }
    private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE) : string
    {
        $borders = $this->style->getBorderChars();
        return \sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
    }
    private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null)
    {
        $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
        $columns = $this->getRowColumns($row);
        $last = \count($columns) - 1;
        foreach ($columns as $i => $column) {
            if ($firstCellFormat && 0 === $i) {
                $rowContent .= $this->renderCell($row, $column, $firstCellFormat);
            } else {
                $rowContent .= $this->renderCell($row, $column, $cellFormat);
            }
            $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
        }
        $this->output->writeln($rowContent);
    }
    private function renderCell(array $row, int $column, string $cellFormat) : string
    {
        $cell = $row[$column] ?? '';
        $width = $this->effectiveColumnWidths[$column];
        if ($cell instanceof TableCell && $cell->getColspan() > 1) {
            foreach (\range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) {
                $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn];
            }
        }
        if (\false !== ($encoding = \mb_detect_encoding($cell, null, \true))) {
            $width += \strlen($cell) - \mb_strwidth($cell, $encoding);
        }
        $style = $this->getColumnStyle($column);
        if ($cell instanceof TableSeparator) {
            return \sprintf($style->getBorderFormat(), \str_repeat($style->getBorderChars()[2], $width));
        }
        $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
        $content = \sprintf($style->getCellRowContentFormat(), $cell);
        return \sprintf($cellFormat, \str_pad($content, $width, $style->getPaddingChar(), $style->getPadType()));
    }
    private function calculateNumberOfColumns(array $rows)
    {
        $columns = [0];
        foreach ($rows as $row) {
            if ($row instanceof TableSeparator) {
                continue;
            }
            $columns[] = $this->getNumberOfColumns($row);
        }
        $this->numberOfColumns = \max($columns);
    }
    private function buildTableRows(array $rows) : TableRows
    {
        $formatter = $this->output->getFormatter();
        $unmergedRows = [];
        for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) {
            $rows = $this->fillNextRows($rows, $rowKey);
            foreach ($rows[$rowKey] as $column => $cell) {
                $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1;
                if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) {
                    $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan);
                }
                if (!\strstr($cell ?? '', "\n")) {
                    continue;
                }
                $escaped = \implode("\n", \array_map([OutputFormatter::class, 'escapeTrailingBackslash'], \explode("\n", $cell)));
                $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped;
                $lines = \explode("\n", \str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
                foreach ($lines as $lineKey => $line) {
                    if ($colspan > 1) {
                        $line = new TableCell($line, ['colspan' => $colspan]);
                    }
                    if (0 === $lineKey) {
                        $rows[$rowKey][$column] = $line;
                    } else {
                        if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) {
                            $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey);
                        }
                        $unmergedRows[$rowKey][$lineKey][$column] = $line;
                    }
                }
            }
        }
        return new TableRows(function () use($rows, $unmergedRows) : \Traversable {
            foreach ($rows as $rowKey => $row) {
                (yield $row instanceof TableSeparator ? $row : $this->fillCells($row));
                if (isset($unmergedRows[$rowKey])) {
                    foreach ($unmergedRows[$rowKey] as $row) {
                        (yield $row instanceof TableSeparator ? $row : $this->fillCells($row));
                    }
                }
            }
        });
    }
    private function calculateRowCount() : int
    {
        $numberOfRows = \count(\iterator_to_array($this->buildTableRows(\array_merge($this->headers, [new TableSeparator()], $this->rows))));
        if ($this->headers) {
            ++$numberOfRows;
        }
        if (\count($this->rows) > 0) {
            ++$numberOfRows;
        }
        return $numberOfRows;
    }
    private function fillNextRows(array $rows, int $line) : array
    {
        $unmergedRows = [];
        foreach ($rows[$line] as $column => $cell) {
            if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && \method_exists($cell, '__toString'))) {
                throw new InvalidArgumentException(\sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
            }
            if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
                $nbLines = $cell->getRowspan() - 1;
                $lines = [$cell];
                if (\strstr($cell, "\n")) {
                    $lines = \explode("\n", \str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
                    $nbLines = \count($lines) > $nbLines ? \substr_count($cell, "\n") : $nbLines;
                    $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan()]);
                    unset($lines[0]);
                }
                $unmergedRows = \array_replace_recursive(\array_fill($line + 1, $nbLines, []), $unmergedRows);
                foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
                    $value = $lines[$unmergedRowKey - $line] ?? '';
                    $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]);
                    if ($nbLines === $unmergedRowKey - $line) {
                        break;
                    }
                }
            }
        }
        foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
            if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && $this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns) {
                foreach ($unmergedRow as $cellKey => $cell) {
                    \array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]);
                }
            } else {
                $row = $this->copyRow($rows, $unmergedRowKey - 1);
                foreach ($unmergedRow as $column => $cell) {
                    if (!empty($cell)) {
                        $row[$column] = $unmergedRow[$column];
                    }
                }
                \array_splice($rows, $unmergedRowKey, 0, [$row]);
            }
        }
        return $rows;
    }
    private function fillCells(iterable $row)
    {
        $newRow = [];
        foreach ($row as $column => $cell) {
            $newRow[] = $cell;
            if ($cell instanceof TableCell && $cell->getColspan() > 1) {
                foreach (\range($column + 1, $column + $cell->getColspan() - 1) as $position) {
                    $newRow[] = '';
                }
            }
        }
        return $newRow ?: $row;
    }
    private function copyRow(array $rows, int $line) : array
    {
        $row = $rows[$line];
        foreach ($row as $cellKey => $cellValue) {
            $row[$cellKey] = '';
            if ($cellValue instanceof TableCell) {
                $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]);
            }
        }
        return $row;
    }
    private function getNumberOfColumns(array $row) : int
    {
        $columns = \count($row);
        foreach ($row as $column) {
            $columns += $column instanceof TableCell ? $column->getColspan() - 1 : 0;
        }
        return $columns;
    }
    private function getRowColumns(array $row) : array
    {
        $columns = \range(0, $this->numberOfColumns - 1);
        foreach ($row as $cellKey => $cell) {
            if ($cell instanceof TableCell && $cell->getColspan() > 1) {
                $columns = \array_diff($columns, \range($cellKey + 1, $cellKey + $cell->getColspan() - 1));
            }
        }
        return $columns;
    }
    private function calculateColumnsWidth(iterable $rows)
    {
        for ($column = 0; $column < $this->numberOfColumns; ++$column) {
            $lengths = [];
            foreach ($rows as $row) {
                if ($row instanceof TableSeparator) {
                    continue;
                }
                foreach ($row as $i => $cell) {
                    if ($cell instanceof TableCell) {
                        $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell);
                        $textLength = Helper::strlen($textContent);
                        if ($textLength > 0) {
                            $contentColumns = \str_split($textContent, \ceil($textLength / $cell->getColspan()));
                            foreach ($contentColumns as $position => $content) {
                                $row[$i + $position] = $content;
                            }
                        }
                    }
                }
                $lengths[] = $this->getCellWidth($row, $column);
            }
            $this->effectiveColumnWidths[$column] = \max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2;
        }
    }
    private function getColumnSeparatorWidth() : int
    {
        return Helper::strlen(\sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3]));
    }
    private function getCellWidth(array $row, int $column) : int
    {
        $cellWidth = 0;
        if (isset($row[$column])) {
            $cell = $row[$column];
            $cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
        }
        $columnWidth = $this->columnWidths[$column] ?? 0;
        $cellWidth = \max($cellWidth, $columnWidth);
        return isset($this->columnMaxWidths[$column]) ? \min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
    }
    private function cleanup()
    {
        $this->effectiveColumnWidths = [];
        $this->numberOfColumns = null;
    }
    private static function initStyles() : array
    {
        $borderless = new TableStyle();
        $borderless->setHorizontalBorderChars('=')->setVerticalBorderChars(' ')->setDefaultCrossingChar(' ');
        $compact = new TableStyle();
        $compact->setHorizontalBorderChars('')->setVerticalBorderChars(' ')->setDefaultCrossingChar('')->setCellRowContentFormat('%s');
        $styleGuide = new TableStyle();
        $styleGuide->setHorizontalBorderChars('-')->setVerticalBorderChars(' ')->setDefaultCrossingChar(' ')->setCellHeaderFormat('%s');
        $box = (new TableStyle())->setHorizontalBorderChars('â”€')->setVerticalBorderChars('â”‚')->setCrossingChars('â”¼', 'â”Œ', 'â”¬', 'â”�', 'â”¤', 'â”˜', 'â”´', 'â””', 'â”œ');
        $boxDouble = (new TableStyle())->setHorizontalBorderChars('â•�', 'â”€')->setVerticalBorderChars('â•‘', 'â”‚')->setCrossingChars('â”¼', 'â•”', 'â•¤', 'â•—', 'â•¢', 'â•�', 'â•§', 'â•š', 'â•Ÿ', 'â• ', 'â•ª', 'â•£');
        return ['default' => new TableStyle(), 'borderless' => $borderless, 'compact' => $compact, 'symfony-style-guide' => $styleGuide, 'box' => $box, 'box-double' => $boxDouble];
    }
    private function resolveStyle($name) : TableStyle
    {
        if ($name instanceof TableStyle) {
            return $name;
        }
        if (isset(self::$styles[$name])) {
            return self::$styles[$name];
        }
        throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name));
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Exception\LogicException;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ProgressIndicator
{
    private $output;
    private $startTime;
    private $format;
    private $message;
    private $indicatorValues;
    private $indicatorCurrent;
    private $indicatorChangeInterval;
    private $indicatorUpdateTime;
    private $started = \false;
    private static $formatters;
    private static $formats;
    public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null)
    {
        $this->output = $output;
        if (null === $format) {
            $format = $this->determineBestFormat();
        }
        if (null === $indicatorValues) {
            $indicatorValues = ['-', '\\', '|', '/'];
        }
        $indicatorValues = \array_values($indicatorValues);
        if (2 > \count($indicatorValues)) {
            throw new InvalidArgumentException('Must have at least 2 indicator value characters.');
        }
        $this->format = self::getFormatDefinition($format);
        $this->indicatorChangeInterval = $indicatorChangeInterval;
        $this->indicatorValues = $indicatorValues;
        $this->startTime = \time();
    }
    public function setMessage($message)
    {
        $this->message = $message;
        $this->display();
    }
    public function start($message)
    {
        if ($this->started) {
            throw new LogicException('Progress indicator already started.');
        }
        $this->message = $message;
        $this->started = \true;
        $this->startTime = \time();
        $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval;
        $this->indicatorCurrent = 0;
        $this->display();
    }
    public function advance()
    {
        if (!$this->started) {
            throw new LogicException('Progress indicator has not yet been started.');
        }
        if (!$this->output->isDecorated()) {
            return;
        }
        $currentTime = $this->getCurrentTimeInMilliseconds();
        if ($currentTime < $this->indicatorUpdateTime) {
            return;
        }
        $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval;
        ++$this->indicatorCurrent;
        $this->display();
    }
    public function finish($message)
    {
        if (!$this->started) {
            throw new LogicException('Progress indicator has not yet been started.');
        }
        $this->message = $message;
        $this->display();
        $this->output->writeln('');
        $this->started = \false;
    }
    public static function getFormatDefinition($name)
    {
        if (!self::$formats) {
            self::$formats = self::initFormats();
        }
        return self::$formats[$name] ?? null;
    }
    public static function setPlaceholderFormatterDefinition($name, $callable)
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }
        self::$formatters[$name] = $callable;
    }
    public static function getPlaceholderFormatterDefinition($name)
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }
        return self::$formatters[$name] ?? null;
    }
    private function display()
    {
        if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) {
            return;
        }
        $this->overwrite(\preg_replace_callback("{%([a-z\\-_]+)(?:\\:([^%]+))?%}i", function ($matches) {
            if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) {
                return $formatter($this);
            }
            return $matches[0];
        }, $this->format ?? ''));
    }
    private function determineBestFormat() : string
    {
        switch ($this->output->getVerbosity()) {
            case OutputInterface::VERBOSITY_VERBOSE:
                return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi';
            case OutputInterface::VERBOSITY_VERY_VERBOSE:
            case OutputInterface::VERBOSITY_DEBUG:
                return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi';
            default:
                return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi';
        }
    }
    private function overwrite(string $message)
    {
        if ($this->output->isDecorated()) {
            $this->output->write("\r\x1b[2K");
            $this->output->write($message);
        } else {
            $this->output->writeln($message);
        }
    }
    private function getCurrentTimeInMilliseconds() : float
    {
        return \round(\microtime(\true) * 1000);
    }
    private static function initPlaceholderFormatters() : array
    {
        return ['indicator' => function (self $indicator) {
            return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)];
        }, 'message' => function (self $indicator) {
            return $indicator->message;
        }, 'elapsed' => function (self $indicator) {
            return Helper::formatTime(\time() - $indicator->startTime);
        }, 'memory' => function () {
            return Helper::formatMemory(\memory_get_usage(\true));
        }];
    }
    private static function initFormats() : array
    {
        return ['normal' => ' %indicator% %message%', 'normal_no_ansi' => ' %message%', 'verbose' => ' %indicator% %message% (%elapsed:6s%)', 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)'];
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Helper;

use Cvphar\Symfony\Component\Console\Descriptor\DescriptorInterface;
use Cvphar\Symfony\Component\Console\Descriptor\JsonDescriptor;
use Cvphar\Symfony\Component\Console\Descriptor\MarkdownDescriptor;
use Cvphar\Symfony\Component\Console\Descriptor\TextDescriptor;
use Cvphar\Symfony\Component\Console\Descriptor\XmlDescriptor;
use Cvphar\Symfony\Component\Console\Exception\InvalidArgumentException;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class DescriptorHelper extends Helper
{
    private $descriptors = [];
    public function __construct()
    {
        $this->register('txt', new TextDescriptor())->register('xml', new XmlDescriptor())->register('json', new JsonDescriptor())->register('md', new MarkdownDescriptor());
    }
    public function describe(OutputInterface $output, $object, array $options = [])
    {
        $options = \array_merge(['raw_text' => \false, 'format' => 'txt'], $options);
        if (!isset($this->descriptors[$options['format']])) {
            throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $options['format']));
        }
        $descriptor = $this->descriptors[$options['format']];
        $descriptor->describe($output, $object, $options);
    }
    public function register($format, DescriptorInterface $descriptor)
    {
        $this->descriptors[$format] = $descriptor;
        return $this;
    }
    public function getName()
    {
        return 'descriptor';
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\DependencyInjection;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\TypedReference;
class AddConsoleCommandPass implements CompilerPassInterface
{
    private $commandLoaderServiceId;
    private $commandTag;
    public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command')
    {
        $this->commandLoaderServiceId = $commandLoaderServiceId;
        $this->commandTag = $commandTag;
    }
    public function process(ContainerBuilder $container)
    {
        $commandServices = $container->findTaggedServiceIds($this->commandTag, \true);
        $lazyCommandMap = [];
        $lazyCommandRefs = [];
        $serviceIds = [];
        foreach ($commandServices as $id => $tags) {
            $definition = $container->getDefinition($id);
            $class = $container->getParameterBag()->resolveValue($definition->getClass());
            if (isset($tags[0]['command'])) {
                $commandName = $tags[0]['command'];
            } else {
                if (!($r = $container->getReflectionClass($class))) {
                    throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
                }
                if (!$r->isSubclassOf(Command::class)) {
                    throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class));
                }
                $commandName = $class::getDefaultName();
            }
            if (null === $commandName) {
                if (!$definition->isPublic() || $definition->isPrivate()) {
                    $commandId = 'console.command.public_alias.' . $id;
                    $container->setAlias($commandId, $id)->setPublic(\true);
                    $id = $commandId;
                }
                $serviceIds[] = $id;
                continue;
            }
            unset($tags[0]);
            $lazyCommandMap[$commandName] = $id;
            $lazyCommandRefs[$id] = new TypedReference($id, $class);
            $aliases = [];
            foreach ($tags as $tag) {
                if (isset($tag['command'])) {
                    $aliases[] = $tag['command'];
                    $lazyCommandMap[$tag['command']] = $id;
                }
            }
            $definition->addMethodCall('setName', [$commandName]);
            if ($aliases) {
                $definition->addMethodCall('setAliases', [$aliases]);
            }
        }
        $container->register($this->commandLoaderServiceId, ContainerCommandLoader::class)->setPublic(\true)->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]);
        $container->setParameter('console.command.ids', $serviceIds);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class LogicException extends \LogicException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

interface ExceptionInterface extends \Throwable
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class NamespaceNotFoundException extends CommandNotFoundException
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class MissingInputException extends RuntimeException implements ExceptionInterface
{
}
<?php

namespace Cvphar\Symfony\Component\Console\Exception;

class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface
{
    private $alternatives;
    public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->alternatives = $alternatives;
    }
    public function getAlternatives()
    {
        return $this->alternatives;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Event;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ConsoleTerminateEvent extends ConsoleEvent
{
    private $exitCode;
    public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode)
    {
        parent::__construct($command, $input, $output);
        $this->setExitCode($exitCode);
    }
    public function setExitCode($exitCode)
    {
        $this->exitCode = (int) $exitCode;
    }
    public function getExitCode()
    {
        return $this->exitCode;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Event;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
final class ConsoleErrorEvent extends ConsoleEvent
{
    private $error;
    private $exitCode;
    public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null)
    {
        parent::__construct($command, $input, $output);
        $this->error = $error;
    }
    public function getError() : \Throwable
    {
        return $this->error;
    }
    public function setError(\Throwable $error) : void
    {
        $this->error = $error;
    }
    public function setExitCode(int $exitCode) : void
    {
        $this->exitCode = $exitCode;
        $r = new \ReflectionProperty($this->error, 'code');
        $r->setAccessible(\true);
        $r->setValue($this->error, $this->exitCode);
    }
    public function getExitCode() : int
    {
        return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Event;

class ConsoleCommandEvent extends ConsoleEvent
{
    public const RETURN_CODE_DISABLED = 113;
    private $commandShouldRun = \true;
    public function disableCommand()
    {
        return $this->commandShouldRun = \false;
    }
    public function enableCommand()
    {
        return $this->commandShouldRun = \true;
    }
    public function commandShouldRun()
    {
        return $this->commandShouldRun;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\Event;

use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\EventDispatcher\Event;
class ConsoleEvent extends Event
{
    protected $command;
    private $input;
    private $output;
    public function __construct(?Command $command, InputInterface $input, OutputInterface $output)
    {
        $this->command = $command;
        $this->input = $input;
        $this->output = $output;
    }
    public function getCommand()
    {
        return $this->command;
    }
    public function getInput()
    {
        return $this->input;
    }
    public function getOutput()
    {
        return $this->output;
    }
}
<?php

namespace Cvphar\Symfony\Component\Console\EventListener;

use Cvphar\Psr\Log\LoggerInterface;
use Cvphar\Symfony\Component\Console\ConsoleEvents;
use Cvphar\Symfony\Component\Console\Event\ConsoleErrorEvent;
use Cvphar\Symfony\Component\Console\Event\ConsoleEvent;
use Cvphar\Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Cvphar\Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ErrorListener implements EventSubscriberInterface
{
    private $logger;
    public function __construct(LoggerInterface $logger = null)
    {
        $this->logger = $logger;
    }
    public function onConsoleError(ConsoleErrorEvent $event)
    {
        if (null === $this->logger) {
            return;
        }
        $error = $event->getError();
        if (!($inputString = $this->getInputString($event))) {
            $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]);
            return;
        }
        $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]);
    }
    public function onConsoleTerminate(ConsoleTerminateEvent $event)
    {
        if (null === $this->logger) {
            return;
        }
        $exitCode = $event->getExitCode();
        if (0 === $exitCode) {
            return;
        }
        if (!($inputString = $this->getInputString($event))) {
            $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]);
            return;
        }
        $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]);
    }
    public static function getSubscribedEvents()
    {
        return [ConsoleEvents::ERROR => ['onConsoleError', -128], ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128]];
    }
    private static function getInputString(ConsoleEvent $event) : ?string
    {
        $commandName = $event->getCommand() ? $event->getCommand()->getName() : null;
        $input = $event->getInput();
        if (\method_exists($input, '__toString')) {
            if ($commandName) {
                return \str_replace(["'{$commandName}'", "\"{$commandName}\""], $commandName, (string) $input);
            }
            return (string) $input;
        }
        return $commandName;
    }
}
<?php

namespace Cvphar;

return array('A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e', 'F' => 'f', 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', 'L' => 'l', 'M' => 'm', 'N' => 'n', 'O' => 'o', 'P' => 'p', 'Q' => 'q', 'R' => 'r', 'S' => 's', 'T' => 't', 'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x', 'Y' => 'y', 'Z' => 'z', 'Ã€' => 'Ã ', 'Ã�' => 'Ã¡', 'Ã‚' => 'Ã¢', 'Ãƒ' => 'Ã£', 'Ã„' => 'Ã¤', 'Ã…' => 'Ã¥', 'Ã†' => 'Ã¦', 'Ã‡' => 'Ã§', 'Ãˆ' => 'Ã¨', 'Ã‰' => 'Ã©', 'ÃŠ' => 'Ãª', 'Ã‹' => 'Ã«', 'ÃŒ' => 'Ã¬', 'Ã�' => 'Ã­', 'ÃŽ' => 'Ã®', 'Ã�' => 'Ã¯', 'Ã�' => 'Ã°', 'Ã‘' => 'Ã±', 'Ã’' => 'Ã²', 'Ã“' => 'Ã³', 'Ã”' => 'Ã´', 'Ã•' => 'Ãµ', 'Ã–' => 'Ã¶', 'Ã˜' => 'Ã¸', 'Ã™' => 'Ã¹', 'Ãš' => 'Ãº', 'Ã›' => 'Ã»', 'Ãœ' => 'Ã¼', 'Ã�' => 'Ã½', 'Ãž' => 'Ã¾', 'Ä€' => 'Ä�', 'Ä‚' => 'Äƒ', 'Ä„' => 'Ä…', 'Ä†' => 'Ä‡', 'Äˆ' => 'Ä‰', 'ÄŠ' => 'Ä‹', 'ÄŒ' => 'Ä�', 'ÄŽ' => 'Ä�', 'Ä�' => 'Ä‘', 'Ä’' => 'Ä“', 'Ä”' => 'Ä•', 'Ä–' => 'Ä—', 'Ä˜' => 'Ä™', 'Äš' => 'Ä›', 'Äœ' => 'Ä�', 'Äž' => 'ÄŸ', 'Ä ' => 'Ä¡', 'Ä¢' => 'Ä£', 'Ä¤' => 'Ä¥', 'Ä¦' => 'Ä§', 'Ä¨' => 'Ä©', 'Äª' => 'Ä«', 'Ä¬' => 'Ä­', 'Ä®' => 'Ä¯', 'Ä°' => 'i', 'Ä²' => 'Ä³', 'Ä´' => 'Äµ', 'Ä¶' => 'Ä·', 'Ä¹' => 'Äº', 'Ä»' => 'Ä¼', 'Ä½' => 'Ä¾', 'Ä¿' => 'Å€', 'Å�' => 'Å‚', 'Åƒ' => 'Å„', 'Å…' => 'Å†', 'Å‡' => 'Åˆ', 'ÅŠ' => 'Å‹', 'ÅŒ' => 'Å�', 'ÅŽ' => 'Å�', 'Å�' => 'Å‘', 'Å’' => 'Å“', 'Å”' => 'Å•', 'Å–' => 'Å—', 'Å˜' => 'Å™', 'Åš' => 'Å›', 'Åœ' => 'Å�', 'Åž' => 'ÅŸ', 'Å ' => 'Å¡', 'Å¢' => 'Å£', 'Å¤' => 'Å¥', 'Å¦' => 'Å§', 'Å¨' => 'Å©', 'Åª' => 'Å«', 'Å¬' => 'Å­', 'Å®' => 'Å¯', 'Å°' => 'Å±', 'Å²' => 'Å³', 'Å´' => 'Åµ', 'Å¶' => 'Å·', 'Å¸' => 'Ã¿', 'Å¹' => 'Åº', 'Å»' => 'Å¼', 'Å½' => 'Å¾', 'Æ�' => 'É“', 'Æ‚' => 'Æƒ', 'Æ„' => 'Æ…', 'Æ†' => 'É”', 'Æ‡' => 'Æˆ', 'Æ‰' => 'É–', 'ÆŠ' => 'É—', 'Æ‹' => 'ÆŒ', 'ÆŽ' => 'Ç�', 'Æ�' => 'É™', 'Æ�' => 'É›', 'Æ‘' => 'Æ’', 'Æ“' => 'É ', 'Æ”' => 'É£', 'Æ–' => 'É©', 'Æ—' => 'É¨', 'Æ˜' => 'Æ™', 'Æœ' => 'É¯', 'Æ�' => 'É²', 'ÆŸ' => 'Éµ', 'Æ ' => 'Æ¡', 'Æ¢' => 'Æ£', 'Æ¤' => 'Æ¥', 'Æ¦' => 'Ê€', 'Æ§' => 'Æ¨', 'Æ©' => 'Êƒ', 'Æ¬' => 'Æ­', 'Æ®' => 'Êˆ', 'Æ¯' => 'Æ°', 'Æ±' => 'ÊŠ', 'Æ²' => 'Ê‹', 'Æ³' => 'Æ´', 'Æµ' => 'Æ¶', 'Æ·' => 'Ê’', 'Æ¸' => 'Æ¹', 'Æ¼' => 'Æ½', 'Ç„' => 'Ç†', 'Ç…' => 'Ç†', 'Ç‡' => 'Ç‰', 'Çˆ' => 'Ç‰', 'ÇŠ' => 'ÇŒ', 'Ç‹' => 'ÇŒ', 'Ç�' => 'ÇŽ', 'Ç�' => 'Ç�', 'Ç‘' => 'Ç’', 'Ç“' => 'Ç”', 'Ç•' => 'Ç–', 'Ç—' => 'Ç˜', 'Ç™' => 'Çš', 'Ç›' => 'Çœ', 'Çž' => 'ÇŸ', 'Ç ' => 'Ç¡', 'Ç¢' => 'Ç£', 'Ç¤' => 'Ç¥', 'Ç¦' => 'Ç§', 'Ç¨' => 'Ç©', 'Çª' => 'Ç«', 'Ç¬' => 'Ç­', 'Ç®' => 'Ç¯', 'Ç±' => 'Ç³', 'Ç²' => 'Ç³', 'Ç´' => 'Çµ', 'Ç¶' => 'Æ•', 'Ç·' => 'Æ¿', 'Ç¸' => 'Ç¹', 'Çº' => 'Ç»', 'Ç¼' => 'Ç½', 'Ç¾' => 'Ç¿', 'È€' => 'È�', 'È‚' => 'Èƒ', 'È„' => 'È…', 'È†' => 'È‡', 'Èˆ' => 'È‰', 'ÈŠ' => 'È‹', 'ÈŒ' => 'È�', 'ÈŽ' => 'È�', 'È�' => 'È‘', 'È’' => 'È“', 'È”' => 'È•', 'È–' => 'È—', 'È˜' => 'È™', 'Èš' => 'È›', 'Èœ' => 'È�', 'Èž' => 'ÈŸ', 'È ' => 'Æž', 'È¢' => 'È£', 'È¤' => 'È¥', 'È¦' => 'È§', 'È¨' => 'È©', 'Èª' => 'È«', 'È¬' => 'È­', 'È®' => 'È¯', 'È°' => 'È±', 'È²' => 'È³', 'Èº' => 'â±¥', 'È»' => 'È¼', 'È½' => 'Æš', 'È¾' => 'â±¦', 'É�' => 'É‚', 'Éƒ' => 'Æ€', 'É„' => 'Ê‰', 'É…' => 'ÊŒ', 'É†' => 'É‡', 'Éˆ' => 'É‰', 'ÉŠ' => 'É‹', 'ÉŒ' => 'É�', 'ÉŽ' => 'É�', 'Í°' => 'Í±', 'Í²' => 'Í³', 'Í¶' => 'Í·', 'Í¿' => 'Ï³', 'Î†' => 'Î¬', 'Îˆ' => 'Î­', 'Î‰' => 'Î®', 'ÎŠ' => 'Î¯', 'ÎŒ' => 'ÏŒ', 'ÎŽ' => 'Ï�', 'Î�' => 'ÏŽ', 'Î‘' => 'Î±', 'Î’' => 'Î²', 'Î“' => 'Î³', 'Î”' => 'Î´', 'Î•' => 'Îµ', 'Î–' => 'Î¶', 'Î—' => 'Î·', 'Î˜' => 'Î¸', 'Î™' => 'Î¹', 'Îš' => 'Îº', 'Î›' => 'Î»', 'Îœ' => 'Î¼', 'Î�' => 'Î½', 'Îž' => 'Î¾', 'ÎŸ' => 'Î¿', 'Î ' => 'Ï€', 'Î¡' => 'Ï�', 'Î£' => 'Ïƒ', 'Î¤' => 'Ï„', 'Î¥' => 'Ï…', 'Î¦' => 'Ï†', 'Î§' => 'Ï‡', 'Î¨' => 'Ïˆ', 'Î©' => 'Ï‰', 'Îª' => 'ÏŠ', 'Î«' => 'Ï‹', 'Ï�' => 'Ï—', 'Ï˜' => 'Ï™', 'Ïš' => 'Ï›', 'Ïœ' => 'Ï�', 'Ïž' => 'ÏŸ', 'Ï ' => 'Ï¡', 'Ï¢' => 'Ï£', 'Ï¤' => 'Ï¥', 'Ï¦' => 'Ï§', 'Ï¨' => 'Ï©', 'Ïª' => 'Ï«', 'Ï¬' => 'Ï­', 'Ï®' => 'Ï¯', 'Ï´' => 'Î¸', 'Ï·' => 'Ï¸', 'Ï¹' => 'Ï²', 'Ïº' => 'Ï»', 'Ï½' => 'Í»', 'Ï¾' => 'Í¼', 'Ï¿' => 'Í½', 'Ð€' => 'Ñ�', 'Ð�' => 'Ñ‘', 'Ð‚' => 'Ñ’', 'Ðƒ' => 'Ñ“', 'Ð„' => 'Ñ”', 'Ð…' => 'Ñ•', 'Ð†' => 'Ñ–', 'Ð‡' => 'Ñ—', 'Ðˆ' => 'Ñ˜', 'Ð‰' => 'Ñ™', 'ÐŠ' => 'Ñš', 'Ð‹' => 'Ñ›', 'ÐŒ' => 'Ñœ', 'Ð�' => 'Ñ�', 'ÐŽ' => 'Ñž', 'Ð�' => 'ÑŸ', 'Ð�' => 'Ð°', 'Ð‘' => 'Ð±', 'Ð’' => 'Ð²', 'Ð“' => 'Ð³', 'Ð”' => 'Ð´', 'Ð•' => 'Ðµ', 'Ð–' => 'Ð¶', 'Ð—' => 'Ð·', 'Ð˜' => 'Ð¸', 'Ð™' => 'Ð¹', 'Ðš' => 'Ðº', 'Ð›' => 'Ð»', 'Ðœ' => 'Ð¼', 'Ð�' => 'Ð½', 'Ðž' => 'Ð¾', 'ÐŸ' => 'Ð¿', 'Ð ' => 'Ñ€', 'Ð¡' => 'Ñ�', 'Ð¢' => 'Ñ‚', 'Ð£' => 'Ñƒ', 'Ð¤' => 'Ñ„', 'Ð¥' => 'Ñ…', 'Ð¦' => 'Ñ†', 'Ð§' => 'Ñ‡', 'Ð¨' => 'Ñˆ', 'Ð©' => 'Ñ‰', 'Ðª' => 'ÑŠ', 'Ð«' => 'Ñ‹', 'Ð¬' => 'ÑŒ', 'Ð­' => 'Ñ�', 'Ð®' => 'ÑŽ', 'Ð¯' => 'Ñ�', 'Ñ ' => 'Ñ¡', 'Ñ¢' => 'Ñ£', 'Ñ¤' => 'Ñ¥', 'Ñ¦' => 'Ñ§', 'Ñ¨' => 'Ñ©', 'Ñª' => 'Ñ«', 'Ñ¬' => 'Ñ­', 'Ñ®' => 'Ñ¯', 'Ñ°' => 'Ñ±', 'Ñ²' => 'Ñ³', 'Ñ´' => 'Ñµ', 'Ñ¶' => 'Ñ·', 'Ñ¸' => 'Ñ¹', 'Ñº' => 'Ñ»', 'Ñ¼' => 'Ñ½', 'Ñ¾' => 'Ñ¿', 'Ò€' => 'Ò�', 'ÒŠ' => 'Ò‹', 'ÒŒ' => 'Ò�', 'ÒŽ' => 'Ò�', 'Ò�' => 'Ò‘', 'Ò’' => 'Ò“', 'Ò”' => 'Ò•', 'Ò–' => 'Ò—', 'Ò˜' => 'Ò™', 'Òš' => 'Ò›', 'Òœ' => 'Ò�', 'Òž' => 'ÒŸ', 'Ò ' => 'Ò¡', 'Ò¢' => 'Ò£', 'Ò¤' => 'Ò¥', 'Ò¦' => 'Ò§', 'Ò¨' => 'Ò©', 'Òª' => 'Ò«', 'Ò¬' => 'Ò­', 'Ò®' => 'Ò¯', 'Ò°' => 'Ò±', 'Ò²' => 'Ò³', 'Ò´' => 'Òµ', 'Ò¶' => 'Ò·', 'Ò¸' => 'Ò¹', 'Òº' => 'Ò»', 'Ò¼' => 'Ò½', 'Ò¾' => 'Ò¿', 'Ó€' => 'Ó�', 'Ó�' => 'Ó‚', 'Óƒ' => 'Ó„', 'Ó…' => 'Ó†', 'Ó‡' => 'Óˆ', 'Ó‰' => 'ÓŠ', 'Ó‹' => 'ÓŒ', 'Ó�' => 'ÓŽ', 'Ó�' => 'Ó‘', 'Ó’' => 'Ó“', 'Ó”' => 'Ó•', 'Ó–' => 'Ó—', 'Ó˜' => 'Ó™', 'Óš' => 'Ó›', 'Óœ' => 'Ó�', 'Óž' => 'ÓŸ', 'Ó ' => 'Ó¡', 'Ó¢' => 'Ó£', 'Ó¤' => 'Ó¥', 'Ó¦' => 'Ó§', 'Ó¨' => 'Ó©', 'Óª' => 'Ó«', 'Ó¬' => 'Ó­', 'Ó®' => 'Ó¯', 'Ó°' => 'Ó±', 'Ó²' => 'Ó³', 'Ó´' => 'Óµ', 'Ó¶' => 'Ó·', 'Ó¸' => 'Ó¹', 'Óº' => 'Ó»', 'Ó¼' => 'Ó½', 'Ó¾' => 'Ó¿', 'Ô€' => 'Ô�', 'Ô‚' => 'Ôƒ', 'Ô„' => 'Ô…', 'Ô†' => 'Ô‡', 'Ôˆ' => 'Ô‰', 'ÔŠ' => 'Ô‹', 'ÔŒ' => 'Ô�', 'ÔŽ' => 'Ô�', 'Ô�' => 'Ô‘', 'Ô’' => 'Ô“', 'Ô”' => 'Ô•', 'Ô–' => 'Ô—', 'Ô˜' => 'Ô™', 'Ôš' => 'Ô›', 'Ôœ' => 'Ô�', 'Ôž' => 'ÔŸ', 'Ô ' => 'Ô¡', 'Ô¢' => 'Ô£', 'Ô¤' => 'Ô¥', 'Ô¦' => 'Ô§', 'Ô¨' => 'Ô©', 'Ôª' => 'Ô«', 'Ô¬' => 'Ô­', 'Ô®' => 'Ô¯', 'Ô±' => 'Õ¡', 'Ô²' => 'Õ¢', 'Ô³' => 'Õ£', 'Ô´' => 'Õ¤', 'Ôµ' => 'Õ¥', 'Ô¶' => 'Õ¦', 'Ô·' => 'Õ§', 'Ô¸' => 'Õ¨', 'Ô¹' => 'Õ©', 'Ôº' => 'Õª', 'Ô»' => 'Õ«', 'Ô¼' => 'Õ¬', 'Ô½' => 'Õ­', 'Ô¾' => 'Õ®', 'Ô¿' => 'Õ¯', 'Õ€' => 'Õ°', 'Õ�' => 'Õ±', 'Õ‚' => 'Õ²', 'Õƒ' => 'Õ³', 'Õ„' => 'Õ´', 'Õ…' => 'Õµ', 'Õ†' => 'Õ¶', 'Õ‡' => 'Õ·', 'Õˆ' => 'Õ¸', 'Õ‰' => 'Õ¹', 'ÕŠ' => 'Õº', 'Õ‹' => 'Õ»', 'ÕŒ' => 'Õ¼', 'Õ�' => 'Õ½', 'ÕŽ' => 'Õ¾', 'Õ�' => 'Õ¿', 'Õ�' => 'Ö€', 'Õ‘' => 'Ö�', 'Õ’' => 'Ö‚', 'Õ“' => 'Öƒ', 'Õ”' => 'Ö„', 'Õ•' => 'Ö…', 'Õ–' => 'Ö†', 'á‚ ' => 'â´€', 'á‚¡' => 'â´�', 'á‚¢' => 'â´‚', 'á‚£' => 'â´ƒ', 'á‚¤' => 'â´„', 'á‚¥' => 'â´…', 'á‚¦' => 'â´†', 'á‚§' => 'â´‡', 'á‚¨' => 'â´ˆ', 'á‚©' => 'â´‰', 'á‚ª' => 'â´Š', 'á‚«' => 'â´‹', 'á‚¬' => 'â´Œ', 'á‚­' => 'â´�', 'á‚®' => 'â´Ž', 'á‚¯' => 'â´�', 'á‚°' => 'â´�', 'á‚±' => 'â´‘', 'á‚²' => 'â´’', 'á‚³' => 'â´“', 'á‚´' => 'â´”', 'á‚µ' => 'â´•', 'á‚¶' => 'â´–', 'á‚·' => 'â´—', 'á‚¸' => 'â´˜', 'á‚¹' => 'â´™', 'á‚º' => 'â´š', 'á‚»' => 'â´›', 'á‚¼' => 'â´œ', 'á‚½' => 'â´�', 'á‚¾' => 'â´ž', 'á‚¿' => 'â´Ÿ', 'áƒ€' => 'â´ ', 'áƒ�' => 'â´¡', 'áƒ‚' => 'â´¢', 'áƒƒ' => 'â´£', 'áƒ„' => 'â´¤', 'áƒ…' => 'â´¥', 'áƒ‡' => 'â´§', 'áƒ�' => 'â´­', 'á¸€' => 'á¸�', 'á¸‚' => 'á¸ƒ', 'á¸„' => 'á¸…', 'á¸†' => 'á¸‡', 'á¸ˆ' => 'á¸‰', 'á¸Š' => 'á¸‹', 'á¸Œ' => 'á¸�', 'á¸Ž' => 'á¸�', 'á¸�' => 'á¸‘', 'á¸’' => 'á¸“', 'á¸”' => 'á¸•', 'á¸–' => 'á¸—', 'á¸˜' => 'á¸™', 'á¸š' => 'á¸›', 'á¸œ' => 'á¸�', 'á¸ž' => 'á¸Ÿ', 'á¸ ' => 'á¸¡', 'á¸¢' => 'á¸£', 'á¸¤' => 'á¸¥', 'á¸¦' => 'á¸§', 'á¸¨' => 'á¸©', 'á¸ª' => 'á¸«', 'á¸¬' => 'á¸­', 'á¸®' => 'á¸¯', 'á¸°' => 'á¸±', 'á¸²' => 'á¸³', 'á¸´' => 'á¸µ', 'á¸¶' => 'á¸·', 'á¸¸' => 'á¸¹', 'á¸º' => 'á¸»', 'á¸¼' => 'á¸½', 'á¸¾' => 'á¸¿', 'á¹€' => 'á¹�', 'á¹‚' => 'á¹ƒ', 'á¹„' => 'á¹…', 'á¹†' => 'á¹‡', 'á¹ˆ' => 'á¹‰', 'á¹Š' => 'á¹‹', 'á¹Œ' => 'á¹�', 'á¹Ž' => 'á¹�', 'á¹�' => 'á¹‘', 'á¹’' => 'á¹“', 'á¹”' => 'á¹•', 'á¹–' => 'á¹—', 'á¹˜' => 'á¹™', 'á¹š' => 'á¹›', 'á¹œ' => 'á¹�', 'á¹ž' => 'á¹Ÿ', 'á¹ ' => 'á¹¡', 'á¹¢' => 'á¹£', 'á¹¤' => 'á¹¥', 'á¹¦' => 'á¹§', 'á¹¨' => 'á¹©', 'á¹ª' => 'á¹«', 'á¹¬' => 'á¹­', 'á¹®' => 'á¹¯', 'á¹°' => 'á¹±', 'á¹²' => 'á¹³', 'á¹´' => 'á¹µ', 'á¹¶' => 'á¹·', 'á¹¸' => 'á¹¹', 'á¹º' => 'á¹»', 'á¹¼' => 'á¹½', 'á¹¾' => 'á¹¿', 'áº€' => 'áº�', 'áº‚' => 'áºƒ', 'áº„' => 'áº…', 'áº†' => 'áº‡', 'áºˆ' => 'áº‰', 'áºŠ' => 'áº‹', 'áºŒ' => 'áº�', 'áºŽ' => 'áº�', 'áº�' => 'áº‘', 'áº’' => 'áº“', 'áº”' => 'áº•', 'áºž' => 'ÃŸ', 'áº ' => 'áº¡', 'áº¢' => 'áº£', 'áº¤' => 'áº¥', 'áº¦' => 'áº§', 'áº¨' => 'áº©', 'áºª' => 'áº«', 'áº¬' => 'áº­', 'áº®' => 'áº¯', 'áº°' => 'áº±', 'áº²' => 'áº³', 'áº´' => 'áºµ', 'áº¶' => 'áº·', 'áº¸' => 'áº¹', 'áºº' => 'áº»', 'áº¼' => 'áº½', 'áº¾' => 'áº¿', 'á»€' => 'á»�', 'á»‚' => 'á»ƒ', 'á»„' => 'á»…', 'á»†' => 'á»‡', 'á»ˆ' => 'á»‰', 'á»Š' => 'á»‹', 'á»Œ' => 'á»�', 'á»Ž' => 'á»�', 'á»�' => 'á»‘', 'á»’' => 'á»“', 'á»”' => 'á»•', 'á»–' => 'á»—', 'á»˜' => 'á»™', 'á»š' => 'á»›', 'á»œ' => 'á»�', 'á»ž' => 'á»Ÿ', 'á» ' => 'á»¡', 'á»¢' => 'á»£', 'á»¤' => 'á»¥', 'á»¦' => 'á»§', 'á»¨' => 'á»©', 'á»ª' => 'á»«', 'á»¬' => 'á»­', 'á»®' => 'á»¯', 'á»°' => 'á»±', 'á»²' => 'á»³', 'á»´' => 'á»µ', 'á»¶' => 'á»·', 'á»¸' => 'á»¹', 'á»º' => 'á»»', 'á»¼' => 'á»½', 'á»¾' => 'á»¿', 'á¼ˆ' => 'á¼€', 'á¼‰' => 'á¼�', 'á¼Š' => 'á¼‚', 'á¼‹' => 'á¼ƒ', 'á¼Œ' => 'á¼„', 'á¼�' => 'á¼…', 'á¼Ž' => 'á¼†', 'á¼�' => 'á¼‡', 'á¼˜' => 'á¼�', 'á¼™' => 'á¼‘', 'á¼š' => 'á¼’', 'á¼›' => 'á¼“', 'á¼œ' => 'á¼”', 'á¼�' => 'á¼•', 'á¼¨' => 'á¼ ', 'á¼©' => 'á¼¡', 'á¼ª' => 'á¼¢', 'á¼«' => 'á¼£', 'á¼¬' => 'á¼¤', 'á¼­' => 'á¼¥', 'á¼®' => 'á¼¦', 'á¼¯' => 'á¼§', 'á¼¸' => 'á¼°', 'á¼¹' => 'á¼±', 'á¼º' => 'á¼²', 'á¼»' => 'á¼³', 'á¼¼' => 'á¼´', 'á¼½' => 'á¼µ', 'á¼¾' => 'á¼¶', 'á¼¿' => 'á¼·', 'á½ˆ' => 'á½€', 'á½‰' => 'á½�', 'á½Š' => 'á½‚', 'á½‹' => 'á½ƒ', 'á½Œ' => 'á½„', 'á½�' => 'á½…', 'á½™' => 'á½‘', 'á½›' => 'á½“', 'á½�' => 'á½•', 'á½Ÿ' => 'á½—', 'á½¨' => 'á½ ', 'á½©' => 'á½¡', 'á½ª' => 'á½¢', 'á½«' => 'á½£', 'á½¬' => 'á½¤', 'á½­' => 'á½¥', 'á½®' => 'á½¦', 'á½¯' => 'á½§', 'á¾ˆ' => 'á¾€', 'á¾‰' => 'á¾�', 'á¾Š' => 'á¾‚', 'á¾‹' => 'á¾ƒ', 'á¾Œ' => 'á¾„', 'á¾�' => 'á¾…', 'á¾Ž' => 'á¾†', 'á¾�' => 'á¾‡', 'á¾˜' => 'á¾�', 'á¾™' => 'á¾‘', 'á¾š' => 'á¾’', 'á¾›' => 'á¾“', 'á¾œ' => 'á¾”', 'á¾�' => 'á¾•', 'á¾ž' => 'á¾–', 'á¾Ÿ' => 'á¾—', 'á¾¨' => 'á¾ ', 'á¾©' => 'á¾¡', 'á¾ª' => 'á¾¢', 'á¾«' => 'á¾£', 'á¾¬' => 'á¾¤', 'á¾­' => 'á¾¥', 'á¾®' => 'á¾¦', 'á¾¯' => 'á¾§', 'á¾¸' => 'á¾°', 'á¾¹' => 'á¾±', 'á¾º' => 'á½°', 'á¾»' => 'á½±', 'á¾¼' => 'á¾³', 'á¿ˆ' => 'á½²', 'á¿‰' => 'á½³', 'á¿Š' => 'á½´', 'á¿‹' => 'á½µ', 'á¿Œ' => 'á¿ƒ', 'á¿˜' => 'á¿�', 'á¿™' => 'á¿‘', 'á¿š' => 'á½¶', 'á¿›' => 'á½·', 'á¿¨' => 'á¿ ', 'á¿©' => 'á¿¡', 'á¿ª' => 'á½º', 'á¿«' => 'á½»', 'á¿¬' => 'á¿¥', 'á¿¸' => 'á½¸', 'á¿¹' => 'á½¹', 'á¿º' => 'á½¼', 'á¿»' => 'á½½', 'á¿¼' => 'á¿³', 'â„¦' => 'Ï‰', 'â„ª' => 'k', 'â„«' => 'Ã¥', 'â„²' => 'â…Ž', 'â… ' => 'â…°', 'â…¡' => 'â…±', 'â…¢' => 'â…²', 'â…£' => 'â…³', 'â…¤' => 'â…´', 'â…¥' => 'â…µ', 'â…¦' => 'â…¶', 'â…§' => 'â…·', 'â…¨' => 'â…¸', 'â…©' => 'â…¹', 'â…ª' => 'â…º', 'â…«' => 'â…»', 'â…¬' => 'â…¼', 'â…­' => 'â…½', 'â…®' => 'â…¾', 'â…¯' => 'â…¿', 'â†ƒ' => 'â†„', 'â’¶' => 'â“�', 'â’·' => 'â“‘', 'â’¸' => 'â“’', 'â’¹' => 'â““', 'â’º' => 'â“”', 'â’»' => 'â“•', 'â’¼' => 'â“–', 'â’½' => 'â“—', 'â’¾' => 'â“˜', 'â’¿' => 'â“™', 'â“€' => 'â“š', 'â“�' => 'â“›', 'â“‚' => 'â“œ', 'â“ƒ' => 'â“�', 'â“„' => 'â“ž', 'â“…' => 'â“Ÿ', 'â“†' => 'â“ ', 'â“‡' => 'â“¡', 'â“ˆ' => 'â“¢', 'â“‰' => 'â“£', 'â“Š' => 'â“¤', 'â“‹' => 'â“¥', 'â“Œ' => 'â“¦', 'â“�' => 'â“§', 'â“Ž' => 'â“¨', 'â“�' => 'â“©', 'â°€' => 'â°°', 'â°�' => 'â°±', 'â°‚' => 'â°²', 'â°ƒ' => 'â°³', 'â°„' => 'â°´', 'â°…' => 'â°µ', 'â°†' => 'â°¶', 'â°‡' => 'â°·', 'â°ˆ' => 'â°¸', 'â°‰' => 'â°¹', 'â°Š' => 'â°º', 'â°‹' => 'â°»', 'â°Œ' => 'â°¼', 'â°�' => 'â°½', 'â°Ž' => 'â°¾', 'â°�' => 'â°¿', 'â°�' => 'â±€', 'â°‘' => 'â±�', 'â°’' => 'â±‚', 'â°“' => 'â±ƒ', 'â°”' => 'â±„', 'â°•' => 'â±…', 'â°–' => 'â±†', 'â°—' => 'â±‡', 'â°˜' => 'â±ˆ', 'â°™' => 'â±‰', 'â°š' => 'â±Š', 'â°›' => 'â±‹', 'â°œ' => 'â±Œ', 'â°�' => 'â±�', 'â°ž' => 'â±Ž', 'â°Ÿ' => 'â±�', 'â° ' => 'â±�', 'â°¡' => 'â±‘', 'â°¢' => 'â±’', 'â°£' => 'â±“', 'â°¤' => 'â±”', 'â°¥' => 'â±•', 'â°¦' => 'â±–', 'â°§' => 'â±—', 'â°¨' => 'â±˜', 'â°©' => 'â±™', 'â°ª' => 'â±š', 'â°«' => 'â±›', 'â°¬' => 'â±œ', 'â°­' => 'â±�', 'â°®' => 'â±ž', 'â± ' => 'â±¡', 'â±¢' => 'É«', 'â±£' => 'áµ½', 'â±¤' => 'É½', 'â±§' => 'â±¨', 'â±©' => 'â±ª', 'â±«' => 'â±¬', 'â±­' => 'É‘', 'â±®' => 'É±', 'â±¯' => 'É�', 'â±°' => 'É’', 'â±²' => 'â±³', 'â±µ' => 'â±¶', 'â±¾' => 'È¿', 'â±¿' => 'É€', 'â²€' => 'â²�', 'â²‚' => 'â²ƒ', 'â²„' => 'â²…', 'â²†' => 'â²‡', 'â²ˆ' => 'â²‰', 'â²Š' => 'â²‹', 'â²Œ' => 'â²�', 'â²Ž' => 'â²�', 'â²�' => 'â²‘', 'â²’' => 'â²“', 'â²”' => 'â²•', 'â²–' => 'â²—', 'â²˜' => 'â²™', 'â²š' => 'â²›', 'â²œ' => 'â²�', 'â²ž' => 'â²Ÿ', 'â² ' => 'â²¡', 'â²¢' => 'â²£', 'â²¤' => 'â²¥', 'â²¦' => 'â²§', 'â²¨' => 'â²©', 'â²ª' => 'â²«', 'â²¬' => 'â²­', 'â²®' => 'â²¯', 'â²°' => 'â²±', 'â²²' => 'â²³', 'â²´' => 'â²µ', 'â²¶' => 'â²·', 'â²¸' => 'â²¹', 'â²º' => 'â²»', 'â²¼' => 'â²½', 'â²¾' => 'â²¿', 'â³€' => 'â³�', 'â³‚' => 'â³ƒ', 'â³„' => 'â³…', 'â³†' => 'â³‡', 'â³ˆ' => 'â³‰', 'â³Š' => 'â³‹', 'â³Œ' => 'â³�', 'â³Ž' => 'â³�', 'â³�' => 'â³‘', 'â³’' => 'â³“', 'â³”' => 'â³•', 'â³–' => 'â³—', 'â³˜' => 'â³™', 'â³š' => 'â³›', 'â³œ' => 'â³�', 'â³ž' => 'â³Ÿ', 'â³ ' => 'â³¡', 'â³¢' => 'â³£', 'â³«' => 'â³¬', 'â³­' => 'â³®', 'â³²' => 'â³³', 'ê™€' => 'ê™�', 'ê™‚' => 'ê™ƒ', 'ê™„' => 'ê™…', 'ê™†' => 'ê™‡', 'ê™ˆ' => 'ê™‰', 'ê™Š' => 'ê™‹', 'ê™Œ' => 'ê™�', 'ê™Ž' => 'ê™�', 'ê™�' => 'ê™‘', 'ê™’' => 'ê™“', 'ê™”' => 'ê™•', 'ê™–' => 'ê™—', 'ê™˜' => 'ê™™', 'ê™š' => 'ê™›', 'ê™œ' => 'ê™�', 'ê™ž' => 'ê™Ÿ', 'ê™ ' => 'ê™¡', 'ê™¢' => 'ê™£', 'ê™¤' => 'ê™¥', 'ê™¦' => 'ê™§', 'ê™¨' => 'ê™©', 'ê™ª' => 'ê™«', 'ê™¬' => 'ê™­', 'êš€' => 'êš�', 'êš‚' => 'êšƒ', 'êš„' => 'êš…', 'êš†' => 'êš‡', 'êšˆ' => 'êš‰', 'êšŠ' => 'êš‹', 'êšŒ' => 'êš�', 'êšŽ' => 'êš�', 'êš�' => 'êš‘', 'êš’' => 'êš“', 'êš”' => 'êš•', 'êš–' => 'êš—', 'êš˜' => 'êš™', 'êšš' => 'êš›', 'êœ¢' => 'êœ£', 'êœ¤' => 'êœ¥', 'êœ¦' => 'êœ§', 'êœ¨' => 'êœ©', 'êœª' => 'êœ«', 'êœ¬' => 'êœ­', 'êœ®' => 'êœ¯', 'êœ²' => 'êœ³', 'êœ´' => 'êœµ', 'êœ¶' => 'êœ·', 'êœ¸' => 'êœ¹', 'êœº' => 'êœ»', 'êœ¼' => 'êœ½', 'êœ¾' => 'êœ¿', 'ê�€' => 'ê��', 'ê�‚' => 'ê�ƒ', 'ê�„' => 'ê�…', 'ê�†' => 'ê�‡', 'ê�ˆ' => 'ê�‰', 'ê�Š' => 'ê�‹', 'ê�Œ' => 'ê��', 'ê�Ž' => 'ê��', 'ê��' => 'ê�‘', 'ê�’' => 'ê�“', 'ê�”' => 'ê�•', 'ê�–' => 'ê�—', 'ê�˜' => 'ê�™', 'ê�š' => 'ê�›', 'ê�œ' => 'ê��', 'ê�ž' => 'ê�Ÿ', 'ê� ' => 'ê�¡', 'ê�¢' => 'ê�£', 'ê�¤' => 'ê�¥', 'ê�¦' => 'ê�§', 'ê�¨' => 'ê�©', 'ê�ª' => 'ê�«', 'ê�¬' => 'ê�­', 'ê�®' => 'ê�¯', 'ê�¹' => 'ê�º', 'ê�»' => 'ê�¼', 'ê�½' => 'áµ¹', 'ê�¾' => 'ê�¿', 'êž€' => 'êž�', 'êž‚' => 'êžƒ', 'êž„' => 'êž…', 'êž†' => 'êž‡', 'êž‹' => 'êžŒ', 'êž�' => 'É¥', 'êž�' => 'êž‘', 'êž’' => 'êž“', 'êž–' => 'êž—', 'êž˜' => 'êž™', 'êžš' => 'êž›', 'êžœ' => 'êž�', 'êžž' => 'êžŸ', 'êž ' => 'êž¡', 'êž¢' => 'êž£', 'êž¤' => 'êž¥', 'êž¦' => 'êž§', 'êž¨' => 'êž©', 'êžª' => 'É¦', 'êž«' => 'Éœ', 'êž¬' => 'É¡', 'êž­' => 'É¬', 'êž°' => 'Êž', 'êž±' => 'Ê‡', 'ï¼¡' => 'ï½�', 'ï¼¢' => 'ï½‚', 'ï¼£' => 'ï½ƒ', 'ï¼¤' => 'ï½„', 'ï¼¥' => 'ï½…', 'ï¼¦' => 'ï½†', 'ï¼§' => 'ï½‡', 'ï¼¨' => 'ï½ˆ', 'ï¼©' => 'ï½‰', 'ï¼ª' => 'ï½Š', 'ï¼«' => 'ï½‹', 'ï¼¬' => 'ï½Œ', 'ï¼­' => 'ï½�', 'ï¼®' => 'ï½Ž', 'ï¼¯' => 'ï½�', 'ï¼°' => 'ï½�', 'ï¼±' => 'ï½‘', 'ï¼²' => 'ï½’', 'ï¼³' => 'ï½“', 'ï¼´' => 'ï½”', 'ï¼µ' => 'ï½•', 'ï¼¶' => 'ï½–', 'ï¼·' => 'ï½—', 'ï¼¸' => 'ï½˜', 'ï¼¹' => 'ï½™', 'ï¼º' => 'ï½š', 'ð��€' => 'ð��¨', 'ð���' => 'ð��©', 'ð��‚' => 'ð��ª', 'ð��ƒ' => 'ð��«', 'ð��„' => 'ð��¬', 'ð��…' => 'ð��­', 'ð��†' => 'ð��®', 'ð��‡' => 'ð��¯', 'ð��ˆ' => 'ð��°', 'ð��‰' => 'ð��±', 'ð��Š' => 'ð��²', 'ð��‹' => 'ð��³', 'ð��Œ' => 'ð��´', 'ð���' => 'ð��µ', 'ð��Ž' => 'ð��¶', 'ð���' => 'ð��·', 'ð���' => 'ð��¸', 'ð��‘' => 'ð��¹', 'ð��’' => 'ð��º', 'ð��“' => 'ð��»', 'ð��”' => 'ð��¼', 'ð��•' => 'ð��½', 'ð��–' => 'ð��¾', 'ð��—' => 'ð��¿', 'ð��˜' => 'ð�‘€', 'ð��™' => 'ð�‘�', 'ð��š' => 'ð�‘‚', 'ð��›' => 'ð�‘ƒ', 'ð��œ' => 'ð�‘„', 'ð���' => 'ð�‘…', 'ð��ž' => 'ð�‘†', 'ð��Ÿ' => 'ð�‘‡', 'ð�� ' => 'ð�‘ˆ', 'ð��¡' => 'ð�‘‰', 'ð��¢' => 'ð�‘Š', 'ð��£' => 'ð�‘‹', 'ð��¤' => 'ð�‘Œ', 'ð��¥' => 'ð�‘�', 'ð��¦' => 'ð�‘Ž', 'ð��§' => 'ð�‘�', 'ð‘¢ ' => 'ð‘£€', 'ð‘¢¡' => 'ð‘£�', 'ð‘¢¢' => 'ð‘£‚', 'ð‘¢£' => 'ð‘£ƒ', 'ð‘¢¤' => 'ð‘£„', 'ð‘¢¥' => 'ð‘£…', 'ð‘¢¦' => 'ð‘£†', 'ð‘¢§' => 'ð‘£‡', 'ð‘¢¨' => 'ð‘£ˆ', 'ð‘¢©' => 'ð‘£‰', 'ð‘¢ª' => 'ð‘£Š', 'ð‘¢«' => 'ð‘£‹', 'ð‘¢¬' => 'ð‘£Œ', 'ð‘¢­' => 'ð‘£�', 'ð‘¢®' => 'ð‘£Ž', 'ð‘¢¯' => 'ð‘£�', 'ð‘¢°' => 'ð‘£�', 'ð‘¢±' => 'ð‘£‘', 'ð‘¢²' => 'ð‘£’', 'ð‘¢³' => 'ð‘£“', 'ð‘¢´' => 'ð‘£”', 'ð‘¢µ' => 'ð‘£•', 'ð‘¢¶' => 'ð‘£–', 'ð‘¢·' => 'ð‘£—', 'ð‘¢¸' => 'ð‘£˜', 'ð‘¢¹' => 'ð‘£™', 'ð‘¢º' => 'ð‘£š', 'ð‘¢»' => 'ð‘£›', 'ð‘¢¼' => 'ð‘£œ', 'ð‘¢½' => 'ð‘£�', 'ð‘¢¾' => 'ð‘£ž', 'ð‘¢¿' => 'ð‘£Ÿ');
<?php

namespace Cvphar;

return '/(?<![\\x{0027}\\x{002E}\\x{003A}\\x{005E}\\x{0060}\\x{00A8}\\x{00AD}\\x{00AF}\\x{00B4}\\x{00B7}\\x{00B8}\\x{02B0}-\\x{02C1}\\x{02C2}-\\x{02C5}\\x{02C6}-\\x{02D1}\\x{02D2}-\\x{02DF}\\x{02E0}-\\x{02E4}\\x{02E5}-\\x{02EB}\\x{02EC}\\x{02ED}\\x{02EE}\\x{02EF}-\\x{02FF}\\x{0300}-\\x{036F}\\x{0374}\\x{0375}\\x{037A}\\x{0384}-\\x{0385}\\x{0387}\\x{0483}-\\x{0487}\\x{0488}-\\x{0489}\\x{0559}\\x{0591}-\\x{05BD}\\x{05BF}\\x{05C1}-\\x{05C2}\\x{05C4}-\\x{05C5}\\x{05C7}\\x{05F4}\\x{0600}-\\x{0605}\\x{0610}-\\x{061A}\\x{061C}\\x{0640}\\x{064B}-\\x{065F}\\x{0670}\\x{06D6}-\\x{06DC}\\x{06DD}\\x{06DF}-\\x{06E4}\\x{06E5}-\\x{06E6}\\x{06E7}-\\x{06E8}\\x{06EA}-\\x{06ED}\\x{070F}\\x{0711}\\x{0730}-\\x{074A}\\x{07A6}-\\x{07B0}\\x{07EB}-\\x{07F3}\\x{07F4}-\\x{07F5}\\x{07FA}\\x{07FD}\\x{0816}-\\x{0819}\\x{081A}\\x{081B}-\\x{0823}\\x{0824}\\x{0825}-\\x{0827}\\x{0828}\\x{0829}-\\x{082D}\\x{0859}-\\x{085B}\\x{08D3}-\\x{08E1}\\x{08E2}\\x{08E3}-\\x{0902}\\x{093A}\\x{093C}\\x{0941}-\\x{0948}\\x{094D}\\x{0951}-\\x{0957}\\x{0962}-\\x{0963}\\x{0971}\\x{0981}\\x{09BC}\\x{09C1}-\\x{09C4}\\x{09CD}\\x{09E2}-\\x{09E3}\\x{09FE}\\x{0A01}-\\x{0A02}\\x{0A3C}\\x{0A41}-\\x{0A42}\\x{0A47}-\\x{0A48}\\x{0A4B}-\\x{0A4D}\\x{0A51}\\x{0A70}-\\x{0A71}\\x{0A75}\\x{0A81}-\\x{0A82}\\x{0ABC}\\x{0AC1}-\\x{0AC5}\\x{0AC7}-\\x{0AC8}\\x{0ACD}\\x{0AE2}-\\x{0AE3}\\x{0AFA}-\\x{0AFF}\\x{0B01}\\x{0B3C}\\x{0B3F}\\x{0B41}-\\x{0B44}\\x{0B4D}\\x{0B56}\\x{0B62}-\\x{0B63}\\x{0B82}\\x{0BC0}\\x{0BCD}\\x{0C00}\\x{0C04}\\x{0C3E}-\\x{0C40}\\x{0C46}-\\x{0C48}\\x{0C4A}-\\x{0C4D}\\x{0C55}-\\x{0C56}\\x{0C62}-\\x{0C63}\\x{0C81}\\x{0CBC}\\x{0CBF}\\x{0CC6}\\x{0CCC}-\\x{0CCD}\\x{0CE2}-\\x{0CE3}\\x{0D00}-\\x{0D01}\\x{0D3B}-\\x{0D3C}\\x{0D41}-\\x{0D44}\\x{0D4D}\\x{0D62}-\\x{0D63}\\x{0DCA}\\x{0DD2}-\\x{0DD4}\\x{0DD6}\\x{0E31}\\x{0E34}-\\x{0E3A}\\x{0E46}\\x{0E47}-\\x{0E4E}\\x{0EB1}\\x{0EB4}-\\x{0EB9}\\x{0EBB}-\\x{0EBC}\\x{0EC6}\\x{0EC8}-\\x{0ECD}\\x{0F18}-\\x{0F19}\\x{0F35}\\x{0F37}\\x{0F39}\\x{0F71}-\\x{0F7E}\\x{0F80}-\\x{0F84}\\x{0F86}-\\x{0F87}\\x{0F8D}-\\x{0F97}\\x{0F99}-\\x{0FBC}\\x{0FC6}\\x{102D}-\\x{1030}\\x{1032}-\\x{1037}\\x{1039}-\\x{103A}\\x{103D}-\\x{103E}\\x{1058}-\\x{1059}\\x{105E}-\\x{1060}\\x{1071}-\\x{1074}\\x{1082}\\x{1085}-\\x{1086}\\x{108D}\\x{109D}\\x{10FC}\\x{135D}-\\x{135F}\\x{1712}-\\x{1714}\\x{1732}-\\x{1734}\\x{1752}-\\x{1753}\\x{1772}-\\x{1773}\\x{17B4}-\\x{17B5}\\x{17B7}-\\x{17BD}\\x{17C6}\\x{17C9}-\\x{17D3}\\x{17D7}\\x{17DD}\\x{180B}-\\x{180D}\\x{180E}\\x{1843}\\x{1885}-\\x{1886}\\x{18A9}\\x{1920}-\\x{1922}\\x{1927}-\\x{1928}\\x{1932}\\x{1939}-\\x{193B}\\x{1A17}-\\x{1A18}\\x{1A1B}\\x{1A56}\\x{1A58}-\\x{1A5E}\\x{1A60}\\x{1A62}\\x{1A65}-\\x{1A6C}\\x{1A73}-\\x{1A7C}\\x{1A7F}\\x{1AA7}\\x{1AB0}-\\x{1ABD}\\x{1ABE}\\x{1B00}-\\x{1B03}\\x{1B34}\\x{1B36}-\\x{1B3A}\\x{1B3C}\\x{1B42}\\x{1B6B}-\\x{1B73}\\x{1B80}-\\x{1B81}\\x{1BA2}-\\x{1BA5}\\x{1BA8}-\\x{1BA9}\\x{1BAB}-\\x{1BAD}\\x{1BE6}\\x{1BE8}-\\x{1BE9}\\x{1BED}\\x{1BEF}-\\x{1BF1}\\x{1C2C}-\\x{1C33}\\x{1C36}-\\x{1C37}\\x{1C78}-\\x{1C7D}\\x{1CD0}-\\x{1CD2}\\x{1CD4}-\\x{1CE0}\\x{1CE2}-\\x{1CE8}\\x{1CED}\\x{1CF4}\\x{1CF8}-\\x{1CF9}\\x{1D2C}-\\x{1D6A}\\x{1D78}\\x{1D9B}-\\x{1DBF}\\x{1DC0}-\\x{1DF9}\\x{1DFB}-\\x{1DFF}\\x{1FBD}\\x{1FBF}-\\x{1FC1}\\x{1FCD}-\\x{1FCF}\\x{1FDD}-\\x{1FDF}\\x{1FED}-\\x{1FEF}\\x{1FFD}-\\x{1FFE}\\x{200B}-\\x{200F}\\x{2018}\\x{2019}\\x{2024}\\x{2027}\\x{202A}-\\x{202E}\\x{2060}-\\x{2064}\\x{2066}-\\x{206F}\\x{2071}\\x{207F}\\x{2090}-\\x{209C}\\x{20D0}-\\x{20DC}\\x{20DD}-\\x{20E0}\\x{20E1}\\x{20E2}-\\x{20E4}\\x{20E5}-\\x{20F0}\\x{2C7C}-\\x{2C7D}\\x{2CEF}-\\x{2CF1}\\x{2D6F}\\x{2D7F}\\x{2DE0}-\\x{2DFF}\\x{2E2F}\\x{3005}\\x{302A}-\\x{302D}\\x{3031}-\\x{3035}\\x{303B}\\x{3099}-\\x{309A}\\x{309B}-\\x{309C}\\x{309D}-\\x{309E}\\x{30FC}-\\x{30FE}\\x{A015}\\x{A4F8}-\\x{A4FD}\\x{A60C}\\x{A66F}\\x{A670}-\\x{A672}\\x{A674}-\\x{A67D}\\x{A67F}\\x{A69C}-\\x{A69D}\\x{A69E}-\\x{A69F}\\x{A6F0}-\\x{A6F1}\\x{A700}-\\x{A716}\\x{A717}-\\x{A71F}\\x{A720}-\\x{A721}\\x{A770}\\x{A788}\\x{A789}-\\x{A78A}\\x{A7F8}-\\x{A7F9}\\x{A802}\\x{A806}\\x{A80B}\\x{A825}-\\x{A826}\\x{A8C4}-\\x{A8C5}\\x{A8E0}-\\x{A8F1}\\x{A8FF}\\x{A926}-\\x{A92D}\\x{A947}-\\x{A951}\\x{A980}-\\x{A982}\\x{A9B3}\\x{A9B6}-\\x{A9B9}\\x{A9BC}\\x{A9CF}\\x{A9E5}\\x{A9E6}\\x{AA29}-\\x{AA2E}\\x{AA31}-\\x{AA32}\\x{AA35}-\\x{AA36}\\x{AA43}\\x{AA4C}\\x{AA70}\\x{AA7C}\\x{AAB0}\\x{AAB2}-\\x{AAB4}\\x{AAB7}-\\x{AAB8}\\x{AABE}-\\x{AABF}\\x{AAC1}\\x{AADD}\\x{AAEC}-\\x{AAED}\\x{AAF3}-\\x{AAF4}\\x{AAF6}\\x{AB5B}\\x{AB5C}-\\x{AB5F}\\x{ABE5}\\x{ABE8}\\x{ABED}\\x{FB1E}\\x{FBB2}-\\x{FBC1}\\x{FE00}-\\x{FE0F}\\x{FE13}\\x{FE20}-\\x{FE2F}\\x{FE52}\\x{FE55}\\x{FEFF}\\x{FF07}\\x{FF0E}\\x{FF1A}\\x{FF3E}\\x{FF40}\\x{FF70}\\x{FF9E}-\\x{FF9F}\\x{FFE3}\\x{FFF9}-\\x{FFFB}\\x{101FD}\\x{102E0}\\x{10376}-\\x{1037A}\\x{10A01}-\\x{10A03}\\x{10A05}-\\x{10A06}\\x{10A0C}-\\x{10A0F}\\x{10A38}-\\x{10A3A}\\x{10A3F}\\x{10AE5}-\\x{10AE6}\\x{10D24}-\\x{10D27}\\x{10F46}-\\x{10F50}\\x{11001}\\x{11038}-\\x{11046}\\x{1107F}-\\x{11081}\\x{110B3}-\\x{110B6}\\x{110B9}-\\x{110BA}\\x{110BD}\\x{110CD}\\x{11100}-\\x{11102}\\x{11127}-\\x{1112B}\\x{1112D}-\\x{11134}\\x{11173}\\x{11180}-\\x{11181}\\x{111B6}-\\x{111BE}\\x{111C9}-\\x{111CC}\\x{1122F}-\\x{11231}\\x{11234}\\x{11236}-\\x{11237}\\x{1123E}\\x{112DF}\\x{112E3}-\\x{112EA}\\x{11300}-\\x{11301}\\x{1133B}-\\x{1133C}\\x{11340}\\x{11366}-\\x{1136C}\\x{11370}-\\x{11374}\\x{11438}-\\x{1143F}\\x{11442}-\\x{11444}\\x{11446}\\x{1145E}\\x{114B3}-\\x{114B8}\\x{114BA}\\x{114BF}-\\x{114C0}\\x{114C2}-\\x{114C3}\\x{115B2}-\\x{115B5}\\x{115BC}-\\x{115BD}\\x{115BF}-\\x{115C0}\\x{115DC}-\\x{115DD}\\x{11633}-\\x{1163A}\\x{1163D}\\x{1163F}-\\x{11640}\\x{116AB}\\x{116AD}\\x{116B0}-\\x{116B5}\\x{116B7}\\x{1171D}-\\x{1171F}\\x{11722}-\\x{11725}\\x{11727}-\\x{1172B}\\x{1182F}-\\x{11837}\\x{11839}-\\x{1183A}\\x{11A01}-\\x{11A0A}\\x{11A33}-\\x{11A38}\\x{11A3B}-\\x{11A3E}\\x{11A47}\\x{11A51}-\\x{11A56}\\x{11A59}-\\x{11A5B}\\x{11A8A}-\\x{11A96}\\x{11A98}-\\x{11A99}\\x{11C30}-\\x{11C36}\\x{11C38}-\\x{11C3D}\\x{11C3F}\\x{11C92}-\\x{11CA7}\\x{11CAA}-\\x{11CB0}\\x{11CB2}-\\x{11CB3}\\x{11CB5}-\\x{11CB6}\\x{11D31}-\\x{11D36}\\x{11D3A}\\x{11D3C}-\\x{11D3D}\\x{11D3F}-\\x{11D45}\\x{11D47}\\x{11D90}-\\x{11D91}\\x{11D95}\\x{11D97}\\x{11EF3}-\\x{11EF4}\\x{16AF0}-\\x{16AF4}\\x{16B30}-\\x{16B36}\\x{16B40}-\\x{16B43}\\x{16F8F}-\\x{16F92}\\x{16F93}-\\x{16F9F}\\x{16FE0}-\\x{16FE1}\\x{1BC9D}-\\x{1BC9E}\\x{1BCA0}-\\x{1BCA3}\\x{1D167}-\\x{1D169}\\x{1D173}-\\x{1D17A}\\x{1D17B}-\\x{1D182}\\x{1D185}-\\x{1D18B}\\x{1D1AA}-\\x{1D1AD}\\x{1D242}-\\x{1D244}\\x{1DA00}-\\x{1DA36}\\x{1DA3B}-\\x{1DA6C}\\x{1DA75}\\x{1DA84}\\x{1DA9B}-\\x{1DA9F}\\x{1DAA1}-\\x{1DAAF}\\x{1E000}-\\x{1E006}\\x{1E008}-\\x{1E018}\\x{1E01B}-\\x{1E021}\\x{1E023}-\\x{1E024}\\x{1E026}-\\x{1E02A}\\x{1E8D0}-\\x{1E8D6}\\x{1E944}-\\x{1E94A}\\x{1F3FB}-\\x{1F3FF}\\x{E0001}\\x{E0020}-\\x{E007F}\\x{E0100}-\\x{E01EF}])(\\pL)(\\pL*+)/u';
<?php

namespace Cvphar;

return array('a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D', 'e' => 'E', 'f' => 'F', 'g' => 'G', 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K', 'l' => 'L', 'm' => 'M', 'n' => 'N', 'o' => 'O', 'p' => 'P', 'q' => 'Q', 'r' => 'R', 's' => 'S', 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W', 'x' => 'X', 'y' => 'Y', 'z' => 'Z', 'Âµ' => 'Îœ', 'Ã ' => 'Ã€', 'Ã¡' => 'Ã�', 'Ã¢' => 'Ã‚', 'Ã£' => 'Ãƒ', 'Ã¤' => 'Ã„', 'Ã¥' => 'Ã…', 'Ã¦' => 'Ã†', 'Ã§' => 'Ã‡', 'Ã¨' => 'Ãˆ', 'Ã©' => 'Ã‰', 'Ãª' => 'ÃŠ', 'Ã«' => 'Ã‹', 'Ã¬' => 'ÃŒ', 'Ã­' => 'Ã�', 'Ã®' => 'ÃŽ', 'Ã¯' => 'Ã�', 'Ã°' => 'Ã�', 'Ã±' => 'Ã‘', 'Ã²' => 'Ã’', 'Ã³' => 'Ã“', 'Ã´' => 'Ã”', 'Ãµ' => 'Ã•', 'Ã¶' => 'Ã–', 'Ã¸' => 'Ã˜', 'Ã¹' => 'Ã™', 'Ãº' => 'Ãš', 'Ã»' => 'Ã›', 'Ã¼' => 'Ãœ', 'Ã½' => 'Ã�', 'Ã¾' => 'Ãž', 'Ã¿' => 'Å¸', 'Ä�' => 'Ä€', 'Äƒ' => 'Ä‚', 'Ä…' => 'Ä„', 'Ä‡' => 'Ä†', 'Ä‰' => 'Äˆ', 'Ä‹' => 'ÄŠ', 'Ä�' => 'ÄŒ', 'Ä�' => 'ÄŽ', 'Ä‘' => 'Ä�', 'Ä“' => 'Ä’', 'Ä•' => 'Ä”', 'Ä—' => 'Ä–', 'Ä™' => 'Ä˜', 'Ä›' => 'Äš', 'Ä�' => 'Äœ', 'ÄŸ' => 'Äž', 'Ä¡' => 'Ä ', 'Ä£' => 'Ä¢', 'Ä¥' => 'Ä¤', 'Ä§' => 'Ä¦', 'Ä©' => 'Ä¨', 'Ä«' => 'Äª', 'Ä­' => 'Ä¬', 'Ä¯' => 'Ä®', 'Ä±' => 'I', 'Ä³' => 'Ä²', 'Äµ' => 'Ä´', 'Ä·' => 'Ä¶', 'Äº' => 'Ä¹', 'Ä¼' => 'Ä»', 'Ä¾' => 'Ä½', 'Å€' => 'Ä¿', 'Å‚' => 'Å�', 'Å„' => 'Åƒ', 'Å†' => 'Å…', 'Åˆ' => 'Å‡', 'Å‹' => 'ÅŠ', 'Å�' => 'ÅŒ', 'Å�' => 'ÅŽ', 'Å‘' => 'Å�', 'Å“' => 'Å’', 'Å•' => 'Å”', 'Å—' => 'Å–', 'Å™' => 'Å˜', 'Å›' => 'Åš', 'Å�' => 'Åœ', 'ÅŸ' => 'Åž', 'Å¡' => 'Å ', 'Å£' => 'Å¢', 'Å¥' => 'Å¤', 'Å§' => 'Å¦', 'Å©' => 'Å¨', 'Å«' => 'Åª', 'Å­' => 'Å¬', 'Å¯' => 'Å®', 'Å±' => 'Å°', 'Å³' => 'Å²', 'Åµ' => 'Å´', 'Å·' => 'Å¶', 'Åº' => 'Å¹', 'Å¼' => 'Å»', 'Å¾' => 'Å½', 'Å¿' => 'S', 'Æ€' => 'Éƒ', 'Æƒ' => 'Æ‚', 'Æ…' => 'Æ„', 'Æˆ' => 'Æ‡', 'ÆŒ' => 'Æ‹', 'Æ’' => 'Æ‘', 'Æ•' => 'Ç¶', 'Æ™' => 'Æ˜', 'Æš' => 'È½', 'Æž' => 'È ', 'Æ¡' => 'Æ ', 'Æ£' => 'Æ¢', 'Æ¥' => 'Æ¤', 'Æ¨' => 'Æ§', 'Æ­' => 'Æ¬', 'Æ°' => 'Æ¯', 'Æ´' => 'Æ³', 'Æ¶' => 'Æµ', 'Æ¹' => 'Æ¸', 'Æ½' => 'Æ¼', 'Æ¿' => 'Ç·', 'Ç…' => 'Ç„', 'Ç†' => 'Ç„', 'Çˆ' => 'Ç‡', 'Ç‰' => 'Ç‡', 'Ç‹' => 'ÇŠ', 'ÇŒ' => 'ÇŠ', 'ÇŽ' => 'Ç�', 'Ç�' => 'Ç�', 'Ç’' => 'Ç‘', 'Ç”' => 'Ç“', 'Ç–' => 'Ç•', 'Ç˜' => 'Ç—', 'Çš' => 'Ç™', 'Çœ' => 'Ç›', 'Ç�' => 'ÆŽ', 'ÇŸ' => 'Çž', 'Ç¡' => 'Ç ', 'Ç£' => 'Ç¢', 'Ç¥' => 'Ç¤', 'Ç§' => 'Ç¦', 'Ç©' => 'Ç¨', 'Ç«' => 'Çª', 'Ç­' => 'Ç¬', 'Ç¯' => 'Ç®', 'Ç²' => 'Ç±', 'Ç³' => 'Ç±', 'Çµ' => 'Ç´', 'Ç¹' => 'Ç¸', 'Ç»' => 'Çº', 'Ç½' => 'Ç¼', 'Ç¿' => 'Ç¾', 'È�' => 'È€', 'Èƒ' => 'È‚', 'È…' => 'È„', 'È‡' => 'È†', 'È‰' => 'Èˆ', 'È‹' => 'ÈŠ', 'È�' => 'ÈŒ', 'È�' => 'ÈŽ', 'È‘' => 'È�', 'È“' => 'È’', 'È•' => 'È”', 'È—' => 'È–', 'È™' => 'È˜', 'È›' => 'Èš', 'È�' => 'Èœ', 'ÈŸ' => 'Èž', 'È£' => 'È¢', 'È¥' => 'È¤', 'È§' => 'È¦', 'È©' => 'È¨', 'È«' => 'Èª', 'È­' => 'È¬', 'È¯' => 'È®', 'È±' => 'È°', 'È³' => 'È²', 'È¼' => 'È»', 'È¿' => 'â±¾', 'É€' => 'â±¿', 'É‚' => 'É�', 'É‡' => 'É†', 'É‰' => 'Éˆ', 'É‹' => 'ÉŠ', 'É�' => 'ÉŒ', 'É�' => 'ÉŽ', 'É�' => 'â±¯', 'É‘' => 'â±­', 'É’' => 'â±°', 'É“' => 'Æ�', 'É”' => 'Æ†', 'É–' => 'Æ‰', 'É—' => 'ÆŠ', 'É™' => 'Æ�', 'É›' => 'Æ�', 'Éœ' => 'êž«', 'É ' => 'Æ“', 'É¡' => 'êž¬', 'É£' => 'Æ”', 'É¥' => 'êž�', 'É¦' => 'êžª', 'É¨' => 'Æ—', 'É©' => 'Æ–', 'É«' => 'â±¢', 'É¬' => 'êž­', 'É¯' => 'Æœ', 'É±' => 'â±®', 'É²' => 'Æ�', 'Éµ' => 'ÆŸ', 'É½' => 'â±¤', 'Ê€' => 'Æ¦', 'Êƒ' => 'Æ©', 'Ê‡' => 'êž±', 'Êˆ' => 'Æ®', 'Ê‰' => 'É„', 'ÊŠ' => 'Æ±', 'Ê‹' => 'Æ²', 'ÊŒ' => 'É…', 'Ê’' => 'Æ·', 'Êž' => 'êž°', 'Í…' => 'Î™', 'Í±' => 'Í°', 'Í³' => 'Í²', 'Í·' => 'Í¶', 'Í»' => 'Ï½', 'Í¼' => 'Ï¾', 'Í½' => 'Ï¿', 'Î¬' => 'Î†', 'Î­' => 'Îˆ', 'Î®' => 'Î‰', 'Î¯' => 'ÎŠ', 'Î±' => 'Î‘', 'Î²' => 'Î’', 'Î³' => 'Î“', 'Î´' => 'Î”', 'Îµ' => 'Î•', 'Î¶' => 'Î–', 'Î·' => 'Î—', 'Î¸' => 'Î˜', 'Î¹' => 'Î™', 'Îº' => 'Îš', 'Î»' => 'Î›', 'Î¼' => 'Îœ', 'Î½' => 'Î�', 'Î¾' => 'Îž', 'Î¿' => 'ÎŸ', 'Ï€' => 'Î ', 'Ï�' => 'Î¡', 'Ï‚' => 'Î£', 'Ïƒ' => 'Î£', 'Ï„' => 'Î¤', 'Ï…' => 'Î¥', 'Ï†' => 'Î¦', 'Ï‡' => 'Î§', 'Ïˆ' => 'Î¨', 'Ï‰' => 'Î©', 'ÏŠ' => 'Îª', 'Ï‹' => 'Î«', 'ÏŒ' => 'ÎŒ', 'Ï�' => 'ÎŽ', 'ÏŽ' => 'Î�', 'Ï�' => 'Î’', 'Ï‘' => 'Î˜', 'Ï•' => 'Î¦', 'Ï–' => 'Î ', 'Ï—' => 'Ï�', 'Ï™' => 'Ï˜', 'Ï›' => 'Ïš', 'Ï�' => 'Ïœ', 'ÏŸ' => 'Ïž', 'Ï¡' => 'Ï ', 'Ï£' => 'Ï¢', 'Ï¥' => 'Ï¤', 'Ï§' => 'Ï¦', 'Ï©' => 'Ï¨', 'Ï«' => 'Ïª', 'Ï­' => 'Ï¬', 'Ï¯' => 'Ï®', 'Ï°' => 'Îš', 'Ï±' => 'Î¡', 'Ï²' => 'Ï¹', 'Ï³' => 'Í¿', 'Ïµ' => 'Î•', 'Ï¸' => 'Ï·', 'Ï»' => 'Ïº', 'Ð°' => 'Ð�', 'Ð±' => 'Ð‘', 'Ð²' => 'Ð’', 'Ð³' => 'Ð“', 'Ð´' => 'Ð”', 'Ðµ' => 'Ð•', 'Ð¶' => 'Ð–', 'Ð·' => 'Ð—', 'Ð¸' => 'Ð˜', 'Ð¹' => 'Ð™', 'Ðº' => 'Ðš', 'Ð»' => 'Ð›', 'Ð¼' => 'Ðœ', 'Ð½' => 'Ð�', 'Ð¾' => 'Ðž', 'Ð¿' => 'ÐŸ', 'Ñ€' => 'Ð ', 'Ñ�' => 'Ð¡', 'Ñ‚' => 'Ð¢', 'Ñƒ' => 'Ð£', 'Ñ„' => 'Ð¤', 'Ñ…' => 'Ð¥', 'Ñ†' => 'Ð¦', 'Ñ‡' => 'Ð§', 'Ñˆ' => 'Ð¨', 'Ñ‰' => 'Ð©', 'ÑŠ' => 'Ðª', 'Ñ‹' => 'Ð«', 'ÑŒ' => 'Ð¬', 'Ñ�' => 'Ð­', 'ÑŽ' => 'Ð®', 'Ñ�' => 'Ð¯', 'Ñ�' => 'Ð€', 'Ñ‘' => 'Ð�', 'Ñ’' => 'Ð‚', 'Ñ“' => 'Ðƒ', 'Ñ”' => 'Ð„', 'Ñ•' => 'Ð…', 'Ñ–' => 'Ð†', 'Ñ—' => 'Ð‡', 'Ñ˜' => 'Ðˆ', 'Ñ™' => 'Ð‰', 'Ñš' => 'ÐŠ', 'Ñ›' => 'Ð‹', 'Ñœ' => 'ÐŒ', 'Ñ�' => 'Ð�', 'Ñž' => 'ÐŽ', 'ÑŸ' => 'Ð�', 'Ñ¡' => 'Ñ ', 'Ñ£' => 'Ñ¢', 'Ñ¥' => 'Ñ¤', 'Ñ§' => 'Ñ¦', 'Ñ©' => 'Ñ¨', 'Ñ«' => 'Ñª', 'Ñ­' => 'Ñ¬', 'Ñ¯' => 'Ñ®', 'Ñ±' => 'Ñ°', 'Ñ³' => 'Ñ²', 'Ñµ' => 'Ñ´', 'Ñ·' => 'Ñ¶', 'Ñ¹' => 'Ñ¸', 'Ñ»' => 'Ñº', 'Ñ½' => 'Ñ¼', 'Ñ¿' => 'Ñ¾', 'Ò�' => 'Ò€', 'Ò‹' => 'ÒŠ', 'Ò�' => 'ÒŒ', 'Ò�' => 'ÒŽ', 'Ò‘' => 'Ò�', 'Ò“' => 'Ò’', 'Ò•' => 'Ò”', 'Ò—' => 'Ò–', 'Ò™' => 'Ò˜', 'Ò›' => 'Òš', 'Ò�' => 'Òœ', 'ÒŸ' => 'Òž', 'Ò¡' => 'Ò ', 'Ò£' => 'Ò¢', 'Ò¥' => 'Ò¤', 'Ò§' => 'Ò¦', 'Ò©' => 'Ò¨', 'Ò«' => 'Òª', 'Ò­' => 'Ò¬', 'Ò¯' => 'Ò®', 'Ò±' => 'Ò°', 'Ò³' => 'Ò²', 'Òµ' => 'Ò´', 'Ò·' => 'Ò¶', 'Ò¹' => 'Ò¸', 'Ò»' => 'Òº', 'Ò½' => 'Ò¼', 'Ò¿' => 'Ò¾', 'Ó‚' => 'Ó�', 'Ó„' => 'Óƒ', 'Ó†' => 'Ó…', 'Óˆ' => 'Ó‡', 'ÓŠ' => 'Ó‰', 'ÓŒ' => 'Ó‹', 'ÓŽ' => 'Ó�', 'Ó�' => 'Ó€', 'Ó‘' => 'Ó�', 'Ó“' => 'Ó’', 'Ó•' => 'Ó”', 'Ó—' => 'Ó–', 'Ó™' => 'Ó˜', 'Ó›' => 'Óš', 'Ó�' => 'Óœ', 'ÓŸ' => 'Óž', 'Ó¡' => 'Ó ', 'Ó£' => 'Ó¢', 'Ó¥' => 'Ó¤', 'Ó§' => 'Ó¦', 'Ó©' => 'Ó¨', 'Ó«' => 'Óª', 'Ó­' => 'Ó¬', 'Ó¯' => 'Ó®', 'Ó±' => 'Ó°', 'Ó³' => 'Ó²', 'Óµ' => 'Ó´', 'Ó·' => 'Ó¶', 'Ó¹' => 'Ó¸', 'Ó»' => 'Óº', 'Ó½' => 'Ó¼', 'Ó¿' => 'Ó¾', 'Ô�' => 'Ô€', 'Ôƒ' => 'Ô‚', 'Ô…' => 'Ô„', 'Ô‡' => 'Ô†', 'Ô‰' => 'Ôˆ', 'Ô‹' => 'ÔŠ', 'Ô�' => 'ÔŒ', 'Ô�' => 'ÔŽ', 'Ô‘' => 'Ô�', 'Ô“' => 'Ô’', 'Ô•' => 'Ô”', 'Ô—' => 'Ô–', 'Ô™' => 'Ô˜', 'Ô›' => 'Ôš', 'Ô�' => 'Ôœ', 'ÔŸ' => 'Ôž', 'Ô¡' => 'Ô ', 'Ô£' => 'Ô¢', 'Ô¥' => 'Ô¤', 'Ô§' => 'Ô¦', 'Ô©' => 'Ô¨', 'Ô«' => 'Ôª', 'Ô­' => 'Ô¬', 'Ô¯' => 'Ô®', 'Õ¡' => 'Ô±', 'Õ¢' => 'Ô²', 'Õ£' => 'Ô³', 'Õ¤' => 'Ô´', 'Õ¥' => 'Ôµ', 'Õ¦' => 'Ô¶', 'Õ§' => 'Ô·', 'Õ¨' => 'Ô¸', 'Õ©' => 'Ô¹', 'Õª' => 'Ôº', 'Õ«' => 'Ô»', 'Õ¬' => 'Ô¼', 'Õ­' => 'Ô½', 'Õ®' => 'Ô¾', 'Õ¯' => 'Ô¿', 'Õ°' => 'Õ€', 'Õ±' => 'Õ�', 'Õ²' => 'Õ‚', 'Õ³' => 'Õƒ', 'Õ´' => 'Õ„', 'Õµ' => 'Õ…', 'Õ¶' => 'Õ†', 'Õ·' => 'Õ‡', 'Õ¸' => 'Õˆ', 'Õ¹' => 'Õ‰', 'Õº' => 'ÕŠ', 'Õ»' => 'Õ‹', 'Õ¼' => 'ÕŒ', 'Õ½' => 'Õ�', 'Õ¾' => 'ÕŽ', 'Õ¿' => 'Õ�', 'Ö€' => 'Õ�', 'Ö�' => 'Õ‘', 'Ö‚' => 'Õ’', 'Öƒ' => 'Õ“', 'Ö„' => 'Õ”', 'Ö…' => 'Õ•', 'Ö†' => 'Õ–', 'áµ¹' => 'ê�½', 'áµ½' => 'â±£', 'á¸�' => 'á¸€', 'á¸ƒ' => 'á¸‚', 'á¸…' => 'á¸„', 'á¸‡' => 'á¸†', 'á¸‰' => 'á¸ˆ', 'á¸‹' => 'á¸Š', 'á¸�' => 'á¸Œ', 'á¸�' => 'á¸Ž', 'á¸‘' => 'á¸�', 'á¸“' => 'á¸’', 'á¸•' => 'á¸”', 'á¸—' => 'á¸–', 'á¸™' => 'á¸˜', 'á¸›' => 'á¸š', 'á¸�' => 'á¸œ', 'á¸Ÿ' => 'á¸ž', 'á¸¡' => 'á¸ ', 'á¸£' => 'á¸¢', 'á¸¥' => 'á¸¤', 'á¸§' => 'á¸¦', 'á¸©' => 'á¸¨', 'á¸«' => 'á¸ª', 'á¸­' => 'á¸¬', 'á¸¯' => 'á¸®', 'á¸±' => 'á¸°', 'á¸³' => 'á¸²', 'á¸µ' => 'á¸´', 'á¸·' => 'á¸¶', 'á¸¹' => 'á¸¸', 'á¸»' => 'á¸º', 'á¸½' => 'á¸¼', 'á¸¿' => 'á¸¾', 'á¹�' => 'á¹€', 'á¹ƒ' => 'á¹‚', 'á¹…' => 'á¹„', 'á¹‡' => 'á¹†', 'á¹‰' => 'á¹ˆ', 'á¹‹' => 'á¹Š', 'á¹�' => 'á¹Œ', 'á¹�' => 'á¹Ž', 'á¹‘' => 'á¹�', 'á¹“' => 'á¹’', 'á¹•' => 'á¹”', 'á¹—' => 'á¹–', 'á¹™' => 'á¹˜', 'á¹›' => 'á¹š', 'á¹�' => 'á¹œ', 'á¹Ÿ' => 'á¹ž', 'á¹¡' => 'á¹ ', 'á¹£' => 'á¹¢', 'á¹¥' => 'á¹¤', 'á¹§' => 'á¹¦', 'á¹©' => 'á¹¨', 'á¹«' => 'á¹ª', 'á¹­' => 'á¹¬', 'á¹¯' => 'á¹®', 'á¹±' => 'á¹°', 'á¹³' => 'á¹²', 'á¹µ' => 'á¹´', 'á¹·' => 'á¹¶', 'á¹¹' => 'á¹¸', 'á¹»' => 'á¹º', 'á¹½' => 'á¹¼', 'á¹¿' => 'á¹¾', 'áº�' => 'áº€', 'áºƒ' => 'áº‚', 'áº…' => 'áº„', 'áº‡' => 'áº†', 'áº‰' => 'áºˆ', 'áº‹' => 'áºŠ', 'áº�' => 'áºŒ', 'áº�' => 'áºŽ', 'áº‘' => 'áº�', 'áº“' => 'áº’', 'áº•' => 'áº”', 'áº›' => 'á¹ ', 'áº¡' => 'áº ', 'áº£' => 'áº¢', 'áº¥' => 'áº¤', 'áº§' => 'áº¦', 'áº©' => 'áº¨', 'áº«' => 'áºª', 'áº­' => 'áº¬', 'áº¯' => 'áº®', 'áº±' => 'áº°', 'áº³' => 'áº²', 'áºµ' => 'áº´', 'áº·' => 'áº¶', 'áº¹' => 'áº¸', 'áº»' => 'áºº', 'áº½' => 'áº¼', 'áº¿' => 'áº¾', 'á»�' => 'á»€', 'á»ƒ' => 'á»‚', 'á»…' => 'á»„', 'á»‡' => 'á»†', 'á»‰' => 'á»ˆ', 'á»‹' => 'á»Š', 'á»�' => 'á»Œ', 'á»�' => 'á»Ž', 'á»‘' => 'á»�', 'á»“' => 'á»’', 'á»•' => 'á»”', 'á»—' => 'á»–', 'á»™' => 'á»˜', 'á»›' => 'á»š', 'á»�' => 'á»œ', 'á»Ÿ' => 'á»ž', 'á»¡' => 'á» ', 'á»£' => 'á»¢', 'á»¥' => 'á»¤', 'á»§' => 'á»¦', 'á»©' => 'á»¨', 'á»«' => 'á»ª', 'á»­' => 'á»¬', 'á»¯' => 'á»®', 'á»±' => 'á»°', 'á»³' => 'á»²', 'á»µ' => 'á»´', 'á»·' => 'á»¶', 'á»¹' => 'á»¸', 'á»»' => 'á»º', 'á»½' => 'á»¼', 'á»¿' => 'á»¾', 'á¼€' => 'á¼ˆ', 'á¼�' => 'á¼‰', 'á¼‚' => 'á¼Š', 'á¼ƒ' => 'á¼‹', 'á¼„' => 'á¼Œ', 'á¼…' => 'á¼�', 'á¼†' => 'á¼Ž', 'á¼‡' => 'á¼�', 'á¼�' => 'á¼˜', 'á¼‘' => 'á¼™', 'á¼’' => 'á¼š', 'á¼“' => 'á¼›', 'á¼”' => 'á¼œ', 'á¼•' => 'á¼�', 'á¼ ' => 'á¼¨', 'á¼¡' => 'á¼©', 'á¼¢' => 'á¼ª', 'á¼£' => 'á¼«', 'á¼¤' => 'á¼¬', 'á¼¥' => 'á¼­', 'á¼¦' => 'á¼®', 'á¼§' => 'á¼¯', 'á¼°' => 'á¼¸', 'á¼±' => 'á¼¹', 'á¼²' => 'á¼º', 'á¼³' => 'á¼»', 'á¼´' => 'á¼¼', 'á¼µ' => 'á¼½', 'á¼¶' => 'á¼¾', 'á¼·' => 'á¼¿', 'á½€' => 'á½ˆ', 'á½�' => 'á½‰', 'á½‚' => 'á½Š', 'á½ƒ' => 'á½‹', 'á½„' => 'á½Œ', 'á½…' => 'á½�', 'á½‘' => 'á½™', 'á½“' => 'á½›', 'á½•' => 'á½�', 'á½—' => 'á½Ÿ', 'á½ ' => 'á½¨', 'á½¡' => 'á½©', 'á½¢' => 'á½ª', 'á½£' => 'á½«', 'á½¤' => 'á½¬', 'á½¥' => 'á½­', 'á½¦' => 'á½®', 'á½§' => 'á½¯', 'á½°' => 'á¾º', 'á½±' => 'á¾»', 'á½²' => 'á¿ˆ', 'á½³' => 'á¿‰', 'á½´' => 'á¿Š', 'á½µ' => 'á¿‹', 'á½¶' => 'á¿š', 'á½·' => 'á¿›', 'á½¸' => 'á¿¸', 'á½¹' => 'á¿¹', 'á½º' => 'á¿ª', 'á½»' => 'á¿«', 'á½¼' => 'á¿º', 'á½½' => 'á¿»', 'á¾€' => 'á¾ˆ', 'á¾�' => 'á¾‰', 'á¾‚' => 'á¾Š', 'á¾ƒ' => 'á¾‹', 'á¾„' => 'á¾Œ', 'á¾…' => 'á¾�', 'á¾†' => 'á¾Ž', 'á¾‡' => 'á¾�', 'á¾�' => 'á¾˜', 'á¾‘' => 'á¾™', 'á¾’' => 'á¾š', 'á¾“' => 'á¾›', 'á¾”' => 'á¾œ', 'á¾•' => 'á¾�', 'á¾–' => 'á¾ž', 'á¾—' => 'á¾Ÿ', 'á¾ ' => 'á¾¨', 'á¾¡' => 'á¾©', 'á¾¢' => 'á¾ª', 'á¾£' => 'á¾«', 'á¾¤' => 'á¾¬', 'á¾¥' => 'á¾­', 'á¾¦' => 'á¾®', 'á¾§' => 'á¾¯', 'á¾°' => 'á¾¸', 'á¾±' => 'á¾¹', 'á¾³' => 'á¾¼', 'á¾¾' => 'Î™', 'á¿ƒ' => 'á¿Œ', 'á¿�' => 'á¿˜', 'á¿‘' => 'á¿™', 'á¿ ' => 'á¿¨', 'á¿¡' => 'á¿©', 'á¿¥' => 'á¿¬', 'á¿³' => 'á¿¼', 'â…Ž' => 'â„²', 'â…°' => 'â… ', 'â…±' => 'â…¡', 'â…²' => 'â…¢', 'â…³' => 'â…£', 'â…´' => 'â…¤', 'â…µ' => 'â…¥', 'â…¶' => 'â…¦', 'â…·' => 'â…§', 'â…¸' => 'â…¨', 'â…¹' => 'â…©', 'â…º' => 'â…ª', 'â…»' => 'â…«', 'â…¼' => 'â…¬', 'â…½' => 'â…­', 'â…¾' => 'â…®', 'â…¿' => 'â…¯', 'â†„' => 'â†ƒ', 'â“�' => 'â’¶', 'â“‘' => 'â’·', 'â“’' => 'â’¸', 'â““' => 'â’¹', 'â“”' => 'â’º', 'â“•' => 'â’»', 'â“–' => 'â’¼', 'â“—' => 'â’½', 'â“˜' => 'â’¾', 'â“™' => 'â’¿', 'â“š' => 'â“€', 'â“›' => 'â“�', 'â“œ' => 'â“‚', 'â“�' => 'â“ƒ', 'â“ž' => 'â“„', 'â“Ÿ' => 'â“…', 'â“ ' => 'â“†', 'â“¡' => 'â“‡', 'â“¢' => 'â“ˆ', 'â“£' => 'â“‰', 'â“¤' => 'â“Š', 'â“¥' => 'â“‹', 'â“¦' => 'â“Œ', 'â“§' => 'â“�', 'â“¨' => 'â“Ž', 'â“©' => 'â“�', 'â°°' => 'â°€', 'â°±' => 'â°�', 'â°²' => 'â°‚', 'â°³' => 'â°ƒ', 'â°´' => 'â°„', 'â°µ' => 'â°…', 'â°¶' => 'â°†', 'â°·' => 'â°‡', 'â°¸' => 'â°ˆ', 'â°¹' => 'â°‰', 'â°º' => 'â°Š', 'â°»' => 'â°‹', 'â°¼' => 'â°Œ', 'â°½' => 'â°�', 'â°¾' => 'â°Ž', 'â°¿' => 'â°�', 'â±€' => 'â°�', 'â±�' => 'â°‘', 'â±‚' => 'â°’', 'â±ƒ' => 'â°“', 'â±„' => 'â°”', 'â±…' => 'â°•', 'â±†' => 'â°–', 'â±‡' => 'â°—', 'â±ˆ' => 'â°˜', 'â±‰' => 'â°™', 'â±Š' => 'â°š', 'â±‹' => 'â°›', 'â±Œ' => 'â°œ', 'â±�' => 'â°�', 'â±Ž' => 'â°ž', 'â±�' => 'â°Ÿ', 'â±�' => 'â° ', 'â±‘' => 'â°¡', 'â±’' => 'â°¢', 'â±“' => 'â°£', 'â±”' => 'â°¤', 'â±•' => 'â°¥', 'â±–' => 'â°¦', 'â±—' => 'â°§', 'â±˜' => 'â°¨', 'â±™' => 'â°©', 'â±š' => 'â°ª', 'â±›' => 'â°«', 'â±œ' => 'â°¬', 'â±�' => 'â°­', 'â±ž' => 'â°®', 'â±¡' => 'â± ', 'â±¥' => 'Èº', 'â±¦' => 'È¾', 'â±¨' => 'â±§', 'â±ª' => 'â±©', 'â±¬' => 'â±«', 'â±³' => 'â±²', 'â±¶' => 'â±µ', 'â²�' => 'â²€', 'â²ƒ' => 'â²‚', 'â²…' => 'â²„', 'â²‡' => 'â²†', 'â²‰' => 'â²ˆ', 'â²‹' => 'â²Š', 'â²�' => 'â²Œ', 'â²�' => 'â²Ž', 'â²‘' => 'â²�', 'â²“' => 'â²’', 'â²•' => 'â²”', 'â²—' => 'â²–', 'â²™' => 'â²˜', 'â²›' => 'â²š', 'â²�' => 'â²œ', 'â²Ÿ' => 'â²ž', 'â²¡' => 'â² ', 'â²£' => 'â²¢', 'â²¥' => 'â²¤', 'â²§' => 'â²¦', 'â²©' => 'â²¨', 'â²«' => 'â²ª', 'â²­' => 'â²¬', 'â²¯' => 'â²®', 'â²±' => 'â²°', 'â²³' => 'â²²', 'â²µ' => 'â²´', 'â²·' => 'â²¶', 'â²¹' => 'â²¸', 'â²»' => 'â²º', 'â²½' => 'â²¼', 'â²¿' => 'â²¾', 'â³�' => 'â³€', 'â³ƒ' => 'â³‚', 'â³…' => 'â³„', 'â³‡' => 'â³†', 'â³‰' => 'â³ˆ', 'â³‹' => 'â³Š', 'â³�' => 'â³Œ', 'â³�' => 'â³Ž', 'â³‘' => 'â³�', 'â³“' => 'â³’', 'â³•' => 'â³”', 'â³—' => 'â³–', 'â³™' => 'â³˜', 'â³›' => 'â³š', 'â³�' => 'â³œ', 'â³Ÿ' => 'â³ž', 'â³¡' => 'â³ ', 'â³£' => 'â³¢', 'â³¬' => 'â³«', 'â³®' => 'â³­', 'â³³' => 'â³²', 'â´€' => 'á‚ ', 'â´�' => 'á‚¡', 'â´‚' => 'á‚¢', 'â´ƒ' => 'á‚£', 'â´„' => 'á‚¤', 'â´…' => 'á‚¥', 'â´†' => 'á‚¦', 'â´‡' => 'á‚§', 'â´ˆ' => 'á‚¨', 'â´‰' => 'á‚©', 'â´Š' => 'á‚ª', 'â´‹' => 'á‚«', 'â´Œ' => 'á‚¬', 'â´�' => 'á‚­', 'â´Ž' => 'á‚®', 'â´�' => 'á‚¯', 'â´�' => 'á‚°', 'â´‘' => 'á‚±', 'â´’' => 'á‚²', 'â´“' => 'á‚³', 'â´”' => 'á‚´', 'â´•' => 'á‚µ', 'â´–' => 'á‚¶', 'â´—' => 'á‚·', 'â´˜' => 'á‚¸', 'â´™' => 'á‚¹', 'â´š' => 'á‚º', 'â´›' => 'á‚»', 'â´œ' => 'á‚¼', 'â´�' => 'á‚½', 'â´ž' => 'á‚¾', 'â´Ÿ' => 'á‚¿', 'â´ ' => 'áƒ€', 'â´¡' => 'áƒ�', 'â´¢' => 'áƒ‚', 'â´£' => 'áƒƒ', 'â´¤' => 'áƒ„', 'â´¥' => 'áƒ…', 'â´§' => 'áƒ‡', 'â´­' => 'áƒ�', 'ê™�' => 'ê™€', 'ê™ƒ' => 'ê™‚', 'ê™…' => 'ê™„', 'ê™‡' => 'ê™†', 'ê™‰' => 'ê™ˆ', 'ê™‹' => 'ê™Š', 'ê™�' => 'ê™Œ', 'ê™�' => 'ê™Ž', 'ê™‘' => 'ê™�', 'ê™“' => 'ê™’', 'ê™•' => 'ê™”', 'ê™—' => 'ê™–', 'ê™™' => 'ê™˜', 'ê™›' => 'ê™š', 'ê™�' => 'ê™œ', 'ê™Ÿ' => 'ê™ž', 'ê™¡' => 'ê™ ', 'ê™£' => 'ê™¢', 'ê™¥' => 'ê™¤', 'ê™§' => 'ê™¦', 'ê™©' => 'ê™¨', 'ê™«' => 'ê™ª', 'ê™­' => 'ê™¬', 'êš�' => 'êš€', 'êšƒ' => 'êš‚', 'êš…' => 'êš„', 'êš‡' => 'êš†', 'êš‰' => 'êšˆ', 'êš‹' => 'êšŠ', 'êš�' => 'êšŒ', 'êš�' => 'êšŽ', 'êš‘' => 'êš�', 'êš“' => 'êš’', 'êš•' => 'êš”', 'êš—' => 'êš–', 'êš™' => 'êš˜', 'êš›' => 'êšš', 'êœ£' => 'êœ¢', 'êœ¥' => 'êœ¤', 'êœ§' => 'êœ¦', 'êœ©' => 'êœ¨', 'êœ«' => 'êœª', 'êœ­' => 'êœ¬', 'êœ¯' => 'êœ®', 'êœ³' => 'êœ²', 'êœµ' => 'êœ´', 'êœ·' => 'êœ¶', 'êœ¹' => 'êœ¸', 'êœ»' => 'êœº', 'êœ½' => 'êœ¼', 'êœ¿' => 'êœ¾', 'ê��' => 'ê�€', 'ê�ƒ' => 'ê�‚', 'ê�…' => 'ê�„', 'ê�‡' => 'ê�†', 'ê�‰' => 'ê�ˆ', 'ê�‹' => 'ê�Š', 'ê��' => 'ê�Œ', 'ê��' => 'ê�Ž', 'ê�‘' => 'ê��', 'ê�“' => 'ê�’', 'ê�•' => 'ê�”', 'ê�—' => 'ê�–', 'ê�™' => 'ê�˜', 'ê�›' => 'ê�š', 'ê��' => 'ê�œ', 'ê�Ÿ' => 'ê�ž', 'ê�¡' => 'ê� ', 'ê�£' => 'ê�¢', 'ê�¥' => 'ê�¤', 'ê�§' => 'ê�¦', 'ê�©' => 'ê�¨', 'ê�«' => 'ê�ª', 'ê�­' => 'ê�¬', 'ê�¯' => 'ê�®', 'ê�º' => 'ê�¹', 'ê�¼' => 'ê�»', 'ê�¿' => 'ê�¾', 'êž�' => 'êž€', 'êžƒ' => 'êž‚', 'êž…' => 'êž„', 'êž‡' => 'êž†', 'êžŒ' => 'êž‹', 'êž‘' => 'êž�', 'êž“' => 'êž’', 'êž—' => 'êž–', 'êž™' => 'êž˜', 'êž›' => 'êžš', 'êž�' => 'êžœ', 'êžŸ' => 'êžž', 'êž¡' => 'êž ', 'êž£' => 'êž¢', 'êž¥' => 'êž¤', 'êž§' => 'êž¦', 'êž©' => 'êž¨', 'ï½�' => 'ï¼¡', 'ï½‚' => 'ï¼¢', 'ï½ƒ' => 'ï¼£', 'ï½„' => 'ï¼¤', 'ï½…' => 'ï¼¥', 'ï½†' => 'ï¼¦', 'ï½‡' => 'ï¼§', 'ï½ˆ' => 'ï¼¨', 'ï½‰' => 'ï¼©', 'ï½Š' => 'ï¼ª', 'ï½‹' => 'ï¼«', 'ï½Œ' => 'ï¼¬', 'ï½�' => 'ï¼­', 'ï½Ž' => 'ï¼®', 'ï½�' => 'ï¼¯', 'ï½�' => 'ï¼°', 'ï½‘' => 'ï¼±', 'ï½’' => 'ï¼²', 'ï½“' => 'ï¼³', 'ï½”' => 'ï¼´', 'ï½•' => 'ï¼µ', 'ï½–' => 'ï¼¶', 'ï½—' => 'ï¼·', 'ï½˜' => 'ï¼¸', 'ï½™' => 'ï¼¹', 'ï½š' => 'ï¼º', 'ð��¨' => 'ð��€', 'ð��©' => 'ð���', 'ð��ª' => 'ð��‚', 'ð��«' => 'ð��ƒ', 'ð��¬' => 'ð��„', 'ð��­' => 'ð��…', 'ð��®' => 'ð��†', 'ð��¯' => 'ð��‡', 'ð��°' => 'ð��ˆ', 'ð��±' => 'ð��‰', 'ð��²' => 'ð��Š', 'ð��³' => 'ð��‹', 'ð��´' => 'ð��Œ', 'ð��µ' => 'ð���', 'ð��¶' => 'ð��Ž', 'ð��·' => 'ð���', 'ð��¸' => 'ð���', 'ð��¹' => 'ð��‘', 'ð��º' => 'ð��’', 'ð��»' => 'ð��“', 'ð��¼' => 'ð��”', 'ð��½' => 'ð��•', 'ð��¾' => 'ð��–', 'ð��¿' => 'ð��—', 'ð�‘€' => 'ð��˜', 'ð�‘�' => 'ð��™', 'ð�‘‚' => 'ð��š', 'ð�‘ƒ' => 'ð��›', 'ð�‘„' => 'ð��œ', 'ð�‘…' => 'ð���', 'ð�‘†' => 'ð��ž', 'ð�‘‡' => 'ð��Ÿ', 'ð�‘ˆ' => 'ð�� ', 'ð�‘‰' => 'ð��¡', 'ð�‘Š' => 'ð��¢', 'ð�‘‹' => 'ð��£', 'ð�‘Œ' => 'ð��¤', 'ð�‘�' => 'ð��¥', 'ð�‘Ž' => 'ð��¦', 'ð�‘�' => 'ð��§', 'ð‘£€' => 'ð‘¢ ', 'ð‘£�' => 'ð‘¢¡', 'ð‘£‚' => 'ð‘¢¢', 'ð‘£ƒ' => 'ð‘¢£', 'ð‘£„' => 'ð‘¢¤', 'ð‘£…' => 'ð‘¢¥', 'ð‘£†' => 'ð‘¢¦', 'ð‘£‡' => 'ð‘¢§', 'ð‘£ˆ' => 'ð‘¢¨', 'ð‘£‰' => 'ð‘¢©', 'ð‘£Š' => 'ð‘¢ª', 'ð‘£‹' => 'ð‘¢«', 'ð‘£Œ' => 'ð‘¢¬', 'ð‘£�' => 'ð‘¢­', 'ð‘£Ž' => 'ð‘¢®', 'ð‘£�' => 'ð‘¢¯', 'ð‘£�' => 'ð‘¢°', 'ð‘£‘' => 'ð‘¢±', 'ð‘£’' => 'ð‘¢²', 'ð‘£“' => 'ð‘¢³', 'ð‘£”' => 'ð‘¢´', 'ð‘£•' => 'ð‘¢µ', 'ð‘£–' => 'ð‘¢¶', 'ð‘£—' => 'ð‘¢·', 'ð‘£˜' => 'ð‘¢¸', 'ð‘£™' => 'ð‘¢¹', 'ð‘£š' => 'ð‘¢º', 'ð‘£›' => 'ð‘¢»', 'ð‘£œ' => 'ð‘¢¼', 'ð‘£�' => 'ð‘¢½', 'ð‘£ž' => 'ð‘¢¾', 'ð‘£Ÿ' => 'ð‘¢¿');
<?php

namespace Cvphar\Symfony\Polyfill\Mbstring;

final class Mbstring
{
    const MB_CASE_FOLD = \PHP_INT_MAX;
    private static $encodingList = array('ASCII', 'UTF-8');
    private static $language = 'neutral';
    private static $internalEncoding = 'UTF-8';
    private static $caseFold = array(array('Âµ', 'Å¿', "Í…", 'Ï‚', "Ï�", "Ï‘", "Ï•", "Ï–", "Ï°", "Ï±", "Ïµ", "áº›", "á¾¾"), array('Î¼', 's', 'Î¹', 'Ïƒ', 'Î²', 'Î¸', 'Ï†', 'Ï€', 'Îº', 'Ï�', 'Îµ', "á¹¡", 'Î¹'));
    public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
    {
        if (\is_array($fromEncoding) || \false !== \strpos($fromEncoding, ',')) {
            $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
        } else {
            $fromEncoding = self::getEncoding($fromEncoding);
        }
        $toEncoding = self::getEncoding($toEncoding);
        if ('BASE64' === $fromEncoding) {
            $s = \base64_decode($s);
            $fromEncoding = $toEncoding;
        }
        if ('BASE64' === $toEncoding) {
            return \base64_encode($s);
        }
        if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) {
            if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) {
                $fromEncoding = 'Windows-1252';
            }
            if ('UTF-8' !== $fromEncoding) {
                $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s);
            }
            return \preg_replace_callback('/[\\x80-\\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
        }
        if ('HTML-ENTITIES' === $fromEncoding) {
            $s = \html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
            $fromEncoding = 'UTF-8';
        }
        return \iconv($fromEncoding, $toEncoding . '//IGNORE', $s);
    }
    public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
    {
        $vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
        $ok = \true;
        \array_walk_recursive($vars, function (&$v) use(&$ok, $toEncoding, $fromEncoding) {
            if (\false === ($v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding))) {
                $ok = \false;
            }
        });
        return $ok ? $fromEncoding : \false;
    }
    public static function mb_decode_mimeheader($s)
    {
        return \iconv_mime_decode($s, 2, self::$internalEncoding);
    }
    public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
    {
        \trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING);
    }
    public static function mb_decode_numericentity($s, $convmap, $encoding = null)
    {
        if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
            \trigger_error('mb_decode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
            return null;
        }
        if (!\is_array($convmap) || !$convmap) {
            return \false;
        }
        if (null !== $encoding && !\is_scalar($encoding)) {
            \trigger_error('mb_decode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
            return '';
        }
        $s = (string) $s;
        if ('' === $s) {
            return '';
        }
        $encoding = self::getEncoding($encoding);
        if ('UTF-8' === $encoding) {
            $encoding = null;
            if (!\preg_match('//u', $s)) {
                $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
            }
        } else {
            $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
        }
        $cnt = \floor(\count($convmap) / 4) * 4;
        for ($i = 0; $i < $cnt; $i += 4) {
            $convmap[$i] += $convmap[$i + 2];
            $convmap[$i + 1] += $convmap[$i + 2];
        }
        $s = \preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use($cnt, $convmap) {
            $c = isset($m[2]) ? (int) \hexdec($m[2]) : $m[1];
            for ($i = 0; $i < $cnt; $i += 4) {
                if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) {
                    return Mbstring::mb_chr($c - $convmap[$i + 2]);
                }
            }
            return $m[0];
        }, $s);
        if (null === $encoding) {
            return $s;
        }
        return \iconv('UTF-8', $encoding . '//IGNORE', $s);
    }
    public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = \false)
    {
        if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
            \trigger_error('mb_encode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
            return null;
        }
        if (!\is_array($convmap) || !$convmap) {
            return \false;
        }
        if (null !== $encoding && !\is_scalar($encoding)) {
            \trigger_error('mb_encode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
            return null;
        }
        if (null !== $is_hex && !\is_scalar($is_hex)) {
            \trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, ' . \gettype($s) . ' given', \E_USER_WARNING);
            return null;
        }
        $s = (string) $s;
        if ('' === $s) {
            return '';
        }
        $encoding = self::getEncoding($encoding);
        if ('UTF-8' === $encoding) {
            $encoding = null;
            if (!\preg_match('//u', $s)) {
                $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
            }
        } else {
            $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
        }
        static $ulenMask = array("\xc0" => 2, "\xd0" => 2, "\xe0" => 3, "\xf0" => 4);
        $cnt = \floor(\count($convmap) / 4) * 4;
        $i = 0;
        $len = \strlen($s);
        $result = '';
        while ($i < $len) {
            $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xf0"];
            $uchr = \substr($s, $i, $ulen);
            $i += $ulen;
            $c = self::mb_ord($uchr);
            for ($j = 0; $j < $cnt; $j += 4) {
                if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) {
                    $cOffset = $c + $convmap[$j + 2] & $convmap[$j + 3];
                    $result .= $is_hex ? \sprintf('&#x%X;', $cOffset) : '&#' . $cOffset . ';';
                    continue 2;
                }
            }
            $result .= $uchr;
        }
        if (null === $encoding) {
            return $result;
        }
        return \iconv('UTF-8', $encoding . '//IGNORE', $result);
    }
    public static function mb_convert_case($s, $mode, $encoding = null)
    {
        $s = (string) $s;
        if ('' === $s) {
            return '';
        }
        $encoding = self::getEncoding($encoding);
        if ('UTF-8' === $encoding) {
            $encoding = null;
            if (!\preg_match('//u', $s)) {
                $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
            }
        } else {
            $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
        }
        if (\MB_CASE_TITLE == $mode) {
            static $titleRegexp = null;
            if (null === $titleRegexp) {
                $titleRegexp = self::getData('titleCaseRegexp');
            }
            $s = \preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s);
        } else {
            if (\MB_CASE_UPPER == $mode) {
                static $upper = null;
                if (null === $upper) {
                    $upper = self::getData('upperCase');
                }
                $map = $upper;
            } else {
                if (self::MB_CASE_FOLD === $mode) {
                    $s = \str_replace(self::$caseFold[0], self::$caseFold[1], $s);
                }
                static $lower = null;
                if (null === $lower) {
                    $lower = self::getData('lowerCase');
                }
                $map = $lower;
            }
            static $ulenMask = array("\xc0" => 2, "\xd0" => 2, "\xe0" => 3, "\xf0" => 4);
            $i = 0;
            $len = \strlen($s);
            while ($i < $len) {
                $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xf0"];
                $uchr = \substr($s, $i, $ulen);
                $i += $ulen;
                if (isset($map[$uchr])) {
                    $uchr = $map[$uchr];
                    $nlen = \strlen($uchr);
                    if ($nlen == $ulen) {
                        $nlen = $i;
                        do {
                            $s[--$nlen] = $uchr[--$ulen];
                        } while ($ulen);
                    } else {
                        $s = \substr_replace($s, $uchr, $i - $ulen, $ulen);
                        $len += $nlen - $ulen;
                        $i += $nlen - $ulen;
                    }
                }
            }
        }
        if (null === $encoding) {
            return $s;
        }
        return \iconv('UTF-8', $encoding . '//IGNORE', $s);
    }
    public static function mb_internal_encoding($encoding = null)
    {
        if (null === $encoding) {
            return self::$internalEncoding;
        }
        $encoding = self::getEncoding($encoding);
        if ('UTF-8' === $encoding || \false !== @\iconv($encoding, $encoding, ' ')) {
            self::$internalEncoding = $encoding;
            return \true;
        }
        return \false;
    }
    public static function mb_language($lang = null)
    {
        if (null === $lang) {
            return self::$language;
        }
        switch ($lang = \strtolower($lang)) {
            case 'uni':
            case 'neutral':
                self::$language = $lang;
                return \true;
        }
        return \false;
    }
    public static function mb_list_encodings()
    {
        return array('UTF-8');
    }
    public static function mb_encoding_aliases($encoding)
    {
        switch (\strtoupper($encoding)) {
            case 'UTF8':
            case 'UTF-8':
                return array('utf8');
        }
        return \false;
    }
    public static function mb_check_encoding($var = null, $encoding = null)
    {
        if (null === $encoding) {
            if (null === $var) {
                return \false;
            }
            $encoding = self::$internalEncoding;
        }
        return self::mb_detect_encoding($var, array($encoding)) || \false !== @\iconv($encoding, $encoding, $var);
    }
    public static function mb_detect_encoding($str, $encodingList = null, $strict = \false)
    {
        if (null === $encodingList) {
            $encodingList = self::$encodingList;
        } else {
            if (!\is_array($encodingList)) {
                $encodingList = \array_map('trim', \explode(',', $encodingList));
            }
            $encodingList = \array_map('strtoupper', $encodingList);
        }
        foreach ($encodingList as $enc) {
            switch ($enc) {
                case 'ASCII':
                    if (!\preg_match('/[\\x80-\\xFF]/', $str)) {
                        return $enc;
                    }
                    break;
                case 'UTF8':
                case 'UTF-8':
                    if (\preg_match('//u', $str)) {
                        return 'UTF-8';
                    }
                    break;
                default:
                    if (0 === \strncmp($enc, 'ISO-8859-', 9)) {
                        return $enc;
                    }
            }
        }
        return \false;
    }
    public static function mb_detect_order($encodingList = null)
    {
        if (null === $encodingList) {
            return self::$encodingList;
        }
        if (!\is_array($encodingList)) {
            $encodingList = \array_map('trim', \explode(',', $encodingList));
        }
        $encodingList = \array_map('strtoupper', $encodingList);
        foreach ($encodingList as $enc) {
            switch ($enc) {
                default:
                    if (\strncmp($enc, 'ISO-8859-', 9)) {
                        return \false;
                    }
                case 'ASCII':
                case 'UTF8':
                case 'UTF-8':
            }
        }
        self::$encodingList = $encodingList;
        return \true;
    }
    public static function mb_strlen($s, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('CP850' === $encoding || 'ASCII' === $encoding) {
            return \strlen($s);
        }
        return @\iconv_strlen($s, $encoding);
    }
    public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('CP850' === $encoding || 'ASCII' === $encoding) {
            return \strpos($haystack, $needle, $offset);
        }
        $needle = (string) $needle;
        if ('' === $needle) {
            \trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING);
            return \false;
        }
        return \iconv_strpos($haystack, $needle, $offset, $encoding);
    }
    public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('CP850' === $encoding || 'ASCII' === $encoding) {
            return \strrpos($haystack, $needle, $offset);
        }
        if ($offset != (int) $offset) {
            $offset = 0;
        } elseif ($offset = (int) $offset) {
            if ($offset < 0) {
                if (0 > ($offset += self::mb_strlen($needle))) {
                    $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
                }
                $offset = 0;
            } else {
                $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
            }
        }
        $pos = \iconv_strrpos($haystack, $needle, $encoding);
        return \false !== $pos ? $offset + $pos : \false;
    }
    public static function mb_str_split($string, $split_length = 1, $encoding = null)
    {
        if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) {
            \trigger_error('mb_str_split() expects parameter 1 to be string, ' . \gettype($string) . ' given', \E_USER_WARNING);
            return null;
        }
        if (1 > ($split_length = (int) $split_length)) {
            \trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
            return \false;
        }
        if (null === $encoding) {
            $encoding = \mb_internal_encoding();
        }
        if ('UTF-8' === ($encoding = self::getEncoding($encoding))) {
            $rx = '/(';
            while (65535 < $split_length) {
                $rx .= '.{65535}';
                $split_length -= 65535;
            }
            $rx .= '.{' . $split_length . '})/us';
            return \preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
        }
        $result = array();
        $length = \mb_strlen($string, $encoding);
        for ($i = 0; $i < $length; $i += $split_length) {
            $result[] = \mb_substr($string, $i, $split_length, $encoding);
        }
        return $result;
    }
    public static function mb_strtolower($s, $encoding = null)
    {
        return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
    }
    public static function mb_strtoupper($s, $encoding = null)
    {
        return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
    }
    public static function mb_substitute_character($c = null)
    {
        if (0 === \strcasecmp($c, 'none')) {
            return \true;
        }
        return null !== $c ? \false : 'none';
    }
    public static function mb_substr($s, $start, $length = null, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('CP850' === $encoding || 'ASCII' === $encoding) {
            return (string) \substr($s, $start, null === $length ? 2147483647 : $length);
        }
        if ($start < 0) {
            $start = \iconv_strlen($s, $encoding) + $start;
            if ($start < 0) {
                $start = 0;
            }
        }
        if (null === $length) {
            $length = 2147483647;
        } elseif ($length < 0) {
            $length = \iconv_strlen($s, $encoding) + $length - $start;
            if ($length < 0) {
                return '';
            }
        }
        return (string) \iconv_substr($s, $start, $length, $encoding);
    }
    public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
    {
        $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
        $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
        return self::mb_strpos($haystack, $needle, $offset, $encoding);
    }
    public static function mb_stristr($haystack, $needle, $part = \false, $encoding = null)
    {
        $pos = self::mb_stripos($haystack, $needle, 0, $encoding);
        return self::getSubpart($pos, $part, $haystack, $encoding);
    }
    public static function mb_strrchr($haystack, $needle, $part = \false, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('CP850' === $encoding || 'ASCII' === $encoding) {
            return \strrchr($haystack, $needle, $part);
        }
        $needle = self::mb_substr($needle, 0, 1, $encoding);
        $pos = \iconv_strrpos($haystack, $needle, $encoding);
        return self::getSubpart($pos, $part, $haystack, $encoding);
    }
    public static function mb_strrichr($haystack, $needle, $part = \false, $encoding = null)
    {
        $needle = self::mb_substr($needle, 0, 1, $encoding);
        $pos = self::mb_strripos($haystack, $needle, $encoding);
        return self::getSubpart($pos, $part, $haystack, $encoding);
    }
    public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
    {
        $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
        $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
        return self::mb_strrpos($haystack, $needle, $offset, $encoding);
    }
    public static function mb_strstr($haystack, $needle, $part = \false, $encoding = null)
    {
        $pos = \strpos($haystack, $needle);
        if (\false === $pos) {
            return \false;
        }
        if ($part) {
            return \substr($haystack, 0, $pos);
        }
        return \substr($haystack, $pos);
    }
    public static function mb_get_info($type = 'all')
    {
        $info = array('internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\\+xml)', 'func_overload' => 0, 'func_overload_list' => 'no overload', 'mail_charset' => 'UTF-8', 'mail_header_encoding' => 'BASE64', 'mail_body_encoding' => 'BASE64', 'illegal_chars' => 0, 'encoding_translation' => 'Off', 'language' => self::$language, 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off');
        if ('all' === $type) {
            return $info;
        }
        if (isset($info[$type])) {
            return $info[$type];
        }
        return \false;
    }
    public static function mb_http_input($type = '')
    {
        return \false;
    }
    public static function mb_http_output($encoding = null)
    {
        return null !== $encoding ? 'pass' === $encoding : 'pass';
    }
    public static function mb_strwidth($s, $encoding = null)
    {
        $encoding = self::getEncoding($encoding);
        if ('UTF-8' !== $encoding) {
            $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
        }
        $s = \preg_replace('/[\\x{1100}-\\x{115F}\\x{2329}\\x{232A}\\x{2E80}-\\x{303E}\\x{3040}-\\x{A4CF}\\x{AC00}-\\x{D7A3}\\x{F900}-\\x{FAFF}\\x{FE10}-\\x{FE19}\\x{FE30}-\\x{FE6F}\\x{FF00}-\\x{FF60}\\x{FFE0}-\\x{FFE6}\\x{20000}-\\x{2FFFD}\\x{30000}-\\x{3FFFD}]/u', '', $s, -1, $wide);
        return ($wide << 1) + \iconv_strlen($s, 'UTF-8');
    }
    public static function mb_substr_count($haystack, $needle, $encoding = null)
    {
        return \substr_count($haystack, $needle);
    }
    public static function mb_output_handler($contents, $status)
    {
        return $contents;
    }
    public static function mb_chr($code, $encoding = null)
    {
        if (0x80 > ($code %= 0x200000)) {
            $s = \chr($code);
        } elseif (0x800 > $code) {
            $s = \chr(0xc0 | $code >> 6) . \chr(0x80 | $code & 0x3f);
        } elseif (0x10000 > $code) {
            $s = \chr(0xe0 | $code >> 12) . \chr(0x80 | $code >> 6 & 0x3f) . \chr(0x80 | $code & 0x3f);
        } else {
            $s = \chr(0xf0 | $code >> 18) . \chr(0x80 | $code >> 12 & 0x3f) . \chr(0x80 | $code >> 6 & 0x3f) . \chr(0x80 | $code & 0x3f);
        }
        if ('UTF-8' !== ($encoding = self::getEncoding($encoding))) {
            $s = \mb_convert_encoding($s, $encoding, 'UTF-8');
        }
        return $s;
    }
    public static function mb_ord($s, $encoding = null)
    {
        if ('UTF-8' !== ($encoding = self::getEncoding($encoding))) {
            $s = \mb_convert_encoding($s, 'UTF-8', $encoding);
        }
        if (1 === \strlen($s)) {
            return \ord($s);
        }
        $code = ($s = \unpack('C*', \substr($s, 0, 4))) ? $s[1] : 0;
        if (0xf0 <= $code) {
            return ($code - 0xf0 << 18) + ($s[2] - 0x80 << 12) + ($s[3] - 0x80 << 6) + $s[4] - 0x80;
        }
        if (0xe0 <= $code) {
            return ($code - 0xe0 << 12) + ($s[2] - 0x80 << 6) + $s[3] - 0x80;
        }
        if (0xc0 <= $code) {
            return ($code - 0xc0 << 6) + $s[2] - 0x80;
        }
        return $code;
    }
    private static function getSubpart($pos, $part, $haystack, $encoding)
    {
        if (\false === $pos) {
            return \false;
        }
        if ($part) {
            return self::mb_substr($haystack, 0, $pos, $encoding);
        }
        return self::mb_substr($haystack, $pos, null, $encoding);
    }
    private static function html_encoding_callback(array $m)
    {
        $i = 1;
        $entities = '';
        $m = \unpack('C*', \htmlentities($m[0], \ENT_COMPAT, 'UTF-8'));
        while (isset($m[$i])) {
            if (0x80 > $m[$i]) {
                $entities .= \chr($m[$i++]);
                continue;
            }
            if (0xf0 <= $m[$i]) {
                $c = ($m[$i++] - 0xf0 << 18) + ($m[$i++] - 0x80 << 12) + ($m[$i++] - 0x80 << 6) + $m[$i++] - 0x80;
            } elseif (0xe0 <= $m[$i]) {
                $c = ($m[$i++] - 0xe0 << 12) + ($m[$i++] - 0x80 << 6) + $m[$i++] - 0x80;
            } else {
                $c = ($m[$i++] - 0xc0 << 6) + $m[$i++] - 0x80;
            }
            $entities .= '&#' . $c . ';';
        }
        return $entities;
    }
    private static function title_case(array $s)
    {
        return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8') . self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8');
    }
    private static function getData($file)
    {
        if (\file_exists($file = __DIR__ . '/Resources/unidata/' . $file . '.php')) {
            return require $file;
        }
        return \false;
    }
    private static function getEncoding($encoding)
    {
        if (null === $encoding) {
            return self::$internalEncoding;
        }
        if ('UTF-8' === $encoding) {
            return 'UTF-8';
        }
        $encoding = \strtoupper($encoding);
        if ('8BIT' === $encoding || 'BINARY' === $encoding) {
            return 'CP850';
        }
        if ('UTF8' === $encoding) {
            return 'UTF-8';
        }
        return $encoding;
    }
}
<?php

namespace Cvphar;

use Cvphar\Symfony\Polyfill\Mbstring as p;
if (!\defined('MB_CASE_UPPER')) {
    \define('MB_CASE_UPPER', 0);
    \define('MB_CASE_LOWER', 1);
    \define('MB_CASE_TITLE', 2);
}
if (!\function_exists('mb_strlen')) {
    function mb_convert_encoding($s, $to, $from = null)
    {
        return p\Mbstring::mb_convert_encoding($s, $to, $from);
    }
    function mb_decode_mimeheader($s)
    {
        return p\Mbstring::mb_decode_mimeheader($s);
    }
    function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null)
    {
        return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent);
    }
    function mb_decode_numericentity($s, $convmap, $enc = null)
    {
        return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc);
    }
    function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = \false)
    {
        return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex);
    }
    function mb_convert_case($s, $mode, $enc = null)
    {
        return p\Mbstring::mb_convert_case($s, $mode, $enc);
    }
    function mb_internal_encoding($enc = null)
    {
        return p\Mbstring::mb_internal_encoding($enc);
    }
    function mb_language($lang = null)
    {
        return p\Mbstring::mb_language($lang);
    }
    function mb_list_encodings()
    {
        return p\Mbstring::mb_list_encodings();
    }
    function mb_encoding_aliases($encoding)
    {
        return p\Mbstring::mb_encoding_aliases($encoding);
    }
    function mb_check_encoding($var = null, $encoding = null)
    {
        return p\Mbstring::mb_check_encoding($var, $encoding);
    }
    function mb_detect_encoding($str, $encodingList = null, $strict = \false)
    {
        return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict);
    }
    function mb_detect_order($encodingList = null)
    {
        return p\Mbstring::mb_detect_order($encodingList);
    }
    function mb_parse_str($s, &$result = array())
    {
        \parse_str($s, $result);
    }
    function mb_strlen($s, $enc = null)
    {
        return p\Mbstring::mb_strlen($s, $enc);
    }
    function mb_strpos($s, $needle, $offset = 0, $enc = null)
    {
        return p\Mbstring::mb_strpos($s, $needle, $offset, $enc);
    }
    function mb_strtolower($s, $enc = null)
    {
        return p\Mbstring::mb_strtolower($s, $enc);
    }
    function mb_strtoupper($s, $enc = null)
    {
        return p\Mbstring::mb_strtoupper($s, $enc);
    }
    function mb_substitute_character($char = null)
    {
        return p\Mbstring::mb_substitute_character($char);
    }
    function mb_substr($s, $start, $length = 2147483647, $enc = null)
    {
        return p\Mbstring::mb_substr($s, $start, $length, $enc);
    }
    function mb_stripos($s, $needle, $offset = 0, $enc = null)
    {
        return p\Mbstring::mb_stripos($s, $needle, $offset, $enc);
    }
    function mb_stristr($s, $needle, $part = \false, $enc = null)
    {
        return p\Mbstring::mb_stristr($s, $needle, $part, $enc);
    }
    function mb_strrchr($s, $needle, $part = \false, $enc = null)
    {
        return p\Mbstring::mb_strrchr($s, $needle, $part, $enc);
    }
    function mb_strrichr($s, $needle, $part = \false, $enc = null)
    {
        return p\Mbstring::mb_strrichr($s, $needle, $part, $enc);
    }
    function mb_strripos($s, $needle, $offset = 0, $enc = null)
    {
        return p\Mbstring::mb_strripos($s, $needle, $offset, $enc);
    }
    function mb_strrpos($s, $needle, $offset = 0, $enc = null)
    {
        return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc);
    }
    function mb_strstr($s, $needle, $part = \false, $enc = null)
    {
        return p\Mbstring::mb_strstr($s, $needle, $part, $enc);
    }
    function mb_get_info($type = 'all')
    {
        return p\Mbstring::mb_get_info($type);
    }
    function mb_http_output($enc = null)
    {
        return p\Mbstring::mb_http_output($enc);
    }
    function mb_strwidth($s, $enc = null)
    {
        return p\Mbstring::mb_strwidth($s, $enc);
    }
    function mb_substr_count($haystack, $needle, $enc = null)
    {
        return p\Mbstring::mb_substr_count($haystack, $needle, $enc);
    }
    function mb_output_handler($contents, $status)
    {
        return p\Mbstring::mb_output_handler($contents, $status);
    }
    function mb_http_input($type = '')
    {
        return p\Mbstring::mb_http_input($type);
    }
    function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
    {
        return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f);
    }
}
if (!\function_exists('mb_chr')) {
    function mb_ord($s, $enc = null)
    {
        return p\Mbstring::mb_ord($s, $enc);
    }
    function mb_chr($code, $enc = null)
    {
        return p\Mbstring::mb_chr($code, $enc);
    }
    function mb_scrub($s, $enc = null)
    {
        $enc = null === $enc ? \mb_internal_encoding() : $enc;
        return \mb_convert_encoding($s, $enc, $enc);
    }
}
if (!\function_exists('mb_str_split')) {
    function mb_str_split($string, $split_length = 1, $encoding = null)
    {
        return p\Mbstring::mb_str_split($string, $split_length, $encoding);
    }
}
<?php

namespace Civi\Cv;

use Cvphar\LesserEvil\ShellVerbosityIsEvil;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\ConsoleOutputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Application extends \Cvphar\Symfony\Component\Console\Application
{
    protected $deprecatedAliases = ['debug:container' => 'service', 'debug:event-dispatcher' => 'event'];
    public static function version() : ?string
    {
        $marker = '@' . 'package' . '_' . 'version' . '@';
        $v = 'v0.3.48';
        if ($v !== $marker) {
            return $v;
        }
        if (\is_callable('Cvphar\\Composer\\InstalledVersions::getVersion')) {
            $v = \Cvphar\Composer\InstalledVersions::getVersion('civicrm/cv');
            if (\preg_match('/^\\d+\\.\\d+/', $v)) {
                return $v;
            }
        }
        return NULL;
    }
    public static function main($binDir)
    {
        $application = new \Civi\Cv\Application('cv', static::version() ?? 'UNKNOWN');
        $application->setAutoExit(\FALSE);
        \Civi\Cv\ErrorHandler::pushHandler();
        $result = $application->run();
        \Civi\Cv\ErrorHandler::popHandler();
        exit($result);
    }
    public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
    {
        parent::__construct($name, $version);
        $this->setCatchExceptions(\TRUE);
        $this->addCommands($this->createCommands());
    }
    protected function getDefaultInputDefinition()
    {
        $definition = parent::getDefaultInputDefinition();
        $definition->addOption(new InputOption('cwd', NULL, InputOption::VALUE_REQUIRED, 'If specified, use the given directory as working directory.'));
        return $definition;
    }
    public function doRun(InputInterface $input, OutputInterface $output)
    {
        \Civi\Cv\ErrorHandler::setRenderer(function ($e) use($output) {
            if ($output instanceof ConsoleOutputInterface) {
                $this->renderThrowable($e, $output->getErrorOutput());
            } else {
                $this->renderThrowable($e, $output);
            }
        });
        $workingDir = $input->getParameterOption(array('--cwd'));
        if (\FALSE !== $workingDir && '' !== $workingDir) {
            if (!\is_dir($workingDir)) {
                throw new \RuntimeException("Invalid working directory specified, {$workingDir} does not exist.");
            }
            if (!\chdir($workingDir)) {
                throw new \RuntimeException("Failed to use directory specified, {$workingDir} as working directory.");
            }
        }
        return parent::doRun($input, $output);
    }
    public function createCommands($context = 'default')
    {
        $commands = array();
        $commands[] = new \Civi\Cv\Command\ApiCommand();
        $commands[] = new \Civi\Cv\Command\Api4Command();
        $commands[] = new \Civi\Cv\Command\ApiBatchCommand();
        $commands[] = new \Civi\Cv\Command\AngularModuleListCommand();
        $commands[] = new \Civi\Cv\Command\AngularHtmlListCommand();
        $commands[] = new \Civi\Cv\Command\AngularHtmlShowCommand();
        $commands[] = new \Civi\Cv\Command\DebugContainerCommand();
        $commands[] = new \Civi\Cv\Command\DebugDispatcherCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionDownloadCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionEnableCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionDisableCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionListCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionUninstallCommand();
        $commands[] = new \Civi\Cv\Command\ExtensionUpgradeDbCommand();
        $commands[] = new \Civi\Cv\Command\FillCommand();
        $commands[] = new \Civi\Cv\Command\FlushCommand();
        $commands[] = new \Civi\Cv\Command\PathCommand();
        $commands[] = new \Civi\Cv\Command\PipeCommand();
        $commands[] = new \Civi\Cv\Command\SettingSetCommand();
        $commands[] = new \Civi\Cv\Command\SettingGetCommand();
        $commands[] = new \Civi\Cv\Command\SettingRevertCommand();
        $commands[] = new \Civi\Cv\Command\SqlCliCommand();
        $commands[] = new \Civi\Cv\Command\ShowCommand();
        $commands[] = new \Civi\Cv\Command\UpgradeDbCommand();
        $commands[] = new \Civi\Cv\Command\HttpCommand();
        $commands[] = new \Civi\Cv\Command\UrlCommand();
        if ($context !== 'repl') {
            $commands[] = new \Civi\Cv\Command\BootCommand();
            $commands[] = new \Civi\Cv\Command\CliCommand();
            $commands[] = new \Civi\Cv\Command\EvalCommand();
            $commands[] = new \Civi\Cv\Command\ScriptCommand();
            $commands[] = new \Civi\Cv\Command\CoreCheckReqCommand();
            $commands[] = new \Civi\Cv\Command\CoreInstallCommand();
            $commands[] = new \Civi\Cv\Command\CoreUninstallCommand();
            $commands[] = new \Cvphar\Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand();
        }
        return $commands;
    }
    protected function configureIO(InputInterface $input, OutputInterface $output)
    {
        ShellVerbosityIsEvil::doWithoutEvil(function () use($input, $output) {
            parent::configureIO($input, $output);
        });
    }
    public function find($name)
    {
        if (isset($this->deprecatedAliases[$name])) {
            \fprintf(\STDERR, "WARNING: Subcommand \"%s\" has been renamed to \"%s\". In the future, the old name may stop working.\n\n", $name, $this->deprecatedAliases[$name]);
            $name = $this->deprecatedAliases[$name];
        }
        return parent::find($name);
    }
}
<?php

namespace Civi\Cv;

class Encoder
{
    public static function getDefaultFormat($fallback = 'json-pretty')
    {
        $e = \getenv('CV_OUTPUT');
        return $e ? $e : $fallback;
    }
    public static function getTabularFormats()
    {
        $result = self::getFormats();
        \array_unshift($result, 'list');
        \array_unshift($result, 'csv');
        \array_unshift($result, 'table');
        return $result;
    }
    public static function getFormats()
    {
        return array('none', 'pretty', 'php', 'php-data', 'json-pretty', 'json-strict', 'serialize', 'shell');
    }
    public static function encode($data, $format)
    {
        switch ($format) {
            case 'none':
                return '';
            case 'pretty':
                return \print_r($data, 1);
            case 'php':
                return \var_export($data, 1);
            case 'php-data':
                return \var_export(static::preferArray($data), 1);
            case 'json-pretty':
                $jsonOptions = (\defined('JSON_PRETTY_PRINT') ? \JSON_PRETTY_PRINT : 0) | (\defined('JSON_UNESCAPED_SLASHES') ? \JSON_UNESCAPED_SLASHES : 0);
                return \json_encode($data, $jsonOptions);
            case 'json':
            case 'json-strict':
                return \json_encode($data);
            case 'serialize':
                return \serialize($data);
            case 'shell':
                $data = static::preferArray($data);
                if (\is_scalar($data)) {
                    return \escapeshellarg($data);
                } elseif (\is_array($data)) {
                    $tree = \Civi\Cv\Util\ArrayUtil::implodeTree('_', $data);
                    $buf = '';
                    foreach ($tree as $k => $v) {
                        $buf .= \sprintf("%s=%s\n", $k, \escapeshellarg($v));
                    }
                    return $buf;
                } else {
                    return \gettype($data);
                }
            case 'civicrm.settings.php':
                $buf = '';
                foreach ($data as $row) {
                    if (!isset($row['scope']) || !isset($row['key']) || !isset($row['value'])) {
                        throw new \RuntimeException("Cannot format result for civicrm.settings.php. Must have columns: scope,key,value");
                    }
                    $scope = \strpos($row['scope'], 'contact') !== \FALSE ? 'contact' : 'domain';
                    $buf .= \sprintf("\$civicrm_setting[%s][%s] = %s;\n", \var_export($scope, \TRUE), \var_export($row['key'], \TRUE), \var_export($row['value'], \TRUE));
                }
                return $buf;
            default:
                throw new \RuntimeException('Unknown output format');
        }
    }
    private static function preferArray($data)
    {
        if (\is_object($data)) {
            if ($data instanceof \JsonSerializable || $data instanceof \stdClass) {
                $data = \json_decode(\json_encode($data), \TRUE);
            }
        }
        return $data;
    }
}
<?php

namespace Civi\Cv\Util;

use Civi\Cv\CmsBootstrap;
use Civi\Cv\Log\SymfonyConsoleLogger;
use Civi\Setup\DbUtil;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
\define('CV_SETUP_PROTOCOL_VER', '1.0');
trait SetupCommandTrait
{
    use \Civi\Cv\Util\BootTrait;
    public function configureSetupOptions()
    {
        $this->addOption('settings-path', NULL, InputOption::VALUE_OPTIONAL, 'The path to CivCRM settings file. (If omitted, use CV_SETUP_SETTINGS or try to use default.)')->addOption('setup-path', NULL, InputOption::VALUE_OPTIONAL, 'The path to CivCRM-Setup source tree. (If omitted, read CV_SETUP_PATH or scan common defaults.)')->addOption('src-path', NULL, InputOption::VALUE_OPTIONAL, 'The path to CivCRM-Core source tree. (If omitted, read CV_SETUP_SRC_PATH or scan common defaults.)')->addOption('plugin-path', NULL, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'A directory with extra installer plugins')->addOption('cms-base-url', NULL, InputOption::VALUE_OPTIONAL, 'The URL of the CMS (If omitted, attempt to autodetect.)')->addOption('lang', NULL, InputOption::VALUE_OPTIONAL, 'Specify the installation language')->addOption('comp', NULL, InputOption::VALUE_OPTIONAL, 'Comma-separated list of CiviCRM components to enable. (Ex: CiviEvent,CiviContribute,CiviMember,CiviMail,CiviReport)')->addOption('ext', NULL, InputOption::VALUE_OPTIONAL, 'Comma-separated list of CiviCRM extensions to enable. (Ex: org.civicrm.shoreditch,org.civicrm.flexmailer)')->addOption('db', NULL, InputOption::VALUE_OPTIONAL, 'Database credentials for primary Civi database.')->addOption('model', 'm', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Set additional field in the model. Key-value pair.');
        return $this;
    }
    protected function bootSetupSubsystem(InputInterface $input, OutputInterface $output, $defaultOutputOptions = 0)
    {
        $b = $this->_boot_cms_only($input, $output);
        $setupOptions = array();
        $setupOptions['cms'] = $b->getBootedCmsType();
        $possibleSrcPaths = [$input->getOption('src-path'), \getenv('CV_SETUP_SRC_PATH'), \implode(\DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'sites', 'all', 'modules', 'civicrm']), \implode(\DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'wp-content', 'plugins', 'civicrm', 'civicrm']), \implode(\DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'modules', 'civicrm']), \implode(\DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'vendor', 'civicrm', 'civicrm-core']), \implode(\DIRECTORY_SEPARATOR, [\dirname($b->getBootedCmsPath()), 'vendor', 'civicrm', 'civicrm-core'])];
        if ($b->getBootedCmsType() === 'Standalone') {
            $possibleSrcPaths[] = \implode(\DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'web', 'core']);
            $possibleSrcPaths[] = \dirname($b->getBootedCmsPath());
        }
        $setupOptions['srcPath'] = \Civi\Cv\Util\ArrayUtil::pickFirst($possibleSrcPaths, 'file_exists');
        if ($setupOptions['srcPath']) {
            $output->writeln(\sprintf('<info>Found code for <comment>%s</comment> in <comment>%s</comment></info>', 'civicrm-core', $setupOptions['srcPath']), $defaultOutputOptions);
        } else {
            $this->printPathError($output, 'civicrm-core', '--src-path', 'CV_SETUP_SRC_PATH', $possibleSrcPaths);
            throw new \Exception("Failed to locate civicrm-core");
        }
        $possibleSetupPaths = [$input->getOption('setup-path'), \getenv('CV_SETUP_PATH'), \implode(\DIRECTORY_SEPARATOR, [$setupOptions['srcPath'], 'vendor', 'civicrm', 'civicrm-setup']), \implode(\DIRECTORY_SEPARATOR, [$setupOptions['srcPath'], 'packages', 'civicrm-setup']), \implode(\DIRECTORY_SEPARATOR, [$setupOptions['srcPath'], 'setup']), \implode(\DIRECTORY_SEPARATOR, [\dirname($setupOptions['srcPath']), 'civicrm-setup']), \implode(\DIRECTORY_SEPARATOR, ['/usr', 'local', 'share', 'civicrm-setup'])];
        $setupOptions['setupPath'] = \Civi\Cv\Util\ArrayUtil::pickFirst($possibleSetupPaths, 'file_exists');
        if ($setupOptions['setupPath']) {
            $output->writeln(\sprintf('<info>Found code for <comment>%s</comment> in <comment>%s</comment></info>', 'civicrm-setup', $setupOptions['setupPath']), $defaultOutputOptions);
        } else {
            $this->printPathError($output, 'civicrm-setup', '--setup-path', 'CV_SETUP_PATH', $possibleSetupPaths);
            throw new \Exception("Failed to locate civicrm-setup");
        }
        if ($input->getOption('cms-base-url')) {
            $setupOptions['cmsBaseUrl'] = $input->getOption('cms-base-url');
        }
        $pluginPaths = $this->buildPluginPaths($b, $input->getOption('plugin-path'));
        $pluginCallback = function ($pluginFiles) use($input, $output, $pluginPaths) {
            $pluginUpdates = [];
            foreach ($pluginPaths as $pluginDir) {
                foreach (['*.civi-setup.php', '*/*.civi-setup.php'] as $pattern) {
                    foreach ((array) \glob("{$pluginDir}/{$pattern}") as $file) {
                        $key = \substr($file, \strlen($pluginDir) + 1);
                        $key = \preg_replace('/\\.civi-setup\\.php$/', '', $key);
                        $pluginUpdates[$key] = $file;
                    }
                }
            }
            if (!empty($pluginUpdates)) {
                $output->writeln(\sprintf('<info>Found extra plugin(s) <comment>%s</comment> in <comment>%s</comment></info>', \implode(' ', \array_keys($pluginUpdates)), \implode(' ', $pluginPaths)));
                $pluginFiles = \array_merge($pluginFiles, $pluginUpdates);
            }
            \ksort($pluginFiles);
            return $pluginFiles;
        };
        $this->setupAutoloaders($setupOptions['srcPath'], $setupOptions['setupPath']);
        $c = new \ReflectionClass('Civi\\Setup');
        if (\substr($c->getFileName(), 0, \strlen($setupOptions['setupPath'])) !== $setupOptions['setupPath']) {
            $effSetupPath = \dirname(\dirname($c->getFileName()));
            $output->writeln(\sprintf('Warning: Autoloader prioritized code from <comment>%s</comment> instead of requested <comment>%s</comment>.', $effSetupPath, $setupOptions['setupPath']));
        }
        \Civi\Setup::assertProtocolCompatibility(CV_SETUP_PROTOCOL_VER);
        \Civi\Setup::init($setupOptions, $pluginCallback, new \Civi\Cv\Util\PsrLogger(new SymfonyConsoleLogger('Setup', $output)));
        $setup = \Civi\Setup::instance();
        $setup->getModel()->settingsPath = \Civi\Cv\Util\ArrayUtil::pickFirst([$input->getOption('settings-path'), \getenv('CV_SETUP_SETTINGS'), $setup->getModel()->settingsPath]);
        $setup->getModel()->cmsBaseUrl = \Civi\Cv\Util\ArrayUtil::pickFirst([$input->getOption('cms-base-url'), $setup->getModel()->cmsBaseUrl]);
        if ($input->getOption('db')) {
            $model = $setup->getModel();
            $model->db = DbUtil::parseDsn($input->getOption('db'));
            if ($model->cms === 'Standalone' && empty($model->cmsDb)) {
                $model->cmsDb = $setup->getModel()->db;
            }
        }
        if ($input->getOption('lang')) {
            $setup->getModel()->lang = $input->getOption('lang');
        }
        if ($input->getOption('comp')) {
            $setup->getModel()->components = \explode(',', $input->getOption('comp'));
        }
        if ($input->getOption('ext')) {
            $setup->getModel()->extensions = \array_unique(\array_merge($setup->getModel()->extensions, \explode(',', $input->getOption('ext'))));
        }
        foreach ($input->getOption('model') as $modelExpr) {
            $obj = $setup->getModel();
            list($key, $value) = \explode('=', $modelExpr, 2);
            $keyPath = \explode('.', $key);
            $firstKey = \array_shift($keyPath);
            if ($keyPath) {
                \Civi\Cv\Util\ArrayUtil::pathSet($obj->{$firstKey}, $keyPath, $value);
            } else {
                $obj->{$firstKey} = $value;
            }
        }
        return $setup;
    }
    protected function setupAutoloaders($srcPath, $setupPath)
    {
        $setupAL = \implode(\DIRECTORY_SEPARATOR, [$setupPath, 'civicrm-setup-autoload.php']);
        if (\file_exists($setupAL)) {
            require_once $setupAL;
        }
        $coreAL = \implode(\DIRECTORY_SEPARATOR, [$srcPath, 'CRM', 'Core', 'ClassLoader.php']);
        if (!\file_exists($coreAL)) {
            throw new \Exception("Failed to load {$coreAL}");
        }
        require_once $coreAL;
        \CRM_Core_ClassLoader::singleton()->register();
    }
    protected function printPathError(OutputInterface $output, $name, $optName, $envName, $possibleSrcPaths)
    {
        $output->writeln(\sprintf('<error>Failed to locate %s</error>', $name));
        $output->writeln(\sprintf('<info>Consider setting <comment>%s</comment>, setting <comment>%s</comment>, or placing it one of these folders:</info>', $optName, $envName));
        foreach ($possibleSrcPaths as $path) {
            if ($path) {
                $output->writeln(\sprintf('<info> * <comment>%s</comment></info>', $path));
            }
        }
    }
    protected function buildPluginPaths(CmsBootstrap $b, array $requestedPaths) : array
    {
        if ($b->getBootedCmsType() === 'Standalone') {
            $requestedPaths[] = $b->getBootedCmsPath() . '/setup/plugins';
        }
        return \array_map(function (string $pluginDir) {
            return \rtrim($pluginDir, '/' . \DIRECTORY_SEPARATOR);
        }, $requestedPaths);
    }
}
<?php

namespace Civi\Cv\Util;

class Rand
{
    public static function createName()
    {
        if (\function_exists('random_bytes')) {
            $hex = \bin2hex(\random_bytes(16));
            return \base_convert($hex, 16, 36);
        } elseif (\function_exists('openssl_random_pseudo_bytes')) {
            $hex = \bin2hex(\openssl_random_pseudo_bytes(16));
            return \base_convert($hex, 16, 36);
        } else {
            $pow16 = \pow(2, 16);
            $buf = '';
            for ($i = 0; $i < 8; $i++) {
                $buf .= '-' . \mt_rand(0, $pow16);
            }
            return \base_convert(\md5($buf), 16, 36);
        }
    }
}
<?php

namespace Civi\Cv\Util;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait SettingTrait
{
    protected function parseSettingParams(InputInterface $input, \Civi\Core\SettingsBag $settingsBag, array $meta) : array
    {
        $args = $input->getArgument('key=value');
        switch ($input->getOption('in')) {
            case 'args':
                $p = new \Civi\Cv\Util\SettingArgParser($settingsBag, $meta);
                $params = $p->parse($args);
                break;
            case 'json':
                $json = \stream_get_contents(\STDIN);
                $params = empty($json) ? [] : \json_decode($json, \TRUE);
                break;
            default:
                throw new \RuntimeException('Unknown input format');
        }
        return $params;
    }
    protected function findSettings(string $scope) : array
    {
        if ($scope === 'domain') {
            return [$scope => \Civi::settings()];
        }
        if ($scope === 'contact') {
            return [$scope => \Civi::contactSettings()];
        }
        $parts = \explode(':', $scope);
        if ($parts[0] === 'contact' && \is_numeric($parts[1])) {
            return [$scope => \Civi::contactSettings($parts[1])];
        }
        if ($parts[0] === 'domain' && \is_numeric($parts[1])) {
            return [$scope => \Civi::settings($parts[1])];
        }
        if ($parts[0] === 'domain' && $parts[1] === '*') {
            $domainIds = \CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_domain')->fetchMap('id', 'id');
            $result = [];
            foreach ($domainIds as $domainId) {
                $result["domain:{$domainId}"] = \Civi::settings($domainId);
            }
            return $result;
        }
        throw new \RuntimeException("Malformed scope");
    }
    public function sendSettings(InputInterface $input, OutputInterface $output, array $result) : void
    {
        $errorOutput = \is_callable([$output, 'getErrorOutput']) ? $output->getErrorOutput() : $output;
        $result = $this->fillMeta($result);
        \usort($result, function ($a, $b) {
            return \strcmp($a['key'], $b['key']);
        });
        $maxColWidth = 40;
        $abridged = \FALSE;
        if (\in_array($input->getOption('out'), ['table'])) {
            if ($output->isVerbose()) {
                $this->showVerboseReport($input, $output, $result);
                return;
            }
            foreach ($result as &$row) {
                foreach (['value', 'default'] as $field) {
                    $row[$field] = \json_encode($row[$field], \JSON_UNESCAPED_SLASHES);
                    if (!$output->isVerbose() && \mb_strlen($row[$field]) > $maxColWidth) {
                        $abridged = \TRUE;
                        $row[$field] = \mb_substr($row[$field], 0, $maxColWidth) . '...';
                    }
                }
            }
        }
        $columns = \explode(',', $input->getOption('columns'));
        $this->sendTable($input, $output, $result, $columns);
        if ($abridged) {
            $errorOutput->writeln('<comment>NOTE: Some values were truncated for readability. To see full data, use "-v" or "--out=json".</comment>');
        }
    }
    protected function getMetadata(string $scope) : array
    {
        if (\preg_match('/^domain:(.*)$/', $scope, $m)) {
            return \Civi\Core\SettingsMetadata::getMetadata([], $m[1]);
        } else {
            return \Civi\Core\SettingsMetadata::getMetadata();
        }
    }
    protected function codec(array $meta, string $field)
    {
        return \Civi\Cv\Util\SettingCodec::codec($meta, $field);
    }
    protected function fillMeta(array $result) : array
    {
        foreach ($result as &$row) {
            $meta = $this->getMetadata($row['scope'])[$row['key']] ?? [];
            foreach ($meta as $key => $value) {
                $row["meta.{$key}"] = $value;
            }
        }
        return $result;
    }
    protected function showVerboseReport(InputInterface $input, OutputInterface $output, array $result) : void
    {
        foreach ($result as $row) {
            $verboseTable = [];
            foreach ($row as $key => $value) {
                $verboseTable[] = ['key' => $key, 'value' => $value];
            }
            $this->sendTable($input, $output, $verboseTable);
        }
    }
    protected function createSettingFilter($names) : \Closure
    {
        $filterList = [];
        foreach ($names as $filterPat) {
            if ($filterPat[0] === '/') {
                if (!\preg_match(';/i?$;', $filterPat)) {
                    throw new \RuntimeException('Malformed regular expression. (There may be a missing delimiter or invalid modifier.)');
                }
                $filterList[] = $filterPat;
            } else {
                $filterList[] = '/^' . \preg_quote($filterPat, '/') . '$/';
            }
        }
        if (empty($filterList)) {
            $filter = function (string $name) {
                return \TRUE;
            };
        } else {
            $filterExpr = '/' . \implode('|', $filterList) . '/';
            $filter = function (string $name) use($filterList) {
                foreach ($filterList as $filterExpr) {
                    if (\preg_match($filterExpr, $name)) {
                        return \TRUE;
                    }
                }
                return \FALSE;
            };
        }
        return $filter;
    }
}
<?php

namespace Civi\Cv\Util;

use Civi\Cv\Encoder;
use Cvphar\Symfony\Component\Console\Helper\Table;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait StructuredOutputTrait
{
    private $outputFormatShortcuts = ['table' => 'T', 'csv' => 'C', 'list' => 'I'];
    public abstract function addOptionCallback($name, $callback);
    protected function configureOutputOptions($config = [])
    {
        $fallback = !empty($config['fallback']) ? $config['fallback'] : 'json-pretty';
        $formats = !empty($config['tabular']) ? Encoder::getTabularFormats() : Encoder::getFormats();
        if (!empty($config['specialFormats'])) {
            $formats = \array_unique(\array_merge($formats, $config['specialFormats']));
        }
        \sort($formats);
        $this->addOption('out', NULL, InputOption::VALUE_REQUIRED, 'Output format (' . \implode(',', $formats) . ')', Encoder::getDefaultFormat($fallback));
        $this->addOption('flat', NULL, InputOption::VALUE_OPTIONAL, 'Flatten output data. Optionally specified a delimiter.', '.');
        if (!empty($config['shortcuts'])) {
            foreach ($config['shortcuts'] as $format) {
                $shortcut = $this->outputFormatShortcuts[$format];
                $optName = 'out=' . $format;
                $this->addOption($optName, $shortcut, InputOption::VALUE_NONE, 'Shortcut for --out=' . $format);
                $this->addOptionCallback($optName, function (InputInterface $input, OutputInterface $output, InputOption $option) use($optName, $format) {
                    if ($input->getOption($optName)) {
                        $input->setOption('out', $format);
                    }
                });
            }
        }
        if (\array_key_exists('defaultColumns', $config) || \array_key_exists('availColumns', $config)) {
            $defaultValue = \array_key_exists('defaultColumns', $config) ? $config['defaultColumns'] : NULL;
            $desc = 'Comma-separated list of columns to display';
            if (!empty($config['availColumns'])) {
                $desc .= ' <comment>[available: ' . $config['availColumns'] . ']</comment>';
            }
            $this->addOption('columns', NULL, InputOption::VALUE_REQUIRED, $desc, $defaultValue);
        }
        return $this;
    }
    protected function sendResult(InputInterface $input, OutputInterface $output, $result)
    {
        $flat = $this->parseOptionalOption($input, ['--flat'], \FALSE, '.');
        if ($flat !== \FALSE) {
            $result = \Civi\Cv\Util\ArrayUtil::implodeTree($flat, $result);
        }
        $buf = Encoder::encode($result, $input->getOption('out'));
        $options = OutputInterface::OUTPUT_RAW;
        if (!\is_array($result)) {
            $options |= OutputInterface::VERBOSITY_NORMAL;
        } else {
            $options |= empty($result['is_error']) ? OutputInterface::VERBOSITY_NORMAL : OutputInterface::VERBOSITY_QUIET;
        }
        $output->writeln($buf, $options);
    }
    protected function sendTable(InputInterface $input, OutputInterface $output, $records, $columns = NULL)
    {
        if (\is_array($columns) && \in_array('*', $columns)) {
            $columns = NULL;
        }
        $columns = $columns ? $columns : \Civi\Cv\Util\ArrayUtil::findColumns($records);
        if (!\in_array($input->getOption('out'), ['table', 'csv', 'list'])) {
            $this->sendResult($input, $output, \Civi\Cv\Util\ArrayUtil::filterColumns($records, $columns));
            return;
        }
        $flat = $this->parseOptionalOption($input, ['--flat'], \FALSE, '.');
        if ($flat !== \FALSE) {
            $filtered = \Civi\Cv\Util\ArrayUtil::filterColumns($records, $columns);
            $flattened = \Civi\Cv\Util\ArrayUtil::implodeTree($flat, $filtered);
            $records = \Civi\Cv\Util\ArrayUtil::convertKeyValueRecord($flattened, 'key', 'value');
            $columns = ['key', 'value'];
            $convertAssocToNum = function ($rows, $columns) {
                return $rows;
            };
        } else {
            $convertAssocToNum = [\Civi\Cv\Util\ArrayUtil::class, 'convertAssocToNum'];
        }
        $flattenValues = function ($rows) {
            return \array_map(function ($row) {
                return \array_map(function ($value) {
                    if (\is_scalar($value)) {
                        return $value;
                    } elseif ($value === NULL) {
                        return '';
                    } elseif (\is_array($value)) {
                        return \json_encode($value);
                    } elseif (\is_object($value)) {
                        return '(' . \get_class($value) . ')';
                    } else {
                        return '(' . \gettype($value) . ')';
                    }
                }, $row);
            }, $rows);
        };
        switch ($input->getOption('out')) {
            case 'table':
                $table = new Table($output);
                $table->setHeaders($columns ?: []);
                $table->addRows($flattenValues($convertAssocToNum($records, $columns)));
                $table->render();
                break;
            case 'csv':
                \fputcsv(\STDOUT, $columns);
                foreach ($convertAssocToNum($records, $columns) as $record) {
                    \fputcsv(\STDOUT, $record);
                }
                break;
            case 'list':
                $col = $flat === \FALSE ? $columns[0] : 'value';
                foreach ($records as $record) {
                    $output->writeln($record[$col], OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_NORMAL);
                }
                break;
            default:
                throw new \RuntimeException("Unsupported table format: " . $input->getOption('out'));
        }
    }
    protected function parseColumns(InputInterface $input, $defaultColumns = array())
    {
        $out = $input->getOption('out');
        if ($input->getOption('columns')) {
            return \explode(',', $input->getOption('columns'));
        } elseif (isset($defaultColumns[$out])) {
            return $defaultColumns[$out];
        } else {
            return array('*');
        }
    }
}
<?php

namespace Civi\Cv\Util;

use ZipArchive;
class HeadlessDownloader
{
    public function run($zipUrl, $extKey, $outputDir, $force)
    {
        $fs = new \Civi\Cv\Util\Filesystem();
        if ($fs->exists($outputDir) && !$force) {
            throw new \RuntimeException("Directory already exists: {$outputDir}");
        }
        $tmpDir = $outputDir . ".tmp";
        if ($fs->exists($tmpDir) && !$force) {
            throw new \RuntimeException("Directory already exists: {$tmpDir}");
        }
        $zipFile = \tempnam(\sys_get_temp_dir(), 'extdl-') . '.zip';
        if ($fs->exists($tmpDir) && $force) {
            $fs->remove($tmpDir);
        }
        $this->download($zipUrl, $zipFile);
        $extractedZipPath = $this->extractZip($zipFile, $extKey, $tmpDir);
        if ($fs->exists($outputDir) && $force) {
            $fs->remove($outputDir);
        }
        \rename($extractedZipPath, $outputDir);
        \rmdir($tmpDir);
        \unlink($zipFile);
    }
    public function findBaseDirs(ZipArchive $zip)
    {
        $cnt = $zip->numFiles;
        $basedirs = array();
        for ($i = 0; $i < $cnt; $i++) {
            $filename = $zip->getNameIndex($i);
            if (\preg_match('/^[^\\/]+\\/$/', $filename) && $filename != './' && $filename != '../') {
                $basedirs[] = \rtrim($filename, '/');
            }
        }
        return $basedirs;
    }
    public function guessBasedir(ZipArchive $zip, $expected)
    {
        $candidate = \FALSE;
        $basedirs = $this->findBaseDirs($zip);
        if (\in_array($expected, $basedirs)) {
            $candidate = $expected;
        } elseif (\count($basedirs) == 1) {
            $candidate = \array_shift($basedirs);
        }
        if ($candidate !== \FALSE && \preg_match('/^[a-zA-Z0-9]/', $candidate)) {
            return $candidate;
        } else {
            return \FALSE;
        }
    }
    public function extractZip($zipFile, $key, $tmpDir)
    {
        $zip = new ZipArchive();
        $res = $zip->open($zipFile);
        if ($res === \TRUE) {
            $zipSubDir = $this->guessBasedir($zip, $key);
            if ($zipSubDir === \FALSE) {
                throw new \Exception('Unable to extract the extension: bad directory structure');
            }
            $extractedZipPath = $tmpDir . \DIRECTORY_SEPARATOR . $zipSubDir;
            if (\is_dir($extractedZipPath)) {
                throw new \Exception("{$extractedZipPath} already exists");
            }
            if (!\is_dir($tmpDir)) {
                \mkdir($tmpDir, 0777, \TRUE);
            }
            if (!$zip->extractTo($tmpDir)) {
                throw new \Exception("Unable to extract the extension to {$tmpDir}.");
            }
            $zip->close();
            return $extractedZipPath;
        } else {
            throw new \Exception('Unable to extract the extension.');
        }
    }
    public function download($url, $file)
    {
        $fp = \fopen($file, 'w');
        $ch = \curl_init($url);
        \curl_setopt($ch, \CURLOPT_FILE, $fp);
        \curl_setopt($ch, \CURLOPT_FOLLOWLOCATION, \TRUE);
        \curl_exec($ch);
        \curl_close($ch);
        \fclose($fp);
    }
}
<?php

namespace Civi\Cv\Util;

class Api4ArgParser extends \Civi\Cv\Util\AbstractPlusParser
{
    protected function applyOption(array &$params, string $type, string $expr) : void
    {
        $aliases = ['s' => 'select', 'w' => 'where', 'o' => 'orderBy', 'l' => 'limit', 'v' => 'values', 'value' => 'values'];
        $type = $aliases[$type] ?? $type;
        switch ($type) {
            case 'select':
                self::mergeInto($params, $type, \array_map([$this, 'parseValueExpr'], \preg_split('/[, ]/', $expr)));
                break;
            case 'where':
                self::appendInto($params, $type, $this->parseWhere($expr));
                break;
            case 'orderBy':
                $keyOrderPairs = \explode(',', $expr);
                foreach ($keyOrderPairs as $keyOrderPair) {
                    $keyOrderPair = \explode(' ', \trim($keyOrderPair));
                    $sortKey = $keyOrderPair[0];
                    $sortOrder = isset($keyOrderPair[1]) ? \strtoupper($keyOrderPair[1]) : 'ASC';
                    $params[$type][$sortKey] = $sortOrder;
                }
                break;
            case 'limit':
                if (\strpos($expr, '@') !== \FALSE) {
                    [$limit, $offset] = \explode('@', $expr);
                    $params['limit'] = (int) $limit;
                    $params['offset'] = (int) $offset;
                } else {
                    $params['limit'] = (int) $expr;
                }
                break;
            case 'values':
                self::mergeInto($params, $type, $this->parseAssignment($expr));
                break;
            default:
                throw new \RuntimeException("Unrecognized option: +{$type}");
        }
    }
}
<?php

namespace Civi\Cv\Util;

class CliEditor
{
    protected $validator = NULL;
    public function editBuffer($buffer, $attempts = 2)
    {
        $tmpFile = \tempnam(\sys_get_temp_dir(), 'cv-editor-');
        \chmod($tmpFile, 0600);
        \file_put_contents($tmpFile, $buffer);
        if (!$this->editFile($tmpFile, $attempts)) {
            \unlink($tmpFile);
            return NULL;
        }
        $buffer = \file_get_contents($tmpFile);
        \unlink($tmpFile);
        return $buffer;
    }
    public function editFile($file, $maxAttempts = 2)
    {
        $attempt = 0;
        do {
            $attempt++;
            $cmd = $this->pick();
            if (!$cmd) {
                return \FALSE;
            }
            \passthru("{$cmd} " . \escapeshellarg($file), $return);
            if (!$return !== 0) {
                return \FALSE;
            }
            if ($this->validator === NULL) {
                $isValid = \TRUE;
            } else {
                list($isValid, $message) = \call_user_func($this->validator, $file);
                if (!$isValid && $attempt >= $maxAttempts) {
                    return \FALSE;
                }
                if (!$isValid && $message) {
                    \file_put_contents($file, $message . \file_get_contents($file));
                }
            }
        } while (!$isValid);
        return \TRUE;
    }
    public function pick()
    {
        if (\getenv('VISUAL') && $this->findCommand(\getenv('VISUAL'))) {
            return \getenv('VISUAL');
        } elseif (\getenv('EDITOR') && $this->findCommand(\getenv('EDITOR'))) {
            return \getenv('EDITOR');
        } elseif ($this->findCommand('editor')) {
            return 'editor';
        } elseif ($this->findCommand('vi')) {
            return 'vi';
        } else {
            return NULL;
        }
    }
    protected function findCommand($name)
    {
        return \Civi\Cv\Util\Process::findCommand($name);
    }
    public function getValidator()
    {
        return $this->validator;
    }
    public function setValidator($validator)
    {
        $this->validator = $validator;
    }
}
<?php

namespace Civi\Cv\Util;

class SettingArgParser extends \Civi\Cv\Util\AbstractPlusParser
{
    protected $settingsBag;
    protected $settingsMeta;
    protected $pathDelimiter = '.';
    public function __construct(\Civi\Core\SettingsBag $settingsBag, array $settingsMeta)
    {
        $this->settingsBag = $settingsBag;
        $this->settingsMeta = $settingsMeta;
    }
    protected function applyOption(array &$params, string $type, string $expr) : void
    {
        $aliases = ['o' => 'object', 'l' => 'list'];
        $type = $aliases[$type] ?? $type;
        [$key, $op, $value] = $this->parseRichOp($expr);
        $keyParts = \explode($this->pathDelimiter, $key);
        $this->includeBaseSetting($params, $keyParts[0]);
        switch ("{$type} {$op}") {
            case 'list =':
            case 'object =':
                \Civi\Cv\Util\ArrayUtil::pathSet($params, $keyParts, $value);
                break;
            case 'list +=':
            case 'list []=':
                $fullValue = \CRM_Utils_Array::pathGet($params, $keyParts, []);
                if (!\in_array($value, $fullValue)) {
                    $fullValue[] = $value;
                }
                \Civi\Cv\Util\ArrayUtil::pathSet($params, $keyParts, $fullValue);
                break;
            case 'list -=':
                $fullValue = \CRM_Utils_Array::pathGet($params, $keyParts, []);
                $fullValue = \array_values(\array_diff($fullValue, [$value]));
                \Civi\Cv\Util\ArrayUtil::pathSet($params, $keyParts, $fullValue);
                break;
            case 'list !':
                if (\count($keyParts) <= 1) {
                    throw new \RuntimeException("Expression \"{$expr}\" should specify which item to remove.");
                }
                $parent = $keyParts;
                $offset = \array_pop($parent);
                $arrayValue = \CRM_Utils_Array::pathGet($params, $parent);
                unset($arrayValue[$offset]);
                $arrayValue = \array_values($arrayValue);
                \CRM_Utils_Array::pathSet($params, $parent, $arrayValue);
                break;
            case 'object !':
                if (\count($keyParts) <= 1) {
                    throw new \RuntimeException("Expression \"{$expr}\" should specify which property to remove.");
                }
                \CRM_Utils_Array::pathUnset($params, $keyParts);
                break;
            default:
                throw new \RuntimeException("Unrecognized option: +{$type}");
        }
    }
    protected function includeBaseSetting(array &$params, string $settingKey)
    {
        [$encode, $decode] = \Civi\Cv\Util\SettingCodec::codec($this->settingsMeta, $settingKey);
        if (!isset($params[$settingKey])) {
            $params[$settingKey] = $decode($this->settingsBag->get($settingKey));
        }
    }
    protected function parseValueExpr($expr)
    {
        if ($expr !== '' && \strpos('{["\'', $expr[0]) !== \FALSE) {
            return $this->parseJsonNoisily($expr);
        } else {
            return $this->castNumberSoftly($expr);
        }
    }
    private function castNumberSoftly($value)
    {
        if (\is_string($value) && \preg_match(';^\\d+$;', $value)) {
            return (int) $value;
        } elseif (\is_string($value) && \preg_match(';^\\d+\\.\\d+$;', $value)) {
            return (float) $value;
        }
        return $value;
    }
    public function parseRichOp($expr)
    {
        if (\preg_match('/^!([a-zA-Z0-9_:\\.]+)\\s*$/i', $expr, $matches)) {
            return [$matches[1], '!'];
        } elseif (\preg_match('/^([a-zA-Z0-9_:\\.]+)\\s*(=|\\[\\]=|\\+=|-=)\\s*(.*)$/i', $expr, $matches)) {
            if (!empty($matches[3])) {
                return [$matches[1], \strtoupper(\trim($matches[2])), $this->parseValueExpr(\trim($matches[3]))];
            } else {
                return [$matches[1], \strtoupper($matches[2])];
            }
        } else {
            throw new \RuntimeException("Error parsing expression: {$expr}");
        }
    }
}
<?php

namespace Civi\Cv\Util;

use Cvphar\Symfony\Component\Console\Helper\Table;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait DebugDispatcherTrait
{
    public function findEventNames($dispatcher, $eventFilter)
    {
        if (!$eventFilter) {
            $listenersByEvent = $dispatcher->getListeners();
        } elseif ($eventFilter[0] === '/') {
            $listenersByEvent = array();
            foreach ($dispatcher->getListeners() as $e => $ls) {
                if (\preg_match($eventFilter, $e)) {
                    $listenersByEvent[$e] = $ls;
                }
            }
        } else {
            $listenersByEvent = array($eventFilter => $dispatcher->getListeners($eventFilter));
        }
        $eventNames = \array_keys($listenersByEvent);
        \sort($eventNames);
        return $eventNames;
    }
    public function printEventListeners(OutputInterface $output, $dispatcher, $eventNames)
    {
        $fmt = \class_exists('\\Civi\\Core\\Event\\EventPrinter') ? ['\\Civi\\Core\\Event\\EventPrinter', 'formatName'] : NULL;
        foreach ($eventNames as $event) {
            $rows = array();
            $i = 0;
            foreach ($dispatcher->getListeners($event) as $listener) {
                $handled = \FALSE;
                if ($fmt != NULL) {
                    $rows[] = array('#' . ++$i, $fmt($listener));
                    $handled = \TRUE;
                } elseif (\is_array($listener)) {
                    list($a, $b) = $listener;
                    if (\is_object($a)) {
                        $rows[] = array('#' . ++$i, \get_class($a) . "->{$b}()");
                        $handled = \TRUE;
                    } elseif (\is_string($a)) {
                        $rows[] = array('#' . ++$i, "{$a}::{$b}()");
                        $handled = \TRUE;
                    }
                } elseif (\is_string($listener)) {
                    $handled = \TRUE;
                    $rows[] = array('#' . ++$i, $listener . '()');
                } elseif ($listener instanceof \Civi\Core\Event\ServiceListener) {
                    $handled = \TRUE;
                    $rows[] = ['#' . ++$i, (string) $listener];
                } else {
                    try {
                        $f = new \ReflectionFunction($listener);
                        $rows[] = array('#' . ++$i, 'closure(' . $f->getFileName() . '@' . $f->getStartLine() . ')');
                        $handled = \TRUE;
                    } catch (\ReflectionException $e) {
                    }
                }
                if (!$handled) {
                    $rows[] = array('#' . ++$i, "unidentified");
                }
            }
            $output->writeln("<info>[Event]</info> {$event}");
            $table = new Table($output);
            $table->setHeaders(array('Order', 'Callable'));
            $table->addRows($rows);
            $table->render();
            $output->writeln("");
        }
    }
}
<?php

namespace Civi\Cv\Util;

use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait UrlCommandTrait
{
    protected $defaultJwtTimeout = 300;
    protected function configureUrlOptions()
    {
        $this->addArgument('path', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Relative path to a CiviCRM page, such as "civicrm/contact/view?reset=1&cid=1"')->addOption('relative', 'r', InputOption::VALUE_NONE, 'Prefer relative URL format. (Default: absolute)')->addOption('frontend', 'f', InputOption::VALUE_NONE, 'Equivalent to --entry=frontend')->addOption('entry', NULL, InputOption::VALUE_REQUIRED, 'Request frontend or backend style URLs', 'default')->addOption('login', 'L', InputOption::VALUE_NONE, 'Add an authentication code (based on current user; uses authx; expires=' . $this->defaultJwtTimeout . 's)')->addOption('ext', 'x', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An extension name. Identify the extension by full key ("org.example.foobar") or short name ("foobar"). Use "." for the default extension dir.')->addOption('config', 'c', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A config property. (Ex: "templateCompileDir/en_US")')->addOption('dynamic', 'd', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A dynamic path expression (v4.7+) (Ex: "[civicrm.root]/packages")');
        return $this;
    }
    protected function createUrls(InputInterface $input, OutputInterface $output, bool $useDefault = \TRUE) : array
    {
        $rows = [];
        if ($input->getOption('ext')) {
            foreach ($input->getOption('ext') as $extExpr) {
                $rows[] = $this->resolveExt($extExpr, $output);
            }
        }
        if ($input->getOption('dynamic')) {
            foreach ($input->getOption('dynamic') as $dynExpr) {
                $rows[] = $this->resolveDynamic($dynExpr, $output);
            }
        }
        if ($input->getOption('config')) {
            foreach ($input->getOption('config') as $configExpr) {
                $rows[] = $this->resolveConfig($configExpr, $output);
            }
        }
        if ($input->getArgument('path')) {
            foreach ($input->getArgument('path') as $pathExpr) {
                $rows[] = $this->resolveRoute($pathExpr, $input);
            }
        }
        if (\count($rows) === 0) {
            if ($useDefault) {
                $rows[] = $this->resolveRoute('', $input);
            } else {
                throw new \RuntimeException("No paths specified");
            }
        }
        if ($input->getOption('login')) {
            if (!\CRM_Extension_System::singleton()->getMapper()->isActiveModule('authx')) {
                if ($this->getIO()->confirm('Enable authx?')) {
                    $output->getErrorOutput()->writeln('<info>Enabling extension "authx"</info>');
                    \civicrm_api3('Extension', 'enable', ['key' => 'authx']);
                } else {
                    throw new \RuntimeException('Missing required extension: authx');
                }
            }
            $authxFlow = $input->hasOption('authx-flow') ? $input->getOption('authx-flow') : 'login';
            $cid = \CRM_Core_Session::getLoggedInContactID();
            if (!$cid) {
                throw new \RuntimeException('The "--login" option requires specifying an active user/contact ("--user=X").');
            }
            $token = \Civi::service('crypto.jwt')->encode(['exp' => \time() + $this->defaultJwtTimeout, 'sub' => 'cid:' . $cid, 'scope' => 'authx']);
            $rows = \array_map(function ($row) use($token, $authxFlow) {
                switch ($authxFlow) {
                    case 'login':
                        $delim = \strpos($row['value'], '?') === \FALSE ? '?' : '&';
                        $row['value'] .= $delim . '_authxSes=1&_authx=Bearer+' . \urlencode($token);
                        break;
                    case 'param':
                        $delim = \strpos($row['value'], '?') === \FALSE ? '?' : '&';
                        $row['value'] .= $delim . '_authx=Bearer+' . \urlencode($token);
                        break;
                    case 'xheader':
                        $row['headers']['X-Civi-Auth'] = 'Bearer ' . $token;
                        break;
                    case 'header':
                        $row['headers']['Authorization'] = 'Bearer ' . $token;
                        break;
                }
                return $row;
            }, $rows);
        }
        return $rows;
    }
    protected function resolveExt($extExpr, OutputInterface $output)
    {
        $mapper = \CRM_Extension_System::singleton()->getMapper();
        [$keyOrName, $file] = \explode('/', $extExpr, 2);
        if ($keyOrName === '.') {
            return array('type' => 'ext', 'expr' => $extExpr, 'value' => $this->urlJoin(\CRM_Core_Config::singleton()->extensionsURL, $file));
        }
        if (\strpos($keyOrName, '.') === \FALSE) {
            $shortMap = $this->getShortMap();
            if (isset($shortMap[$keyOrName]) && \count($shortMap[$keyOrName]) === 1) {
                $keyOrName = $shortMap[$keyOrName][0];
            }
        }
        try {
            return array('type' => 'ext', 'expr' => $extExpr, 'value' => $this->urlJoin($mapper->keyToUrl($keyOrName), $file));
        } catch (\CRM_Extension_Exception_MissingException $e) {
            $output->getErrorOutput()->writeln("<error>Ignoring unrecognized extension \"{$keyOrName}\"</error>");
            return NULL;
        }
    }
    protected function resolveDynamic($dynExpr, OutputInterface $output)
    {
        if (!\is_callable(array('Civi', 'paths'))) {
            $output->getErrorOutput()->writeln("<error>Dynamic path expressions are only available on CiviCRM v4.7+</error>");
            return NULL;
        }
        if (\preg_match(';^(\\[[^\\]]+\\])([\\/]?)$;', $dynExpr, $matches)) {
            $dyn = \Civi::paths()->getUrl($matches[1] . "/./", 'absolute');
            $value = \preg_replace(';/./$;', '', $dyn) . $matches[2];
            return array('type' => 'dynamic', 'expr' => $dynExpr, 'value' => $value);
        } else {
            return array('type' => 'dynamic', 'expr' => $dynExpr, 'value' => \Civi::paths()->getUrl($dynExpr, 'absolute'));
        }
    }
    protected function resolveConfig($configExpr, OutputInterface $output)
    {
        [$configProperty, $file] = \explode('/', $configExpr, 2);
        $dir = \CRM_Core_Config::singleton()->{$configProperty};
        return array('type' => 'config', 'expr' => $configExpr, 'value' => $this->urlJoin($dir, $file));
    }
    protected function urlJoin($folder, $file)
    {
        if ($folder == NULL || $folder == \FALSE) {
            return $folder;
        }
        if ($file !== NULL && $file !== \FALSE) {
            return \CRM_Utils_File::addTrailingSlash($folder, '/') . $file;
        } else {
            return \rtrim($folder, \DIRECTORY_SEPARATOR);
        }
    }
    protected function resolveRoute($pathExpr, InputInterface $input)
    {
        $path = \parse_url($pathExpr, \PHP_URL_PATH);
        $query = \parse_url($pathExpr, \PHP_URL_QUERY);
        $fragment = \parse_url($pathExpr, \PHP_URL_FRAGMENT);
        $entry = $input->getOption('frontend') ? 'frontend' : $input->getOption('entry');
        return ['type' => 'router', 'expr' => $pathExpr, 'value' => \CRM_Utils_System::url($path, $query, !$input->getOption('relative'), $fragment, \FALSE, $entry === 'frontend', $entry === 'backend')];
    }
}
<?php

namespace Civi\Cv\Util;

class ArrayUtil
{
    public static function collect($array, $index)
    {
        $result = array();
        foreach ($array as $item) {
            if (isset($item[$index])) {
                $result[] = $item[$index];
            }
        }
        return $result;
    }
    public static function implodeTree($delim, &$arr)
    {
        $result = array();
        foreach ($arr as $key => &$value) {
            if (\is_array($value)) {
                $temp =& self::implodeTree($delim, $value);
                foreach ($temp as $key2 => $value2) {
                    $result[$key . $delim . $key2] = $value2;
                }
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
    public static function pathSet(&$arr, $pathParts, $value)
    {
        $r =& $arr;
        $last = \array_pop($pathParts);
        foreach ($pathParts as $part) {
            if (!isset($r[$part])) {
                $r[$part] = array();
            }
            $r =& $r[$part];
        }
        $r[$last] = $value;
    }
    public static function convertKeyValueRecord($records, $keyProp = 0, $valueProp = 1)
    {
        $result = [];
        foreach ($records as $key => $value) {
            $result[] = [$keyProp => $key, $valueProp => $value];
        }
        return $result;
    }
    public static function convertAssocToNum($records, $columns, $defaults = [])
    {
        $result = array();
        foreach ($records as $k => $oldRow) {
            $newRow = array();
            foreach ($columns as $newKey => $oldKey) {
                $newRow[$newKey] = $oldRow[$oldKey] ?? $defaults[$newKey] ?? NULL;
            }
            $result[$k] = $newRow;
        }
        return $result;
    }
    public static function filterColumns($records, $columns)
    {
        $result = array();
        foreach ($records as $k => $oldRow) {
            $newRow = array();
            foreach ($columns as $key) {
                if (\array_key_exists($key, $oldRow)) {
                    $newRow[$key] = $oldRow[$key];
                }
            }
            $result[$k] = $newRow;
        }
        return $result;
    }
    public static function findColumns($records)
    {
        foreach ($records as $record) {
            $columns = \array_keys($record);
            if ($columns) {
                return $columns;
            }
        }
        return NULL;
    }
    public static function pickFirst($values, $filter = NULL)
    {
        foreach ($values as $value) {
            if ($filter !== NULL && $filter($value) || $filter === NULL && $value) {
                return $value;
            }
        }
        return NULL;
    }
}
<?php

namespace Civi\Cv\Util;

class SettingCodec
{
    public static function codec(array $meta, string $field)
    {
        $encode = function ($value) use($meta, $field) {
            if (isset($value) && !empty($meta[$field]['serialize'])) {
                return \CRM_Core_DAO::serializeField($value, $meta[$field]['serialize']);
            }
            return $value;
        };
        $decode = function ($value) use($meta, $field) {
            if (isset($value) && !empty($meta[$field]['serialize'])) {
                return \CRM_Core_DAO::unSerializeField($value, $meta[$field]['serialize']);
            }
            return $value;
        };
        return [$encode, $decode];
    }
}
<?php

namespace Civi\Cv\Util;

abstract class AbstractPlusParser
{
    public function parse($args, $defaults = [])
    {
        $state = '_TOP_';
        $params = $defaults;
        foreach ($args as $arg) {
            if ($state !== '_TOP_') {
                $this->applyOption($params, $state, $arg);
                $state = '_TOP_';
            } elseif (\preg_match('/^([a-zA-Z0-9_:\\.]+)=(.*)/', $arg, $matches)) {
                [, $key, $value] = $matches;
                $params[$key] = $this->parseValueExpr($value);
            } elseif (\preg_match('/^\\+([a-zA-Z0-9_]+)$/', $arg, $matches)) {
                $state = $matches[1];
            } elseif (\preg_match('/^\\+([a-zA-Z0-9_]+)[:=](.*)/', $arg, $matches)) {
                [, $key, $expr] = $matches;
                $this->applyOption($params, $key, $expr);
            } elseif (\preg_match('/^\\{.*\\}$/', $arg)) {
                $params = \array_merge($params, $this->parseJsonNoisily($arg));
            } else {
                throw new \RuntimeException("Unrecognized option format: {$arg}");
            }
        }
        return $params;
    }
    protected static function mergeInto(&$params, $key, $values)
    {
        if (!isset($params[$key])) {
            $params[$key] = [];
        }
        $params[$key] = \array_merge($params[$key], $values);
    }
    protected static function appendInto(&$params, $key, $values)
    {
        if (!isset($params[$key])) {
            $params[$key] = [];
        }
        $params[$key][] = $values;
    }
    protected function parseJsonNoisily($arg)
    {
        $values = \json_decode($arg, 1);
        if ($values === NULL) {
            throw new \RuntimeException("Failed to parse JSON: {$values}");
        }
        return $values;
    }
    protected function parseValueExpr($expr)
    {
        if ($expr !== '' && \strpos('{["\'', $expr[0]) !== \FALSE) {
            return $this->parseJsonNoisily($expr);
        } else {
            return $expr;
        }
    }
    protected abstract function applyOption(array &$params, string $type, string $expr) : void;
    public function parseAssignment($expr)
    {
        if (\preg_match('/^([a-zA-Z0-9_:\\.]+)\\s*=\\s*(.*)$/', $expr, $matches)) {
            return [$matches[1] => $this->parseValueExpr($matches[2])];
        } else {
            throw new \RuntimeException("Error parsing \"value\": {$expr}");
        }
    }
    public function parseWhere($expr)
    {
        if (\preg_match('/^([a-zA-Z0-9_:\\.]+)\\s*(\\<=|\\>=|=|!=|\\<|\\>|IS NULL|IS NOT NULL|IS EMPTY|IS NOT EMPTY|LIKE|NOT LIKE|IN|NOT IN)\\s*(.*)$/i', $expr, $matches)) {
            if (!empty($matches[3])) {
                return [$matches[1], \strtoupper(\trim($matches[2])), $this->parseValueExpr(\trim($matches[3]))];
            } else {
                return [$matches[1], \strtoupper($matches[2])];
            }
        } else {
            throw new \RuntimeException("Error parsing \"where\": {$expr}");
        }
    }
}
<?php

namespace Civi\Cv\Util;

use Civi\Cv\Log\InternalLogger;
use Cvphar\Psr\Log\AbstractLogger;
class PsrLogger extends AbstractLogger
{
    protected $internalLog;
    public function __construct(InternalLogger $internalLog)
    {
        $this->internalLog = $internalLog;
    }
    public function log($level, $message, array $context = array()) : void
    {
        $this->internalLog->log($level, $message, $context);
    }
}
<?php

namespace Civi\Cv\Util;

class Datasource
{
    private static $attribute_names = array('database', 'driver', 'host', 'password', 'port', 'username');
    private static $cividsn_to_settings_name = array('database' => 'database', 'dbsyntax' => 'driver', 'hostspec' => 'host', 'password' => 'password', 'port' => 'port', 'username' => 'username');
    private static $settings_to_doctrine_options = array('database' => 'dbname', 'driver' => 'driver', 'host' => 'host', 'password' => 'password', 'port' => 'port', 'username' => 'user');
    private static $settings_to_pdo_options = array('host' => 'host', 'port' => 'port', 'database' => 'dbname', 'socket_path' => 'unix_socket');
    private $database;
    private $driver;
    private $host;
    private $password;
    private $port;
    private $socket_path;
    private $username;
    public function __construct($options = NULL)
    {
        if ($options !== NULL) {
            if (isset($options['civi_dsn'])) {
                $this->loadFromCiviDSN($options['civi_dsn']);
            } elseif ($options['settings_array']) {
                $this->loadFromSettingsArray($options['settings_array']);
            } else {
                throw new \InvalidArgumentException("The options parameter needs to be blank if you want to load from CIVICRM_DSN, or it can be an array with key 'civi_dsn' that is a CiviCRM formatted DSN string, or it can be an array with key 'settings_array' than points to another array of database settings.");
            }
        }
    }
    public function loadFromCiviDSN($civi_dsn)
    {
        $parsed_dsn = \DB::parseDSN($civi_dsn);
        foreach (static::$cividsn_to_settings_name as $key => $value) {
            if (\array_key_exists($key, $parsed_dsn)) {
                $this->{$value} = $parsed_dsn[$key];
            }
        }
        $this->updateHost();
    }
    public function loadFromSettingsArray($settings_array)
    {
        foreach ($settings_array as $key => $value) {
            $this->{$key} = $value;
        }
        $this->updateHost();
    }
    public function createPDO()
    {
        $pdo = new \PDO($this->toPDODSN(), $this->username, $this->password);
        $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        return $pdo;
    }
    public function isValid()
    {
        try {
            $dbh = $this->createPDO();
            foreach ($dbh->query('SELECT 99 as value') as $row) {
                if ($row['value'] == 99) {
                    return \TRUE;
                }
            }
        } catch (\PDOException $e) {
        }
        $dbh = NULL;
        return \FALSE;
    }
    public function toCiviDSN()
    {
        $civi_dsn = "{$this->driver}://{$this->username}:{$this->password}@{$this->host}";
        if ($this->port !== NULL) {
            $civi_dsn = "{$civi_dsn}:{$this->port}";
        }
        $civi_dsn = "{$civi_dsn}/{$this->database}?new_link=true";
        return $civi_dsn;
    }
    public function toDoctrineArray()
    {
        $result = array();
        foreach (self::$settings_to_doctrine_options as $key => $value) {
            $result[$value] = $this->{$key};
        }
        $result['driver'] = "pdo_{$result['driver']}";
        return $result;
    }
    public function toDrupalDSN()
    {
        $drupal_dsn = "{$this->driver}://{$this->username}:{$this->password}@{$this->host}";
        if ($this->port !== NULL) {
            $drupal_dsn = "{$drupal_dsn}:{$this->port}";
        }
        $drupal_dsn = "{$drupal_dsn}/{$this->database}";
        return $drupal_dsn;
    }
    public function toMySQLArguments($tmpDir)
    {
        $data = "[client]\n";
        $data .= "host={$this->host}\n";
        $data .= "user={$this->username}\n";
        $data .= "password={$this->password}\n";
        if ($this->port != NULL) {
            $data .= "port={$this->port}\n";
        }
        $file = $tmpDir . '/my.cnf-' . \md5($data);
        if (!\file_exists($file)) {
            if (!\file_put_contents($file, $data)) {
                throw new \RuntimeException("Failed to create temporary my.cnf connection file.");
            }
        }
        $args = "--defaults-file=" . \escapeshellarg($file);
        $args .= " {$this->database}";
        return $args;
    }
    public function toPHPArrayString()
    {
        $result = "array(\n";
        foreach (static::$attribute_names as $attribute_name) {
            $result .= "  '{$attribute_name}' => '{$this->{$attribute_name}}',\n";
        }
        $result .= ")";
        return $result;
    }
    public function toPDODSN($options = array())
    {
        $pdo_dsn = "{$this->driver}:";
        $pdo_dsn_options = array();
        $settings_to_pdo_options = static::$settings_to_pdo_options;
        if (isset($options['no_database']) && $options['no_database']) {
            unset($settings_to_pdo_options['database']);
        }
        foreach ($settings_to_pdo_options as $settings_name => $pdo_name) {
            if ($this->{$settings_name} !== NULL) {
                $pdo_dsn_options[] = "{$pdo_name}={$this->{$settings_name}}";
            }
        }
        $pdo_dsn .= \implode(';', $pdo_dsn_options);
        return $pdo_dsn;
    }
    public function updateHost()
    {
        if ($this->port != NULL && $this->host == 'localhost') {
            $this->host = '127.0.0.1';
        }
    }
    public function setDatabase($database)
    {
        $this->database = $database;
    }
    public function getDatabase()
    {
        return $this->database;
    }
    public function setDriver($driver)
    {
        $this->driver = $driver;
    }
    public function getDriver()
    {
        return $this->driver;
    }
    public function setHost($host)
    {
        $this->host = $host;
    }
    public function getHost()
    {
        return $this->host;
    }
    public function setPassword($password)
    {
        $this->password = $password;
    }
    public function getPassword()
    {
        return $this->password;
    }
    public function setPort($port)
    {
        $this->port = $port;
    }
    public function getPort()
    {
        return $this->port;
    }
    public function setUsername($username)
    {
        $this->username = $username;
    }
    public function getUsername()
    {
        return $this->username;
    }
    public function setSocketPath($socket_path)
    {
        $this->socket_path = $socket_path;
    }
    public function getSocketPath()
    {
        return $this->socket_path;
    }
}
<?php

namespace Civi\Cv\Util;

use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ConsoleQueueRunner
{
    private $dryRun;
    private $io;
    private $queue;
    private $step;
    public function __construct(\Cvphar\Symfony\Component\Console\Style\SymfonyStyle $io, \CRM_Queue_Queue $queue, $dryRun = \FALSE, $step = \FALSE)
    {
        $this->io = $io;
        $this->queue = $queue;
        $this->dryRun = $dryRun;
        $this->step = (bool) $step;
    }
    public function runAll()
    {
        $io = $this->io;
        $taskCtx = new \CRM_Queue_TaskContext();
        $taskCtx->queue = $this->queue;
        $taskCtx->log = \Log::singleton('display');
        while ($this->queue->numberOfItems()) {
            $item = $this->queue->stealItem();
            $task = $item->data;
            if ($io->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) {
                $io->write(".");
            } elseif ($io->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) {
                $io->writeln(\sprintf("<info>%s</info>", $task->title));
            } elseif ($io->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
                $io->writeln(\sprintf("<info>%s</info> (<comment>%s</comment>)", $task->title, self::formatTaskCallback($task)));
            }
            $action = 'y';
            if ($this->step) {
                $action = $io->choice('Execute this step?', ['y' => 'yes', 's' => 'skip', 'a' => 'abort'], 'y');
            }
            if ($action === 'a') {
                throw new \Exception('Aborted');
            }
            if ($action === 'y' && !$this->dryRun) {
                try {
                    $isOK = $task->run($taskCtx);
                    if (!$isOK) {
                        throw new \Exception('Task returned false');
                    }
                } catch (\Exception $e) {
                    $io->writeln(\sprintf("<error>Error executing task \"%s\"</error>", $task->title));
                    throw $e;
                }
            }
            $this->queue->deleteItem($item);
        }
        if ($io->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) {
            $io->newLine();
        }
    }
    protected static function formatTaskCallback(\CRM_Queue_Task $task)
    {
        return \sprintf("%s(%s)", \implode('::', (array) $task->callback), \implode(',', $task->arguments));
    }
}
<?php

namespace Civi\Cv\Util;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
trait OptionCallbackTrait
{
    public abstract function getDefinition();
    private $optionCallbacks = [];
    public function addOptionCallback($name, $callback)
    {
        $this->optionCallbacks[] = [$name, $callback];
        return $this;
    }
    protected function runOptionCallbacks(InputInterface $input, OutputInterface $output)
    {
        $defn = $this->getDefinition();
        foreach ($this->optionCallbacks as $optionCallbackDefn) {
            list($optionName, $callback) = $optionCallbackDefn;
            if ($defn->hasOption($optionName)) {
                $callback($input, $output, $defn->getOption($optionName));
            }
        }
        return $this;
    }
}
<?php

namespace Civi\Cv\Util;

class Relativizer
{
    protected $prefixes;
    public function __construct()
    {
        $this->prefixes = ['[civicrm.root]/' => \Civi::paths()->getPath('[civicrm.root]/'), '[civicrm.packages]/' => \Civi::paths()->getPath('[civicrm.packages]/'), '[civicrm.files]/' => \Civi::paths()->getPath('[civicrm.files]/'), '[cms.root]/' => \Civi::paths()->getPath('[cms.root]/')];
    }
    public function filter(string $path) : string
    {
        foreach ($this->prefixes as $prefix => $prefixPath) {
            if (\CRM_Utils_File::isChildPath($prefixPath, $path)) {
                return $prefix . \mb_substr($path, \mb_strlen($prefixPath));
            }
        }
        return $path;
    }
}
<?php

namespace Civi\Cv\Util;

class Cv
{
    public static function run($cmd, $decode = 'json')
    {
        $cmd = 'cv ' . $cmd;
        $descriptorSpec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => \STDERR);
        $oldOutput = \getenv('CV_OUTPUT');
        \putenv("CV_OUTPUT=json");
        $process = \proc_open($cmd, $descriptorSpec, $pipes);
        \putenv("CV_OUTPUT={$oldOutput}");
        \fclose($pipes[0]);
        $result = \stream_get_contents($pipes[1]);
        \fclose($pipes[1]);
        if (\proc_close($process) !== 0) {
            throw new \RuntimeException("Command failed ({$cmd}):\n{$result}");
        }
        switch ($decode) {
            case 'raw':
                return $result;
            case 'phpcode':
                if (\substr(\trim($result), 0, 12) !== "/*BEGINPHP*/" || \substr(\trim($result), -10) !== "/*ENDPHP*/") {
                    throw new \RuntimeException("Command failed ({$cmd}):\n{$result}");
                }
                return $result;
            case 'json':
                return \json_decode($result, 1);
            default:
                throw new \RuntimeException("Bad decoder format ({$decode})");
        }
    }
    public static function passthru($cmd)
    {
        $cmd = 'cv ' . $cmd;
        $process = \proc_open($cmd, array(0 => \STDIN, 1 => \STDOUT, 2 => \STDERR), $pipes);
        return \proc_close($process);
    }
}
<?php

namespace Civi\Cv\Util;

class Process
{
    public static function sprintf($expr)
    {
        $args = \func_get_args();
        $newArgs = array();
        $newArgs[] = \array_shift($args);
        foreach ($args as $arg) {
            $newArgs[] = \preg_match(';^[a-zA-Z0-9\\.\\/]+$;', $arg) ? $arg : \escapeshellarg($arg);
        }
        return \call_user_func_array('sprintf', $newArgs);
    }
    public static function runDebug($process)
    {
        if (\getenv('DEBUG')) {
            \var_dump(array('Working Directory' => $process->getWorkingDirectory(), 'Command' => $process->getCommandLine()));
            \ob_flush();
        }
        $process->run(function ($type, $buffer) {
            if (\getenv('DEBUG')) {
                if (\Cvphar\Symfony\Component\Process\Process::ERR === $type) {
                    echo 'STDERR > ' . $buffer;
                } else {
                    echo 'STDOUT > ' . $buffer;
                }
                \ob_flush();
            }
        });
        return $process;
    }
    public static function runOk(\Cvphar\Symfony\Component\Process\Process $process)
    {
        self::runDebug($process);
        if (!$process->isSuccessful()) {
            throw new \Civi\Cv\Exception\ProcessErrorException($process);
        }
        return $process;
    }
    public static function runFail(\Cvphar\Symfony\Component\Process\Process $process)
    {
        self::runDebug($process);
        if ($process->isSuccessful()) {
            \Civi\Cv\Util\Process::dump($process);
            throw new \Civi\Cv\Exception\ProcessErrorException($process, "Process succeeded unexpectedly");
        }
        return $process;
    }
    public static function findCommand($name)
    {
        $paths = \explode(\PATH_SEPARATOR, \getenv('PATH'));
        foreach ($paths as $path) {
            if (\file_exists("{$path}/{$name}")) {
                return "{$path}/{$name}";
            }
        }
        return NULL;
    }
    public static function isShellScript($file)
    {
        $firstLine = \file_get_contents($file, \FALSE, NULL, 0, 120);
        list($firstLine) = \explode("\n", $firstLine);
        return (bool) \preg_match(';^#.*bin.*sh;', $firstLine);
    }
    public static function dump(\Cvphar\Symfony\Component\Process\Process $process)
    {
        \var_dump(array('Working Directory' => $process->getWorkingDirectory(), 'Command' => $process->getCommandLine(), 'Exit Code' => $process->getExitCode(), 'Output' => $process->getOutput(), 'Error Output' => $process->getErrorOutput()));
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Process\Process;
use Cvphar\Symfony\Component\Process\Exception\ProcessFailedException;
class UpgradeDlCommand extends \Civi\Cv\Command\BaseCommand
{
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('upgrade:dl')->setDescription('Download CiviCRM code and put it in place for an upgrade')->configureOutputOptions()->addOption('stability', 's', InputOption::VALUE_REQUIRED, 'Specify the stability of the version to get (beta, rc, stable)', 'stable')->addOption('cms', 'c', InputOption::VALUE_REQUIRED, 'Specify the cms to get (Backdrop, Drupal, Drupal6, Joomla, Wordpress) instead of the current site')->addOption('url', 'u', InputOption::VALUE_REQUIRED, 'Specify the URL to a tarball/zipfile for downloading (regardless of --stability and --cms)')->addOption('temploc', NULL, InputOption::VALUE_REQUIRED, 'Specify the location to put the temporary tarball', \sys_get_temp_dir())->setHelp('Download CiviCRM code and put it in place for an upgrade

Examples:
  cv upgrade:dl --stability=rc

Returns a JSON object with the properties:
  downloadedFile   The path to the downloaded archive
  extractedDir     The path to the extracted archive (not performed for Joomla)
  installedTo      The path to the `civicrm` directory of the file upgrade
');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $url = $input->getOption('url');
        if (empty($url)) {
            $stability = $input->getOption('stability');
            $command = "upgrade:get --stability={$stability}";
            $cms = $input->getOption('cms');
            if (!empty($cms)) {
                $command .= " --cms={$cms}";
            }
            $dl = \Civi\Cv\Util\Cv::run($command);
            if (empty($dl['url'])) {
                $error = 'No URL available for downloading';
                $error .= empty($dl['error']) ? '.' : ": {$dl['error']}";
                throw new \RuntimeException($error);
            }
            $url = $dl['url'];
        }
        $vars = empty($dl['vars']) ? \Civi\Cv\Util\Cv::run('vars:show') : $dl['vars'];
        if (empty($cms)) {
            $cms = $vars['CIVI_UF'];
        }
        $temploc = $input->getOption('temploc');
        $filename = \basename($url);
        $got = \file_get_contents($url);
        if ($got === \FALSE) {
            throw new \RuntimeException("Download of {$url} failed.");
        }
        \file_put_contents("{$temploc}/{$filename}", $got);
        $result = array('downloadedFile' => "{$temploc}/{$filename}");
        $dest = $vars['CIVI_CORE'];
        switch ($cms) {
            case 'WordPress':
                $dest = \substr($dest, 0, -8);
            case 'Backdrop':
            case 'Drupal':
            case 'Drupal6':
                if (\substr($dest, -1) != '/') {
                    $dest .= '/';
                }
                $tail = empty($dl['rev']) ? \time() : $dl['rev'];
                $foldername = \pathinfo($filename, \PATHINFO_FILENAME) . $tail;
                $result['extractedDir'] = "{$temploc}/{$foldername}";
                $this->extractAndRsync("{$temploc}/{$filename}", "{$temploc}/{$foldername}", $dest);
                break;
            case 'Joomla':
                $www = \dirname($dest);
                $sitename = \basename($dest);
                $p = new Process("joomla extension:installfile --www {$www} {$sitename} {$temploc}/{$filename}");
                $p->run();
                if (!$p->isSuccessful()) {
                    throw new ProcessFailedException($p);
                }
                break;
        }
        $result['installedTo'] = $dest;
        $this->sendResult($input, $output, $result);
    }
    protected function extractAndRsync($fileloc, $folderloc, $dest)
    {
        if (\pathinfo($fileloc, \PATHINFO_EXTENSION) == 'zip') {
            $command = "unzip {$fileloc} -d {$folderloc}";
        } else {
            $command = "tar -xzf {$fileloc} -C {$folderloc}";
        }
        $p = new Process("mkdir -p {$folderloc} && {$command}");
        $p->run();
        if (!$p->isSuccessful()) {
            throw new ProcessFailedException($p);
        }
        $excludeFiles = array('civicrm.settings.php', 'settings_location.php');
        $command = 'rsync -rl --delete-after';
        foreach ($excludeFiles as $x) {
            $command .= " --exclude {$x}";
        }
        $p = new Process("{$command} {$folderloc}/civicrm/ {$dest}");
        $p->run();
        if (!$p->isSuccessful()) {
            throw new ProcessFailedException($p);
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExtensionEnableCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:enable')->setAliases(['en', 'ext:install'])->setDescription('Enable an extension')->addOption('refresh', 'r', InputOption::VALUE_NONE, 'Refresh the local list of extensions (Default: Only refresh on cache-miss)')->addOption('ignore-missing', NULL, InputOption::VALUE_NONE, 'If a requested extension is missing, skip it')->addArgument('key-or-name', InputArgument::IS_ARRAY, 'One or more extensions to enable. Identify the extension by full key ("org.example.foobar") or short name ("foobar")')->setHelp('Enable an extension

Examples:
  cv ext:enable org.example.foobar
  cv en foobar

Note:
  Beginning circa CiviCRM v4.2+, it has been recommended that extensions
  include a unique long name ("org.example.foobar") and a unique short
  name ("foobar"). However, short names are not strongly guaranteed.
  
  This subcommand does not output parseable data. For parseable output,
  consider using `cv api extension.install`.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $refresh = $input->getOption('refresh') ? 'yes' : 'auto';
        while (\TRUE) {
            if ($refresh === 'yes') {
                $output->writeln("<info>Refreshing extension cache</info>");
                $result = $this->callApiSuccess($input, $output, 'Extension', 'refresh', array('local' => \TRUE, 'remote' => \FALSE));
                if (!empty($result['is_error'])) {
                    return 1;
                }
            }
            list($foundKeys, $missingKeys) = $this->parseKeys($input, $output);
            if ($refresh == 'auto' && !empty($missingKeys)) {
                $output->writeln("<info>Extension cache does not contain requested item(s)</info>");
                $refresh = 'yes';
            } else {
                break;
            }
        }
        if ($missingKeys) {
            if ($input->getOption('ignore-missing')) {
                foreach ($missingKeys as $key) {
                    $output->getErrorOutput()->writeln("<error>Warning: Skipped unrecognized extension \"{$key}\"</error>");
                }
            } else {
                foreach ($missingKeys as $key) {
                    $output->getErrorOutput()->writeln("<error>Error: Unrecognized extension \"{$key}\"</error>");
                }
                return 1;
            }
        }
        foreach ($foundKeys as $key) {
            $output->writeln("<info>Enabling extension \"{$key}\"</info>");
        }
        $result = $this->callApiSuccess($input, $output, 'Extension', 'install', array('keys' => $foundKeys));
        return empty($result['is_error']) ? 0 : 1;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\SetupCommandTrait;
use Civi\Cv\Util\DebugDispatcherTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Question\ConfirmationQuestion;
class CoreUninstallCommand extends \Civi\Cv\Command\BaseCommand
{
    use SetupCommandTrait;
    use DebugDispatcherTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('core:uninstall')->setDescription('Purge CiviCRM schema and settings files')->configureSetupOptions()->addOption('force', 'f', InputOption::VALUE_NONE, 'Remove without any prompt or confirmation')->configureOutputOptions()->setHelp('
Purge CiviCRM schema and settings files

TIP: If you have a special system configuration, it may help to pass the same
options for "core:uninstall" as the preceding "core:install".
');
        $this->configureBootOptions('none');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $setup = $this->bootSetupSubsystem($input, $output);
        $debugEvent = $this->parseOptionalOption($input, ['--debug-event'], NULL, '');
        if ($debugEvent !== NULL) {
            $eventNames = $this->findEventNames($setup->getDispatcher(), $debugEvent);
            $this->printEventListeners($output, $setup->getDispatcher(), $eventNames);
            return 0;
        }
        $installed = $setup->checkInstalled();
        if (!$installed->isDatabaseInstalled() && !$installed->isSettingInstalled()) {
            $output->writeln("<comment>CiviCRM does not appear to be installed.</comment>");
            return 0;
        }
        if ($installed->isDatabaseInstalled()) {
            $output->writeln(\sprintf("<info>Found <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
        }
        if ($installed->isSettingInstalled()) {
            $output->writeln(\sprintf("<info>Found <comment>%s</comment> in <comment>%s</comment></info>", \basename($setup->getModel()->settingsPath), \dirname($setup->getModel()->settingsPath)));
        }
        if (!$input->getOption('force')) {
            $output->writeln('');
            $helper = $this->getHelper('question');
            $question = new ConfirmationQuestion('<comment>Are you sure want to purge the CiviCRM database and data files? Data may be permanently destroyed.</comment> (y/N) ', \FALSE);
            if (!$helper->ask($input, $output, $question)) {
                $output->writeln("<comment>Aborted</comment>");
                return 1;
            }
        }
        if ($installed->isDatabaseInstalled()) {
            $output->writeln(\sprintf("<info>Removing <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
            $setup->uninstallDatabase();
        }
        if ($installed->isSettingInstalled()) {
            $output->writeln(\sprintf("<info>Removing <comment>%s</comment> from <comment>%s</comment></info>", \basename($setup->getModel()->settingsPath), \dirname($setup->getModel()->settingsPath)));
            $setup->uninstallFiles();
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class AngularHtmlListCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ang:html:list')->setAliases(array())->setDescription('List Angular HTML files')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'list', 'defaultColumns' => 'file'])->addArgument('filter', InputArgument::OPTIONAL, 'Filter by filename. For regex filtering, use semicolon delimiter.')->setHelp('List Angular HTML files

Examples:
  cv ang:html:list
  cv ang:html:list crmUi/*
  cv ang:html:list \';(tabset|wizard)\\.html;\'
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!$input->getOption('user')) {
            $output->getErrorOutput()->writeln("<comment>For a full list, try passing --user=[username].</comment>");
        }
        $columns = \explode(',', $input->getOption('columns'));
        $records = $this->sort($this->find($input), $columns);
        $this->sendTable($input, $output, $records, $columns);
        return 0;
    }
    protected function find($input)
    {
        $regex = $input->getArgument('filter') ? $this->createRegex($input->getArgument('filter')) : NULL;
        $ang = \Civi::service('angular');
        $rows = array();
        foreach ($ang->getModules() as $name => $module) {
            $partials = $ang->getPartials($name);
            foreach ($partials as $file => $html) {
                $rows[] = array('file' => \preg_replace(';^~/;', '', $file), 'module' => $name, 'ext' => $module['ext']);
            }
        }
        $rows = \array_filter($rows, function ($row) use($regex) {
            if ($regex) {
                if (!\preg_match($regex, $row['file'])) {
                    return \FALSE;
                }
            }
            return \TRUE;
        });
        return $rows;
    }
    protected function sort($rows, $orderByColumns)
    {
        \usort($rows, function ($a, $b) use($orderByColumns) {
            foreach ($orderByColumns as $col) {
                if ($a[$col] < $b[$col]) {
                    return -1;
                }
                if ($a[$col] > $b[$col]) {
                    return 1;
                }
            }
            return 0;
        });
        return $rows;
    }
    protected function createRegex($filterExpr)
    {
        if ($filterExpr[0] === ';') {
            return $filterExpr;
        }
        $regex = \preg_quote($filterExpr, ';');
        $regex = \str_replace('\\*', '[^/]*', $regex);
        $regex = ";^{$regex}.*\$;";
        return $regex;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class UpgradeCommand extends \Civi\Cv\Command\BaseCommand
{
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('upgrade')->setDescription('Download CiviCRM and upgrade the site')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions()->addOption('stability', 's', InputOption::VALUE_REQUIRED, 'Specify the stability of the version to get (nightly, rc, stable)', 'stable')->setHelp('Download CiviCRM, extract in place, and upgrade the site, notifying civicrm.org
Examples:
  cv upgrade --stability=rc
');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        throw new \RuntimeException("FIXME: Calls to run() should be escaped, e.g. with Process::sprintf()");
        $exitCode = 0;
        $stage = 'Start';
        $result = array();
        $reportName = \Civi\Cv\Util\Rand::createName();
        try {
            $stability = $input->getOption('stability');
            $stage = 'Lookup';
            $dl = \Civi\Cv\Util\Cv::run("upgrade:get --stability={$stability}");
            $result['dl-data'] = $dl;
            if (!empty($dl['error'])) {
                throw new \RuntimeException($dl['error'], 1);
            }
            $stage = 'Start report';
            $startReport = \Civi\Cv\Util\Cv::run("upgrade:report --started --revision={$dl['rev']} --name={$reportName}");
            $stage = 'Download and extract';
            $extract = \Civi\Cv\Util\Cv::run("upgrade:dl --url={$dl['url']}");
            $result['extract-data'] = $extract;
            $stage = 'Download report';
            $dlReport = \Civi\Cv\Util\Cv::run("upgrade:report --downloaded --download-url {$dl['url']} --extracted --name {$reportName}");
            $stage = 'Database upgrade';
            $db = \Civi\Cv\Util\Cv::run("upgrade:db");
            $result['db-upgrade'] = $db;
            $messageFile = \sys_get_temp_dir() . "/upgrademessages-{$reportName}.html";
            \file_put_contents($messageFile, $db['message']);
            $stage = 'Upgrade report';
            $finishReport = \Civi\Cv\Util\Cv::run("upgrade:report --upgraded --upgrade-messages {$messageFile} --name {$reportName}");
            $stage = 'Cleanup';
            \unlink($messageFile);
        } catch (\RuntimeException $e) {
            $exitCode = 1;
            $result['error-stage'] = $stage;
            $result['error-message'] = $e->getMessage();
            $problem = "{$stage} problem: {$result['error_message']}";
            $result['fail-report'] = \Civi\Cv\Util\Cv::run("upgrade:report --failed --problem-message '{$problem}' --name {$reportName}");
        }
        $this->sendResult($input, $output, $result);
        return $exitCode;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ApiBatchCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    public $defaults = [];
    public $metaDefaults = ['v3' => ['version' => 3], 'v4' => ['version' => 4, 'checkPermissions' => \FALSE]];
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('api:batch')->setDescription('Call multiple APIs via STDIN/STDOUT (bidirectional pipe; batch mode)')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (json)', 'json')->addOption('out', NULL, InputOption::VALUE_REQUIRED, 'Output format (json)', 'json')->addOption('defaults', NULL, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Set default options for all requests (Either string \'v3\', \'v4\', or a JSON object \'{key:value...}\'', ['v3'])->setHelp('Call multiple APIs via STDIN/STDOUT (bidirectional pipe; batch mode)

The api:batch command implements a line-oriented protocol for running CiviCRM APIs using pipes. In basic form, you may pipe in JSON:

Example: APIv3
  echo \'[["Contact","get",{"id":100}],["Contact","get",{"id":101}]]\' | cv api:batch

Example: APIv4
  echo \'[["Contact","get",{"where":[["id","=",100]]}]]\' | cv api:batch --defaults=v4

Example: Extra defaults
  echo \'[["Contact","get",{"where":[["id","=",100]]}]]\' | cv api:batch --defaults=\'{"version":4,"checkPermissions":true}\'

More advanced consumers may use bi-directional piping to send and receive multiple, dynamic calls - without requiring multiple bootstraps.

Protocol:

* Client may submit multiple lines of input (separated by \\n).
* Each line is executed synchronously. Caller should write one line and then read one line.
* Each line of input is a JSON document, listing a batch of API requests.
* Each line of output is a JSON document, listing a batch of API responses.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('in') !== 'json' || $input->getOption('out') !== 'json') {
            throw new \Exception("api:batch only supports JSON dialog");
        }
        $this->boot($input, $output);
        $addDefault = function ($v) {
            $this->defaults = \CRM_Utils_Array::crmArrayMerge($v, $this->defaults);
        };
        foreach ((array) $input->getOption('defaults') as $dflExpr) {
            if (isset($this->metaDefaults[$dflExpr])) {
                $addDefault($this->metaDefaults[$dflExpr]);
            } elseif ($dflExpr[0] === '{') {
                if (($parsed = \json_decode($dflExpr, 1)) !== NULL) {
                    $addDefault($parsed);
                } else {
                    throw new \Exception("Malformed defaults (JSON): {$dflExpr}");
                }
            } else {
                throw new \Exception("Malformed defaults: {$dflExpr}");
            }
        }
        if ($output->isVerbose()) {
            \fwrite(\STDERR, \sprintf("Set API defaults: %s\n", \json_encode($this->defaults, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)));
        }
        $lineNum = 0;
        while (\FALSE !== ($line = \fgets(\STDIN))) {
            $lineNum++;
            $line = \trim($line);
            if (empty($line)) {
                continue;
            }
            $todos = \json_decode($line, \TRUE);
            $result = array();
            if ($todos === NULL) {
                \fwrite(\STDERR, \sprintf("JSON cannot be decoded (line {$lineNum})"));
            } else {
                foreach ($todos as $k => $api) {
                    if (!\is_array($api) || !isset($api[1]) || !\is_string($api[0]) || !\is_string($api[1])) {
                        \fwrite(\STDERR, "JSON data is structured incorrectly (line {$lineNum})\n");
                        $result[$k] = array('is_error' => 1, 'error_message' => "JSON data is structured incorrectly (line {$lineNum})");
                        continue;
                    }
                    list($entity, $action, $params) = $api;
                    $params = \CRM_Utils_Array::crmArrayMerge($params, $this->defaults);
                    if ($output->isVerbose()) {
                        \fwrite(\STDERR, \sprintf("Execute API calls: %s\n", \json_encode([$entity, $action, $params], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)));
                    }
                    $result[$k] = \civicrm_api($entity, $action, $params);
                }
            }
            echo \json_encode($result);
            echo "\n";
            if (\ob_get_level() > 0) {
                \ob_flush();
            }
            \flush();
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\Process;
use Civi\Cv\Util\StructuredOutputTrait;
use Civi\Cv\Util\UrlCommandTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class UrlCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    use StructuredOutputTrait;
    use UrlCommandTrait;
    protected function configure()
    {
        $this->setName('url')->setAliases(['open'])->setDescription('Compose a URL to a CiviCRM page. (Optionally, open in a browser.)')->configureOutputOptions(['tabular' => \TRUE, 'availColumns' => 'type,expr,value', 'shortcuts' => ['table', 'list']])->configureUrlOptions()->addOption('open', 'O', InputOption::VALUE_NONE, 'Open a local web browser')->addOption('tabular', NULL, InputOption::VALUE_NONE, 'Force display in multi-record mode. (Enabled by default for list,csv,table formats.)')->setHelp('
Compose a URL to a CiviCRM page or resource.

Examples: Lookup the site root
  cv url

Examples: Lookup URLs with the standard router
  cv url civicrm/dashboard
  cv url \'civicrm/a/#/mailing/123?angularDebug=1\'
  cv url civicrm/dashboard --user=bob --login

Examples: Open URLs in a local browser (Linux/OSX)
  cv open civicrm/dashboard
  cv open civicrm/dashboard --user=bob --login
  cv url civicrm/dashboard --open

Examples: Lookup URLs for extension resources
  cv url -x org.civicrm.module.cividiscount
  cv url -x cividiscount
  cv url -x cividiscount/css/example.css

Examples: Lookup URLs using configuration properties
  cv url -c imageUploadURL
  cv url -c imageUploadURL/example.png

Examples: Lookup URLs using dynamic expressions
  cv url -d \'[civicrm.root]/extern/ipn.php\'
  cv url -d \'[civicrm.files]\'
  cv url -d \'[cms.root]/index.php\'

Examples: Lookup multiple URLs
  cv url -x cividiscount -x volunteer civicrm/admin --out=table
  cv url -x cividiscount -x volunteer civicrm/admin --out=json --tabular


NOTE: To change the default output format, set CV_OUTPUT.

NOTE: If you use `--login` and do not have `authx`, then it prompts about
      enabling the extension. The extra I/O may influence some scripted
      use-cases.
');
        $this->configureBootOptions();
    }
    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        if ($input->getFirstArgument() === 'open') {
            $input->setOption('open', \TRUE);
        }
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (\in_array($input->getOption('out'), Encoder::getTabularFormats()) && !\in_array($input->getOption('out'), Encoder::getFormats())) {
            $input->setOption('tabular', \TRUE);
        }
        $this->boot($input, $output);
        $rows = $this->createUrls($input, $output);
        if ($input->getOption('open')) {
            $cmd = $this->pickCommand();
            if (!$cmd) {
                throw new \RuntimeException("Failed to locate 'xdg-open' or 'open'. Open not supported on this system.");
            }
            foreach ($rows as $row) {
                if (!empty($row['value'])) {
                    $escaped = \escapeshellarg($row['value']);
                    Process::runOk(new \Cvphar\Symfony\Component\Process\Process("{$cmd} {$escaped}"));
                }
            }
        }
        if ($input->getOption('tabular')) {
            $columns = $this->parseColumns($input, array('list' => array('value')));
            $this->sendTable($input, $output, $rows, $columns);
        } else {
            if (\count($rows) !== 1) {
                $output->getErrorOutput()->writeln('<error>Detected multiple URLs. You must specify --tabular.</error>');
                return 1;
            } else {
                $this->sendResult($input, $output, $rows[0]['value']);
            }
        }
        return \in_array(NULL, $rows) ? 1 : 0;
    }
    protected function pickCommand($commands = array('xdg-open', 'open'))
    {
        $paths = \explode(\PATH_SEPARATOR, \getenv('PATH'));
        foreach ($commands as $cmd) {
            foreach ($paths as $path) {
                $file = $path . \DIRECTORY_SEPARATOR . $cmd;
                if (\is_file($file)) {
                    return $cmd;
                }
            }
        }
        return NULL;
    }
}
<?php

namespace Civi\Cv\Command;

use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExtensionUpgradeDbCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:upgrade-db')->setAliases(array())->setDescription('Apply DB upgrades for any extensions')->setHelp('Apply DB upgrades for any extensions

Examples:
  cv ext:upgrade-db

Note:
  This subcommand does not output parseable data. For parseable output,
  consider using `cv api extension.upgrade`.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $output->writeln("<info>Applying database upgrades from extensions</info>");
        $result = $this->callApiSuccess($input, $output, 'Extension', 'upgrade', array());
        if (!empty($result['is_error'])) {
            return 1;
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Civi\Cv\Util\UrlCommandTrait;
use GuzzleHttp\Client;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class HttpCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    use StructuredOutputTrait;
    use UrlCommandTrait;
    protected function configure()
    {
        $this->setName('http')->setDescription('Send an HTTP request')->configureUrlOptions()->addOption('request', 'X', InputOption::VALUE_REQUIRED, 'HTTP Request Method (GET, POST, etc)')->addOption('data', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'HTTP Request Data')->addOption('header', 'H', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'HTTP Request Header')->addOption('authx-flow', NULL, InputOption::VALUE_REQUIRED, 'How to present authentication credentials [header, login, param, xheader]', 'xheader')->setHelp('
Request a page or resource via HTTP.

Examples:
  cv http get civicrm/dashboard
  cv http -x get cividiscount/css/example.css
  cv http post -d \'[civicrm.root]/extern/ipn.php\'
  cv http get -d \'[civicrm.files]/foo.txt\'

NOTE: For a longer list of example URLs, see `cv url --help`

NOTE: Some defaults change depending the presence of --data:
      Without --data, the default verb is GET.
      With --data, the default verb is POST, and the default `Content-Type`
      is `application/x-www-form-urlencoded`

NOTE: If you use `--login` and do not have `authx`, then it prompts about
      enabling the extension. The extra I/O may influence some scripted
      use-cases.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $method = $input->getOption('request');
        $data = $this->parseRequestData($input);
        $headers = $this->parseRequestHeaders($input);
        if ($data) {
            $headers['Content-Length'] = \strlen($data);
            $headers['Content-Type'] = $headers['Content-Type'] ?? 'application/x-www-form-urlencoded';
        }
        if (empty($method)) {
            $method = $data === NULL ? 'GET' : 'POST';
        }
        $rows = $this->createUrls($input, $output, \FALSE);
        foreach ($rows as $row) {
            $statusCode = $this->sendRequest($output, $method, $row['value'], \array_merge($headers, $row['headers'] ?? []), $data);
            return $statusCode >= 200 && $statusCode < 300 ? 0 : $statusCode;
        }
    }
    protected function sendRequest(OutputInterface $output, string $method, string $url, array $headers = [], ?string $body = NULL) : int
    {
        $method = \strtoupper($method);
        $errorOutput = \is_callable([$output, 'getErrorOutput']) ? $output->getErrorOutput() : $output;
        $verbose = function (string $text) use($errorOutput) {
            $errorOutput->writeln($text, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_VERBOSE);
        };
        $verbose("> {$method} {$url}");
        foreach ($headers as $name => $value) {
            $verbose("> {$name}: {$value}");
        }
        $c = new Client();
        $response = $c->request($method, $url, ['http_errors' => \FALSE, 'headers' => $headers, 'body' => $body]);
        $verbose('< HTTP/' . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
        foreach ($response->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                $verbose("< {$name}: {$value}");
            }
        }
        $body = $response->getBody();
        while (!$body->eof()) {
            $output->write($body->read(16 * 1024));
        }
        return $response->getStatusCode();
    }
    protected function parseRequestData(InputInterface $input) : ?string
    {
        $inputData = $input->getOption('data');
        $data = NULL;
        if (!empty($inputData)) {
            foreach ($inputData as $datum) {
                $data = \is_null($data) ? '' : "{$data}&";
                if ($datum === '-') {
                    $data .= \file_get_contents('php://stdin');
                } elseif ($datum[0] === '@') {
                    $file = \substr($datum, 1);
                    if (!\file_exists($file) || !\is_readable($file)) {
                        throw new \RuntimeException("Cannot read file: {$file}");
                    }
                    $data .= \file_get_contents($file);
                } else {
                    $data .= $datum;
                }
            }
        }
        return $data;
    }
    protected function parseRequestHeaders(InputInterface $input) : array
    {
        $headers = [];
        foreach ($input->getOption('header') as $str) {
            [$key, $value] = \explode(':', $str, 2);
            $headers[$key] = \ltrim($value, ' ');
        }
        return $headers;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Config;
use Civi\Cv\Encoder;
use Civi\Cv\SiteConfigReader;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class FillCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected $fields;
    protected $defaults;
    protected function configure()
    {
        $this->setName('vars:fill')->setDescription('Generate a configuration file for any missing site data')->addOption('file', NULL, InputOption::VALUE_REQUIRED, 'Read existing configuration from a file');
        $this->configureBootOptions();
    }
    public function __construct($name = NULL)
    {
        parent::__construct($name);
        $this->defaults = array('ADMIN_EMAIL' => 'admin@example.com', 'ADMIN_PASS' => 't0ps3cr3t', 'ADMIN_USER' => 'admin', 'CIVI_CORE' => '', 'CIVI_DB_DSN' => 'mysql://dbUser:dbPass@dbHost/dbName?new_link=true', 'CIVI_FILES' => '', 'CIVI_SETTINGS' => '', 'CIVI_SITE_KEY' => '', 'CIVI_TEMPLATEC' => '', 'CIVI_UF' => '', 'CIVI_URL' => '', 'CIVI_VERSION' => '', 'CMS_DB_DSN' => 'mysql://dbUser:dbPass@dbHost/dbName?new_link=true', 'CMS_ROOT' => '', 'CMS_TITLE' => 'Untitled installation', 'CMS_URL' => '', 'CMS_VERSION' => '', 'DEMO_EMAIL' => 'demo@example.com', 'DEMO_PASS' => 't0ps3cr3t', 'DEMO_USER' => 'demo', 'IS_INSTALLED' => '1', 'SITE_TOKEN' => \md5(\openssl_random_pseudo_bytes(256)), 'SITE_TYPE' => '', 'TEST_DB_DSN' => 'mysql://dbUser:dbPass@dbHost/dbName?new_link=true');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!$input->getOption('file')) {
            $reader = new SiteConfigReader(CIVICRM_SETTINGS_PATH);
            $liveData = $reader->compile(array('buildkit', 'home', 'active'));
        } else {
            $file = $input->getOption('file');
            if (\strpos($file, '://') !== \FALSE) {
                throw new \RuntimeException("Failed to extract current configuration.");
            }
            if ($file === '/dev/stdin') {
                $file = 'php://stdin';
            }
            $liveData = \json_decode(\file_get_contents($file), 1);
        }
        if ($liveData === NULL) {
            throw new \RuntimeException("Failed to extract current configuration.");
        }
        $siteConfig = array();
        foreach ($this->defaults as $field => $value) {
            if (!isset($liveData[$field])) {
                $siteConfig[$field] = $value;
            }
        }
        $output->writeln(\sprintf("<info>Site:</info> %s", CIVICRM_SETTINGS_PATH));
        if (empty($siteConfig)) {
            $output->writeln("<info>No extra fields are required.</info>");
        } else {
            $output->writeln(\sprintf("<info>These fields were missing. Setting defaults:</info>"));
            $output->writeln(Encoder::encode($siteConfig, 'json-pretty'));
            Config::update(function ($config) use($siteConfig, $output) {
                if (isset($config['sites'][CIVICRM_SETTINGS_PATH])) {
                    $config['sites'][CIVICRM_SETTINGS_PATH] = \array_merge($siteConfig, $config['sites'][CIVICRM_SETTINGS_PATH]);
                } else {
                    $config['sites'][CIVICRM_SETTINGS_PATH] = $siteConfig;
                }
                \ksort($config['sites'][CIVICRM_SETTINGS_PATH]);
                return $config;
            });
            $output->writeln(\sprintf("<info>Please edit</info> %s", Config::getFileName()));
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExtensionDisableCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:disable')->setAliases(array('dis'))->setDescription('Disable an extension')->addArgument('key-or-name', InputArgument::IS_ARRAY, 'One or more extensions to enable. Identify the extension by full key ("org.example.foobar") or short name ("foobar")')->setHelp('Disable an extension

Examples:
  cv ext:disable org.example.foobar
  cv dis foobar

Note:
  Beginning circa CiviCRM v4.2+, it has been recommended that extensions
  include a unique long name ("org.example.foobar") and a unique short
  name ("foobar"). However, short names are not strongly guaranteed.

  This subcommand does not output parseable data. For parseable output,
  consider using `cv api extension.disable`.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        list($foundKeys, $missingKeys) = $this->parseKeys($input, $output);
        $disableKeys = \array_merge($foundKeys, \preg_grep('/\\./', $missingKeys));
        $missingKeys = \preg_grep('/\\./', $missingKeys, \PREG_GREP_INVERT);
        foreach ($missingKeys as $key) {
            $output->writeln("<comment>Ignoring unrecognized extension \"{$key}\"</comment>");
        }
        foreach ($disableKeys as $key) {
            $output->writeln("<info>Disabling extension \"{$key}\"</info>");
        }
        $result = $this->callApiSuccess($input, $output, 'Extension', 'disable', array('keys' => $disableKeys));
        return empty($result['is_error']) ? 0 : 1;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\Relativizer;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
class DebugContainerCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('service')->setAliases(['svc'])->setDescription('Inspect the service container')->addArgument('name', InputArgument::OPTIONAL, 'An service name or regex')->addOption('concrete', 'C', InputOption::VALUE_NONE, 'Display concrete class names. (This requires activating every matching service.)')->addOption('internal', 'i', InputOption::VALUE_NONE, 'Include internal services')->addOption('tag', NULL, InputOption::VALUE_REQUIRED, 'Find services by tag.')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'table'])->setHelp('
Dump the container configuration

NOTE: By default, internal services are not displayed. However, some flags will enable display of
internal services (eg `--all`, `--tag=XXX`, or `-v`).
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        \define('CIVICRM_CONTAINER_CACHE', 'never');
        $output->getErrorOutput()->writeln('<comment>The debug command ignores the container cache.</comment>');
        $this->boot($input, $output);
        $c = $this->getInspectableContainer($input);
        $filterPat = $input->getArgument('name');
        if (empty($filterPat)) {
            $filter = function (Definition $definition, string $name) {
                return \TRUE;
            };
        } elseif ($filterPat[0] === '/') {
            $filter = function (Definition $definition, string $name) use($filterPat) {
                return (bool) \preg_match($filterPat, $name);
            };
        } else {
            $filter = function (Definition $definition, string $name) use($filterPat) {
                return $name === $filterPat;
            };
        }
        if ($output->isVerbose() || $input->getOption('tag')) {
            $input->setOption('internal', \TRUE);
        }
        if ($input->getOption('tag')) {
            $filter = function (Definition $definition, string $name) use($filter, $input) {
                return $definition->getTag($input->getOption('tag')) && $filter($definition, $name);
            };
        }
        if (!$input->getOption('internal')) {
            $filter = function (Definition $definition, string $name) use($filter) {
                if (!$definition->isPublic() || $definition->getTag('internal')) {
                    return \FALSE;
                }
                return $filter($definition, $name);
            };
        }
        $definitions = $c->getDefinitions();
        $definitions = \array_filter($definitions, $filter, \ARRAY_FILTER_USE_BOTH);
        \ksort($definitions);
        if ($output->isVerbose()) {
            $this->showVerboseReport($input, $output, $definitions);
        } else {
            $this->showBasicReport($input, $output, $definitions);
        }
    }
    public function showBasicReport(InputInterface $input, OutputInterface $output, array $definitions) : void
    {
        $rows = [];
        foreach ($definitions as $name => $definition) {
            $events = $this->getEvents($definition);
            $extras = array();
            if ($this->getFactory($definition) !== NULL) {
                $extras[] = 'factory';
            }
            if ($definition->getMethodCalls()) {
                $extras[] = \sprintf("calls[%s]", \count($definition->getMethodCalls()));
            }
            if ($definition->getTags()) {
                $extras[] = \sprintf("tag[%s]", \implode(' ', \array_keys($definition->getTags())));
            }
            $class = $input->getOption('concrete') ? \get_class(\Civi::service($name)) : $definition->getClass();
            $rows[] = array('service' => $name, 'class' => $class, 'events' => $events ? \count($events) : '', 'extras' => \implode(' ', $extras));
        }
        $this->sendTable($input, $output, $rows, array('service', 'class', 'events', 'extras'));
    }
    public function showVerboseReport(InputInterface $input, OutputInterface $output, array $definitions) : void
    {
        $relativizer = new Relativizer();
        foreach ($definitions as $name => $definition) {
            $class = $input->getOption('concrete') && $definition->isPublic() ? \get_class(\Civi::service($name)) : $definition->getClass();
            if (\class_exists($class)) {
                $classFile = (new \ReflectionClass($class))->getFileName();
                $classFile = $input->getOption('concrete') ? $classFile : $relativizer->filter($classFile);
            } else {
                $classFile = '?';
            }
            $row = [];
            $row[] = ['key' => 'service', 'value' => $name];
            $row[] = ['key' => 'class', 'value' => $class];
            $row[] = ['key' => 'class-file', 'value' => $classFile];
            foreach ($definition->getTags() as $tag => $tagData) {
                $row[] = ['key' => "tag[{$tag}]", 'value' => $tagData];
            }
            foreach ($this->getEvents($definition) as $eventName => $eventValue) {
                $row[] = ['key' => "event[{$eventName}]", 'value' => $this->toPrintableData($eventValue)];
            }
            if ($factory = $this->getFactory($definition)) {
                $row[] = ['key' => 'factory', 'value' => $this->toPrintableData($factory)];
            }
            foreach ($definition->getMethodCalls() as $n => $call) {
                $row[] = ['key' => "call", 'value' => $this->toPrintableData($call)];
            }
            $this->sendTable($input, $output, $row);
        }
    }
    protected function toPrintableData($item)
    {
        if ($item instanceof Reference) {
            return '$(' . $item . ')';
        } elseif ($item instanceof ServiceClosureArgument) {
            return $this->toPrintableData($item->getValues());
        } elseif (\is_array($item)) {
            $r = [];
            foreach ($item as $key => $value) {
                $r[$key] = $this->toPrintableData($value);
            }
            return $r;
        } elseif (\is_scalar($item) || $item instanceof \stdClass) {
            return $item;
        }
        return '(' . \gettype($item) . ')';
    }
    /**
    @parm
    */
    protected function getInspectableContainer(InputInterface $input) : \Symfony\Component\DependencyInjection\ContainerBuilder
    {
        $container = (new \Civi\Core\Container())->createContainer();
        if (\version_compare(\CRM_Utils_System::version(), '4.7.0', '<')) {
            throw new \RuntimeException("Container inspection is only supported on 4.7.0+.");
        }
        if (\is_callable([$container, 'getCompilerPassConfig'])) {
            $passConfig = $container->getCompilerPassConfig();
            $removingPasses = \array_filter($passConfig->getRemovingPasses(), function ($pass) {
                return !$pass instanceof \Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass;
            });
            $passConfig->setRemovingPasses($removingPasses);
        }
        $container->compile();
        return $container;
    }
    protected function getEvents($definition) : array
    {
        if (\class_exists('Civi\\Core\\Event\\EventScanner')) {
            if ($definition->getTag('event_subscriber') || $definition->getTag('kernel.event_subscriber')) {
                return \Civi\Core\Event\EventScanner::findListeners($definition->getClass());
            }
        }
        return [];
    }
    protected function getFactory(Definition $definition)
    {
        if (\is_callable([$definition, 'getFactory'])) {
            return $definition->getFactory();
        }
        foreach (['getFactoryClass', 'getFactoryMethod', 'getFactoryService'] as $factoryCheck) {
            if (\is_callable([$definition, $factoryCheck]) && $definition->{$factoryCheck}()) {
                return 'yes';
            }
        }
        return NULL;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Application;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class CliCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected function configure()
    {
        $this->setName('cli')->setDescription('Load interactive command line');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $cv = new Application();
        $sh = new \Cvphar\Psy\Shell();
        $sh->addCommands($cv->createCommands());
        $sh->run();
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\SettingTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SettingSetCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    use SettingTrait;
    protected function configure()
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->setName('setting:set')->setAliases(['vset'])->setDescription('Update CiviCRM settings')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions(['tabular' => \TRUE, 'shortcuts' => ['table', 'list'], 'fallback' => 'table', 'availColumns' => 'scope,key,value,default,explicit,mandatory,layer', 'defaultColumns' => 'scope,key,value,layer'])->addOption('dry-run', 'N', InputOption::VALUE_NONE, 'Preview the API call. Do not execute.')->addOption('scope', NULL, InputOption::VALUE_REQUIRED, 'Domain to configure', 'domain')->addArgument('key=value', InputArgument::IS_ARRAY)->setHelp("Update CiviCRM settings\n\nIf you'd like to inspect the behavior more carefully, try using {$I}--dry-run{$_I} ({$I}-N{$_I}).\n\n{$C}Specification: Piped JSON{$_C}\n\n    {$C}echo{$_C} {$I}JSON{$_I} | {$C}cv setting:set{$_C} {$C}--in=json{$_C}\n\n{$C}Specification: JSON-ish Key-Value{$_C}\n\n    {$C}cv setting:set{$_C} [{$I}KEY{$_I}={$I}VALUE{$_I}]... [{$I}JSON-OBJECT{$_I}]...\n\n    Use {$I}KEY{$_I}={$I}VALUE{$_I} to set an input to a specific value. The value may be a bare string\n    or it may be JSON (beginning with '[' or '{' or '\"').\n\n    Use {$I}JSON-OBJECT{$_I} if you want to pass several fields as one pure JSON string.\n    A parameter which begins with '{' will be interpreted as a JSON expression.\n\n{$C}Specification: +Options{$_C}\n\n    {$C}cv setting:set {$_C}[{$C}+{$_C}{$I}OP{$_I}{$C} {$_C}{$I}EXPR{$_I}]...\n\n    If you have a setting that includes structured data (e.g. objects or lists),\n    then you may wish to update individual elements within the setting. Use a \"+Option\".\n\n    Option         Examples\n    {$C}+o{$_C}|{$C}+object{$_C}     {$C}+o{$_C} {$I}mailing_backend.smtpServer{$_I}{$C}={$_C}{$I}example.com{$_I}  (modify \"smtpServer\")\n                   {$C}+o{$_C} {$C}!{$_C}{$I}mailing_backend.smtpServer{$_I}             (remove \"smtpServer\")\n    {$C}+l{$_C}|{$C}+list{$_C}       {$C}+l{$_C} {$I}contact_reference_options{$_I}{$C}[]={$_C}{$I}3{$_I}           (append value \"3\")\n                   {$C}+l{$_C} {$I}contact_reference_options{$_I}{$C}+={$_C}{$I}3{$_I}            (append value \"3\")\n                   {$C}+l{$_C} {$I}contact_reference_options{$_I}{$C}-={$_C}{$I}3{$_I}            (remove value \"3\")\n                   {$C}+l{$_C} {$I}contact_reference_options.0{$_I}{$C}={$_C}{$I}3{$_I}           (modify 0th value)\n                   {$C}+l{$_C} {$C}!{$_C}{$I}contact_reference_options.0{$_I}            (remove 0th value)\n\n{$C}Setting Scope{$_C}\n\n    All CiviCRM settings are formally attached to a scope, such as a {$I}Contact{$_I} or {$I}Domain{$_I}.\n    For most tasks in most deployments, there is only one important scope ({$I}domain #1{$_I}).\n    In some edge-cases, you may need to target a specific scope Here are some example scopes:\n\n    {$C}cv setting:set --scope={$_C}{$I}domain{$_I}                             (default domain)\n    {$C}cv setting:set --scope={$_C}{$I}domain:*{$_I}                           (all domains)\n    {$C}cv setting:set --scope={$_C}{$I}domain:12{$_I}                          (domain #12)\n    {$C}cv setting:set --scope={$_C}{$I}contact{$_I}{$C} --user={$_C}{$I}admin{$_I}               (admin's contact)\n    {$C}cv setting:set --scope={$_C}{$I}contact:201{$_I}                        (contact #201)\n");
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->boot($input, $output);
        $errorOutput = \is_callable([$output, 'getErrorOutput']) ? $output->getErrorOutput() : $output;
        $result = [];
        foreach ($this->findSettings($input->getOption('scope')) as $settingScope => $settingBag) {
            $meta = $this->getMetadata($settingScope);
            $params = $this->parseSettingParams($input, $settingBag, $meta);
            if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
                $output->writeln("{$I}Params{$_I}: " . \json_encode($params, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
            }
            foreach ($params as $settingKey => $settingValue) {
                [$encode, $decode] = $this->codec($meta, $settingKey);
                if ($settingBag->getMandatory($settingKey) !== NULL) {
                    $errorOutput->writeln("<comment>WARNING: \"{$settingKey}\" has a mandatory override. Stored settings may be inoperative.</comment>");
                }
                if (!$input->getOption('dry-run')) {
                    $settingBag->set($settingKey, $encode($settingValue));
                }
                $row = ['scope' => $settingScope, 'key' => $settingKey, 'value' => $input->getOption('dry-run') ? $decode($settingBag->getMandatory($settingKey)) ?: $settingValue : $decode($settingBag->get($settingKey)), 'default' => $decode($settingBag->getDefault($settingKey)), 'explicit' => $input->getOption('dry-run') ? $settingValue : $decode($settingBag->getExplicit($settingKey)), 'mandatory' => $decode($settingBag->getMandatory($settingKey)), 'layer' => $settingBag->getMandatory($settingKey) !== NULL ? 'mandatory' : ($settingBag->hasExplict($settingKey) ? 'explicit' : 'default')];
                $result[] = $row;
            }
        }
        $this->sendSettings($input, $output, $result);
        return 0;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\OptionCallbackTrait;
use Cvphar\Symfony\Component\Console\Command\Command;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Style\SymfonyStyle;
class BaseCommand extends Command
{
    use OptionCallbackTrait;
    private $io;
    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->io = new SymfonyStyle($input, $output);
        $this->runOptionCallbacks($input, $output);
    }
    protected function getIO()
    {
        return $this->io;
    }
    protected function assertBooted()
    {
        if (!$this->isBooted()) {
            throw new \Exception("Error: This command requires bootstrapping, but the system does not appear to be bootstrapped. Perhaps you set --level=none?");
        }
    }
    protected function callApiSuccess(InputInterface $input, OutputInterface $output, $entity, $action, $params)
    {
        $this->assertBooted();
        $params['debug'] = 1;
        if (!isset($params['version'])) {
            $params['version'] = 3;
        }
        $output->writeln("Calling {$entity} {$action} API", OutputInterface::VERBOSITY_DEBUG);
        $result = \civicrm_api($entity, $action, $params);
        if (!empty($result['is_error']) || $output->isDebug()) {
            $data = array('entity' => $entity, 'action' => $action, 'params' => $params, 'result' => $result);
            if (!empty($result['is_error'])) {
                $output->getErrorOutput()->writeln("<error>Error: API Call Failed</error>: " . Encoder::encode($data, 'pretty'));
            } else {
                $output->writeln("API success" . Encoder::encode($data, 'pretty'), OutputInterface::VERBOSITY_DEBUG);
            }
        }
        return $result;
    }
    public function parseOptionalOption(InputInterface $input, $rawNames, $omittedDefault, $activeDefault)
    {
        $value = NULL;
        foreach ($rawNames as $rawName) {
            if ($input->hasParameterOption($rawName)) {
                if (NULL === $input->getParameterOption($rawName)) {
                    return $activeDefault;
                } else {
                    return $input->getParameterOption($rawName);
                }
            }
        }
        return $omittedDefault;
    }
    protected function isBooted()
    {
        return \defined('CIVICRM_DSN');
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\SetupCommandTrait;
use Civi\Cv\Util\DebugDispatcherTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Question\ChoiceQuestion;
class CoreInstallCommand extends \Civi\Cv\Command\BaseCommand
{
    use SetupCommandTrait;
    use DebugDispatcherTrait;
    protected function configure()
    {
        $this->setName('core:install')->setDescription('Initialize the CiviCRM data-files and database-schema')->configureSetupOptions()->addOption('abort', 'A', InputOption::VALUE_NONE, 'In the event of conflict, abort.')->addOption('keep', 'K', InputOption::VALUE_NONE, 'In the event of conflict, keep existing files/tables.')->addOption('force', 'f', InputOption::VALUE_NONE, 'In the event of conflict, overwrite existing files/tables.')->addOption('debug-event', NULL, InputOption::VALUE_OPTIONAL, 'Display debug information about events and exit. Give an event name or regex.')->addOption('debug-model', NULL, InputOption::VALUE_NONE, 'Display debug information about model and exit.')->setHelp('
Initialize the CiviCRM data-files and database-schema

Example: Install on a basic WordPress build.
$ cv core:install
$ wp plugin activate civicrm

Example: Install on a basic Drupal 7 build.
$ cv core:install --cms-base-url=http://example.com/
$ drush -y en civicrm

Example: Install on WordPress with a custom language and database.
$ cv core:install --lang=fr_FR --db=mysql://user:pass@host:3306/database
$ wp plugin activate civicrm

Example: Forcibly reinstall/overwrite. Display verbose debug info.
$ cv core:install -f -vv

Example: Inspect the installer events+plugins
$ cv core:install --debug-event

Example: Install while setting a hidden option
$ cv core:install --model=extras.opt-in.versionCheck=1
$ cv core:install -m extras.opt-in.versionCheck=1
');
        $this->configureBootOptions('none');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $setup = $this->bootSetupSubsystem($input, $output);
        $debugMode = \FALSE;
        $debugEvent = $this->parseOptionalOption($input, ['--debug-event'], NULL, '');
        if ($debugEvent !== NULL) {
            $eventNames = $this->findEventNames($setup->getDispatcher(), $debugEvent);
            $this->printEventListeners($output, $setup->getDispatcher(), $eventNames);
            $debugMode = \TRUE;
        }
        if ($input->getOption('debug-model')) {
            $output->writeln(Encoder::encode($setup->getModel()->getValues(), 'json-pretty'));
            $debugMode = 1;
        }
        if ($debugMode) {
            return 0;
        }
        $this->runSetup($input, $output, $setup);
        if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
            $output->writeln(Encoder::encode($setup->getModel()->getValues(), 'json-pretty'));
        }
    }
    protected function pickConflictAction(InputInterface $input, OutputInterface $output, $title)
    {
        if ($input->getOption('abort')) {
            return 'abort';
        }
        if ($input->getOption('keep')) {
            return 'keep';
        }
        if ($input->getOption('force')) {
            return 'overwrite';
        }
        $helper = $this->getHelper('question');
        $question = new ChoiceQuestion("The {$title} already exists. What you like to do?", array('a' => "Abort. (Default.) (Equivalent to -A.)", 'k' => "Keep existing {$title}. (WARNING: This may fail if the existing version is out-of-date.) (Equivalent to -K.)", 'o' => "Overwrite with new {$title}. (WARNING: This may destroy data.) (Equivalent to -f.)"), 'a');
        switch ($helper->ask($input, $output, $question)) {
            case 'k':
                return 'keep';
            case 'o':
                return 'overwrite';
            case 'a':
            default:
                return 'abort';
        }
    }
    protected function runSetup(InputInterface $input, OutputInterface $output, $setup)
    {
        $reqs = $setup->checkRequirements();
        foreach ($reqs->getWarnings() as $msg) {
            $output->writeln(\sprintf("<comment>WARNING: (<info>%s</info>) %s:</comment> %s", $msg['section'], $msg['name'], $msg['message']));
        }
        $errors = $reqs->getErrors();
        if ($errors) {
            foreach ($errors as $msg) {
                $output->writeln(\sprintf("<error>ERROR: (%s) %s:</error> %s", $msg['section'], $msg['name'], $msg['message']));
            }
            throw new \Exception('Requirements check failed.');
        }
        $installed = $setup->checkInstalled();
        if (!$installed->isSettingInstalled()) {
            $output->writeln(\sprintf("<info>Creating file <comment>%s</comment></info>", $setup->getModel()->settingsPath));
            $setup->installFiles();
        } else {
            $output->writeln(\sprintf("<info>Found existing <comment>%s</comment> in <comment>%s</comment></info>", \basename($setup->getModel()->settingsPath), \dirname($setup->getModel()->settingsPath)));
            switch ($this->pickConflictAction($input, $output, 'civicrm.settings.php')) {
                case 'abort':
                    throw new \Exception("Aborted");
                case 'overwrite':
                    $output->writeln(\sprintf("<info>Removing <comment>%s</comment> from <comment>%s</comment></info>", \basename($setup->getModel()->settingsPath), \dirname($setup->getModel()->settingsPath)));
                    $setup->uninstallFiles();
                    $output->writeln(\sprintf("<info>Creating <comment>%s</comment> in <comment>%s</comment></info>", \basename($setup->getModel()->settingsPath), \dirname($setup->getModel()->settingsPath)));
                    $setup->installFiles();
                    break;
                case 'keep':
                    break;
                default:
                    throw new \Exception("Unrecognized action");
            }
        }
        if (!$installed->isDatabaseInstalled()) {
            $output->writeln(\sprintf("<info>Creating <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
            $setup->installDatabase();
        } else {
            $output->writeln(\sprintf("<info>Found existing <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
            switch ($this->pickConflictAction($input, $output, 'database tables')) {
                case 'abort':
                    throw new \Exception("Aborted");
                case 'overwrite':
                    $output->writeln(\sprintf("<info>Removing <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
                    $setup->uninstallDatabase();
                    $output->writeln(\sprintf("<info>Creating <comment>civicrm_*</comment> database tables in <comment>%s</comment></info>", $setup->getModel()->db['database']));
                    $setup->installDatabase();
                    break;
                case 'keep':
                    break;
                default:
                    throw new \Exception("Unrecognized action");
            }
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\Filesystem;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ScriptCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected function configure()
    {
        $this->setName('php:script')->setAliases(array('scr'))->setDescription('Execute a PHP script')->addArgument('script', InputArgument::REQUIRED)->addArgument('scriptArguments', InputArgument::IS_ARRAY, 'Optional arguments to pass to the script as $argv');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $fs = new Filesystem();
        $origScript = $fs->toAbsolutePath($input->getArgument('script'));
        $scriptArguments = $input->getArgument('scriptArguments');
        $origCwd = \getcwd();
        $this->boot($input, $output);
        $postCwd = \getcwd();
        if (\file_exists($origScript)) {
            \chdir($origCwd);
            $this->runScript($output, $origScript, $scriptArguments);
            return 0;
        }
        $postScript = $fs->toAbsolutePath($input->getArgument('script'));
        if (\file_exists($postScript)) {
            $output->getErrorOutput()->writeln("<comment>WARNING: Loaded script relative to CMS root -- which is deprecated. Script path should be (a) absolute or (b) relative to CWD.</comment>");
            \chdir($postCwd);
            $this->runScript($output, $postScript, $scriptArguments);
            return 0;
        }
        $output->getErrorOutput()->writeln("<error>Failed to locate script: " . $input->getArgument('script') . "</error>");
        return 1;
    }
    protected function runScript(OutputInterface $output, string $script, array $scriptArguments = [])
    {
        $output->writeln("<info>[ScriptCommand]</info> Start \"{$script}\"", OutputInterface::VERBOSITY_DEBUG);
        $argv = $scriptArguments;
        \array_unshift($argv, $script);
        $argc = \count($argv);
        $run = function () use($argv, $argc, $script) {
            require $script;
        };
        $run();
        $output->writeln("<info>[ScriptCommand]</info> Finish \"{$script}\"", OutputInterface::VERBOSITY_DEBUG);
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\SiteConfigReader;
use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ShowCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('vars:show')->setDescription('Show the configuration of the local CiviCRM installation')->configureOutputOptions();
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $reader = new SiteConfigReader(CIVICRM_SETTINGS_PATH);
        $data = $reader->compile(array('buildkit', 'home', 'active'));
        $this->sendResult($input, $output, $data);
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class BaseExtensionCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    public function configureRepoOptions()
    {
        $this->addOption('dev', NULL, InputOption::VALUE_NONE, 'Include developmental extensions. (Equivalent to "--filter-status=* --filter-ready=*")')->addOption('filter-ver', NULL, InputOption::VALUE_REQUIRED, 'Filter remote extensions by Civi compatibility (Ex: "4.7.15","4.6.20")', '{ver}')->addOption('filter-uf', NULL, InputOption::VALUE_REQUIRED, 'Filter remote extensions by CMS compatibility (Ex: "Drupal", "WordPress")', '{uf}')->addOption('filter-status', NULL, InputOption::VALUE_REQUIRED, 'Filter remote extensions by stability flag (Ex: "stable", "*")', 'stable')->addOption('filter-ready', NULL, InputOption::VALUE_REQUIRED, 'Filter remote extensions based on reviewers\' approval (Ex: "ready", "*")', 'ready');
    }
    public function parseRepoUrl(InputInterface $input)
    {
        if ($input->getOption('dev')) {
            $input->setOption('filter-status', '*');
            $input->setOption('filter-ready', '*');
        }
        $parts = array();
        foreach (array('ver', 'uf', 'status', 'ready') as $key) {
            $value = $input->getOption("filter-" . $key);
            if ($value === '*') {
                $value = '';
            }
            $parts[] = $key . '=' . $value;
        }
        return 'https://civicrm.org/extdir/' . \implode('|', $parts);
    }
    protected function parseKeys(InputInterface $input, OutputInterface $output)
    {
        $allKeys = \CRM_Extension_System::singleton()->getFullContainer()->getKeys();
        $foundKeys = array();
        $missingKeys = array();
        $shortMap = NULL;
        foreach ($input->getArgument('key-or-name') as $keyOrName) {
            if (\in_array($keyOrName, $allKeys)) {
                $foundKeys[] = $keyOrName;
                continue;
            }
            if ($shortMap === NULL) {
                $shortMap = $this->getShortMap();
            }
            if (isset($shortMap[$keyOrName])) {
                $foundKeys = \array_merge($foundKeys, $shortMap[$keyOrName]);
                continue;
            }
            $missingKeys[] = $keyOrName;
        }
        return array($foundKeys, $missingKeys);
    }
    protected function getShortMap()
    {
        $map = array();
        $mapper = \CRM_Extension_System::singleton()->getMapper();
        $container = \CRM_Extension_System::singleton()->getFullContainer();
        foreach ($container->getKeys() as $key) {
            $info = $mapper->keyToInfo($key);
            if ($info->file) {
                $map[$info->file][] = $key;
            }
        }
        return $map;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class AngularModuleListCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ang:module:list')->setAliases(array())->setDescription('List Angular modules')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'table', 'defaultColumns' => 'name,basePages,requires'])->addArgument('regex', InputArgument::OPTIONAL, 'Filter extensions by full key or short name')->setHelp('List Angular modules

Examples:
  cv ang:module:list
  cv ang:module:list /crmUi/
  cv ang:module:list --columns=name,ext,extDir
  cv ang:module:list \'/crmMail/\' --user=admin --columns=extDir,css
  cv ang:module:list --columns=name,js,css --out=json-pretty
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!$input->getOption('user')) {
            $output->getErrorOutput()->writeln("<comment>For a full list, try passing --user=[username].</comment>");
        }
        $columns = \explode(',', $input->getOption('columns'));
        $records = $this->sort($this->find($input), $columns);
        $this->sendTable($input, $output, $records, $columns);
        return 0;
    }
    protected function find($input)
    {
        $regex = $input->getArgument('regex');
        $ang = \Civi::service('angular');
        $rows = array();
        foreach ($ang->getModules() as $name => $module) {
            $resources = array();
            foreach (array('js', 'partials', 'css', 'settings') as $key) {
                if (!empty($module[$key])) {
                    $resources[] = \sprintf("%s(%d)", $key, \count($module[$key]));
                }
            }
            if (!isset($module['basePages'])) {
                $basePages = 'civicrm/a';
            } elseif (empty($module['basePages'])) {
                $basePages = '(as-needed)';
            } else {
                $basePages = \implode(", ", $module['basePages']);
            }
            $rows[] = array('name' => $name, 'ext' => $module['ext'], 'extDir' => \CRM_Core_Resources::singleton()->getPath($module['ext'], NULL), 'resources' => \implode(', ', $resources), 'basePages' => $basePages, 'js' => isset($module['js']) ? \implode(", ", $module['js']) : '', 'css' => isset($module['css']) ? \implode(", ", $module['css']) : '', 'partials' => isset($module['partials']) ? \implode(", ", $module['partials']) : '', 'requires' => isset($module['requires']) ? \implode(', ', $module['requires']) : '');
        }
        $rows = \array_filter($rows, function ($row) use($regex) {
            if ($regex) {
                if (!\preg_match($regex, $row['ext']) && !\preg_match($regex, $row['name'])) {
                    return \FALSE;
                }
            }
            return \TRUE;
        });
        return $rows;
    }
    protected function sort($rows, $orderByColumns)
    {
        \usort($rows, function ($a, $b) use($orderByColumns) {
            foreach ($orderByColumns as $col) {
                if ($a[$col] < $b[$col]) {
                    return -1;
                }
                if ($a[$col] > $b[$col]) {
                    return 1;
                }
            }
            return 0;
        });
        return $rows;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class FlushCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected function configure()
    {
        $this->setName('flush')->setAliases(array())->addOption('triggers', 'T', InputOption::VALUE_NONE, 'Rebuild triggers')->setDescription('Flush system caches')->setHelp('
Flush system caches
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        \define('CIVICRM_CONTAINER_CACHE', 'never');
        $this->boot($input, $output);
        $params = array();
        if ($input->getOption('triggers')) {
            $params['triggers'] = \TRUE;
        }
        $output->writeln("<info>Flushing system caches</info>");
        $result = $this->callApiSuccess($input, $output, 'System', 'flush', $params);
        return empty($result['is_error']) ? 0 : 1;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class UpgradeGetCommand extends \Civi\Cv\Command\BaseCommand
{
    const DEFAULT_CHECK_URL = "https://upgrade.civicrm.org/check";
    use BootTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('upgrade:get')->setDescription('Find out what file you should use to upgrade')->configureOutputOptions()->addOption('stability', 's', InputOption::VALUE_REQUIRED, 'Specify the stability of the version to get (nightly, rc, stable)', 'stable')->addOption('cms', 'c', InputOption::VALUE_REQUIRED, 'Specify the CMS to get (Backdrop, Drupal, Drupal6, Joomla, WordPress) instead of the current site')->setHelp('Find out what file you should use to upgrade

Examples:
  cv upgrade:get --stability=rc

Returns a JSON object with the properties:
  rev        a unique ID corresponding to the commits that are included
  path       the path to download a tarball/zipfile
  git        the corresponding commits of the civicrm repos
  vars       the site variables from cv vars:show
  error      only appears if there is an error
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $result = array();
        $exitCode = 0;
        $stability = $input->getOption('stability');
        $cms = $input->getOption('cms');
        if (empty($cms)) {
            $this->boot($input, $output);
            if (\defined('CIVICRM_UF')) {
                $cms = CIVICRM_UF;
            }
            $result['vars'] = $GLOBALS['_CV'];
        }
        if (empty($cms)) {
            throw new \RuntimeException("Cannot determine download URL without CMS");
        }
        $url = self::DEFAULT_CHECK_URL . "?stability=" . \urlencode($stability);
        $lookup = \json_decode(\file_get_contents($url), \TRUE);
        if (empty($lookup)) {
            $result = array('error' => "Version not found at {$url}");
            $exitCode = 1;
        } else {
            if (\array_key_exists('rev', $lookup)) {
                $result['rev'] = $lookup['rev'];
            }
            if (\array_key_exists('version', $lookup)) {
                $result['version'] = $lookup['version'];
            }
            if (\array_key_exists('git', $lookup)) {
                $result['git'] = $lookup['git'];
            }
            if (!empty($lookup['tar'][$cms])) {
                $result['url'] = $lookup['tar'][$cms];
            }
        }
        $this->sendResult($input, $output, $result);
        return $exitCode;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\SettingTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SettingGetCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    use SettingTrait;
    protected function configure()
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->setName('setting:get')->setAliases(['vget'])->setDescription('Read CiviCRM settings')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions(['tabular' => \TRUE, 'shortcuts' => ['table', 'list'], 'fallback' => 'table', 'availColumns' => 'scope,key,value,default,explicit,mandatory,layer', 'defaultColumns' => 'scope,key,value,layer', 'specialFormats' => ['civicrm.settings.php']])->addOption('scope', NULL, InputOption::VALUE_REQUIRED, 'Domain to configure', 'domain')->addArgument('name', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'An setting name or regex')->setHelp("Read CiviCRM settings\n\n{$C}Name Filter{$_C}\n\n    By default, display all settings. You may optionally lookup specific settings by name\n    or by regular expression.\n\n    {$C}cv setting:get {$_C}{$I}mailerJobSize{$_I}                    (specific settings)\n    {$C}cv setting:get {$_C}{$I}mailerJobSize mailerJobsMax{$_I}      (specific settings)\n    {$C}cv setting:get /{$_C}{$I}mail{$_I}{$C}/{$_C}                           (any settings that involve \"mail\")\n\n{$C}Output Modes{$_C}\n\n    By default, display settings and their current values in a summary table.\n    For more detailed information, you may mix {$C}-v{$_C}, {$C}--columns{$_C}, and/or {$C}-out{$_C}.\n\n    {$C}cv setting:get -v{$_C}                               (detailed report, console)\n    {$C}cv setting:get --out={$_C}{$I}json-pretty{$_I}{$C} --columns={$_C}{$I}*{$_I}    (detailed report, json)\n    {$C}cv setting:get --out={$_C}{$I}civicrm.settings.php{$_I}       (export for use in civicrm.settings.php)\n\n{$C}Setting Scope{$_C}\n\n    All CiviCRM settings are formally attached to a scope, such as a {$I}Contact{$_I} or {$I}Domain{$_I}.\n    For most tasks in most deployments, there is only one important scope ({$I}domain #1{$_I}).\n    In some edge-cases, you may need to target a specific scope Here are some example scopes:\n\n    {$C}cv setting:get --scope={$_C}{$I}domain{$_I}                   (default domain)\n    {$C}cv setting:get --scope={$_C}{$I}domain:*{$_I}                 (all domains)\n    {$C}cv setting:get --scope={$_C}{$I}domain:12{$_I}                (domain #12)\n    {$C}cv setting:get --scope={$_C}{$I}contact{$_I}{$C} --user={$_C}{$I}admin{$_I}     (admin's contact)\n    {$C}cv setting:get --scope={$_C}{$I}contact:201{$_I}              (contact #201)\n");
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $filter = $this->createSettingFilter($input->getArgument('name'));
        $result = [];
        foreach ($this->findSettings($input->getOption('scope')) as $settingScope => $settingBag) {
            $meta = $this->getMetadata($settingScope);
            foreach ($settingBag->all() as $settingKey => $settingValue) {
                if (!$filter($settingKey)) {
                    continue;
                }
                [$encode, $decode] = $this->codec($meta, $settingKey);
                $row = ['scope' => $settingScope, 'key' => $settingKey, 'value' => $decode($settingBag->get($settingKey)), 'default' => $decode($settingBag->getDefault($settingKey)), 'explicit' => $decode($settingBag->getExplicit($settingKey)), 'mandatory' => $decode($settingBag->getMandatory($settingKey)), 'layer' => $settingBag->getMandatory($settingKey) !== NULL ? 'mandatory' : ($settingBag->hasExplict($settingKey) ? 'explicit' : 'default')];
                $result[] = $row;
            }
        }
        $this->sendSettings($input, $output, $result);
        return 0;
    }
}
<?php

namespace Civi\Cv\Command;

use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExtensionUninstallCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:uninstall')->setAliases(array())->setDescription('Uninstall an extension and purge its data')->addArgument('key-or-name', InputArgument::IS_ARRAY, 'One or more extensions to enable. Identify the extension by full key ("org.example.foobar") or short name ("foobar")')->setHelp('Uninstall an extension and purge its data.

Examples:
  cv ext:uninstall org.example.foobar
  cv ext:uninstall foobar

Note:
  Beginning circa CiviCRM v4.2+, it has been recommended that extensions
  include a unique long name ("org.example.foobar") and a unique short
  name ("foobar"). However, short names are not strongly guaranteed.

  This subcommand does not output parseable data. For parseable output,
  consider using `cv api extension.uninstall`.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        list($foundKeys, $missingKeys) = $this->parseKeys($input, $output);
        $uninstallKeys = \array_merge($foundKeys, \preg_grep('/\\./', $missingKeys));
        $missingKeys = \preg_grep('/\\./', $missingKeys, \PREG_GREP_INVERT);
        foreach ($missingKeys as $key) {
            $output->writeln("<comment>Ignoring unrecognized extension \"{$key}\"</comment>");
        }
        foreach ($uninstallKeys as $key) {
            $output->writeln("<info>Uninstalling extension \"{$key}\"</info>");
        }
        $result = $this->callApiSuccess($input, $output, 'Extension', 'disable', array('keys' => $uninstallKeys));
        if (!empty($result['is_error'])) {
            return 1;
        }
        $result = $this->callApiSuccess($input, $output, 'Extension', 'uninstall', array('keys' => $uninstallKeys));
        return empty($result['is_error']) ? 0 : 1;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Config;
use Civi\Cv\Encoder;
use Civi\Cv\Util\CliEditor;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class EditCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected $editor;
    protected function configure()
    {
        $this->setName('vars:edit')->setDescription('Edit configuration values for this build');
        $this->configureBootOptions();
    }
    public function __construct($name = NULL)
    {
        parent::__construct($name);
        $this->editor = new CliEditor();
        $this->editor->setValidator(function ($file) {
            $data = \json_decode(\file_get_contents($file));
            if ($data === NULL) {
                return array(\FALSE, '// The JSON document was malformed. Please resolve syntax errors and then remove this message.');
            } else {
                return array(\TRUE, '');
            }
        });
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $config = Config::read();
        $oldSiteData = empty($config['sites'][CIVICRM_SETTINGS_PATH]) ? array() : $config['sites'][CIVICRM_SETTINGS_PATH];
        $oldJson = Encoder::encode($oldSiteData, 'json-pretty');
        $newJson = $this->editor->editBuffer($oldJson);
        $newSiteData = \json_decode($newJson);
        print "NEW DATA\n\n====\n{$newJson}\n====\n";
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class UpgradeReportCommand extends \Civi\Cv\Command\BaseCommand
{
    const DEFAULT_REPORT_URL = 'https://upgrade.civicrm.org/report';
    use StructuredOutputTrait;
    public static function getReportModes()
    {
        return array('started', 'downloaded', 'extracted', 'upgraded', 'finished', 'failed');
    }
    protected function configure()
    {
        $this->setName('upgrade:report')->setDescription('Notify civicrm.org of your upgrade success or failure')->configureOutputOptions()->addOption('name', NULL, InputOption::VALUE_REQUIRED, 'Specify the name to link the report to past reports on the same upgrade')->addOption('revision', NULL, InputOption::VALUE_REQUIRED, 'Precise revision being installed (e.g. 4.7.16-201701020304)')->addOption('download-url', NULL, InputOption::VALUE_REQUIRED, 'Indicate the URL for the download attempt')->addOption('upgrade-messages', NULL, InputOption::VALUE_REQUIRED, 'Provide a file of upgrade messages')->addOption('problem-message', NULL, InputOption::VALUE_REQUIRED, 'Provide a message about the problem')->addOption('reporter', NULL, InputOption::VALUE_REQUIRED, "Your email address so you can be contacted with questions")->setHelp('Notify civicrm.org of your upgrade success or failure

Examples:
  cv upgrade:report --started=1475079931

Returns a JSON object with the properties:
  name      The name under which the report was issued

');
        foreach (self::getReportModes() as $mode) {
            $this->addOption($mode, NULL, InputOption::VALUE_OPTIONAL, "Send a \"{$mode}\" report, optionally with a timestamp");
        }
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $report = array('cvVersion' => 'v0.3.48');
        foreach (self::getReportModes() as $mode) {
            if (!$input->hasParameterOption("--{$mode}")) {
                continue;
            }
            $modeTime = $input->getOption($mode) ?: \time();
            $report[$mode] = $modeTime;
        }
        $reportProblems = $this->checkReport($input, $report);
        if (!empty($reportProblems)) {
            throw new \RuntimeException(\implode("\n", $reportProblems));
        }
        if (!empty($report['upgradeReport'])) {
            $report['upgradeReport'] = \file_get_contents($report['upgradeReport']);
        }
        $report['siteId'] = \Civi\Cv\Util\Cv::run("ev \"return md5('We need to talk about your TPS reports' . CIVICRM_SITE_KEY);\" --level=settings");
        if ($input->hasParameterOption('--reporter')) {
            $report['reporter'] = $input->getOption('reporter');
        }
        $reportPoints = array('started', 'finished');
        $reportsToSend = \array_intersect($reportPoints, \array_keys($report));
        if (!empty($reportsToSend)) {
            $systemReport = $this->systemReport();
            foreach ($reportsToSend as $stage) {
                $key = \preg_replace('/ed$/', 'Report', $stage);
                $report[$key] = $systemReport;
            }
        }
        $report['response'] = $this->reportToCivi($report);
        $this->sendResult($input, $output, $report);
    }
    protected function systemReport()
    {
        try {
            $report = \Civi\Cv\Util\Cv::run('api system.get');
        } catch (\Exception $e) {
            $report = array('error' => 'Could not produce report');
        }
        $vars = \Civi\Cv\Util\Cv::run('vars:show');
        $domain = empty($vars['CMS_URL']) ? NULL : \preg_replace(";https?://;", '', $vars['CMS_URL']);
        $this->recursiveRedact($report, $domain);
        return $report;
    }
    protected function checkReport($input, &$report)
    {
        $reportProblems = array();
        $reportModes = self::getReportModes();
        if (0 == \count(\array_intersect($reportModes, \array_keys($report)))) {
            $modeList = '--' . \implode(', --', $reportModes);
            $reportProblems[] = "Your report must include one of the following arguments: {$modeList}";
        }
        $requirements = array('started' => array('revision' => array('label' => 'revision number', 'reportkey' => 'revision')), 'downloaded' => array('download-url' => array('label' => 'download URL', 'reportkey' => 'downloadUrl')), 'upgraded' => array('upgrade-messages' => array('label' => 'upgrade messages', 'reportkey' => 'upgradeReport')), 'failed' => array('problem-message' => array('label' => 'problem message', 'reportkey' => 'problem'), 'revision' => array('label' => 'revision number', 'reportkey' => 'revision', 'alternative' => 'name')));
        foreach ($requirements as $reqMode => $reqs) {
            foreach ($reqs as $reqOpt => $req) {
                if ($input->hasParameterOption("--{$reqOpt}")) {
                    $report[$req['reportkey']] = $input->getOption($reqOpt);
                } elseif (\array_key_exists($reqMode, $report)) {
                    if (empty($req['alternative']) || empty($input->getOption($req['alternative']))) {
                        $reportProblems[] = "You must specify the {$req['label']} as --{$reqOpt}.";
                    }
                }
            }
        }
        $initialModes = array('started', 'failed');
        if (!($report['name'] = $input->getOption('name'))) {
            if (!\array_intersect($initialModes, \array_keys($report))) {
                $reportProblems[] = 'Unless you are sending a start report (with --started or --failed), you must specify the report name (with --name)';
            } else {
                $report['name'] = \Civi\Cv\Util\Rand::createName();
            }
        }
        if (\array_key_exists('started', $report)) {
            $tooLate = array('extracted', 'upgraded', 'finished');
            if (\array_intersect($tooLate, \array_keys($report))) {
                $reportProblems[] = "You can't report a start once you have extracted or upgraded. Use --failed instead.";
            }
        }
        return $reportProblems;
    }
    protected function recursiveRedact(&$report, $domain)
    {
        foreach ($report as $k => &$v) {
            if (\is_array($v)) {
                $this->recursiveRedact($v, $domain);
            } elseif ($v == "REDACTED") {
                unset($report[$k]);
            } elseif ($domain) {
                $v = \preg_replace(";(https?://)?{$domain};", 'REDACTEDURL/', $v);
            }
        }
    }
    protected function reportToCivi($report)
    {
        foreach ($report as &$part) {
            if (\is_array($part)) {
                $part = \json_encode($part);
            }
        }
        $ch = \curl_init(self::DEFAULT_REPORT_URL);
        \curl_setopt($ch, \CURLOPT_POSTFIELDS, \http_build_query($report));
        \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, \TRUE);
        $response = \curl_exec($ch);
        \curl_close($ch);
        return $response;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class EvalCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('php:eval')->setAliases(array('ev'))->setDescription('Evaluate a snippet of PHP code')->addArgument('code')->addOption('out', NULL, InputArgument::OPTIONAL, 'Specify return format (auto,' . \implode(',', Encoder::getFormats()) . ')', 'auto')->setHelp('
Evaluate a snippet of PHP code

Examples:
  cv ev \'civicrm_api3("System", "flush", array());\'
  cv ev \'if (rand(0,10)<5) echo "heads\\n"; else echo "tails\\n";\'

When reading data, you may use "return":
  cv ev \'return CRM_Utils_System::version()\'
  cv ev \'return CRM_Utils_System::version()\' --out=shell
  cv ev \'return CRM_Utils_System::version()\' --out=json

If the output format is set to "auto". This will be produce silent output -- unless
you use a "return" statement. In that case, it will use the default (' . \Civi\Cv\Encoder::getDefaultFormat() . ').

NOTE: To change the default output format, set CV_OUTPUT.
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if ($input->getOption('out') === 'auto') {
            $hasReturn = \preg_match('/^\\s*return[ \\t\\r\\n]/', $input->getArgument('code')) || \preg_match('/[;\\{]\\s*return[ \\t\\r\\n]/', $input->getArgument('code'));
            $input->setOption('out', $hasReturn ? \Civi\Cv\Encoder::getDefaultFormat() : 'none');
        }
        $value = eval($input->getArgument('code') . ';');
        $this->sendResult($input, $output, $value);
        return 0;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ApiCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    public $defaults;
    public function __construct($name = NULL)
    {
        $this->defaults = array('version' => 3);
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('api3')->setAliases(['api'])->setDescription('Call APIv3')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions(['tabular' => \TRUE, 'shortcuts' => ['table', 'list']])->addArgument('Entity.action', InputArgument::REQUIRED)->addArgument('key=value', InputArgument::IS_ARRAY)->setHelp('Call APIv3

Examples:
  cv api system.get
  cv api contact.get id=10
  echo \'{"id":10, "api.Email.get": 1}\' | cv api contact.get --in=json

TIP: To change the default output format, set CV_OUTPUT.

TIP: To display a full backtrace of any errors, pass "-vv" (very verbose).
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->boot($input, $output);
        list($entity, $action) = \explode('.', $input->getArgument('Entity.action'));
        $params = $this->parseParams($input);
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE && !\array_key_exists('debug', $params)) {
            $params['debug'] = 1;
        }
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $output->writeln("{$I}Entity{$_I}: {$C}{$entity}{$_C}");
            $output->writeln("{$I}Action{$_I}: {$C}{$action}{$_C}");
            $output->writeln("{$I}Params{$_I}: " . \json_encode($params, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
        }
        $result = \civicrm_api($entity, $action, $params);
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE && $result['trace']) {
            $output->getErrorOutput()->writeln("<error>Error: " . (isset($result['error_message']) ? $result['error_message'] : "") . "</error>");
            $output->getErrorOutput()->writeln("  " . \str_replace("\n", "\n  ", $result['trace']), OutputInterface::OUTPUT_RAW);
            $output->getErrorOutput()->write("\n");
            unset($result['trace']);
        }
        $out = $input->getOption('out');
        if (!\in_array($out, Encoder::getFormats()) && \in_array($out, Encoder::getTabularFormats())) {
            if ($action !== 'get' || !isset($result['values']) || !empty($result['is_error'])) {
                $output->getErrorOutput()->writeln("<error>The output format \"{$out}\" only works with tabular data. Try using a \"get\" API. Forcing format to \"json-pretty\".</error>");
                $input->setOption('out', 'json-pretty');
                $this->sendResult($input, $output, $result);
            } else {
                $columns = empty($params['return']) ? NULL : \explode(',', $params['return']);
                $this->sendTable($input, $output, \array_values($result['values']), $columns);
            }
        } else {
            $this->sendResult($input, $output, $result);
        }
        return empty($result['is_error']) ? 0 : 1;
    }
    protected function parseParams(InputInterface $input)
    {
        $args = $input->getArgument('key=value');
        switch ($input->getOption('in')) {
            case 'args':
                $params = $this->defaults;
                foreach ($args as $arg) {
                    \preg_match('/^([^=]+)=(.*)$/', $arg, $matches);
                    $params[$matches[1]] = $matches[2];
                }
                break;
            case 'json':
                $json = \stream_get_contents(\STDIN);
                if (empty($json)) {
                    $params = $this->defaults;
                } else {
                    $params = \array_merge($this->defaults, \json_decode($json, \TRUE));
                }
                break;
            default:
                throw new \RuntimeException('Unknown input format');
        }
        return $params;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class BootCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected function configure()
    {
        $this->setName('php:boot')->setDescription('Generate PHP bootstrap code');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        switch ($input->getOption('level')) {
            case 'classloader':
                $code = \sprintf('require_once  %s . "/CRM/Core/ClassLoader.php";', \var_export(\rtrim($GLOBALS["civicrm_root"], '/'), 1)) . '\\CRM_Core_ClassLoader::singleton()->register();';
                break;
            case 'settings':
                $code = \Civi\Cv\Bootstrap::singleton()->generate() . '\\CRM_Core_Config::singleton(FALSE);';
                break;
            case 'full':
                $code = \Civi\Cv\Bootstrap::singleton()->generate() . '\\CRM_Core_Config::singleton();' . '\\CRM_Utils_System::loadBootStrap(array(), FALSE);';
                break;
            case 'cms-full':
                $code = \Civi\Cv\CmsBootstrap::singleton()->generate(['bootCms', 'bootCivi']);
                break;
            case 'none':
                break;
            default:
                throw new \Exception("Cannot generate boot instructions for given boot level.");
        }
        $output->writeln('/*BEGINPHP*/');
        $output->writeln($code);
        $output->writeln('/*ENDPHP*/');
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\Filesystem;
use Civi\Cv\Util\HeadlessDownloader;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
use Cvphar\Symfony\Component\Console\Question\ChoiceQuestion;
class ExtensionDownloadCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:download')->setAliases(array('dl'))->setDescription('Download and enable an extension')->addOption('bare', 'b', InputOption::VALUE_NONE, 'Perform a basic download in a non-bootstrapped environment. Implies --level=none, --no-install, and no --refresh. You must specify the download URL.')->addOption('refresh', 'r', InputOption::VALUE_NONE, 'Refresh the remote list of extensions (Default: Only refresh on cache-miss)')->addOption('no-install', NULL, InputOption::VALUE_NONE, 'Only download. Skip the installation.')->addOption('force', 'f', InputOption::VALUE_NONE, 'If an extension already exists, download it anyway.')->addOption('to', NULL, InputOption::VALUE_OPTIONAL, 'Download to a specific directory (absolute path).')->addOption('keep', 'k', InputOption::VALUE_NONE, 'If an extension already exists, keep it.')->addArgument('key-or-name', InputArgument::IS_ARRAY, 'One or more extensions to enable. Identify the extension by full key ("org.example.foobar") or short name ("foobar"). Optionally append a URL.')->setHelp('Download and enable an extension

Examples:
  cv ext:download org.example.foobar
  cv dl foobar
  cv dl --dev foobar
  cv dl -b "@https://example.org/files/foobar/info.xml" --to="$PWD/myext"

The extension can be specified using any of the following:

  - Long name (ex: "org.example.foobar"). Resolved via civicrm.org.
  - Short name (ex: "foobar"). Resolved via civicrm.org.
  - Long name + Zip URL (ex: "org.example.foobar@http://example.org/files/foobar-1.2.zip")
  - Info XML URL (ex: "@http://example.org/files/foobar/info.xml")

Note:
  By default, extensions are downloaded to the site\'s writable
  extension folder, but you can optionally specify --to.

  Beginning circa CiviCRM v4.2+, it has been recommended that extensions
  include a unique long name ("org.example.foobar") and a unique short
  name ("foobar"). However, short names are not strongly guaranteed.

  This subcommand does not output parseable data. For parseable output,
  consider using `cv api extension.install`.
');
        parent::configureRepoOptions();
        $this->configureBootOptions();
    }
    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        if ($input->hasOption('bare') && $input->getOption('bare')) {
            $input->setOption('level', 'none');
            $input->setOption('no-install', \TRUE);
        }
        parent::initialize($input, $output);
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $fs = new Filesystem();
        if ($extRepoUrl = $this->parseRepoUrl($input)) {
            global $civicrm_setting;
            $civicrm_setting['Extension Preferences']['ext_repo_url'] = $extRepoUrl;
        }
        $this->boot($input, $output);
        if ($input->getOption('to') && !$fs->isAbsolutePath($input->getOption('to'))) {
            throw new \RuntimeException("The --to argument requires an absolute path.");
        }
        if ($this->isBooted()) {
            $output->writeln("<info>Using extension feed \"" . \CRM_Extension_System::singleton()->getBrowser()->getRepositoryUrl() . "\"</info>");
        }
        $refresh = $input->getOption('refresh') ? 'yes' : 'auto';
        while (\TRUE) {
            if ($refresh === 'yes' && $this->isBooted()) {
                $output->writeln("<info>Refreshing extension cache</info>");
                $result = $this->callApiSuccess($input, $output, 'Extension', 'refresh', array('local' => \FALSE, 'remote' => \TRUE));
                if (!empty($result['is_error'])) {
                    return 1;
                }
            }
            list($downloads, $errors) = $this->parseDownloads($input);
            if ($refresh == 'auto' && !empty($errors)) {
                $output->writeln("<info>Extension cache does not contain requested item(s)</info>");
                $refresh = 'yes';
            } else {
                break;
            }
        }
        if (!empty($errors)) {
            foreach ($errors as $error) {
                $output->getErrorOutput()->writeln("<error>{$error}</error>");
            }
            $output->getErrorOutput()->writeln("<comment>Tip: To customize the feed, review options in \"cv {$input->getFirstArgument()} --help\"");
            $output->getErrorOutput()->writeln("<comment>Tip: To browse available downloads, run \"cv ext:list -R\"</comment>");
            return 1;
        }
        if ($input->getOption('to') && \count($downloads) > 1) {
            throw new \RuntimeException("When specifying --to, you can only download one extension at a time.");
        }
        foreach ($downloads as $key => $url) {
            $action = $this->pickAction($input, $output, $key);
            switch ($action) {
                case 'download':
                    if ($to = $input->getOption('to')) {
                        $output->writeln("<info>Downloading extension \"{$key}\" ({$url}) to \"{$to}\"</info>");
                        $dl = new HeadlessDownloader();
                        $dl->run($url, $key, $input->getOption('to'), \TRUE);
                    } else {
                        $output->writeln("<info>Downloading extension \"{$key}\" ({$url})</info>");
                        $this->assertBooted();
                        $result = $this->callApiSuccess($input, $output, 'Extension', 'download', array('key' => $key, 'url' => $url, 'install' => !$input->getOption('no-install')));
                    }
                    break;
                case 'install':
                    $output->writeln("<info>Found extension \"{$key}\". Enabling.</info>");
                    $result = $this->callApiSuccess($input, $output, 'Extension', 'enable', array('key' => $key));
                    break;
                case 'abort':
                    $output->writeln("<error>Aborted</error>");
                    return 1;
                case 'skip':
                    $output->writeln("<comment>Skipped extension \"{$key}\".</comment>");
                    break;
                default:
                    throw new \RuntimeException("Unrecognized action: {$action}");
            }
            if (!empty($result['is_error'])) {
                return 1;
            }
        }
        return 0;
    }
    protected function getRemoteInfos()
    {
        static $cache = NULL;
        if ($cache === NULL) {
            $this->assertBooted();
            $cache = \CRM_Extension_System::singleton()->getBrowser()->getExtensions();
        }
        return $cache;
    }
    protected function getRemoteShortMap()
    {
        static $cache = NULL;
        if ($cache === NULL) {
            $cache = array();
            foreach ($this->getRemoteInfos() as $key => $info) {
                if ($info->file) {
                    $cache[$info->file][] = $key;
                }
            }
        }
        return $cache;
    }
    protected function parseDownloads(InputInterface $input)
    {
        $downloads = array();
        $errors = array();
        $remoteInfos = NULL;
        $shortMap = NULL;
        if (!$input->getArgument('key-or-name')) {
            $errors[] = 'Error: Please specify at least one extension to download';
        }
        foreach ($input->getArgument('key-or-name') as $keyOrName) {
            $origExpr = $keyOrName;
            $url = NULL;
            if (\strpos($keyOrName, '@') !== \FALSE) {
                list($keyOrName, $url) = \explode('@', $keyOrName, 2);
            }
            if (empty($keyOrName) && !empty($url)) {
                if (!\preg_match('/\\.xml$/', $url)) {
                    $errors[] = "Unclear file reference ({$origExpr}). Please provide either \"key@http://example/file.zip\" or \"@http://example/file.xml\".";
                    continue;
                }
                $xmlString = \file_get_contents($url);
                if (empty($xmlString)) {
                    $errors[] = "Failed to fetch XML file ({$origExpr}).";
                    continue;
                }
                $xml = \simplexml_load_string($xmlString);
                $keyOrName = (string) $xml->attributes()->key;
                $url = (string) $xml->downloadUrl;
                if (!$keyOrName || !$url) {
                    $errors[] = "The specified XML file is missing the key and/or downloadUrl ({$origExpr}).";
                    continue;
                }
            }
            if ($this->isBooted() && \strpos($keyOrName, '.') === \FALSE) {
                if ($shortMap === NULL) {
                    $shortMap = $this->getRemoteShortMap();
                }
                if (isset($shortMap[$keyOrName])) {
                    if (\count($shortMap[$keyOrName]) === 1) {
                        $keyOrName = $shortMap[$keyOrName][0];
                    } else {
                        $otherNames = '"' . \implode('", "', $shortMap[$keyOrName]) . '"';
                        $errors[] = "Ambiguous name \"{$keyOrName}\". Use a more specific key: {$otherNames}";
                        continue;
                    }
                }
            }
            if ($this->isBooted() && empty($url)) {
                if ($remoteInfos === NULL) {
                    $remoteInfos = $this->getRemoteInfos();
                }
                if (!empty($remoteInfos[$keyOrName]->downloadUrl)) {
                    $url = $remoteInfos[$keyOrName]->downloadUrl;
                }
            }
            if (empty($url)) {
                $errors[] = $this->isBooted() ? "Error: Unrecognized extension \"{$keyOrName}\"" : "Error: unrecognized extension \"{$keyOrName}\" cannot be resolved in bare environment";
                continue;
            }
            $downloads[$keyOrName] = $url;
        }
        return array($downloads, $errors);
    }
    protected function pickAction(InputInterface $input, OutputInterface $output, $key)
    {
        if ($input->getOption('to')) {
            $exists = \file_exists($input->getOption('to'));
        } elseif ($this->isBooted()) {
            $existingExts = \CRM_Extension_System::singleton()->getFullContainer()->getKeys();
            $exists = \in_array($key, $existingExts);
        } else {
            throw new \RuntimeException("In --bare mode, you must specify the target path with --to.");
        }
        $action = NULL;
        if (!$exists) {
            return 'download';
        } elseif ($input->getOption('keep')) {
            return $input->getOptions('no-install') ? 'skip' : 'install';
        } elseif ($input->getOption('force')) {
            return 'download';
        } else {
            $helper = $this->getHelper('question');
            $question = new ChoiceQuestion("The extension \"{$key}\" already exists. What you like to do?", array('k' => 'Keep existing extension. (Default) (Equivalent to option "-k")', 'd' => 'Download anyway. (Equivalent to option "-f")', 'a' => 'Abort'), 'k');
            switch ($helper->ask($input, $output, $question)) {
                case 'd':
                    return 'download';
                case 'k':
                    return $input->getOptions('no-install') ? 'skip' : 'install';
                case 'a':
                default:
                    return 'abort';
            }
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Encoder;
use Civi\Cv\Util\Api4ArgParser;
use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class Api4Command extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    public $defaults;
    public function __construct($name = NULL)
    {
        $this->defaults = array('version' => 4, 'checkPermissions' => \FALSE);
        parent::__construct($name);
    }
    protected function configure()
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->setName('api4')->setDescription('Call APIv4')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions(['tabular' => \TRUE, 'shortcuts' => ['table', 'list']])->addOption('dry-run', 'N', InputOption::VALUE_NONE, 'Preview the API call. Do not execute.')->addArgument('Entity.action', InputArgument::REQUIRED)->addArgument('key=value', InputArgument::IS_ARRAY)->setHelp("Call an entity/action in APIv4\n\nIf your inputs are determined dynamically (e.g. from an external or untrusted\ndata-source), then it is better to pass parameters via pipe using strict JSON format.\nThis minimizes the risk that a dynamic value will be incorrectly escaped.\n\nAlas, strict JSON is cumbersome to manually enter on the CLI.\n\nIf your inputs are entered manually, then it is easier to use a mix of \"+Options\"\nand \"JSON-ish Key-Value\". The \"+Options\" are ideal for common parameters\n(like \"select\" or \"where\"), and \"JSON-ish Key-Value\" is a decent fallback\nfor less common parameters.\n\nBelow, we consider a specification for each format and a set of examples.\n\nIf you'd like to inspect the behavior more carefully, try using {$I}--dry-run{$_I} ({$I}-N{$_I}).\n\n{$C}Specification: Piped JSON{$_C}\n\n    {$C}echo{$_C} {$I}JSON{$_I} | {$C}cv api4{$_C} {$I}ENTITY{$_I}.{$I}ACTION{$_I} {$C}--in=json{$_C}\n\n{$C}Specification: +Options{$_C}\n\n    {$C}cv api4{$_C} {$I}ENTITY{$_I}.{$I}ACTION{$_I} [{$C}+{$_C}{$I}OP{$_I}{$C} {$_C}{$I}EXPR{$_I}]...\n\n    Each \"+Option\" allows you to specify a common APIv4 parameter using a\n    pithy, purpose-built notation. For example:\n\n    Option         Examples\n    {$C}+s{$_C}|{$C}+select{$_C}     +select id,display_name\n                   +select=id,display_name\n                   +s id,display_name\n    {$C}+w{$_C}|{$C}+where{$_C}      +where 'first_name like \"Adams%\"'\n                   +w 'first_name like \"Adams%\"'\n    {$C}+o{$_C}|{$C}+orderBy{$_C}    +orderBy last_name,first_name\n                   +o last_name,first_name\n                   +o 'last_name DESC,first_name ASC'\n    {$C}+l{$_C}|{$C}+limit{$_C}      +limit 15@60\n                   +l 15\n    {$C}+v{$_C}|{$C}+value{$_C}      +v name=Alice\n                   +v name=Alice\n\n    NOTE: The +{$I}OP{$_I} may be written long ({$C}+where{$_C}) or short ({$C}+w{$_C}). It is\n    valid to separate the +{$I}OP{$_I} and {$I}EXPR{$_I} using a space, colon, or equals sign.\n\n{$C}Specification: JSON-ish Key-Value{$_C}\n\n    {$C}cv api4{$_C} {$I}ENTITY{$_I}.{$I}ACTION{$_I} [{$I}KEY{$_I}={$I}VALUE{$_I}]... [{$I}JSON-OBJECT{$_I}]...\n\n    Use {$I}KEY{$_I}={$I}VALUE{$_I} to set an input to a specific value. The value may be a bare string\n    or it may be JSON (beginning with '[' or '{' or '\"').\n    \n    For parameters which expect boolean values, use {$I}1{$_I} for true and {$I}0{$_I} for false.\n\n    Use {$I}JSON-OBJECT{$_I} if you want to pass several fields as one pure JSON string.\n    A parameter which begins with '{' will be interpreted as a JSON expression.\n\n{$C}Example: Get all contacts{$_C}\n    cv api4 Contact.get\n\n{$C}Example: Get all email addresses for contact 33, bypassing the permissions check{$_C}\n    cv api4 Email.get +w 'contact_id = 33' checkPermissions=0\n\n{$C}Example: Get ten contacts{$_C} (All examples are equivalent.)\n    cv api4 Contact.get +s id,display_name +l 10\n    cv api4 Contact.get select='[\"id\",\"display_name\"]' limit=10\n    cv api4 Contact.get '{\"select\":[\"id\",\"display_name\"],\"limit\":10}'\n    echo '{\"select\":[\"id\",\"display_name\"],\"limit\":10}' | cv api4 Contact.get --in=json\n\n{$C}Example: Find ten contacts named \"Adam\"{$_C}\n    cv api4 Contact.get +s display_name +w 'display_name LIKE \"Adam%\"' limit=10\n\n{$C}Example: Find contact names for IDs between 100 and 200, ordered by last name{$_C}\n    cv api4 Contact.get +s display_name +o last_name +w 'id >= 100' +w 'id <= 200'\n\n{$C}Example: Change do_not_phone for everyone named Adam{$_C}\n    cv api4 Contact.update +w 'display_name like %Adam%' +v do_not_phone=1\n\nNOTE: To change the default output format, set CV_OUTPUT.\n");
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->boot($input, $output);
        if (!\function_exists('civicrm_api4')) {
            throw new \RuntimeException("Please enable APIv4 before running APIv4 commands.");
        }
        list($entity, $action) = \explode('.', $input->getArgument('Entity.action'));
        $params = $this->parseParams($input);
        if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE || $input->getOption('dry-run')) {
            $output->writeln("{$I}Entity{$_I}: {$C}{$entity}{$_C}");
            $output->writeln("{$I}Action{$_I}: {$C}{$action}{$_C}");
            $output->writeln("{$I}Params{$_I}: " . \json_encode($params, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
        }
        if ($input->getOption('dry-run')) {
            return 0;
        }
        $result = \civicrm_api4($entity, $action, $params);
        $out = $input->getOption('out');
        if (!\in_array($out, Encoder::getFormats()) && \in_array($out, Encoder::getTabularFormats())) {
            if (!empty($params['select'])) {
                $columns = $params['select'];
            } else {
                $columns = \count($result) ? \array_keys($result->first()) : [''];
            }
            $this->sendTable($input, $output, (array) $result, $columns);
        } else {
            $this->sendResult($input, $output, $result);
        }
        return empty($result['is_error']) ? 0 : 1;
    }
    protected function parseParams(InputInterface $input)
    {
        $args = $input->getArgument('key=value');
        switch ($input->getOption('in')) {
            case 'args':
                $p = new Api4ArgParser();
                $params = $p->parse($args, $this->defaults);
                break;
            case 'json':
                $json = \stream_get_contents(\STDIN);
                if (empty($json)) {
                    $params = $this->defaults;
                } else {
                    $params = \array_merge($this->defaults, \json_decode($json, \TRUE));
                }
                break;
            default:
                throw new \RuntimeException('Unknown input format');
        }
        return $params;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\DebugDispatcherTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class DebugDispatcherCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use DebugDispatcherTrait;
    protected function configure()
    {
        $this->setName('event')->setDescription('Inspect events and listeners')->addArgument('event', InputArgument::OPTIONAL, 'An event name or regex')->setHelp('
Dump the list of event listeners

Examples:
  cv debug:event-dispatcher
  cv debug:event-dispatcher actionSchedule.getMappings
  cv debug:event-dispatcher /^actionSchedule/
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        \define('CIVICRM_CONTAINER_CACHE', 'never');
        $output->getErrorOutput()->writeln('<comment>The debug command ignores the container cache.</comment>');
        $this->boot($input, $output);
        $container = \Civi::container();
        if ($container->has('civi_api_kernel')) {
            $container->get('civi_api_kernel');
        }
        $dispatcher = $container->get('dispatcher');
        $eventFilter = $input->getArgument('event');
        $eventNames = $this->findEventNames($dispatcher, $eventFilter);
        $this->printEventListeners($output, $dispatcher, $eventNames);
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class ExtensionListCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    use StructuredOutputTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ext:list')->setAliases(['ext'])->setDescription('List extensions')->addOption('local', 'L', InputOption::VALUE_NONE, 'Filter extensions by location (local)')->addOption('remote', 'R', InputOption::VALUE_NONE, 'Filter extensions by location (remote)')->addOption('refresh', 'r', InputOption::VALUE_NONE, 'Refresh the list of extensions')->addOption('installed', 'i', InputOption::VALUE_NONE, 'Filter extensions by "installed" status (Equivalent to --statuses=installed)')->addOption('statuses', NULL, InputOption::VALUE_REQUIRED, 'Filter extensions by status (comma separated)', '*')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'table', 'defaultColumns' => 'location,key,name,version,status,downloadUrl'])->addArgument('regex', InputArgument::OPTIONAL, 'Filter extensions by full key or short name')->setHelp('List extensions

Examples:
  cv ext:list
  cv ext:list --remote --dev /mail/
  cv ext:list /^org.civicrm.*/
  cv ext:list -Li --columns=key,label

Note:
  If you do not specify --local (-L) or --remote (-R), then all are listed.

  Beginning circa CiviCRM v4.2+, it has been recommended that extensions
  include a unique long name ("org.example.foobar") and a unique short
  name ("foobar"). However, short names are not strongly guaranteed.
');
        parent::configureRepoOptions();
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $wo = $input->getOption('out') === 'table' ? OutputInterface::OUTPUT_NORMAL | OutputInterface::VERBOSITY_NORMAL : OutputInterface::OUTPUT_NORMAL | OutputInterface::VERBOSITY_VERBOSE;
        list($local, $remote) = $this->parseLocalRemote($input);
        if ($extRepoUrl = $this->parseRepoUrl($input)) {
            global $civicrm_setting;
            $civicrm_setting['Extension Preferences']['ext_repo_url'] = $extRepoUrl;
        }
        $this->boot($input, $output);
        if ($remote) {
            $output->writeln("<info>Using extension feed \"" . \CRM_Extension_System::singleton()->getBrowser()->getRepositoryUrl() . "\"</info>", $wo);
        }
        if ($input->getOption('refresh')) {
            $output->writeln("<info>Refreshing extensions</info>", $wo);
            $result = $this->callApiSuccess($input, $output, 'Extension', 'refresh', array('local' => $local, 'remote' => $remote));
            if (!empty($result['is_error'])) {
                return 1;
            }
        }
        $columns = \explode(',', $input->getOption('columns'));
        $records = $this->sort($this->find($input), $columns);
        $this->sendTable($input, $output, $records, $columns);
        return 0;
    }
    protected function getRemoteInfos()
    {
        static $cache = NULL;
        if ($cache === NULL) {
            $cache = \CRM_Extension_System::singleton()->getBrowser()->getExtensions();
        }
        return $cache;
    }
    protected function find($input)
    {
        $regex = $input->getArgument('regex');
        list($local, $remote) = $this->parseLocalRemote($input);
        if ($input->getOption('installed')) {
            $statusFilter = array('installed');
        } elseif ($input->getOption('statuses') && $input->getOption('statuses') !== '*') {
            $statusFilter = \explode(',', $input->getOption('statuses'));
        } else {
            $statusFilter = NULL;
        }
        $rows = array();
        if ($remote) {
            foreach ($this->getRemoteInfos() as $info) {
                $rows[] = array('location' => 'remote', 'key' => $info->key, 'name' => $info->file, 'version' => $info->version, 'label' => $info->label, 'status' => '', 'type' => $info->type, 'path' => '', 'downloadUrl' => $info->downloadUrl);
            }
        }
        if ($local) {
            $keys = \CRM_Extension_System::singleton()->getFullContainer()->getKeys();
            $statuses = \CRM_Extension_System::singleton()->getManager()->getStatuses();
            $mapper = \CRM_Extension_System::singleton()->getMapper();
            foreach ($keys as $key) {
                $info = $mapper->keyToInfo($key);
                $rows[] = array('location' => 'local', 'key' => $key, 'name' => $info->file, 'version' => $info->version, 'label' => $info->label, 'status' => isset($statuses[$key]) ? $statuses[$key] : '', 'type' => $info->type, 'path' => $mapper->keyToBasePath($key), 'downloadUrl' => \property_exists($info, 'downloadUrl') ? $info->downloadUrl : NULL);
            }
        }
        $rows = \array_filter($rows, function ($row) use($regex, $statusFilter) {
            if ($statusFilter !== NULL && !\in_array($row['status'], $statusFilter)) {
                return \FALSE;
            }
            if ($regex) {
                if (!\preg_match($regex, $row['key']) && !\preg_match($regex, $row['name'])) {
                    return \FALSE;
                }
            }
            return \TRUE;
        });
        return $rows;
    }
    protected function sort($rows, $orderByColumns)
    {
        \usort($rows, function ($a, $b) use($orderByColumns) {
            foreach ($orderByColumns as $col) {
                if ($a[$col] < $b[$col]) {
                    return -1;
                }
                if ($a[$col] > $b[$col]) {
                    return 1;
                }
            }
            return 0;
        });
        return $rows;
    }
    protected function parseLocalRemote(InputInterface $input)
    {
        if ($input->getOption('local') || $input->getOption('remote')) {
            $local = (bool) $input->getOption('local');
            $remote = (bool) $input->getOption('remote');
            return array($local, $remote);
        } else {
            $local = $remote = \TRUE;
            return array($local, $remote);
        }
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\Process;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class AngularHtmlShowCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('ang:html:show')->setAliases(array())->setDescription('Show an Angular HTML file')->addOption('raw', NULL, InputOption::VALUE_NONE, 'Display the raw (unmodified/unhooked) content')->addOption('diff', NULL, InputOption::VALUE_NONE, 'Display the diff (from pristine code to live code)')->addArgument('file', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'The file to display. (The leading "~" is optional.)')->setHelp('Show an Angular HTML file

Examples:
  cv ang:html:show crmMailing/BlockMailing.html
  cv ang:html:show crmMailing/BlockMailing.html --diff
  cv ang:html:show crmMailing/BlockMailing.html --diff | colordiff
  cv ang:html:show "~/crmMailing/BlockMailing.html"
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!$input->getOption('user')) {
            $output->getErrorOutput()->writeln("<comment>For a full list, try passing --user=[username].</comment>");
        }
        $ang = \Civi::service('angular');
        $result = 0;
        if (!\is_callable(array($ang, 'getRawPartials'))) {
            $output->writeln('<error>This version of CiviCRM does not support getRawPartials().</error>');
            return 4;
        }
        foreach ($input->getArgument('file') as $file) {
            $file = '~/' . \preg_replace(';^~/;', '', $file);
            if (!\preg_match(';^~/([^\\/]+)/.+;', $file, $matches)) {
                $output->writeln("<error>File name is malformed ({$file})</error>");
                $result = 1;
                continue;
            }
            $module = $matches[1];
            if ($input->getOption('diff')) {
                $command = Process::findCommand('diff');
                if (!$command) {
                    $output->writeln("<error>Command 'diff' is not available.</error>");
                    $result = 3;
                    continue;
                }
                $livePartials = $ang->getPartials($module);
                $rawPartials = $ang->getRawPartials($module);
                $prefix = \preg_replace(';[^a-zA-Z0-9_\\-\\.];', '', $file) . '-';
                $liveFile = \tempnam(\sys_get_temp_dir(), $prefix);
                $rawFile = \tempnam(\sys_get_temp_dir(), $prefix);
                $coder = new \Civi\Angular\Coder();
                \file_put_contents($rawFile, isset($rawPartials[$file]) ? $coder->recode($rawPartials[$file]) : '');
                \file_put_contents($liveFile, isset($livePartials[$file]) ? $coder->recode($livePartials[$file]) : '');
                $cmd = \sprintf("diff -u %s %s", \escapeshellarg($rawFile), \escapeshellarg($liveFile));
                $content = `{$cmd}`;
                if (empty($content)) {
                    $content = 'No differences found';
                }
                \unlink($rawFile);
                \unlink($liveFile);
            } elseif ($input->getOption('raw')) {
                $rawPartials = $ang->getRawPartials($module);
                $content = isset($rawPartials[$file]) ? $rawPartials[$file] : NULL;
            } else {
                $livePartials = $ang->getPartials($module);
                $content = isset($livePartials[$file]) ? $livePartials[$file] : NULL;
            }
            if ($content === NULL) {
                $output->writeln("<error>File \"{$file}\" not found in module \"{$module}\".</error>");
                $result = 2;
            } else {
                $output->writeln($content);
            }
        }
        return $result;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\Datasource;
use Civi\Cv\Util\Process;
use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SqlCliCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    protected function configure()
    {
        $this->setName('sql')->setAliases(array('sql:cli'))->setDescription('Open the SQL CLI')->addOption('eval', 'e', InputOption::VALUE_NONE, 'Enable evaluation of preprocessing expressions. (Pipe-only)')->addOption('target', 'T', InputOption::VALUE_REQUIRED, 'Target DB (civi, cms)', 'civi')->addOption('dry-run', 'N', InputOption::VALUE_NONE, 'Preview the SQL commands. Do not execute. (Pipe-only)')->setHelp("\nThe \"sql\" command allows you to execute SQL interactively or through a pipe.\n\nThis is a wrapper for the \"mysql\" CLI command -- the general semantics\nand notation are therefore inherited from MySQL's CLI.\n\nOptionally, when piping in SQL, the \"--eval\" option adds support for extra\npre-processing features. Specifically, it interpolates and escapes environment variables:\n\n  export USERNAME=badguy\n  echo 'DELETE FROM users WHERE username = @ENV[USERNAME]' | cv sql -e\n\nThe ENV expressions are prefixed to indicate their escaping rule:\n\n  @ENV[FOO]    Produces an escaped version of string FOO\n  #ENV[FOO]    Produces the numerical value of FOO (or fails)\n  !ENV[FOO]    Produces the raw, unescaped string version of FOO\n");
        $this->configureBootOptions();
    }
    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('dry-run') && $output->getVerbosity() <= OutputInterface::VERBOSITY_NORMAL) {
            $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
        }
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $datasource = new Datasource();
        $datasource->loadFromCiviDSN($this->pickDsn($input->getOption('target')));
        $mysql = Process::findCommand('mysql');
        if (Process::isShellScript($mysql)) {
            $output->getErrorOutput()->writeln("<info>[SqlCommand]</info> <comment>WARNING: The mysql command appears to be a wrapper script. In some environments, this may interfere with credential passing.</comment>");
        }
        $cmd = \escapeshellcmd($mysql) . " " . $datasource->toMySQLArguments($this->findCreateTmpDir());
        $output->getErrorOutput()->writeln("<info>[SqlCommand]</info> Launch sub-command: <comment>{$cmd}</comment>", OutputInterface::VERBOSITY_VERBOSE);
        if (!$input->getOption('dry-run')) {
            $process = \proc_open($cmd, array(0 => $input->getOption('eval') ? array('pipe', 'r') : \STDIN, 1 => \STDOUT, 2 => \STDERR), $pipes);
        }
        $finalSql = NULL;
        if ($input->getOption('dry-run') || $input->getOption('eval')) {
            $rawSql = \trim(\file_get_contents('php://stdin'), "\r\n");
            $output->getErrorOutput()->writeln("<info>[SqlCommand]</info> Raw SQL:   <comment>{$rawSql}</comment>", OutputInterface::VERBOSITY_VERBOSE);
            $finalSql = $input->getOption('eval') ? $this->filterSql($rawSql) : $rawSql;
            $output->getErrorOutput()->writeln("<info>[SqlCommand]</info> Final SQL: <comment>{$finalSql}</comment>", OutputInterface::VERBOSITY_VERBOSE);
        }
        if (!$input->getOption('dry-run')) {
            if ($finalSql !== NULL) {
                \fwrite($pipes[0], $finalSql);
                \fclose($pipes[0]);
            }
            return \proc_close($process);
        } else {
            return 0;
        }
    }
    protected function filterSql($sql)
    {
        $changed = \preg_replace_callback('/([#!@])ENV\\[([a-zA-Z0-9_]+)\\]/', function ($matches) use($pdo) {
            $value = \getenv($matches[2]);
            switch ($matches[1]) {
                case '!':
                    return $value;
                case '#':
                    if (!\is_numeric($value)) {
                        throw new \RuntimeException("Environment variable " . $matches[2] . " is not numeric!");
                    }
                    return $value;
                case '@':
                    return '"' . \CRM_Core_DAO::escapeString($value) . '"';
                default:
                    throw new \RuntimeException("Variable prefix not recognized.");
            }
        }, $sql);
        return $changed;
    }
    protected function findCreateTmpDir()
    {
        $path = \sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'cv-cli-' . \posix_getuid();
        if (!\is_dir($path)) {
            \mkdir($path, 0700);
        }
        return $path;
    }
    protected function pickDsn($target)
    {
        $dsn = NULL;
        switch ($target) {
            case 'civi':
                $dsn = CIVICRM_DSN;
                break;
            case 'cms':
                $dsn = \CRM_Core_Config::singleton()->userFrameworkDSN;
                break;
        }
        if (empty($dsn)) {
            throw new \RuntimeException("Failed determine DSN for target \"{$target}\".");
        }
        return $dsn;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\SetupCommandTrait;
use Civi\Cv\Util\DebugDispatcherTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class CoreCheckReqCommand extends \Civi\Cv\Command\BaseCommand
{
    use SetupCommandTrait;
    use DebugDispatcherTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('core:check-req')->setDescription('Check installation requirements')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'table'])->addOption('filter-warnings', 'w', InputOption::VALUE_NONE, 'Show warnings')->addOption('filter-errors', 'e', InputOption::VALUE_NONE, 'Show errors')->addOption('filter-infos', 'i', InputOption::VALUE_NONE, 'Show info')->configureSetupOptions()->setHelp('
Check whether installation requirements are met.

Example: Show all checks
$ cv core:check-req

Example: Show only errors
$ cv core:check-req -e

Example: Show warnings and errors
$ cv core:check-req -we
');
        $this->configureBootOptions('none');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $filterSeverities = $this->parseFilter($input);
        $showBootMsgsByDefault = \in_array($input->getOption('out'), ['table', 'pretty']);
        $setup = $this->bootSetupSubsystem($input, $output, $showBootMsgsByDefault ? 0 : OutputInterface::VERBOSITY_VERBOSE);
        $reqs = $setup->checkRequirements();
        $messages = \array_filter($reqs->getMessages(), function ($m) use($filterSeverities) {
            return \in_array($m['severity'], $filterSeverities);
        });
        \uasort($messages, function ($a, $b) {
            return \strcmp($a['severity'] . '-' . $a['section'] . '-' . $a['name'], $b['severity'] . '-' . $b['section'] . '-' . $b['name']);
        });
        $this->sendTable($input, $output, $messages, array('severity', 'section', 'name', 'message'));
        return $reqs->getErrors() ? 1 : 0;
    }
    protected function parseFilter(InputInterface $input)
    {
        $filterSeverities = array();
        if ($input->getOption('filter-warnings')) {
            $filterSeverities[] = 'warning';
        }
        if ($input->getOption('filter-errors')) {
            $filterSeverities[] = 'error';
        }
        if ($input->getOption('filter-infos')) {
            $filterSeverities[] = 'info';
        }
        if ($filterSeverities === array()) {
            $filterSeverities = array('warning', 'error', 'info');
        }
        return $filterSeverities;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\SettingTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class SettingRevertCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    use SettingTrait;
    protected function configure()
    {
        $C = '<comment>';
        $_C = '</comment>';
        $I = '<info>';
        $_I = '</info>';
        $this->setName('setting:revert')->setAliases(['vdel'])->setDescription('Revert CiviCRM settings')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->configureOutputOptions(['tabular' => \TRUE, 'shortcuts' => ['table', 'list'], 'fallback' => 'table', 'availColumns' => 'scope,key,value,default,explicit,mandatory,layer', 'defaultColumns' => 'scope,key,value,layer'])->addOption('dry-run', 'N', InputOption::VALUE_NONE, 'Preview the API call. Do not execute.')->addOption('scope', NULL, InputOption::VALUE_REQUIRED, 'Domain to configure', 'domain')->addArgument('name', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'An setting name or regex')->setHelp("Revert CiviCRM settings\n\n{$C}Name Filter{$_C}\n\n    By default, display all settings. You may optionally lookup specific settings by name\n    or by regular expression.\n\n    {$C}cv setting:revert {$_C}{$I}mailerJobSize{$_I}                    (specific settings)\n    {$C}cv setting:revert {$_C}{$I}mailerJobSize mailerJobsMax{$_I}      (specific settings)\n    {$C}cv setting:revert /{$_C}{$I}mail{$_I}{$C}/{$_C}                           (any settings that involve \"mail\")\n\n{$C}Setting Scope{$_C}\n\n    All CiviCRM settings are formally attached to a scope, such as a {$I}Contact{$_I} or {$I}Domain{$_I}.\n    For most tasks in most deployments, there is only one important scope ({$I}domain #1{$_I}).\n    In some edge-cases, you may need to target a specific scope Here are some example scopes:\n\n    {$C}cv setting:revert --scope={$_C}{$I}domain{$_I}                   (default domain)\n    {$C}cv setting:revert --scope={$_C}{$I}domain:*{$_I}                 (all domains)\n    {$C}cv setting:revert --scope={$_C}{$I}domain:12{$_I}                (domain #12)\n    {$C}cv setting:revert --scope={$_C}{$I}contact{$_I}{$C} --user={$_C}{$I}admin{$_I}     (admin's contact)\n    {$C}cv setting:revert --scope={$_C}{$I}contact:201{$_I}              (contact #201)\n");
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        $errorOutput = \is_callable([$output, 'getErrorOutput']) ? $output->getErrorOutput() : $output;
        $filter = $this->createSettingFilter($input->getArgument('name'));
        $result = [];
        foreach ($this->findSettings($input->getOption('scope')) as $settingScope => $settingBag) {
            $meta = $this->getMetadata($settingScope);
            foreach ($settingBag->all() as $settingKey => $settingValue) {
                if (!$filter($settingKey)) {
                    continue;
                }
                if (!$settingBag->hasExplict($settingKey)) {
                    $errorOutput->writeln("<comment>Skip \"{$settingKey}\" (no value found)</comment>");
                } elseif ($input->getOption('dry-run')) {
                    $errorOutput->writeln("<comment>Revert \"{$settingKey}\" (dry run)</comment>");
                } else {
                    $errorOutput->writeln("<comment>Revert \"{$settingKey}\"</comment>");
                    $settingBag->revert($settingKey);
                }
                [$encode, $decode] = $this->codec($meta, $settingKey);
                $row = ['scope' => $settingScope, 'key' => $settingKey, 'value' => $decode($settingBag->get($settingKey)), 'default' => $decode($settingBag->getDefault($settingKey)), 'explicit' => $decode($settingBag->getExplicit($settingKey)), 'mandatory' => $decode($settingBag->getMandatory($settingKey)), 'layer' => $settingBag->getMandatory($settingKey) !== NULL ? 'mandatory' : ($settingBag->hasExplict($settingKey) ? 'explicit' : 'default')];
                $result[] = $row;
            }
        }
        $this->sendSettings($input, $output, $result);
        return 0;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Civi\Cv\Util\StructuredOutputTrait;
use Civi\Cv\Util\ConsoleQueueRunner;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class UpgradeDbCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    use StructuredOutputTrait;
    protected function configure()
    {
        $this->setName('upgrade:db')->setDescription('Run the database upgrade')->configureOutputOptions(['fallback' => 'pretty'])->addOption('dry-run', NULL, InputOption::VALUE_NONE, 'Preview the list of upgrade tasks')->addOption('retry', NULL, InputOption::VALUE_NONE, 'Resume a failed upgrade, retrying the last step')->addOption('skip', NULL, InputOption::VALUE_NONE, 'Resume a failed upgrade, skipping the last step')->addOption('step', NULL, InputOption::VALUE_NONE, 'Run the upgrade queue in steps, pausing before each step')->setHelp('Run the database upgrade

Examples:
  cv upgrade:db
  cv upgrade:db --dry-run
  cv upgrade:db --retry
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!\defined('CIVICRM_UPGRADE_ACTIVE')) {
            \define('CIVICRM_UPGRADE_ACTIVE', 1);
        }
        $this->boot($input, $output);
        if (!\ini_get('safe_mode')) {
            \set_time_limit(0);
        }
        if ($input->getOption('step')) {
            if ($input->getOption('out') !== 'pretty') {
                throw new \RuntimeException('The --step option only works with "pretty" output.');
            }
            if ($output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) {
                $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
            }
        }
        $niceMsgVerbosity = $input->getOption('out') === 'pretty' ? OutputInterface::VERBOSITY_NORMAL : OutputInterface::VERBOSITY_VERBOSE;
        $isFirstTry = !$input->getOption('retry') && !$input->getOption('skip');
        $codeVer = \CRM_Utils_System::version();
        $dbVer = \CRM_Core_BAO_Domain::version();
        $postUpgradeMessageFile = $this->getUpgradeFile();
        $output->writeln(\sprintf("<info>Found CiviCRM database version <comment>%s</comment>.</info>", $dbVer), $niceMsgVerbosity);
        $output->writeln(\sprintf("<info>Found CiviCRM code version <comment>%s</comment>.</info>", $codeVer), $niceMsgVerbosity);
        if (\version_compare($codeVer, $dbVer) == 0) {
            $result = array('latestVer' => $codeVer, 'message' => "You are already upgraded to CiviCRM {$codeVer}");
            $result['text'] = $result['message'];
            $this->sendResult($input, $output, $result);
            return 0;
        }
        if ($isFirstTry && \FALSE !== \stripos($dbVer, 'upgrade')) {
            throw new \Exception("Cannot begin upgrade: The database indicates that an incomplete upgrade is pending. If you would like to resume, use --retry or --skip.");
        }
        if (!$isFirstTry && !\file_exists($postUpgradeMessageFile)) {
            throw new \Exception("Cannot resume upgrade: The log file ({$postUpgradeMessageFile}) is missing. Consider a regular upgrade (without --retry or --skip).");
        }
        $upgrade = new \CRM_Upgrade_Form();
        if ($error = $upgrade->checkUpgradeableVersion($dbVer, $codeVer)) {
            throw new \Exception($error);
        }
        if ($isFirstTry) {
            $output->writeln("<info>Checking pre-upgrade messages...</info>", $niceMsgVerbosity);
            $preUpgradeMessage = NULL;
            $upgrade->setPreUpgradeMessage($preUpgradeMessage, $dbVer, $codeVer);
            if ($preUpgradeMessage) {
                $output->writeln(\CRM_Utils_String::htmlToText($preUpgradeMessage), $niceMsgVerbosity);
                if (!$this->getIO()->confirm('Continue?')) {
                    $output->writeln("<error>Abort</error>");
                    return 1;
                }
            } else {
                $output->writeln("(No messages)", $niceMsgVerbosity);
            }
        }
        if ($isFirstTry) {
            $output->writeln("<info>Dropping SQL triggers...</info>", $niceMsgVerbosity);
            if (!$input->getOption('dry-run')) {
                \CRM_Core_DAO::dropTriggers();
            }
        }
        if ($isFirstTry) {
            $output->writeln("<info>Preparing upgrade...</info>", $niceMsgVerbosity);
            \file_put_contents($postUpgradeMessageFile, "");
            \chmod($postUpgradeMessageFile, 0700);
            $queue = \CRM_Upgrade_Form::buildQueue($dbVer, $codeVer, $postUpgradeMessageFile);
            if (!$queue instanceof \CRM_Queue_Queue_Sql) {
                throw new \RuntimeException("Error: \"cv upgrade\" only supports SQL-based queues.");
            }
        } else {
            $output->writeln("<info>Resuming upgrade...</info>", $niceMsgVerbosity);
            $queue = \CRM_Queue_Service::singleton()->load(array('name' => \CRM_Upgrade_Form::QUEUE_NAME, 'type' => 'Sql'));
            if ($input->getOption('skip')) {
                $item = $queue->stealItem();
                $output->writeln(\sprintf("<error>Skip task: %s</error>", $item->data->title));
                $queue->deleteItem($item);
            }
        }
        $output->writeln("<info>Executing upgrade...</info>", $niceMsgVerbosity);
        $runner = new ConsoleQueueRunner($this->getIO(), $queue, $input->getOption('dry-run'), $input->getOption('step'));
        $runner->runAll();
        $output->writeln("<info>Finishing upgrade...</info>", $niceMsgVerbosity);
        if (!$input->getOption('dry-run')) {
            \CRM_Upgrade_Form::doFinish();
        }
        $output->writeln("<info>Upgrade to <comment>{$codeVer}</comment> completed.</info>", $niceMsgVerbosity);
        if (\version_compare($codeVer, '5.26.alpha', '<')) {
            $output->writeln('<info>Detected CiviCRM 5.25 or earlier. Force flush.</info>');
            \Civi\Cv\Util\Cv::passthru("flush");
        }
        $output->writeln("<info>Checking post-upgrade messages...</info>", $niceMsgVerbosity);
        $message = \file_get_contents($postUpgradeMessageFile);
        if ($input->getOption('out') === 'pretty') {
            if ($message) {
                $output->writeln(\CRM_Utils_String::htmlToText($message), OutputInterface::OUTPUT_RAW);
            } else {
                $output->writeln("(No messages)", $niceMsgVerbosity);
            }
            $output->writeln("<info>Have a nice day.</info>", $niceMsgVerbosity);
        } else {
            $this->sendResult($input, $output, array('latestVer' => $codeVer, 'message' => $message, 'text' => \CRM_Utils_String::htmlToText($message)));
        }
        \unlink($postUpgradeMessageFile);
    }
    protected function getUpgradeFile()
    {
        $home = \getenv('HOME') ? \getenv('HOME') : \getenv('USERPROFILE');
        if (empty($home) || !\file_exists($home)) {
            throw new \RuntimeException("Failed to locate HOME or USERPROFILE");
        }
        $dir = \implode(\DIRECTORY_SEPARATOR, [$home, '.cv', 'upgrade']);
        if (!\file_exists($dir)) {
            if (!\mkdir($dir, 0777, \TRUE)) {
                throw new \RuntimeException("Failed to initialize upgrade data folder: {$dir}");
            }
        }
        $id = \md5(\implode(\CRM_Core_DAO::VALUE_SEPARATOR, array(\function_exists('posix_getuid') ? \posix_getuid() : 0, $home, CIVICRM_SETTINGS_PATH, $GLOBALS['civicrm_root'], \parse_url(CIVICRM_DSN, \PHP_URL_PATH), \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''))));
        return $dir . \DIRECTORY_SEPARATOR . $id . '.dat';
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\BootTrait;
use Cvphar\Symfony\Component\Console\Input\InputArgument;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class PipeCommand extends \Civi\Cv\Command\BaseCommand
{
    use BootTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('pipe')->setDescription('Start a Civi::pipe session (JSON-RPC 2.0)')->setHelp('Start a Civi::pipe session (JSON-RPC 2.0)

The Civi::pipe protocol provides a line-oriented session for executing multiple requests in a single CiviCRM instance.

Callers may request *connection flags*, such as:

* v: Show version
* l: Show login support
* t: Enable trusted mode
* u: Enable untrusted mode

Examples:

  $ cv pipe
  {"Civi::pipe":{"v":"5.47.alpha1","t":"trusted","l":["nologin"]}}

  $ cv pipe uv
  {"Civi::pipe":{"u":"untrusted","v":"5.47.alpha1"}}

See also: https://docs.civicrm.org/dev/en/latest/framework/pipe
');
        $this->addArgument('connection-flags', InputArgument::OPTIONAL, 'List of connection-flags (Default: Determined by civicrm-core)', NULL);
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!\is_callable(['Civi', 'pipe'])) {
            \fwrite(\STDERR, "This version of CiviCRM does not include Civi::pipe() support.\n");
            return 1;
        }
        if ($flags = $input->getArgument('connection-flags')) {
            \Civi::pipe($flags);
        } else {
            \Civi::pipe();
        }
        return 0;
    }
}
<?php

namespace Civi\Cv\Command;

use Civi\Cv\Util\StructuredOutputTrait;
use Cvphar\Symfony\Component\Console\Input\InputInterface;
use Cvphar\Symfony\Component\Console\Input\InputOption;
use Cvphar\Symfony\Component\Console\Output\OutputInterface;
class PathCommand extends \Civi\Cv\Command\BaseExtensionCommand
{
    use StructuredOutputTrait;
    public function __construct($name = NULL)
    {
        parent::__construct($name);
    }
    protected function configure()
    {
        $this->setName('path')->setAliases(array())->setDescription('Look up the path to a file or directory')->configureOutputOptions(['tabular' => \TRUE, 'fallback' => 'list', 'availColumns' => 'type,expr,value', 'shortcuts' => ['table', 'list']])->addOption('ext', 'x', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An extension name. Identify the extension by full key ("org.example.foobar") or short name ("foobar"). Use "." for the default extension dir.')->addOption('config', 'c', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A config property. (Ex: "templateCompileDir/en_US")')->addOption('dynamic', 'd', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A dynamic path expression (v4.7+) (Ex: "[civicrm.root]/packages")')->addOption('mkdir', 'm', InputOption::VALUE_NONE, 'Make a directory for the given path(s)')->setHelp('Look up the path to a file or directory within CiviCRM.

Examples: Lookup extension paths
  cv path -x org.civicrm.module.cividiscount
  cv path -x cividiscount
  cv path -x cividiscount/info.xml
  cv path -x .

Examples: Lookup configuration properties
  cv path -c configAndLogDir
  cv path -c customFileUploadDir
  cv path -c customPHPPathDir
  cv path -c customTemplateDir
  cv path -c extensionsDir
  cv path -c imageUploadDir
  cv path -c uploadDir
  cv path -c templateCompileDir
  cv path -c templateCompileDir/en_US

Examples: Lookup dynamic paths
  cv path -d \'[civicrm.root]\'
  cv path -d \'[civicrm.root]/packages/DB.php\'
  cv path -d \'[civicrm.files]\'
  cv path -d \'[cms.root]/index.php\'

Example: Lookup multiple items
  cv path -x cividiscount/info.xml -x flexmailer/info.xml -d \'[civicrm.root]/civicrm-version.php\'
');
        $this->configureBootOptions();
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->boot($input, $output);
        if (!$input->getOption('ext') && !$input->getOption('config') && !$input->getOption('dynamic')) {
            $output->getErrorOutput()->writeln("<error>No paths specified. Must use -x, -c, or -d. (See also: cv path -h)</error>");
            return 1;
        }
        $results = array();
        $returnValue = 0;
        $mapper = \CRM_Extension_System::singleton()->getMapper();
        foreach ($input->getOption('ext') as $extExpr) {
            [$keyOrName, $file] = $this->pathSplit($extExpr);
            if ($keyOrName === '.') {
                $results[] = array('type' => 'ext', 'expr' => $extExpr, 'value' => $this->pathJoin(\CRM_Core_Config::singleton()->extensionsDir, $file));
                continue;
            }
            if (\strpos($keyOrName, '.') === \FALSE) {
                $shortMap = $this->getShortMap();
                if (isset($shortMap[$keyOrName]) && \count($shortMap[$keyOrName]) === 1) {
                    $keyOrName = $shortMap[$keyOrName][0];
                }
            }
            try {
                $results[] = array('type' => 'ext', 'expr' => $extExpr, 'value' => $this->pathJoin($mapper->keyToBasePath($keyOrName), $file));
            } catch (\CRM_Extension_Exception_MissingException $e) {
                $output->getErrorOutput()->writeln("<error>Ignoring unrecognized extension \"{$keyOrName}\"</error>");
                $returnValue = 1;
            }
        }
        foreach ($input->getOption('config') as $configExpr) {
            [$configProperty, $file] = $this->pathSplit($configExpr);
            $dir = \CRM_Core_Config::singleton()->{$configProperty};
            if (\version_compare(\CRM_Utils_System::version(), '4.7', '<') && $configProperty === 'templateCompileDir') {
                $dir = \dirname($dir);
            }
            $results[] = array('type' => 'config', 'expr' => $configExpr, 'value' => $this->pathJoin($dir, $file));
        }
        foreach ($input->getOption('dynamic') as $dynExpr) {
            if (!\is_callable(array('Civi', 'paths'))) {
                $output->getErrorOutput()->writeln("<error>Dynamic path expressions are only available on CiviCRM v4.7+</error>");
                $returnValue = 1;
                break;
            }
            if (\preg_match(';^(\\[[^\\]]+\\])([\\/]?)$;', $dynExpr, $matches)) {
                $dyn = \Civi::paths()->getPath($matches[1] . "/./");
                $value = \preg_replace(';/./$;', '', $dyn) . $matches[2];
                $results[] = array('type' => 'dynamic', 'expr' => $dynExpr, 'value' => $value);
            } else {
                $results[] = array('type' => 'dynamic', 'expr' => $dynExpr, 'value' => \Civi::paths()->getPath($dynExpr));
            }
        }
        $columns = $this->parseColumns($input, array('list' => array('value')));
        if ($input->getOption('mkdir')) {
            foreach ($results as $result) {
                if (!\file_exists($result['value'])) {
                    \mkdir($result['value'], 0777, \TRUE);
                }
            }
        }
        $this->sendTable($input, $output, $results, $columns);
        return $returnValue;
    }
    protected function pathSplit(string $expr) : array
    {
        $parts = \explode('/', $expr);
        $first = \array_shift($parts);
        return [$first, \count($parts) ? \implode('/', $parts) : NULL];
    }
    protected function pathJoin($folder, $file)
    {
        if ($file !== NULL && $file !== \FALSE) {
            return \CRM_Utils_File::addTrailingSlash($folder) . $file;
        } else {
            return \rtrim($folder, \DIRECTORY_SEPARATOR);
        }
    }
}
<?php

namespace Civi\Cv\Exception;

class ProcessErrorException extends \RuntimeException
{
    private $process;
    public function __construct(\Cvphar\Symfony\Component\Process\Process $process, $message = "", $code = 0, \Civi\Cv\Exception\Exception $previous = NULL)
    {
        $this->process = $process;
        if (empty($message)) {
            $message = $this->createReport($process);
        }
        parent::__construct($message, $code, $previous);
    }
    public function setProcess($process)
    {
        $this->process = $process;
    }
    public function getProcess()
    {
        return $this->process;
    }
    public function createReport($process)
    {
        return "Process failed:\n[[ COMMAND: {$process->getCommandLine()} ]]\n[[ CWD: {$process->getWorkingDirectory()} ]]\n[[ EXIT CODE: {$process->getExitCode()} ]]\n[[ STDOUT ]]\n{$process->getOutput()}\n[[ STDERR ]]\n{$process->getErrorOutput()}\n      ";
    }
}
‘Ç Ì¤âœª8k5èiD›:´åþ   GBMB