fix CS
This commit is contained in:
parent
7c754e495e
commit
5f89fa4190
@ -82,7 +82,7 @@ class ObjectHydrator extends AbstractHydrator
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @override
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected function prepare()
|
protected function prepare()
|
||||||
{
|
{
|
||||||
|
@ -589,18 +589,19 @@ class Parser
|
|||||||
? $AST->fromClause->identificationVariableDeclarations[0]->rangeVariableDeclaration->abstractSchemaName
|
? $AST->fromClause->identificationVariableDeclarations[0]->rangeVariableDeclaration->abstractSchemaName
|
||||||
: null;
|
: 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) {
|
if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
|
||||||
$namespace = substr($fromClassName, 0 , strrpos($fromClassName, '\\'));
|
$namespace = substr($fromClassName, 0 , strrpos($fromClassName, '\\'));
|
||||||
$className = $namespace . '\\' . $className;
|
$fqcn = $namespace . '\\' . $className;
|
||||||
|
|
||||||
if (class_exists($className)) {
|
if (class_exists($fqcn)) {
|
||||||
$expression->className = $className;
|
$expression->className = $fqcn;
|
||||||
|
$className = $fqcn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! class_exists($className)) {
|
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);
|
$class = new \ReflectionClass($className);
|
||||||
@ -613,7 +614,7 @@ class Parser
|
|||||||
$this->semanticalError(sprintf('Class "%s" has not a valid contructor.', $className), $token);
|
$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);
|
$this->semanticalError(sprintf('Number of arguments does not match with "%s" constructor declaration.', $className), $token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user