private function _verifyMaxPathLength(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        if (!$cert->isSelfIssued()) {
            if ($state->maxPathLength() <= 0) {
                throw new PathValidationException(
                    "Certification path length exceeded.");
            }
            $state = $state->withMaxPathLength($state->maxPathLength() - 1);
        }
        return $state;
    }
private function _verifyMaxPathLength(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        if (!$cert->isSelfIssued()) {
            if ($state->maxPathLength() <= 0) {
                throw new PathValidationException(
                    "Certification path length exceeded.");
            }
            $state = $state->withMaxPathLength($state->maxPathLength() - 1);
        }
        return $state;
    }
private function _verifyMaxPathLength ( ValidatorState $ state , Certificate $ cert ) : ValidatorState { if ( ! $ cert -> isSelfIssued ( ) ) { if ( $ state -> maxPathLength ( ) <= 0 ) { throw new PathValidationException ( "Certification path length exceeded." ) ; } $ state = $ state -> withMaxPathLength ( $ state -> maxPathLength ( ) - 1 ) ; } return $ state ; }
Verify maximum certification path length for the preparation step.

@param ValidatorState $state
@param Certificate $cert
@throws PathValidationException
@return ValidatorState
Verify maximum certification path length for the preparation step .