public function probe(): void
    {
        if(!isset($this->settings["constraints"])) 
            return;
        $constraints = $this->settings["constraints"];
        foreach($constraints as $constraint=>$constraint_val) {
            if(is_null($constraint_val))
                continue;
            switch($constraint) {
                case "format":
                    if(!in_array($constraint_val, [
                         "numeric",
                         "ip",
                         "email",
                         "url",
                         "creditCard",
                         "alpha",
                         "alphaNum"
                         // "date" // there is already the Date field
                    ])) {
                        /*
                        if($constraint_val == "uuid" || $constraint_val == "udid") {
                            try {
                                ID::fromString($this->value);
                            }
                            catch(LibGraph\Exceptions\MalformedIDException $e) {
                                throw new \InvalidArgumentException;
                            }
                        }
                        else {
                            throw new \InvalidArgumentException;
                        }
                        */
                        throw new \InvalidArgumentException;
                    }
                    $v = new Validator(["field"=>$this->value]);
                    $v->rule($constraint_val, "field");
                    if(!$v->validate()) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                //case "dateFormat":
                case "dateBefore":
                case "dateAfter":
                    $v = new Validator(["field"=>$this->value]);
                    $v->rule($constraint, "field", $constraint_val);
                    if(!$v->validate()) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                case "minLength":
                case "maxLength":
                case "greaterThan":
                case "lessThan":
                    Assert::$constraint($this->value, $constraint_val);
                    break;
                               
                case "id":
                    try {
                        ID::fromString($this->value);
                    }
                    catch(LibGraph\Exceptions\MalformedIDException $e) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                
                case "regex":
                    /*
                    if($constraint_val[0]!="/")
                        Assert::$constraint($this->value, "/".addslashes($constraint_val)."/");
                    else*/
                        Assert::$constraint($this->value, $constraint_val);
                    break;
             } 
        }
    }
public function probe(): void
    {
        if(!isset($this->settings["constraints"])) 
            return;
        $constraints = $this->settings["constraints"];
        foreach($constraints as $constraint=>$constraint_val) {
            if(is_null($constraint_val))
                continue;
            switch($constraint) {
                case "format":
                    if(!in_array($constraint_val, [
                         "numeric",
                         "ip",
                         "email",
                         "url",
                         "creditCard",
                         "alpha",
                         "alphaNum"
                         // "date" // there is already the Date field
                    ])) {
                        /*
                        if($constraint_val == "uuid" || $constraint_val == "udid") {
                            try {
                                ID::fromString($this->value);
                            }
                            catch(LibGraph\Exceptions\MalformedIDException $e) {
                                throw new \InvalidArgumentException;
                            }
                        }
                        else {
                            throw new \InvalidArgumentException;
                        }
                        */
                        throw new \InvalidArgumentException;
                    }
                    $v = new Validator(["field"=>$this->value]);
                    $v->rule($constraint_val, "field");
                    if(!$v->validate()) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                //case "dateFormat":
                case "dateBefore":
                case "dateAfter":
                    $v = new Validator(["field"=>$this->value]);
                    $v->rule($constraint, "field", $constraint_val);
                    if(!$v->validate()) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                case "minLength":
                case "maxLength":
                case "greaterThan":
                case "lessThan":
                    Assert::$constraint($this->value, $constraint_val);
                    break;
                               
                case "id":
                    try {
                        ID::fromString($this->value);
                    }
                    catch(LibGraph\Exceptions\MalformedIDException $e) {
                        throw new \InvalidArgumentException;
                    }
                    break;
                
                case "regex":
                    /*
                    if($constraint_val[0]!="/")
                        Assert::$constraint($this->value, "/".addslashes($constraint_val)."/");
                    else*/
                        Assert::$constraint($this->value, $constraint_val);
                    break;
             } 
        }
    }
public function probe ( ) : void { if ( ! isset ( $ this -> settings [ "constraints" ] ) ) return ; $ constraints = $ this -> settings [ "constraints" ] ; foreach ( $ constraints as $ constraint => $ constraint_val ) { if ( is_null ( $ constraint_val ) ) continue ; switch ( $ constraint ) { case "format" : if ( ! in_array ( $ constraint_val , [ "numeric" , "ip" , "email" , "url" , "creditCard" , "alpha" , "alphaNum" // "date" // there is already the Date field ] ) ) { /*
                        if($constraint_val == "uuid" || $constraint_val == "udid") {
                            try {
                                ID::fromString($this->value);
                            }
                            catch(LibGraph\Exceptions\MalformedIDException $e) {
                                throw new \InvalidArgumentException;
                            }
                        }
                        else {
                            throw new \InvalidArgumentException;
                        }
                        */ throw new \ InvalidArgumentException ; } $ v = new Validator ( [ "field" => $ this -> value ] ) ; $ v -> rule ( $ constraint_val , "field" ) ; if ( ! $ v -> validate ( ) ) { throw new \ InvalidArgumentException ; } break ; //case "dateFormat": case "dateBefore" : case "dateAfter" : $ v = new Validator ( [ "field" => $ this -> value ] ) ; $ v -> rule ( $ constraint , "field" , $ constraint_val ) ; if ( ! $ v -> validate ( ) ) { throw new \ InvalidArgumentException ; } break ; case "minLength" : case "maxLength" : case "greaterThan" : case "lessThan" : Assert :: $ constraint ( $ this -> value , $ constraint_val ) ; break ; case "id" : try { ID :: fromString ( $ this -> value ) ; } catch ( LibGraph \ Exceptions \ MalformedIDException $ e ) { throw new \ InvalidArgumentException ; } break ; case "regex" : /*
                    if($constraint_val[0]!="/")
                        Assert::$constraint($this->value, "/".addslashes($constraint_val)."/");
                    else*/ Assert :: $ constraint ( $ this -> value , $ constraint_val ) ; break ; } } }
Checks if the field meets the requirements of the constraints in the
particle's FIELDS constant.

@return void

@throws \InvalidArgumentException thrown when there argument does not meet the constraints.
Checks if the field meets the requirements of the constraints in the particle s FIELDS constant .