Skip to content

Commit 2b477d0

Browse files
committed
Validate the object driver class.
1 parent d7c2171 commit 2b477d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Rdb.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ protected function __construct($config)
7272
}
7373

7474
$class = $this->config->object_driver;
75+
76+
if (!is_subclass_of($class, RdbObjectDriver::class)) {
77+
throw new InvalidArgumentException('Invalid object driver: ' . $class);
78+
}
79+
7580
$this->driver = new $class($this);
7681
}
7782

0 commit comments

Comments
 (0)