Skip to content

Commit ea86a5c

Browse files
authored
Merge #500 - Add some more return types
Pull-request: #500
2 parents 52ffc49 + b31d0a6 commit ea86a5c

14 files changed

+18
-75
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -925,16 +925,6 @@ parameters:
925925
count: 2
926926
path: tests/Components/PartitionDefinitionTest.php
927927

928-
-
929-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 2 and PhpMyAdmin\\\\SqlParser\\\\TokensList will always evaluate to false\\.$#"
930-
count: 1
931-
path: tests/Lexer/TokensListTest.php
932-
933-
-
934-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 112 and PhpMyAdmin\\\\SqlParser\\\\UtfString will always evaluate to false\\.$#"
935-
count: 1
936-
path: tests/Misc/UtfStringTest.php
937-
938928
-
939929
message: "#^Cannot call method has\\(\\) on PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\.$#"
940930
count: 1

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.14.1@b9d355e0829c397b9b3b47d0c0ed042a8a70284d">
2+
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
33
<file src="src/Components/AlterOperation.php">
44
<InvalidPropertyAssignmentValue>
55
<code><![CDATA[[

src/Statement.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ public function __construct(Parser|null $parser = null, TokensList|null $list =
113113

114114
/**
115115
* Builds the string representation of this statement.
116-
*
117-
* @return string
118116
*/
119-
public function build()
117+
public function build(): string
120118
{
121119
/**
122120
* Query to be returned.
@@ -472,11 +470,9 @@ public function __toString()
472470
* @param Parser $parser the instance that requests parsing
473471
* @param TokensList $list the list of tokens to be parsed
474472
*
475-
* @return bool
476-
*
477473
* @throws Exceptions\ParserException
478474
*/
479-
public function validateClauseOrder($parser, $list)
475+
public function validateClauseOrder($parser, $list): bool
480476
{
481477
$clauses = array_flip(array_keys($this->getClauses()));
482478

src/Statements/DeleteStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ class DeleteStatement extends Statement
157157
*/
158158
public $limit;
159159

160-
/**
161-
* @return string
162-
*/
163-
public function build()
160+
public function build(): string
164161
{
165162
$ret = 'DELETE ' . OptionsArray::build($this->options);
166163

src/Statements/InsertStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ class InsertStatement extends Statement
111111
*/
112112
public array|null $onDuplicateSet = null;
113113

114-
/**
115-
* @return string
116-
*/
117-
public function build()
114+
public function build(): string
118115
{
119116
$ret = 'INSERT ' . $this->options;
120117
$ret = trim($ret) . ' INTO ' . $this->into;

src/Statements/LoadStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ class LoadStatement extends Statement
179179
*/
180180
public $linesRows;
181181

182-
/**
183-
* @return string
184-
*/
185-
public function build()
182+
public function build(): string
186183
{
187184
$ret = 'LOAD DATA ' . $this->options
188185
. ' INFILE ' . $this->fileName;

src/Statements/NotImplementedStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ class NotImplementedStatement extends Statement
2323
*/
2424
public $unknown = [];
2525

26-
/**
27-
* @return string
28-
*/
29-
public function build()
26+
public function build(): string
3027
{
3128
// Building the parsed part of the query (if any).
3229
$query = parent::build() . ' ';

src/Statements/ReplaceStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ class ReplaceStatement extends Statement
8181
*/
8282
public $select;
8383

84-
/**
85-
* @return string
86-
*/
87-
public function build()
84+
public function build(): string
8885
{
8986
$ret = 'REPLACE ' . $this->options;
9087
$ret = trim($ret) . ' INTO ' . $this->into;

src/Statements/TransactionStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ public function parse(Parser $parser, TokensList $list): void
8080
}
8181
}
8282

83-
/**
84-
* @return string
85-
*/
86-
public function build()
83+
public function build(): string
8784
{
8885
$ret = OptionsArray::build($this->options);
8986
if ($this->type === self::TYPE_BEGIN) {

src/Statements/WithStatement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,7 @@ public function parse(Parser $parser, TokensList $list): void
266266
--$list->idx;
267267
}
268268

269-
/**
270-
* {@inheritdoc}
271-
*/
272-
public function build()
269+
public function build(): string
273270
{
274271
$str = 'WITH ';
275272

0 commit comments

Comments
 (0)