Skip to content
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

[Bug]: Typings for Arch tests seems to be off #1242

Open
pataar opened this issue Sep 12, 2024 · 5 comments
Open

[Bug]: Typings for Arch tests seems to be off #1242

pataar opened this issue Sep 12, 2024 · 5 comments
Labels

Comments

@pataar
Copy link

pataar commented Sep 12, 2024

What Happened

Preset doesn't seem to be available, Phpstan doesn't like that either:

image

The tests work correctly though.

How to Reproduce

  1. Add a testfile named Arch.php
  2. Add the following contents:
<?php
/**
* PHP Preset
*/
arch()
  ->preset()
  ->php();
  1. Notice the errors above in Phpstorm

Sample Repository

No response

Pest Version

3.0.6

PHP Version

8.3.x

Operation System

macOS

Notes

Using the latest Phpstorm

@pataar pataar added the bug label Sep 12, 2024
@pataar pataar changed the title [Bug]: Typing for Arch tests seem to be off [Bug]: Typings for Arch tests seems to be off Sep 12, 2024
@CamKem
Copy link
Contributor

CamKem commented Sep 13, 2024

It's certainly nullable, Check here => https://github.com/pestphp/pest-plugin-arch/blob/0a27e55a270cfe73d8cb70551b91002ee2cb64b0/src/Autoload.php#L18

Also in my PhpStorm:
Screenshot 2024-09-13 at 6 28 04 PM

You probably need to composer update, or restart PhpStorm.

It's always a good idea to check the code in the repo before placing a bug report. You can click that little pencil icon and it will jump to the source code for you to look at.

@pataar
Copy link
Author

pataar commented Sep 13, 2024

@CamKem Ah, my bad. Switched branches but didn't ran composer install again. The other issue still persists though.

@CamKem
Copy link
Contributor

CamKem commented Sep 18, 2024

@CamKem Ah, my bad. Switched branches but didn't ran composer install again. The other issue still persists though.

You are correct, the TestCall needs to be updated to @mixin the place the preset method is stored or reference a @method for preset. I'm going to do a PR tomorrow for it.

@CamKem
Copy link
Contributor

CamKem commented Sep 29, 2024

This was closed by commit 7cd42aa.

@rcerljenko
Copy link

I still have this issue even with this mentioned commit...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants