RadoslavGeorgiev / rila-framework

A front-end WordPress framework with a set of many extendable class wrappers, inpired by the MVC ideology
GNU General Public License v2.0
18 stars 3 forks source link

Avoid string conversion within the plugin #4

Closed RadoslavGeorgiev closed 8 years ago

RadoslavGeorgiev commented 8 years ago

When an error is thrown within a __toString() conversion, PHP only reports that exceptions should not be thrown within __toString().

This makes eliminating even the slightest bug tedious.

Try to avoid those conversions as much as possible, for example within the Builder class and within blocks.

RadoslavGeorgiev commented 8 years ago

Improved in 161a612ab71699b9e1a8df8bd2a6b7e946b1a059

The builder and the block will return a string with the exception instead of just fail.