Whats the best method to suppress errors for a class.
I don't mean $obj = @new MyClass();
I am more interested in class function errors...
public function encrypt($data, $key) {
if (!isset($data, $key)) throw new CryptographyException('The encrypt function requires 2 arguments.');
}
$obj->encrypt(); // This would throw my exception (good), but I will also get php error message reports (bad).
I don't want to use @ on everything.
Is there a way to use error_reporting(0)... just on the class object(s)?
I thought this would work, @include_once(../classes/crypto.php'); but doesn't.
P.S The php error messages are only logged to a file on my server, but the class itself will be used by others, within their code, so I cannot use error_reporting(0), unless I can make it somehow local to the class.