public function isValid() : bool
    {
        $this->validate();

        if ($this->hasErrors()) {
            return false;
        }

        foreach ($this->components as $component) {
            if ($component->hasErrors()) {
                return false;
            }
        }

        return true;
    }
public function isValid() : bool
    {
        $this->validate();

        if ($this->hasErrors()) {
            return false;
        }

        foreach ($this->components as $component) {
            if ($component->hasErrors()) {
                return false;
            }
        }

        return true;
    }
public function isValid ( ) : bool { $ this -> validate ( ) ; if ( $ this -> hasErrors ( ) ) { return false ; } foreach ( $ this -> components as $ component ) { if ( $ component -> hasErrors ( ) ) { return false ; } } return true ; }
Returns whether the form is valid.

@return bool
Returns whether the form is valid .