"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ClassNotFoundFatalErrorHandler.php  (phplist-3.4.5.tgz):ClassNotFoundFatalErrorHandler.php  (phplist-3.4.6.tgz)
skipping to change at line 36 skipping to change at line 36
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function handleError(array $error, FatalErrorException $exception) public function handleError(array $error, FatalErrorException $exception)
{ {
$messageLen = \strlen($error['message']); $messageLen = \strlen($error['message']);
$notFoundSuffix = '\' not found'; $notFoundSuffix = '\' not found';
$notFoundSuffixLen = \strlen($notFoundSuffix); $notFoundSuffixLen = \strlen($notFoundSuffix);
if ($notFoundSuffixLen > $messageLen) { if ($notFoundSuffixLen > $messageLen) {
return; return null;
} }
if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundS uffixLen)) { if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundS uffixLen)) {
return; return null;
} }
foreach (['class', 'interface', 'trait'] as $typeName) { foreach (['class', 'interface', 'trait'] as $typeName) {
$prefix = ucfirst($typeName).' \''; $prefix = ucfirst($typeName).' \'';
$prefixLen = \strlen($prefix); $prefixLen = \strlen($prefix);
if (0 !== strpos($error['message'], $prefix)) { if (0 !== strpos($error['message'], $prefix)) {
continue; continue;
} }
$fullyQualifiedClassName = substr($error['message'], $prefixLen, -$n otFoundSuffixLen); $fullyQualifiedClassName = substr($error['message'], $prefixLen, -$n otFoundSuffixLen);
skipping to change at line 74 skipping to change at line 74
if ($candidates) { if ($candidates) {
$tail = ' for e.g. "'.implode('", "', $candidates).'" or "'. $tail; $tail = ' for e.g. "'.implode('", "', $candidates).'" or "'. $tail;
} else { } else {
$tail = ' for "'.$tail; $tail = ' for "'.$tail;
} }
} }
$message .= "\nDid you forget a \"use\" statement".$tail; $message .= "\nDid you forget a \"use\" statement".$tail;
return new ClassNotFoundException($message, $exception); return new ClassNotFoundException($message, $exception);
} }
return null;
} }
/** /**
* Tries to guess the full namespace for a given class name. * Tries to guess the full namespace for a given class name.
* *
* By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
* autoloader (that should cover all common cases). * autoloader (that should cover all common cases).
* *
* @param string $class A class name (without its namespace) * @param string $class A class name (without its namespace)
* *
skipping to change at line 199 skipping to change at line 201
require_once $file; require_once $file;
} catch (\Throwable $e) { } catch (\Throwable $e) {
return null; return null;
} }
foreach ($candidates as $candidate) { foreach ($candidates as $candidate) {
if ($this->classExists($candidate)) { if ($this->classExists($candidate)) {
return $candidate; return $candidate;
} }
} }
return null;
} }
/** /**
* @param string $class * @param string $class
* *
* @return bool * @return bool
*/ */
private function classExists($class) private function classExists($class)
{ {
return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)