src/Validation.php
public function getCode(): int {
        if ($status = $this->getMainCode()) {
            return $status;
        }

        if ($this->isValid()) {
            return 200;
        }

        // There was no status so loop through the errors and look for the highest one.
        $max = 0;
        foreach ($this->getRawErrors() as $error) {
            if (isset($error['code']) && $error['code'] > $max) {
                $max = $error['code'];
            }
        }

        return $max ?: 400;
    }
public function getCode(): int {
        if ($status = $this->getMainCode()) {
            return $status;
        }

        if ($this->isValid()) {
            return 200;
        }

        // There was no status so loop through the errors and look for the highest one.
        $max = 0;
        foreach ($this->getRawErrors() as $error) {
            if (isset($error['code']) && $error['code'] > $max) {
                $max = $error['code'];
            }
        }

        return $max ?: 400;
    }
public function getCode ( ) : int { if ( $ status = $ this -> getMainCode ( ) ) { return $ status ; } if ( $ this -> isValid ( ) ) { return 200 ; } // There was no status so loop through the errors and look for the highest one. $ max = 0 ; foreach ( $ this -> getRawErrors ( ) as $ error ) { if ( isset ( $ error [ 'code' ] ) && $ error [ 'code' ] > $ max ) { $ max = $ error [ 'code' ] ; } } return $ max ? : 400 ; }
Get the error code.

The code is an HTTP response code and should be of the 4xx variety.

@return int Returns an error code.
Get the error code .