From 587909da9426e2e182b61add022e8b085e4fdc41 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 10 Mar 2014 14:17:31 +0100 Subject: update to documentation --- documentation/magic-methods.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/documentation/magic-methods.html b/documentation/magic-methods.html index c7902ea..899f335 100644 --- a/documentation/magic-methods.html +++ b/documentation/magic-methods.html @@ -92,7 +92,11 @@ public: std::string email = value; // must have a '@' character in it - if (email.find('@') == std::string::npos) throw Php::Exception("Invalid email address"); + if (email.find('@') == std::string::npos) + { + // email address is invalid, throw exception + throw Php::Exception("Invalid email address"); + } // store the member _email = email; @@ -127,7 +131,11 @@ public: virtual void __unset(const Php::Value &name) override { // name and email can not be unset - if (name == "name" || name == "email") throw Php::Exception("Name and email address can not be removed"); + if (name == "name" || name == "email") + { + // warn the user with an exception that this is impossible + throw Php::Exception("Name and email address can not be removed"); + } // fallback to default Php::Base::__unset(name); -- cgit v1.2.3