public function isRequired(): bool
    {
        foreach ($this->rules as $rule) {
            if ($rule instanceof RequiredRule) {
                return true;
            }
        }
        return false;
    }
public function isRequired(): bool
    {
        foreach ($this->rules as $rule) {
            if ($rule instanceof RequiredRule) {
                return true;
            }
        }
        return false;
    }
public function isRequired ( ) : bool { foreach ( $ this -> rules as $ rule ) { if ( $ rule instanceof RequiredRule ) { return true ; } } return false ; }
Get required flag

@return bool
Get required flag