We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See https://getrector.com/demo/08d68709-877e-4905-a393-ba6faea77000
<?php namespace shop\basket\viewmodel; use Webmozart\Assert\Assert; /** * @immutable */ final class TestObj { public string $code; public function __construct(string $code) { $this->code = $code; } public static function tryFromUntrusted($code): ?self { $ok = \is_string($code) && self::isCodeOk($code); if (! $ok) { return null; } return new self($code); } private static function isCodeOk(string $code): bool { return true; } }
ParamTypeByMethodCallTypeRector
rector should not infer string param type, because the code is meant to work for anything (on a php version which does not support a mixed param type)
string
mixed
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/08d68709-877e-4905-a393-ba6faea77000
Responsible rules
ParamTypeByMethodCallTypeRector
Expected Behavior
rector should not infer
string
param type, because the code is meant to work for anything (on a php version which does not support amixed
param type)The text was updated successfully, but these errors were encountered: