summaryrefslogtreecommitdiff
path: root/documentation/magic-methods.html
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:17:31 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:17:31 +0100
commit587909da9426e2e182b61add022e8b085e4fdc41 (patch)
tree990b23dfcbff96ffb8bcb95abccd7dcd29841626 /documentation/magic-methods.html
parent81861258bef606bcdf14d170fb73cd06e25e5ebe (diff)
update to documentation
Diffstat (limited to 'documentation/magic-methods.html')
-rw-r--r--documentation/magic-methods.html12
1 files 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 &amp;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);