X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FACLFormatter.php;h=cd398fc280a419c314fe6b2e7a0a5af7ae299cf6;hb=911ed3d6ba98149ed6d400d554e7a0e10bd1c273;hp=f7a0894e1c6e81bce4f6911c0361d36131529c79;hpb=1129e8f17d0e11f803965467abd3f2539495dae7;p=friendica.git diff --git a/src/Util/ACLFormatter.php b/src/Util/ACLFormatter.php index f7a0894e1c..cd398fc280 100644 --- a/src/Util/ACLFormatter.php +++ b/src/Util/ACLFormatter.php @@ -35,7 +35,7 @@ final class ACLFormatter * * @return array The array based on the IDs (empty in case there is no list) */ - public function expand(string $acl_string = null) + public function expand(string $acl_string = null): array { // In case there is no ID list, return empty array (=> no ACL set) if (empty($acl_string)) { @@ -55,7 +55,7 @@ final class ACLFormatter * @param string|null $acl_string * @return string */ - public function sanitize(string $acl_string = null) + public function sanitize(string $acl_string = null): string { if (empty($acl_string)) { return ''; @@ -107,10 +107,13 @@ final class ACLFormatter * * @return string */ - function toString($permissions) { + function toString($permissions): string + { $return = ''; if (is_array($permissions)) { $item = $permissions; + } elseif (empty($permissions)) { + return ''; } else { $item = explode(',', $permissions); }