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
tests: improve tests for ide #406
base: 1.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @Chris53897 thanks for your PR
IMO IDE-specific annotations should not land in the code.
Co-authored-by: Nicolas PHILIPPE <nikophil@gmail.com>
Co-authored-by: Nicolas PHILIPPE <nikophil@gmail.com>
I changed it and add the use statements. PhpStorm does not yet understand it like this https://youtrack.jetbrains.com/issue/WI-55925. But maybe other ide's can understand it now. And hopefully phpstorm in the future |
I've tried your PR, and trying to "ctrl + click" // \Zenstruck\Foundry\Tests\Functional\RepositoryProxyTest
public function can_find_random_object(): void
{
$this->categoryFactoryClass()::createMany(5); |
if PHPStorm does not understand it, we could change like this, maybe? /** @return class-string */
abstract protected function categoryClass(): string;
/** @return class-string<ModelFactory> */
abstract protected function categoryFactoryClass(): string; |
This helps the IDE (in my case PhpStorm) to read the code.
Please have a look if you find it useful and is correct.