diff -pruN 1.6.1-1/debian/changelog 1.6.2-1/debian/changelog
--- 1.6.1-1/debian/changelog	2025-03-28 06:58:39.000000000 +0000
+++ 1.6.2-1/debian/changelog	2025-08-24 06:47:45.000000000 +0000
@@ -1,3 +1,17 @@
+php-composer-class-map-generator (1.6.2-1) unstable; urgency=medium
+
+  [ Ángel Guzmán Maeso ]
+  * feat: improve namespaces PHPFile (#22)
+  * feat: type return values classmap (#24)
+
+  [ Daniel Scherzer ]
+  * Simplify `PhpFileParser::getExtraTypes()` logic (#25)
+
+  [ David Prévot ]
+  * Remove Rules-Requires-Root
+
+ -- David Prévot <taffit@debian.org>  Sun, 24 Aug 2025 08:47:45 +0200
+
 php-composer-class-map-generator (1.6.1-1) unstable; urgency=medium
 
   [ Jordi Boggiano ]
diff -pruN 1.6.1-1/debian/control 1.6.2-1/debian/control
--- 1.6.1-1/debian/control	2025-03-28 06:58:01.000000000 +0000
+++ 1.6.2-1/debian/control	2025-08-24 06:45:15.000000000 +0000
@@ -14,7 +14,6 @@ Standards-Version: 4.7.2
 Homepage: https://github.com/composer/class-map-generator
 Vcs-Browser: https://salsa.debian.org/php-team/pear/php-composer-class-map-generator
 Vcs-Git: https://salsa.debian.org/php-team/pear/php-composer-class-map-generator.git
-Rules-Requires-Root: no
 
 Package: php-composer-class-map-generator
 Architecture: all
diff -pruN 1.6.1-1/debian/patches/0001-Compatibility-with-recent-PHPUnit-10.patch 1.6.2-1/debian/patches/0001-Compatibility-with-recent-PHPUnit-10.patch
--- 1.6.1-1/debian/patches/0001-Compatibility-with-recent-PHPUnit-10.patch	2025-03-28 06:54:28.000000000 +0000
+++ 1.6.2-1/debian/patches/0001-Compatibility-with-recent-PHPUnit-10.patch	2025-08-24 06:44:25.000000000 +0000
@@ -7,7 +7,7 @@ Subject: Compatibility with recent PHPUn
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/tests/ClassMapGeneratorTest.php b/tests/ClassMapGeneratorTest.php
-index 51506d7..4d75d4b 100644
+index 16a8fc2..ced0b30 100644
 --- a/tests/ClassMapGeneratorTest.php
 +++ b/tests/ClassMapGeneratorTest.php
 @@ -56,7 +56,7 @@ class ClassMapGeneratorTest extends TestCase
diff -pruN 1.6.1-1/debian/patches/0002-Compatibility-with-recent-PHPUnit-12.patch 1.6.2-1/debian/patches/0002-Compatibility-with-recent-PHPUnit-12.patch
--- 1.6.1-1/debian/patches/0002-Compatibility-with-recent-PHPUnit-12.patch	2025-03-28 06:54:28.000000000 +0000
+++ 1.6.2-1/debian/patches/0002-Compatibility-with-recent-PHPUnit-12.patch	2025-08-24 06:44:25.000000000 +0000
@@ -7,7 +7,7 @@ Subject: Compatibility with recent PHPUn
  1 file changed, 2 insertions(+)
 
 diff --git a/tests/ClassMapGeneratorTest.php b/tests/ClassMapGeneratorTest.php
-index 4d75d4b..d8e8765 100644
+index ced0b30..c32b05d 100644
 --- a/tests/ClassMapGeneratorTest.php
 +++ b/tests/ClassMapGeneratorTest.php
 @@ -19,6 +19,7 @@
diff -pruN 1.6.1-1/debian/tests/control 1.6.2-1/debian/tests/control
--- 1.6.1-1/debian/tests/control	2024-06-05 05:23:41.000000000 +0000
+++ 1.6.2-1/debian/tests/control	2025-08-24 06:46:29.000000000 +0000
@@ -1,3 +1,3 @@
 Test-Command: mkdir -p vendor && phpabtpl --require composer/class-map-generator --require symfony/filesystem > debian/autoload.tests.php.tpl && phpab -o vendor/autoload.php -t debian/autoload.tests.php.tpl --exclude '*/StripNoise.php' tests && phpunit
-Restrictions: rw-build-tree, allow-stderr
+Restrictions: allow-stderr, rw-build-tree
 Depends: php-symfony-filesystem, phpab, phpunit, pkg-php-tools (>= 1.41~), @
diff -pruN 1.6.1-1/src/ClassMap.php 1.6.2-1/src/ClassMap.php
--- 1.6.1-1/src/ClassMap.php	2025-03-24 13:50:44.000000000 +0000
+++ 1.6.2-1/src/ClassMap.php	2025-08-20 18:52:43.000000000 +0000
@@ -94,7 +94,7 @@ class ClassMap implements \Countable
 
         $ambiguousClasses = [];
         foreach ($this->ambiguousClasses as $class => $paths) {
-            $paths = array_filter($paths, function ($path) use ($duplicatesFilter) {
+            $paths = array_filter($paths, function ($path) use ($duplicatesFilter): bool {
                 return !Preg::isMatch($duplicatesFilter, strtr($path, '\\', '/'));
             });
             if (\count($paths) > 0) {
diff -pruN 1.6.1-1/src/ClassMapGenerator.php 1.6.2-1/src/ClassMapGenerator.php
--- 1.6.1-1/src/ClassMapGenerator.php	2025-03-24 13:50:44.000000000 +0000
+++ 1.6.2-1/src/ClassMapGenerator.php	2025-08-20 18:52:43.000000000 +0000
@@ -280,7 +280,7 @@ class ClassMapGenerator
      * @param  string $path
      * @return bool
      */
-    private static function isAbsolutePath(string $path)
+    private static function isAbsolutePath(string $path): bool
     {
         return strpos($path, '/') === 0 || substr($path, 1, 1) === ':' || strpos($path, '\\\\') === 0;
     }
@@ -294,7 +294,7 @@ class ClassMapGenerator
      * @param  string $path Path to the file or directory
      * @return string
      */
-    private static function normalizePath(string $path)
+    private static function normalizePath(string $path): string
     {
         $parts = [];
         $path = strtr($path, '\\', '/');
diff -pruN 1.6.1-1/src/PhpFileCleaner.php 1.6.2-1/src/PhpFileCleaner.php
--- 1.6.1-1/src/PhpFileCleaner.php	2025-03-24 13:50:44.000000000 +0000
+++ 1.6.2-1/src/PhpFileCleaner.php	2025-08-20 18:52:43.000000000 +0000
@@ -53,11 +53,11 @@ class PhpFileCleaner
     public static function setTypeConfig(array $types): void
     {
         foreach ($types as $type) {
-            self::$typeConfig[$type[0]] = array(
+            self::$typeConfig[$type[0]] = [
                 'name' => $type,
                 'length' => \strlen($type),
                 'pattern' => '{.\b(?<![\$:>])'.$type.'\s++[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+}Ais',
-            );
+            ];
         }
 
         self::$restPattern = '{[^?"\'</'.implode('', array_keys(self::$typeConfig)).']+}A';
@@ -110,6 +110,7 @@ class PhpFileCleaner
                         $this->skipToNewline();
                         continue;
                     }
+
                     if ($this->peek('*')) {
                         $this->skipComment();
                         continue;
@@ -122,9 +123,7 @@ class PhpFileCleaner
                         \substr($this->contents, $this->index, $type['length']) === $type['name']
                         && Preg::isMatch($type['pattern'], $this->contents, $match, 0, $this->index - 1)
                     ) {
-                        $clean .= $match[0];
-
-                        return $clean;
+                        return $clean . $match[0];
                     }
                 }
 
@@ -161,10 +160,12 @@ class PhpFileCleaner
                 $this->index += 2;
                 continue;
             }
+
             if ($this->contents[$this->index] === $delimiter) {
                 $this->index += 1;
                 break;
             }
+
             $this->index += 1;
         }
     }
@@ -188,6 +189,7 @@ class PhpFileCleaner
             if ($this->contents[$this->index] === "\r" || $this->contents[$this->index] === "\n") {
                 return;
             }
+
             $this->index += 1;
         }
     }
@@ -214,6 +216,7 @@ class PhpFileCleaner
 
                         return;
                     }
+
                     break;
             }
 
