beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

LazyAssertion chaining no longer hinted in PhpStorm #291

Closed Vorta closed 4 years ago

Vorta commented 4 years ago

Version: v3.2.2 I'm not sure if this is due to PhpStorm or due to LazyAssertion docblock, so I'm reporting here first.

Code example:

Assert::lazy()
    ->that($something, null)
    ->notNull('error')
    ->notEmpty('error')
    ->numeric('error')
    ->verifyNow();

Above example will work normally, however, PhpStorm will underline the notEmpty method and say "Method 'notEmpty' not found".

The only way I could get the hints to work properly again was to replace @method $this ... with @method \Assert\LazyAssertion inside the LazyAssertion.php.

rquadling commented 4 years ago

That looks like an error on our part.

rquadling commented 4 years ago

Hopefully fixed in v.3.2.4.

LucasHantz commented 4 years ago

Hello, looks like it's not fixed. The "@method static static" does not the trick. Putting @method LazyAssertion works though. Why not use that?

rquadling commented 4 years ago

Fair enough!

rquadling commented 4 years ago

Released 3.2.7