Skip to content

Commit 1d7933f

Browse files
kamil-tekielawilliamdes
authored andcommitted
Fix type hint in IndexHint
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 88c8314 commit 1d7933f

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

phpstan-baseline.neon

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,7 @@ parameters:
186186
path: src/Components/GroupKeyword.php
187187

188188
-
189-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\IndexHint\\:\\:\\$for \\(string\\) does not accept string\\|null\\.$#"
190-
count: 1
191-
path: src/Components/IndexHint.php
192-
193-
-
194-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\IndexHint\\:\\:\\$indexOrKey \\(string\\) does not accept string\\|null\\.$#"
195-
count: 1
196-
path: src/Components/IndexHint.php
197-
198-
-
199-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\IndexHint\\:\\:\\$type \\(string\\) does not accept mixed\\.$#"
200-
count: 1
201-
path: src/Components/IndexHint.php
202-
203-
-
204-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\IndexHint\\:\\:\\$type \\(string\\) does not accept string\\|null\\.$#"
189+
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\IndexHint\\:\\:\\$type \\(string\\|null\\) does not accept mixed\\.$#"
205190
count: 1
206191
path: src/Components/IndexHint.php
207192

psalm-baseline.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,10 @@
234234
<MoreSpecificImplementedParamType occurrences="1">
235235
<code>$component</code>
236236
</MoreSpecificImplementedParamType>
237-
<PossiblyNullPropertyAssignmentValue occurrences="3">
238-
<code>$for</code>
239-
<code>$indexOrKey</code>
240-
<code>$type</code>
241-
</PossiblyNullPropertyAssignmentValue>
242-
<RedundantConditionGivenDocblockType occurrences="1">
243-
<code>$component-&gt;for !== null</code>
244-
</RedundantConditionGivenDocblockType>
237+
<PossiblyNullOperand occurrences="2">
238+
<code>$component-&gt;indexOrKey</code>
239+
<code>$component-&gt;type</code>
240+
</PossiblyNullOperand>
245241
</file>
246242
<file src="src/Components/IntoKeyword.php">
247243
<MixedArgument occurrences="2">

src/Components/IndexHint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ class IndexHint extends Component
2222
/**
2323
* The type of hint (USE/FORCE/IGNORE)
2424
*
25-
* @var string
25+
* @var string|null
2626
*/
2727
public $type;
2828

2929
/**
3030
* What the hint is for (INDEX/KEY)
3131
*
32-
* @var string
32+
* @var string|null
3333
*/
3434
public $indexOrKey;
3535

3636
/**
3737
* The clause for which this hint is (JOIN/ORDER BY/GROUP BY)
3838
*
39-
* @var string
39+
* @var string|null
4040
*/
4141
public $for;
4242

0 commit comments

Comments
 (0)