Fix helper method for invalid options in connection classes.

This fix is needed since connection parameters do not respond to __toString()
anymore after recent changes.
This commit is contained in:
Daniele Alessandri
2012-03-18 15:23:25 +01:00
parent bcba9e1009
commit 608c48146f
+4 -2
View File
@@ -177,9 +177,11 @@ abstract class AbstractConnection implements SingleConnectionInterface
*/
protected function onInvalidOption($option, $parameters = null)
{
$message = "Invalid option: $option";
$class = get_called_class();
$message = "Invalid option for connection $class: $option";
if (isset($parameters)) {
$message .= " [$parameters]";
$message .= sprintf(' [%s => %s]', $option, $parameters->{$option});
}
throw new NotSupportedException($message);