beautified instantiation with ReflectionClass

This commit is contained in:
Steffen Vogel 2010-06-07 01:03:53 +02:00
parent 36abb3b7ea
commit dc7d96206a
2 changed files with 2 additions and 2 deletions

View file

@ -154,7 +154,7 @@ abstract class Channel extends DatabaseObject implements ChannelInterface {
final static protected function factory($object) {
$rc = new ReflectionClass($object['type']);
if (!$rc->isSubclassOf('Channel')) {
throw new InvalidArgumentException('\'' . $object['type'] . '\' is not a valid channel type');
throw new InvalidArgumentException('\'' . $rc->getName() . '\' is not a valid channel type');
}
return $rc->newInstanceArgs(array($object));

View file

@ -196,7 +196,7 @@ abstract class Database implements DatabaseInterface {
$rc = new ReflectionClass($config['db']['backend']);
if (!$rc->isSubclassOf('Database')) {
throw new InvalidArgumentException('\'' . $result['type'] . '\' is not a valid database backend');
throw new InvalidArgumentException('\'' . $rc->getName() . '\' is not a valid database backend');
}
self::$connection = $rc->newInstanceArgs(array($config['db']));