Skip to content

Commit 332054f

Browse files
Merge pull request #465 from kamil-tekiela/More-known-types
Add native types
2 parents ee2118c + 384b2f1 commit 332054f

8 files changed

Lines changed: 10 additions & 34 deletions

File tree

src/Statements/CallStatement.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ class CallStatement extends Statement
2929

3030
/**
3131
* Build statement for CALL.
32-
*
33-
* @return string
3432
*/
35-
public function build()
33+
public function build(): string
3634
{
3735
return 'CALL ' . $this->call->name . '('
3836
. ($this->call->parameters ? implode(',', $this->call->parameters->raw) : '') . ')';

src/Statements/CreateStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,7 @@ class CreateStatement extends Statement
408408
*/
409409
public $body = [];
410410

411-
/**
412-
* @return string
413-
*/
414-
public function build()
411+
public function build(): string
415412
{
416413
$fields = '';
417414
if (! empty($this->fields)) {

src/Statements/RenameStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ public function before(Parser $parser, TokensList $list, Token $token): void
4444
$list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'TABLE');
4545
}
4646

47-
/**
48-
* @return string
49-
*/
50-
public function build()
47+
public function build(): string
5148
{
5249
return 'RENAME TABLE ' . RenameOperation::build($this->renames);
5350
}

src/Statements/TruncateStatement.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ class TruncateStatement extends Statement
2929

3030
/**
3131
* Special build method for truncate statement as Statement::build would return empty string.
32-
*
33-
* @return string
3432
*/
35-
public function build()
33+
public function build(): string
3634
{
3735
return 'TRUNCATE TABLE ' . $this->table . ';';
3836
}

src/UtfString.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,8 @@ public function offsetUnset($offset)
290290
* @see https://tools.ietf.org/html/rfc3629
291291
*
292292
* @param string $byte the byte to be analyzed
293-
*
294-
* @return int
295293
*/
296-
public static function getCharLength($byte)
294+
public static function getCharLength($byte): int
297295
{
298296
// Use the default ASCII map as queries are mostly ASCII chars
299297
// ord($byte) has a performance cost

src/Utils/CLI.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ public function parseHighlight(): array|false
9292
return $params;
9393
}
9494

95-
/**
96-
* @return int
97-
*/
98-
public function runHighlight()
95+
public function runHighlight(): int
9996
{
10097
$params = $this->parseHighlight();
10198
if ($params === false) {
@@ -159,10 +156,7 @@ public function parseLint(): array|false
159156
return $params;
160157
}
161158

162-
/**
163-
* @return int
164-
*/
165-
public function runLint()
159+
public function runLint(): int
166160
{
167161
$params = $this->parseLint();
168162
if ($params === false) {
@@ -234,10 +228,7 @@ public function parseTokenize(): array|false
234228
return $params;
235229
}
236230

237-
/**
238-
* @return int
239-
*/
240-
public function runTokenize()
231+
public function runTokenize(): int
241232
{
242233
$params = $this->parseTokenize();
243234
if ($params === false) {

src/Utils/Formatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,9 @@ public static function getGroupLength($list)
766766
*
767767
* @param Token $token the token to be checked
768768
*
769-
* @return int|false
770769
* @psalm-return 1|2|false
771770
*/
772-
public static function isClause($token)
771+
public static function isClause($token): int|false
773772
{
774773
if (
775774
($token->type === Token::TYPE_KEYWORD && isset(Parser::$statementParsers[$token->keyword]))

src/Utils/Query.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,8 @@ public static function getClause($statement, $list, $clause, $type = 0, $skipFir
738738
* it is considered to be equal with `$old`.
739739
* @param bool $onlyType whether only the type of the clause should
740740
* be replaced or the entire clause
741-
*
742-
* @return string
743741
*/
744-
public static function replaceClause($statement, $list, $old, $new = null, $onlyType = false)
742+
public static function replaceClause($statement, $list, $old, $new = null, $onlyType = false): string
745743
{
746744
// TODO: Update the tokens list and the statement.
747745

0 commit comments

Comments
 (0)