Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/debug/DebugClassLoader.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
231 } | 231 } |
232 | 232 |
233 // Detect annotations on the class | 233 // Detect annotations on the class |
234 if (false !== $doc = $refl->getDocComment()) { | 234 if (false !== $doc = $refl->getDocComment()) { |
235 foreach (['final', 'deprecated', 'internal'] as $annotation) { | 235 foreach (['final', 'deprecated', 'internal'] as $annotation) { |
236 if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) { | 236 if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) { |
237 self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; | 237 self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
256 // Detect if the parent is annotated | 256 // Detect if the parent is annotated |
257 foreach ($parentAndOwnInterfaces + \class_uses($class, false) as $use) { | 257 foreach ($parentAndOwnInterfaces + \class_uses($class, false) as $use) { |
258 if (!isset(self::$checkedClasses[$use])) { | 258 if (!isset(self::$checkedClasses[$use])) { |
259 $this->checkClass($use); | 259 $this->checkClass($use); |
260 } | 260 } |
261 if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) { | 261 if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) { |
262 $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); | 262 $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); |
263 $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); | 263 $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); |
264 | 264 |
265 $deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s.', $class, $type, $verb, $use, self::$deprecated[$use]); | 265 $deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s.', $class, $type, $verb, $use, self::$deprecated[$use]); |
266 } | 266 } |
305 if (false === $doc = $method->getDocComment()) { | 305 if (false === $doc = $method->getDocComment()) { |
306 continue; | 306 continue; |
307 } | 307 } |
308 | 308 |
309 foreach (['final', 'internal'] as $annotation) { | 309 foreach (['final', 'internal'] as $annotation) { |
310 if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) { | 310 if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) { |
311 $message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; | 311 $message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : ''; |
312 self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message]; | 312 self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message]; |
313 } | 313 } |
314 } | 314 } |
315 } | 315 } |
387 } | 387 } |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 $dirFiles = self::$darwinCache[$kDir][1]; | 391 $dirFiles = self::$darwinCache[$kDir][1]; |
392 | |
393 if (!isset($dirFiles[$file]) && ') : eval()\'d code' === substr($file, -17)) { | |
394 // Get the file name from "file_name.php(123) : eval()'d code" | |
395 $file = substr($file, 0, strrpos($file, '(', -17)); | |
396 } | |
392 | 397 |
393 if (isset($dirFiles[$file])) { | 398 if (isset($dirFiles[$file])) { |
394 return $real .= $dirFiles[$file]; | 399 return $real .= $dirFiles[$file]; |
395 } | 400 } |
396 | 401 |