| Subject | Details |
| :------------- | :---------------------------------------------------------------------------- |
| Issue type | Feature Request |
| Plugin | Php Inspections (EA Extended), 3.0.6.1 |
| Language level | PHP 7.2 |
This is a feature request, thus the whole check is missing right now.
Please have a look at the following code:
<?php
declare(strict_types=1);
function foo(string $input): string
{
if (is_string($input)) {
return 'Input is a string';
}
return 'Input is not a string.';
}
I'd expect an inspection that warns that the type check in this case is not required, as strict_types=1 is set and the input param is already declared that it has to be a string. Same is true with many other functions like is_int(), is_float(), is_array(), etc.
Sorry, the suggestion is already implemented in "EA Ultimate": "Callable parameter usage violates definition".
So, you discovered ultimate, congrats and thank you for supporting via Patreon =) The license is coming today (~evening).
It's a great tool that deserves more support! Thank you again for creating the tool.
Most helpful comment
It's a great tool that deserves more support! Thank you again for creating the tool.