pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.12k stars 319 forks source link

[Bug]: Expectation is marked as internal class #1018

Closed allanmcarvalho closed 7 months ago

allanmcarvalho commented 7 months ago

What Happened

It's provide a false IDE errors

How to Reproduce

When we use the method each() a closure is passed as param and a Expectation is provided on this closure as param, so if we want type the closure, a IDE error is printed as below.

Captura de Tela 2023-11-22 às 17 01 46

Sample Repository

No response

Pest Version

2.25

PHP Version

8.2.0

Operation System

macOS

Notes

No response

owenvoke commented 7 months ago

I think it's correctly marked as internal, and the IDE notice is just a warning that it might change without notice (which is true). As far as I know, PhpStorm's notice doesn't stop you from using the class at all.

I guess this is a little bit confusing though, as it's showing up on a built-in method.

@nunomaduro, what are your thoughts on this?

nunomaduro commented 7 months ago

Lets remove the internal thing for now. Please make a pull request.