str_replace('\\', '_',
$prefix.'\\'.
$namespacedClass),
];
if ($prefix) { $candidates =
array_filter($candidates,
fn ($candidate) =>
str_starts_with($candidate,
$prefix));
} // We cannot use the autoloader here as most of them use require; but if the class
// is not found, the new autoloader call will require the file again leading to a
// "cannot redeclare class" error.
foreach ($candidates as $candidate) { if ($this->
classExists($candidate)) { return $candidate;
} } // Symfony may ship some polyfills, like "Normalizer". But if the Intl
// extension is already installed, the next require_once will fail with
// a compile error because the class is already defined. And this one
// does not throw a Throwable. So it's better to skip it here.
if (str_contains($file, 'Resources/stubs'
)) { return null;
}