src/Callbacks/EmptyValueValidatorCallback.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)
    {
        $subject = $this->getSubject();
        if ($this->isNullable($attributeValue)) {
            return;
        }
        $optionValues = $subject->explode($attributeValue, ',');
        if (!is_array($optionValues)) {
            return;
        }
        foreach ($optionValues as $optionValue) {
            if (trim($optionValue) === '') {
                throw new \InvalidArgumentException(
                    sprintf('Found empty array value for attribute or property with code "%s"', $attributeCode)
                );
            }
        }
    }
public function handle ( $ attributeCode = null , $ attributeValue = null ) { $ subject = $ this -> getSubject ( ) ; if ( $ this -> isNullable ( $ attributeValue ) ) { return ; } $ optionValues = $ subject -> explode ( $ attributeValue , ',' ) ; if ( ! is_array ( $ optionValues ) ) { return ; } foreach ( $ optionValues as $ optionValue ) { if ( trim ( $ optionValue ) === '' ) { throw new \ InvalidArgumentException ( sprintf ( 'Found empty array value for attribute or property with code "%s"' , $ attributeCode ) ) ; } } }
Will be invoked by the observer it has been registered for.
Will be invoked by the observer it has been registered for .
// load the subject instance // explode the additional attributes // extract the option values // iterate over the attribute value options // query whether or not the value is valid