public function isRequired() : Group
    {
        foreach ((array)$this as $el) {
            if (!is_object($el)) {
                continue;
            }
            $el->getElement()->attribute('required', 1);
        }
        return $this->addTest('required', function ($value) {
            foreach ($value as $option) {
                if ($option->getElement() instanceof Radio
                    && $option->getElement()->checked()
                ) {
                    return true;
                }
            }
            return false;
        });
    }
public function isRequired() : Group
    {
        foreach ((array)$this as $el) {
            if (!is_object($el)) {
                continue;
            }
            $el->getElement()->attribute('required', 1);
        }
        return $this->addTest('required', function ($value) {
            foreach ($value as $option) {
                if ($option->getElement() instanceof Radio
                    && $option->getElement()->checked()
                ) {
                    return true;
                }
            }
            return false;
        });
    }
public function isRequired ( ) : Group { foreach ( ( array ) $ this as $ el ) { if ( ! is_object ( $ el ) ) { continue ; } $ el -> getElement ( ) -> attribute ( 'required' , 1 ) ; } return $ this -> addTest ( 'required' , function ( $ value ) { foreach ( $ value as $ option ) { if ( $ option -> getElement ( ) instanceof Radio && $ option -> getElement ( ) -> checked ( ) ) { return true ; } } return false ; } ) ; }
Marks the group as required.

@return self
Marks the group as required .