mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-10 00:43:50 +09:00
Update dependencies
This commit is contained in:
@@ -21,9 +21,6 @@ use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
*/
|
||||
class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(\Throwable $error): ?\Throwable
|
||||
{
|
||||
// Some specific versions of PHP produce a fatal error when extending a not found class.
|
||||
@@ -110,7 +107,8 @@ class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
|
||||
|
||||
private function findClassInPath(string $path, string $class, string $prefix): array
|
||||
{
|
||||
if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
|
||||
$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path);
|
||||
if (!$path || !is_dir($path)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -143,7 +141,7 @@ class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
|
||||
];
|
||||
|
||||
if ($prefix) {
|
||||
$candidates = array_filter($candidates, function ($candidate) use ($prefix) { return 0 === strpos($candidate, $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
|
||||
@@ -155,9 +153,17 @@ class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
try {
|
||||
require_once $file;
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user