Skip to content

[DeadCode] Removing useless if statements #1688

@JanMikes

Description

@JanMikes

Hey, i wave just made few changes in our code and making this change in like 60 places, wondering if we have already rector for it :-)

Diff

- /** @var ICache|null */
+ /** @var ICache */
private $cache;

- if ($this->cache) {
    $this->cache->save($x);
- }

PHPStan link: https://phpstan.org/r/1d1026c1-ab7c-46e4-8146-17c052eb8dae

To show how real this issue is, check this (just part of) phpstan report:
Screenshot 2019-07-04 14 44 17

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions