beberlei / assert

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

add typehint #286

Closed wirwolf closed 5 years ago

wirwolf commented 5 years ago

add composer require ext add throw phpdoc

jakzal commented 5 years ago

This change made that the whole beberlei/assert package now requires the intl extension to be installed.

I failed to find how this library is dependent on intl. Surely, not all features depend on it to make it whole package's dependency?

jakzal commented 5 years ago

Ok, found out that #268 and #269 make that count() and isCountable() can now work with intl resources.

It's what I'd call an optional dependency though. The Assertion class, and therefore the whole library, can work perfectly fine without the intl extension.

The intl extension is still not being commonly installed as for most projects it's of no benefit. IMO It's not nice to force people to install it because an assertion library "needs" it for some edge cases.

Taluu commented 4 years ago

This is actually a BC break, making it impossible to properly extend Assert, Assertion and AssertionChain classes until php 7.4 (because a signature mismatch, which can trigger several phpstan errors).

Resolving these can be kinda trivial, but still...