8000 Fixes · symfony/symfony@f3bb16a · GitHub
[go: up one dir, main page]

Skip to content

Commit f3bb16a

Browse files
committed
Fixes
1 parent ea53d22 commit f3bb16a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines c 8000 hanged

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,26 +178,22 @@ public function loadClass($class)
178178
self::$finalMethods[$name] = $parent && isset(self::$finalMethods[$parent]) ? self::$finalMethods[$parent] : array();
179179

180180
foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) {
181-
// It's not the declaring class
182181
if ($method->class !== $name) {
183182
continue;
184183
}
185184

186185
if ($parent && isset(self::$finalMethods[$parent][$method->name])) {
187-
// Fetch the real class declaring the parent method
188-
$prototype = $method->getPrototype();
189-
190-
@trigger_error(sprintf('The %s::%s() method is considered final%s. It may change without further notice as of its next major version. You should not extend it from %s.', $prototype->class, $method->name, self::$finalMethods[$parent][$method->name], $name), E_USER_DEPRECATED);
186+
@trigger_error(sprintf('%s It may change without further notice as of its next major version. You should not extend it from %s.', self::$finalMethods[$parent][$method->name], $name), E_USER_DEPRECATED);
191187
}
192188

193189
$doc = $method->getDocComment();
194-
// No @final annotation
195190
if (false === $doc || false === strpos($doc, '@final')) {
196191
continue;
197192
}
198193

199194
if (preg_match('#\n\s+\* @final(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
200-
self::$finalMethods[$name][$method->name] = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
195+
$message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
196+
self::$finalMethods[$name][$method->name] = sprintf('The %s::%s() method is considered final%s.', $name, $method->name, $message);
201197
}
202198
}
203199

0 commit comments

Comments
 (0)
0