diff -pruN 1.6.1-1/src/PhpFileParser.php 1.6.2-1/src/PhpFileParser.php
--- 1.6.1-1/src/PhpFileParser.php	2025-03-24 13:50:44.000000000 +0000
+++ 1.6.2-1/src/PhpFileParser.php	2025-08-20 18:52:43.000000000 +0000
@@ -12,6 +12,7 @@
 
 namespace Composer\ClassMapGenerator;
 
+use RuntimeException;
 use Composer\Pcre\Preg;
 
 /**
@@ -23,7 +24,7 @@ class PhpFileParser
      * Extract the classes in the given file
      *
      * @param  string            $path The file to check
-     * @throws \RuntimeException
+     * @throws RuntimeException
      * @return list<class-string> The found classes
      */
     public static function findClasses(string $path): array
@@ -31,8 +32,9 @@ class PhpFileParser
         $extraTypes = self::getExtraTypes();
 
         if (!function_exists('php_strip_whitespace')) {
-            throw new \RuntimeException('Classmap generation relies on the php_strip_whitespace function, but it has been disabled by the disable_functions directive.');
+            throw new RuntimeException('Classmap generation relies on the php_strip_whitespace function, but it has been disabled by the disable_functions directive.');
         }
+
         // Use @ here instead of Silencer to actively suppress 'unhelpful' output
         // @link https://github.com/composer/composer/pull/4886
         $contents = @php_strip_whitespace($path);
