beautified instantiation with ReflectionClass
This commit is contained in:
parent
36abb3b7ea
commit
dc7d96206a
2 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
|
|
|
@ -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']));
|
||||
|
|
Loading…
Add table
Reference in a new issue