Phpinspectionsea: False positive: [EA] Written value is same as default one, consider removing this assignment.

Created on 25 Apr 2020  路  2Comments  路  Source: kalessil/phpinspectionsea


| Subject | Details |
| :------------- | :---------------------------------------------------------------------------- |
| Plugin | Php Inspections (EA Extended) 4.0.3 |
| Language level | PHP 7.4 |

Current behaviour

The code

class A {
    private ?string $foo;
    private ?A $bar;
    private ?DateTime $baz;

    public function __construct()
    {
        $this->foo = null;
        $this->bar = null;
        $this->baz = null;
    }
}

still yields "[EA] Written value is same as default one, consider removing this assignment." for all 3 properies.

Expected behaviour

No warning

Environment details

PHPStorm 2020.1 (201.6668.153)

bug / false-positive fixed

Most helpful comment

Fixed!

All 2 comments

Thank you @MisatoTremor.

Fixed!

Was this page helpful?
0 / 5 - 0 ratings