src/Callbacks/SelectValidatorCallback.php
/**
     * Will be invoked by the observer it has been registered for.
     *
     * @param string|null $attributeCode  The code of the attribute that has to be validated
     * @param string|null $attributeValue The attribute value to be validated
     *
     * @return mixed The modified value
     */
Will be invoked by the observer it has been registered for.
@param string|null $attributeCode  The code of the attribute that has to be validated
@param string|null $attributeValue The attribute value to be validated

@return mixed The modified value
Will be invoked by the observer it has been registered for . @param string|null $attributeCode The code of the attribute that has to be validated @param string|null $attributeValue The attribute value to be validated @return mixed The modified value
public function handle($attributeCode = null, $attributeValue = null)
    {
        if ($this->isNullable($attributeValue)) {
            return;
        }
        $validations = $this->getValidations($attributeCode);
        if (in_array($attributeValue, $validations)) {
            return;
        }
        throw new \InvalidArgumentException(
            sprintf('Found invalid option value "%s" for attribute with code "%s"', $attributeValue, $attributeCode)
        );
    }
public function handle ( $ attributeCode = null , $ attributeValue = null ) { if ( $ this -> isNullable ( $ attributeValue ) ) { return ; } $ validations = $ this -> getValidations ( $ attributeCode ) ; if ( in_array ( $ attributeValue , $ validations ) ) { return ; } throw new \ InvalidArgumentException ( sprintf ( 'Found invalid option value "%s" for attribute with code "%s"' , $ attributeValue , $ attributeCode ) ) ; }
Will be invoked by the observer it has been registered for.
Will be invoked by the observer it has been registered for .
// explode the additional attributes // load the validations for the attribute with the passed code // query whether or not the value is valid // throw an exception if the value is NOT in the array