public function withCertificates(array $certificates): self
    {
        foreach ($certificates as $key => $certificate) {
            if (!\is_string($key)) {
                throw new \TypeError('Expected an array mapping domain names to Certificate instances');
            }

            if (!$certificate instanceof Certificate) {
                throw new \TypeError('Expected an array of Certificate instances');
            }

            if (\PHP_VERSION_ID < 70200 && $certificate->getCertFile() !== $certificate->getKeyFile()) {
                throw new \Error(
                    'Different files for cert and key are not supported on this version of PHP. ' .
                    'Please upgrade to PHP 7.2 or later.'
                );
            }
        }

        $clone = clone $this;
        $clone->certificates = $certificates;

        return $clone;
    }
public function withCertificates(array $certificates): self
    {
        foreach ($certificates as $key => $certificate) {
            if (!\is_string($key)) {
                throw new \TypeError('Expected an array mapping domain names to Certificate instances');
            }

            if (!$certificate instanceof Certificate) {
                throw new \TypeError('Expected an array of Certificate instances');
            }

            if (\PHP_VERSION_ID < 70200 && $certificate->getCertFile() !== $certificate->getKeyFile()) {
                throw new \Error(
                    'Different files for cert and key are not supported on this version of PHP. ' .
                    'Please upgrade to PHP 7.2 or later.'
                );
            }
        }

        $clone = clone $this;
        $clone->certificates = $certificates;

        return $clone;
    }
public function withCertificates ( array $ certificates ) : self { foreach ( $ certificates as $ key => $ certificate ) { if ( ! \ is_string ( $ key ) ) { throw new \ TypeError ( 'Expected an array mapping domain names to Certificate instances' ) ; } if ( ! $ certificate instanceof Certificate ) { throw new \ TypeError ( 'Expected an array of Certificate instances' ) ; } if ( \ PHP_VERSION_ID < 70200 && $ certificate -> getCertFile ( ) !== $ certificate -> getKeyFile ( ) ) { throw new \ Error ( 'Different files for cert and key are not supported on this version of PHP. ' . 'Please upgrade to PHP 7.2 or later.' ) ; } } $ clone = clone $ this ; $ clone -> certificates = $ certificates ; return $ clone ; }
Certificates to use for the given host names.

@param array $certificates Must be a associative array mapping hostnames to certificate instances.

@return self Cloned, modified instance.
Certificates to use for the given host names .