-
Notifications
You must be signed in to change notification settings - Fork 19
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
Switching to PHPStan parser #27
Switching to PHPStan parser #27
Conversation
This looks awesome, I'll give it a try ASAP In the meantime I've noticed there are still some references to BetterReflection here |
👍 I'll fix this this afternoon.
Actually, you are not allowed to throw an exception in a __toString() method. I'm giving the changes a test run on some projects before merging this. Do not hesitate if you see any bug. |
I'm testing it and it really got fast! For now I think I've found something regarding Traits
abstract class AbstractAsyncCommand implements AsyncCommand
{
use SerializablePayloadTrait;
[...]
}
trait SerializablePayloadTrait
{
use PayloadTrait {
setPayloadParameter as protected setSerializablePayloadParameter;
}
[...]
}
trait PayloadTrait
{
/**
* @param string $parameter
* @return mixed
*/
public function get(string $parameter)
[...]
/**
* @param string $method
* @param mixed[] $parameters
* @return DTO|bool|mixed
*/
public function __call(string $method, array $parameters)
[...]
} I see here that when a Trait uses another Trait PHPStan Rule looses not only the method docblock but also doesn't consider the list of ignored methods for return types |
Thanks for the feedback! I'll look into it. It is indeed fast. My test suite jumped from 15s to 1.7s :) |
The error related to dockblock losts in traits has already been reported to PHPStan: phpstan/phpstan#1142 |
Closes #24 |
As suggested in #24 , PHPStan parser is now stable and complete enough so we can simply drop better-reflection.
This PR removes better-reflection and replaces it with PHPStan parser.
As a side effect, the rules should be really faster, which is awesome.
Ping @juliangut