get_declared_classes support for PHP 7.4
Overview
Ensure core use of get_declared_classes() function does not rely on it returning anonymous classes that have not been instantiated yet as part of support for PHP 7.4.
Reproduction steps
See https://www.php.net/manual/en/migration74.incompatible.php Need to confirm if this is an issue in following uses:
$ grep -R get_declared_classes ./*
./Civi/CiUtil/PHPUnitScanner.php: $origClasses = get_declared_classes();
./Civi/CiUtil/PHPUnitScanner.php: $newClasses = get_declared_classes();
./tests/phpunit/CiviTest/CiviTestSuite.php: $oldClassNames = get_declared_classes();
./tests/phpunit/CiviTest/CiviTestSuite.php: $newClassNames = get_declared_classes();
./tests/phpunit/CiviTest/CiviTestSuite.php: $oldClassNames = get_declared_classes();
./tests/phpunit/CiviTest/CiviTestSuite.php: $newClassNames = get_declared_classes();
Current behaviour
function exists in two files, as listed above.
Expected behaviour
Modify code if it depends on anonymous classes being returned even if they are not instantiated.
Environment information
PHP <7.4
Comments
This task is part of epic to support PHP 7.4. It might be simple to diagnose and close with no changes required to core.