Converts this TLS context into PHP's equivalent stream context array.

@return array Stream context array compatible with PHP's streams.
437751
public function toStreamContextArray(): array
    {
        $options = [
            'crypto_method' => $this->toStreamCryptoMethod(),
            'peer_name' => $this->peerName,
            'verify_peer' => $this->verifyPeer,
            'verify_peer_name' => $this->verifyPeer,
            'verify_depth' => $this->verifyDepth,
            'ciphers' => $this->ciphers ?? \OPENSSL_DEFAULT_STREAM_CIPHERS,
            'capture_peer_cert' => $this->capturePeer,
            'capture_peer_cert_chain' => $this->capturePeer,
            'SNI_enabled' => $this->sniEnabled,
        ];

        if ($this->certificate !== null) {
            $options['local_cert'] = $this->certificate->getCertFile();

            if ($this->certificate->getCertFile() !== $this->certificate->getKeyFile()) {
                $options['local_pk'] = $this->certificate->getKeyFile();
            }
        }

        if ($this->caFile !== null) {
            $options['cafile'] = $this->caFile;
        }

        if ($this->caPath !== null) {
            $options['capath'] = $this->caPath;
        }

        if (\OPENSSL_VERSION_NUMBER >= 0x10100000) {
            $options['security_level'] = $this->securityLevel;
        }

        return ['ssl' => $options];
    }
94673
public function getContents() : string
    {
        $r = false;
        $err = ($this->stream === null || $this->readable === false);

        if ($err === false) {
            $r = stream_get_contents($this->stream);
        }

        if ($err === true || $r === false) {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException("Could not get contents of stream.");
            // @codeCoverageIgnoreEnd
        }

        return $r;
    }
196564
public function getContentStream()
    {
        $dict = $this->getPageDictionary();
        $contents = PdfType::resolve(PdfDictionary::get($dict, 'Contents'), $this->parser);
        if ($contents instanceof PdfNull) {
            return '';
        }

        if ($contents instanceof PdfArray) {
            $result = [];
            foreach ($contents->value as $content) {
                $content = PdfType::resolve($content, $this->parser);
                if (!($content instanceof PdfStream)) {
                    continue;
                }
                $result[] = $content->getUnfilteredStream();
            }

            return \implode("\n", $result);
        }

        if ($contents instanceof PdfStream) {
            return $contents->getUnfilteredStream();
        }

        throw new PdfReaderException(
            'Array or stream expected.',
            PdfReaderException::UNEXPECTED_DATA_TYPE
        );
    }
487447
public function getContext()
    {
        return array_filter(array(
            'subject' => $this->getSubject(),
            'from' => $this->addressToString((array) $this->getSender()),
            'to' => $this->addressToString((array) $this->getRecipients()),
            'cc' => $this->addressToString((array) $this->getCc()),
            'bcc' => $this->addressToString((array) $this->getBcc())
        ));
    }
462317
protected function getContextParameters()
    {
        if ($this->contextParameters === null) {
            $this->contextParameters    = stream_context_get_params($this->context);
        }
        return $this->contextParameters;
    }
1119181
public function getEncodings()
    {
        if (null !== $this->encodings) {
            return $this->encodings;
        }

        return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
    }
1281129
public function getContextData(): Array
    {
        return [
        'id' => $this->getId(),
        'name' => $this->getName(),
        'client_id' => $this->getClientId(),
        'client_secret' => $this->getClientSecret(),
        'application_type' => $this->getApplicationType(),
        'redirect_uris' => $this->getRedirectUris(),
        'cors_uris' => $this->getCorsUris()
        ];
    }
135193
public function getHeaders(): array
	{
		$headers = [];

		foreach($this->parameters as $key => $value)
		{
			if(strpos($key, 'HTTP_') === 0)
			{
				$headers[substr($key, 5)] = $value;
			}
			elseif(in_array($key, ['CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE']))
			{
				$headers[$key] = $value;
			}
		}

		return $headers;
	}
220747
public function toArray()
    {
        $return = array();
        foreach ($this->_attribs as $key => $value) {
            $return[$key] = $value;
        }

        if ($this->_value instanceof CanConvertToArray) {
            $return = array_merge($return, $this->_value->toArray());
        } else {
            $return[$this->_name] = $this->_value;
        }

        return $return;
    }
760128
public function toArray() : ?array
    {
        if (null === $this->stmt || false === $this->stmt) {
            return null;
        }
        return $this->stmt->toArray();
    }
1057258
public function getStringifiedArray(): array
    {
        $ret = [];
        foreach ($this->headers as $header => $value) {
            if (is_array($value)) {
                $value = implode(", ", $value);
            }
            $ret[] = "$header: $value";
        }
        return $ret;
    }
45258
public function toArray(): array
    {
        return [
            "clientFilename" => $this->getClientFilename(),
            "unverifiedContentType" => $this->error ? "" : $this->getContentType(true),
            "verifiedContentType" => $this->error ? "" : $this->getContentType(),
            "size" => $this->error ? 0 : $this->getSize(),
            "tempPath" => $this->error ? "" : $this->getTempPath(),
            "error" => $this->error ? $this->error->getMessage() : "",
        ];
    }
146027
private function getContext(): array
    {
        $context = [$this->name];
        if ($this instanceof AliasInterface) {
            $context = array_unique(array_merge($context, $this->getAlias()));
        }

        return $context;
    }
1231888
public function getArray()
    {
        try {
            $parsed = TomlParser::ParseFile($this->context);
        } catch (ParseException $e) {
            throw new InvalidFileException($e->getMessage());
        }

        // if (! is_array($parsed)) {
        //     throw new InvalidFileException('Unable to parse invalid TOML file at ' . $this->context);
        // }

        return $parsed;
    }
607576
public function getBodyAsStream()
    {
        $body = $this->getBody();
        if (is_callable($this->body)) {
            $body = $this->getBodyAsString();
        }
        if (is_string($body) || null === $body) {
            $stream = fopen('php://temp', 'r+');
            fwrite($stream, (string) $body);
            rewind($stream);

            return $stream;
        }

        return $body;
    }
763721
private function getResourceContext()
    {
        if (null === $this->httpProxy["host"] || null === $this->httpProxy["port"]) {
            return null;
        }

        $options = array();
        foreach (array("http", "https") as $protocol) {
            $options[$protocol] = array(
                "method"          => "GET",
                "proxy"           => sprintf("tcp://%s:%s", $this->httpProxy["host"], $this->httpProxy["port"]),
                "request_fulluri" => true
            );

            if (null !== $this->httpProxy["auth"]) {
                $options[$protocol]["header"] = sprintf("Proxy-Authorization: Basic %s", base64_encode($this->httpProxy["auth"]));
            }
        }

        return stream_context_create($options);
    }
422060
public function getContents()
    {
        $this->valideAttach()->valideRead();
        if (($stream = stream_get_contents($this->stream)) === false) {
            throw new \RuntimeException('An error occurred while reading the stream.');
        }

        return $stream;
    }