From 348af48ecd47e69f4ec6d37cb95f3bdebd0b07ab Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 5 Jan 2009 20:55:08 +0000 Subject: [PATCH] - updated PHP 5.3 namespace separator --- dibi/Nette/IDebuggable.php | 2 +- dibi/libs/DibiConnection.php | 4 ++-- dibi/libs/DibiObject.php | 40 ++++++++++++++++++------------------ examples/nette-debug.php | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dibi/Nette/IDebuggable.php b/dibi/Nette/IDebuggable.php index bba1b183..7d9e743e 100644 --- a/dibi/Nette/IDebuggable.php +++ b/dibi/Nette/IDebuggable.php @@ -22,7 +22,7 @@ /** - * Custom output for Nette::Debug. + * Custom output for Nette\Debug. * * @author David Grudl * @copyright Copyright (c) 2004, 2009 David Grudl diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 99362a23..266c492e 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -54,8 +54,8 @@ class DibiConnection extends DibiObject */ public function __construct($config, $name = NULL) { - if (class_exists(/*Nette::*/'Debug', FALSE)) { - /*Nette::*/Debug::addColophon(array('dibi', 'getColophon')); + if (class_exists(/*Nette\*/'Debug', FALSE)) { + /*Nette\*/Debug::addColophon(array('dibi', 'getColophon')); } // DSN string diff --git a/dibi/libs/DibiObject.php b/dibi/libs/DibiObject.php index ab814896..2a91c592 100644 --- a/dibi/libs/DibiObject.php +++ b/dibi/libs/DibiObject.php @@ -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."); } diff --git a/examples/nette-debug.php b/examples/nette-debug.php index f93c568e..20660f95 100644 --- a/examples/nette-debug.php +++ b/examples/nette-debug.php @@ -1,7 +1,7 @@ -

Nette::Debug & dibi example

+

Nette\Debug & dibi example

-

Dibi can display and log exceptions via Nette::Debug, part of Nette Framework.

+

Dibi can display and log exceptions via Nette\Debug, part of Nette Framework.