-
Notifications
You must be signed in to change notification settings - Fork 187
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
Use static factory methods instead of functions in the Assert namespace #184
Use static factory methods instead of functions in the Assert namespace #184
Conversation
The namespaced methods can not be autoloaded and make customizing assertion and/or exception classes impossible.
…erridden Assert class
Aha. You've added a new method So, just like the constructor and the magic call handler, this needs to be added to the list of ignored methods in |
When you run the |
aa5f528
to
a273ff5
Compare
Updated the Pull Request to support all PHP versions that are supported by the Assertion library |
Hi. Looking good. I would like the testing to be done slightly differently though. With this PR, the existing namespace'd functions ( So, maybe, reinstate the tests for the functions but in a separate file that can be deleted as part of the deprecation process in the next major release. Also, the documentation should document both mechanisms, clearly marking the deprecation of the functions in the next major release. Also, being picky, no tests exist for :-D |
And just to make your life a little harder, you'll need to take into account the new tryAll() functionality for chained assertions. |
Use PHP5.3 compatible array() syntax
Besides my stubbornness regarding array syntax I think all should be well now ;) |
Maybe dropping support for PHP versions that have been eol for over two years is a good idea for the next major release? |
I think that dropping support for PHP 5.3 in the next major release is probably reasonable. The use of the dev namespace threw me a bit. |
The functions in the Assert namespace can not be autoloaded, nor can they be used with alternative exception classes. This pull request resolves these issues by introducing a static factory class (\Assert\Assert) that provides these functions as static methods. This will also solve #57.