kalessil / phpinspectionsea

A Static Code Analyzer for PHP (a PhpStorm/Idea Plugin)
https://plugins.jetbrains.com/plugin/7622?pr=phpStorm
Other
1.44k stars 118 forks source link

False-positive: string cast #1959

Open sneakyvv opened 1 hour ago

sneakyvv commented 1 hour ago
Subject Details
Plugin Php Inspections (EA Extended)
Language level PHP 8.1

Current behaviour

image image image

Expected behaviour

Should not mark the (first) cast as unnecessary. (The second cast is there because of Psalm config)

Environment details

Windows 11, PhpStorm 2024.2.3

sneakyvv commented 1 hour ago

I just noted that this does work properly.

image

Is it a bug then? Or is it because php will cast for us? Even when strict_types=1?