1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
Fabio B. Silva 2012-08-20 22:43:16 -03:00
parent 7c754e495e
commit 5f89fa4190
2 changed files with 12 additions and 11 deletions

View File

@ -81,8 +81,8 @@ class ObjectHydrator extends AbstractHydrator
private $existingCollections = array();
/**
* @override
/**
* {@inheritdoc}
*/
protected function prepare()
{

View File

@ -71,7 +71,7 @@ class Parser
* Expressions that were encountered during parsing of identifiers and expressions
* and still need to be validated.
*/
/**
* @var array
*/
@ -81,12 +81,12 @@ class Parser
* @var array
*/
private $deferredPartialObjectExpressions = array();
/**
* @var array
*/
private $deferredPathExpressions = array();
/**
* @var array
*/
@ -589,18 +589,19 @@ class Parser
? $AST->fromClause->identificationVariableDeclarations[0]->rangeVariableDeclaration->abstractSchemaName
: null;
// If the namespace is not given then assumes the first from entity namespace
// If the namespace is not given then assumes the first FROM entity namespace
if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
$namespace = substr($fromClassName, 0 , strrpos($fromClassName, '\\'));
$className = $namespace . '\\' . $className;
$fqcn = $namespace . '\\' . $className;
if (class_exists($className)) {
$expression->className = $className;
if (class_exists($fqcn)) {
$expression->className = $fqcn;
$className = $fqcn;
}
}
if ( ! class_exists($className)) {
$this->semanticalError(sprintf('Class "%s" is not defined.', $expression->className), $token);
$this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token);
}
$class = new \ReflectionClass($className);
@ -613,7 +614,7 @@ class Parser
$this->semanticalError(sprintf('Class "%s" has not a valid contructor.', $className), $token);
}
if ($class->getConstructor()->getNumberOfRequiredParameters() > sizeof($args)) {
if ($class->getConstructor()->getNumberOfRequiredParameters() > count($args)) {
$this->semanticalError(sprintf('Number of arguments does not match with "%s" constructor declaration.', $className), $token);
}
}