DDC-127 - Special Case with invalid input parameter in DQL leads to php notice instead of an exception.
This commit is contained in:
parent
f9ab947372
commit
26a2ec2e63
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user