locating files in a directory for classes only with Laminas

Code
<?php

use Laminas\File\ClassFileLocator;

$dir 'laminas/laminas-file/src';

$locator = new ClassFileLocator($dir);

foreach (
$locator as $classFile) {
    echo 
$classFile->getFileName() . PHP_EOL;
}
Result
ClassFileLocator.php
PhpClassFile.php
ExceptionInterface.php
InvalidArgumentException.php
RuntimeException.php
BadMethodCallException.php
Transfer.php
ExceptionInterface.php
InvalidArgumentException.php
PhpEnvironmentException.php
RuntimeException.php
BadMethodCallException.php
FilterPluginManager.php
Http.php
ValidatorPluginManager.php
AbstractAdapter.php
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8