New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHPStan parser for different PHP version parsing #1791
Conversation
3964aff
to
7642518
Compare
...Rector/FuncCall/DowngradeJsonDecodeNullAssociativeArgRector/Fixture/clue_json_decode.php.inc
Show resolved
Hide resolved
60b933f
to
2be2313
Compare
...hp72/Rector/FuncCall/DowngradeJsonDecodeNullAssociativeArgRector/Fixture/array_assoc.php.inc
Outdated
Show resolved
Hide resolved
...72/Rector/FuncCall/DowngradeJsonDecodeNullAssociativeArgRector/Fixture/possibly_null.php.inc
Outdated
Show resolved
Hide resolved
9d73c8c
to
6999ac5
Compare
@TomasVotruba It seems if it called multiple time, the changes keep happen:
try call multiple times, and it keep adding diff, which should not. |
It called multiple time, make multipel changes: bin/rector process vendor/clue/ndjson-react/src/Decoder.php -c build/config/config-downgrade-parallel.php --clear-cache --debug if ($this->options === 0) {
- $data = \json_decode($data, ($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc), $this->depth);
+ $data = \json_decode($data, (($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc)) === null ?: (($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc)), $this->depth);
} else {
- $data = \json_decode($data, ($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc), $this->depth, $this->options);
+ $data = \json_decode($data, (($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc)) === null ?: (($this->assoc === null ?: $this->assoc) === null ?: ($this->assoc === null ?: $this->assoc)), $this->depth, $this->options); |
Indeed, the scope is not refreshed so the type is the same. I'll check it 👍 |
@TomasVotruba the |
This change is invalid: 1) vendor/clue/ndjson-react/src/Decoder.php:108
---------- begin diff ----------
@@ @@
// decode data with options given in ctor
if ($this->options === 0) {
- $data = \json_decode($data, $this->assoc, $this->depth);
+ $data = \json_decode($data, $this->assoc === null ?: $this->assoc, $this->depth);
} else {
- $data = \json_decode($data, $this->assoc, $this->depth, $this->options);
+ $data = \json_decode($data, $this->assoc === null ?: $this->assoc, $this->depth, $this->options);
}
// abort stream if decoding failed
----------- end diff -----------
Applied rules:
* DowngradeJsonDecodeNullAssociativeArgRector (https://3v4l.org/b1mA6) since |
6b8e649
to
7858df3
Compare
963b961
to
20379f4
Compare
@samsonasik I've tried few |
20379f4
to
6215ee1
Compare
Ref rectorphp/rector#6970