Skip to content

Commit

Permalink
Merge pull request #9717 from greg0ire/better-trace-docs
Browse files Browse the repository at this point in the history
Make it easier to find how to promote Trace
  • Loading branch information
orklah committed Apr 26, 2023
2 parents c059388 + 09dd8c3 commit 8842fe9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions docs/annotating_code/supported_annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,18 @@ $username = $_GET['username']; // prints something like "test.php:4 $username: m

```

*Note*: it throws [special low-level issue](../running_psalm/issues/Trace.md), so you have to set errorLevel to 1, override it in config or invoke Psalm with `--show-info=true`.
*Note*: it throws [special low-level issue](../running_psalm/issues/Trace.md).
To see it, you can set the global `errorLevel` to 1, or invoke Psalm with
`--show-info=true`, but both these solutions will probably result in a lot of
output. Another solution is to selectively bump the error level of the issue,
so that you only get one more error:

```xml
<!-- psalm.xml -->
<issueHandlers>
<Trace errorLevel="error"/>
</issueHandlers>
```

### `@psalm-check-type`

Expand Down Expand Up @@ -596,7 +607,7 @@ class Foo
}
```
When Psalm encounters variable property, it treats all properties in given class as potentially referenced.
With `@psalm-ignore-variable-property` annotation, this reference is ignored.
With `@psalm-ignore-variable-property` annotation, this reference is ignored.

While `PossiblyUnusedProperty` would be emitted in both cases, using `@psalm-ignore-variable-property`
would allow [Psalter](../manipulating_code/fixing.md) to delete `Foo::$bar`.
Expand Down
3 changes: 2 additions & 1 deletion docs/running_psalm/issues/Trace.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Trace

Not really an issue. Just reports type of the variable.
Not really an issue. Just reports the type of a variable when using
[`@psalm-trace`](../annotating_code/supported_annotations.md#psalm-trace).

```php
<?php
Expand Down

0 comments on commit 8842fe9

Please sign in to comment.