]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ACLFormatter.php
Friendica copyright changed from 2023 to 2034
[friendica.git] / src / Util / ACLFormatter.php
index f7a0894e1c6e81bce4f6911c0361d36131529c79..4d7be6165cffb4c9d8258d4d17a2d765bd761c74 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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);
                }