public static function toTarget(Certificate $target,
        CertificateBundle $trust_anchors, CertificateBundle $intermediate = null): self
    {
        $builder = new CertificationPathBuilder($trust_anchors);
        return $builder->shortestPathToTarget($target, $intermediate);
    }
public static function toTarget(Certificate $target,
        CertificateBundle $trust_anchors, CertificateBundle $intermediate = null): self
    {
        $builder = new CertificationPathBuilder($trust_anchors);
        return $builder->shortestPathToTarget($target, $intermediate);
    }
public static function toTarget ( Certificate $ target , CertificateBundle $ trust_anchors , CertificateBundle $ intermediate = null ) : self { $ builder = new CertificationPathBuilder ( $ trust_anchors ) ; return $ builder -> shortestPathToTarget ( $ target , $ intermediate ) ; }
Build certification path to given target.

@param Certificate $target Target end-entity certificate
@param CertificateBundle $trust_anchors List of trust anchors
@param CertificateBundle|null $intermediate Optional intermediate
certificates
@return self
Build certification path to given target .