Completed
Pull Request — master (#94)
by Deven
78:53
created
src/Token.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
      *
30 30
      * @var int
31 31
      */
32
-    const TYPE_NONE                     =  0;
32
+    const TYPE_NONE = 0;
33 33
 
34 34
     /**
35 35
      * SQL specific keywords: SELECT, UPDATE, INSERT, etc.
36 36
      *
37 37
      * @var int
38 38
      */
39
-    const TYPE_KEYWORD                  =  1;
39
+    const TYPE_KEYWORD = 1;
40 40
 
41 41
     /**
42 42
      * Any type of legal operator.
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
      *
51 51
      * @var int
52 52
      */
53
-    const TYPE_OPERATOR                 =  2;
53
+    const TYPE_OPERATOR = 2;
54 54
 
55 55
     /**
56 56
      * Spaces, tabs, new lines, etc.
57 57
      *
58 58
      * @var int
59 59
      */
60
-    const TYPE_WHITESPACE               =  3;
60
+    const TYPE_WHITESPACE = 3;
61 61
 
62 62
     /**
63 63
      * Any type of legal comment.
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
      *
80 80
      * @var int
81 81
      */
82
-    const TYPE_COMMENT                  =  4;
82
+    const TYPE_COMMENT = 4;
83 83
 
84 84
     /**
85 85
      * Boolean values: true or false.
86 86
      *
87 87
      * @var int
88 88
      */
89
-    const TYPE_BOOL                     =  5;
89
+    const TYPE_BOOL = 5;
90 90
 
91 91
     /**
92 92
      * Numbers: 4, 0x8, 15.16, 23e42, etc.
93 93
      *
94 94
      * @var int
95 95
      */
96
-    const TYPE_NUMBER                   =  6;
96
+    const TYPE_NUMBER = 6;
97 97
 
98 98
     /**
99 99
      * Literal strings: 'string', "test".
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @var int
103 103
      */
104
-    const TYPE_STRING                   =  7;
104
+    const TYPE_STRING = 7;
105 105
 
106 106
     /**
107 107
      * Database, table names, variables, etc.
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      *
110 110
      * @var int
111 111
      */
112
-    const TYPE_SYMBOL                   =  8;
112
+    const TYPE_SYMBOL = 8;
113 113
 
114 114
     /**
115 115
      * Delimits an unknown string.
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      *
118 118
      * @var int
119 119
      */
120
-    const TYPE_DELIMITER                =  9;
120
+    const TYPE_DELIMITER = 9;
121 121
 
122 122
     /**
123 123
      * Labels in LOOP statement, ITERATE statement etc.
@@ -129,46 +129,46 @@  discard block
 block discarded – undo
129 129
      *
130 130
      * @var int
131 131
      */
132
-    const TYPE_LABEL                =  10;
132
+    const TYPE_LABEL = 10;
133 133
 
134 134
     // Flags that describe the tokens in more detail.
135 135
     // All keywords must have flag 1 so `Context::isKeyword` method doesn't
136 136
     // require strict comparison.
137
-    const FLAG_KEYWORD_RESERVED         =  2;
138
-    const FLAG_KEYWORD_COMPOSED         =  4;
139
-    const FLAG_KEYWORD_DATA_TYPE        =  8;
137
+    const FLAG_KEYWORD_RESERVED         = 2;
138
+    const FLAG_KEYWORD_COMPOSED         = 4;
139
+    const FLAG_KEYWORD_DATA_TYPE        = 8;
140 140
     const FLAG_KEYWORD_KEY              = 16;
141 141
     const FLAG_KEYWORD_FUNCTION         = 32;
142 142
 
143 143
     // Numbers related flags.
144
-    const FLAG_NUMBER_HEX               =  1;
145
-    const FLAG_NUMBER_FLOAT             =  2;
146
-    const FLAG_NUMBER_APPROXIMATE       =  4;
147
-    const FLAG_NUMBER_NEGATIVE          =  8;
144
+    const FLAG_NUMBER_HEX               = 1;
145
+    const FLAG_NUMBER_FLOAT             = 2;
146
+    const FLAG_NUMBER_APPROXIMATE       = 4;
147
+    const FLAG_NUMBER_NEGATIVE          = 8;
148 148
     const FLAG_NUMBER_BINARY            = 16;
149 149
 
150 150
     // Strings related flags.
151
-    const FLAG_STRING_SINGLE_QUOTES     =  1;
152
-    const FLAG_STRING_DOUBLE_QUOTES     =  2;
151
+    const FLAG_STRING_SINGLE_QUOTES     = 1;
152
+    const FLAG_STRING_DOUBLE_QUOTES     = 2;
153 153
 
154 154
     // Comments related flags.
155
-    const FLAG_COMMENT_BASH             =  1;
156
-    const FLAG_COMMENT_C                =  2;
157
-    const FLAG_COMMENT_SQL              =  4;
158
-    const FLAG_COMMENT_MYSQL_CMD        =  8;
155
+    const FLAG_COMMENT_BASH             = 1;
156
+    const FLAG_COMMENT_C                = 2;
157
+    const FLAG_COMMENT_SQL              = 4;
158
+    const FLAG_COMMENT_MYSQL_CMD        = 8;
159 159
 
160 160
     // Operators related flags.
161
-    const FLAG_OPERATOR_ARITHMETIC      =  1;
162
-    const FLAG_OPERATOR_LOGICAL         =  2;
163
-    const FLAG_OPERATOR_BITWISE         =  4;
164
-    const FLAG_OPERATOR_ASSIGNMENT      =  8;
161
+    const FLAG_OPERATOR_ARITHMETIC      = 1;
162
+    const FLAG_OPERATOR_LOGICAL         = 2;
163
+    const FLAG_OPERATOR_BITWISE         = 4;
164
+    const FLAG_OPERATOR_ASSIGNMENT      = 8;
165 165
     const FLAG_OPERATOR_SQL             = 16;
166 166
 
167 167
     // Symbols related flags.
168
-    const FLAG_SYMBOL_VARIABLE          =  1;
169
-    const FLAG_SYMBOL_BACKTICK          =  2;
170
-    const FLAG_SYMBOL_USER              =  4;
171
-    const FLAG_SYMBOL_SYSTEM            =  8;
168
+    const FLAG_SYMBOL_VARIABLE          = 1;
169
+    const FLAG_SYMBOL_BACKTICK          = 2;
170
+    const FLAG_SYMBOL_USER              = 4;
171
+    const FLAG_SYMBOL_SYSTEM            = 8;
172 172
 
173 173
     /**
174 174
      * The token it its raw string representation.
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 return $ret;
262 262
             case Token::TYPE_STRING:
263 263
                 $quote = $this->token[0];
264
-                $str = str_replace($quote . $quote, $quote, $this->token);
264
+                $str = str_replace($quote.$quote, $quote, $this->token);
265 265
                 return mb_substr($str, 1, -1, 'UTF-8'); // trims quotes
266 266
             case Token::TYPE_SYMBOL:
267 267
                 $str = $this->token;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                 || ($str[0] === '"') || ($str[0] === '\''))
280 280
                 ) {
281 281
                     $quote = $str[0];
282
-                    $str = str_replace($quote . $quote, $quote, $str);
282
+                    $str = str_replace($quote.$quote, $quote, $str);
283 283
                     $str = mb_substr($str, 1, -1, 'UTF-8');
284 284
                 }
285 285
                 return $str;
Please login to merge, or discard this patch.