Skip to content

Commit 568e3c8

Browse files
committed
Merge #459 - Add native return types
Pull-request: #459 Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents 9e99de5 + b41c5e5 commit 568e3c8

28 files changed

Lines changed: 37 additions & 69 deletions

src/Components/AlterOperation.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,8 @@ public static function build($component, array $options = []): string
553553
* between column and table alteration
554554
*
555555
* @param string $tokenValue Value of current token
556-
*
557-
* @return bool
558556
*/
559-
private static function checkIfColumnDefinitionKeyword($tokenValue)
557+
private static function checkIfColumnDefinitionKeyword($tokenValue): bool
560558
{
561559
$commonOptions = [
562560
'AUTO_INCREMENT',
@@ -579,10 +577,8 @@ private static function checkIfColumnDefinitionKeyword($tokenValue)
579577
* Check if token is symbol and quoted with backtick
580578
*
581579
* @param Token $token token to check
582-
*
583-
* @return bool
584580
*/
585-
private static function checkIfTokenQuotedSymbol($token)
581+
private static function checkIfTokenQuotedSymbol($token): bool
586582
{
587583
return $token->type === Token::TYPE_SYMBOL && $token->flags === Token::FLAG_SYMBOL_BACKTICK;
588584
}

src/Components/Array2d.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Array2d implements Component
2525
*
2626
* @return ArrayObj[]
2727
*/
28-
public static function parse(Parser $parser, TokensList $list, array $options = [])
28+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
2929
{
3030
$ret = [];
3131

src/Components/Condition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function __construct($expr = null)
9595
*
9696
* @return Condition[]
9797
*/
98-
public static function parse(Parser $parser, TokensList $list, array $options = [])
98+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
9999
{
100100
$ret = [];
101101

src/Components/ExpressionArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class ExpressionArray implements Component
3131
*
3232
* @throws ParserException
3333
*/
34-
public static function parse(Parser $parser, TokensList $list, array $options = [])
34+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
3535
{
3636
$ret = [];
3737

src/Components/GroupKeyword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($expr = null)
4343
*
4444
* @return GroupKeyword[]
4545
*/
46-
public static function parse(Parser $parser, TokensList $list, array $options = [])
46+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
4747
{
4848
$ret = [];
4949

src/Components/IndexHint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public function __construct(
6868
* @param TokensList $list the list of tokens that are being parsed
6969
* @param array<string, mixed> $options parameters for parsing
7070
*
71-
* @return IndexHint|Component[]
71+
* @return IndexHint[]
7272
*/
73-
public static function parse(Parser $parser, TokensList $list, array $options = [])
73+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
7474
{
7575
$ret = [];
7676
$expr = new static();

src/Components/JoinKeyword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function __construct($type = null, $expr = null, $on = null, $using = nul
9393
*
9494
* @return JoinKeyword[]
9595
*/
96-
public static function parse(Parser $parser, TokensList $list, array $options = [])
96+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
9797
{
9898
$ret = [];
9999

src/Components/OptionsArray.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function has($key, $getExpr = false)
329329
*
330330
* @return bool whether the key was found and deleted or not
331331
*/
332-
public function remove($key)
332+
public function remove($key): bool
333333
{
334334
foreach ($this->options as $idx => $option) {
335335
if (is_array($option)) {
@@ -367,10 +367,8 @@ public function merge($options)
367367

368368
/**
369369
* Checks tf there are no options set.
370-
*
371-
* @return bool
372370
*/
373-
public function isEmpty()
371+
public function isEmpty(): bool
374372
{
375373
return empty($this->options);
376374
}

src/Components/OrderKeyword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct($expr = null, $type = 'ASC')
4848
*
4949
* @return OrderKeyword[]
5050
*/
51-
public static function parse(Parser $parser, TokensList $list, array $options = [])
51+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
5252
{
5353
$ret = [];
5454

src/Components/ParameterDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($name = null, $inOut = null, $type = null)
5959
*
6060
* @return ParameterDefinition[]
6161
*/
62-
public static function parse(Parser $parser, TokensList $list, array $options = [])
62+
public static function parse(Parser $parser, TokensList $list, array $options = []): array
6363
{
6464
$ret = [];
6565

0 commit comments

Comments
 (0)