disable runtime enforcement of require class constraints for mock classes
Summary:
A trait with a `require class C` constraints can only be used by class `C`, which must be final. This is enforced by HHVM when loading the class that uses the trait with the constraint.
HHVM enforcement is however too strict in presence of mock classes (see test mock.php in this diff). This diff disables HHVM enforcement for classes with the `<<__MockClass>>` attribute.
Additionally, this diff improves the error message printed when HHVM enforcement of `require class` constraints detects an error.
Reviewed By: ricklavoie
Differential Revision:
D40547447
fbshipit-source-id:
56acc7e2c0a8abdb52b5d465b17b7f8b392bf118