Type hint in IpAddress

Signed-off-by: Vincent Petry <vincent@nextcloud.com>

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
This commit is contained in:
Vincent Petry 2021-11-22 17:36:26 +01:00 committed by backportbot[bot]
parent cc0d10435b
commit 74eeca32ee

View file

@ -96,10 +96,9 @@ class IpAddress {
* Returns the IPv4 address embedded in an IPv6 if applicable.
* The detected format is "::ffff:x.x.x.x" using the binary form.
*
* @param string $ipv6 IPv6 string
* @return null|string embedded IPv4 string or null if none was found
* @return string|null embedded IPv4 string or null if none was found
*/
private function getEmbeddedIpv4($ipv6) {
private function getEmbeddedIpv4(string $ipv6): ?string {
$binary = inet_pton($ipv6);
if (!$binary) {
return null;