beberlei / assert

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

LazyAssertion magic calls return $this #278

Closed arnedesmedt closed 5 years ago

arnedesmedt commented 5 years ago

A LazyAssertion magic call needs to return $this. If you extend the Assertion class with your own assertion methods, It is great if that methods are also hinted in your IDE.

To do this, you can override the LazyAssertion class and add your own phpDoc at class level. But if you chain the methods with existing assertions, it will not work anymore because they return the default LazyAsssertion object and not your own LazyAssertion object.

rquadling commented 5 years ago

The change will need to take place in the documentation generator and the LazyAssertion class.

But other than that, makes sense.

arnedesmedt commented 5 years ago

Hi,

I didn't saw there was a doc generator. I know added the return type $this to the document generator for generating the docs of the LazyAssertion class.

rquadling commented 5 years ago

Thank you.