Closed
Description
Bug Report
Subject | Details |
---|---|
Rector version | dev-main |
DisallowedEmptyRuleFixerRector is making dangerous non-equivalent changes. See snippet below.
Minimal PHP Code Causing Issue
class Bug {
public function get(): ?string {
return null;
}
public function example(): void {
if (!empty($this->get())) {
}
}
}
// gets converted to
class Bug {
public function get(): ?string {
return null;
}
public function example(): void {
if ($this->get() !== null) {
}
}
}
Expected Behaviour
// should be converted to
class Bug {
public function get(): ?string {
return null;
}
public function example(): void {
if ($this->get() !== null && $this->get() !== '') {
}
}
}