public function checkConstraint($constraint)
    {
        if (!$constraint instanceof ConstraintContract && !$constraint instanceof ConstraintGroupContract) {
            throw new InvalidArgumentException("Constraint has to be Constraint or ConstraintGroup, not " . Type::of($constraint));
        }
        if ($this->allowedOperators && $constraint instanceof Constraint) {
            $constraint->allowOperators($this->allowedOperators);
        }
        return $constraint;
    }
public function checkConstraint($constraint)
    {
        if (!$constraint instanceof ConstraintContract && !$constraint instanceof ConstraintGroupContract) {
            throw new InvalidArgumentException("Constraint has to be Constraint or ConstraintGroup, not " . Type::of($constraint));
        }
        if ($this->allowedOperators && $constraint instanceof Constraint) {
            $constraint->allowOperators($this->allowedOperators);
        }
        return $constraint;
    }
public function checkConstraint ( $ constraint ) { if ( ! $ constraint instanceof ConstraintContract && ! $ constraint instanceof ConstraintGroupContract ) { throw new InvalidArgumentException ( "Constraint has to be Constraint or ConstraintGroup, not " . Type :: of ( $ constraint ) ) ; } if ( $ this -> allowedOperators && $ constraint instanceof Constraint ) { $ constraint -> allowOperators ( $ this -> allowedOperators ) ; } return $ constraint ; }
Checks the type of the constraint

@param mixed $constraint

@return ConstraintContract|ConstraintGroupContract
Checks the type of the constraint