comparison vendor/psy/psysh/src/Formatter/CodeFormatter.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
35 throw new RuntimeException('Source code unavailable'); 35 throw new RuntimeException('Source code unavailable');
36 } 36 }
37 37
38 $colorMode = $colorMode ?: Configuration::COLOR_MODE_AUTO; 38 $colorMode = $colorMode ?: Configuration::COLOR_MODE_AUTO;
39 39
40 if ($reflector instanceof \ReflectionGenerator) {
41 $reflector = $reflector->getFunction();
42 }
43
44 if ($fileName = $reflector->getFileName()) { 40 if ($fileName = $reflector->getFileName()) {
45 if (!is_file($fileName)) { 41 if (!is_file($fileName)) {
46 throw new RuntimeException('Source code unavailable'); 42 throw new RuntimeException('Source code unavailable');
47 } 43 }
48 44
68 * @return bool 64 * @return bool
69 */ 65 */
70 private static function isReflectable(\Reflector $reflector) 66 private static function isReflectable(\Reflector $reflector)
71 { 67 {
72 return $reflector instanceof \ReflectionClass || 68 return $reflector instanceof \ReflectionClass ||
73 $reflector instanceof \ReflectionFunctionAbstract || 69 $reflector instanceof \ReflectionFunctionAbstract;
74 $reflector instanceof \ReflectionGenerator;
75 } 70 }
76 } 71 }