Skip to content

Commit 8d45373

Browse files
committed
compatibility fixes for PHP < 7
1 parent 39fa104 commit 8d45373

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

wp-includes/sqlite/class-wp-sqlite-lexer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ class WP_SQLite_Lexer {
1616
/**
1717
* The maximum length of a keyword.
1818
*/
19-
public const KEYWORD_MAX_LENGTH = 30;
19+
const KEYWORD_MAX_LENGTH = 30;
2020

2121
/**
2222
* The maximum length of a label.
2323
*
2424
* Ref: https://dev.mysql.com/doc/refman/5.7/en/statement-labels.html
2525
*/
26-
public const LABEL_MAX_LENGTH = 16;
26+
const LABEL_MAX_LENGTH = 16;
2727

2828
/**
2929
* The maximum length of an operator.
3030
*/
31-
public const OPERATOR_MAX_LENGTH = 4;
31+
const OPERATOR_MAX_LENGTH = 4;
3232

3333
/**
3434
* A list of methods that are used in lexing the SQL query.
@@ -1404,7 +1404,7 @@ class WP_SQLite_Lexer {
14041404
* @link https://dev.mysql.com/doc/refman/en/sql-mode.html#sqlmode_ansi_quotes
14051405
* @link https://mariadb.com/kb/en/sql-mode/#ansi_quotes
14061406
*/
1407-
public const SQL_MODE_ANSI_QUOTES = 2;
1407+
const SQL_MODE_ANSI_QUOTES = 2;
14081408

14091409
/**
14101410
* The array of tokens.

wp-includes/sqlite/class-wp-sqlite-token.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class WP_SQLite_Token {
2222
* determined because of the ambiguous context. Further analysis might be
2323
* required to detect its type.
2424
*/
25-
public const TYPE_NONE = 0;
25+
const TYPE_NONE = 0;
2626

2727
/**
2828
* SQL specific keywords: SELECT, UPDATE, INSERT, etc.
2929
*/
30-
public const TYPE_KEYWORD = 1;
30+
const TYPE_KEYWORD = 1;
3131

3232
/**
3333
* Any type of legal operator.
@@ -39,12 +39,12 @@ class WP_SQLite_Token {
3939
* SQL specific operators: . (e.g. .. WHERE database.table ..),
4040
* * (e.g. SELECT * FROM ..)
4141
*/
42-
public const TYPE_OPERATOR = 2;
42+
const TYPE_OPERATOR = 2;
4343

4444
/**
4545
* Spaces, tabs, new lines, etc.
4646
*/
47-
public const TYPE_WHITESPACE = 3;
47+
const TYPE_WHITESPACE = 3;
4848

4949
/**
5050
* Any type of legal comment.
@@ -64,35 +64,35 @@ class WP_SQLite_Token {
6464
*
6565
* Backslashes were added to respect PHP's comments syntax.
6666
*/
67-
public const TYPE_COMMENT = 4;
67+
const TYPE_COMMENT = 4;
6868

6969
/**
7070
* Boolean values: true or false.
7171
*/
72-
public const TYPE_BOOL = 5;
72+
const TYPE_BOOL = 5;
7373

7474
/**
7575
* Numbers: 4, 0x8, 15.16, 23e42, etc.
7676
*/
77-
public const TYPE_NUMBER = 6;
77+
const TYPE_NUMBER = 6;
7878

7979
/**
8080
* Literal strings: 'string', "test".
8181
* Some of these strings are actually symbols.
8282
*/
83-
public const TYPE_STRING = 7;
83+
const TYPE_STRING = 7;
8484

8585
/**
8686
* Database, table names, variables, etc.
8787
* For example: ```SELECT `foo`, `bar` FROM `database`.`table`;```.
8888
*/
89-
public const TYPE_SYMBOL = 8;
89+
const TYPE_SYMBOL = 8;
9090

9191
/**
9292
* Delimits an unknown string.
9393
* For example: ```SELECT * FROM test;```, `test` is a delimiter.
9494
*/
95-
public const TYPE_DELIMITER = 9;
95+
const TYPE_DELIMITER = 9;
9696

9797
/**
9898
* Labels in LOOP statement, ITERATE statement etc.
@@ -102,47 +102,47 @@ class WP_SQLite_Token {
102102
* begin_label: REPEAT [statement_list] ... END REPEAT [end_label]
103103
* begin_label: WHILE ... DO [statement_list] END WHILE [end_label].
104104
*/
105-
public const TYPE_LABEL = 10;
105+
const TYPE_LABEL = 10;
106106

107107
// Flags that describe the tokens in more detail.
108108
// All keywords must have flag 1 so `Context::isKeyword` method doesn't
109109
// require strict comparison.
110-
public const FLAG_KEYWORD_RESERVED = 2;
111-
public const FLAG_KEYWORD_COMPOSED = 4;
112-
public const FLAG_KEYWORD_DATA_TYPE = 8;
113-
public const FLAG_KEYWORD_KEY = 16;
114-
public const FLAG_KEYWORD_FUNCTION = 32;
110+
const FLAG_KEYWORD_RESERVED = 2;
111+
const FLAG_KEYWORD_COMPOSED = 4;
112+
const FLAG_KEYWORD_DATA_TYPE = 8;
113+
const FLAG_KEYWORD_KEY = 16;
114+
const FLAG_KEYWORD_FUNCTION = 32;
115115

116116
// Numbers related flags.
117-
public const FLAG_NUMBER_HEX = 1;
118-
public const FLAG_NUMBER_FLOAT = 2;
119-
public const FLAG_NUMBER_APPROXIMATE = 4;
120-
public const FLAG_NUMBER_NEGATIVE = 8;
121-
public const FLAG_NUMBER_BINARY = 16;
117+
const FLAG_NUMBER_HEX = 1;
118+
const FLAG_NUMBER_FLOAT = 2;
119+
const FLAG_NUMBER_APPROXIMATE = 4;
120+
const FLAG_NUMBER_NEGATIVE = 8;
121+
const FLAG_NUMBER_BINARY = 16;
122122

123123
// Strings related flags.
124-
public const FLAG_STRING_SINGLE_QUOTES = 1;
125-
public const FLAG_STRING_DOUBLE_QUOTES = 2;
124+
const FLAG_STRING_SINGLE_QUOTES = 1;
125+
const FLAG_STRING_DOUBLE_QUOTES = 2;
126126

127127
// Comments related flags.
128-
public const FLAG_COMMENT_BASH = 1;
129-
public const FLAG_COMMENT_C = 2;
130-
public const FLAG_COMMENT_SQL = 4;
131-
public const FLAG_COMMENT_MYSQL_CMD = 8;
128+
const FLAG_COMMENT_BASH = 1;
129+
const FLAG_COMMENT_C = 2;
130+
const FLAG_COMMENT_SQL = 4;
131+
const FLAG_COMMENT_MYSQL_CMD = 8;
132132

133133
// Operators related flags.
134-
public const FLAG_OPERATOR_ARITHMETIC = 1;
135-
public const FLAG_OPERATOR_LOGICAL = 2;
136-
public const FLAG_OPERATOR_BITWISE = 4;
137-
public const FLAG_OPERATOR_ASSIGNMENT = 8;
138-
public const FLAG_OPERATOR_SQL = 16;
134+
const FLAG_OPERATOR_ARITHMETIC = 1;
135+
const FLAG_OPERATOR_LOGICAL = 2;
136+
const FLAG_OPERATOR_BITWISE = 4;
137+
const FLAG_OPERATOR_ASSIGNMENT = 8;
138+
const FLAG_OPERATOR_SQL = 16;
139139

140140
// Symbols related flags.
141-
public const FLAG_SYMBOL_VARIABLE = 1;
142-
public const FLAG_SYMBOL_BACKTICK = 2;
143-
public const FLAG_SYMBOL_USER = 4;
144-
public const FLAG_SYMBOL_SYSTEM = 8;
145-
public const FLAG_SYMBOL_PARAMETER = 16;
141+
const FLAG_SYMBOL_VARIABLE = 1;
142+
const FLAG_SYMBOL_BACKTICK = 2;
143+
const FLAG_SYMBOL_USER = 4;
144+
const FLAG_SYMBOL_SYSTEM = 8;
145+
const FLAG_SYMBOL_PARAMETER = 16;
146146

147147
/**
148148
* The token it its raw string representation.

0 commit comments

Comments
 (0)