public function getDepth(): int
    {
        $depth = parent::getDepth();
        $paths = array_filter(array_map(
            /**
             * Extracts error path.
             *
             * @param Invalid $error the exception
             *
             * @return array|null
             */
            function(Invalid $error) {
                return $error->getPath();
            },
            $this->errors
        ));

        if ($paths && ($max = max(array_map('count', $paths))) > $depth) {
            $depth = $max;
        }

        return $depth;
    }
public function getDepth(): int
    {
        $depth = parent::getDepth();
        $paths = array_filter(array_map(
            /**
             * Extracts error path.
             *
             * @param Invalid $error the exception
             *
             * @return array|null
             */
            function(Invalid $error) {
                return $error->getPath();
            },
            $this->errors
        ));

        if ($paths && ($max = max(array_map('count', $paths))) > $depth) {
            $depth = $max;
        }

        return $depth;
    }
public function getDepth ( ) : int { $ depth = parent :: getDepth ( ) ; $ paths = array_filter ( array_map ( /**
             * Extracts error path.
             *
             * @param Invalid $error the exception
             *
             * @return array|null
             */ function ( Invalid $ error ) { return $ error -> getPath ( ) ; } , $ this -> errors ) ) ; if ( $ paths && ( $ max = max ( array_map ( 'count' , $ paths ) ) ) > $ depth ) { $ depth = $ max ; } return $ depth ; }
Calculate the maximum depth between its errors.

@return int
Calculate the maximum depth between its errors .