Commit 080bc06
TypeHints/DisallowMixedTypeHint: fix logic error
If a file only contains a placeholder docblock (typically an empty `index.php` file in a OS project which doesn't have control over server configuration), it is possible for the `TokenHelper::findNextEffective()` method to return `null`.
As the code didn't take this into account, this led to the following error:
```
1 | ERROR | [ ] An error occurred during processing; checking has been aborted. The error message was: Undefined array
| | key "" in
| | path/to/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php on
| | line 87
| | The error originated in the SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint sniff on line 86.
| | (Internal.Exception)
```1 parent 1136fb9 commit 080bc06
File tree
2 files changed
+6
-1
lines changed- SlevomatCodingStandard/Sniffs/TypeHints
- tests/Sniffs/TypeHints/data
2 files changed
+6
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments