1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 17:27:28 +01:00
psalm/docs/running_psalm/issues/RedundantPropertyInitializationCheck.md

17 lines
434 B
Markdown
Raw Normal View History

# RedundantPropertyInitializationCheck
Emitted when checking `isset()` on a non-nullable property. This issue indicate a redundant check for projects that initialize their properties in constructor.
```php
<?php
class A {
public string $bar;
public function getBar() : string {
if (isset($this->bar)) {
return $this->bar;
}
return "hello";
}
}
```