1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

- updated PHP 5.3 namespace separator

This commit is contained in:
David Grudl
2009-01-05 20:55:08 +00:00
parent 52a9e316b8
commit 348af48ecd
4 changed files with 26 additions and 26 deletions

View File

@@ -23,7 +23,7 @@
/**
* DibiObject is the ultimate ancestor of all instantiable classes.
*
* DibiObject is copy of Nette::Object from Nette Framework (http://nettephp.com).
* DibiObject is copy of Nette\Object from Nette Framework (http://nettephp.com).
*
* It defines some handful methods and enhances object core of PHP:
* - access to undeclared members throws exceptions
@@ -82,11 +82,11 @@ abstract class DibiObject
/**
* Access to reflection.
* @return ReflectionObject
* @return \ReflectionObject
*/
final public function getReflection()
{
return new ReflectionObject($this);
return new /*\*/ReflectionObject($this);
}
@@ -96,22 +96,22 @@ abstract class DibiObject
* @param string method name
* @param array arguments
* @return mixed
* @throws ::MemberAccessException
* @throws \MemberAccessException
*/
public function __call($name, $args)
{
$class = get_class($this);
if ($name === '') {
throw new /*::*/MemberAccessException("Call to class '$class' method without name.");
throw new /*\*/MemberAccessException("Call to class '$class' method without name.");
}
// event functionality
if (preg_match('#^on[A-Z]#', $name)) {
$rp = new ReflectionProperty($class, $name);
$rp = new /*\*/ReflectionProperty($class, $name);
if ($rp->isPublic() && !$rp->isStatic()) {
$list = $this->$name;
if (is_array($list) || $list instanceof Traversable) {
if (is_array($list) || $list instanceof /*\*/Traversable) {
foreach ($list as $handler) {
/**/if (is_object($handler)) {
call_user_func_array(array($handler, '__invoke'), $args);
@@ -131,7 +131,7 @@ abstract class DibiObject
return call_user_func_array($cb, $args);
}
throw new /*::*/MemberAccessException("Call to undefined method $class::$name().");
throw new /*\*/MemberAccessException("Call to undefined method $class::$name().");
}
@@ -141,12 +141,12 @@ abstract class DibiObject
* @param string method name (in lower case!)
* @param array arguments
* @return mixed
* @throws ::MemberAccessException
* @throws \MemberAccessException
*/
public static function __callStatic($name, $args)
{
$class = get_called_class();
throw new /*::*/MemberAccessException("Call to undefined static method $class::$name().");
throw new /*\*/MemberAccessException("Call to undefined static method $class::$name().");
}
@@ -217,14 +217,14 @@ abstract class DibiObject
* Returns property value. Do not call directly.
* @param string property name
* @return mixed property value
* @throws ::MemberAccessException if the property is not defined.
* @throws \MemberAccessException if the property is not defined.
*/
public function &__get($name)
{
$class = get_class($this);
if ($name === '') {
throw new /*::*/MemberAccessException("Cannot read an class '$class' property without name.");
throw new /*\*/MemberAccessException("Cannot read an class '$class' property without name.");
}
// property getter support
@@ -232,7 +232,7 @@ abstract class DibiObject
$m = 'get' . $name;
if (self::hasAccessor($class, $m)) {
// ampersands:
// - uses &__get() because declaration should be forward compatible (e.g. with Nette::Web::Html)
// - uses &__get() because declaration should be forward compatible (e.g. with Nette\Web\Html)
// - doesn't call &$this->$m because user could bypass property setter by: $x = & $obj->property; $x = 'new value';
$val = $this->$m();
return $val;
@@ -245,7 +245,7 @@ abstract class DibiObject
}
$name = func_get_arg(0);
throw new /*::*/MemberAccessException("Cannot read an undeclared property $class::\$$name.");
throw new /*\*/MemberAccessException("Cannot read an undeclared property $class::\$$name.");
}
@@ -255,14 +255,14 @@ abstract class DibiObject
* @param string property name
* @param mixed property value
* @return void
* @throws ::MemberAccessException if the property is not defined or is read-only
* @throws \MemberAccessException if the property is not defined or is read-only
*/
public function __set($name, $value)
{
$class = get_class($this);
if ($name === '') {
throw new /*::*/MemberAccessException("Cannot assign to an class '$class' property without name.");
throw new /*\*/MemberAccessException("Cannot assign to an class '$class' property without name.");
}
// property setter support
@@ -275,12 +275,12 @@ abstract class DibiObject
} else {
$name = func_get_arg(0);
throw new /*::*/MemberAccessException("Cannot assign to a read-only property $class::\$$name.");
throw new /*\*/MemberAccessException("Cannot assign to a read-only property $class::\$$name.");
}
}
$name = func_get_arg(0);
throw new /*::*/MemberAccessException("Cannot assign to an undeclared property $class::\$$name.");
throw new /*\*/MemberAccessException("Cannot assign to an undeclared property $class::\$$name.");
}
@@ -302,12 +302,12 @@ abstract class DibiObject
* Access to undeclared property.
* @param string property name
* @return void
* @throws ::MemberAccessException
* @throws \MemberAccessException
*/
public function __unset($name)
{
$class = get_class($this);
throw new /*::*/MemberAccessException("Cannot unset an property $class::\$$name.");
throw new /*\*/MemberAccessException("Cannot unset an property $class::\$$name.");
}