$compositeOption = $this->getCompositeOption();
$nestedConstraints = $this->$compositeOption;
- if (!is_array($nestedConstraints)) {
+ if (!\is_array($nestedConstraints)) {
$nestedConstraints = array($nestedConstraints);
}
foreach ($nestedConstraints as $constraint) {
if (!$constraint instanceof Constraint) {
- if (is_object($constraint)) {
- $constraint = get_class($constraint);
+ if (\is_object($constraint)) {
+ $constraint = \get_class($constraint);
}
- throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, get_class($this)));
+ throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, \get_class($this)));
}
if ($constraint instanceof Valid) {
- throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', get_class($this)));
+ throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', \get_class($this)));
}
}
if (property_exists($constraint, 'groups')) {
$excessGroups = array_diff($constraint->groups, $this->groups);
- if (count($excessGroups) > 0) {
- throw new ConstraintDefinitionException(sprintf(
- 'The group(s) "%s" passed to the constraint %s '.
- 'should also be passed to its containing constraint %s',
- implode('", "', $excessGroups),
- get_class($constraint),
- get_class($this)
- ));
+ if (\count($excessGroups) > 0) {
+ throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint %s should also be passed to its containing constraint %s', implode('", "', $excessGroups), \get_class($constraint), \get_class($this)));
}
} else {
$constraint->groups = $this->groups;