Add visibility modifiers to constants

Closes GH-848.
This commit is contained in:
MathiasReker 2022-07-04 17:11:08 +02:00 committed by Nikita Popov
parent a3f2bb634d
commit 050342b5df
22 changed files with 349 additions and 349 deletions

View File

@ -24,7 +24,7 @@ use PhpParser\Node\Stmt;
class #(-p) extends \PhpParser\ParserAbstract
{
#tokenval
const %s = %n;
public const %s = %n;
#endtokenval
protected $tokenToSymbolMapSize = #(YYMAXLEX);

View File

@ -9,9 +9,9 @@ use PhpParser\Node\Stmt;
class TraitUseAdaptation implements Builder
{
const TYPE_UNDEFINED = 0;
const TYPE_ALIAS = 1;
const TYPE_PRECEDENCE = 2;
public const TYPE_UNDEFINED = 0;
public const TYPE_ALIAS = 1;
public const TYPE_PRECEDENCE = 2;
/** @var int Type of building adaptation */
protected $type;

View File

@ -7,10 +7,10 @@ namespace PhpParser\Internal;
*/
class DiffElem
{
const TYPE_KEEP = 0;
const TYPE_REMOVE = 1;
const TYPE_ADD = 2;
const TYPE_REPLACE = 3;
public const TYPE_KEEP = 0;
public const TYPE_REMOVE = 1;
public const TYPE_ADD = 2;
public const TYPE_REPLACE = 3;
/** @var int One of the TYPE_* constants */
public $type;

View File

@ -20,10 +20,10 @@ use 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';
public const PHP_7_3 = '7.3dev';
public const PHP_7_4 = '7.4dev';
public const PHP_8_0 = '8.0dev';
public const PHP_8_1 = '8.1dev';
/** @var mixed[] Patches used to reverse changes introduced in the code */
private $patches = [];

View File

@ -6,7 +6,7 @@ use PhpParser\Lexer\Emulative;
final class FlexibleDocStringEmulator extends TokenEmulator
{
const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX'
private 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

View File

@ -6,8 +6,8 @@ use PhpParser\Token;
abstract class KeywordEmulator extends TokenEmulator
{
abstract function getKeywordString(): string;
abstract function getKeywordToken(): int;
abstract public function getKeywordString(): string;
abstract public function getKeywordToken(): int;
public function isEmulationNeeded(string $code): bool
{

View File

@ -7,13 +7,13 @@ use PhpParser\Token;
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';
private const BIN = '(?:0b[01]+(?:_[01]+)*)';
private const HEX = '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)';
private const DEC = '(?:[0-9]+(?:_[0-9]+)*)';
private const SIMPLE_FLOAT = '(?:' . self::DEC . '\.' . self::DEC . '?|\.' . self::DEC . ')';
private const EXP = '(?:e[+-]?' . self::DEC . ')';
private const FLOAT = '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')';
private const NUMBER = '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA';
public function getPhpVersion(): string
{

View File

@ -7,8 +7,8 @@ use PhpParser\Node\Expr;
class Array_ extends Expr
{
// For use in "kind" attribute
const KIND_LONG = 1; // array() syntax
const KIND_SHORT = 2; // [] syntax
public const KIND_LONG = 1; // array() syntax
public const KIND_SHORT = 2; // [] syntax
/** @var (ArrayItem|null)[] Items */
public $items;

View File

@ -7,9 +7,9 @@ use PhpParser\Node\Expr\Cast;
class Double extends Cast
{
// For use in "kind" attribute
const KIND_DOUBLE = 1; // "double" syntax
const KIND_FLOAT = 2; // "float" syntax
const KIND_REAL = 3; // "real" syntax
public const KIND_DOUBLE = 1; // "double" syntax
public const KIND_FLOAT = 2; // "float" syntax
public const KIND_REAL = 3; // "real" syntax
public function getType() : string {
return 'Expr_Cast_Double';

View File

@ -7,8 +7,8 @@ use PhpParser\Node\Expr;
class Exit_ extends Expr
{
/* For use in "kind" attribute */
const KIND_EXIT = 1;
const KIND_DIE = 2;
public const KIND_EXIT = 1;
public const KIND_DIE = 2;
/** @var null|Expr Expression */
public $expr;

View File

@ -6,10 +6,10 @@ use 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 const TYPE_INCLUDE = 1;
public const TYPE_INCLUDE_ONCE = 2;
public const TYPE_REQUIRE = 3;
public const TYPE_REQUIRE_ONCE = 4;
/** @var Expr Expression */
public $expr;

View File

@ -8,10 +8,10 @@ use PhpParser\Node\Scalar;
class LNumber extends Scalar
{
/* For use in "kind" attribute */
const KIND_BIN = 2;
const KIND_OCT = 8;
const KIND_DEC = 10;
const KIND_HEX = 16;
public const KIND_BIN = 2;
public const KIND_OCT = 8;
public const KIND_DEC = 10;
public const KIND_HEX = 16;
/** @var int Number value */
public $value;

View File

@ -8,10 +8,10 @@ use PhpParser\Node\Scalar;
class String_ extends Scalar
{
/* For use in "kind" attribute */
const KIND_SINGLE_QUOTED = 1;
const KIND_DOUBLE_QUOTED = 2;
const KIND_HEREDOC = 3;
const KIND_NOWDOC = 4;
public const KIND_SINGLE_QUOTED = 1;
public const KIND_DOUBLE_QUOTED = 2;
public const KIND_HEREDOC = 3;
public const KIND_NOWDOC = 4;
/** @var string String value */
public $value;

View File

@ -7,15 +7,15 @@ use 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;
public const MODIFIER_PUBLIC = 1;
public const MODIFIER_PROTECTED = 2;
public const MODIFIER_PRIVATE = 4;
public const MODIFIER_STATIC = 8;
public const MODIFIER_ABSTRACT = 16;
public const MODIFIER_FINAL = 32;
public const MODIFIER_READONLY = 64;
const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4
public const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4
/** @var int Type */
public $flags;

View File

@ -7,8 +7,8 @@ use PhpParser\Node;
class Namespace_ extends Node\Stmt
{
/* For use in the "kind" attribute */
const KIND_SEMICOLON = 1;
const KIND_BRACED = 2;
public const KIND_SEMICOLON = 1;
public const KIND_BRACED = 2;
/** @var null|Node\Name Name */
public $name;

View File

@ -11,13 +11,13 @@ class Use_ extends Stmt
* TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the
* Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations.
*/
const TYPE_UNKNOWN = 0;
public const TYPE_UNKNOWN = 0;
/** Class or namespace import */
const TYPE_NORMAL = 1;
public const TYPE_NORMAL = 1;
/** Function import */
const TYPE_FUNCTION = 2;
public const TYPE_FUNCTION = 2;
/** Constant import */
const TYPE_CONSTANT = 3;
public const TYPE_CONSTANT = 3;
/** @var int Type of alias */
public $type;

View File

@ -11,7 +11,7 @@ class NodeTraverser implements NodeTraverserInterface
* For subsequent visitors enterNode() will still be called on the current
* node and leaveNode() will also be invoked for the current node.
*/
const DONT_TRAVERSE_CHILDREN = 1;
public const DONT_TRAVERSE_CHILDREN = 1;
/**
* If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns
@ -19,7 +19,7 @@ class NodeTraverser implements NodeTraverserInterface
*
* The afterTraverse() method will still be invoked.
*/
const STOP_TRAVERSAL = 2;
public const STOP_TRAVERSAL = 2;
/**
* If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs
@ -28,7 +28,7 @@ class NodeTraverser implements NodeTraverserInterface
* For subsequent visitors leaveNode() will still be invoked for the
* removed node.
*/
const REMOVE_NODE = 3;
public const REMOVE_NODE = 3;
/**
* If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes
@ -37,7 +37,7 @@ class NodeTraverser implements NodeTraverserInterface
* For subsequent visitors enterNode() will not be called as well.
* leaveNode() will be invoked for visitors that has enterNode() method invoked.
*/
const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;
public const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;
/** @var NodeVisitor[] Visitors */
protected $visitors = [];

View File

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

View File

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

View File

@ -25,7 +25,7 @@ use PhpParser\Parser\Tokens;
abstract class ParserAbstract implements Parser
{
const SYMBOL_NONE = -1;
private const SYMBOL_NONE = -1;
/** @var Lexer Lexer that is used when parsing */
protected $lexer;

View File

@ -7,8 +7,8 @@ use PhpParser\Parser\Php8;
class ParserFactory
{
const PREFER_PHP7 = 1;
const ONLY_PHP7 = 3;
public const PREFER_PHP7 = 1;
public const ONLY_PHP7 = 3;
/**
* Creates a Parser instance, according to the provided kind.

View File

@ -14,13 +14,13 @@ use PhpParser\Node\Stmt;
abstract class PrettyPrinterAbstract
{
const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence
const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence
const FIXUP_CALL_LHS = 2; // LHS of call
const FIXUP_DEREF_LHS = 3; // LHS of dereferencing operation
const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing
const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing
const FIXUP_ENCAPSED = 6; // Encapsed string part
protected const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence
protected const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence
protected const FIXUP_CALL_LHS = 2; // LHS of call
protected const FIXUP_DEREF_LHS = 3; // LHS of dereferencing operation
protected const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing
protected const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing
protected const FIXUP_ENCAPSED = 6; // Encapsed string part
protected $precedenceMap = [
// [precedence, associativity]