Skip to content

Commit 3488f37

Browse files
committed
Fix coding standard issues for missing typehints
Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent 7c79fa9 commit 3488f37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+185
-109
lines changed

src/Components/GroupKeyword.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
class GroupKeyword extends Component
2222
{
23+
/** @var mixed */
2324
public $type;
2425

2526
/**

src/Components/IntoKeyword.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ public static function parse(Parser $parser, TokensList $list, array $options =
239239
return $ret;
240240
}
241241

242+
/**
243+
* @param string $keyword
244+
*
245+
* @return void
246+
*/
242247
public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS')
243248
{
244249
++$list->idx;

src/Components/LockExpression.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public static function build($component, array $options = [])
112112
return $component->table . ' ' . $component->type;
113113
}
114114

115+
/**
116+
* @return string
117+
*/
115118
private static function parseLockType(Parser $parser, TokensList $list)
116119
{
117120
$lockType = '';

src/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ public function parseComment()
613613
// This can occurs in the following statements:
614614
// - "SELECT */* comment */ FROM ..."
615615
// - "SELECT 2*/* comment */3 AS `six`;"
616-
$next = $this->last+1;
616+
$next = $this->last + 1;
617617
if (($next < $this->len) && $this->str[$next] === '*') {
618618
// Conflict in "*/*": first "*" was not for ending a comment.
619619
// Stop here and let other parsing method define the true behavior of that first star.

src/Statement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ abstract class Statement
5959
*/
6060
public static $CLAUSES = [];
6161

62+
/** @var array */
6263
public static $END_OPTIONS = [];
6364

6465
/**

src/Statements/LoadStatement.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,10 @@ public function parse(Parser $parser, TokensList $list)
330330
--$list->idx;
331331
}
332332

333-
public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS')
333+
/**
334+
* @param string $keyword
335+
*/
336+
public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS'): void
334337
{
335338
++$list->idx;
336339

@@ -353,6 +356,13 @@ public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'F
353356
}
354357
}
355358

359+
/**
360+
* @param Parser $parser
361+
* @param TokensList $list
362+
* @param int $state
363+
*
364+
* @return int
365+
*/
356366
public function parseKeywordsAccordingToState($parser, $list, $state)
357367
{
358368
$token = $list->tokens[$list->idx];

src/Statements/LockStatement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class LockStatement extends Statement
2929
/**
3030
* Whether it's a LOCK statement
3131
* if false, it's an UNLOCK statement
32+
*
33+
* @var bool
3234
*/
3335
public $isLock = true;
3436

src/Statements/PurgeStatement.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ public function parse(Parser $parser, TokensList $list)
126126
*
127127
* @param Parser $parser the instance that requests parsing
128128
* @param Token $token token to be parsed
129-
* @param Array $expected_keywords array of possibly expected keywords at this point
129+
* @param array $expected_keywords array of possibly expected keywords at this point
130+
*
131+
* @return mixed|null
130132
*/
131133
private static function parseExpectedKeyword($parser, $token, $expected_keywords)
132134
{

src/Statements/SelectStatement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class SelectStatement extends Statement
7272
'SQL_CALC_FOUND_ROWS' => 9,
7373
];
7474

75+
/** @var array<string,int> */
7576
public static $END_OPTIONS = [
7677
'FOR UPDATE' => 1,
7778
'LOCK IN SHARE MODE' => 1,

src/Statements/SetStatement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SetStatement extends Statement
3636
];
3737

3838
/**
39-
* Possible exceptions in SET statment.
39+
* Possible exceptions in SET statement.
4040
*
4141
* @var array
4242
*/
@@ -67,6 +67,7 @@ class SetStatement extends Statement
6767
'@@PERSIST_ONLY' => 3,
6868
];
6969

70+
/** @var array */
7071
public static $END_OPTIONS = [
7172
'COLLATE' => [
7273
1,

0 commit comments

Comments
 (0)