public function __construct($options = null)
{
// no known options set? $options is the fields array
- if (is_array($options)
+ if (\is_array($options)
&& !array_intersect(array_keys($options), array('groups', 'fields', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage'))) {
$options = array('fields' => $options);
}
{
parent::initializeNestedConstraints();
- if (!is_array($this->fields)) {
+ if (!\is_array($this->fields)) {
throw new ConstraintDefinitionException(sprintf('The option "fields" is expected to be an array in constraint %s', __CLASS__));
}
foreach ($this->fields as $fieldName => $field) {
// the XmlFileLoader and YamlFileLoader pass the field Optional
// and Required constraint as an array with exactly one element
- if (is_array($field) && 1 == count($field)) {
+ if (\is_array($field) && 1 == \count($field)) {
$this->fields[$fieldName] = $field = $field[0];
}