Requests for comment/Assert

This is a proposal for providing an alternative to PHP's assert that allows for an simple and reliable way to check preconditions and postconditions in MediaWiki code.

The background of this proposal is the reoccurring discussions about whether PHP's assert can and should be used in MediaWiki code. Two relevant threads:
 * Using PHP's assert in MediaWiki code
 * Is assert allowed?

The outcome appears to be that
 * assertions are generally a good way to improve code quality
 * but PHP's assert is broken by design

Following a suggestion by Tim Starling, I propose to create our own functions for assertions. A first implementation is available at https://github.com/wmde/Assert and can be installed using composer.

Implementation
The idea is to provide some static methods that allow for checking pre- and postconditions in a uniform way: