Skip to content

Commit

Permalink
Merge b396a60 into 937aff6
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 20, 2017
2 parents 937aff6 + b396a60 commit c548806
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
28 changes: 14 additions & 14 deletions lib/ClientTlsContext.php
Expand Up @@ -26,7 +26,7 @@ final class ClientTlsContext {
*
* @param int $version `ServerTlsContext::TLSv1_0`, `ServerTlsContext::TLSv1_1`, or `ServerTlsContext::TLSv1_2`.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
* @throws \Error If an invalid minimum version is given.
*/
public function withMinimumVersion(int $version): self {
Expand Down Expand Up @@ -54,7 +54,7 @@ public function getMinimumVersion(): int {
*
* @param string|null $peerName
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerName(string $peerName = null): self {
$clone = clone $this;
Expand All @@ -73,7 +73,7 @@ public function getPeerName() {
/**
* Enable peer verification.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerVerification(): self {
$clone = clone $this;
Expand All @@ -85,7 +85,7 @@ public function withPeerVerification(): self {
/**
* Disable peer verification, this is the default for servers.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withoutPeerVerification(): self {
$clone = clone $this;
Expand All @@ -106,7 +106,7 @@ public function hasPeerVerification(): bool {
*
* @param int $verifyDepth Maximum length of the certificate chain.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withVerificationDepth(int $verifyDepth): self {
if ($verifyDepth < 0) {
Expand All @@ -131,7 +131,7 @@ public function getVerificationDepth(): int {
*
* @param string|null $ciphers List of ciphers in OpenSSL's format (colon separated).
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCiphers(string $ciphers = null): self {
$clone = clone $this;
Expand All @@ -152,7 +152,7 @@ public function getCiphers(): string {
*
* @param string|null $cafile Path to the file or `null` to unset.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCaFile(string $cafile = null): self {
$clone = clone $this;
Expand All @@ -173,7 +173,7 @@ public function getCaFile() {
*
* @param string|null $capath Path to the file or `null` to unset.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCaPath(string $capath = null): self {
$clone = clone $this;
Expand All @@ -194,7 +194,7 @@ public function getCaPath() {
*
* Note: This is the chain as sent by the peer, NOT the verified chain.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerCapturing(): self {
$clone = clone $this;
Expand All @@ -206,7 +206,7 @@ public function withPeerCapturing(): self {
/**
* Don't capture the certificates sent by the peer.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withoutPeerCapturing(): self {
$clone = clone $this;
Expand All @@ -225,7 +225,7 @@ public function hasPeerCapturing(): bool {
/**
* Enable SNI.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withSni(): self {
$clone = clone $this;
Expand All @@ -237,7 +237,7 @@ public function withSni(): self {
/**
* Disable SNI.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withoutSni(): self {
$clone = clone $this;
Expand All @@ -260,7 +260,7 @@ public function hasSni(): bool {
*
* @param int $level Must be between 0 and 5.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withSecurityLevel(int $level): self {
// See https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_security_level.html
Expand Down Expand Up @@ -297,7 +297,7 @@ public function getSecurityLevel(): int {
/**
* Client certificate to use, if key is no present it assumes it is present in the same file as the certificate.
*
* @return ClientTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCertificate(Certificate $certificate = null): self {
$clone = clone $this;
Expand Down
26 changes: 13 additions & 13 deletions lib/ServerTlsContext.php
Expand Up @@ -47,7 +47,7 @@ final class ServerTlsContext {
*
* @param int $version `ServerTlsContext::TLSv1_0`, `ServerTlsContext::TLSv1_1`, or `ServerTlsContext::TLSv1_2`.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
* @throws \Error If an invalid minimum version is given.
*/
public function withMinimumVersion(int $version): self {
Expand Down Expand Up @@ -75,7 +75,7 @@ public function getMinimumVersion(): int {
*
* @param string|null $peerName
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerName(string $peerName = null): self {
$clone = clone $this;
Expand All @@ -94,7 +94,7 @@ public function getPeerName() {
/**
* Enable peer verification.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerVerification(): self {
$clone = clone $this;
Expand All @@ -106,7 +106,7 @@ public function withPeerVerification(): self {
/**
* Disable peer verification, this is the default for servers.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withoutPeerVerification(): self {
$clone = clone $this;
Expand All @@ -127,7 +127,7 @@ public function hasPeerVerification(): bool {
*
* @param int $verifyDepth Maximum length of the certificate chain.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withVerificationDepth(int $verifyDepth): self {
if ($verifyDepth < 0) {
Expand All @@ -152,7 +152,7 @@ public function getVerificationDepth(): int {
*
* @param string|null $ciphers List of ciphers in OpenSSL's format (colon separated).
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCiphers(string $ciphers = null): self {
$clone = clone $this;
Expand All @@ -173,7 +173,7 @@ public function getCiphers(): string {
*
* @param string|null $cafile Path to the file or `null` to unset.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCaFile(string $cafile = null): self {
$clone = clone $this;
Expand All @@ -194,7 +194,7 @@ public function getCaFile() {
*
* @param string|null $capath Path to the file or `null` to unset.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCaPath(string $capath = null): self {
$clone = clone $this;
Expand All @@ -215,7 +215,7 @@ public function getCaPath() {
*
* Note: This is the chain as sent by the peer, NOT the verified chain.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withPeerCapturing(): self {
$clone = clone $this;
Expand All @@ -227,7 +227,7 @@ public function withPeerCapturing(): self {
/**
* Don't capture the certificates sent by the peer.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withoutPeerCapturing(): self {
$clone = clone $this;
Expand All @@ -248,7 +248,7 @@ public function hasPeerCapturing(): bool {
*
* @param Certificate|null $defaultCertificate
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withDefaultCertificate(Certificate $defaultCertificate = null): self {
$clone = clone $this;
Expand All @@ -269,7 +269,7 @@ public function getDefaultCertificate() {
*
* @param array $certificates Must be a associative array mapping hostnames to certificate instances.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withCertificates(array $certificates): self {
foreach ($certificates as $key => $certificate) {
Expand Down Expand Up @@ -309,7 +309,7 @@ public function getCertificates(): array {
*
* @param int $level Must be between 0 and 5.
*
* @return ServerTlsContext Cloned, modified instance.
* @return self Cloned, modified instance.
*/
public function withSecurityLevel(int $level): self {
// See https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_security_level.html
Expand Down

0 comments on commit c548806

Please sign in to comment.