Skip to content

Commit 11c3a9a

Browse files
committed
fix comments formatting
1 parent c7fb01e commit 11c3a9a

4 files changed

Lines changed: 112 additions & 77 deletions

File tree

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

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,11 @@ class WP_SQLite_Lexer {
13211321
* @var array<string, bool|int|array<int, int|string|array<string, bool>>>
13221322
*/
13231323
public static $field_options = array(
1324-
// Tells the `OptionsArray` to not sort the options.
1325-
// See the note below.
1324+
1325+
/*
1326+
* Tells the `OptionsArray` to not sort the options.
1327+
* See the note below.
1328+
*/
13261329
'_UNSORTED' => true,
13271330

13281331
'NOT NULL' => 1,
@@ -1535,8 +1538,10 @@ public function lex() {
15351538
continue;
15361539
}
15371540

1538-
// Skipping last R (from `delimiteR`) and whitespaces between
1539-
// the keyword `DELIMITER` and the actual delimiter.
1541+
/*
1542+
* Skipping last R (from `delimiteR`) and whitespaces between
1543+
* the keyword `DELIMITER` and the actual delimiter.
1544+
*/
15401545
$pos = ++$this->last;
15411546
$token = $this->parse_whitespace();
15421547

@@ -1725,16 +1730,10 @@ public function parse_keyword() {
17251730
*/
17261731
$ret = null;
17271732

1728-
/**
1729-
* The value of `$this->last` where `$token` ends in `$this->str`.
1730-
*/
1733+
// The value of `$this->last` where `$token` ends in `$this->str`.
17311734
$i_end = $this->last;
17321735

1733-
/**
1734-
* Whether last parsed character is a whitespace.
1735-
*
1736-
* @var bool
1737-
*/
1736+
// Whether last parsed character is a whitespace.
17381737
$last_space = false;
17391738

17401739
for ( $j = 1; $j < static::KEYWORD_MAX_LENGTH && $this->last < $this->string_length; ++$j, ++$this->last ) {
@@ -1786,9 +1785,7 @@ public function parse_label() {
17861785
*/
17871786
$ret = null;
17881787

1789-
/**
1790-
* The value of `$this->last` where `$token` ends in `$this->str`.
1791-
*/
1788+
// The value of `$this->last` where `$token` ends in `$this->str`.
17921789
$i_end = $this->last;
17931790
for ( $j = 1; $j < static::LABEL_MAX_LENGTH && $this->last < $this->string_length; ++$j, ++$this->last ) {
17941791
if ( ':' === $this->str[ $this->last ] && $j > 1 ) {
@@ -1800,8 +1797,10 @@ public function parse_label() {
18001797
}
18011798

18021799
if ( static::is_whitespace( $this->str[ $this->last ] ) && $j > 1 ) {
1803-
// Whitespace between label and `:`.
1804-
// The size of the keyword didn't increase.
1800+
/*
1801+
* Whitespace between label and `:`.
1802+
* The size of the keyword didn't increase.
1803+
*/
18051804
--$j;
18061805
} elseif ( static::is_separator( $this->str[ $this->last ] ) ) {
18071806
// Any other separator.
@@ -1831,9 +1830,7 @@ public function parse_operator() {
18311830
*/
18321831
$ret = null;
18331832

1834-
/**
1835-
* The value of `$this->last` where `$token` ends in `$this->str`.
1836-
*/
1833+
// The value of `$this->last` where `$token` ends in `$this->str`.
18371834
$i_end = $this->last;
18381835

18391836
for ( $j = 1; $j < static::OPERATOR_MAX_LENGTH && $this->last < $this->string_length; ++$j, ++$this->last ) {
@@ -2504,8 +2501,10 @@ public static function is_string( $str ) {
25042501
* @return bool
25052502
*/
25062503
public static function is_separator( $str ) {
2507-
// NOTES: Only non alphanumeric ASCII characters may be separators.
2508-
// `~` is the last printable ASCII character.
2504+
/*
2505+
* NOTES: Only non alphanumeric ASCII characters may be separators.
2506+
* `~` is the last printable ASCII character.
2507+
*/
25092508
return ( $str <= '~' )
25102509
&& ( '_' !== $str )
25112510
&& ( '$' !== $str )

wp-includes/sqlite/class-wp-sqlite-query-rewriter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ public function skip( $query = array() ) {
238238
public function skip_and_return_all( $query = array() ) {
239239
$tokens = $this->move_forward( $query );
240240

241-
// When skipping over whitespaces, make sure to consume
242-
// at least one to avoid SQL syntax errors.
241+
/*
242+
* When skipping over whitespaces, make sure to consume
243+
* at least one to avoid SQL syntax errors.
244+
*/
243245
foreach ( $tokens as $token ) {
244246
if ( $token->matches( WP_SQLite_Token::TYPE_WHITESPACE ) ) {
245247
$this->add( $token );

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
*/
1818
class WP_SQLite_Token {
1919

20-
// Types of tokens (a vague description of a token's purpose).
21-
2220
/**
2321
* This type is used when the token is invalid or its type cannot be
2422
* determined because of the ambiguous context. Further analysis might be
@@ -248,8 +246,10 @@ private function extract() {
248246
case self::TYPE_KEYWORD:
249247
$this->keyword = strtoupper( $this->token );
250248
if ( ! ( $this->flags & self::FLAG_KEYWORD_RESERVED ) ) {
251-
// Unreserved keywords should stay the way they are because they
252-
// might represent field names.
249+
/*
250+
* Unreserved keywords should stay the way they are
251+
* because they might represent field names.
252+
*/
253253
return $this->token;
254254
}
255255

@@ -287,19 +287,23 @@ private function extract() {
287287
$quote = $this->token[0];
288288
$str = str_replace( $quote . $quote, $quote, $str );
289289

290-
// Finally unescapes the string.
291-
//
292-
// `stripcslashes` replaces escape sequences with their
293-
// representation.
290+
/*
291+
* Finally unescapes the string.
292+
*
293+
* `stripcslashes` replaces escape sequences with their
294+
* representation.
295+
*/
294296
$str = stripcslashes( $str );
295297

296298
return $str;
297299

298300
case self::TYPE_SYMBOL:
299301
$str = $this->token;
300302
if ( isset( $str[0] ) && ( '@' === $str[0] ) ) {
301-
// `mb_strlen($str)` must be used instead of `null` because
302-
// in PHP 5.3- the `null` parameter isn't handled correctly.
303+
/*
304+
* `mb_strlen($str)` must be used instead of `null` because
305+
* in PHP 5.3- the `null` parameter isn't handled correctly.
306+
*/
303307
$str = mb_substr(
304308
$str,
305309
! empty( $str[1] ) && ( '@' === $str[1] ) ? 2 : 1,

0 commit comments

Comments
 (0)