@@ -43,21 +45,23 @@ class PhpFileParser
                 $message = 'File at "%s" is not readable, check its permissions';
             } elseif ('' === trim((string) file_get_contents($path))) {
                 // The input file was really empty and thus contains no classes
-                return array();
+                return [];
             } else {
                 $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted';
             }
+
             $error = error_get_last();
             if (isset($error['message'])) {
                 $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message'];
             }
-            throw new \RuntimeException(sprintf($message, $path));
+
+            throw new RuntimeException(sprintf($message, $path));
         }
 
         // return early if there is no chance of matching anything in this file
         Preg::matchAllStrictGroups('{\b(?:class|interface|trait'.$extraTypes.')\s}i', $contents, $matches);
-        if (0 === \count($matches)) {
-            return array();
+        if ([] === $matches) {
+            return [];
         }
 
         $p = new PhpFileCleaner($contents, count($matches[0]));
@@ -71,22 +75,26 @@ class PhpFileParser
             )
         }ix', $contents, $matches);
 
-        $classes = array();
+        $classes = [];
         $namespace = '';
 
-        for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {
+        for ($i = 0, $len = count($matches['type']); $i < $len; ++$i) {
             if (isset($matches['ns'][$i]) && $matches['ns'][$i] !== '') {
-                $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', (string) $matches['nsname'][$i]) . '\\';
+                $namespace = str_replace([' ', "\t", "\r", "\n"], '', (string) $matches['nsname'][$i]) . '\\';
             } else {
                 $name = $matches['name'][$i];
                 assert(is_string($name));
                 // skip anon classes extending/implementing
-                if ($name === 'extends' || $name === 'implements') {
+                if ($name === 'extends') {
+                    continue;
+                }
+                if ($name === 'implements') {
                     continue;
                 }
+
                 if ($name[0] === ':') {
                     // This is an XHP class, https://github.com/facebook/xhp
-                    $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
+                    $name = 'xhp'.substr(str_replace(['-', ':'], ['_', '__'], $name), 1);
                 } elseif (strtolower((string) $matches['type'][$i]) === 'enum') {
                     // something like:
                     //   enum Foo: int { HERP = '123'; }
@@ -101,6 +109,7 @@ class PhpFileParser
                         $name = substr($name, 0, $colonPos);
                     }
                 }
+
                 /** @var class-string */
                 $className = ltrim($namespace . $name, '\\');
                 $classes[] = $className;
@@ -110,22 +119,18 @@ class PhpFileParser
         return $classes;
     }
 
-    /**
-     * @return string
-     */
     private static function getExtraTypes(): string
     {
         static $extraTypes = null;
 
         if (null === $extraTypes) {
             $extraTypes = '';
+            $extraTypesArray = [];
             if (PHP_VERSION_ID >= 80100 || (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>='))) {
                 $extraTypes .= '|enum';
+                $extraTypesArray = ['enum'];
             }
 
-            $extraTypesArray = array_filter(explode('|', $extraTypes), function (string $type) {
-                return $type !== '';
-            });
             PhpFileCleaner::setTypeConfig(array_merge(['class', 'interface', 'trait'], $extraTypesArray));
         }
 
@@ -140,7 +145,6 @@ class PhpFileParser
      *
      * @see Composer\Util\Filesystem::isReadable
      *
-     * @param  string $path
      * @return bool
      */
     private static function isReadable(string $path)
diff -pruN 1.6.1-1/tests/ClassMapGeneratorTest.php 1.6.2-1/tests/ClassMapGeneratorTest.php
--- 1.6.1-1/tests/ClassMapGeneratorTest.php	2025-03-24 13:50:44.000000000 +0000
+++ 1.6.2-1/tests/ClassMapGeneratorTest.php	2025-08-20 18:52:43.000000000 +0000
@@ -422,7 +422,7 @@ class ClassMapGeneratorTest extends Test
             if (!file_exists($unique) && @mkdir($unique, 0777)) {
                 return (string) realpath($unique);
             }
-        } while (--$attempts);
+        } while (--$attempts > 0);
 
         throw new \RuntimeException('Failed to create a unique temporary directory.');
     }
