1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-05 13:10:49 +01:00
psalm/docs/running_psalm/issues/InvalidScalarArgument.md
2022-01-02 14:56:18 +02:00

19 lines
407 B
Markdown

# InvalidScalarArgument
Emitted when a scalar value is passed to a method that expected another scalar type.
This is only emitted in situations where Psalm can be sure that PHP tries to coerce one scalar type to another.
In all other cases `InvalidArgument` is emitted.
```php
<?php
function foo(int $i) : void {}
function bar(string $s) : void {
if (is_numeric($s)) {
foo($s);
}
}
```