$m because user could bypass property setter by: $x = & $obj->property; $x = 'new value'; $val = $_this->$m(); return $val; } $m = 'is' . $name; if (isset(self::$methods[$class][$m])) { $val = $_this->$m(); return $val; } $type = isset(self::$methods[$class]['set' . $name]) ? 'a write-only' : 'an undeclared'; $name = func_get_arg(1); throw new MemberAccessException("Cannot read $type property $class::\$$name."); } /** * Sets value of a property. * @param object * @param string property name * @param mixed property value * @return void * @throws MemberAccessException if the property is not defined or is read-only */ public static function set($_this, $name, $value) { $class = get_class($_this); if ($name === '') { throw new MemberAccessException("Cannot write to a class '$class' property without name."); } if (!isset(self::$methods[$class])) { self::$methods[$class] = array_flip(get_class_methods($class)); } // property setter support $name[0] = $name[0] & "\xDF"; // case-sensitive checking, capitalize first character $m = 'set' . $name; if (isset(self::$methods[$class][$m])) { $_this->$m($value); return; } $type = isset(self::$methods[$class]['get' . $name]) || isset(self::$methods[$class]['is' . $name]) ? 'a read-only' : 'an undeclared'; $name = func_get_arg(1); throw new MemberAccessException("Cannot write to $type property $class::\$$name."); } } WebSVN - freenet-router - Blame - Rev 2 - /trunk/freenet-router/var/www/freenet-router/Framework/Core/ObjectMixin.php
  jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Core/] [ObjectMixin.php] - Blame information for rev 2

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1