comparison vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
39 if (!class_exists($className) || null === $methods = get_class_methods($className)) { 39 if (!class_exists($className) || null === $methods = get_class_methods($className)) {
40 // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class) 40 // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
41 return new UndefinedMethodException($message, $exception); 41 return new UndefinedMethodException($message, $exception);
42 } 42 }
43 43
44 $candidates = array(); 44 $candidates = [];
45 foreach ($methods as $definedMethodName) { 45 foreach ($methods as $definedMethodName) {
46 $lev = levenshtein($methodName, $definedMethodName); 46 $lev = levenshtein($methodName, $definedMethodName);
47 if ($lev <= strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) { 47 if ($lev <= \strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
48 $candidates[] = $definedMethodName; 48 $candidates[] = $definedMethodName;
49 } 49 }
50 } 50 }
51 51
52 if ($candidates) { 52 if ($candidates) {