1
0
mirror of synced 2025-01-31 12:32:59 +03:00

DDC-127 - Special Case with invalid input parameter in DQL leads to php notice instead of an exception.

This commit is contained in:
beberlei 2009-11-21 13:18:45 +00:00
parent f9ab947372
commit 26a2ec2e63

View File

@ -37,10 +37,16 @@ class InputParameter extends Node
public $isNamed; public $isNamed;
public $name; public $name;
/**
* @param string $value
*/
public function __construct($value) public function __construct($value)
{ {
if (strlen($value) == 1) { if (strlen($value) == 1) {
throw new \InvalidArgumentException("Invalid parameter format."); throw new \InvalidArgumentException(
"Invalid parameter format, '".$value."' given, ".
"but :<name> or ?<num> expected."
);
} }
$param = substr($value, 1); $param = substr($value, 1);