diff options
author | J0WI <J0WI@users.noreply.github.com> | 2021-04-19 15:50:30 +0200 |
---|---|---|
committer | J0WI <J0WI@users.noreply.github.com> | 2021-04-19 17:31:12 +0200 |
commit | ca7b37ce5a5c68ea4a105377754005a772c5deaa (patch) | |
tree | 2df753ec57b8f5b51324d2e0bc4a361179dc2967 /lib/private/Security/Certificate.php | |
parent | 9a69b8839389f133db55a41e1c2ba4435fd50c19 (diff) | |
download | nextcloud-server-ca7b37ce5a5c68ea4a105377754005a772c5deaa.tar.gz nextcloud-server-ca7b37ce5a5c68ea4a105377754005a772c5deaa.zip |
Make Security module strict
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
Diffstat (limited to 'lib/private/Security/Certificate.php')
-rw-r--r-- | lib/private/Security/Certificate.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/private/Security/Certificate.php b/lib/private/Security/Certificate.php index c89122f9a4b..e299f9d2b8f 100644 --- a/lib/private/Security/Certificate.php +++ b/lib/private/Security/Certificate.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -49,7 +52,7 @@ class Certificate implements ICertificate { * @param string $name * @throws \Exception If the certificate could not get parsed */ - public function __construct($data, $name) { + public function __construct(string $data, string $name) { $this->name = $name; $gmt = new \DateTimeZone('GMT'); @@ -75,42 +78,42 @@ class Certificate implements ICertificate { /** * @return string */ - public function getName() { + public function getName(): string { return $this->name; } /** * @return string|null */ - public function getCommonName() { + public function getCommonName(): ?string { return $this->commonName; } /** - * @return string + * @return string|null */ - public function getOrganization() { + public function getOrganization(): ?string { return $this->organization; } /** * @return \DateTime */ - public function getIssueDate() { + public function getIssueDate(): \DateTime { return $this->issueDate; } /** * @return \DateTime */ - public function getExpireDate() { + public function getExpireDate(): \DateTime { return $this->expireDate; } /** * @return bool */ - public function isExpired() { + public function isExpired(): bool { $now = new \DateTime(); return $this->issueDate > $now or $now > $this->expireDate; } @@ -118,14 +121,14 @@ class Certificate implements ICertificate { /** * @return string|null */ - public function getIssuerName() { + public function getIssuerName(): ?string { return $this->issuerName; } /** * @return string|null */ - public function getIssuerOrganization() { + public function getIssuerOrganization(): ?string { return $this->issuerOrganization; } } |