]> Raphaël G. Git Repositories - packbundle/commitdiff
Remove mixed strict type for data as it may be array or string
authorRaphaël Gertz <git@rapsys.eu>
Sun, 8 Aug 2021 13:40:18 +0000 (15:40 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Sun, 8 Aug 2021 13:40:18 +0000 (15:40 +0200)
Improve doc

Util/SluggerUtil.php

index 14a128dea8ec552c7ba5d8722e479afc500f78cc..0d8f346dec16b3a9964e053ce88fda076bf56ebc 100644 (file)
@@ -84,14 +84,14 @@ class SluggerUtil {
        /**
         * Flatten recursively an array
         *
        /**
         * Flatten recursively an array
         *
-        * @param array $data The data tree
+        * @param array|string $data The data tree
         * @param string|null $current The current prefix
         * @param string $sep The key separator
         * @param string $prefix The key prefix
         * @param string $suffix The key suffix
         * @return array The flattened data
         */
         * @param string|null $current The current prefix
         * @param string $sep The key separator
         * @param string $prefix The key prefix
         * @param string $suffix The key suffix
         * @return array The flattened data
         */
-       public function flatten(array $data, mixed $current = null, string $sep = '.', string $prefix = '', string $suffix = ''): array {
+       public function flatten($data, ?string $current = null, string $sep = '.', string $prefix = '', string $suffix = ''): array {
                //Init result
                $ret = [];
 
                //Init result
                $ret = [];