public function setOptions(array $options)
    {
        $availableOptions = [
            'default',
            'group',
            'key',
            'message',
            'messages',
            'rules'
        ];

        foreach ($availableOptions as $option) {
            if (isset($options[$option])) {
                $this->$option = $options[$option];
            }
        }
    }
public function setOptions(array $options)
    {
        $availableOptions = [
            'default',
            'group',
            'key',
            'message',
            'messages',
            'rules'
        ];

        foreach ($availableOptions as $option) {
            if (isset($options[$option])) {
                $this->$option = $options[$option];
            }
        }
    }
public function setOptions ( array $ options ) { $ availableOptions = [ 'default' , 'group' , 'key' , 'message' , 'messages' , 'rules' ] ; foreach ( $ availableOptions as $ option ) { if ( isset ( $ options [ $ option ] ) ) { $ this -> $ option = $ options [ $ option ] ; } } }
Sets options from an array.

@param array $options
Sets options from an array .