public static function fromAssocArray(array $keyValueOptions, string $valueType = 'string') : ArrayFieldOptions
    {
        $options = [];

        foreach ($keyValueOptions as $value => $label) {
            settype($value, $valueType);
            $options[] = $label instanceof IFieldOption
                    ? $label
                    : new FieldOption($value, $label);
        }

        return new self($options);
    }
public static function fromAssocArray(array $keyValueOptions, string $valueType = 'string') : ArrayFieldOptions
    {
        $options = [];

        foreach ($keyValueOptions as $value => $label) {
            settype($value, $valueType);
            $options[] = $label instanceof IFieldOption
                    ? $label
                    : new FieldOption($value, $label);
        }

        return new self($options);
    }
public static function fromAssocArray ( array $ keyValueOptions , string $ valueType = 'string' ) : ArrayFieldOptions { $ options = [ ] ; foreach ( $ keyValueOptions as $ value => $ label ) { settype ( $ value , $ valueType ) ; $ options [ ] = $ label instanceof IFieldOption ? $ label : new FieldOption ( $ value , $ label ) ; } return new self ( $ options ) ; }
Constructs an array field options collections with the option
values as the array keys and the labels as the array values.

@param array  $keyValueOptions
@param string $valueType

@return ArrayFieldOptions
Constructs an array field options collections with the option values as the array keys and the labels as the array values .