Update dependencies

This commit is contained in:
Chris Hunt
2024-02-16 21:36:54 +00:00
parent 22d7a59e59
commit d52ae0d3c3
9569 changed files with 460443 additions and 282416 deletions

View File

@@ -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;
}

View File

@@ -19,9 +19,6 @@ use Symfony\Component\ErrorHandler\Error\UndefinedFunctionError;
*/
class UndefinedFunctionErrorEnhancer implements ErrorEnhancerInterface
{
/**
* {@inheritdoc}
*/
public function enhance(\Throwable $error): ?\Throwable
{
if ($error instanceof FatalError) {
@@ -42,7 +39,7 @@ class UndefinedFunctionErrorEnhancer implements ErrorEnhancerInterface
$prefix = 'Call to undefined function ';
$prefixLen = \strlen($prefix);
if (0 !== strpos($message, $prefix)) {
if (!str_starts_with($message, $prefix)) {
return null;
}

View File

@@ -19,9 +19,6 @@ use Symfony\Component\ErrorHandler\Error\UndefinedMethodError;
*/
class UndefinedMethodErrorEnhancer implements ErrorEnhancerInterface
{
/**
* {@inheritdoc}
*/
public function enhance(\Throwable $error): ?\Throwable
{
if ($error instanceof FatalError) {
@@ -47,7 +44,7 @@ class UndefinedMethodErrorEnhancer implements ErrorEnhancerInterface
$candidates = [];
foreach ($methods as $definedMethodName) {
$lev = levenshtein($methodName, $definedMethodName);
if ($lev <= \strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
if ($lev <= \strlen($methodName) / 3 || str_contains($definedMethodName, $methodName)) {
$candidates[] = $definedMethodName;
}
}